@pie-lib/charting 5.1.0 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/lib/axes.js +33 -60
- package/lib/axes.js.map +1 -1
- package/lib/bars/bar.js +19 -30
- package/lib/bars/bar.js.map +1 -1
- package/lib/bars/common/bars.js +30 -46
- package/lib/bars/common/bars.js.map +1 -1
- package/lib/bars/histogram.js +19 -30
- package/lib/bars/histogram.js.map +1 -1
- package/lib/chart-setup.js +25 -30
- package/lib/chart-setup.js.map +1 -1
- package/lib/chart-type.js +2 -2
- package/lib/chart-type.js.map +1 -1
- package/lib/chart-types.js +2 -2
- package/lib/chart-types.js.map +1 -1
- package/lib/chart.js +38 -64
- package/lib/chart.js.map +1 -1
- package/lib/common/drag-handle.js +26 -41
- package/lib/common/drag-handle.js.map +1 -1
- package/lib/common/styles.js +7 -5
- package/lib/common/styles.js.map +1 -1
- package/lib/grid.js +19 -31
- package/lib/grid.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/line/common/drag-handle.js +24 -38
- package/lib/line/common/drag-handle.js.map +1 -1
- package/lib/line/common/line.js +40 -71
- package/lib/line/common/line.js.map +1 -1
- package/lib/line/line-cross.js +25 -39
- package/lib/line/line-cross.js.map +1 -1
- package/lib/line/line-dot.js +24 -38
- package/lib/line/line-dot.js.map +1 -1
- package/lib/mark-label.js +10 -20
- package/lib/mark-label.js.map +1 -1
- package/lib/plot/common/plot.js +30 -46
- package/lib/plot/common/plot.js.map +1 -1
- package/lib/plot/dot.js +20 -31
- package/lib/plot/dot.js.map +1 -1
- package/lib/plot/line.js +21 -32
- package/lib/plot/line.js.map +1 -1
- package/lib/tool-menu.js +19 -32
- package/lib/tool-menu.js.map +1 -1
- package/lib/utils.js +5 -3
- package/lib/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/axes.jsx +1 -1
- package/src/bars/common/bars.jsx +1 -1
- package/src/chart-setup.jsx +21 -24
- package/src/chart-type.js +21 -23
- package/src/line/common/line.jsx +1 -1
- package/src/plot/common/plot.jsx +1 -1
package/src/chart-setup.jsx
CHANGED
|
@@ -11,9 +11,8 @@ const ConfigureChartPanel = props => {
|
|
|
11
11
|
const { range } = model;
|
|
12
12
|
const size = model.graph;
|
|
13
13
|
|
|
14
|
-
const rangeProps = chartType =>
|
|
15
|
-
|
|
16
|
-
};
|
|
14
|
+
const rangeProps = chartType =>
|
|
15
|
+
chartType.includes('Plot') ? { min: 3, max: 10 } : { min: 0.05, max: 10000 };
|
|
17
16
|
|
|
18
17
|
const onSizeChanged = (key, value) => {
|
|
19
18
|
const graph = { ...size, [key]: value };
|
|
@@ -29,7 +28,24 @@ const ConfigureChartPanel = props => {
|
|
|
29
28
|
onChange({ ...model, range });
|
|
30
29
|
};
|
|
31
30
|
|
|
32
|
-
const onChartTypeChange = chartType =>
|
|
31
|
+
const onChartTypeChange = chartType => {
|
|
32
|
+
if (chartType.includes('Plot')) {
|
|
33
|
+
rangeProps.min = 3;
|
|
34
|
+
rangeProps.max = 10;
|
|
35
|
+
|
|
36
|
+
if (range.max > 10 || range.max < 3) {
|
|
37
|
+
range.max = 10;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
range.step = 1;
|
|
41
|
+
range.labelStep = 1;
|
|
42
|
+
onChange({ ...model, range, chartType });
|
|
43
|
+
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
onChange({ ...model, chartType });
|
|
48
|
+
};
|
|
33
49
|
|
|
34
50
|
return (
|
|
35
51
|
<div className={classes.wrapper}>
|
|
@@ -47,26 +63,7 @@ const ConfigureChartPanel = props => {
|
|
|
47
63
|
onChange={(e, v) => onRangeChanged('max', v)}
|
|
48
64
|
/>
|
|
49
65
|
</div>
|
|
50
|
-
|
|
51
|
-
<NumberTextFieldCustom
|
|
52
|
-
className={classes.mediumTextField}
|
|
53
|
-
label="Grid Interval"
|
|
54
|
-
value={range.step}
|
|
55
|
-
min={0}
|
|
56
|
-
max={10000}
|
|
57
|
-
variant="outlined"
|
|
58
|
-
onChange={(e, v) => onRangeChanged('step', v)}
|
|
59
|
-
/>
|
|
60
|
-
<NumberTextFieldCustom
|
|
61
|
-
className={classes.mediumTextField}
|
|
62
|
-
label={'Label Interval'}
|
|
63
|
-
value={range.labelStep}
|
|
64
|
-
min={0}
|
|
65
|
-
max={10000}
|
|
66
|
-
variant={'outlined'}
|
|
67
|
-
onChange={(e, v) => onRangeChanged('labelStep', v)}
|
|
68
|
-
/>
|
|
69
|
-
</div>
|
|
66
|
+
{!model.chartType.includes('Plot') && stepConfig}
|
|
70
67
|
<div className={classes.dimensions}>
|
|
71
68
|
<div>
|
|
72
69
|
<Typography>Dimensions(px)</Typography>
|
package/src/chart-type.js
CHANGED
|
@@ -13,29 +13,27 @@ const ChartType = withStyles(theme => ({
|
|
|
13
13
|
chartTypeLabel: {
|
|
14
14
|
backgroundColor: 'transparent'
|
|
15
15
|
}
|
|
16
|
-
}))(({ onChange, value, classes }) =>
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</InputLabel>
|
|
16
|
+
}))(({ onChange, value, classes }) => (
|
|
17
|
+
<div className={classes.chartType}>
|
|
18
|
+
<FormControl variant={'outlined'} className={classes.chartType}>
|
|
19
|
+
<InputLabel htmlFor="type-helper" className={classes.chartTypeLabel}>
|
|
20
|
+
ChartType
|
|
21
|
+
</InputLabel>
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
23
|
+
<Select
|
|
24
|
+
value={value}
|
|
25
|
+
onChange={onChange}
|
|
26
|
+
input={<OutlinedInput name="type" id="type-helper" />}
|
|
27
|
+
>
|
|
28
|
+
<MenuItem value={'histogram'}>Histogram</MenuItem>
|
|
29
|
+
<MenuItem value={'bar'}>Bar</MenuItem>
|
|
30
|
+
<MenuItem value={'lineDot'}>Line Dot</MenuItem>
|
|
31
|
+
<MenuItem value={'lineCross'}>Line Cross</MenuItem>
|
|
32
|
+
<MenuItem value={'dotPlot'}>Dot Plot</MenuItem>
|
|
33
|
+
<MenuItem value={'linePlot'}>Line Plot</MenuItem>
|
|
34
|
+
</Select>
|
|
35
|
+
</FormControl>
|
|
36
|
+
</div>
|
|
37
|
+
));
|
|
40
38
|
|
|
41
39
|
export default ChartType;
|
package/src/line/common/line.jsx
CHANGED
|
@@ -94,7 +94,7 @@ export class RawLine extends React.Component {
|
|
|
94
94
|
{lineToUse &&
|
|
95
95
|
lineToUse.map((point, i) => {
|
|
96
96
|
const r = 6;
|
|
97
|
-
const enableDraggable = defineChart
|
|
97
|
+
const enableDraggable = defineChart || point.interactive;
|
|
98
98
|
const Component = enableDraggable ? DraggableHandle : DragHandle;
|
|
99
99
|
|
|
100
100
|
return (
|
package/src/plot/common/plot.jsx
CHANGED
|
@@ -151,7 +151,7 @@ export class Plot extends React.Component {
|
|
|
151
151
|
<Bar
|
|
152
152
|
value={d.value}
|
|
153
153
|
label={d.label}
|
|
154
|
-
interactive={defineChart
|
|
154
|
+
interactive={defineChart || d.interactive}
|
|
155
155
|
xBand={xBand}
|
|
156
156
|
index={index}
|
|
157
157
|
key={`bar-${d.label}-${d.value}-${index}`}
|