-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
css visibility is overridden by plotly #984
Comments
The reason for this is that visibility of text nodes is explicitly set to @etpinard, do you know for sure whether that line is strictly necessary or not? Could it be set only when necessary? Could As a workaround, |
Controlling the elements inside a plotly.js graph div with CSS is a bad idea to begin with. plotly.js graph are meant to be fully and strictly determined by the We could set So, I'd vote for |
I sympathize that it's nice if properties aren't hard-coded unnecessarily, but I also agree that it's not a good idea in general to expect CSS properties to meaningfully filter into an SVG. I'd vote for |
@etpinard I don't think this is an acceptable stance for a library built to be used in a browser environment. You simply aren't going to have graphs outside the context of the dom, and therefore there are a minimum of things that plotly should do to play nice with the dom, including sizing correctly within its parent element, and reacting to things like visibility and opacity of ancestor elements. Please reopen so we can continue to discuss this for more than 23 hours, this topic deserves more than 3 opinions. |
Apologies on the hasty closure and for my likely-undue skepticism, @fresheneesz. I'm not particularly familiar with the text utilities, but there's quite a bit going on there, so I had a queasy feeling about changes leading to more changes leading to more changes since it's in a part of plotly that touches essentially everything. I've submitted PR #990. All of the tests pass, though there is certainly a possibility of untested regressions. If |
Thanks rreusser! |
For just a bit more context, @fresheneesz, I'd go as far as to say (correct me if I'm wrong!) that the fundamental design principle of plotly.js is that the JSON definition of the plot should determine effectively everything about how the plot looks. This is the property that makes the plots editable, embeddable and portable via the JSON definition only. The goal then is to eject most css interactions so that stray user styles don't break this assumption. |
@fresheneesz I apologise if that fast |
"the JSON no longer describes what the plot looks like" I don't think making the plot entirely invisible (via visibility:none or display:hidden) means that the JSON no longer describes how the plot looks. In what case would reacting to css "plotly.js graph will remain fully and strictly determined by the data / layout JSON serializable API" I can see the usefulness of portable JSON definitions, but I don't think what I'm suggesting in any way conflicts with that policy. |
@fresheneesz my mistake. I thought you were talking about applying CSS to elements inside the plotly graph This is bug. The graph Next time, please attach a reproducible example to make your point clearer. |
Ah ok, will do. Glad we got on the same page. |
fixed in #990 |
If you use css
visibility:hidden
on an element containing a plotly graph, you can still see the axes numbers and titles.The text was updated successfully, but these errors were encountered: