-
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] Add UI to disable style meta and get top categories from current features #59707
[Maps] Add UI to disable style meta and get top categories from current features #59707
Conversation
…orical_field_meta
…orical_field_meta
…orical_field_meta
Pinging @elastic/kibana-gis (Team:Geo) |
@@ -52,6 +53,10 @@ export class DynamicStyleProperty extends AbstractStyleProperty { | |||
const fieldName = this.getFieldName(); | |||
const rangeFieldMetaFromLocalFeatures = styleMeta.getRangeFieldMetaDescriptor(fieldName); | |||
|
|||
if (!this.isFieldMetaEnabled()) { |
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.
Fixes a bug introduced in #58766 where disabling style meta would still use style meta range, instead of range from local features.
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.
🙇
...legacy/plugins/maps/public/layers/styles/vector/components/field_meta/field_meta_popover.tsx
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/common/style_property_descriptor_types.d.ts
Outdated
Show resolved
Hide resolved
@@ -52,6 +53,10 @@ export class DynamicStyleProperty extends AbstractStyleProperty { | |||
const fieldName = this.getFieldName(); | |||
const rangeFieldMetaFromLocalFeatures = styleMeta.getRangeFieldMetaDescriptor(fieldName); | |||
|
|||
if (!this.isFieldMetaEnabled()) { |
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.
🙇
x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/styles/vector/properties/dynamic_style_property.d.ts
Outdated
Show resolved
Hide resolved
supportsFeatureState(): boolean; | ||
pluckOrdinalStyleMetaFromFeatures(features: unknown[]): RangeFieldMeta; | ||
pluckCategoricalStyleMetaFromFeatures(features: unknown[]): CategoryFieldMeta; | ||
pluckOrdinalStyleMetaFromFieldMetaData(fieldMetaData: unknown): RangeFieldMeta; |
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.
Worth creating types for the ES-responses? (don't feel strongly)
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.
I don't think this is worthwhile, at least not in this PR
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.
thanks. The TS-typing is really starting to click now. lgtm when green.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…nt features (elastic#59707) * rough start * remove unused files * get everything working * add style options types * convert DynmaicStyleProperty to TS * limit scope of PR * CategoricalFieldMetaPopover * update label and move functions to IStyleProperty interface * fix ts lint errors * replace unknown with IJoin now that its available * remove duplicate import * review feedback
…nt features (#59707) (#59933) * rough start * remove unused files * get everything working * add style options types * convert DynmaicStyleProperty to TS * limit scope of PR * CategoricalFieldMetaPopover * update label and move functions to IStyleProperty interface * fix ts lint errors * replace unknown with IJoin now that its available * remove duplicate import * review feedback Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This PR provides UI to allow users to turn off style meta and instead get top categories from current features. PR also adds a bunch of types for StyleProperty and DynamicStyleProperty.
Categorical style meta fetches the top 9 terms for styling. When styling on a field with high cardinality, the current view may not contain any features with the top 9 terms. Allowing users to disable field meta will allow them to style by current features on the map.