Repository navigation
[Maps] Use field formatter to format value in legend - #48132
Conversation
|
Pinging @elastic/kibana-gis (Team:Geo) |
💚 Build Succeeded |
thomasneirynck
left a comment
There was a problem hiding this comment.
this kind of polish is great.
As discussed in person, not to be addressed in this PR, but to track this more explicitly. Field formatters are retrieved now for tooltips and legend formatting, and each need to handle aggregation fields, join fields, and source-fields separately. It would make sense to isolate this into a separate concept (e.g. Field). This may also help organize future work on better defaults for symbology based on field-level characteristics (domain/distribution of the data, classification, ...).
The rest are nits, but I really don't think we should mix/match notations and start using lambda notations for methods. These functions belong on the prototype. Apart from the inconsistency with how 95% of the class-methods in Maps are written now, lambdas-as-methods are needlessly crufty recreating that function with each new call. It's also confusing the type inference in my IDE, making navigating to through the code inconsistent :(
Consistent formatting of our class will also help with a future migration to typescript, since class-syntax in TS is equivalent. TS-sugar for access modifiers can be added in-place when using the vanilla method-notation.
💚 Build Succeeded |
* [Maps] Use field formatter to format value in legend * remove console statement * simplify logic * review feed back
* [Maps] Use field formatter to format value in legend * remove console statement * simplify logic * review feed back
This PR uses field formatters to format the value displayed in legend. This PR addresses a comment made in PR #47903 (comment) about formatting the time string in the legend.
To test the PR, configure the formatter for the web logs sample data set
bytesfield to display the value as bytes. Then view the legend for the sample data set and verify the label is formatted