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
bugfix/20264-toogling-inverted-packedbubble #20328
bugfix/20264-toogling-inverted-packedbubble #20328
Conversation
File size comparisonSizes for compiled+gzipped (bold) and compiled files.
|
Visual test results - No difference found |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
ts/Core/Series/Series.ts
Outdated
// If chart is set to inverted and there are no axes, clip box shouldn't | ||
// be inverted (#20264) | ||
if (chart.inverted && !xAxis && !yAxis) { | ||
[seriesBox.width, seriesBox.height] = | ||
[seriesBox.height, seriesBox.width]; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OP demo works fine even without this block, but the unit tests fail. I don't quite understand why this is necessary - why do we need to flip the axes when we set inverted correctly in Series.update()
? Is it because the series clipBox
extends the chart.clipBox
? And if so, shouldn't we make sure chart.clipBox
is correct after running chart.propFromSeries
in series.update()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: The chart.clipBox
seems to suffer from the same issue here, and continues to do so with the current state of this PR: https://jsfiddle.net/highcharts/oydrk26s/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I added this code to fix the issue from the demo that you attached: https://jsfiddle.net/BlackLabel/7qLo2x46/ and added a unit test specially for that.
I have tested it on this demo (packedbubble
without axes): https://jsfiddle.net/BlackLabel/uv1943nc/
I am not sure about firing something like this after propFromSeries
, I tried, but always gave me bad results, that's why I decided to change only series.clipBox
to not ruin other logic. Besides that, currently, it works like this for any series with axes, chart.clipBox
is calculated and then series.clipBox
is overwritten in series.getClipBox
with axis.len
value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I understand now. The chart.clipBox
is actually correct after the update (it should be inverted). What you made sure is that the series that do not support inversion (packedbubble, pie etc), are not clipped to an inverted clip box. I'll do some more checking then come back. For example, some series like sankey or tree graphs support inversion but have no axes. Maybe we need a series flag like invertible
if we can't find some existing property to check for.
Fixed #20264, the packed bubble series was not rendered correctly in an inverted chart.