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] allow drag and drop reorder on xyChart for y dimension #84640

Merged
merged 10 commits into from
Dec 3, 2020

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Dec 1, 2020

Summary

As we recently merged #84223 which solved this: elastic/elastic-charts#868 , we are safe to enable drag and drop reordering on xy chart 🙌

Dec-01-2020 15-01-10

@mbondyra mbondyra added Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Lens v7.11.0 labels Dec 1, 2020
@mbondyra mbondyra marked this pull request as ready for review December 1, 2020 14:01
@mbondyra mbondyra requested a review from a team December 1, 2020 14:01
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@mbondyra
Copy link
Contributor Author

mbondyra commented Dec 1, 2020

@elasticmachine merge upstream

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.

I think I found a bug, where the order of the color indicators is not updated after dragging within the Y axis. I created two layers, and put 2 metrics on the second layer:

Screen Shot 2020-12-01 at 5 00 14 PM

Do you think this should be tagged release_note:enhancement? Is there somewhere we can add this to the docs?

@flash1293
Copy link
Contributor

This is happening because for the rendered chart, we reorder the accessors array based on the table column order in the to_expression function, but we use the original layer objects from the state in the getConfiguration call to get the colors for the dimension triggers. In getConfiguration we should reorder the accessors in the same way before calculating the “colorAssignments” object

…g_n_drop_for_xy

# Conflicts:
#	x-pack/plugins/lens/public/xy_visualization/visualization.tsx
@mbondyra mbondyra force-pushed the lens/drag_n_drop_for_xy branch from 8346fea to eaf5918 Compare December 2, 2020 18:08
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 works as expected. As discussed this is not a perfect solution and we should revisit the whole logic of keeping column orders in sync in general. @mbondyra Could you open a tech debt issue for this?

I left a nit about the test as I would like to get rid of the testing of internals via mocking a dependency, but I don't think another round of review is required.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 995.8KB 996.4KB +571.0B

History

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

@flash1293 flash1293 requested a review from wylieconlon December 3, 2020 17:13
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, tested again and the bug is fixed!

@mbondyra mbondyra merged commit 1ff2bb3 into elastic:master Dec 3, 2020
@mbondyra mbondyra deleted the lens/drag_n_drop_for_xy branch December 3, 2020 19:30
mbondyra added a commit to mbondyra/kibana that referenced this pull request Dec 3, 2020
…c#84640)

* [Lens] allow drag and drop on xyChart for y dimension

* wip

* tests

* dimension panel fix

* eslint

* fix test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Dec 4, 2020
* master: (28 commits)
  [Actions] fixes bug where severity is auto selected but not applied to the action in PagerDuty (elastic#84891)
  Only attempt to rollover signals index if version < builtin version (elastic#84982)
  skip flaky suite (elastic#84978)
  skip lens rollup tests
  Add geo containment tracking alert type (elastic#84151)
  Changed rollup tests to use test user rather than elastic super user. (elastic#79567)
  skip 'should allow creation of lens xy chart' elastic#84957
  [APM] Add log_level/sanitize_field_names config options to Python Agent (elastic#84810)
  [Maps] geo line source (elastic#76572)
  [data.search] Move search method inside session service and add tests (elastic#84715)
  skip lens drag and drop test.  elastic#84941
  [Ingest Node Pipelines] Integrate painless autocomplete (elastic#84554)
  [Lens] allow drag and drop reorder on xyChart for y dimension (elastic#84640)
  [Lens] Fix error when selecting the current field again (elastic#84817)
  [Metrics UI] Add metadata tab to node details flyout (elastic#84454)
  [CI] Enables APM collection (elastic#81731)
  [Workplace Search] Migrate Sources Schema tree (elastic#84847)
  Disable checking for conflicts when copying saved objects (elastic#83575)
  [SECURITY_SOLUTION] delete advanced Policy fields when they are empty (elastic#84368)
  y18n 4.0.0 -> 4.0.1 (elastic#84905)
  ...
mbondyra added a commit that referenced this pull request Dec 4, 2020
#84937)

* [Lens] allow drag and drop on xyChart for y dimension

* wip

* tests

* dimension panel fix

* eslint

* fix test

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants