Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
inferRadialDomain relies on the heuristic h25 = "median of 25% quantiles of the r channel across marks".
It sets the domain [0, h25] with a default range of [0, 3].
The problem is that "domain" and "range" carry little information about the actual extent of the values (in data or pixel space), and unless you know how the sausage is made you can't really guess how to change either domain or range to meet your visual requirements (though fixing the two solves everything).
With this commit, the default domain becomes the actual extent of values in data space, and the default range are the corresponding values in pixel space, based on the h25 heuristic (in other words, the scale is chosen in a way that r(0) = 0 and r(h25) = 3, and its domain is the data's extent).
Setting the range to [2, 10] (without setting the domain) will make the smallest dot have a radius of 2 and the largest a radius of 10. This is crystal-clear.
Setting the domain alone (without setting the range) does not change the chart at all, but allows the user to change the extent of a potential future radius legend.
In the case of the http://localhost:8008/?test=diamondsCaratPriceDots test, I had to change add an explicit range: [0,3] to the domain: [0, 100], in order to have the set scale (100 values => a dot of radius 3).
In the general case (no indication given by the user), the heuristic is preserved exactly (only precision issues make the test svgs change).