From b7a5afcbd3bd16dd7be592fd5a4fae39401559aa Mon Sep 17 00:00:00 2001 From: Zachary Tong Date: Fri, 5 Apr 2013 11:51:03 -0400 Subject: [PATCH] Geopoint settings --- panels/map2/editor.html | 165 +++++++++++++++++++++++++--------------- panels/map2/module.js | 37 +++++---- 2 files changed, 123 insertions(+), 79 deletions(-) diff --git a/panels/map2/editor.html b/panels/map2/editor.html index b5e9d3afc36..70a3bfc63d2 100644 --- a/panels/map2/editor.html +++ b/panels/map2/editor.html @@ -1,75 +1,120 @@ -
+ +
- The map panel uses 2 letter country or US state codes to plot concentrations on a map. Darker terroritories mean more records matched that area. If multiple queries are sent from a single panel the first query will be displayed + The map panel uses 2 letter country or US state codes to plot concentrations + on a map. Darker terroritories mean more records matched that area. If + multiple queries are sent from a single panel the first query will be + displayed
-
+
-
+
-
-
Field
- -
+
+
Field
+ +
+
-
-
Query
- - -
+
+
Query
+
-
Map
- -
-
-
-
+
+
Map
+
+
+ +
+

Display Options

-
- - -
- + --> -
- - - - - - - - -
- - - - - -
-
-
-
- -
Panel Spy
-
-
- +
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + +
Geopoints + +
Point size + +
Point Transparency + +
Autosizing + +
+
+
+
+ +
Panel Spy
+ +
+
+ +
+
- The panel spy shows 'behind the scenes' information about a panel. It can - be accessed by clicking the in the top right - of the panel. + The panel spy shows 'behind the scenes' information about a panel. It can be + accessed by clicking the in the top right of the panel.
-
+
\ No newline at end of file diff --git a/panels/map2/module.js b/panels/map2/module.js index c55fef9ebeb..0fc4f1c3a88 100644 --- a/panels/map2/module.js +++ b/panels/map2/module.js @@ -14,7 +14,9 @@ angular.module('kibana.map2', []) display: { geopoints: { enabled: true, - enabledText: "Enabled" + enabledText: "Enabled", + pointSize: 1, + pointAlpha: 0.6 }, binning: { @@ -221,6 +223,8 @@ angular.module('kibana.map2', []) return projection([decoded.longitude, decoded.latitude]); }); + + var color = d3.scale.linear() .domain([0, 20]) .range(["white", "steelblue"]) @@ -245,27 +249,22 @@ angular.module('kibana.map2', []) }) .attr("opacity", 1); - /* + /* raw geopoints */ - raw, ugly points - */ + if (scope.panel.display.geopoints.enabled) { - var points = _.map(scope.data, function (k, v) { - var decoded = geohash.decode(v); - return { - lat: decoded.latitude, - lon: decoded.longitude - }; - }); - g.selectAll("circles.points") - .data(points) - .enter() - .append("circle") - .attr("r", 1) - .attr("transform", function (d) { - return "translate(" + projection([d.lon, d.lat]) + ")"; - }); + g.selectAll("circles.points") + .data(points) + .enter() + .append("circle") + .attr("r", scope.panel.display.geopoints.pointSize) + .attr("opacity", scope.panel.display.geopoints.pointAlpha) + .attr("transform", function (d) { + return "translate(" + d[0] + "," + d[1] + ")"; + }); + } + });