@pie-lib/charting 4.5.11-next.434 → 4.5.11-next.457

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.
Files changed (46) hide show
  1. package/lib/axes.js +32 -59
  2. package/lib/axes.js.map +1 -1
  3. package/lib/bars/bar.js +19 -30
  4. package/lib/bars/bar.js.map +1 -1
  5. package/lib/bars/common/bars.js +29 -45
  6. package/lib/bars/common/bars.js.map +1 -1
  7. package/lib/bars/histogram.js +19 -30
  8. package/lib/bars/histogram.js.map +1 -1
  9. package/lib/chart-setup.js +49 -30
  10. package/lib/chart-setup.js.map +1 -1
  11. package/lib/chart-type.js +2 -2
  12. package/lib/chart-type.js.map +1 -1
  13. package/lib/chart-types.js +2 -2
  14. package/lib/chart-types.js.map +1 -1
  15. package/lib/chart.js +38 -64
  16. package/lib/chart.js.map +1 -1
  17. package/lib/common/drag-handle.js +26 -41
  18. package/lib/common/drag-handle.js.map +1 -1
  19. package/lib/common/styles.js +7 -5
  20. package/lib/common/styles.js.map +1 -1
  21. package/lib/grid.js +19 -31
  22. package/lib/grid.js.map +1 -1
  23. package/lib/index.js +2 -2
  24. package/lib/index.js.map +1 -1
  25. package/lib/line/common/drag-handle.js +24 -38
  26. package/lib/line/common/drag-handle.js.map +1 -1
  27. package/lib/line/common/line.js +39 -70
  28. package/lib/line/common/line.js.map +1 -1
  29. package/lib/line/line-cross.js +25 -39
  30. package/lib/line/line-cross.js.map +1 -1
  31. package/lib/line/line-dot.js +24 -38
  32. package/lib/line/line-dot.js.map +1 -1
  33. package/lib/mark-label.js +10 -20
  34. package/lib/mark-label.js.map +1 -1
  35. package/lib/plot/common/plot.js +29 -45
  36. package/lib/plot/common/plot.js.map +1 -1
  37. package/lib/plot/dot.js +20 -31
  38. package/lib/plot/dot.js.map +1 -1
  39. package/lib/plot/line.js +21 -32
  40. package/lib/plot/line.js.map +1 -1
  41. package/lib/tool-menu.js +19 -32
  42. package/lib/tool-menu.js.map +1 -1
  43. package/lib/utils.js +5 -3
  44. package/lib/utils.js.map +1 -1
  45. package/package.json +2 -2
  46. package/src/chart-setup.jsx +42 -21
@@ -11,6 +11,29 @@ const ConfigureChartPanel = props => {
11
11
  const { range } = model;
12
12
  const size = model.graph;
13
13
 
14
+ const stepConfig = (
15
+ <div className={classes.rowView}>
16
+ <NumberTextFieldCustom
17
+ className={classes.mediumTextField}
18
+ label="Grid Interval"
19
+ value={range.step}
20
+ min={0}
21
+ max={10000}
22
+ variant="outlined"
23
+ onChange={(e, v) => onRangeChanged('step', v)}
24
+ />
25
+ <NumberTextFieldCustom
26
+ className={classes.mediumTextField}
27
+ label={'Label Interval'}
28
+ value={range.labelStep}
29
+ min={0}
30
+ max={10000}
31
+ variant={'outlined'}
32
+ onChange={(e, v) => onRangeChanged('labelStep', v)}
33
+ />
34
+ </div>
35
+ );
36
+
14
37
  const rangeProps = chartType => {
15
38
  return chartType.includes('Plot') ? { min: 3, max: 10 } : { min: 0.05, max: 10000 };
16
39
  };
@@ -29,7 +52,24 @@ const ConfigureChartPanel = props => {
29
52
  onChange({ ...model, range });
30
53
  };
31
54
 
32
- const onChartTypeChange = chartType => onChange({ ...model, chartType });
55
+ const onChartTypeChange = chartType => {
56
+ if (chartType.includes('Plot')) {
57
+ rangeProps.min = 3;
58
+ rangeProps.max = 10;
59
+
60
+ if (range.max > 10 || range.max < 3) {
61
+ range.max = 10;
62
+ }
63
+
64
+ range.step = 1;
65
+ range.labelStep = 1;
66
+ onChange({ ...model, range, chartType });
67
+
68
+ return;
69
+ }
70
+
71
+ onChange({ ...model, chartType });
72
+ };
33
73
 
34
74
  return (
35
75
  <div className={classes.wrapper}>
@@ -47,26 +87,7 @@ const ConfigureChartPanel = props => {
47
87
  onChange={(e, v) => onRangeChanged('max', v)}
48
88
  />
49
89
  </div>
50
- <div className={classes.rowView}>
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>
90
+ {!model.chartType.includes('Plot') && stepConfig}
70
91
  <div className={classes.dimensions}>
71
92
  <div>
72
93
  <Typography>Dimensions(px)</Typography>