@cloud-ru/uikit-product-charts 0.13.12
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 +843 -0
- package/LICENSE +201 -0
- package/README.md +8 -0
- package/package.json +67 -0
- package/src/components/BagelChart/BagelChart.tsx +47 -0
- package/src/components/BagelChart/index.ts +1 -0
- package/src/components/BagelChart/styles.module.scss +29 -0
- package/src/components/BagelChart/utils.ts +14 -0
- package/src/components/HeatMapChart/HeatMapChart.tsx +154 -0
- package/src/components/HeatMapChart/constants.ts +4 -0
- package/src/components/HeatMapChart/helpers/constants.ts +6 -0
- package/src/components/HeatMapChart/helpers/getComputedColor.ts +5 -0
- package/src/components/HeatMapChart/helpers/getContrastColor.ts +16 -0
- package/src/components/HeatMapChart/helpers/getStyles.ts +34 -0
- package/src/components/HeatMapChart/helpers/getTickValues.ts +63 -0
- package/src/components/HeatMapChart/helpers/index.ts +4 -0
- package/src/components/HeatMapChart/index.ts +2 -0
- package/src/components/HeatMapChart/styles.module.scss +96 -0
- package/src/components/HeatMapChart/types.ts +40 -0
- package/src/components/InteractiveChart/InteractiveChart.tsx +75 -0
- package/src/components/InteractiveChart/configurations/boxPlot.ts +75 -0
- package/src/components/InteractiveChart/configurations/defaultPlot.ts +63 -0
- package/src/components/InteractiveChart/configurations/index.ts +2 -0
- package/src/components/InteractiveChart/constants.ts +19 -0
- package/src/components/InteractiveChart/helpers/pathRenderer.ts +48 -0
- package/src/components/InteractiveChart/hooks/useComputedColors.ts +32 -0
- package/src/components/InteractiveChart/hooks/useLayer.ts +33 -0
- package/src/components/InteractiveChart/index.ts +2 -0
- package/src/components/InteractiveChart/plugins/boxPlotPlugin.ts +132 -0
- package/src/components/InteractiveChart/plugins/columnHighlightPlugin.ts +78 -0
- package/src/components/InteractiveChart/plugins/legendAsTooltipPlugin.ts +69 -0
- package/src/components/InteractiveChart/plugins/wheelZoomPlugin.ts +115 -0
- package/src/components/InteractiveChart/styles.module.scss +39 -0
- package/src/components/InteractiveChart/types.ts +7 -0
- package/src/components/PieChart/Legend/Legend.tsx +71 -0
- package/src/components/PieChart/Legend/index.ts +1 -0
- package/src/components/PieChart/Legend/styles.module.scss +45 -0
- package/src/components/PieChart/Pie.tsx +71 -0
- package/src/components/PieChart/PieChart.tsx +154 -0
- package/src/components/PieChart/index.ts +2 -0
- package/src/components/PieChart/styles.module.scss +56 -0
- package/src/components/PieChart/types.ts +42 -0
- package/src/components/index.ts +4 -0
- package/src/constants/colors.ts +70 -0
- package/src/index.ts +1 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { themeVars } from '@sbercloud/figma-tokens-cloud-platform';
|
|
2
|
+
import { ValueOf } from '@snack-uikit/utils';
|
|
3
|
+
|
|
4
|
+
export const COLOR_CONTAINER_CLASSNAME = 'interactive-chart-wrapper';
|
|
5
|
+
|
|
6
|
+
export const SERIES_COLORS = {
|
|
7
|
+
Green1: 'green1',
|
|
8
|
+
Blue1: 'blue1',
|
|
9
|
+
Violet1: 'violet1',
|
|
10
|
+
Crimson1: 'crimson1',
|
|
11
|
+
Green2: 'green2',
|
|
12
|
+
Blue2: 'blue2',
|
|
13
|
+
Violet2: 'violet2',
|
|
14
|
+
Crimson2: 'crimson2',
|
|
15
|
+
Green3: 'green3',
|
|
16
|
+
Blue3: 'blue3',
|
|
17
|
+
Violet3: 'violet3',
|
|
18
|
+
Crimson3: 'crimson3',
|
|
19
|
+
Green4: 'green4',
|
|
20
|
+
Blue4: 'blue4',
|
|
21
|
+
Violet4: 'violet4',
|
|
22
|
+
Crimson4: 'crimson4',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type SeriesColor = ValueOf<typeof SERIES_COLORS>;
|
|
26
|
+
export type SeriesColorMap = Record<SeriesColor, string>;
|
|
27
|
+
|
|
28
|
+
export const CHART_SERIES_COLORS: SeriesColorMap = {
|
|
29
|
+
[SERIES_COLORS.Green1]: themeVars.sys.green.accentDefault,
|
|
30
|
+
[SERIES_COLORS.Green2]: themeVars.sys.green.textLight,
|
|
31
|
+
[SERIES_COLORS.Green3]: themeVars.sys.green.textDisabled,
|
|
32
|
+
[SERIES_COLORS.Green4]: themeVars.sys.green.decorActivated,
|
|
33
|
+
[SERIES_COLORS.Blue1]: themeVars.sys.blue.accentDefault,
|
|
34
|
+
[SERIES_COLORS.Blue2]: themeVars.sys.blue.textLight,
|
|
35
|
+
[SERIES_COLORS.Blue3]: themeVars.sys.blue.textDisabled,
|
|
36
|
+
[SERIES_COLORS.Blue4]: themeVars.sys.blue.decorActivated,
|
|
37
|
+
[SERIES_COLORS.Violet1]: themeVars.sys.violet.accentDefault,
|
|
38
|
+
[SERIES_COLORS.Violet2]: themeVars.sys.violet.textLight,
|
|
39
|
+
[SERIES_COLORS.Violet3]: themeVars.sys.violet.textDisabled,
|
|
40
|
+
[SERIES_COLORS.Violet4]: themeVars.sys.violet.decorActivated,
|
|
41
|
+
[SERIES_COLORS.Crimson1]: themeVars.sys.pink.accentDefault,
|
|
42
|
+
[SERIES_COLORS.Crimson2]: themeVars.sys.pink.textLight,
|
|
43
|
+
[SERIES_COLORS.Crimson3]: themeVars.sys.pink.textDisabled,
|
|
44
|
+
[SERIES_COLORS.Crimson4]: themeVars.sys.pink.decorActivated,
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const OTHER_COLORS = {
|
|
48
|
+
ShadowColor: 'shadowColor',
|
|
49
|
+
LineColor: 'lineColor',
|
|
50
|
+
TooltipBackgroundColor: 'tooltipBackgroundColor',
|
|
51
|
+
TooltipColor: 'tooltipColor',
|
|
52
|
+
ColumnHighlightColor: 'columnHighlightColor',
|
|
53
|
+
AxisColor: 'axisColor',
|
|
54
|
+
LabelColor: 'labelColor',
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type OtherColor = ValueOf<typeof OTHER_COLORS>;
|
|
58
|
+
export type OtherColorMap = Record<OtherColor, string>;
|
|
59
|
+
|
|
60
|
+
export const CHART_OTHER_COLORS: OtherColorMap = {
|
|
61
|
+
[OTHER_COLORS.ShadowColor]: themeVars.sys.neutral.accentDefault,
|
|
62
|
+
[OTHER_COLORS.LineColor]: themeVars.sys.neutral.onAccent,
|
|
63
|
+
[OTHER_COLORS.TooltipBackgroundColor]: themeVars.sys.invertNeutral.background,
|
|
64
|
+
[OTHER_COLORS.TooltipColor]: themeVars.sys.invertNeutral.textMain,
|
|
65
|
+
[OTHER_COLORS.ColumnHighlightColor]: themeVars.sys.neutral.decorDefault,
|
|
66
|
+
[OTHER_COLORS.AxisColor]: themeVars.sys.neutral.decorDefault,
|
|
67
|
+
[OTHER_COLORS.LabelColor]: themeVars.sys.neutral.textSupport,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type ColorMap = SeriesColorMap & OtherColorMap;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|