-
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
[Lens] Settings panel redesign and separate settings per y axis #76373
Conversation
@cchaos do you want to jump in and share your feedback? |
@stratoula I pushed you commit to get buttons looking more like groups and adding some custom icons (may port them into EUI later). The one thing I noticed is that there is still a lot of duplication. For example we could consolidate each popover contents to their own components. Especially for ones like the Legend and axis options. They can then just be customizable with the things that change from axis to axis or chart to chart but keeping the layout and form elements in one place. |
Thank you Caroline! Yes I know, this is a reason I have it on draft. Will ping you again when it will be finalised |
@elasticmachine merge upstream |
@@ -118,8 +119,22 @@ export const buildExpression = ( | |||
}, | |||
], | |||
fittingFunction: [state.fittingFunction || 'None'], | |||
showXAxisTitle: [state.showXAxisTitle ?? true], |
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 decided here instead of having 3 booleans to check the visibility of each axis title to change it to axisTitlesVisibilitySettings in order to be in line with tickLabelsVisibilitySettings and gridlinesVisibilitySettings as all of them have to do with visibility settings. If there is any objection, I am ok to revert it to the previous one.
import { FramePublicAPI } from '../types'; | ||
import { ToolbarPopover } from '../shared_components'; | ||
import { ToolbarButtonProps } from '../toolbar_button'; | ||
// @ts-ignore |
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.
My dear @cchaos can we somehow avoid ts-ignore here?
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.
It should be doable like this:
- Rename
axis_*.js
->axis_*.ts
- Change
({ title, titleId, ...props })
->({ title, titleId, ...props }: : { title: string; titleId: string })
Thanks @flash1293 for pointing this out. I missed it, I used the groupId instead and I think that now works ok |
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.
Tested in Chrome and didn't notice any problems. This LGTM, great job!
Left a comment about the ts-ignore
s, once those are fixed this is good to merge from my side
import { FramePublicAPI } from '../types'; | ||
import { ToolbarPopover } from '../shared_components'; | ||
import { ToolbarButtonProps } from '../toolbar_button'; | ||
// @ts-ignore |
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.
It should be doable like this:
- Rename
axis_*.js
->axis_*.ts
- Change
({ title, titleId, ...props })
->({ title, titleId, ...props }: : { title: string; titleId: string })
Thanx @flash1293. I def agree that toolbar should be on shared folder. Let me move it on 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.
Sure @wylieconlon, it wraps on two rows now. |
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.
Played through the different settings and everything worked great. Left a small code comment.
I also noticed that the "Axis side" button group's options in the dimension configuration doesn't match up to the sides of the graph. It seems this PR does have that knowledge and would be great to pass down to this component as well.
But other than that. 👍 LGTM!
x-pack/plugins/lens/public/shared_components/legend_settings_popover.tsx
Outdated
Show resolved
Hide resolved
@cchaos you mean for horizontal bars instead of displaying Left to display Bottom etc, right? Now we have three axis modes (right, auto, left) and the whole logic depends on that. We could change only the label but leave the modes the same but I am not sure about that. @flash1293 what do you think? |
@elasticmachine merge upstream |
💚 Build SucceededBuild metrics@kbn/optimizer bundle module count
page load bundle size
History
To update your PR or re-run it, just comment with: |
@stratoula The way I understand @cchaos comment is to just change the later if the chart is in "horizontal" mode and keep everything the same. I think it makes sense to change the labels because it's better aligned to what the user sees and we are doing the same already for the icons in the toolbar. The same thing should be done for the disabled tooltip as well (should be Also, can we show aria label as tooltip as well for the enabled popover buttons? Maybe it's just me, but I'm scared of clicking on icon buttons and often hover over them to see the title - currently they don't show one but the aria label is set correctly already. I wouldn't consider any of this blockers as the wording is consistent, we can also separate it from the base PR as it touches a lot of stuff and create a separate followup issue. |
Thanx @flash1293, I will create a separate PR for it |
…tic#76373) * wip, redsign the xy axis general settings * pie chart settings. fix tests, initial implementation * Fix Internationalization * Cleanup * remove unused translations * Add test to check that right axis is enabled * fix test * remove unecessary translation * Added icons and cleaned up some of the visuals for grouped buttons * Fix types * Axis Settings Popover Reusable Component * Legend Popover Reusable Component * Cleanup unused translations * Fix right axis behavior * Revert yLeftTitle to yTitle to avoid migration * PR fixes * identify which axis is enabled * Change the logic on enabling the y axes popovers * Adjust axis popover on horizontal bars * fix failing test and change the logic of fetching the y axis titles * Simpify the axis title logic, make the toolbar repsponsive, add TopAxisIcon * Ui Changes on legends popover * Cleanup and more unit tests * use groupId instead of index to take under consideration all possible scenarios * fix gridlines * Remove ts-ignore from icons and move toolbar button to shared components * Workspace toolbar wraps on smaller devices * Tooltip on Toolbar appears only if the button is disabled * clean up * Add missing translations * fix eslint Co-authored-by: cchaos <caroline.horn@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…) (#77580) * wip, redsign the xy axis general settings * pie chart settings. fix tests, initial implementation * Fix Internationalization * Cleanup * remove unused translations * Add test to check that right axis is enabled * fix test * remove unecessary translation * Added icons and cleaned up some of the visuals for grouped buttons * Fix types * Axis Settings Popover Reusable Component * Legend Popover Reusable Component * Cleanup unused translations * Fix right axis behavior * Revert yLeftTitle to yTitle to avoid migration * PR fixes * identify which axis is enabled * Change the logic on enabling the y axes popovers * Adjust axis popover on horizontal bars * fix failing test and change the logic of fetching the y axis titles * Simpify the axis title logic, make the toolbar repsponsive, add TopAxisIcon * Ui Changes on legends popover * Cleanup and more unit tests * use groupId instead of index to take under consideration all possible scenarios * fix gridlines * Remove ts-ignore from icons and move toolbar button to shared components * Workspace toolbar wraps on smaller devices * Tooltip on Toolbar appears only if the button is disabled * clean up * Add missing translations * fix eslint Co-authored-by: cchaos <caroline.horn@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: cchaos <caroline.horn@elastic.co> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* master: (55 commits) [Grok] Fix missing error message in error toasts (elastic#77499) [Alerting] Exempt Alerts pre 7.10 from RBAC on their Action execution until updated (elastic#75563) [ML] fix type in apply_influencer_filters_action (elastic#77495) [Lens] create reusable component for filters and range aggregation (elastic#77453) fix eslint violations Collapse alert chart previews by default (elastic#77479) [ML] Fixing field caps wrapper endpoint (elastic#77546) showing service maps when filte by environment not defined (elastic#77483) [Lens] Settings panel redesign and separate settings per y axis (elastic#76373) log request body in new ES client (elastic#77150) use `navigateToUrl` to navigate to recent nav links (elastic#77446) Move core config service to `kbn/config` package (elastic#76874) [UBI] Copy license to /licenses folder (elastic#77563) Skip flaky Events Viewer Cypress test [Lens] Remove dynamic names in telemetry fields (elastic#76988) [Maps] Add DynamicStyleProperty#getMbPropertyName and DynamicStyleProperty#getMbPropertyValue (elastic#77366) [Enterprise Search] Add flag to restrict width of layout (elastic#77539) [Security Solutions][Cases - Timeline] Fix bug when adding a timeline to a case (elastic#76967) [Security Solution][Detections] Integration test for Editing a Rule (elastic#77090) [Ingest pipelines] Polish pipeline debugging workflow (elastic#76058) ...
* master: (54 commits) [Grok] Fix missing error message in error toasts (elastic#77499) [Alerting] Exempt Alerts pre 7.10 from RBAC on their Action execution until updated (elastic#75563) [ML] fix type in apply_influencer_filters_action (elastic#77495) [Lens] create reusable component for filters and range aggregation (elastic#77453) fix eslint violations Collapse alert chart previews by default (elastic#77479) [ML] Fixing field caps wrapper endpoint (elastic#77546) showing service maps when filte by environment not defined (elastic#77483) [Lens] Settings panel redesign and separate settings per y axis (elastic#76373) log request body in new ES client (elastic#77150) use `navigateToUrl` to navigate to recent nav links (elastic#77446) Move core config service to `kbn/config` package (elastic#76874) [UBI] Copy license to /licenses folder (elastic#77563) Skip flaky Events Viewer Cypress test [Lens] Remove dynamic names in telemetry fields (elastic#76988) [Maps] Add DynamicStyleProperty#getMbPropertyName and DynamicStyleProperty#getMbPropertyValue (elastic#77366) [Enterprise Search] Add flag to restrict width of layout (elastic#77539) [Security Solutions][Cases - Timeline] Fix bug when adding a timeline to a case (elastic#76967) [Security Solution][Detections] Integration test for Editing a Rule (elastic#77090) [Ingest pipelines] Polish pipeline debugging workflow (elastic#76058) ...
* master: (76 commits) Fixing service maps API test (elastic#77586) [Grok] Fix missing error message in error toasts (elastic#77499) [Alerting] Exempt Alerts pre 7.10 from RBAC on their Action execution until updated (elastic#75563) [ML] fix type in apply_influencer_filters_action (elastic#77495) [Lens] create reusable component for filters and range aggregation (elastic#77453) fix eslint violations Collapse alert chart previews by default (elastic#77479) [ML] Fixing field caps wrapper endpoint (elastic#77546) showing service maps when filte by environment not defined (elastic#77483) [Lens] Settings panel redesign and separate settings per y axis (elastic#76373) log request body in new ES client (elastic#77150) use `navigateToUrl` to navigate to recent nav links (elastic#77446) Move core config service to `kbn/config` package (elastic#76874) [UBI] Copy license to /licenses folder (elastic#77563) Skip flaky Events Viewer Cypress test [Lens] Remove dynamic names in telemetry fields (elastic#76988) [Maps] Add DynamicStyleProperty#getMbPropertyName and DynamicStyleProperty#getMbPropertyValue (elastic#77366) [Enterprise Search] Add flag to restrict width of layout (elastic#77539) [Security Solutions][Cases - Timeline] Fix bug when adding a timeline to a case (elastic#76967) [Security Solution][Detections] Integration test for Editing a Rule (elastic#77090) ...
Summary
Closes #74836.
We want to give to the user the possibility to control the behavior of the left and the right axis separately. So this PR:
XY Charts
Introduce a Values popover with the missing values, popover is enabled only forarea and line charts.
Introduce a legend popover and replacing the position dropdown with icon buttons.
Introduce bottom, left and right axes popovers.
Right axis popover is enabled only when there is a right axis enabled.
Pie/Donut/Treemap Charts
Introduce the Values popover with all the corresponding settings.
Introduce the Legends popover and replacing the position dropdown with icon buttons.
Note: Icons are random atm.
Checklist
Delete any items that are not applicable to this PR.