You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
funmain(args:Array<String>) {
val scale = scaleLinear<Double>().domain(-100.0, 100.0).range(0.0, 100.0)
println(scale(0.0))
println(scale.invert(50.0)) // is this really supposed to throw?
}
The text was updated successfully, but these errors were encountered:
Ideally no, it wouldn't throw an IllegalStateException in this common case and I'll fix it so that it doesn't.
It's more complicated than it sounds. A DeinterpolatorFactory wasn't provided to the scale so it really doesn't have any idea how to invert R. However, for this exact reason I made scaleLinearreified R so that I can inspect R and provide default implementations of ReinterpolatorFactory and DeinterpolatorFactory in common cases. It looks like I did that for ReinterpolatorFactory but not DeinterpolatorFactory.
D3 handles this by providing a default deinterpolator factory which works on numbers, and ONLY on numbers. D3 doesn't allow you to invert if your range is non-numeric. In Kubed you can invert on a range of any type, but you've got to tell it how by providing a deinterpolator and comparator.
The text was updated successfully, but these errors were encountered: