Skip to content

Fix react-vis overrides#1123

Merged
markov00 merged 4 commits into
elastic:masterfrom
markov00:fix/react-vis-overrides
Aug 20, 2018
Merged

Fix react-vis overrides#1123
markov00 merged 4 commits into
elastic:masterfrom
markov00:fix/react-vis-overrides

Conversation

@markov00
Copy link
Copy Markdown
Contributor

Fix #1121
On the current implementation we copied the existing react-vis style into EUI.
We also overridden few classes.
Since react-vis is also used on APM, I've scoped all the react-vis class behind a container class.
BTW this is a workaround until the new version of the EUIChart is ready.

@markov00 markov00 requested review from cchaos and sorenlouv August 17, 2018 14:46
@markov00 markov00 added the bug label Aug 17, 2018
Copy link
Copy Markdown
Contributor

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! 🙏

@jasonrhodes
Copy link
Copy Markdown
Member

FWIW @markov00, in the <XYPlot> component you should be able to pass it a className prop which will append your custom class alongside .rv-xy-plot, if you like.

Copy link
Copy Markdown
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.

👍 @markov00 Thanks for jumping on this fix!

return (
<div {...rest}>
<div
className="euiSeriesChartContainer"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this is a fine way to do it (albeit, for now) since this container already exists and you don't need to then create classnames for each individual plot.

@cchaos
Copy link
Copy Markdown
Contributor

cchaos commented Aug 17, 2018

Oh and don't forget a changelog entry and double check your tests, I see the latest build errored.

@markov00
Copy link
Copy Markdown
Contributor Author

@cchaos sure, It's a bit strange why the test fails, when I ran the tests I've also got some other snapshot updated like switch.test.js.snap icon.test.js.snap and I've pushed also them. But on CI it reject this changes. Maybe a different version of some node modules. I've to check and push it again.

@cchaos I can also change this to enable composition of external classnames together with the one on eui

@jasonrhodes yes sure, the big problem with react-vis is that not every component has the possibility to pass a class, some of them have already some style applied that override your class so we preferred to import their scss files and change them directly.

@markov00 markov00 merged commit 91dbf4e into elastic:master Aug 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants