Skip to content
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

Merged
merged 39 commits into from
Sep 16, 2020

Conversation

stratoula
Copy link
Contributor

@stratoula stratoula commented Sep 1, 2020

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:

  • Redesigns the settings popover, specifically, we have settings options split on different popovers
  • It affects both the settings of pie/donut/treemap charts and xy axis charts
  • Changes the legends positions from the dropdown to button group with icons
  • Adds settings for the right y-axis

XY Charts

Screenshot 2020-09-02 at 11 28 52 AM

Introduce a Values popover with the missing values, popover is enabled only forarea and line charts.

Screenshot 2020-09-02 at 11 29 02 AM

Introduce a legend popover and replacing the position dropdown with icon buttons.

Screenshot 2020-09-02 at 11 29 14 AM

Introduce bottom, left and right axes popovers.

Screenshot 2020-09-02 at 11 30 17 AM

Right axis popover is enabled only when there is a right axis enabled.

Pie/Donut/Treemap Charts

Screenshot 2020-09-02 at 11 29 36 AM

Introduce the Values popover with all the corresponding settings.

Screenshot 2020-09-02 at 11 57 26 AM

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.

@stratoula stratoula changed the title Lens settings redesign [Lens] Settings panel redesign and separate settings per y axis Sep 2, 2020
@stratoula
Copy link
Contributor Author

@cchaos do you want to jump in and share your feedback?

@stratoula stratoula requested a review from cchaos September 2, 2020 09:08
@cchaos
Copy link
Contributor

cchaos commented Sep 4, 2020

@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.

@stratoula
Copy link
Contributor Author

Thank you Caroline! Yes I know, this is a reason I have it on draft. Will ping you again when it will be finalised

@stratoula
Copy link
Contributor Author

@elasticmachine merge upstream

@@ -118,8 +119,22 @@ export const buildExpression = (
},
],
fittingFunction: [state.fittingFunction || 'None'],
showXAxisTitle: [state.showXAxisTitle ?? true],
Copy link
Contributor Author

@stratoula stratoula Sep 7, 2020

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
Copy link
Contributor Author

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?

Copy link
Contributor

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 })

@stratoula stratoula added Feature:Lens release_note:enhancement v8.0.0 v7.10.0 Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Sep 8, 2020
@flash1293
Copy link
Contributor

There is a problem with matching the axis settings to the chart.
Here I configured two metrics, both set to "right axis" - but it seems like editing the "right axis popover" is not picked up in the chart:

Screenshot 2020-09-14 at 12 15 36

@stratoula
Copy link
Contributor Author

There is a problem with matching the axis settings to the chart.
Here I configured two metrics, both set to "right axis" - but it seems like editing the "right axis popover" is not picked up in the chart:

Screenshot 2020-09-14 at 12 15 36

Thanks @flash1293 for pointing this out. I missed it, I used the groupId instead and I think that now works ok

Copy link
Contributor

@flash1293 flash1293 left a 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-ignores, 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
Copy link
Contributor

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 })

@stratoula
Copy link
Contributor Author

Thanx @flash1293. I def agree that toolbar should be on shared folder. Let me move it on this PR 🙂

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, although I did find one edge case with the X overflow on the buttons: it seems like it would be nicer to wrap to a second row if possible.

Screen Shot 2020-09-14 at 5 36 19 PM

@stratoula
Copy link
Contributor Author

LGTM, although I did find one edge case with the X overflow on the buttons: it seems like it would be nicer to wrap to a second row if possible.

Screen Shot 2020-09-14 at 5 36 19 PM

Sure @wylieconlon, it wraps on two rows now.

Copy link
Contributor

@cchaos cchaos left a 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.

Image 2020-09-15 at 1 10 12 PM

But other than that. 👍 LGTM!

@stratoula
Copy link
Contributor Author

stratoula commented Sep 16, 2020

@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?

@stratoula
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
lens 444 +8 436

page load bundle size

id value diff baseline
lens 1.1MB +27.2KB 1.1MB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@flash1293
Copy link
Contributor

flash1293 commented Sep 16, 2020

@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 ...when top axis is enabled...):
Screenshot 2020-09-16 at 10 15 28

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.

@stratoula
Copy link
Contributor Author

Thanx @flash1293, I will create a separate PR for it

@stratoula stratoula merged commit c4eb47a into elastic:master Sep 16, 2020
stratoula added a commit to stratoula/kibana that referenced this pull request Sep 16, 2020
…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>
stratoula added a commit that referenced this pull request Sep 16, 2020
…) (#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>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 16, 2020
* 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)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 16, 2020
* 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)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 16, 2020
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Allow user to change y axis settings separately for each axis
6 participants