1 | import times from 'lodash/times';
|
2 | import { SERIES_NAME, SERIES_NAME_SHORT } from '../stories_utils';
|
3 |
|
4 | import {
|
5 | marqueeSelectionSvgPath,
|
6 | redoSvgPath,
|
7 | clearAllSvgPath,
|
8 | downloadSvgPath,
|
9 | } from '../svgs/svg_paths';
|
10 | import { colorFromDefaultPalette } from './theme';
|
11 |
|
12 | export const toolbox = {
|
13 | feature: {
|
14 | dataZoom: {
|
15 | icon: {
|
16 | zoom: marqueeSelectionSvgPath,
|
17 | back: redoSvgPath,
|
18 | },
|
19 | },
|
20 | restore: {
|
21 | icon: clearAllSvgPath,
|
22 | },
|
23 | saveAsImage: {
|
24 | icon: downloadSvgPath,
|
25 | },
|
26 | },
|
27 | };
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | export const generateSeriesData = (amount = 10, nameType = SERIES_NAME_SHORT) => {
|
37 | const defaultData = [820, 932, 960, 1150, 1290, 1330, 1390];
|
38 | const name = SERIES_NAME[nameType];
|
39 |
|
40 | return times(amount, (index) => ({
|
41 | color: colorFromDefaultPalette(index),
|
42 | data: defaultData.map((value) => value * index),
|
43 | name: `${name}${index + 1}`,
|
44 | }));
|
45 | };
|