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

React-plotly Svg transform #23

Open
jmeberst opened this issue Dec 12, 2017 · 5 comments
Open

React-plotly Svg transform #23

jmeberst opened this issue Dec 12, 2017 · 5 comments

Comments

@jmeberst
Copy link

jmeberst commented Dec 12, 2017

I'm trying to use react-plotly inside a foreign object within an Svg, this works fine as shown here.
https://codepen.io/anon/pen/eyYjgr

However I would like to move this object using a transform.
<foreignObject id={"TestSvgFO"} width="100%" height="100%" transform="translate(150, 0)" xmlns="http://www.w3.org/2000/svg">

This results in sliding the view window off the plotly graph instead of moving it.
https://codepen.io/anon/pen/qpByMe

Any suggestions on a way to get it to move correctly in an Svg object with a transform?

(edited your links so they work - alexcjohnson)

@bpostlethwaite
Copy link
Member

@jmeberst I don't seem to have access to those codepens.

@alexcjohnson
Copy link
Collaborator

I'm afraid we've got some longstanding bugs with plotly.js inside css-transformed elements - probably you're seeing the same thing as this issue: plotly/plotly.js#888

@jmeberst
Copy link
Author

jmeberst commented Dec 12, 2017

@alexcjohnson I'm not having any issues with the css transforms when they are just applied to a wrapper div though, that seems to be working correctly where the entire graph can be moved as a unit like I would expect.

https://codepen.io/anon/pen/BJaqeN

@alexcjohnson
Copy link
Collaborator

Weird. This behaves differently (and perhaps correctly) in Firefox, and Chrome seems confused about where items are (note that I've selected the first bar in the inspector):
screen shot 2017-12-12 at 3 50 23 pm
So I'm tempted to say this is a Chrome bug...

@jmeberst
Copy link
Author

It's working as I would expect in Firefox. What a strange bug.

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

No branches or pull requests

3 participants