@gravity-ui/chartkit 3.2.0 → 3.4.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 (70) hide show
  1. package/build/plugins/d3/renderer/components/AxisX.js +15 -5
  2. package/build/plugins/d3/renderer/components/AxisY.js +18 -8
  3. package/build/plugins/d3/renderer/components/Chart.js +3 -3
  4. package/build/plugins/d3/renderer/hooks/useChartOptions/chart.js +16 -9
  5. package/build/plugins/d3/renderer/hooks/useChartOptions/legend.js +4 -2
  6. package/build/plugins/d3/renderer/hooks/useChartOptions/types.d.ts +8 -0
  7. package/build/plugins/d3/renderer/hooks/useChartOptions/x-axis.js +8 -0
  8. package/build/plugins/d3/renderer/hooks/useChartOptions/y-axis.js +8 -0
  9. package/build/plugins/d3/renderer/hooks/useScales/index.js +22 -14
  10. package/build/plugins/d3/renderer/hooks/useShapes/bar-x.d.ts +16 -0
  11. package/build/plugins/d3/renderer/hooks/useShapes/bar-x.js +75 -0
  12. package/build/plugins/d3/renderer/hooks/useShapes/index.js +28 -57
  13. package/build/plugins/d3/renderer/hooks/useShapes/scatter.d.ts +18 -0
  14. package/build/plugins/d3/renderer/hooks/useShapes/scatter.js +62 -0
  15. package/build/plugins/highcharts/renderer/helpers/config/utils/index.js +1 -1
  16. package/build/types/widget-data/axis.d.ts +20 -0
  17. package/build/types/widget-data/bar-x.d.ts +31 -0
  18. package/build/types/widget-data/index.d.ts +6 -2
  19. package/build/types/widget-data/index.js +1 -0
  20. package/build/types/widget-data/series.d.ts +16 -2
  21. package/package.json +7 -2
  22. package/build/libs/chartkit-error/__tests__/chartkit-error.js +0 -27
  23. package/build/libs/settings/__tests__/settings.test.d.ts +0 -1
  24. package/build/libs/settings/__tests__/settings.test.js +0 -17
  25. package/build/plugins/d3/__stories__/LinearCategories.stories.d.ts +0 -4
  26. package/build/plugins/d3/__stories__/LinearCategories.stories.js +0 -101
  27. package/build/plugins/d3/__stories__/Timestamp.stories.d.ts +0 -4
  28. package/build/plugins/d3/__stories__/Timestamp.stories.js +0 -89
  29. package/build/plugins/d3/__stories__/penguins.json +0 -3098
  30. package/build/plugins/highcharts/__stories__/Line.stories.d.ts +0 -3
  31. package/build/plugins/highcharts/__stories__/Line.stories.js +0 -12
  32. package/build/plugins/highcharts/__stories__/Pie.stories.d.ts +0 -3
  33. package/build/plugins/highcharts/__stories__/Pie.stories.js +0 -12
  34. package/build/plugins/highcharts/__stories__/area/Range.stories.d.ts +0 -3
  35. package/build/plugins/highcharts/__stories__/area/Range.stories.js +0 -12
  36. package/build/plugins/highcharts/__stories__/area/Stacked.stories.d.ts +0 -3
  37. package/build/plugins/highcharts/__stories__/area/Stacked.stories.js +0 -12
  38. package/build/plugins/highcharts/__stories__/column/HorizontalStacked.stories.d.ts +0 -3
  39. package/build/plugins/highcharts/__stories__/column/HorizontalStacked.stories.js +0 -12
  40. package/build/plugins/highcharts/__stories__/column/Vertical.stories.d.ts +0 -3
  41. package/build/plugins/highcharts/__stories__/column/Vertical.stories.js +0 -12
  42. package/build/plugins/highcharts/__stories__/column/VerticalStacked.stories.d.ts +0 -3
  43. package/build/plugins/highcharts/__stories__/column/VerticalStacked.stories.js +0 -12
  44. package/build/plugins/highcharts/__stories__/combined/ComboChartWithSameLegendValues.stories.d.ts +0 -3
  45. package/build/plugins/highcharts/__stories__/combined/ComboChartWithSameLegendValues.stories.js +0 -12
  46. package/build/plugins/highcharts/__stories__/complex/TwoAxis.stories.d.ts +0 -3
  47. package/build/plugins/highcharts/__stories__/complex/TwoAxis.stories.js +0 -12
  48. package/build/plugins/highcharts/__stories__/components/ChartStory.d.ts +0 -12
  49. package/build/plugins/highcharts/__stories__/components/ChartStory.js +0 -28
  50. package/build/plugins/highcharts/__stories__/constants/story-settings.d.ts +0 -42
  51. package/build/plugins/highcharts/__stories__/constants/story-settings.js +0 -42
  52. package/build/plugins/highcharts/__stories__/custom-error-render/custom-error-render.stories.d.ts +0 -3
  53. package/build/plugins/highcharts/__stories__/custom-error-render/custom-error-render.stories.js +0 -41
  54. package/build/plugins/highcharts/__stories__/no-data/no-data.stories.d.ts +0 -3
  55. package/build/plugins/highcharts/__stories__/no-data/no-data.stories.js +0 -20
  56. package/build/plugins/highcharts/__stories__/pie/WithTotals.stories.d.ts +0 -3
  57. package/build/plugins/highcharts/__stories__/pie/WithTotals.stories.js +0 -12
  58. package/build/plugins/highcharts/__tests__/prepare-data.test.d.ts +0 -1
  59. package/build/plugins/highcharts/__tests__/prepare-data.test.js +0 -13
  60. package/build/plugins/indicator/__stories__/Indicator.stories.d.ts +0 -4
  61. package/build/plugins/indicator/__stories__/Indicator.stories.js +0 -45
  62. package/build/plugins/yagr/__stories__/Yagr.stories.d.ts +0 -6
  63. package/build/plugins/yagr/__stories__/Yagr.stories.js +0 -90
  64. package/build/plugins/yagr/__stories__/mocks/line10.d.ts +0 -53
  65. package/build/plugins/yagr/__stories__/mocks/line10.js +0 -78
  66. package/build/plugins/yagr/__tests__/utils.test.d.ts +0 -1
  67. package/build/plugins/yagr/__tests__/utils.test.js +0 -26
  68. package/build/utils/__tests__/common.test.d.ts +0 -1
  69. package/build/utils/__tests__/common.test.js +0 -9
  70. /package/build/{libs/chartkit-error/__tests__/chartkit-error.d.ts → types/widget-data/bar-x.js} +0 -0
