Skip to content

Instantly share code, notes, and snippets.

@tmeasday
Last active May 16, 2017 06:25
Show Gist options
  • Select an option

  • Save tmeasday/43db17a3ee4772added8295708f91320 to your computer and use it in GitHub Desktop.

Select an option

Save tmeasday/43db17a3ee4772added8295708f91320 to your computer and use it in GitHub Desktop.
import { storiesOf } from '@kadira/storybook';
import Histogram from './Histogram';
const latencies = [];
for (var i = 20; i <= 120; i += 20) {
latencies.push(i);
}
storiesOf('Histogram')
.add('Typical', () => <Histogram data={latencies.map(latency => ({
latency,
count: 5000 + Math.random() * 15000,
}))} />)
.add('Low data', () => <Histogram data={latencies.map(latency => ({
latency,
count: latency === 110 ? 5000 + Math.random() * 15000 : Math.random() * 1000,
}))} />)
.add('No data', () => <Histogram data={latencies.map(latency => ({latency, count: 0}))} />)
.add('Loading', () => <Histogram loading={true} />);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment