-
Notifications
You must be signed in to change notification settings - Fork 16
/
ScatterPlot.jsx
44 lines (40 loc) · 1014 Bytes
/
ScatterPlot.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
import d3 from 'd3';
import { PropTypes } from 'react';
import D3ReactBase from '../charts/D3ReactBase';
import ScatterPlotImpls from './ScatterPlotImpls';
import './style.scss';
export default class ScatterPlot extends D3ReactBase {
constructor (props) {
super(props);
this.chartConstructor = ScatterPlotImpls;
}
static propTypes = {...D3ReactBase.propTypes,
dotRadiusScale: PropTypes.func,
dotRadius: PropTypes.number,
dotRadiusAccessor: PropTypes.func,
dotColorScale: PropTypes.func,
dotColorAccessor: PropTypes.func
};
static defaultProps = {...D3ReactBase.defaultProps,
xScale: d3.scale.linear(),
yScale: d3.scale.linear(),
className: 'scatterplot',
dotRadius: 3,
xaxis: {
className: 'x axis',
orient: 'bottom',
position: 'bottom',
attr: {
dx: '0',
dy: '0.5em'
},
style: {
'text-anchor': 'middle'
}
},
yaxis: {
className: 'y axis',
orient: 'left',
}
};
}