@semcore/d3-chart 1.5.2 → 1.5.6

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 (93) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/lib/cjs/Area.js +15 -13
  3. package/lib/cjs/Area.js.map +1 -1
  4. package/lib/cjs/Axis.js +12 -12
  5. package/lib/cjs/Bar.js +21 -17
  6. package/lib/cjs/Bar.js.map +1 -1
  7. package/lib/cjs/Donut.js +77 -64
  8. package/lib/cjs/Donut.js.map +1 -1
  9. package/lib/cjs/Dots.js +8 -7
  10. package/lib/cjs/Dots.js.map +1 -1
  11. package/lib/cjs/GroupBar.js +8 -7
  12. package/lib/cjs/GroupBar.js.map +1 -1
  13. package/lib/cjs/HorizontalBar.js +21 -17
  14. package/lib/cjs/HorizontalBar.js.map +1 -1
  15. package/lib/cjs/Hover.js +3 -3
  16. package/lib/cjs/Line.js +14 -12
  17. package/lib/cjs/Line.js.map +1 -1
  18. package/lib/cjs/StackBar.js +39 -14
  19. package/lib/cjs/StackBar.js.map +1 -1
  20. package/lib/cjs/StackedArea.js +11 -9
  21. package/lib/cjs/StackedArea.js.map +1 -1
  22. package/lib/cjs/Tooltip.js +11 -11
  23. package/lib/cjs/Tooltip.js.map +1 -1
  24. package/lib/cjs/Venn.js +8 -8
  25. package/lib/cjs/Venn.js.map +1 -1
  26. package/lib/cjs/color.js +32 -30
  27. package/lib/cjs/color.js.map +1 -1
  28. package/lib/cjs/style/area.shadow.css +12 -2
  29. package/lib/cjs/style/bar.shadow.css +7 -2
  30. package/lib/cjs/style/donut.shadow.css +15 -0
  31. package/lib/cjs/style/dot.shadow.css +6 -1
  32. package/lib/cjs/style/line.shadow.css +6 -1
  33. package/lib/cjs/style/tooltip.shadow.css +5 -0
  34. package/lib/cjs/style/var.css +32 -0
  35. package/lib/cjs/style/venn.shadow.css +7 -1
  36. package/lib/es6/Area.js +15 -13
  37. package/lib/es6/Area.js.map +1 -1
  38. package/lib/es6/Axis.js +12 -12
  39. package/lib/es6/Bar.js +21 -17
  40. package/lib/es6/Bar.js.map +1 -1
  41. package/lib/es6/Donut.js +77 -64
  42. package/lib/es6/Donut.js.map +1 -1
  43. package/lib/es6/Dots.js +8 -7
  44. package/lib/es6/Dots.js.map +1 -1
  45. package/lib/es6/GroupBar.js +8 -7
  46. package/lib/es6/GroupBar.js.map +1 -1
  47. package/lib/es6/HorizontalBar.js +21 -17
  48. package/lib/es6/HorizontalBar.js.map +1 -1
  49. package/lib/es6/Hover.js +3 -3
  50. package/lib/es6/Line.js +14 -12
  51. package/lib/es6/Line.js.map +1 -1
  52. package/lib/es6/StackBar.js +39 -14
  53. package/lib/es6/StackBar.js.map +1 -1
  54. package/lib/es6/StackedArea.js +11 -9
  55. package/lib/es6/StackedArea.js.map +1 -1
  56. package/lib/es6/Tooltip.js +10 -10
  57. package/lib/es6/Tooltip.js.map +1 -1
  58. package/lib/es6/Venn.js +8 -8
  59. package/lib/es6/Venn.js.map +1 -1
  60. package/lib/es6/color.js +33 -31
  61. package/lib/es6/color.js.map +1 -1
  62. package/lib/es6/style/area.shadow.css +12 -2
  63. package/lib/es6/style/bar.shadow.css +7 -2
  64. package/lib/es6/style/donut.shadow.css +15 -0
  65. package/lib/es6/style/dot.shadow.css +6 -1
  66. package/lib/es6/style/line.shadow.css +6 -1
  67. package/lib/es6/style/tooltip.shadow.css +5 -0
  68. package/lib/es6/style/var.css +32 -0
  69. package/lib/es6/style/venn.shadow.css +7 -1
  70. package/lib/types/Bar.d.ts +1 -1
  71. package/lib/types/HorizontalBar.d.ts +1 -1
  72. package/package.json +1 -1
  73. package/src/Area.js +2 -3
  74. package/src/Bar.js +13 -10
  75. package/src/Donut.js +8 -7
  76. package/src/GroupBar.js +6 -2
  77. package/src/HorizontalBar.js +14 -10
  78. package/src/Line.js +2 -3
  79. package/src/StackBar.js +24 -7
  80. package/src/StackedArea.js +3 -2
  81. package/src/Tooltip.js +2 -2
  82. package/src/Venn.js +1 -1
  83. package/src/color.js +6 -32
  84. package/src/style/area.shadow.css +12 -2
  85. package/src/style/bar.shadow.css +7 -2
  86. package/src/style/donut.shadow.css +15 -0
  87. package/src/style/dot.shadow.css +6 -1
  88. package/src/style/line.shadow.css +6 -1
  89. package/src/style/tooltip.shadow.css +5 -0
  90. package/src/style/var.css +32 -0
  91. package/src/style/venn.shadow.css +7 -1
  92. package/src/types/Bar.d.ts +1 -1
  93. package/src/types/HorizontalBar.d.ts +1 -1
