-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
scrolling legend height not recalculated on resize #348
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
Comments
@timelyportfolio thanks for the report!
That would be great. Go for it! |
So, this became far thornier than I initially expected. We have a scope problem with The full brute force method would be to
|
Moving block 1 and 2 above the It is important to attach event listeners to the legend only once per graph (hence that @mdtusz Any other insights? |
That should solve the sizing issue. So long as the existing eventListeners are removed, I see no problem with re-setting them. It may take a bit of fiddling to get the order of operations right and will require a check to see that you aren't adding a listener to a non-existent scroll, but it would ensure the correct value in the |
For the record, More thoroughly, // select all clippath nodes with id 'clipId' => 0 node on first pass, 1 node afterwards
var clipPath = fullLayout._topdefs.selectAll('#' + clipId);
// bind an array of length 1 to selection
.data([0])
// grabs the enter selection => has 1 node in first pass, 0 node afterwards
.enter()
// from enter selection => append <clipPath> with id 'clipId'
.append('clipPath')
.attr('id', clipId)
// and append a <rect> inside <clipPath>
.append('rect'); |
Thanks for the clarification. I understand what you are saying, and I'll attempt to demonstrate what is happening in this instance with a narrow CodePen. |
@etpinard, I think this CodePen might explain my statement. Notice how only the second and since |
@timelyportfolio nice catch. This block should be var clipPath = fullLayout._topdefs.selectAll('#' + clipId)
.data([0]);
clipPath.enter().append('clipPath')
.attr('id', clipId)
.append('rect') my mistake. |
So, I think the only thing left is we need to somehow pass the new |
I don't. I'd would simply remove/add the handlers. |
Initially reported in plotly/plotly.R#525, I was able to isolate to a non-R JavaScript only example in codepen. I had hoped
v1.7.0
would solve this, but unfortunately I just updated, and the problem persists.I am happy to attempt to tackle this if desired. I see on line where it checks for
firstRender
to draw the legend. I'm wondering if we can handle by just removing thisfirstRender
check.The text was updated successfully, but these errors were encountered: