1

All:

I am pretty new to React-Motion, most examples on its github is about how to interpolate single number, I wonder I want to apply a array of data objects to it, how can I implement this?

My use case is to implement same effect of transition from D3 for svg path

I am thinking something like:

<Transition data={data}>
    {
        (interpolateData)=> {
             return <path d={interpolateData} />
        }
    }
</Transition>

Thanks

Kuan
  • 11,149
  • 23
  • 93
  • 201
  • d3 ships with `interpolate`, I'm 100% positive you can achieve what you want with that https://github.com/d3/d3-interpolate – azium Oct 20 '16 at 22:01
  • @azium Thanks, could you show me a demo how to integrate it into react component? – Kuan Oct 20 '16 at 22:07
  • I could... but have you written any code yet? Can you show us your svg setup so that I can tailor my answer to your specific situation, and the parameters you would like to animate? – azium Oct 20 '16 at 22:13
  • @azium Ok, I will update my question – Kuan Oct 20 '16 at 22:20
  • @azium I do not need any param other than data – Kuan Oct 20 '16 at 22:34
  • I have the same issue and am not able to find an example. The effect is in this [example](http://bl.ocks.org/duopixel/4063326) using React. I have tried using React-motion with strokeDashoffset and strokeDasharray and the total length of the path but haven't succeeded. My [pen](https://codepen.io/tormod17/pen/GEeeNG?editors=0011). @azium any direction on this. – Tormod Smith Jul 15 '17 at 12:34

0 Answers0