-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Added checkbox in dist_bar viz to enable sorting of bars based on x axis labels #1379
Conversation
@@ -1316,6 +1316,7 @@ class DistributionBarViz(DistributionPieViz): | |||
('y_axis_format', 'bottom_margin'), | |||
('x_axis_label', 'y_axis_label'), | |||
('reduce_x_ticks', 'contribution'), | |||
('order_bars'), |
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.
('order_bars', None)
will render using half the column so that the checkbox is not too far away from the label.
'order_bars': (BetterBooleanField, { | ||
"label": _("Sort Bars"), | ||
"default": False, | ||
"description": "Sort bars by x labels" |
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.
_("Sort bars by x labels"),
for translation, and don't forget the trailing comma
Updated checkbox and tooltip message @mistercrunch |
I have a question about this logic: https://github.com/airbnb/caravel/blob/63161b11c347d5a6d62f7ae7dc91fa3c30b5dc93/caravel/models.py#L1093 |
LGTM! |
Hi,
As shown in the gif, checking sort bars and hit query button will work. Are
you on latest master?
…On Thu, Dec 15, 2016 at 6:23 PM, hongqp ***@***.***> wrote:
Sorry @vera-liu <https://github.com/vera-liu> . I used #1379
<#1379>, and already can saw the
"Sort Bars" checkbox on the page. But when I checked it and re-query, there
is nothing changed. How can I do if I want enable sorting of bars based on
x axis labels in dist_bar.
[image: default]
<https://cloud.githubusercontent.com/assets/11678296/21249373/7d08dc7e-c378-11e6-85be-1c27e031cd39.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1379 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AUAafrq38tOUylhiXMP2-crXIgwO07sQks5rIfYhgaJpZM4Kbgnc>
.
--
Best,
Vera
|
@vera-liu ,yes,it work when I updated the file “explore.0.12.0.entry.js”. |
@vera-liu unfortunately labels are sorted only alphabetically. In case of numeric labels the resulting order is 1, 10, 101, 11, 2, 21, 3 instead of 1, 2, 3, 10, 11, 21, 101. |
@vera-liu |
Done:
Issue:
#519
Checkbox:
![screen shot 2016-10-20 at 2 52 54 pm](https://cloud.githubusercontent.com/assets/20978302/19579361/10ee7d34-96d5-11e6-9ab1-23c24c7868bb.png)
Before ordering:
![screen shot 2016-10-19 at 2 42 01 pm](https://cloud.githubusercontent.com/assets/20978302/19538752/6d735fb4-960a-11e6-8258-2284a6eab8cb.png)
After toggling checkbox and click 'Query' button:
![screen shot 2016-10-19 at 2 42 18 pm](https://cloud.githubusercontent.com/assets/20978302/19538760/7be21ee6-960a-11e6-926c-3e6dbbe1dbd0.png)
needs-review @mistercrunch @ascott