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

[Vis: Default Editor] EUIficate 'Metrics & Axis' tab #43772

Merged
merged 103 commits into from
Sep 13, 2019

Conversation

maryia-lapata
Copy link
Contributor

@maryia-lapata maryia-lapata commented Aug 22, 2019

Summary

EUIfication of options tab Metrics & Axes in Area/Bar/Line vis.
Part of #38273.

For better understanding of components structure I added a schema in Tech details section.

This PR contains the following changes:

  • Euification of vislib-series, vislib-value-axes and vislib-category-axis directives.

  • for vis config:

    • moved common collections and optionTabs into utils files;
    • added enum types for category type, scale type, axis type, rotate, chart type, chart mode, interpolate mode, threshold line styles. Also their options were localized;
    • options tab titles Metric & axes and Panel settings were localized;
    • added thresholdLine config in Histogram bar;
    • defined lineWidth for seriesParams as 2;
  • for PointSeriesOptions:

    • renamed GridOptions to GridPanel;
    • moved ThresholdLine setting into a separate component
  • for common components:

    • added ValidationWrapper component for multifield validation support like in AggGroup since we're still bound by angularjs's ngForm;
    • added data-test-subj, disabled , isInvalid and error props to NumberInputOption;
    • added disabled prop to TruncateLabelsOption;
    • added data-test-subj prop to TextInputOption ;
    • now SelectOption allows value as number too (Rotate needs this);
  • labels were update using sentence case.

  • remove unused style .visEditorSidebar__formTitle;

  • old unit tests were removed. I'll add jest unit tests in a separate PR.

Screenshots

  1. General view
  1. Metrics

Line:

|


Area:

  1. Y-Axes

3a) Disabled Show axes lines and labels


3b) Custom extends


3c) Validation


  1. X-Axes


Tech details

1. MetricsAxisOptions

Screen Shot 2019-09-02 at 5 56 05 PM

2. ChartOptions

Screen Shot 2019-09-02 at 6 07 30 PM Options

3. ValueAxisOptions

Screen Shot 2019-09-02 at 6 24 03 PM

Use cases

1. From #24176 about Axis title:

- When an axis title is set manually, it will always override the custom label set on the agg - Otherwise, the axis title will be set to whatever the custom label is on the agg - If no custom label is specified on the agg, the axis title will be set to the default for the agg (i.e. whatever `aggConfig.makeLabel()` returns) - If the agg type is changed, axis titles are reset to `aggConfg.makeLabel()`


2. Y-Axis name should be changed to opposite when X-axis position is changed:


3. Y-Axis name should be changed when this Y-axis position is changed:

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

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.

LGTM besides always keeping "Show dots" enabled as discussed offline.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

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.

LGTM thanks @maryia-lapata!

@maryia-lapata maryia-lapata removed the request for review from sulemanof September 13, 2019 07:51
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@sulemanof sulemanof requested review from sulemanof and removed request for sulemanof September 13, 2019 11:10
@maryia-lapata maryia-lapata merged commit 1223ab9 into elastic:master Sep 13, 2019
@maryia-lapata maryia-lapata deleted the series-options branch September 13, 2019 11:12
maryia-lapata added a commit to maryia-lapata/kibana that referenced this pull request Sep 13, 2019
* EUIficate pointe-series and grid

* Apply TS

* Show grid on a panel

* Remove extra space

* Add TS

* Use BasicOptions

* Adjust func test

* Add dataTestSubj prop to SelectOption

* Use id instead of data-sest-subj

* Disable show x-axis lines when there is histogram agg

* Add tooltip for disabled 'Show x-axis lines' config

* Add series_options.tsx

* Migrate series

* Improve changeValueAxis

* Create CategoryAxisPanel

* Create ValueAxesPanel

* Create CustomExtentsOptions

* File renaming

* Use TruncateLabelsOption

* Set min value

* Add validation

* Refactoring

* Move types upper

* Convert series logic

* Convert valueAxes logic

* Rename function

* Add validation and refactoring

* Adjust styles

* Fix rotates

* Apply config for other vis

* Remove old directives

* Fix useHook usage

* Update vislib_vis_type.js

* Fix

* Move Threshold line panel into a separate component

