@semcore/d3-chart 3.33.0 → 3.34.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 (108) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/lib/cjs/Area.js +11 -11
  3. package/lib/cjs/Axis.js +14 -14
  4. package/lib/cjs/Bar.js +10 -10
  5. package/lib/cjs/Bubble.js +12 -12
  6. package/lib/cjs/Donut.js +9 -9
  7. package/lib/cjs/Dots.js +8 -8
  8. package/lib/cjs/HorizontalBar.js +10 -10
  9. package/lib/cjs/Hover.js +3 -3
  10. package/lib/cjs/Line.js +9 -9
  11. package/lib/cjs/Plot.js +3 -3
  12. package/lib/cjs/Radar.js +19 -19
  13. package/lib/cjs/RadialTree.js +11 -11
  14. package/lib/cjs/RadialTree.js.map +1 -1
  15. package/lib/cjs/ReferenceLine.js +9 -9
  16. package/lib/cjs/ScatterPlot.js +9 -9
  17. package/lib/cjs/Tooltip.js +9 -9
  18. package/lib/cjs/Venn.js +9 -9
  19. package/lib/cjs/a11y/PlotA11yModule.js +2 -2
  20. package/lib/cjs/a11y/PlotA11yView.js +2 -2
  21. package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
  22. package/lib/cjs/component/Chart/BubbleChart.js +15 -50
  23. package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
  24. package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
  25. package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  26. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
  27. package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  28. package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
  29. package/lib/cjs/index.js +6 -0
  30. package/lib/cjs/index.js.map +1 -1
  31. package/lib/cjs/types/Area.d.js.map +1 -1
  32. package/lib/cjs/types/Bar.d.js.map +1 -1
  33. package/lib/cjs/types/Bubble.d.js.map +1 -1
  34. package/lib/cjs/types/Donut.d.js.map +1 -1
  35. package/lib/cjs/types/HorizontalBar.d.js.map +1 -1
  36. package/lib/cjs/types/Line.d.js.map +1 -1
  37. package/lib/cjs/types/Plot.d.js.map +1 -1
  38. package/lib/cjs/types/Radar.d.js.map +1 -1
  39. package/lib/cjs/types/ScatterPlot.d.js.map +1 -1
  40. package/lib/cjs/types/StackBar.d.js.map +1 -1
  41. package/lib/cjs/types/StackedArea.d.js.map +1 -1
  42. package/lib/cjs/types/Venn.d.js.map +1 -1
  43. package/lib/cjs/types/index.d.js.map +1 -1
  44. package/lib/cjs/utils.js +36 -1
  45. package/lib/cjs/utils.js.map +1 -1
  46. package/lib/es6/Area.js +11 -11
  47. package/lib/es6/Axis.js +14 -14
  48. package/lib/es6/Bar.js +10 -10
  49. package/lib/es6/Bubble.js +12 -12
  50. package/lib/es6/Donut.js +9 -9
  51. package/lib/es6/Dots.js +8 -8
  52. package/lib/es6/HorizontalBar.js +10 -10
  53. package/lib/es6/Hover.js +3 -3
  54. package/lib/es6/Line.js +9 -9
  55. package/lib/es6/Plot.js +3 -3
  56. package/lib/es6/Radar.js +19 -19
  57. package/lib/es6/RadialTree.js +11 -11
  58. package/lib/es6/RadialTree.js.map +1 -1
  59. package/lib/es6/ReferenceLine.js +9 -9
  60. package/lib/es6/ScatterPlot.js +9 -9
  61. package/lib/es6/Tooltip.js +9 -9
  62. package/lib/es6/Venn.js +9 -9
  63. package/lib/es6/a11y/PlotA11yModule.js +2 -2
  64. package/lib/es6/a11y/PlotA11yView.js +2 -2
  65. package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
  66. package/lib/es6/component/Chart/BubbleChart.js +16 -51
  67. package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
  68. package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
  69. package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
  70. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
  71. package/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
  72. package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
  73. package/lib/es6/index.js +1 -1
  74. package/lib/es6/index.js.map +1 -1
  75. package/lib/es6/types/Area.d.js.map +1 -1
  76. package/lib/es6/types/Bar.d.js.map +1 -1
  77. package/lib/es6/types/Bubble.d.js.map +1 -1
  78. package/lib/es6/types/Donut.d.js.map +1 -1
  79. package/lib/es6/types/HorizontalBar.d.js.map +1 -1
  80. package/lib/es6/types/Line.d.js.map +1 -1
  81. package/lib/es6/types/Plot.d.js.map +1 -1
  82. package/lib/es6/types/Radar.d.js.map +1 -1
  83. package/lib/es6/types/ScatterPlot.d.js.map +1 -1
  84. package/lib/es6/types/StackBar.d.js.map +1 -1
  85. package/lib/es6/types/StackedArea.d.js.map +1 -1
  86. package/lib/es6/types/Venn.d.js.map +1 -1
  87. package/lib/es6/types/index.d.js.map +1 -1
  88. package/lib/es6/utils.js +34 -0
  89. package/lib/es6/utils.js.map +1 -1
  90. package/lib/types/Area.d.ts +1 -1
  91. package/lib/types/Bar.d.ts +1 -1
  92. package/lib/types/Bubble.d.ts +1 -1
  93. package/lib/types/Donut.d.ts +1 -1
  94. package/lib/types/HorizontalBar.d.ts +1 -1
  95. package/lib/types/Line.d.ts +1 -1
  96. package/lib/types/Plot.d.ts +1 -1
  97. package/lib/types/Radar.d.ts +1 -1
  98. package/lib/types/RadialTree.d.ts +1 -1
  99. package/lib/types/ScatterPlot.d.ts +1 -1
  100. package/lib/types/StackBar.d.ts +1 -1
  101. package/lib/types/StackedArea.d.ts +1 -1
  102. package/lib/types/Venn.d.ts +1 -1
  103. package/lib/types/component/Chart/AbstractChart.type.d.ts +1 -1
  104. package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +1 -1
  105. package/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +2 -2
  106. package/lib/types/index.d.ts +5 -0
  107. package/lib/types/utils.d.ts +6 -0
  108. package/package.json +6 -6
