Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react and d3 integration #1

Open
wants to merge 3 commits into
base: react-d3-interaction
Choose a base branch
from

Conversation

david-trumid
Copy link

  • 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
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