Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tilemap heatmap #3830

Merged
merged 53 commits into from
May 18, 2015
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
0ff21e1
add heatmap to map types
Apr 9, 2015
b6c9b8a
add leaflet.heat
Apr 9, 2015
c108cdf
fixed require config for heat
Apr 9, 2015
084eb85
add method to normalize data for heatmap
Apr 9, 2015
29868ac
add metric type to goeJson properties, add normalize checkbox to heat…
Apr 10, 2015
a80a48d
added metric type and field to geojson, added method to getMinMax fro…
Apr 13, 2015
83d291d
namespaced leafle-heat, removed class on ng-X divs, removed a console…
Apr 14, 2015
908c5d4
removed console.log
Apr 15, 2015
ee04ac2
fixed conflict
Apr 15, 2015
0f4b2e8
removed ng-X classes, changed to sliders for heat param inputs, hintb…
Apr 15, 2015
1265669
remove heatmap popups checkbox and heatMapPoints method
Apr 17, 2015
1ebdd18
add bounds of gehash grid to features for heatmap popups
Apr 17, 2015
f8ffd3c
add method to find feature by latlng and display tooltip on heatmap
Apr 17, 2015
cf71ffd
added scale for pad on feature bounds based on precision, updated a c…
Apr 17, 2015
ecb0fcf
changed heatmap tooltip to find nearest feature
Apr 20, 2015
bdefe0b
add latLngs to mapData when heatmap created to improve tooltip perfor…
Apr 20, 2015
2b5adc2
fix conflict
Apr 20, 2015
3dee5d5
add param for leafletPopup to get tooltip formatter
Apr 21, 2015
c743758
removed popup events from all map types, removed pointer events in cs…
Apr 21, 2015
bad16ca
removed popup events from all map types, removed pointer events in cs…
Apr 21, 2015
22ba072
Merge branch 'master' into tilemap-heatmap
Apr 21, 2015
bb65a17
removed an unused method, added method for mouseMove, fixed fatal err…
Apr 22, 2015
05c518c
fixed default value for heatMaxZoom to be 16
Apr 22, 2015
30c8b27
removed comment changed var name
Apr 22, 2015
b008449
added many tests, fixed a couple of methods related to heatmap due to…
Apr 24, 2015
69c1e28
Merge branch 'master' into tilemap-heatmap
Apr 24, 2015
459bab4
removed pinMarkers method and mapType for Pins from tests
Apr 24, 2015
394852a
added comment to tilemap.less
Apr 24, 2015
665325a
revised _tilemap.less, removed heatLegende method and css, added note…
Apr 24, 2015
32064f4
updated tooltipProximity zoomScale to improve tooltip display at all …
Apr 28, 2015
b787e12
updated _tilemap.less and geojson formatter for leaflet popups to loo…
Apr 28, 2015
e1c9014
Merge branch 'master' into tilemap-heatmap
Apr 28, 2015
9f4b405
removed methods, formatter, styles, params related to #3717 tilemap-t…
Apr 30, 2015
11f09a0
removed methods, params, etc related to #3713 tilemap-zoom-precision
Apr 30, 2015
93478d8
Merge branch 'master' into tilemap-heatmap
Apr 30, 2015
91c3e95
cleanup changes unrelated to heatmap
Apr 30, 2015
84c807d
Merge branch 'master' into tilemap-heatmap
May 4, 2015
429a5ff
change method to clear layers to work for all mapTypes
May 5, 2015
cd6cfa4
changed features to featureLayer to be consistent
May 5, 2015
b4ff312
consistent naming of method params and returned objects
May 5, 2015
e238894
removed geojson property that was not used, applied addLatLng method …
May 6, 2015
b44b1a3
added nearestFeature tooltip to heatmap
May 7, 2015
25c4a8f
removed console.log from test
May 7, 2015
2714340
Merge branch 'master' into tilemap-heatmap
May 7, 2015
997fb35
modified some tests, moved vars to beforeEach, simplified method for …
May 8, 2015
3214ac8
Merge branch 'master' into tilemap-heatmap
May 8, 2015
2bf8b0e
update _tilemap.less to style leaflet tooltip like the kibana tooltip
May 8, 2015
ec74972
Fix merge conflicts
May 13, 2015
9f6ac49
Use the same tooltip for all map type, remove normalize
May 13, 2015
44cb38e
Change tests to return a string instead of the input object
May 13, 2015
e167f29
Fix fitBounds
May 15, 2015
3aedf20
Merge master
May 15, 2015
2457199
Merge precision fix
May 18, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"inflection": "~1.3.5",
"jquery": "~2.1.0",
"leaflet": "0.7.3",
"Leaflet.heat": "Leaflet/Leaflet.heat#627ede7c11bbe43",
"lesshat": "~3.0.2",
"lodash": "~2.4.1",
"moment": "~2.9.0",
Expand Down
8 changes: 8 additions & 0 deletions src/kibana/components/agg_response/geo_json/_tooltip.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<table>
<tbody>
<tr ng-repeat="detail in details" >
<td><b>{{detail.label}}</b></td>
<td>{{detail.value}}</td>
</tr>
</tbody>
</table>
32 changes: 32 additions & 0 deletions src/kibana/components/agg_response/geo_json/_tooltip_formatter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
define(function (require) {
return function TileMapTooltipFormatter($compile, $rootScope) {
var $ = require('jquery');

var $tooltipScope = $rootScope.$new();
var $tooltip = $(require('text!components/agg_response/geo_json/_tooltip.html'));
$compile($tooltip)($tooltipScope);

return function tooltipFormatter(feature) {
if (!feature) return '';

var details = $tooltipScope.details = [];

var lat = feature.geometry.coordinates[1];
var lng = feature.geometry.coordinates[0];

var metric = {
label: feature.properties.valueLabel,
value: feature.properties.count
};
var location = {
label: 'Center',
value: lat.toFixed(4) + ', ' + lng.toFixed(4)
};

details.push(metric, location);

$tooltipScope.$apply();
return $tooltip[0].outerHTML;
};
};
});
7 changes: 7 additions & 0 deletions src/kibana/components/agg_response/geo_json/geo_json.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ define(function (require) {
var _ = require('lodash');

var readRows = require('components/agg_response/geo_json/_read_rows');
var tooltipFormatter = Private(require('components/agg_response/geo_json/_tooltip_formatter'));

function findCol(table, name) {
return _.findIndex(table.columns, function (col) {
return col.aggConfig.schema.name === name;
Expand All @@ -25,6 +27,7 @@ define(function (require) {
});

var chart = {};
chart.tooltipFormatter = tooltipFormatter;
var geoJson = chart.geoJson = {
type: 'FeatureCollection',
features: []
Expand All @@ -37,6 +40,10 @@ define(function (require) {
max: 0
};

if (agg.metric._opts.params && agg.metric._opts.params.field) {
props.metricField = agg.metric._opts.params.field;
}

// set precision from the bucketting column, if we have one
if (agg.geo) {
props.precision = _.parseInt(agg.geo.params.precision);
Expand Down
47 changes: 42 additions & 5 deletions src/kibana/components/vislib/styles/_tilemap.less
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,56 @@

.leaflet-popup {
margin-bottom: 16px !important;
pointer-events: none;
}

.leaflet-popup-content-wrapper {
background: rgba(70, 82, 93, 0.95) !important;
color: @gray-lighter !important;
background: @tooltip-bg !important;
color: @tooltip-color !important;
border-radius: 4px !important;
padding: 0 !important;
}

.leaflet-popup-content {
padding: 8px !important;
margin: 0 !important;
line-height: 14px !important;
line-height: 1.1 !important;
font-size: 12px;
font-weight: normal;
word-wrap: break-word;
overflow: hidden;
pointer-events: none;

> :last-child {
margin-bottom: @tooltip-space;
}

> * {
margin: @tooltip-space @tooltip-space 0;
}

table {
td,th {
padding: @tooltip-space-tight;

&.row-bucket {
word-break: break-all;
}
}

// if there is a header, give it a border that matches
// those in the body
thead tr {
border-bottom: 1px solid @gray;
}

// only apply to tr in the body, not the header
tbody tr {
border-top: 1px solid @gray;
&:first-child {
border-top: none;
}
}
}
}

.leaflet-popup-tip-container, .leaflet-popup-close-button {
Expand All @@ -109,7 +146,7 @@
}

.leaflet-draw-tooltip {
display: none;
display: none;
}

/* filter to desaturate mapquest tiles */
Expand Down
Loading