MIT-CAVE / cave_static

A react based static web app to be used as a UI and data consumer for the CAVE app.
Apache License 2.0
0 stars 1 forks source link

When sorting / ordering groupings, parent levels should be respected. #475

Closed connor-makowski closed 8 months ago

connor-makowski commented 9 months ago

Consider the following example:

Dates: Jan 01, Jan 02, Feb 01, Feb 02

With Month being a parent of Date.

Assuming I order:

Month: Jan, Feb Date: 01, 02

I would expect any chart with group by Date to show an axis of Jan 01, Jan 02, Feb 01, Feb 02 In that order.

Currently this would output: Feb 01, Jan 01, Feb 02, Jan 02

mrkwanzaa commented 8 months ago

Reopening this to allow for exceptions to be specified in the API

mrkwanzaa commented 8 months ago

I've added the orderingWithParent key which can be set to false to stop that level and any children from looking at orderings above the specified level. See the example below or kitchen_sink.py

"state": {
                            "name": "States",
                            "parent": "country",
                            "ordering": ["Michigan", "Florida", "Indiana", "Massachusetts", "Ontario"],
                            "orderWithParent": False, # True if not specified
                        },