visx icon indicating copy to clipboard operation
visx copied to clipboard

change examples to have passed-in data

Open ianstormtaylor opened this issue 3 years ago • 4 comments

Right now most of the examples I've seen use static data supplied by import statements. But I think the examples themselves should take the data in as a prop instead, because that is how most people will need to write their components.

This has downstream effects because most of the uses of scales and data transformations are defined outside the React components, but this doesn't fly in real-world use cases, where useMemo should be used instead.

Overall it just makes it more taxing to translate from examples when trying to build new charts.

ianstormtaylor avatar May 05 '21 18:05 ianstormtaylor

Hey @ianstormtaylor thanks for checking out visx and for this request. It's a lot of work to refactor 30+ examples in this way/we don't currently have the bandwidth to do that, but I'm happy to review any PRs refactoring examples in this way.

williaster avatar May 06 '21 18:05 williaster

@ianstormtaylor Are you working on this? If not, I guess it would be something good for me to work on. @williaster Would you prefer all of the examples refactored in 1 pull request?

dennisja avatar May 26 '21 20:05 dennisja

Hey @dennisja 👋 , sweet! I think it'd be easiest to review these as separate PRs because there's ~30 examples which would be a huge PR.

williaster avatar May 27 '21 22:05 williaster

Hey @williaster and @dennisja I'm happy to tackle refactoring some of these examples in a separate PR as well, if more help is needed

csdiehl avatar Oct 05 '23 06:10 csdiehl