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

bugfix/18658-sunburst-labels-blinking #18697

Merged
merged 3 commits into from Mar 31, 2023

Conversation

vazonik
Copy link
Member

@vazonik vazonik commented Mar 20, 2023

Fixed #18658, all sunburst's data labels were disappearing and showing back after one point update.

@vazonik vazonik self-assigned this Mar 20, 2023
@highsoft-bot
Copy link
Collaborator

File size comparison

No differences found

@highsoft-bot
Copy link
Collaborator

Visual test results - No difference found

Copy link
Collaborator

@TorsteinHonsi TorsteinHonsi left a comment

Choose a reason for hiding this comment

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

@vazonik When removing code, it is important to consider closely what is lost. One thing I can see is that the data labels now suddenly appear initially, instead of easing/fading in. This is what should be controlled by the dataLabels.defer option, and in the current state of this PR, it behaves like defer is always false.

I recommend taking a closer look at what is going on in that code block, hopefully we can do it in a more consistent way. Maybe we can implement the defer option in another place, more consistent with other series types. If things were done correctly, it shouldn't be necessary with series-specific overrides like this.

@vazonik
Copy link
Member Author

vazonik commented Mar 21, 2023

@TorsteinHonsi Thanks! Ignoring the defer option was caused by some other commit that had already been merged into the master, but I haven't identified which one of it yet. This regression applies to data labels regardless of series type. Should I fix it in this pull request or should I make a separate issue for it?

My change causes removing the fadein-fadeout animation of data labels during drill down, but with @pawellysy we found that it could also be unnecessary.

@TorsteinHonsi
Copy link
Collaborator

TorsteinHonsi commented Mar 21, 2023

Ignoring the defer option was caused by some other commit that had already been merged into the master

@vazonik In that case it is important that we find it and fix it before the next release. Do you have a demo of this? It seems to work well here (on the master): https://jsfiddle.net/highcharts/rz82ywtp/

@vazonik
Copy link
Member Author

vazonik commented Mar 21, 2023

Do you have a demo of this?

@TorsteinHonsi Yes:

@TorsteinHonsi
Copy link
Collaborator

Okay, it's caused by this regression: #18478 . If we set a container height in the CSS, we fix the redraw issue and the data labels behave like they should.

@vazonik vazonik marked this pull request as draft March 21, 2023 09:02
@vazonik vazonik marked this pull request as ready for review March 22, 2023 11:01
@vazonik
Copy link
Member Author

vazonik commented Mar 22, 2023

Ok, so now it works like this: https://jsfiddle.net/BlackLabel/Lg5c0nwu/

Copy link
Collaborator

@TorsteinHonsi TorsteinHonsi left a comment

Choose a reason for hiding this comment

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

Yes, seems good now!

Copy link
Collaborator

@TorsteinHonsi TorsteinHonsi left a comment

Choose a reason for hiding this comment

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

I now remembered what the hackDataLabelAnimation is about. It is for traversing the sunburst. See http://localhost:3030/samples/#view/highcharts/demo/sunburst and click Europe. Without the hack, the data labels animate in a chaotic way. That's why we decided to just temporary hide them and fade back in instead of trying to animate between different rotations and text paths. I think what you need to do is to keep the logic is it was, but rather inspect when the hackDataLabelAnimation is activated. So that it does not get activated when just doing a simple point update. In fact, looking at the previous line 851, I would expect it to only happen when the root changed, which is does not do in this case.

@TorsteinHonsi
Copy link
Collaborator

Thank you! While we're in this part of the code, I want to ask you to to check out something I have been noticing for a while. See https://jsfiddle.net/highcharts/6eka4tmn/. If you click the middle element, "Oceanic", you also get the blinking of the data labels. I would expect that in this case the root id was identical to the previous root id, since we're not allowed to traverse further up, and subsequently the labels shouldn't blink. Can you have a look at that?

Copy link
Collaborator

@TorsteinHonsi TorsteinHonsi left a comment

Choose a reason for hiding this comment

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

Thanks!

@TorsteinHonsi TorsteinHonsi merged commit 2e2ee02 into master Mar 31, 2023
@highsoft-bot highsoft-bot added this to the Next milestone Mar 31, 2023
@TorsteinHonsi TorsteinHonsi deleted the bugfix/18658-sunburst-labels-blinking branch March 31, 2023 05:26
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.

Sunburst: data labels re-animate when points are programmatically updated
3 participants