hettlage (94) [Avatar] Offline
#1
I'm a bit puzzled by the setting of the domain of the color scale for the iris plot. You point out that the reason for explicitly setting the domain is to avoid indeterminate behaviour. However, doesn't the expression data.map(colorValue) still depend on the ordering within the csv file, so that effectively the problem persists?
Curran Kelleher (6) [Avatar] Offline
#2
That's a great point.

I suppose this example doesn't really isolate the case where it would be useful/necessary to set the scale explicitly. In this example, the behavior is the same either way, and you're right that the ordering depends on the ordering from the CSV file.

To make it really deterministic, you'd probably want to sort the values before passing into the range.

I've encountered this need in projects where filtering is applied to the data, which depends on some configuration, and also with APIs that return results in inconsistent orders.

Thanks for the feedback! Maybe this is something I can incorporate into a future revision.