@semcore/d3-chart 2.8.19 → 2.9.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.
- package/CHANGELOG.md +6 -0
- package/lib/cjs/Area.js +10 -10
- package/lib/cjs/Axis.js +14 -14
- package/lib/cjs/Bar.js +9 -9
- package/lib/cjs/Bubble.js +11 -11
- package/lib/cjs/Donut.js +8 -8
- package/lib/cjs/Dots.js +10 -10
- package/lib/cjs/HorizontalBar.js +9 -9
- package/lib/cjs/Hover.js +4 -4
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +5 -5
- package/lib/cjs/Plot.js.map +1 -1
- package/lib/cjs/Radar.js +885 -0
- package/lib/cjs/Radar.js.map +1 -0
- package/lib/cjs/RadialTree.js +13 -13
- package/lib/cjs/ReferenceLine.js +10 -10
- package/lib/cjs/ScatterPlot.js +8 -8
- package/lib/cjs/Tooltip.js +8 -8
- package/lib/cjs/Venn.js +8 -8
- package/lib/cjs/a11y/PlotA11yModule.js +3 -3
- package/lib/cjs/a11y/PlotA11yView.js +4 -4
- package/lib/cjs/index.js +16 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/radar.shadow.css +73 -0
- package/lib/cjs/types/Radar.js +2 -0
- package/lib/cjs/types/Radar.js.map +1 -0
- package/lib/cjs/types/index.d.js +21 -0
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/cjs/utils.js +2 -1
- package/lib/cjs/utils.js.map +1 -1
- package/lib/es6/Area.js +10 -10
- package/lib/es6/Axis.js +14 -14
- package/lib/es6/Bar.js +9 -9
- package/lib/es6/Bubble.js +11 -11
- package/lib/es6/Donut.js +8 -8
- package/lib/es6/Dots.js +10 -10
- package/lib/es6/HorizontalBar.js +9 -9
- package/lib/es6/Hover.js +4 -4
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +5 -5
- package/lib/es6/Plot.js.map +1 -1
- package/lib/es6/Radar.js +880 -0
- package/lib/es6/Radar.js.map +1 -0
- package/lib/es6/RadialTree.js +13 -13
- package/lib/es6/ReferenceLine.js +10 -10
- package/lib/es6/ScatterPlot.js +8 -8
- package/lib/es6/Tooltip.js +8 -8
- package/lib/es6/Venn.js +8 -8
- package/lib/es6/a11y/PlotA11yModule.js +3 -3
- package/lib/es6/a11y/PlotA11yView.js +4 -4
- package/lib/es6/index.js +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/radar.shadow.css +73 -0
- package/lib/es6/types/Radar.js +2 -0
- package/lib/es6/types/Radar.js.map +1 -0
- package/lib/es6/types/index.d.js +2 -0
- package/lib/es6/types/index.d.js.map +1 -1
- package/lib/es6/utils.js +2 -1
- package/lib/es6/utils.js.map +1 -1
- package/lib/types/index.d.ts +3 -0
- package/lib/types/types/Radar.d.ts +89 -0
- package/package.json +3 -2
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import IContext from './context';
|
|
2
|
+
import { MapProps } from './Plot';
|
|
3
|
+
import { ReturnEl } from '@semcore/core';
|
|
4
|
+
import { CurveFactory } from 'd3-shape';
|
|
5
|
+
export interface IRadarProps extends IContext {
|
|
6
|
+
/**
|
|
7
|
+
* Scale for radar element
|
|
8
|
+
* */
|
|
9
|
+
scale: any;
|
|
10
|
+
/**
|
|
11
|
+
* Graph type to be displayed
|
|
12
|
+
* @default 'polygon'
|
|
13
|
+
* */
|
|
14
|
+
type?: 'polygon' | 'circle';
|
|
15
|
+
/**
|
|
16
|
+
* Indent from the edge of svg to graph
|
|
17
|
+
* */
|
|
18
|
+
offset?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Label font size
|
|
21
|
+
* @default 12
|
|
22
|
+
* */
|
|
23
|
+
textSize?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface IRadarAxisProps extends IContext {
|
|
26
|
+
/**
|
|
27
|
+
* Sets the field name for categories
|
|
28
|
+
* */
|
|
29
|
+
dataKey: string;
|
|
30
|
+
}
|
|
31
|
+
export interface IRadarAxisTicksProps {
|
|
32
|
+
/**
|
|
33
|
+
* Distance between auxiliary lines
|
|
34
|
+
* @default 100
|
|
35
|
+
* */
|
|
36
|
+
tickSize?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface IRadarAxisLabelsProps {
|
|
39
|
+
/**
|
|
40
|
+
* Indent from graph to label
|
|
41
|
+
* @default 10
|
|
42
|
+
* */
|
|
43
|
+
labelOffset?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface IRadialPolygonProps extends IContext {
|
|
46
|
+
/**
|
|
47
|
+
* Sets the field name for data
|
|
48
|
+
* */
|
|
49
|
+
dataKey: string;
|
|
50
|
+
/**
|
|
51
|
+
* Curve method
|
|
52
|
+
* @default curveLinearClosed
|
|
53
|
+
* */
|
|
54
|
+
curve?: CurveFactory;
|
|
55
|
+
/**
|
|
56
|
+
* Sets the color of the entire polygon
|
|
57
|
+
* */
|
|
58
|
+
color?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Sets the fill color
|
|
61
|
+
* */
|
|
62
|
+
fill?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface IRadialPolygonLineProps {
|
|
65
|
+
/**
|
|
66
|
+
* Sets the line color
|
|
67
|
+
* */
|
|
68
|
+
color?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface IRadialPolygonDotsProps {
|
|
71
|
+
/**
|
|
72
|
+
* Sets the dot color
|
|
73
|
+
* */
|
|
74
|
+
color?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface IRadarHoverProps extends IContext {
|
|
77
|
+
}
|
|
78
|
+
declare const Radar: (<T>(props: MapProps<IRadarProps & T>) => ReturnEl) & {
|
|
79
|
+
Axis: (<T>(props: MapProps<IRadarAxisProps & T>) => ReturnEl) & {
|
|
80
|
+
Ticks: <T>(props: MapProps<IRadarAxisTicksProps & T>) => ReturnEl;
|
|
81
|
+
Labels: <T>(props: MapProps<IRadarAxisLabelsProps & T>) => ReturnEl;
|
|
82
|
+
};
|
|
83
|
+
Polygon: (<T>(props: MapProps<IRadialPolygonProps & T>) => ReturnEl) & {
|
|
84
|
+
Line: <T>(props: MapProps<IRadialPolygonLineProps & T>) => ReturnEl;
|
|
85
|
+
Dots: <T>(props: MapProps<IRadialPolygonDotsProps & T>) => ReturnEl;
|
|
86
|
+
};
|
|
87
|
+
Hover: (<T>(props: MapProps<IRadarHoverProps & T>) => ReturnEl);
|
|
88
|
+
};
|
|
89
|
+
export default Radar;
|
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": "2.
|
|
4
|
+
"version": "2.9.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"@upsetjs/venn.js": "1.4.1",
|
|
19
19
|
"d3-array": "3.1.6",
|
|
20
20
|
"d3-interpolate": "3.0.1",
|
|
21
|
+
"d3-polygon": "^3.0.1",
|
|
21
22
|
"d3-scale": "3.3.0",
|
|
22
23
|
"d3-shape": "3.1.0",
|
|
23
24
|
"d3-transition": "3.0.1",
|
|
@@ -38,7 +39,6 @@
|
|
|
38
39
|
"directory": "semcore/d3-chart"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
|
-
"@types/react": "18.0.21",
|
|
42
42
|
"@semcore/babel-plugin-react-semcore": "^4.2.1",
|
|
43
43
|
"@semcore/button": "*",
|
|
44
44
|
"@semcore/checkbox": "*",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@types/d3-array": "^3.0.2",
|
|
50
50
|
"@types/d3-scale": "^4.0.2",
|
|
51
51
|
"@types/d3-transition": "^3.0.1",
|
|
52
|
+
"@types/react": "18.0.21",
|
|
52
53
|
"jest": "29.0.1"
|
|
53
54
|
},
|
|
54
55
|
"scripts": {
|