-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Maps] Support categorical styling for numbers and dates #57908
[Maps] Support categorical styling for numbers and dates #57908
Conversation
Pinging @elastic/kibana-gis (Team:Geo) |
Assigned review, wanting to get a sense if this is the right way to do it. Basically, just use the "type" field on the dynamic_style-property to toggle between categorical/qualitative.
|
@elasticmachine merge upstream |
I think this is a good approach. Just a few comments. "Quantitative" and "Qualitative" are complex words for users without a strong math/data visualization background. I think we need some help text or tooltip to explain the difference between the two. Should add number and date fields to icon style by value as well so numbers can be used for setting icon. |
fed77c5
to
26607b4
Compare
26607b4
to
42b1d88
Compare
'xpack.maps.styles.dynamicColorSelect.qualitativeOrQuantitativeTooltip', | ||
{ | ||
defaultMessage: | ||
'Choose `quantitative` to map the value as a number to a color on a range. Choose `qualitative` to map the value as a category to a color from a palette', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gchaps I could probably use some help with some good help-text here 😃 Any ideas to make this read better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a tooltip, how about EuiFormRow help text for the selected value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do either of these work?
Choose Quantitative
to map the value to a number in a color range, or Qualitative
to map to a category in a color palette.
Choose Quantitative
to map by number in a color range, or Qualitative
to categorize by color palette.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx @gchaps !
to avoid some clutter in the UX (which is getting really long), we were thinking if we could avoid the help-text if the select-box uses "As number" and "As category" for the options. It'd still using your help-text in the aria-label.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That wording is much clearer than using quantitative and qualitative.
But should it be "By number" and "By category"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gchaps maybe (?) :) not super familiar with the nuances here.
It's basically to express the difference in how the value should be interpreted. Should the value be interpreted as a number on a range, then we can map it to a continuous color-range. Should the value be interpreted as a category, then we just assign a color-value.
I can make this change to 'by', but 'as' seems to fit a little better by what it's trying to express.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. 'as' is the better choice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvements. Really like removing of getDateFields, getNumberFields, and getCategoricalFields
x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.d.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_term_source.test.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js
Outdated
Show resolved
Hide resolved
...ck/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js
Outdated
Show resolved
Hide resolved
...ck/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js
Outdated
Show resolved
Hide resolved
...ck/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/styles/vector/components/vector_style_editor.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/es_geo_grid_source/es_geo_grid_source.test.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/fields/top_term_percentage_field.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/styles/vector/components/color/color_map_select.js
Outdated
Show resolved
Hide resolved
...ck/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_color_property.test.js
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with green ci
code review, tested in chrome
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* master: (22 commits) Generate docs from data plugin (elastic#56955) Fixes elastic#59513 by hiding one of the symmetric edges rather than omiting it (elastic#59514) Harden creation of child processes (elastic#55697) [Alerting] replace watcher http APIs used by index threshold Alerting (elastic#59475) [Maps][docs] add more details to Quantitative data driven styling docs (elastic#59553) chore: 🤖 hide Drilldowns in master (elastic#59698) [Discover] Migrate AppState/GlobalState to new app state helpers (elastic#57175) Use HTTP request schemas to create types, use those types in the client (elastic#59340) [Maps] Support categorical styling for numbers and dates (elastic#57908) [ML] Functional API tests - bucket span estimation with custom search.max_buckets (elastic#59665) Fix slm_ui setting by changing camel case back to snake case. (elastic#59663) removes beta tag (elastic#59618) [DOCS] Removed spatial references (elastic#59595) fix outdated docs (elastic#58729) [ML] Fixes bucket span estimators loading of max_buckets setting (elastic#59639) [ML] Refactoring anomaly detector job types (elastic#59556) [Upgrade Assistant] Better handling of closed indices (elastic#58890) additional visualizations plugin cleanup before moving to NP (elastic#59318) In scripted fields, unable to switch the `Type` - getting a console error which says - Class constructor DecoratedFieldFormat cannot be invoked without 'new' (elastic#59285) [Visualize] Remove global state in visualize (elastic#58352) ...
…s/kibana into alerting/fix-flaky-instance-test * 'alerting/fix-flaky-instance-test' of github.com:gmmorris/kibana: (176 commits) Generate docs from data plugin (elastic#56955) Fixes elastic#59513 by hiding one of the symmetric edges rather than omiting it (elastic#59514) Harden creation of child processes (elastic#55697) [Alerting] replace watcher http APIs used by index threshold Alerting (elastic#59475) [Maps][docs] add more details to Quantitative data driven styling docs (elastic#59553) chore: 🤖 hide Drilldowns in master (elastic#59698) [Discover] Migrate AppState/GlobalState to new app state helpers (elastic#57175) Use HTTP request schemas to create types, use those types in the client (elastic#59340) [Maps] Support categorical styling for numbers and dates (elastic#57908) [ML] Functional API tests - bucket span estimation with custom search.max_buckets (elastic#59665) Fix slm_ui setting by changing camel case back to snake case. (elastic#59663) removes beta tag (elastic#59618) [DOCS] Removed spatial references (elastic#59595) fix outdated docs (elastic#58729) [ML] Fixes bucket span estimators loading of max_buckets setting (elastic#59639) [ML] Refactoring anomaly detector job types (elastic#59556) [Upgrade Assistant] Better handling of closed indices (elastic#58890) additional visualizations plugin cleanup before moving to NP (elastic#59318) In scripted fields, unable to switch the `Type` - getting a console error which says - Class constructor DecoratedFieldFormat cannot be invoked without 'new' (elastic#59285) [Visualize] Remove global state in visualize (elastic#58352) ...
Closes #54923
Introduces a few changes:
Adds quantitative/qualitative selector.
It adds number/date fields to the icon-selector.
It removes all the
get[Number|Date|...]Field
methods fromSource
andLayer
, in favor of letting the vector-style-editor component filter out fields by type.