d3-component icon indicating copy to clipboard operation
d3-component copied to clipboard

Create React Interop Examples

Open curran opened this issue 7 years ago • 2 comments

(Excerpted from a discussion on the D3 Slack)

The thought "d3-component as a replacement for React's Component, as it basically replicates its functionality" is correct. But I also recognize that they need to play well together. It is possible to create a general-purpose shim between them, to create a React component "wrapper" or "wrapper factory" around any component authored using d3-component. I've been meaning to make this, or at least a PoC for it, but have not yet. It would translate into simply passing the props from the React component render function into the d3-component instance. I'd welcome a PoC for this.

curran avatar Mar 21 '17 13:03 curran

The first step would be to create a working example where a React component wraps around a specific d3-component. Maybe the Airport Clocks would be a good example?

Would be cool to have a "React Analog Clock" component up on NPM!

curran avatar Mar 25 '17 12:03 curran

You might want to look at this: https://github.com/skellyb/react-d3-wrap. It seems like he has already implemented a D3 component wrapper - might be able adapt it.

warrenronsiek avatar Apr 11 '17 18:04 warrenronsiek