-
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] show dynamic style ranges in legend #35417
Conversation
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
Pinging @elastic/kibana-gis |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
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.
This is a massive PR, and has so many new features. 💫
- improves the small legend icon in the left of the TOC
- shows a detailed legend on expansion
- adds range readouts
- changes the layout of the TOC-entry, making it more intuitive to activate edit-mode
- making legend expandable, and savind this per map and per dashboard (really neat!)
- cleanup of some of the icon-rendering code, simplifying some of the constructs
I'm sure I'm forgetting more. 🚀
I have some minor comments in the code. It was a lot, so I might have not really thorough.
A couple minor comments.
-
I think the general layout gets a little cluttered. It's hard to see which legend applies to which value. But I defer to @cchaos and @alexfrancoeur here.
x-pack/plugins/maps/public/shared/layers/styles/abstract_style.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/shared/layers/styles/vector_style.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/components/widget_overlay/layer_control/layer_toc/toc_entry/view.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/shared/layers/styles/components/vector/legend/index.js
Outdated
Show resolved
Hide resolved
The field name has a tooltip that displays the full name if the name gets truncated and contains the style property so this will alleviate help avoid confusion. I would rather avoid taking up more vertical space for each scaled property so the user can display more data and not have to scroll the legend |
💚 Build Succeeded |
Looking really nice! A couple of observations: Seems like we should consider either not showing range details for not-currently-visible layers or showing them but updating range metadata on a different event sequence than the one currently used (initiated by The last-used expand button keeps the focus after clicking and leaving the Legend Entry. Maybe we should consider changing/clearing the focus after leaving it: |
In your screenshot, the focus will continue to be on the legend toggle until the user clicks somewhere else. This is by design so that these buttons (that are hidden until hover) will show when a keyboard user is tabbing through them. It's the default behavior of a browser to keep focus on the last clicked item. I would not change this default behavior. |
x-pack/plugins/maps/public/components/widget_overlay/layer_control/layer_toc/toc_entry/view.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/components/widget_overlay/layer_control/layer_toc/toc_entry/view.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/components/widget_overlay/layer_control/layer_toc/toc_entry/index.js
Show resolved
Hide resolved
...ugins/maps/public/shared/layers/styles/components/vector/legend/style_property_legend_row.js
Outdated
Show resolved
Hide resolved
x-pack/plugins/maps/public/shared/layers/styles/components/vector/legend/vector_icon.js
Outdated
Show resolved
Hide resolved
I think I will leave them visible to avoid having the TOC expand/collapse as users zoom around the map. |
💚 Build Succeeded |
💚 Build Succeeded |
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.
🐎
* show grab and edit buttons when hovering over layer name * display layer details when layer name is clicked * add range to dynamic style property state * render dynamic ranges in TOC details * render symbol size and border width header in legend * simplify VectorStyle.getIcon * removed unused component * open TOC details on map load * save open TOC details state in embeddable config * show gradients for dynmaic fill color icon * round corners of dynamic icon if points only * add tooltip to legend label * add edit panel action to action panel * add functional test for details in legend * fix broken gis_page function doesLayerExist * add unit tests for VectorStyle.getDescriptorWithDynamicRanges * open actions menu on layer title click, add arrow up/down for togging layer details * Design cleanup of layers panel (#31) * fix functional test * update jest snapshots * refactor StylePropertyLegendRow to use same function to render lineWidth and iconSize legends * fix functional test * fix another functional test * make escapeLayerName function instead of instance method * move _isLayerDetailsOpen into prop from redux connector * remove index.js file * do not show legend details toggle when layer has not legend details * rename FillableVector to FillableRectangle * use mixin pattern instead of encapulated function call
* show grab and edit buttons when hovering over layer name * display layer details when layer name is clicked * add range to dynamic style property state * render dynamic ranges in TOC details * render symbol size and border width header in legend * simplify VectorStyle.getIcon * removed unused component * open TOC details on map load * save open TOC details state in embeddable config * show gradients for dynmaic fill color icon * round corners of dynamic icon if points only * add tooltip to legend label * add edit panel action to action panel * add functional test for details in legend * fix broken gis_page function doesLayerExist * add unit tests for VectorStyle.getDescriptorWithDynamicRanges * open actions menu on layer title click, add arrow up/down for togging layer details * Design cleanup of layers panel (#31) * fix functional test * update jest snapshots * refactor StylePropertyLegendRow to use same function to render lineWidth and iconSize legends * fix functional test * fix another functional test * make escapeLayerName function instead of instance method * move _isLayerDetailsOpen into prop from redux connector * remove index.js file * do not show legend details toggle when layer has not legend details * rename FillableVector to FillableRectangle * use mixin pattern instead of encapulated function call
This PR: