Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.7k
fix: custom category order was hard-coded#5000
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
"On Route", | ||
"Delivered", | ||
] | ||
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.
I was doing a similar fix 🙈
You could also add the comparison withgo.Pie
:
values_=np.array([x[0]forxinsorted(zip(data["count"],data["status"]),key=lambdat:custom_order.index(t[1])) ])trace=go.Pie(values=values_,labels=custom_order, )_compare_figures(trace,fig)
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.
yup, thanks for reviewing!
nw.col("b") | ||
.replace_strict(order,range(len(order)), return_dtype=nw.UInt32) | ||
nw.col(names) | ||
.replace_strict(order,np.arange(len(order)), return_dtype=nw.UInt32) |
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.
@MarcoGorelli What's the reason for usingnp.arange
here rather thanrange
? Is there a performance difference?
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,@FBruzzesi had noted that it was generally more performant, and numpy is still required in plotly express anyway - no objections to changing this back of course!
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.
Yup, makes sense to me, thanks!
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.
Looks good@MarcoGorelli , thanks for the fix. 🎉
thanks for your review! |
d974535
intoplotly:masterUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
closes#4999