-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2731 from spalger/fieldFormatting
Field formatting
- Loading branch information
Showing
130 changed files
with
3,276 additions
and
1,256 deletions.
There are no files selected for viewing
3 changes: 1 addition & 2 deletions
3
src/kibana/components/agg_response/hierarchical/_collect_branch.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ define(function (require) { | |
chart.yScale = xAggOutput.metricScale || null; | ||
}; | ||
}; | ||
}); | ||
}); |
1 change: 0 additions & 1 deletion
1
src/kibana/components/agg_response/point_series/_tooltip_formatter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ define(function (require) { | |
] | ||
}); | ||
}; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
define(function (require) { | ||
return function AggTypeMetricCardinalityProvider(Private) { | ||
var MetricAggType = Private(require('components/agg_types/metrics/_metric_agg_type')); | ||
var fieldFormats = Private(require('registry/field_formats')); | ||
|
||
return new MetricAggType({ | ||
name: 'cardinality', | ||
title: 'Unique Count', | ||
makeLabel: function (aggConfig) { | ||
return 'Unique count of ' + aggConfig.params.field.displayName; | ||
}, | ||
getFormat: function () { | ||
return fieldFormats.getDefaultInstance('number'); | ||
}, | ||
params: [ | ||
{ | ||
name: 'field' | ||
} | ||
] | ||
}); | ||
}; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
define(function (require) { | ||
return function AggTypeMetricCountProvider(Private) { | ||
var MetricAggType = Private(require('components/agg_types/metrics/_metric_agg_type')); | ||
var fieldFormats = Private(require('registry/field_formats')); | ||
|
||
return new MetricAggType({ | ||
name: 'count', | ||
title: 'Count', | ||
hasNoDsl: true, | ||
makeLabel: function (aggConfig) { | ||
makeLabel: function () { | ||
return 'Count'; | ||
}, | ||
getFormat: function () { | ||
return fieldFormats.getDefaultInstance('number'); | ||
}, | ||
getValue: function (agg, bucket) { | ||
return bucket.doc_count; | ||
} | ||
}); | ||
}; | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
define(function (require) { | ||
return function BoundToConfigObjProvider($rootScope, config) { | ||
var _ = require('lodash'); | ||
|
||
/** | ||
* Create an object with properties that may be bound to config values. | ||
* The input object is basically cloned unless one of it's own properties | ||
* resolved to a string value that starts with an equal sign. When that is | ||
* found, that property is forever bound to the corresponding config key. | ||
* | ||
* example: | ||
* | ||
* // name is cloned, height is bound to the defaultHeight config key | ||
* { name: 'john', height: '=defaultHeight' }; | ||
* | ||
* @param {Object} input | ||
* @return {Object} | ||
*/ | ||
function BoundToConfigObj(input) { | ||
var self = this; | ||
|
||
_.forOwn(input, function (val, prop) { | ||
if (!_.isString(val) || val.charAt(0) !== '=') { | ||
self[prop] = val; | ||
return; | ||
} | ||
|
||
var configKey = val.substr(1); | ||
|
||
update(); | ||
$rootScope.$on('init:config', update); | ||
$rootScope.$on('change:config.' + configKey, update); | ||
function update() { | ||
self[prop] = config.get(configKey); | ||
} | ||
|
||
}); | ||
} | ||
|
||
return BoundToConfigObj; | ||
|
||
}; | ||
}); |
Oops, something went wrong.