@semcore/d3-chart 1.9.0 → 2.0.0

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 (80) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/Area.js +9 -9
  3. package/lib/cjs/Axis.js +14 -14
  4. package/lib/cjs/Bar.js +8 -8
  5. package/lib/cjs/Bubble.js +10 -10
  6. package/lib/cjs/Donut.js +7 -7
  7. package/lib/cjs/Dots.js +8 -8
  8. package/lib/cjs/GroupBar.js +6 -6
  9. package/lib/cjs/HorizontalBar.js +8 -8
  10. package/lib/cjs/Hover.js +4 -4
  11. package/lib/cjs/Line.js +8 -8
  12. package/lib/cjs/RadialTree.js +16 -13
  13. package/lib/cjs/RadialTree.js.map +1 -1
  14. package/lib/cjs/ScatterPlot.js +7 -7
  15. package/lib/cjs/StackBar.js +6 -6
  16. package/lib/cjs/StackedArea.js +7 -7
  17. package/lib/cjs/Tooltip.js +8 -8
  18. package/lib/cjs/Venn.js +7 -7
  19. package/lib/cjs/color.js +122 -30
  20. package/lib/cjs/color.js.map +1 -1
  21. package/lib/cjs/style/area.shadow.css +4 -4
  22. package/lib/cjs/style/axis.shadow.css +4 -4
  23. package/lib/cjs/style/bar.shadow.css +2 -2
  24. package/lib/cjs/style/bubble.shadow.css +3 -3
  25. package/lib/cjs/style/donut.shadow.css +2 -2
  26. package/lib/cjs/style/dot.shadow.css +1 -1
  27. package/lib/cjs/style/hover.shadow.css +2 -2
  28. package/lib/cjs/style/line.shadow.css +2 -2
  29. package/lib/cjs/style/radial-tree.shadow.css +11 -0
  30. package/lib/cjs/style/scatterplot.shadow.css +2 -2
  31. package/lib/cjs/style/tooltip.shadow.css +5 -5
  32. package/lib/cjs/style/var.css +123 -30
  33. package/lib/cjs/style/venn.shadow.css +1 -1
  34. package/lib/es6/Area.js +9 -9
  35. package/lib/es6/Axis.js +14 -14
  36. package/lib/es6/Bar.js +8 -8
  37. package/lib/es6/Bubble.js +10 -10
  38. package/lib/es6/Donut.js +7 -7
  39. package/lib/es6/Dots.js +8 -8
  40. package/lib/es6/GroupBar.js +6 -6
  41. package/lib/es6/HorizontalBar.js +8 -8
  42. package/lib/es6/Hover.js +4 -4
  43. package/lib/es6/Line.js +8 -8
  44. package/lib/es6/RadialTree.js +16 -13
  45. package/lib/es6/RadialTree.js.map +1 -1
  46. package/lib/es6/ScatterPlot.js +7 -7
  47. package/lib/es6/StackBar.js +6 -6
  48. package/lib/es6/StackedArea.js +7 -7
  49. package/lib/es6/Tooltip.js +8 -8
  50. package/lib/es6/Venn.js +7 -7
  51. package/lib/es6/color.js +122 -30
  52. package/lib/es6/color.js.map +1 -1
  53. package/lib/es6/style/area.shadow.css +4 -4
  54. package/lib/es6/style/axis.shadow.css +4 -4
  55. package/lib/es6/style/bar.shadow.css +2 -2
  56. package/lib/es6/style/bubble.shadow.css +3 -3
  57. package/lib/es6/style/donut.shadow.css +2 -2
  58. package/lib/es6/style/dot.shadow.css +1 -1
  59. package/lib/es6/style/hover.shadow.css +2 -2
  60. package/lib/es6/style/line.shadow.css +2 -2
  61. package/lib/es6/style/radial-tree.shadow.css +11 -0
  62. package/lib/es6/style/scatterplot.shadow.css +2 -2
  63. package/lib/es6/style/tooltip.shadow.css +5 -5
  64. package/lib/es6/style/var.css +123 -30
  65. package/lib/es6/style/venn.shadow.css +1 -1
  66. package/package.json +7 -2
  67. package/src/RadialTree.tsx +2 -3
  68. package/src/style/area.shadow.css +4 -4
  69. package/src/style/axis.shadow.css +4 -4
  70. package/src/style/bar.shadow.css +2 -2
  71. package/src/style/bubble.shadow.css +3 -3
  72. package/src/style/donut.shadow.css +2 -2
  73. package/src/style/dot.shadow.css +1 -1
  74. package/src/style/hover.shadow.css +2 -2
  75. package/src/style/line.shadow.css +2 -2
  76. package/src/style/radial-tree.shadow.css +11 -0
  77. package/src/style/scatterplot.shadow.css +2 -2
  78. package/src/style/tooltip.shadow.css +5 -5
  79. package/src/style/var.css +123 -30
  80. package/src/style/venn.shadow.css +1 -1
