-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPairPlot.stories.jsx
86 lines (78 loc) · 1.94 KB
/
PairPlot.stories.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import React from 'react';
import { assoc } from 'ramda';
import PairPlot from '../src/PairPlot';
import cars from './assets/cars.json';
import carsTypes from './assets/cars.types.json';
import penguins from './assets/penguins.json';
import penguinsTypes from './assets/penguins.types.json';
import satellites from './assets/satellites.json';
import satellitesTypes from './assets/satellites.types.json';
export default {
title: 'PairPlot',
component: PairPlot,
argTypes: {},
};
function Template(args) {
return <PairPlot {...args} />;
}
export const Count = Template.bind({});
Count.args = {
data: [
{ cat: 'Henry', count: 23 },
{ cat: 'Disco', count: 13 },
{ cat: 'Zelda', count: 7 },
],
types: {
cat: 'nominal',
count: 'quantitative',
},
};
export const Cars = Template.bind({});
Cars.args = {
data: cars,
types: carsTypes,
};
export const Penguins = Template.bind({});
Penguins.args = {
data: penguins,
types: penguinsTypes,
};
export const Missing = Template.bind({});
Missing.args = {
data: penguins,
// The 'Sex' column has missing values, so we include it here with one nominal
// column and one numerical column.
types: (({ Sex, Species, 'Body Mass (g)': mass }) => ({
Sex,
Species,
'Body Mass (g)': mass,
}))(penguinsTypes),
};
export const Satellites = Template.bind({});
Satellites.args = {
data: satellites,
types: satellitesTypes,
};
export const Bar = Template.bind({});
Bar.args = {
data: [
{ animal: 'cat' },
{ animal: 'dog' },
{ animal: 'bird' },
{ animal: 'fish' },
{ animal: 'mouse' },
{ animal: 'hamster' },
{ animal: 'snake' },
{ animal: 'horse' },
{ animal: 'bat' },
{ animal: 'sloth' },
{ animal: 'lizard' },
{ animal: 'shark' },
{ animal: 'octopus' },
{ animal: 'insect' },
{ animal: 'smoot' },
]
.reverse()
.map((m, i) => assoc('count', 2 ** i, m)),
types: { animal: 'nominal', count: 'quantitative' },
};