Upgrade to Pro — share decks privately, control downloads, hide ads and more …

React Native and D3 Workshop

React Native and D3 Workshop

Harry Wolff

January 19, 2017
Tweet

More Decks by Harry Wolff

Other Decks in Programming

Transcript

  1. React Native …creates a bridge between JavaScript and Native Code

    (iOS / Android) …and handles passing information between the two environments More details: http://tadeuzagallo.com/ blog/react-native-bridge/
  2. Exercise 1 1. You should have node, watchman, and either

    Xcode or Android Studio installed. 2. Install React Native CLI: npm install -g react- native-cli 3. react-native init ReactNativeAndD3Workshop 4. cd ReactNativeAndD3Workshop/ 5. react-native run-ios (or react-native run-android)
  3. SVG • XML: markup language • Human and machine readable

    • Vector image: use of polygons to represent images • Can be resized without losing quality
  4. SVG Elements • Root element: SVG • Creates an SVG

    fragment, own viewport and coordinate system • Graphic elements: <circle>, <ellipse>, <image>, <line>, <mesh>, <path>, <polygon>, <polyline>, <rect>, <text>, <use>
  5. SVG <path> https://developer.mozilla.org/en-US/docs/Web/SVG/ Tutorial/Paths “Paths create complex shapes by combining

    multiple straight lines or curved lines” “The shape of a path element is defined by one attribute: d.”
  6. SVG <path> Create graphics using line commands Move to x

    10, y 10 Horizontal line of 90 Vertical line of 90 Horizontal line of 10 Line to x 10, y 10
  7. d3-scale https://github.com/d3/d3-scale “Continuous scales map a continuous, quantitative input domain

    to a continuous output range.” Continuous Scales “Given a value from the domain, returns the corresponding value from the range.”
  8. d3-scale https://github.com/d3/d3-scale “Time scales are a variant of linear scales

    that have a temporal domain: domain values are coerced to dates rather than numbers" Time Scales
  9. React ART https://github.com/reactjs/react-art “React ART is a JavaScript library for

    drawing vector graphics using React.” “It provides declarative and reactive bindings to the ART library.”