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

[Graph] Reactify visualization #46799

Merged
merged 9 commits into from
Oct 2, 2019
Merged

Conversation

flash1293
Copy link
Contributor

@flash1293 flash1293 commented Sep 27, 2019

This PR migrates the visualization itself to React and adds some tests. This is an interim solution, it will eventually be implemented with cytoscape.js: #46784

Screenshot 2019-09-27 at 17 10 43

The resulting DOM should stay exactly the same, with a few renamed classes to match BEM and light icon colors for dark node colors.

@miukimiu @cchaos If you have some quick win ideas to improve the appearance they would be appreciated - it's not required for this PR though.

@flash1293 flash1293 added Feature:Graph Graph application feature Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.5.0 labels Sep 27, 2019
@flash1293 flash1293 requested a review from a team September 27, 2019 15:12
@flash1293 flash1293 requested a review from a team as a code owner September 27, 2019 15:12
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@flash1293
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

Code LGTM. Testing it with chrome I noticed warnings in console:
Bildschirmfoto 2019-09-30 um 10 34 23

x-pack/legacy/plugins/graph/public/app.js Show resolved Hide resolved
@flash1293 flash1293 mentioned this pull request Sep 30, 2019
31 tasks
@flash1293
Copy link
Contributor Author

Testing it with chrome I noticed warnings in console

Good point, this was caused by the ace editor in the inspect panel (this will go away shortly and be replaced by the standard inspect panel). I fixed it temporarily by doing what the warning says :)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@kertal kertal self-requested a review September 30, 2019 14:59
Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

Code LGTM 🖼 , no more warnings

Just a notice while I tested und unrelated to this PR, you could change CSS to show a pointer while hovering a node
image

.gphNode__text {
fill: $euiColorDarkestShade;

&--lowOpacity {
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this class completely. The icons should be fully opaque when on top of the node colors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. This class was still used in other places because the styling of icons in menus was entangled with the node styles. I separated them and removed some unused classes.

}

.gphNode__text {
fill: $euiColorDarkestShade;
Copy link
Contributor

Choose a reason for hiding this comment

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

These fills need to be always black or always white, not switchable via theme. So that when going from

image

to dark mode, you get

image

Instead of

image

Suggested change
fill: $euiColorDarkestShade;
fill: $euiColorInk;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, fixed. As the visualization now supports dark colors, I removed the light color filter from the default palette.

}

&--inverse {
fill: $euiColorLightestShade;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
fill: $euiColorLightestShade;
fill: $euiColorGhost;

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

A couple more suggestions but then it LGTM

opacity: .7;
}

&--pickable:hover, &--pickable:focus, &--selected {
Copy link
Contributor

Choose a reason for hiding this comment

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

Separate selectors to their own lines.

}

.gphNode__text {
fill: $euiColorInk;
Copy link
Contributor

Choose a reason for hiding this comment

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

cursor: pointer as @kertal suggested

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@flash1293 flash1293 merged commit 2b06c02 into elastic:master Oct 2, 2019
@flash1293 flash1293 deleted the graph/react-vis branch October 2, 2019 12:20
flash1293 added a commit to flash1293/kibana that referenced this pull request Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Graph Graph application feature 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.

5 participants