Skip to content

[7.x] Map layout changes (#77132)#77526

Merged
smith merged 2 commits intoelastic:7.xfrom
smith:backport/7.x/pr-77132
Sep 18, 2020
Merged

[7.x] Map layout changes (#77132)#77526
smith merged 2 commits intoelastic:7.xfrom
smith:backport/7.x/pr-77132

Conversation

@smith
Copy link
Copy Markdown
Contributor

@smith smith commented Sep 15, 2020

Backports the following commits to 7.x:

These changes make the map work better with auto-refresh and with dragged nodes.

Extract all event handling out of the Cytoscape component into a hook.
Use React.memo to only render when the list of element ids has changed.
Only do a fit on the layout if we're going from 0 to more than 0 elements.
Instead of removing all the nodes on rerender, only remove the ones that aren't in the new list.
Trigger a custom:data event instead of data when we receive fetched data. Before we triggered a data event which would trigger a layout if you called data() on an element.
Don't trigger a deselect when we get new data, so popovers stay open when we get new data.
Animate the layout on changes.
When we do a layout, exclude selected nodes and nodes that have been dragged.
When we set the time range to something low (like the default of 15m) and a fast refresh interval (1-3s) the edges we get back from the API are not consistent, so you can see the map changing frequently.

See this video for an example: https://www.dropbox.com/s/jsq2bffxdw61xhu/77132.mov?dl=0

Fixes elastic#73156.
Fixes elastic#76936.
@smith smith requested a review from a team September 15, 2020 17:35
@smith smith added the backport This PR is a backport of another PR label Sep 15, 2020
@smith
Copy link
Copy Markdown
Contributor Author

smith commented Sep 18, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
apm 1256 +3 1253

async chunks size

id value diff baseline
apm 5.0MB +4.9KB 5.0MB

History

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

@smith smith merged commit 9cda2be into elastic:7.x Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants