mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[aggResponse/geoJson] support transforming tables without aggConfigResults
This commit is contained in:
parent
96d371f831
commit
a543484dc6
1 changed files with 9 additions and 4 deletions
|
@ -1,7 +1,12 @@
|
|||
define(function (require) {
|
||||
var decodeGeoHash = require('utils/decode_geo_hash');
|
||||
var AggConfigResult = require('components/vis/_agg_config_result');
|
||||
var _ = require('lodash');
|
||||
|
||||
function unwrap(val) {
|
||||
return (val instanceof AggConfigResult) ? val.value : val;
|
||||
}
|
||||
|
||||
function readRows(table, agg, index, chart) {
|
||||
var geoJson = chart.geoJson;
|
||||
var props = geoJson.properties;
|
||||
|
@ -15,9 +20,9 @@ define(function (require) {
|
|||
props.valueFormatter = metricFormatter;
|
||||
|
||||
table.rows.forEach(function (row) {
|
||||
var geohash = row[index.geo].value;
|
||||
var valResult = row[index.metric];
|
||||
var val = valResult.value;
|
||||
var geohash = unwrap(row[index.geo]);
|
||||
var valResult = (row[index.metric] instanceof AggConfigResult) ? row[index.metric] : null;
|
||||
var val = unwrap(row[index.metric]);
|
||||
var formatted = metricFormatter(val);
|
||||
|
||||
if (props.min === null || val < props.min) props.min = val;
|
||||
|
@ -53,4 +58,4 @@ define(function (require) {
|
|||
}
|
||||
|
||||
return readRows;
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue