Slide 1

Slide 1 text

React Native and D3JS hswolff @hswolff

Slide 2

Slide 2 text

Harry Wolff Senior UI Engineer @ MongoDB.com Blog @ hswolff.com Twitter @ hswolff GitHub @ hswolff

Slide 3

Slide 3 text

What do I know about React Native?

Slide 4

Slide 4 text

Chartbeat iOS http://blog.chartbeat.com/2016/04/07/say-hello-to-the-all-new-chartbeat-ios-app/

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

What is React Native?

Slide 7

Slide 7 text

A framework for building native apps with React

Slide 8

Slide 8 text

“React Native lets you build mobile apps using only JavaScript. It uses the same design as React, letting you compose a rich mobile UI from declarative components.” https://facebook.github.io/react-native/

Slide 9

Slide 9 text

https://facebook.github.io/react-native/

Slide 10

Slide 10 text

What is D3JS?

Slide 11

Slide 11 text

“a JavaScript library for manipulating documents based on data” https://d3js.org/

Slide 12

Slide 12 text

“D3 helps you bring data to life using HTML, SVG, and CSS.” https://d3js.org/

Slide 13

Slide 13 text

https://d3js.org/

Slide 14

Slide 14 text

D3 4.0 Now Modular

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

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.”

Slide 18

Slide 18 text

d3-scale https://github.com/d3/d3-scale

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

d3-scale https://github.com/d3/d3-scale

Slide 21

Slide 21 text

d3-shape https://github.com/d3/d3-shape

Slide 22

Slide 22 text

d3-shape https://github.com/d3/d3-shape “line generator can then be used to compute the d attribute of an SVG path element”

Slide 23

Slide 23 text

SVG 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.”

Slide 24

Slide 24 text

d3-shape https://github.com/d3/d3-shape

Slide 25

Slide 25 text

d3-scale https://github.com/d3/d3-shape

Slide 26

Slide 26 text

How does D3JS work with React Native?

Slide 27

Slide 27 text

ART https://github.com/sebmarkbage/art “ART is a retained mode vector drawing API”

Slide 28

Slide 28 text

ART https://github.com/sebmarkbage/art

Slide 29

Slide 29 text

ART https://github.com/sebmarkbage/art

Slide 30

Slide 30 text

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.”

Slide 31

Slide 31 text

React ART https://github.com/reactjs/react-art

Slide 32

Slide 32 text

React Native ART https://github.com/facebook/react-native/tree/master/

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

What are we making?

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

Open Sourced https://github.com/hswolff/ BetterWeather

Slide 37

Slide 37 text

Let’s Build

Slide 38

Slide 38 text

Link ART https://facebook.github.io/react-native/docs/linking- libraries-ios.html#manual-linking

Slide 39

Slide 39 text

WeatherPage.js

Slide 40

Slide 40 text

WeatherPage.js

Slide 41

Slide 41 text

WeatherGraph.js

Slide 42

Slide 42 text

WeatherGraph.js

Slide 43

Slide 43 text

WeatherGraph.js

Slide 44

Slide 44 text

WeatherGraph.js

Slide 45

Slide 45 text

WeatherGraph.js

Slide 46

Slide 46 text

WeatherGraph.js

Slide 47

Slide 47 text

WeatherGraph.js

Slide 48

Slide 48 text

WeatherGraph.js

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

https://developer.forecast.io/

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

WeatherGraph.js

Slide 53

Slide 53 text

WeatherGraph.js

Slide 54

Slide 54 text

graph-utils.js

Slide 55

Slide 55 text

graph-utils.js

Slide 56

Slide 56 text

graph-utils.js

Slide 57

Slide 57 text

graph-utils.js

Slide 58

Slide 58 text

graph-utils.js

Slide 59

Slide 59 text

graph-utils.js

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

graph-utils.js

Slide 63

Slide 63 text

graph-utils.js

Slide 64

Slide 64 text

graph-utils.js

Slide 65

Slide 65 text

WeatherGraph.js

Slide 66

Slide 66 text

WeatherGraph.js

Slide 67

Slide 67 text

WeatherGraph.js

Slide 68

Slide 68 text

WeatherGraph.js

Slide 69

Slide 69 text

WeatherGraph.js

Slide 70

Slide 70 text

Let’s Animate

Slide 71

Slide 71 text

WeatherGraph.js WeatherPage.js

Slide 72

Slide 72 text

WeatherPage.js WeatherGraph.js

Slide 73

Slide 73 text

WeatherGraph.js WeatherPage.js

Slide 74

Slide 74 text

WeatherGraph.js WeatherPage.js

Slide 75

Slide 75 text

WeatherGraph.js WeatherPage.js

Slide 76

Slide 76 text

WeatherGraph.js WeatherPage.js

Slide 77

Slide 77 text

WeatherGraph.js WeatherPage.js

Slide 78

Slide 78 text

WeatherGraph.js WeatherPage.js

Slide 79

Slide 79 text

WeatherGraph.js WeatherPage.js

Slide 80

Slide 80 text

WeatherGraph.js

Slide 81

Slide 81 text

WeatherGraph.js

Slide 82

Slide 82 text

No content

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

No content

Slide 93

Slide 93 text

No content

Slide 94

Slide 94 text

No content

Slide 95

Slide 95 text

No content

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

React Native and D3JS hswolff @hswolff https://speakerdeck.com/hswolff/react-native-and-d3js