Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
9edfb210
Commit
9edfb210
authored
Apr 09, 2013
by
Zachary Tong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial base for bullseye feature
parent
37161ba3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
7 deletions
+67
-7
panels/map2/display/bullseye.js
+43
-0
panels/map2/module.html
+5
-0
panels/map2/module.js
+19
-7
No files found.
panels/map2/display/bullseye.js
0 → 100644
View file @
9edfb210
function
displayBullseye
(
scope
,
projection
,
path
)
{
var
arc
=
d3
.
svg
.
arc
()
.
innerRadius
(
5
)
.
outerRadius
(
10
)
.
startAngle
(
0
)
//converting from degs to radians
.
endAngle
(
2
*
Math
.
PI
)
//just radians
var
coords
=
projection
([
parseFloat
(
scope
.
panel
.
display
.
bullseye
.
coord
.
lon
),
parseFloat
(
scope
.
panel
.
display
.
bullseye
.
coord
.
lat
)]);
var
circle
=
d3
.
geo
.
circle
();
var
data
=
[
{
lat
:
parseFloat
(
scope
.
panel
.
display
.
bullseye
.
coord
.
lat
),
lon
:
parseFloat
(
scope
.
panel
.
display
.
bullseye
.
coord
.
lon
)}
];
scope
.
g
.
selectAll
(
"arc"
)
.
data
(
data
)
.
enter
().
append
(
"path"
)
.
datum
(
function
(
d
)
{
console
.
log
(
d
);
return
circle
.
origin
([
d
.
lon
,
d
.
lat
]).
angle
(
1
)();
})
.
attr
(
"d"
,
path
)
.
attr
(
"class"
,
"arc"
);
/*
scope.g.append("path")
.attr("d", arc)
.attr("transform", "translate(" + coords[0] + "," + coords[1] + ")");
scope.g
.append("circle")
.attr("r", 1)
.attr("opacity", 1)
.attr("transform", "translate(" + coords[0] + "," + coords[1] + ")");
*/
}
\ No newline at end of file
panels/map2/module.html
View file @
9edfb210
...
@@ -32,6 +32,11 @@
...
@@ -32,6 +32,11 @@
.q8
{
fill
:
rgb
(
8
,
81
,
156
);
}
.q8
{
fill
:
rgb
(
8
,
81
,
156
);
}
.q9
{
fill
:
rgb
(
8
,
48
,
107
);
}
.q9
{
fill
:
rgb
(
8
,
48
,
107
);
}
.arc
{
stroke
:
#f00
;
stroke-width
:
.5px
;
fill
:
none
;
}
</style>
</style>
<span
ng-show=
"panel.spyable"
style=
"position:absolute;right:0px;top:0px"
class=
'panelextra pointer'
>
<span
ng-show=
"panel.spyable"
style=
"position:absolute;right:0px;top:0px"
class=
'panelextra pointer'
>
<i
bs-modal=
"'partials/modal.html'"
class=
"icon-eye-open"
></i>
<i
bs-modal=
"'partials/modal.html'"
class=
"icon-eye-open"
></i>
...
...
panels/map2/module.js
View file @
9edfb210
...
@@ -36,7 +36,12 @@ angular.module('kibana.map2', [])
...
@@ -36,7 +36,12 @@ angular.module('kibana.map2', [])
enabled
:
false
enabled
:
false
},
},
bullseye
:
{
bullseye
:
{
enabled
:
false
enabled
:
false
,
coord
:
{
lat
:
0
,
lon
:
0
},
}
}
},
},
displayTabs
:
[
"Geopoints"
,
"Binning"
,
"Choropleth"
,
"Bullseye"
,
"Data"
],
displayTabs
:
[
"Geopoints"
,
"Binning"
,
"Choropleth"
,
"Bullseye"
,
"Data"
],
...
@@ -206,7 +211,8 @@ angular.module('kibana.map2', [])
...
@@ -206,7 +211,8 @@ angular.module('kibana.map2', [])
.
script
(
"panels/map2/lib/d3.hexbin.v0.min.js"
)
.
script
(
"panels/map2/lib/d3.hexbin.v0.min.js"
)
.
script
(
"panels/map2/lib/queue.v1.min.js"
)
.
script
(
"panels/map2/lib/queue.v1.min.js"
)
.
script
(
"panels/map2/display/binning.js"
)
.
script
(
"panels/map2/display/binning.js"
)
.
script
(
"panels/map2/display/geopoints.js"
);
.
script
(
"panels/map2/display/geopoints.js"
)
.
script
(
"panels/map2/display/bullseye.js"
);
// Populate element. Note that jvectormap appends, does not replace.
// Populate element. Note that jvectormap appends, does not replace.
scripts
.
wait
(
function
()
{
scripts
.
wait
(
function
()
{
...
@@ -243,15 +249,16 @@ angular.module('kibana.map2', [])
...
@@ -243,15 +249,16 @@ angular.module('kibana.map2', [])
var
width
=
$
(
elem
[
0
]).
width
(),
var
width
=
$
(
elem
[
0
]).
width
(),
height
=
$
(
elem
[
0
]).
height
();
height
=
$
(
elem
[
0
]).
height
();
//scale to whichever dimension is smaller, helps to ensure the whole map is displayed
//scale to whichever dimension is smaller, helps to ensure the whole map is displayed
var
scale
=
(
width
>
height
)
?
(
height
/
2
/
Math
.
PI
)
:
(
width
/
2
/
Math
.
PI
);
var
scale
=
(
width
>
height
)
?
(
height
/
5
)
:
(
width
/
5
);
/**
/**
* D3 and general config section
* D3 and general config section
*/
*/
var
projection
=
d3
.
geo
.
mercator
()
var
projection
=
d3
.
geo
.
mercator
()
.
translate
([
0
,
0
])
.
translate
([
width
/
2
,
height
/
2
])
.
scale
(
scale
);
.
scale
(
scale
);
var
zoom
=
d3
.
behavior
.
zoom
()
var
zoom
=
d3
.
behavior
.
zoom
()
...
@@ -310,10 +317,9 @@ angular.module('kibana.map2', [])
...
@@ -310,10 +317,9 @@ angular.module('kibana.map2', [])
//where countries are
//where countries are
scope
.
svg
.
append
(
"rect"
)
scope
.
svg
.
append
(
"rect"
)
.
attr
(
"class"
,
"overlay"
)
.
attr
(
"class"
,
"overlay"
)
.
attr
(
"x"
,
-
width
/
2
)
.
attr
(
"y"
,
-
height
/
2
)
.
attr
(
"width"
,
width
)
.
attr
(
"width"
,
width
)
.
attr
(
"height"
,
height
);
.
attr
(
"height"
,
height
)
.
attr
(
"transform"
,
"translate("
+
width
/
2
+
","
+
height
/
2
+
")"
);
//Draw the countries, if this is a choropleth, draw with fancy colors
//Draw the countries, if this is a choropleth, draw with fancy colors
scope
.
g
.
selectAll
(
"path"
)
scope
.
g
.
selectAll
(
"path"
)
...
@@ -342,6 +348,7 @@ angular.module('kibana.map2', [])
...
@@ -342,6 +348,7 @@ angular.module('kibana.map2', [])
//Hexagonal Binning
//Hexagonal Binning
if
(
scope
.
panel
.
display
.
binning
.
enabled
)
{
if
(
scope
.
panel
.
display
.
binning
.
enabled
)
{
//@todo fix this
var
dimensions
=
[
width
,
height
];
var
dimensions
=
[
width
,
height
];
displayBinning
(
scope
,
dimensions
,
projection
);
displayBinning
(
scope
,
dimensions
,
projection
);
}
}
...
@@ -351,6 +358,10 @@ angular.module('kibana.map2', [])
...
@@ -351,6 +358,10 @@ angular.module('kibana.map2', [])
displayGeopoints
(
scope
);
displayGeopoints
(
scope
);
}
}
if
(
scope
.
panel
.
display
.
bullseye
.
enabled
)
{
displayBullseye
(
scope
,
projection
,
path
);
}
/**
/**
* Zoom Functionality
* Zoom Functionality
...
@@ -373,6 +384,7 @@ angular.module('kibana.map2', [])
...
@@ -373,6 +384,7 @@ angular.module('kibana.map2', [])
scope
.
g
.
style
(
"stroke-width"
,
1
/
s
).
attr
(
"transform"
,
"translate("
+
t
+
")scale("
+
s
+
")"
);
scope
.
g
.
style
(
"stroke-width"
,
1
/
s
).
attr
(
"transform"
,
"translate("
+
t
+
")scale("
+
s
+
")"
);
}
}
}
}
}
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment