@semcore/d3-chart 2.8.18 → 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.
Files changed (62) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/lib/cjs/Area.js +10 -10
  3. package/lib/cjs/Axis.js +14 -14
  4. package/lib/cjs/Bar.js +9 -9
  5. package/lib/cjs/Bubble.js +11 -11
  6. package/lib/cjs/Donut.js +8 -8
  7. package/lib/cjs/Dots.js +10 -10
  8. package/lib/cjs/HorizontalBar.js +9 -9
  9. package/lib/cjs/Hover.js +4 -4
  10. package/lib/cjs/Line.js +9 -9
  11. package/lib/cjs/Plot.js +5 -5
  12. package/lib/cjs/Plot.js.map +1 -1
  13. package/lib/cjs/Radar.js +885 -0
  14. package/lib/cjs/Radar.js.map +1 -0
  15. package/lib/cjs/RadialTree.js +13 -13
  16. package/lib/cjs/ReferenceLine.js +10 -10
  17. package/lib/cjs/ScatterPlot.js +8 -8
  18. package/lib/cjs/Tooltip.js +8 -8
  19. package/lib/cjs/Venn.js +8 -8
  20. package/lib/cjs/a11y/PlotA11yModule.js +3 -3
  21. package/lib/cjs/a11y/PlotA11yView.js +4 -4
  22. package/lib/cjs/index.js +16 -0
  23. package/lib/cjs/index.js.map +1 -1
  24. package/lib/cjs/style/radar.shadow.css +73 -0
  25. package/lib/cjs/types/Radar.js +2 -0
  26. package/lib/cjs/types/Radar.js.map +1 -0
  27. package/lib/cjs/types/index.d.js +21 -0
  28. package/lib/cjs/types/index.d.js.map +1 -1
  29. package/lib/cjs/utils.js +2 -1
  30. package/lib/cjs/utils.js.map +1 -1
  31. package/lib/es6/Area.js +10 -10
  32. package/lib/es6/Axis.js +14 -14
  33. package/lib/es6/Bar.js +9 -9
  34. package/lib/es6/Bubble.js +11 -11
  35. package/lib/es6/Donut.js +8 -8
  36. package/lib/es6/Dots.js +10 -10
  37. package/lib/es6/HorizontalBar.js +9 -9
  38. package/lib/es6/Hover.js +4 -4
  39. package/lib/es6/Line.js +9 -9
  40. package/lib/es6/Plot.js +5 -5
  41. package/lib/es6/Plot.js.map +1 -1
  42. package/lib/es6/Radar.js +880 -0
  43. package/lib/es6/Radar.js.map +1 -0
  44. package/lib/es6/RadialTree.js +13 -13
  45. package/lib/es6/ReferenceLine.js +10 -10
  46. package/lib/es6/ScatterPlot.js +8 -8
  47. package/lib/es6/Tooltip.js +8 -8
  48. package/lib/es6/Venn.js +8 -8
  49. package/lib/es6/a11y/PlotA11yModule.js +3 -3
  50. package/lib/es6/a11y/PlotA11yView.js +4 -4
  51. package/lib/es6/index.js +1 -0
  52. package/lib/es6/index.js.map +1 -1
  53. package/lib/es6/style/radar.shadow.css +73 -0
  54. package/lib/es6/types/Radar.js +2 -0
  55. package/lib/es6/types/Radar.js.map +1 -0
  56. package/lib/es6/types/index.d.js +2 -0
  57. package/lib/es6/types/index.d.js.map +1 -1
  58. package/lib/es6/utils.js +2 -1
  59. package/lib/es6/utils.js.map +1 -1
  60. package/lib/types/index.d.ts +3 -0
  61. package/lib/types/types/Radar.d.ts +89 -0
  62. 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.8.18",
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": {