package/src/color.js CHANGED
@@ -1,35 +1,8 @@
1
- export const colors = {
2
- 'blue-01': '#50aef4',
3
- 'blue-02': '#91c7ef',
4
- 'blue-03': '#0e75c2',
5
- 'blue-04': '#d1e8f8',
6
- 'blue-05': '#084c80',
7
- 'green-01': '#3ab011',
8
- 'green-02': '#91d27b',
9
- 'green-03': '#278707',
10
- 'green-04': '#d1edc8',
11
- 'green-05': '#1a6700',
12
- 'orange-01': '#ff8e29',
13
- 'orange-02': '#fec089',
14
- 'orange-03': '#da6905',
15
- 'orange-04': '#ffe5cd',
16
- 'orange-05': '#a14e03',
17
- 'violet-01': '#890c85',
18
- 'violet-02': '#c783c5',
19
- 'violet-03': '#6e026b',
20
- 'violet-04': '#e7cbe6',
21
- 'violet-05': '#4d024b',
22
- 'red-01': '#e91e25',
23
- 'red-02': '#f69498',
24
- 'red-03': '#bd0000',
25
- 'red-04': '#fbd2d3',
26
- 'red-05': '#830005',
27
- 'yellow-01': '#ffc83f',
28
- 'yellow-02': '#ffdb82',
29
- 'yellow-03': '#e4aa18',
30
- 'yellow-04': '#ffebb9',
31
- 'yellow-05': '#b3840c',
32
- };
1
+ /*__semcore-vars__:"./style/var.css"*/
2
+ const colors = preval`
3
+ const path = require('path');
4
+ module.exports = require('@semcore/babel-plugin-react-semcore/utils/vars')(path.resolve(__dirname, './style/var.css'));
5
+ `;
33
6
 
34
7
  let componentRenderIndex = 0;
35
8
  const cache = {};
@@ -37,6 +10,7 @@ const colorValues = Object.keys(colors).sort((a, b) => {
37
10
  return parseInt(a.match(/[0-9]/g).join(''), 10) - parseInt(b.match(/[0-9]/g).join(''), 10);
38
11
  });
39
12
 
