Skip to content

Commit 84f694b

Browse files
committed
add less than and greater than symbols when styling by field stats
1 parent e9764e5 commit 84f694b

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

x-pack/legacy/plugins/maps/public/layers/styles/vector/components/legend/style_property_legend_row.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,17 @@ export class StylePropertyLegendRow extends Component {
7272
return !this.props.style.isDynamic() || !this.props.style.isComplete() || !this.props.style.getField().getName();
7373
}
7474

75-
_formatValue = value => {
75+
_formatValue = (value, prefix) => {
7676
if (!this.state.hasLoadedFieldFormatter || !this._fieldValueFormatter || value === EMPTY_VALUE) {
7777
return value;
7878
}
7979

80-
return this._fieldValueFormatter(value);
80+
return this.props.style.isFieldMetaEnabled()
81+
? `${prefix} ${this._fieldValueFormatter(value)}`
82+
: this._fieldValueFormatter(value);
8183
}
8284

8385
render() {
84-
8586
const { range, style } = this.props;
8687
if (this._excludeFromHeader()) {
8788
return null;
@@ -91,8 +92,8 @@ export class StylePropertyLegendRow extends Component {
9192
return (
9293
<StyleLegendRow
9394
header={header}
94-
minLabel={this._formatValue(_.get(range, 'min', EMPTY_VALUE))}
95-
maxLabel={this._formatValue(_.get(range, 'max', EMPTY_VALUE))}
95+
minLabel={this._formatValue(_.get(range, 'min', EMPTY_VALUE), '<')}
96+
maxLabel={this._formatValue(_.get(range, 'max', EMPTY_VALUE), '>')}
9697
propertyLabel={getVectorStyleLabel(style.getStyleName())}
9798
fieldLabel={this.state.label}
9899
/>

0 commit comments

Comments
 (0)