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
I'm currently working on a charting library that would benefit from having direct access to the interpolation functions available for d3.svg.line/area. Would it be reasonable to create a pull request that does the following:
Break out the interpolators from svg/line.js and puts them into svg/interpolators.js
Refactor the default available interpolator functions from d3_svg_lineLinear to d3.svg.interpolators.linear and so on.
Thoughts?
The text was updated successfully, but these errors were encountered:
I’m probably on board with this, though I want to think through the API a little bit before we make it public.
Could you elaborate a little bit on how you plan on using these methods? I’m also curious whether it’s necessary to expose these methods directly, or to just use a d3.svg.line instance to do the interpolation for you?
We expose an .interpolate method, like d3 does, but it only takes in functions as a parameter, as opposed to either a function or a string. The reasons we chose to do this are because we wanted:
consistency between the getter/setter methods (you always get/set a function)
to not be tied to strings specified in d3 that correspond to interpolation functions.
Using a d3.svg.line instance for retrieving interpolation functions seems a little problematic because one would end up creating an instance for no reason other than retrieving instance functions that should have been static in the first place. In addition, given that the interpolation functions are also being used on d3.svg.area, separating interpolators into a higher level (d3.svg.interpolator) might be a cleaner approach.
I'm currently working on a charting library that would benefit from having direct access to the interpolation functions available for d3.svg.line/area. Would it be reasonable to create a pull request that does the following:
d3_svg_lineLinear
tod3.svg.interpolators.linear
and so on.Thoughts?
The text was updated successfully, but these errors were encountered: