@semcore/d3-chart 1.5.4 → 1.6.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 +23 -1
- package/lib/cjs/Area.js +9 -9
- package/lib/cjs/Area.js.map +1 -1
- package/lib/cjs/Axis.js +12 -12
- package/lib/cjs/Bar.js +11 -14
- package/lib/cjs/Bar.js.map +1 -1
- package/lib/cjs/Bubble.js +276 -0
- package/lib/cjs/Bubble.js.map +1 -0
- package/lib/cjs/Donut.js +77 -64
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +8 -7
- package/lib/cjs/Dots.js.map +1 -1
- package/lib/cjs/GroupBar.js +8 -7
- package/lib/cjs/GroupBar.js.map +1 -1
- package/lib/cjs/HorizontalBar.js +11 -14
- package/lib/cjs/HorizontalBar.js.map +1 -1
- package/lib/cjs/Hover.js +3 -3
- package/lib/cjs/Line.js +8 -8
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/ScatterPlot.js +224 -0
- package/lib/cjs/ScatterPlot.js.map +1 -0
- package/lib/cjs/StackBar.js +39 -14
- package/lib/cjs/StackBar.js.map +1 -1
- package/lib/cjs/StackedArea.js +11 -9
- package/lib/cjs/StackedArea.js.map +1 -1
- package/lib/cjs/Tooltip.js +17 -13
- package/lib/cjs/Tooltip.js.map +1 -1
- package/lib/cjs/Venn.js +8 -8
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/color.js +32 -30
- package/lib/cjs/color.js.map +1 -1
- package/lib/cjs/index.js +16 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/area.shadow.css +12 -2
- package/lib/cjs/style/bar.shadow.css +7 -2
- package/lib/cjs/style/bubble.shadow.css +45 -0
- package/lib/cjs/style/donut.shadow.css +15 -0
- package/lib/cjs/style/dot.shadow.css +6 -1
- package/lib/cjs/style/line.shadow.css +6 -1
- package/lib/cjs/style/scatterplot.shadow.css +27 -0
- package/lib/cjs/style/tooltip.shadow.css +7 -2
- package/lib/cjs/style/var.css +32 -0
- package/lib/cjs/style/venn.shadow.css +7 -1
- package/lib/es6/Area.js +9 -9
- package/lib/es6/Area.js.map +1 -1
- package/lib/es6/Axis.js +12 -12
- package/lib/es6/Bar.js +11 -14
- package/lib/es6/Bar.js.map +1 -1
- package/lib/es6/Bubble.js +259 -0
- package/lib/es6/Bubble.js.map +1 -0
- package/lib/es6/Donut.js +77 -64
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +8 -7
- package/lib/es6/Dots.js.map +1 -1
- package/lib/es6/GroupBar.js +8 -7
- package/lib/es6/GroupBar.js.map +1 -1
- package/lib/es6/HorizontalBar.js +11 -14
- package/lib/es6/HorizontalBar.js.map +1 -1
- package/lib/es6/Hover.js +3 -3
- package/lib/es6/Line.js +8 -8
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/ScatterPlot.js +209 -0
- package/lib/es6/ScatterPlot.js.map +1 -0
- package/lib/es6/StackBar.js +39 -14
- package/lib/es6/StackBar.js.map +1 -1
- package/lib/es6/StackedArea.js +11 -9
- package/lib/es6/StackedArea.js.map +1 -1
- package/lib/es6/Tooltip.js +16 -12
- package/lib/es6/Tooltip.js.map +1 -1
- package/lib/es6/Venn.js +8 -8
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/color.js +33 -31
- package/lib/es6/color.js.map +1 -1
- package/lib/es6/index.js +2 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/area.shadow.css +12 -2
- package/lib/es6/style/bar.shadow.css +7 -2
- package/lib/es6/style/bubble.shadow.css +45 -0
- package/lib/es6/style/donut.shadow.css +15 -0
- package/lib/es6/style/dot.shadow.css +6 -1
- package/lib/es6/style/line.shadow.css +6 -1
- package/lib/es6/style/scatterplot.shadow.css +27 -0
- package/lib/es6/style/tooltip.shadow.css +7 -2
- package/lib/es6/style/var.css +32 -0
- package/lib/es6/style/venn.shadow.css +7 -1
- package/lib/types/Bar.d.ts +1 -1
- package/lib/types/Bubble.d.ts +27 -0
- package/lib/types/HorizontalBar.d.ts +1 -1
- package/lib/types/ScatterPlot.d.ts +27 -0
- package/lib/types/index.d.ts +6 -0
- package/package.json +1 -1
- package/src/Area.js +0 -1
- package/src/Bar.js +6 -8
- package/src/Bubble.js +189 -0
- package/src/Donut.js +8 -7
- package/src/GroupBar.js +6 -2
- package/src/HorizontalBar.js +5 -8
- package/src/Line.js +0 -1
- package/src/ScatterPlot.js +130 -0
- package/src/StackBar.js +24 -7
- package/src/StackedArea.js +3 -2
- package/src/Tooltip.js +10 -4
- package/src/Venn.js +1 -1
- package/src/color.js +6 -32
- package/src/index.js +2 -0
- package/src/style/area.shadow.css +12 -2
- package/src/style/bar.shadow.css +7 -2
- package/src/style/bubble.shadow.css +45 -0
- package/src/style/donut.shadow.css +15 -0
- package/src/style/dot.shadow.css +6 -1
- package/src/style/line.shadow.css +6 -1
- package/src/style/scatterplot.shadow.css +27 -0
- package/src/style/tooltip.shadow.css +7 -2
- package/src/style/var.css +32 -0
- package/src/style/venn.shadow.css +7 -1
- package/src/types/Bar.d.ts +1 -1
- package/src/types/Bubble.d.ts +27 -0
- package/src/types/HorizontalBar.d.ts +1 -1
- package/src/types/ScatterPlot.d.ts +27 -0
- package/src/types/index.d.ts +6 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@import '@semcore/utils/style/var.css';
|
|
2
|
+
@import '@semcore/d3-chart/src/style/var.css';
|
|
3
|
+
|
|
4
|
+
SBubble {
|
|
5
|
+
fill: #2bb3ff;
|
|
6
|
+
stroke: #fff;
|
|
7
|
+
stroke-width: 2px;
|
|
8
|
+
transition-property: cx, cy;
|
|
9
|
+
transition-duration: var(--duration);
|
|
10
|
+
transition-timing-function: ease-in-out;
|
|
11
|
+
opacity: 0.5;
|
|
12
|
+
&:hover {
|
|
13
|
+
opacity: 0.8;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
SBubble[color] {
|
|
18
|
+
fill: var(--color);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
SCenter {
|
|
22
|
+
text-anchor: middle;
|
|
23
|
+
font-size: 11px;
|
|
24
|
+
stroke: #2bb3ff;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
SCenter[color] {
|
|
28
|
+
stroke: var(--color);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
SLabel {
|
|
32
|
+
fill: #2bb3ff;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
SLabel[position='right'] {
|
|
36
|
+
text-anchor: end;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
SLabel[position='left'] {
|
|
40
|
+
text-anchor: start;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
SLabel[color] {
|
|
44
|
+
fill: var(--color);
|
|
45
|
+
}
|
|
@@ -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
|
|
package/src/style/dot.shadow.css
CHANGED
|
@@ -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(--
|
|
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(--
|
|
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
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
@import '@semcore/utils/style/var.css';
|
|
2
|
+
@import '@semcore/d3-chart/src/style/var.css';
|
|
3
|
+
|
|
4
|
+
SScatterPlot {
|
|
5
|
+
fill: #2bb3ff;
|
|
6
|
+
transition-property: cx, cy;
|
|
7
|
+
transition-duration: var(--duration);
|
|
8
|
+
transition-timing-function: ease-in-out;
|
|
9
|
+
opacity: 0.5;
|
|
10
|
+
&:hover {
|
|
11
|
+
opacity: 0.8;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
SScatterPlot[color] {
|
|
16
|
+
fill: var(--color);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
SValue {
|
|
20
|
+
text-anchor: middle;
|
|
21
|
+
font-size: 10px;
|
|
22
|
+
stroke: #008ff8;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
SValue[color] {
|
|
26
|
+
stroke: var(--color);
|
|
27
|
+
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
@import '@semcore/utils/style/var.css';
|
|
2
|
+
@import '@semcore/d3-chart/src/style/var.css';
|
|
2
3
|
|
|
3
4
|
STooltip {
|
|
5
|
+
font-size: var(--fs-100);
|
|
6
|
+
line-height: var(--lh-100);
|
|
4
7
|
position: relative;
|
|
5
8
|
background-color: #fff;
|
|
6
9
|
border-radius: 3px;
|
|
@@ -11,8 +14,6 @@ STooltip {
|
|
|
11
14
|
}
|
|
12
15
|
|
|
13
16
|
STitle {
|
|
14
|
-
font-size: var(--fs-100);
|
|
15
|
-
line-height: var(--lh-100);
|
|
16
17
|
color: var(--gray60);
|
|
17
18
|
margin-bottom: 8px;
|
|
18
19
|
}
|
|
@@ -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(--
|
|
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;
|
package/src/types/Bar.d.ts
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
|
|
4
|
+
export interface IBubbleProps extends IContext {
|
|
5
|
+
/** Field from data for XAxis */
|
|
6
|
+
x: string;
|
|
7
|
+
/** Field from data for YAxis */
|
|
8
|
+
y: string;
|
|
9
|
+
/** Field from data for circle radius */
|
|
10
|
+
value: string;
|
|
11
|
+
/** Field from data for circle label */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Circle color */
|
|
14
|
+
color?: string;
|
|
15
|
+
/** Cross in the center of the bubble
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
markedCross?: boolean;
|
|
19
|
+
/** Animation duration in ms
|
|
20
|
+
* @default 500
|
|
21
|
+
*/
|
|
22
|
+
duration?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare const Bubble: <T>(props: CProps<IBubbleProps & T>) => ReturnEl;
|
|
26
|
+
|
|
27
|
+
export default Bubble;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CProps, ReturnEl } from '@semcore/core';
|
|
2
|
+
import IContext from './context';
|
|
3
|
+
|
|
4
|
+
export interface IScatterPlotProps extends IContext {
|
|
5
|
+
/** Field from data for XAxis */
|
|
6
|
+
x: string;
|
|
7
|
+
/** Field from data for YAxis */
|
|
8
|
+
y: string;
|
|
9
|
+
/** Field from data for circle value */
|
|
10
|
+
value?: string;
|
|
11
|
+
/** Circle color */
|
|
12
|
+
color?: string;
|
|
13
|
+
/** Circle value color */
|
|
14
|
+
valueColor?: string;
|
|
15
|
+
/** Animation duration in ms
|
|
16
|
+
* @default 500
|
|
17
|
+
*/
|
|
18
|
+
duration?: number;
|
|
19
|
+
/** Radius of circles
|
|
20
|
+
* @default 5.5 or 12 with value
|
|
21
|
+
*/
|
|
22
|
+
r?: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare const ScatterPlot: <T>(props: CProps<IScatterPlotProps & T>) => ReturnEl;
|
|
26
|
+
|
|
27
|
+
export default ScatterPlot;
|
package/src/types/index.d.ts
CHANGED
|
@@ -39,3 +39,9 @@ export * from './Donut';
|
|
|
39
39
|
|
|
40
40
|
export { default as Tooltip } from './Tooltip';
|
|
41
41
|
export * from './Tooltip';
|
|
42
|
+
|
|
43
|
+
export { default as ScatterPlot } from './ScatterPlot';
|
|
44
|
+
export * from './ScatterPlot';
|
|
45
|
+
|
|
46
|
+
export { default as Bubble } from './Bubble';
|
|
47
|
+
export * from './Bubble';
|