terezka / elm-charts

Create SVG charts in Elm.
https://www.elm-charts.org
BSD 3-Clause "New" or "Revised" License
736 stars 67 forks source link

Is it possible to write our own custom implementation of CE.getNearest? #115

Open Arrow7000 opened 2 years ago

Arrow7000 commented 2 years ago

As far as I can tell it seems like it's not possible to create our own implementation of functions of type:

customFunc : Remodel (One data Any) (Item result) -> Decoder data (List (Item result))

which is what CE.onMouseMove expects for its 2nd parameter, because both Remodel and Decoder don't have their constructors exposed.

So if I want to write a custom implementation of CE.getNearest, e.g. one that can return the n nearest items instead of just the single nearest one, how would I do that?

terezka commented 11 months ago

Hi! I'm adding both a default option to return nearest items and an option to customize your own decoder in the next version. Thanks!