@@ -37,7 +37,7 @@ export type BarProps = Context & {
37
37
  * The maximum width of each Bar
38
38
  */
39
39
  maxBarSize?: number;
40
- /** Enables charts patterns that enhances charts accessability */
40
+ /** Enables charts patterns that enhances charts accessibility */
41
41
  patterns?: PatternsConfig;
42
42
  };
43
43
 
@@ -27,7 +27,7 @@ export type BubbleProps = Context & {
27
27
  duration?: number;
28
28
  /** Enables element transparency */
29
29
  transparent?: boolean;
30
- /** Enables charts patterns that enhances charts accessability */
30
+ /** Enables charts patterns that enhances charts accessibility */
31
31
  patterns?: PatternsConfig;
32
32
  };
33
33
 
@@ -25,7 +25,7 @@ export type DonutProps = Context & {
25
25
  * @default 0
26
26
  */
27
27
  paddingAngle?: number;
28
- /** Enables charts patterns that enhances charts accessability */
28
+ /** Enables charts patterns that enhances charts accessibility */
29
29
  patterns?: PatternsConfig;
30
30
  };
31
31
 
@@ -27,7 +27,7 @@ export type HorizontalBarProps = Context & {
27
27
  * The maximum width of each Bar
28
28
  */
29
29
  maxBarSize?: number;
30
- /** Enables charts patterns that enhances charts accessability */
30
+ /** Enables charts patterns that enhances charts accessibility */
31
31
  patterns?: PatternsConfig;
32
32
  };
33
33
 
@@ -24,7 +24,7 @@ export type LineProps = Context & {
24
24
  duration?: number;
25
25
  /** Enables element transparency */
26
26
  transparent?: boolean;
27
- /** Enables charts patterns that enhances charts accessability */
27
+ /** Enables charts patterns that enhances charts accessibility */
28
28
  patterns?: PatternsConfig;
29
29
  };
30
30
 
@@ -28,7 +28,7 @@ export type PlotProps = Context &
28
28
  /** Optional prop to tune up alt text generating for charts */
29
29
  a11yAltTextConfig?: PlotSummarizerConfig;
30
30
 
31
- /** Enables charts patterns that enhances charts accessability */
31
+ /** Enables charts patterns that enhances charts accessibility */
32
32
  patterns?: PatternsConfig;
33
33
 
34
34
  /** @deprecated */
@@ -36,7 +36,7 @@ export type RadarProps = Context & {
36
36
  * @example Math.PI/3
37
37
  * */
38
38
  angleOffset?: number;
39
- /** Enables charts patterns that enhances charts accessability */
39
+ /** Enables charts patterns that enhances charts accessibility */
40
40
  patterns?: PatternsConfig;
41
41
  };
42
42
 
@@ -155,7 +155,7 @@ export type RadialTreeRadianCapProps = {
155
155
  transparent?: boolean;
156
156
  ['data-radial-animation']?: `${string}-cap-circle`;
157
157
  ['data-radian-index']?: number;
158
- /** Enables charts patterns that enhances charts accessability */
158
+ /** Enables charts patterns that enhances charts accessibility */
159
159
  patterns?: PatternsConfig;
160
160
  };
161
161
  type RadialTreeRadianCapAsProps = RadialTreeRadianCapProps & {
@@ -27,7 +27,7 @@ export type ScatterPlotProps = Context & {
27
27
  r?: number;
28
28
  /** Enables element transparency */
29
29
  transparent?: boolean;
30
- /** Enables charts patterns that enhances charts accessability */
30
+ /** Enables charts patterns that enhances charts accessibility */
31
31
  patterns?: PatternsConfig;
32
32
  };
33
33
 
@@ -21,7 +21,7 @@ export type StackBarProps = Context & {
21
21
  */
22
22
  maxBarSize?: number;
23
23
 
24
- /** Enables charts patterns that enhances charts accessability */
24
+ /** Enables charts patterns that enhances charts accessibility */
25
25
  patterns?: PatternsConfig;
26
26
  };
27
27
 
@@ -16,7 +16,7 @@ export type StackedAreaProps = Context & {
16
16
  /** @deprecated */
17
17
  stack?: any;
18
18
 
19
- /** Enables charts patterns that enhances charts accessability */
19
+ /** Enables charts patterns that enhances charts accessibility */
20
20
  patterns?: PatternsConfig;
21
21
  };
22
22
 
@@ -19,7 +19,7 @@ export type VennProps = Context &
19
19
  * @default (circle1, circle2) => circle2.radius - circle1.radius
20
20
  */
21
21
  orientationOrder?: (c1: number, c2: number) => number;
22
- /** Enables charts patterns that enhances charts accessability */
22
+ /** Enables charts patterns that enhances charts accessibility */
23
23
  patterns?: PatternsConfig;
24
24
  };
25
25
 
@@ -48,7 +48,7 @@ export type BaseChartProps<T extends ListData | ObjectData> = FlexProps & {
48
48
  * Height of plot
49
49
  */
50
50
  plotHeight: number;
51
- /** Enables charts patterns that enhances charts accessability */
51
+ /** Enables charts patterns that enhances charts accessibility */
52
52
  patterns?: PatternsConfig;
53
53
  /**
54
54
  * Margin (for Y axis points) from left side of chart container to Y axis
@@ -25,6 +25,6 @@ export type LegendProps = BoxProps & BaseChartLegendProps & {
25
25
  * Legend items
26
26
  */
27
27
  items: LegendItem[];
28
- /** Enables charts patterns that enhances charts accessability */
28
+ /** Enables charts patterns that enhances charts accessibility */
29
29
  patterns?: PatternsConfig;
30
30
  };
@@ -38,7 +38,7 @@ export type LegendItem = {
38
38
  count: number;
39
39
  };
40
40
  patternKey?: string;
41
- /** Enables patterns symbols that enhances charts accessability */
41
+ /** Enables patterns symbols that enhances charts accessibility */
42
42
  patterns?: PatternsConfig;
43
43
  };
44
44
  export type LegendItemProps = LegendItem & {
@@ -55,7 +55,7 @@ export type LegendItemProps = LegendItem & {
55
55
  * !Need to redefine onClick, because we don't have `event` in it.
56
56
  */
57
57
  onClick: () => void;
58
- /** Enables patterns symbols that enhances charts accessability */
58
+ /** Enables patterns symbols that enhances charts accessibility */
59
59
  patterns?: PatternsConfig;
60
60
  };
61
61
  export type ShapeProps = LegendItem & {
@@ -1,6 +1,11 @@
1
1
  // Utils
2
2
  export declare function minMax(data: any, key: string | number): any;
3
3
  export declare const interpolateValue: Symbol;
4
+ export declare function calculateBubbleDomain(
5
+ data: Array<{ value: number; x: number; y: number }>,
6
+ key: 'x' | 'y',
7
+ range: [number, number],
8
+ ): [min: number, max: number];
4
9
 
5
10
  export { makeDataHintsContainer } from './a11y/hints';
6
11
 
@@ -32,3 +32,9 @@ export declare const interpolateValue: unique symbol;
32
32
  export declare const getChartDefaultColorName: (index: number) => string;
33
33
  export declare const getBubbleChartValueScale: (data: any[], key: string) => import("d3-scale").ScalePower<number, number, never>;
34
34
  export declare const getScatterPlotRadius: (valueKey?: string) => number;
35
+ type BubbleChartDataItem = {
36
+ value: number;
37
+ x: number;
38
+ y: number;
39
+ };
40
+ export declare const calculateBubbleDomain: (data: Array<BubbleChartDataItem>, key: 'x' | 'y', range: [number, number]) => [min: number, max: number];
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": "3.33.0",
4
+ "version": "3.34.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -15,11 +15,11 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@formatjs/intl": "2.3.0",
18
- "@semcore/animation": "2.19.2",
19
- "@semcore/divider": "4.18.5",
20
- "@semcore/flex-box": "5.19.4",
21
- "@semcore/popper": "5.21.0",
22
- "@semcore/utils": "4.20.5",
18
+ "@semcore/animation": "2.20.0",
19
+ "@semcore/divider": "4.19.0",
20
+ "@semcore/flex-box": "5.20.0",
21
+ "@semcore/popper": "5.22.0",
22
+ "@semcore/utils": "4.21.0",
23
23
  "@types/d3-shape": "^3.1.0",
24
24
  "@upsetjs/venn.js": "1.4.2",
25
25
  "d3-array": "3.1.6",