@gravity-ui/chartkit 4.17.0 → 4.18.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.
Files changed (55) hide show
  1. package/build/i18n/keysets/en.json +2 -1
  2. package/build/i18n/keysets/ru.json +2 -1
  3. package/build/plugins/d3/examples/area/PercentStacking.d.ts +2 -0
  4. package/build/plugins/d3/examples/area/PercentStacking.js +47 -0
  5. package/build/plugins/d3/examples/bar-x/PercentStack.d.ts +2 -0
  6. package/build/plugins/d3/examples/bar-x/PercentStack.js +47 -0
  7. package/build/plugins/d3/examples/bar-y/PercentStacking.d.ts +2 -0
  8. package/build/plugins/d3/examples/bar-y/PercentStacking.js +49 -0
  9. package/build/plugins/d3/examples/pie/DonutWithTotals.d.ts +2 -0
  10. package/build/plugins/d3/examples/pie/DonutWithTotals.js +36 -0
  11. package/build/plugins/d3/examples/scatter/Basic.js +0 -21
  12. package/build/plugins/d3/index.d.ts +1 -0
  13. package/build/plugins/d3/index.js +1 -0
  14. package/build/plugins/d3/renderer/D3Widget.js +4 -2
  15. package/build/plugins/d3/renderer/components/Tooltip/TooltipTriggerArea.js +5 -4
  16. package/build/plugins/d3/renderer/hooks/useSeries/constants.d.ts +2 -0
  17. package/build/plugins/d3/renderer/hooks/useSeries/constants.js +7 -1
  18. package/build/plugins/d3/renderer/hooks/useSeries/prepare-area.d.ts +2 -2
  19. package/build/plugins/d3/renderer/hooks/useSeries/prepare-area.js +2 -8
  20. package/build/plugins/d3/renderer/hooks/useSeries/{prepare-line-series.d.ts → prepare-line.d.ts} +2 -2
  21. package/build/plugins/d3/renderer/hooks/useSeries/{prepare-line-series.js → prepare-line.js} +2 -8
  22. package/build/plugins/d3/renderer/hooks/useSeries/prepare-pie.js +1 -0
  23. package/build/plugins/d3/renderer/hooks/useSeries/prepare-scatter.d.ts +11 -0
  24. package/build/plugins/d3/renderer/hooks/useSeries/prepare-scatter.js +45 -0
  25. package/build/plugins/d3/renderer/hooks/useSeries/prepareSeries.js +3 -24
  26. package/build/plugins/d3/renderer/hooks/useSeries/types.d.ts +24 -4
  27. package/build/plugins/d3/renderer/hooks/useSeries/utils.d.ts +1 -1
  28. package/build/plugins/d3/renderer/hooks/useSeries/utils.js +1 -1
  29. package/build/plugins/d3/renderer/hooks/useShapes/area/prepare-data.js +18 -0
  30. package/build/plugins/d3/renderer/hooks/useShapes/bar-x/prepare-data.js +15 -3
  31. package/build/plugins/d3/renderer/hooks/useShapes/bar-y/prepare-data.js +15 -4
  32. package/build/plugins/d3/renderer/hooks/useShapes/index.d.ts +2 -2
  33. package/build/plugins/d3/renderer/hooks/useShapes/marker.d.ts +4 -3
  34. package/build/plugins/d3/renderer/hooks/useShapes/marker.js +18 -19
  35. package/build/plugins/d3/renderer/hooks/useShapes/pie/index.js +14 -0
  36. package/build/plugins/d3/renderer/hooks/useShapes/scatter/index.d.ts +1 -2
  37. package/build/plugins/d3/renderer/hooks/useShapes/scatter/index.js +44 -56
  38. package/build/plugins/d3/renderer/hooks/useShapes/scatter/prepare-data.d.ts +1 -10
  39. package/build/plugins/d3/renderer/hooks/useShapes/scatter/prepare-data.js +6 -8
  40. package/build/plugins/d3/renderer/hooks/useShapes/scatter/types.d.ts +15 -0
  41. package/build/plugins/d3/renderer/hooks/useShapes/scatter/types.js +1 -0
  42. package/build/plugins/d3/renderer/hooks/useShapes/utils.d.ts +1 -1
  43. package/build/plugins/d3/renderer/utils/symbol.d.ts +1 -3
  44. package/build/plugins/d3/renderer/validation/index.js +18 -1
  45. package/build/plugins/d3/utils/index.d.ts +4 -0
  46. package/build/plugins/d3/utils/index.js +4 -0
  47. package/build/plugins/d3/utils/pie-center-text.d.ts +7 -0
  48. package/build/plugins/d3/utils/pie-center-text.js +23 -0
  49. package/build/types/widget-data/area.d.ts +2 -2
  50. package/build/types/widget-data/line.d.ts +1 -5
  51. package/build/types/widget-data/marker.d.ts +2 -0
  52. package/build/types/widget-data/pie.d.ts +11 -0
  53. package/build/types/widget-data/series.d.ts +9 -4
  54. package/build/types/widget-data/tooltip.d.ts +5 -1
  55. package/package.json +5 -3
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { PieSeries, PieSeriesData } from './pie';
3
3
  import type { ScatterSeries, ScatterSeriesData } from './scatter';
4
4
  import type { BarXSeries, BarXSeriesData } from './bar-x';
5
- import type { LineSeries, LineSeriesData, LineMarkerOptions } from './line';
5
+ import type { LineSeries, LineSeriesData } from './line';
6
6
  import type { BarYSeries, BarYSeriesData } from './bar-y';
7
7
  import type { PointMarkerOptions } from './marker';
8
8
  import type { AreaSeries, AreaSeriesData } from './area';
@@ -137,7 +137,12 @@ export type ChartKitWidgetSeriesOptions = {
137
137
  scatter?: {
138
138
  /** Options for the series states that provide additional styling information to the series. */
139
139
  states?: {
140
- hover?: BasicHoverState;
140
+ hover?: BasicHoverState & {
141
+ marker?: PointMarkerOptions & {
142
+ /** Options for the halo appearing around the hovered point */
143
+ halo?: Halo;
144
+ };
145
+ };
141
146
  inactive?: BasicInactiveState;
142
147
  };
143
148
  };
@@ -158,7 +163,7 @@ export type ChartKitWidgetSeriesOptions = {
158
163
  inactive?: BasicInactiveState;
159
164
  };
160
165
  /** Options for the point markers of line series */
161
- marker?: LineMarkerOptions;
166
+ marker?: PointMarkerOptions;
162
167
  /** Options for line style
163
168
  *
164
169
  * @default 'Solid'
@@ -187,7 +192,7 @@ export type ChartKitWidgetSeriesOptions = {
187
192
  inactive?: BasicInactiveState;
188
193
  };
189
194
  /** Options for the point markers of line series */
190
- marker?: LineMarkerOptions;
195
+ marker?: PointMarkerOptions;
191
196
  };
192
197
  };
193
198
  export {};
@@ -23,7 +23,11 @@ export type TooltipDataChunkPie<T = any> = {
23
23
  };
24
24
  export type TooltipDataChunkScatter<T = any> = {
25
25
  data: ScatterSeriesData<T>;
26
- series: ScatterSeries<T>;
26
+ series: {
27
+ type: ScatterSeries['type'];
28
+ id: string;
29
+ name: string;
30
+ };
27
31
  };
28
32
  export type TooltipDataChunkLine<T = any> = {
29
33
  data: LineSeriesData<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/chartkit",
3
- "version": "4.17.0",
3
+ "version": "4.18.1",
4
4
  "description": "React component used to render charts based on any sources you need",
5
5
  "license": "MIT",
6
6
  "repository": "git@github.com:gravity-ui/ChartKit.git",
@@ -48,7 +48,7 @@
48
48
  "dependencies": {
49
49
  "@bem-react/classname": "^1.6.0",
50
50
  "@gravity-ui/date-utils": "^1.4.1",
51
- "@gravity-ui/yagr": "^4.2.0",
51
+ "@gravity-ui/yagr": "^4.2.3",
52
52
  "afterframe": "^1.0.2",
53
53
  "d3": "^7.8.5",
54
54
  "lodash": "^4.17.21",
@@ -64,6 +64,7 @@
64
64
  "@gravity-ui/stylelint-config": "^1.0.1",
65
65
  "@gravity-ui/tsconfig": "^1.0.0",
66
66
  "@gravity-ui/uikit": "^5.6.0",
67
+ "@playwright/experimental-ct-react17": "^1.41.1",
67
68
  "@storybook/addon-essentials": "^7.0.26",
68
69
  "@storybook/addon-knobs": "^7.0.2",
69
70
  "@storybook/cli": "^7.0.26",
@@ -126,7 +127,8 @@
126
127
  "docs:build": "cd ./documentation && npm run build",
127
128
  "docs:serve": "cd ./documentation && npm run serve",
128
129
  "docs:deploy": "cd ./documentation && npm run deploy",
129
- "prepublishOnly": "npm run build"
130
+ "prepublishOnly": "npm run build",
131
+ "test:playwright": "playwright test -c tests/playwright.config.ts"
130
132
  },
131
133
  "husky": {
132
134
  "hooks": {