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

enable rotation of sunburst plots to change starting point #4728

Open
bishonen opened this issue Apr 3, 2020 · 6 comments
Open

enable rotation of sunburst plots to change starting point #4728

bishonen opened this issue Apr 3, 2020 · 6 comments
Labels
feature something new P3 backlog

Comments

@bishonen
Copy link

bishonen commented Apr 3, 2020

Hi,

adding the option to decide at which angle the sunburst chart starts would be a nice feature. Currently the first slice is rendered at 90 degrees.

@archmoj archmoj added the feature something new label Apr 3, 2020
@archmoj
Copy link
Contributor

archmoj commented Apr 7, 2020

@bishonen
In terms of roadmap, at the moment we aren't planning on working on this for the next few months, but if anyone here works for an organization that has a software budget, we do accept sponsorship for features, which would enable us to build this feature faster :)

@thierryVergult
Copy link
Contributor

+1 for this request.

Moving away from Highcharts, where this option is avaible.

@thierryVergult
Copy link
Contributor

The code to modify the angle is found in ./traces/sunburst/plot.js

        pt.rpx0 = y2rpx(pt.y0);
        pt.rpx1 = y2rpx(pt.y1);
        pt.xmid = (pt.x0 + pt.x1) / 2;
        pt.pxmid = rx2px(pt.rpx1, pt.xmid);
        pt.midangle = -(pt.xmid - Math.PI / 2);
        pt.startangle = -(pt.x0 - Math.PI / 2);
        pt.stopangle = -(pt.x1 - Math.PI / 2);
        pt.halfangle = 0.5 * Math.min(Lib.angleDelta(pt.x0, pt.x1) || Math.PI, Math.PI);
        pt.ring = 1 - (pt.rpx0 / pt.rpx1);
        pt.rInscribed = getInscribedRadiusFraction(pt, trace);

Adding a value (in radians) to x0 & x1 worked for my 1st test

...
pt.x0 = pt.x0 + (Math.PI / 2); // adding 90 degrees to x0
pt.x1 = pt.x1 + (Math.PI / 2); // adding 90 degrees to x1

    pt.rpx0 = y2rpx(pt.y0);
    pt.rpx1 = y2rpx(pt.y1);
    pt.xmid = (pt.x0 + pt.x1) / 2;

...

I will explore how to turn this in a configuration option.

@gvwilson
Copy link
Contributor

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

@janosh
Copy link

janosh commented Jun 24, 2024

i'd be happy to sponsor this feature with 100 USD

@gvwilson gvwilson reopened this Jun 24, 2024
@gvwilson gvwilson self-assigned this Jun 24, 2024
@gvwilson
Copy link
Contributor

THanks @janosh - I'll see if I can find someone to do the work.

@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson changed the title Sunburst Rotation (Starting point) enable rotation of sunburst plots to change starting point Aug 9, 2024
@gvwilson gvwilson added the P3 backlog label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P3 backlog
Projects
None yet
Development

No branches or pull requests

5 participants