-
-
Notifications
You must be signed in to change notification settings - Fork 668
Description
Our ordinal type has long history since the original version.
I've feeling more and more that it's a mistake.
The only thing "ordinal" really does in the whole compiler is we use "ordinal" color scheme instead of "category" when we use it with color scale.
More importantly, the keyword alone is incomplete because the keyword "ordinal" alone doesn't tell the order. Users still have to specify custom sort order (e.g., "sort": ["small", "medium", "large"]) anyway.
Basically there is also no difference between:
x: {field: 'size', type: 'nominal', sort: ["small", "medium", "large"]}
and
x: {field: 'size', type: 'ordinal', sort: ["small", "medium", "large"]}
So having "ordinal" in the language is simply just confusing because the keyword doesn't do anything related to order.
In a way, some books even just call nominal "unordered categorical" and ordinal "ordered categorical".
I think we should consider deprecating it in VL 5.0 (with backward compatibility so we don't break people's code) so we can simplify both the documentation and the internal code.
For internal code, there are several places that we have to check if the type is either nominal or ordinal, even the ordinal bit is never useful beyond the color range.
This is also related to the discussion about adding cyclical type #6590