Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
marcus-lodspeakr
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
uib-ub
Spesialsamlingene
marcus-lodspeakr
Commits
1c04395d
Commit
1c04395d
authored
12 years ago
by
alvaro
Browse files
Options
Downloads
Patches
Plain Diff
Added D3RadarChart to visualization filters
parent
ff8e029a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/examples/originalComponents/static/admin/js/editor.js
+2
-1
2 additions, 1 deletion
doc/examples/originalComponents/static/admin/js/editor.js
lib/Haanga/lib/Haanga/Extension/Filter/D3radarchart.php
+71
-0
71 additions, 0 deletions
lib/Haanga/lib/Haanga/Extension/Filter/D3radarchart.php
with
73 additions
and
1 deletion
doc/examples/originalComponents/static/admin/js/editor.js
+
2
−
1
View file @
1c04395d
...
@@ -49,6 +49,7 @@ $(document).ready(function(){
...
@@ -49,6 +49,7 @@ $(document).ready(function(){
{
name
:
'
D3ForceGraph
'
,
params
:
"
sourceNode,TargetNode
"
,
img
:
"
graph.png
"
},
{
name
:
'
D3ForceGraph
'
,
params
:
"
sourceNode,TargetNode
"
,
img
:
"
graph.png
"
},
{
name
:
'
D3ParallelCoordinates
'
,
params
:
"
label,value1,value2,...,valueN
"
,
img
:
"
parallelcoordinates.png
"
},
{
name
:
'
D3ParallelCoordinates
'
,
params
:
"
label,value1,value2,...,valueN
"
,
img
:
"
parallelcoordinates.png
"
},
{
name
:
'
D3WordCloud
'
,
params
:
[
"
variableWithFreeText
"
,
"
phraseVariable,sizeOfPhrase
"
,
"
phraseVariable,sizeOfPhrase,linkOnEachPhrase
"
],
img
:
"
wordcloud.png
"
},
{
name
:
'
D3WordCloud
'
,
params
:
[
"
variableWithFreeText
"
,
"
phraseVariable,sizeOfPhrase
"
,
"
phraseVariable,sizeOfPhrase,linkOnEachPhrase
"
],
img
:
"
wordcloud.png
"
},
{
name
:
'
D3RadarChart
'
,
params
:
"
value1,value2,value3,...,valueN
"
,
img
:
"
radar.png
"
},
{
name
:
'
GoogleMaps
'
,
params
:
"
latitude,longitude,label
"
,
img
:
"
maps.png
"
},
{
name
:
'
GoogleMaps
'
,
params
:
"
latitude,longitude,label
"
,
img
:
"
maps.png
"
},
{
name
:
'
GoogleVizBarChart
'
,
params
:
"
valuesInAxisX,valuesInAxisY
"
,
img
:
"
barchart.png
"
},
{
name
:
'
GoogleVizBarChart
'
,
params
:
"
valuesInAxisX,valuesInAxisY
"
,
img
:
"
barchart.png
"
},
{
name
:
'
GoogleVizColumnChart
'
,
params
:
"
valuesInAxisX,valuesInAxisY
"
,
img
:
"
columnchart.png
"
},
{
name
:
'
GoogleVizColumnChart
'
,
params
:
"
valuesInAxisX,valuesInAxisY
"
,
img
:
"
columnchart.png
"
},
...
@@ -82,7 +83,7 @@ $(document).ready(function(){
...
@@ -82,7 +83,7 @@ $(document).ready(function(){
}
}
}
}
}
}
var
visualFilter
=
'
<h3>
'
+
$
(
this
).
html
()
+
'
</h3>
'
+
examples
+
'
<img src="img/
'
+
$
(
this
).
attr
(
"
data-img
"
)
+
'
"/>
'
;
tip
.
html
(
visualFilter
).
animate
({
opacity
:
.
95
},
20
)})
var
visualFilter
=
'
<h3>
'
+
$
(
this
).
html
()
+
'
</h3>
'
+
examples
+
'
<img
style="max-width:200px;max-height:150px"
src="img/
'
+
$
(
this
).
attr
(
"
data-img
"
)
+
'
"/>
'
;
tip
.
html
(
visualFilter
).
animate
({
opacity
:
.
95
},
20
)})
.
on
(
'
mouseleave
'
,
function
(){
tip
.
animate
({
opacity
:
'
0
'
},
20
)});
.
on
(
'
mouseleave
'
,
function
(){
tip
.
animate
({
opacity
:
'
0
'
},
20
)});
//Create Template and Query Editor
//Create Template and Query Editor
var
templateEditor
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
'
template-editor
'
),
{
mode
:
'
mustache
'
,
var
templateEditor
=
CodeMirror
.
fromTextArea
(
document
.
getElementById
(
'
template-editor
'
),
{
mode
:
'
mustache
'
,
...
...
This diff is collapsed.
Click to expand it.
lib/Haanga/lib/Haanga/Extension/Filter/D3radarchart.php
0 → 100644
+
71
−
0
View file @
1c04395d
<?php
class
Haanga_Extension_Filter_D3RadarChart
{
public
$is_safe
=
TRUE
;
static
function
main
(
$obj
,
$varname
){
$nodesArr
=
array
();
$n
=
0
;
$first
=
""
;
$nodes
=
array
();
$links
=
array
();
$names
=
explode
(
","
,
$varname
);
$varList
=
array
();
$randId
=
uniqid
(
"_ID_"
);
foreach
(
$names
as
$v
){
if
(
strpos
(
$v
,
"="
)){
break
;
}
$variable
[
'name'
]
=
$v
;
$variable
[
'value'
]
=
'value'
;
if
(
strpos
(
$v
,
"."
)){
$aux
=
explode
(
"."
,
$v
);
$variable
[
'name'
]
=
$aux
[
0
];
$variable
[
'value'
]
=
$aux
[
1
];
}
$fieldCounter
++
;
$columnType
=
'number'
;
if
(
$firstColumn
){
$columnType
=
'string'
;
$firstColumn
=
false
;
}
array_push
(
$varList
,
$variable
);
}
//options
$options
=
array
();
$options
[
'width'
]
=
400
;
$options
[
'height'
]
=
400
;
for
(
$z
=
$fieldCounter
;
$z
<
count
(
$names
);
$z
++
){
$pair
=
explode
(
"="
,
$names
[
$z
]);
$key
=
trim
(
$pair
[
0
],
"
\"
'"
);
$value
=
trim
(
$pair
[
1
],
"
\"
'"
);
$options
[
$key
]
=
$value
;
}
$optionJson
=
json_encode
(
$options
);
$rows
=
array
();
foreach
(
$obj
as
$k
){
$row
=
array
();
foreach
(
$varList
as
$v
){
$variable
=
$v
[
'name'
];
$val
=
$v
[
'value'
];
$row
[]
=
array
(
'axis'
=>
$variable
,
'value'
=>
floatval
(
$k
->
$variable
->
$val
));
}
array_push
(
$rows
,
$row
);
}
$json
=
$rows
;
$pre
=
'<div id="'
.
$randId
.
'"></div>
<script src="http://d3js.org/d3.v2.min.js?2.9.3"></script>
<script src="https://raw.github.com/alangrafu/radar-chart-d3/master/src/radar-chart-min.js"></script>
<script>
var jsonD3'
.
$randId
.
' = '
.
json_encode
(
$json
)
.
';
options'
.
$randId
.
' = '
.
$optionJson
.
';
RadarChart.draw("#'
.
$randId
.
'", jsonD3'
.
$randId
.
', options'
.
$randId
.
');
</script>'
;
return
$pre
.
$post
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment