The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/panels/map2/display/bullseye.js

28 lines
657 B

/**
* Renders bullseyes as geo-json poly gon entities
* Allows for them to clip on spheres correctly
*/
function displayBullseye(scope, dr) {
var degrees = 180 / Math.PI
var circle = d3.geo.circle();
var data = [];
if (scope.panel.display.bullseye.enabled) {
data = [
circle.origin(parseFloat(scope.panel.display.bullseye.coord.lat), parseFloat(scope.panel.display.bullseye.coord.lon)).angle(1000 / 6371 * degrees)()
];
}
var arcs = dr.g.selectAll(".arc")
.data(data);
arcs.enter().append("path")
.attr("d", dr.path)
.attr("class", "arc");
arcs.exit().remove();
}