13
+ export { colors };
40
14
  export default function getColor(key) {
41
15
  if (cache[key]) {
42
16
  return cache[key];
@@ -1,14 +1,24 @@
1
+ @import '@semcore/d3-chart/src/style/var.css';
2
+
1
3
  SArea {
2
- fill: var(--color);
4
+ fill: var(--blue-01);
3
5
  fill-opacity: 0.4;
4
6
  }
5
7
 
8
+ SArea[color] {
9
+ fill: var(--color);
10
+ }
11
+
6
12
  SAreaLine {
7
- stroke: var(--color);
13
+ stroke: var(--blue-01);
8
14
  stroke-width: 3;
9
15
  fill: transparent;
10
16
  }
11
17
 
18
+ SAreaLine[color] {
19
+ stroke: var(--color);
20
+ }
21
+
12
22
  SArea,
13
23
  SAreaLine {
14
24
  transition-property: d;
@@ -1,16 +1,21 @@
1
1
  @import '@semcore/utils/style/var.css';
2
+ @import '@semcore/d3-chart/src/style/var.css';
2
3
 
3
4
  SBar {
4
- fill: var(--color);
5
+ fill: var(--blue-01);
5
6
  transition-property: height, width, y;
6
7
  transition-duration: var(--duration);
7
8
  transition-timing-function: ease-in-out;
8
9
  }
9
10
 
11
+ SBar[color] {
12
+ fill: var(--color);
13
+ }
14
+
10
15
  SBar[hide] {
11
16
  display: none;
12
17
  }
13
18
 
14
19
  SBackground {
15
- fill: color-mod(var(--mystic));
20
+ fill: var(--mystic);
16
21
  }
@@ -1,5 +1,20 @@
1
+ @import '@semcore/utils/style/var.css';
2
+ @import '@semcore/d3-chart/src/style/var.css';
3
+
1
4
  SPie {
2
5
  stroke: #ffffff;
6
+ fill: var(--blue-01);
7
+ }
8
+
9
+ SPie[color] {
10
+ fill: var(--color);
11
+ }
12
+
13
+ SEmptyData {
14
+ fill: var(--mystic);
15
+ }
16
+
17
+ SEmptyData[color] {
3
18
  fill: var(--color);
4
19
  }
5
20
 
@@ -1,15 +1,20 @@
1
1
  @import '@semcore/utils/style/var.css';
2
+ @import '@semcore/d3-chart/src/style/var.css';
2
3
 
3
4
  SDot {
4
5
  stroke-width: 2px;
5
6
  stroke: #fff;
6
7
  r: 6px;
7
- fill: var(--color);
8
+ fill: var(--blue-01);
8
9
  transition-property: cx, cy;
9
10
  transition-duration: var(--duration);
10
11
  transition-timing-function: ease-in-out;
11
12
  }
12
13
 
14
+ SDot[color] {
15
+ fill: var(--color);
16
+ }
17
+
13
18
  SDot[hide] {
14
19
  display: none;
15
20
  }
@@ -1,14 +1,19 @@
1
1
  @import '@semcore/utils/style/var.css';
2
+ @import '@semcore/d3-chart/src/style/var.css';
2
3
 
3
4
  SLine {
4
5
  fill: transparent;
5
6
  stroke-width: 3;
6
- stroke: var(--color);
7
+ stroke: var(--blue-01);
7
8
  transition-property: d;
8
9
  transition-duration: var(--duration);
9
10
  transition-timing-function: ease-in-out;
10
11
  }
11
12
 
13
+ SLine[color] {
14
+ stroke: var(--color);
15
+ }
16
+
12
17
  SLine[hide] {
13
18
  display: none;
14
19
  }
@@ -1,4 +1,5 @@
1
1
  @import '@semcore/utils/style/var.css';
2
+ @import '@semcore/d3-chart/src/style/var.css';
2
3
 
3
4
  STooltip {
4
5
  position: relative;
@@ -27,5 +28,9 @@ SDot {
27
28
  height: 8px;
28
29
  border-radius: 50%;
29
30
  margin-right: 8px;
31
+ background: var(--blue-01);
32
+ }
33
+
34
+ SDot[color] {
30
35
  background: var(--color);
31
36
  }
@@ -0,0 +1,32 @@
1
+ :root {
2
+ --blue-01: #50aef4;
3
+ --blue-02: #91c7ef;
4
+ --blue-03: #0e75c2;
5
+ --blue-04: #d1e8f8;
6
+ --blue-05: #084c80;
7
+ --green-01: #3ab011;
8
+ --green-02: #91d27b;
9
+ --green-03: #278707;
10
+ --green-04: #d1edc8;
11
+ --green-05: #1a6700;
12
+ --orange-01: #ff8e29;
13
+ --orange-02: #fec089;
14
+ --orange-03: #da6905;
15
+ --orange-04: #ffe5cd;
16
+ --orange-05: #a14e03;
17
+ --violet-01: #890c85;
18
+ --violet-02: #c783c5;
19
+ --violet-03: #6e026b;
20
+ --violet-04: #e7cbe6;
21
+ --violet-05: #4d024b;
22
+ --red-01: #e91e25;
23
+ --red-02: #f69498;
24
+ --red-03: #bd0000;
25
+ --red-04: #fbd2d3;
26
+ --red-05: #830005;
27
+ --yellow-01: #ffc83f;
28
+ --yellow-02: #ffdb82;
29
+ --yellow-03: #e4aa18;
30
+ --yellow-04: #ffebb9;
31
+ --yellow-05: #b3840c;
32
+ }
@@ -1,5 +1,7 @@
1
+ @import '@semcore/d3-chart/src/style/var.css';
2
+
1
3
  SCircle {
2
- fill: var(--color);
4
+ fill: var(--green-01);
3
5
  stroke: #fff;
4
6
  stroke-width: 2px;
5
7
  fill-opacity: 0.5;
@@ -12,6 +14,10 @@ SCircle {
12
14
  }
13
15
  }
14
16
 
17
+ SCircle[color] {
18
+ fill: var(--color);
19
+ }
20
+
15
21
  SIntersection {
16
22
  stroke: #fff;
17
23
  stroke-width: 2px;
@@ -18,7 +18,7 @@ export interface IBarProps extends IContext {
18
18
  /** Radius of curvature
19
19
  * @default 2
20
20
  */
21
- r?: number;
21
+ r?: number | number[];
22
22
  }
23
23
 
24
24
  export interface IBarContext {
@@ -17,7 +17,7 @@ export interface IHorizontalBarProps extends IContext {
17
17
  /** Radius of curvature
18
18
  * @default 2
19
19
  */
20
- r?: number;
20
+ r?: number | number[];
21
21
  }
22
22
 
23
23
  declare const HorizontalBar: (<T>(