@@ -1,78 +0,0 @@
1
- export const line10 = {
2
- data: {
3
- timeline: [
4
- 1636838612441, 1636925012441, 1637011412441, 1637097812441, 1637184212441,
5
- 1637270612441, 1637357012441, 1637443412441, 1637529812441, 1637616212441,
6
- ],
7
- graphs: [
8
- {
9
- id: '0',
10
- name: 'Serie 1',
11
- color: '#6c59c2',
12
- data: [45, 52, 89, 72, 39, 49, 82, 59, 36, 5],
13
- },
14
- {
15
- id: '1',
16
- name: 'Serie 2',
17
- color: '#6e8188',
18
- data: [37, 6, 51, 10, 65, 35, 72, 0, 94, 54],
19
- },
20
- {
21
- id: '2',
22
- name: 'Serie 3',
23
- color: '#e21576',
24
- data: [26, 54, 15, 40, 43, 18, 65, 46, 51, 33],
25
- },
26
- ],
27
- },
28
- libraryConfig: {
29
- chart: {
30
- series: {
31
- type: 'line',
32
- },
33
- select: {
34
- zoom: false,
35
- },
36
- },
37
- title: {
38
- text: 'line: random 10 pts',
39
- },
40
- axes: {
41
- x: {},
42
- },
43
- scales: {
44
- x: {},
45
- y: {
46
- type: 'linear',
47
- range: 'nice',
48
- },
49
- },
50
- cursor: {
51
- x: {
52
- visible: true,
53
- style: 'solid 2px rgba(230, 2, 7, 0.3)',
54
- },
55
- },
56
- tooltip: {
57
- show: true,
58
- tracking: 'sticky',
59
- },
60
- legend: {},
61
- processing: {},
62
- },
63
- };
64
- export const getNewConfig = () => {
65
- const startPoint = (Math.random() * 10 ** 5) >> 0; // eslint-disable-line no-bitwise
66
- return Object.assign(Object.assign({}, line10), { libraryConfig: Object.assign(Object.assign({}, line10.libraryConfig), { title: {
67
- text: 'line: random 100 pts',
68
- } }), data: {
69
- timeline: new Array(100).fill(0).map((_, i) => {
70
- return startPoint + i * 1000;
71
- }),
72
- graphs: line10.data.graphs.map((graph) => {
73
- return Object.assign(Object.assign({}, graph), { data: new Array(100).fill(0).map(() => {
74
- return (Math.random() * 100) >> 0; // eslint-disable-line no-bitwise
75
- }) });
76
- }),
77
- } });
78
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,26 +0,0 @@
1
- import { shapeYagrConfig } from '../renderer/utils';
2
- const DATA = {
3
- timeline: [1],
4
- graphs: [{ data: [45] }],
5
- };
6
- describe('plugins/yagr/utils', () => {
7
- describe('shapeYagrConfig > check chart property', () => {
8
- test.each([
9
- [{}, { appearance: { locale: 'en', theme: 'dark' } }],
10
- [{ appearance: { locale: 'ru' } }, { appearance: { locale: 'ru', theme: 'dark' } }],
11
- [{ appearance: { theme: 'light' } }, { appearance: { locale: 'en', theme: 'light' } }],
12
- [
13
- { series: { type: 'dots' }, select: { zoom: false }, timeMultiplier: 1 },
14
- {
15
- appearance: { locale: 'en', theme: 'dark' },
16
- series: { type: 'dots' },
17
- select: { zoom: false },
18
- timeMultiplier: 1,
19
- },
20
- ],
21
- ])('(args: %j)', (chart, expected) => {
22
- const config = shapeYagrConfig({ data: DATA, libraryConfig: { chart }, theme: 'dark' });
23
- expect(config.chart).toEqual(expected);
24
- });
25
- });
26
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- import { getRandomCKId } from '../common';
2
- // length of "ck." + 10 random symbols
3
- const ID_LENGTH = 13;
4
- describe('utils/getRandomCKId', () => {
5
- it('Id should have 13 symbols', () => {
6
- const result = getRandomCKId();
7
- expect(result.length).toBe(ID_LENGTH);
8
- });
9
- });