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
9a91a494
Commit
9a91a494
authored
Apr 18, 2013
by
Zachary Tong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix clipping issues with geopoints on sphere
parent
25938054
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
24 deletions
+37
-24
panels/map2/display/geopoints.js
+19
-8
panels/map2/module.js
+18
-16
No files found.
panels/map2/display/geopoints.js
View file @
9a91a494
...
...
@@ -2,29 +2,40 @@
* Renders geopoints as geo-json poly gon entities
* Allows for them to clip on spheres correctly
*/
function
displayGeopoints
(
scope
,
dr
,
path
)
{
function
displayGeopoints
(
scope
,
dr
)
{
var
points
=
[];
var
circle
=
d3
.
geo
.
circle
();
var
degrees
=
180
/
Math
.
PI
if
(
scope
.
panel
.
display
.
geopoints
.
enabled
)
{
points
=
dr
.
points
;
//points = dr.points;
points
=
_
.
map
(
dr
.
points
,
function
(
v
)
{
return
{
type
:
"Point"
,
coordinates
:
[
v
[
0
],
v
[
1
]]
};
});
}
dr
.
geopoints
=
dr
.
g
.
selectAll
(
"path.geopoint"
)
.
data
(
points
);
var
geopoints
=
dr
.
g
.
selectAll
(
".geopoint"
)
.
data
(
points
);
geopoints
.
enter
().
append
(
"path"
)
dr
.
geopoints
.
enter
().
append
(
"path"
)
/*
.datum(function(d) {
return circle.origin([d[0], d[1]]).angle(scope.panel.display.geopoints.pointSize / 6371 * degrees)();
})
.
attr
(
"d"
,
path
)
.
attr
(
"class"
,
"geopoint"
);
*/
.
attr
(
"class"
,
"geopoint"
)
.
attr
(
"d"
,
dr
.
path
);
geopoints
.
exit
().
remove
();
dr
.
geopoints
.
exit
().
remove
();
...
...
panels/map2/module.js
View file @
9a91a494
...
...
@@ -339,15 +339,8 @@ angular.module('kibana.map2', [])
}
var
path
=
d3
.
geo
.
path
()
.
projection
(
dr
.
projection
);
//Special fix for when the user changes from mercator -> orthographic
//The globe won't redraw automatically, we need to force it
if
(
scope
.
panel
.
display
.
data
.
type
===
'orthographic'
)
{
dr
.
svg
.
selectAll
(
"path"
).
attr
(
"d"
,
path
);
}
dr
.
path
=
d3
.
geo
.
path
()
.
projection
(
dr
.
projection
).
pointRadius
(
0.2
);
console
.
log
(
scope
.
data
);
...
...
@@ -364,8 +357,6 @@ angular.module('kibana.map2', [])
return
dr
.
projection
(
coords
);
});
dr
.
svg
.
select
(
".overlay"
).
remove
();
dr
.
svg
.
append
(
"rect"
)
...
...
@@ -387,7 +378,7 @@ angular.module('kibana.map2', [])
return
'land'
;
}
})
.
attr
(
"d"
,
path
);
.
attr
(
"d"
,
dr
.
path
);
countryPath
.
exit
().
remove
();
...
...
@@ -399,9 +390,20 @@ angular.module('kibana.map2', [])
.
on
(
"drag"
,
function
()
{
if
(
scope
.
keylistener
.
keyActive
(
17
))
{
dr
.
projection
.
rotate
([
d3
.
event
.
x
/
2
,
-
d3
.
event
.
y
/
2
,
dr
.
projection
.
rotate
()[
2
]]);
dr
.
svg
.
selectAll
(
"path"
).
attr
(
"d"
,
path
);
//dr.svg.selectAll("path").attr("d", dr.path);
dr
.
g
.
selectAll
(
"path"
).
attr
(
"d"
,
dr
.
path
);
}
}));
}));
}
//Special fix for when the user changes from mercator -> orthographic
//The globe won't redraw automatically, we need to force it
if
(
scope
.
panel
.
display
.
data
.
type
===
'orthographic'
)
{
//dr.svg.selectAll("path").attr("d", dr.path);
}
...
...
@@ -413,8 +415,8 @@ angular.module('kibana.map2', [])
//@todo fix this
var
dimensions
=
[
width
,
height
];
displayBinning
(
scope
,
dr
,
dimensions
);
displayGeopoints
(
scope
,
dr
,
path
);
displayBullseye
(
scope
,
dr
,
path
);
displayGeopoints
(
scope
,
dr
);
displayBullseye
(
scope
,
dr
);
...
...
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