Skip to content

react and d3 integration - #1

Open
david-trumid wants to merge 3 commits into
rhyolight:react-d3-interactionfrom
david-trumid:dave/react
Open

react and d3 integration#1
david-trumid wants to merge 3 commits into
rhyolight:react-d3-interactionfrom
david-trumid:dave/react

Conversation

@david-trumid

Copy link
Copy Markdown
  • Renamed react files to .jsx
  • Added very basic listing (babel with eslint) - just remove the .eslintrc.json file to turn it off (I recommend keeping it)
  • Made a helpers file to keep some common functions
  • Made BasicScalarEncoder (along side SimpleScalarEncoder so you can see old/new code if you want, I only reference BasicScalarEncode now in page)
  • Made a scrubbers folder to hold scrubber components (only did one for number - using hooks to show you an example of how you don’t need a React.Component just to use state)
    -- There is something wrong with the way the d3 is handling dragging (didn’t investigate too far though), I recommend just using something like dat.gui. Code is in Number.jsx
    --- I added a little section at top of page to show you an example (with all the changeable params)..you can remove it

Some suggestions..

  • Name files .jsx if it contains react components
  • Import React on first line
  • Add prop types if you can (I just use TypeScript which supports type checking and no need for prop types - but that is a bigger change)
  • Use object structuring if you can
  • Use const instead of let unless the value or reference will change

@david-trumid

Copy link
Copy Markdown
Author

feel free to change the tab/spacing didnt want to dig too deep into formatting and just let the linter style it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant