Skip to content

Instantly share code, notes, and snippets.

View s-haensch's full-sized avatar

Steffen Hänsch s-haensch

View GitHub Profile
@s-haensch
s-haensch / App.js
Last active September 20, 2017 15:05
creating a strip plot - step 3
// ./src/components/App.js
import React from 'react';
import {scaleLinear} from 'd3-scale';
import _ from 'lodash';
class App extends React.Component {
stripLine(scale, dimensions, value, index) {
const {height, margin} = dimensions;
return (
@s-haensch
s-haensch / App.js
Last active September 20, 2017 15:05
creating a strip plot - step 2
// ./src/components/App.js
import React from 'react';
import {scaleLinear} from 'd3-scale';
class App extends React.Component {
render() {
const {width, height, margin} = this.props;
const scale = scaleLinear()
.domain([0, 100])
.range([margin.left, width - margin.right]);
@s-haensch
s-haensch / App.js
Last active September 20, 2017 15:05
creating a strip plot - step 1
// ./src/components/App.js
import React from 'react';
class App extends React.Component {
render() {
const {width, height, margin} = this.props;
return (
<svg
width={width}