@@ -1,7 +1,7 @@
1
1
  @import '@semcore/d3-chart/src/style/var.css';
2
2
 
3
3
  SCircle {
4
- fill: var(--green-01);
4
+ fill: var(--green-02);
5
5
  stroke: #fff;
6
6
  stroke-width: 2px;
7
7
  fill-opacity: 0.5;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/d3-chart",
3
3
  "description": "SEMRush D3 Chart Component",
4
- "version": "1.9.0",
4
+ "version": "2.0.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -42,6 +42,11 @@
42
42
  "@semcore/jest-preset-ui": "1.0.0",
43
43
  "@types/d3-array": "^3.0.2",
44
44
  "@types/d3-scale": "^4.0.2",
45
- "@types/d3-transition": "^3.0.1"
45
+ "@types/d3-transition": "^3.0.1",
46
+ "@semcore/typography": "*",
47
+ "@semcore/dropdown-menu": "*",
48
+ "@semcore/button": "*",
49
+ "@semcore/checkbox": "*",
50
+ "@semcore/icon": "*"
46
51
  }
47
52
  }
@@ -136,7 +136,6 @@ class RadialTreeBase extends Component<RootAsProps> {
136
136
  duration: 300,
137
137
  centralMargin: 50,
138
138
  labelMargin: 2,
139
- color: '#008FF8',
140
139
  iconColor: '#fff',
141
140
  capSize: 8,
142
141
  iconSize: 8,
@@ -577,8 +576,8 @@ type RadialTreeRadianLineAsProps = IRadialTreeRadianLineProps & {
577
576
  Element: React.FC<{ render: string } & React.SVGProps<any>>;
578
577
  styles: React.CSSProperties;
579
578
  };
580
- const Line: React.FC<RadialTreeRadianLineAsProps> = ({ Element: SLine, styles }) => {
581
- return sstyled(styles)(<SLine render="line" />) as React.ReactElement;
579
+ const Line: React.FC<RadialTreeRadianLineAsProps> = ({ Element: SLine, styles, stroke }) => {
580
+ return sstyled(styles)(<SLine render="line" stroke={stroke} />) as React.ReactElement;
582
581
  };
583
582
 
584
583
  export interface IRadialTreeRadianCapProps {
@@ -1,8 +1,8 @@
1
1
  @import '@semcore/d3-chart/src/style/var.css';
2
2
 
3
3
  SArea {
4
- fill: var(--blue-01);
5
- fill-opacity: 0.4;
4
+ fill: var(--blue-03);
5
+ fill-opacity: 0.2;
6
6
  }
7
7
 
8
8
  SArea[color] {
@@ -10,7 +10,7 @@ SArea[color] {
10
10
  }
11
11
 
12
12
  SAreaLine {
13
- stroke: var(--blue-01);
13
+ stroke: var(--blue-03);
14
14
  stroke-width: 3;
15
15
  fill: transparent;
16
16
  }
@@ -28,7 +28,7 @@ SAreaLine {
28
28
 
29
29
  SNull {
30
30
  fill: transparent;
31
- stroke: #bdc4c6;
31
+ stroke: var(--gray-400);
32
32
  stroke-dasharray: 4;
33
33
  }
34
34
 
@@ -1,7 +1,7 @@
1
1
  @import '@semcore/utils/style/var.css';
2
2
 
3
3
  SAxis {
4
- stroke: var(--stone);
4
+ stroke: var(--gray-200);
5
5
  }
6
6
 
7
7
  SAxis[hide] {
@@ -10,7 +10,7 @@ SAxis[hide] {
10
10
 
11
11
  STick {
12
12
  font-size: 12px;
13
- fill: var(--gray60);
13
+ fill: var(--gray-500);
14
14
  }
15
15
 
16
16
  STick[hide] {
@@ -19,12 +19,12 @@ STick[hide] {
19
19
 
20
20
  SGrid {
21
21
  fill: transparent;
22
- stroke: var(--mercury);
22
+ stroke: var(--gray-100);
23
23
  }
24
24
 
25
25
  STitle {
26
26
  font-size: 12px;
27
- fill: var(--gray60);
27
+ fill: var(--gray-500);
28
28
  transform-origin: var(--transform-origin);
29
29
  }
30
30
 
@@ -2,7 +2,7 @@
2
2
  @import '@semcore/d3-chart/src/style/var.css';
3
3
 
4
4
  SBar {
5
- fill: var(--blue-01);
5
+ fill: var(--blue-03);
6
6
  transition-property: height, width, y;
7
7
  transition-duration: var(--duration);
8
8
  transition-timing-function: ease-in-out;
@@ -17,5 +17,5 @@ SBar[hide] {
17
17
  }
18
18
 
19
19
  SBackground {
20
- fill: var(--mystic);
20
+ fill: var(--gray-200);
21
21
  }
@@ -2,7 +2,7 @@
2
2
  @import '@semcore/d3-chart/src/style/var.css';
3
3
 
4
4
  SBubble {
5
- fill: #2bb3ff;
5
+ fill: var(--blue-03);
6
6
  stroke: #fff;
7
7
  stroke-width: 2px;
8
8
  transition-property: cx, cy;
@@ -21,7 +21,7 @@ SBubble[color] {
21
21
  SCenter {
22
22
  text-anchor: middle;
23
23
  font-size: 11px;
24
- stroke: #2bb3ff;
24
+ stroke: var(--blue-03);
25
25
  }
26
26
 
27
27
  SCenter[color] {
@@ -29,7 +29,7 @@ SCenter[color] {
29
29
  }
30
30
 
31
31
  SLabel {
32
- fill: #2bb3ff;
32
+ fill: var(--blue-03);
33
33
  }
34
34
 
35
35
  SLabel[position='right'] {
@@ -3,7 +3,7 @@
3
3
 
4
4
  SPie {
5
5
  stroke: #ffffff;
6
- fill: var(--blue-01);
6
+ fill: var(--blue-03);
7
7
  }
8
8
 
9
9
  SPie[color] {
@@ -11,7 +11,7 @@ SPie[color] {
11
11
  }
12
12
 
13
13
  SEmptyData {
14
- fill: var(--mystic);
14
+ fill: var(--gray-100);
15
15
  }
16
16
 
17
17
  SEmptyData[color] {
@@ -5,7 +5,7 @@ SDot {
5
5
  stroke-width: 2px;
6
6
  stroke: #fff;
7
7
  r: 6px;
8
- fill: var(--blue-01);
8
+ fill: var(--blue-03);
9
9
  transition-property: cx, cy;
10
10
  transition-duration: var(--duration);
11
11
  transition-timing-function: ease-in-out;
@@ -1,9 +1,9 @@
1
1
  @import '@semcore/utils/style/var.css';
2
2
 
3
3
  SHoverLine {
4
- stroke: var(--stone);
4
+ stroke: var(--gray-300);
5
5
  }
6
6
 
7
7
  SHoverRect {
8
- fill: color-mod(var(--mist) a(30%));
8
+ fill: color-mod(var(--gray-200) a(30%));
9
9
  }
@@ -4,7 +4,7 @@
4
4
  SLine {
5
5
  fill: transparent;
6
6
  stroke-width: 3;
7
- stroke: var(--blue-01);
7
+ stroke: var(--blue-03);
8
8
  transition-property: d;
9
9
  transition-duration: var(--duration);
10
10
  transition-timing-function: ease-in-out;
@@ -20,7 +20,7 @@ SLine[hide] {
20
20
 
21
21
  SNull {
22
22
  fill: transparent;
23
- stroke: var(--mist);
23
+ stroke: var(--gray-200);
24
24
  stroke-dasharray: 4;
25
25
  }
26
26
 
@@ -3,10 +3,21 @@
3
3
 
4
4
  SRadian {
5
5
  cursor: pointer;
6
+ fill: var(--blue-04);
6
7
  }
8
+
9
+ SLine {
10
+ stroke: var(--blue-04);
11
+ }
12
+
13
+ SLine[color] {
14
+ stroke: var(--color);
15
+ }
16
+
7
17
  SCap {
8
18
  transition: r 0.1s;
9
19
  }
20
+
10
21
  SLabel {
11
22
  fill: var(--color);
12
23
  cursor: var(--text-cursor);
@@ -2,7 +2,7 @@
2
2
  @import '@semcore/d3-chart/src/style/var.css';
3
3
 
4
4
  SScatterPlot {
5
- fill: #2bb3ff;
5
+ fill: var(--blue-03);
6
6
  transition-property: cx, cy;
7
7
  transition-duration: var(--duration);
8
8
  transition-timing-function: ease-in-out;
@@ -19,7 +19,7 @@ SScatterPlot[color] {
19
19
  SValue {
20
20
  text-anchor: middle;
21
21
  font-size: 10px;
22
- stroke: #008ff8;
22
+ stroke: var(--blue-04);
23
23
  }
24
24
 
25
25
  SValue[color] {
@@ -6,15 +6,15 @@ STooltip {
6
6
  line-height: var(--lh-100);
7
7
  position: relative;
8
8
  background-color: #fff;
9
- border-radius: 3px;
10
- border: 1px solid var(--stone-light);
9
+ border-radius: 6px;
10
+ border: 1px solid var(--gray-100);
11
11
  box-sizing: border-box;
12
- box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.25), 0 -2px 5px -2px rgba(0, 0, 0, 0.25);
12
+ box-shadow: var(--box-shadow-popper);
13
13
  padding: 12px;
14
14
  }
15
15
 
16
16
  STitle {
17
- color: var(--gray60);
17
+ color: var(--gray-500);
18
18
  margin-bottom: 8px;
19
19
  }
20
20
 
@@ -28,7 +28,7 @@ SDot {
28
28
  height: 8px;
29
29
  border-radius: 50%;
30
30
  margin-right: 8px;
31
- background: var(--blue-01);
31
+ background: var(--blue-03);
32
32
  }
33
33
 
34
34
  SDot[color] {
package/src/style/var.css CHANGED
@@ -1,32 +1,125 @@
1
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;
2
+ --blue-01: #c4e5fe;
3
+ --blue-02: #8ecdff;
4
+ --blue-03: #2bb3ff;
5
+ --blue-04: #008ff8;
6
+ --blue-05: #006dca;
7
+ --green-01: #9ef2c9;
8
+ --green-02: #59ddaa;
9
+ --green-03: #00c192;
10
+ --green-04: #009f81;
11
+ --green-05: #007c65;
12
+ --orange-01: #ffdca2;
13
+ --orange-02: #ffb26e;
14
+ --orange-03: #ff8c43;
15
+ --orange-04: #ff622d;
16
+ --orange-05: #c33909;
17
+ --pink-01: #ffd3ff;
18
+ --pink-02: #ffa9fa;
19
+ --pink-03: #f67cf2;
20
+ --pink-04: #e14adf;
21
+ --pink-05: #b229b9;
22
+ --violet-01: #edd9ff;
23
+ --violet-02: #dcb8ff;
24
+ --violet-03: #c695ff;
25
+ --violet-04: #ab6cfe;
26
+ --violet-05: #8649e1;
27
+ --red-01: #ffd7df;
28
+ --red-02: #ffaeb5;
29
+ --red-03: #ff8786;
30
+ --red-04: #ff4953;
31
+ --red-05: #d1002f;
32
+ --yellow-01: #fce081;
33
+ --yellow-02: #fdc23c;
34
+ --yellow-03: #ef9800;
35
+ --yellow-04: #d87900;
36
+ --yellow-05: #a75800;
37
+ --salad-01: #c7ee96;
38
+ --salad-02: #9bd85d;
39
+ --salad-03: #66c030;
40
+ --salad-04: #35a21e;
41
+ --salad-05: #0a7e22;
42
+ --gray-01: #c4c7cf;
43
+
44
+ --gray-50: #f4f5f9;
45
+ --gray-100: #e0e1e9;
46
+ --gray-200: #c4c7cf;
47
+ --gray-300: #a9abb6;
48
+ --gray-400: #8a8e9b;
49
+ --gray-500: #6c6e79;
50
+ --gray-600: #484a54;
51
+ --gray-700: #2b2e38;
52
+ --gray-800: #191b23;
53
+ --blue-50: #e9f7ff;
54
+ --blue-100: #c4e5fe;
55
+ --blue-200: #8ecdff;
56
+ --blue-300: #2bb3ff;
57
+ --blue-400: #008ff8;
58
+ --blue-500: #006dca;
59
+ --blue-600: #044792;
60
+ --blue-700: #002b5f;
61
+ --blue-800: #001b3d;
62
+ --green-100: #9ef2c9;
63
+ --green-200: #59ddaa;
64
+ --green-300: #00c192;
65
+ --green-400: #009f81;
66
+ --green-50: #dbfee8;
67
+ --green-500: #007c65;
68
+ --green-600: #055345;
69
+ --green-700: #00342d;
70
+ --green-800: #00201e;
71
+ --salad-100: #c7ee96;
72
+ --salad-200: #9bd85d;
73
+ --salad-300: #66c030;
74
+ --salad-400: #35a21e;
75
+ --salad-50: #ecfbcd;
76
+ --salad-500: #0a7e22;
77
+ --salad-600: #005613;
78
+ --salad-700: #003509;
79
+ --salad-800: #002203;
80
+ --orange-50: #fff3d9;
81
+ --orange-100: #ffdca2;
82
+ --orange-200: #ffb26e;
83
+ --orange-300: #ff8c43;
84
+ --orange-400: #ff622d;
85
+ --orange-500: #c33909;
86
+ --orange-600: #8b1500;
87
+ --orange-700: #551200;
88
+ --orange-800: #351000;
89
+ --yellow-100: #fce081;
90
+ --yellow-200: #fdc23c;
91
+ --yellow-300: #ef9800;
92
+ --yellow-400: #d87900;
93
+ --yellow-50: #fdf7c8;
94
+ --yellow-500: #a75800;
95
+ --yellow-600: #743a00;
96
+ --yellow-700: #462500;
97
+ --yellow-800: #2c1600;
98
+ --red-100: #ffd7df;
99
+ --red-200: #ffaeb5;
100
+ --red-300: #ff8786;
101
+ --red-400: #ff4953;
102
+ --red-50: #fff0f7;
103
+ --red-500: #d1002f;
104
+ --red-600: #8e0016;
105
+ --red-700: #58000a;
106
+ --red-800: #410101;
107
+ --pink-100: #ffd3ff;
108
+ --pink-200: #ffa9fa;
109
+ --pink-300: #f67cf2;
110
+ --pink-400: #e14adf;
111
+ --pink-50: #fff0ff;
112
+ --pink-500: #b229b9;
113
+ --pink-600: #7d0480;
114
+ --pink-700: #4d0050;
115
+ --pink-800: #340439;
116
+ --violet-100: #edd9ff;
117
+ --violet-200: #dcb8ff;
118
+ --violet-300: #c695ff;
119
+ --violet-400: #ab6cfe;
120
+ --violet-50: #f9f2ff;
121
+ --violet-500: #8649e1;
122
+ --violet-600: #5925ab;
123
+ --violet-700: #421984;
124
+ --violet-800: #220358;
32
125
  }
@@ -1,7 +1,7 @@
1
1
  @import '@semcore/d3-chart/src/style/var.css';
2
2
 
3
3
  SCircle {
4
- fill: var(--green-01);
4
+ fill: var(--green-02);
5
5
  stroke: #fff;
6
6
  stroke-width: 2px;
7
7
  fill-opacity: 0.5;