* Remove unused translations

* Apply ui suggestions

* Update functional tests

* Remove angular unit test

* Refactoring

* Fix dependencies

* Refactoring

* Add validation

* Add validation for other vis

* Refactoring of onPositionChanged handler

* Refactoring of addValueAxis

* Get rid of a useEffect

* Refactoring of updateAxisTitle

* Update useCallback

* Refactoring

* Refactoring of collections config

* Refactoring of setChartValueByIndex and setValueAxisByIndex

* Update metrics_axes_options.tsx

* Watch current tab for correct accordion height

* Revert axis title logic

* Fix axis id and name number

* Fix code review comments

* Fix functional tests

* Update visualize_page.js

* Move option tabs in common

* Fix code review comments

* Update index.tsx

* Refactoring

* Fix merge conflict

* Show ThresholdPanel when it's configured

* Fix passing a current tab to vis-options

* Localize 'Count' text

* Pass one axis to CategoryAxisPanel

* Fix y-axis name number when x-axis position changed

* Fix Y-axis name number when position Y-axis changed

* Fix refresh loop

* Re-organize controls

* Apply code review comments

* Refactoring

* Fix extents empty value

* Update y_extents.tsx

* Fix code review comments

* Fix updating several seriesParams when removing axis

* Add thresholdLine config to horizontal bar

* Refactoring

* Reset grid.valueAxis when the axis deleted

* Fix refresh loop

* Set interpolate config for line

* Enable "show dots"
maryia-lapata added a commit that referenced this pull request Sep 13, 2019
…45621)

* [Vis: Default Editor] EUIficate 'Metrics & Axis' tab (#43772)

* EUIficate pointe-series and grid

* Apply TS

* Show grid on a panel

* Remove extra space

* Add TS

* Use BasicOptions

* Adjust func test

* Add dataTestSubj prop to SelectOption

* Use id instead of data-sest-subj

* Disable show x-axis lines when there is histogram agg

* Add tooltip for disabled 'Show x-axis lines' config

* Add series_options.tsx

* Migrate series

* Improve changeValueAxis

* Create CategoryAxisPanel

* Create ValueAxesPanel

* Create CustomExtentsOptions

* File renaming

* Use TruncateLabelsOption

* Set min value

* Add validation

* Refactoring

* Move types upper

* Convert series logic

* Convert valueAxes logic

* Rename function

* Add validation and refactoring

* Adjust styles

* Fix rotates

* Apply config for other vis

* Remove old directives

* Fix useHook usage

* Update vislib_vis_type.js

* Fix

* Move Threshold line panel into a separate component

* Remove unused translations

* Apply ui suggestions

* Update functional tests

* Remove angular unit test

* Refactoring

* Fix dependencies

* Refactoring

* Add validation

* Add validation for other vis

* Refactoring of onPositionChanged handler

* Refactoring of addValueAxis

* Get rid of a useEffect

* Refactoring of updateAxisTitle

* Update useCallback

* Refactoring

* Refactoring of collections config

* Refactoring of setChartValueByIndex and setValueAxisByIndex

* Update metrics_axes_options.tsx

* Watch current tab for correct accordion height

* Revert axis title logic

* Fix axis id and name number

* Fix code review comments

* Fix functional tests

* Update visualize_page.js

* Move option tabs in common

* Fix code review comments

* Update index.tsx

* Refactoring

* Fix merge conflict

* Show ThresholdPanel when it's configured

* Fix passing a current tab to vis-options

* Localize 'Count' text

* Pass one axis to CategoryAxisPanel

* Fix y-axis name number when x-axis position changed

* Fix Y-axis name number when position Y-axis changed

* Fix refresh loop

* Re-organize controls

* Apply code review comments

* Refactoring

* Fix extents empty value

* Update y_extents.tsx

* Fix code review comments

* Fix updating several seriesParams when removing axis

* Add thresholdLine config to horizontal bar

* Refactoring

* Reset grid.valueAxis when the axis deleted

* Fix refresh loop

* Set interpolate config for line

* Enable "show dots"

* Fix functional test
@elasticmachine
Copy link
Contributor

💔 Build Failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Vis Editor Visualization editor issues release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.5.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants