@orbcharts/plugins-basic 3.0.0-alpha.56 → 3.0.0-alpha.57

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 (87) hide show
  1. package/LICENSE +200 -200
  2. package/dist/orbcharts-plugins-basic.es.js +7064 -7067
  3. package/dist/orbcharts-plugins-basic.umd.js +10 -10
  4. package/dist/src/base/BaseLineAreas.d.ts +1 -0
  5. package/dist/src/base/BaseLines.d.ts +3 -1
  6. package/dist/src/grid/gridObservables.d.ts +19 -2
  7. package/dist/src/grid/types.d.ts +1 -0
  8. package/dist/vite.config.d.mts +2 -0
  9. package/package.json +43 -42
  10. package/src/base/BaseBarStack.ts +778 -778
  11. package/src/base/BaseBars.ts +764 -764
  12. package/src/base/BaseBarsTriangle.ts +672 -672
  13. package/src/base/BaseDots.ts +513 -513
  14. package/src/base/BaseGroupAxis.ts +558 -558
  15. package/src/base/BaseLegend.ts +641 -641
  16. package/src/base/BaseLineAreas.ts +628 -625
  17. package/src/base/BaseLines.ts +704 -699
  18. package/src/base/BaseValueAxis.ts +478 -478
  19. package/src/base/types.ts +2 -2
  20. package/src/grid/defaults.ts +128 -127
  21. package/src/grid/gridObservables.ts +539 -248
  22. package/src/grid/index.ts +15 -15
  23. package/src/grid/plugins/BarStack.ts +43 -43
  24. package/src/grid/plugins/Bars.ts +44 -44
  25. package/src/grid/plugins/BarsPN.ts +41 -41
  26. package/src/grid/plugins/BarsTriangle.ts +42 -42
  27. package/src/grid/plugins/Dots.ts +37 -37
  28. package/src/grid/plugins/GridLegend.ts +59 -59
  29. package/src/grid/plugins/GroupAux.ts +976 -922
  30. package/src/grid/plugins/GroupAxis.ts +35 -35
  31. package/src/grid/plugins/LineAreas.ts +40 -39
  32. package/src/grid/plugins/Lines.ts +40 -38
  33. package/src/grid/plugins/ScalingArea.ts +173 -173
  34. package/src/grid/plugins/ValueAxis.ts +36 -36
  35. package/src/grid/plugins/ValueStackAxis.ts +38 -38
  36. package/src/grid/types.ts +123 -122
  37. package/src/index.ts +9 -9
  38. package/src/multiGrid/defaults.ts +158 -158
  39. package/src/multiGrid/index.ts +13 -13
  40. package/src/multiGrid/multiGridObservables.ts +49 -49
  41. package/src/multiGrid/plugins/MultiBarStack.ts +78 -78
  42. package/src/multiGrid/plugins/MultiBars.ts +77 -77
  43. package/src/multiGrid/plugins/MultiBarsTriangle.ts +77 -77
  44. package/src/multiGrid/plugins/MultiDots.ts +65 -65
  45. package/src/multiGrid/plugins/MultiGridLegend.ts +89 -89
  46. package/src/multiGrid/plugins/MultiGroupAxis.ts +69 -69
  47. package/src/multiGrid/plugins/MultiLineAreas.ts +77 -67
  48. package/src/multiGrid/plugins/MultiLines.ts +77 -66
  49. package/src/multiGrid/plugins/MultiValueAxis.ts +69 -69
  50. package/src/multiGrid/plugins/MultiValueStackAxis.ts +69 -69
  51. package/src/multiGrid/plugins/OverlappingValueAxes.ts +167 -167
  52. package/src/multiGrid/plugins/OverlappingValueStackAxes.ts +168 -168
  53. package/src/multiGrid/types.ts +72 -72
  54. package/src/noneData/defaults.ts +102 -102
  55. package/src/noneData/index.ts +3 -3
  56. package/src/noneData/plugins/Container.ts +10 -10
  57. package/src/noneData/plugins/Tooltip.ts +310 -310
  58. package/src/noneData/types.ts +26 -26
  59. package/src/series/defaults.ts +144 -144
  60. package/src/series/index.ts +9 -9
  61. package/src/series/plugins/Bubbles.ts +545 -545
  62. package/src/series/plugins/Pie.ts +576 -576
  63. package/src/series/plugins/PieEventTexts.ts +262 -262
  64. package/src/series/plugins/PieLabels.ts +304 -304
  65. package/src/series/plugins/Rose.ts +472 -472
  66. package/src/series/plugins/RoseLabels.ts +362 -362
  67. package/src/series/plugins/SeriesLegend.ts +59 -59
  68. package/src/series/seriesObservables.ts +145 -145
  69. package/src/series/seriesUtils.ts +51 -51
  70. package/src/series/types.ts +83 -83
  71. package/src/tree/defaults.ts +23 -23
  72. package/src/tree/index.ts +3 -3
  73. package/src/tree/plugins/TreeLegend.ts +59 -59
  74. package/src/tree/plugins/TreeMap.ts +305 -305
  75. package/src/tree/types.ts +23 -23
  76. package/src/utils/commonUtils.ts +21 -21
  77. package/src/utils/d3Graphics.ts +124 -124
  78. package/src/utils/d3Utils.ts +73 -73
  79. package/src/utils/observables.ts +14 -14
  80. package/src/utils/orbchartsUtils.ts +100 -100
  81. package/{tsconfig.json → tsconfig.base.json} +13 -13
  82. package/tsconfig.json.bak.vite-plugin-tsconfig +8 -0
  83. package/tsconfig.prod.json +2 -13
  84. package/vite.config.mjs +41 -0
  85. package/dist/vite.config.d.ts +0 -2
  86. package/tsconfig.dev.json +0 -17
  87. package/vite.config.js +0 -50
@@ -1,39 +1,39 @@
1
- import {
2
- takeUntil,
3
- map,
4
- distinctUntilChanged,
5
- shareReplay,
6
- switchMap,
7
- iif,
8
- Observable,
9
- Subject } from 'rxjs'
10
- import type { ComputedDataGrid } from '@orbcharts/core'
11
- import {
12
- defineGridPlugin } from '@orbcharts/core'
13
- import { DEFAULT_VALUE_STACK_AXIS_PARAMS } from '../defaults'
14
- import { createBaseValueAxis } from '../../base/BaseValueAxis'
15
-
16
- const pluginName = 'ValueStackAxis'
17
-
18
- export const ValueStackAxis = defineGridPlugin(pluginName, DEFAULT_VALUE_STACK_AXIS_PARAMS)(({ selection, name, observer, subject }) => {
19
-
20
- const destroy$ = new Subject()
21
-
22
- const unsubscribeBaseValueAxis = createBaseValueAxis(pluginName, {
23
- selection,
24
- computedData$: observer.computedStackedData$, // 計算疊加value的資料
25
- fullParams$: observer.fullParams$,
26
- fullDataFormatter$: observer.fullDataFormatter$,
27
- fullChartParams$: observer.fullChartParams$,
28
- gridAxesTransform$: observer.gridAxesTransform$,
29
- gridAxesReverseTransform$: observer.gridAxesReverseTransform$,
30
- gridAxesSize$: observer.gridAxesSize$,
31
- gridContainerPosition$: observer.gridContainerPosition$,
32
- isSeriesSeprate$: observer.isSeriesSeprate$,
33
- })
34
-
35
- return () => {
36
- destroy$.next(undefined)
37
- unsubscribeBaseValueAxis()
38
- }
1
+ import {
2
+ takeUntil,
3
+ map,
4
+ distinctUntilChanged,
5
+ shareReplay,
6
+ switchMap,
7
+ iif,
8
+ Observable,
9
+ Subject } from 'rxjs'
10
+ import type { ComputedDataGrid } from '@orbcharts/core'
11
+ import {
12
+ defineGridPlugin } from '@orbcharts/core'
13
+ import { DEFAULT_VALUE_STACK_AXIS_PARAMS } from '../defaults'
14
+ import { createBaseValueAxis } from '../../base/BaseValueAxis'
15
+
16
+ const pluginName = 'ValueStackAxis'
17
+
18
+ export const ValueStackAxis = defineGridPlugin(pluginName, DEFAULT_VALUE_STACK_AXIS_PARAMS)(({ selection, name, observer, subject }) => {
19
+
20
+ const destroy$ = new Subject()
21
+
22
+ const unsubscribeBaseValueAxis = createBaseValueAxis(pluginName, {
23
+ selection,
24
+ computedData$: observer.computedStackedData$, // 計算疊加value的資料
25
+ fullParams$: observer.fullParams$,
26
+ fullDataFormatter$: observer.fullDataFormatter$,
27
+ fullChartParams$: observer.fullChartParams$,
28
+ gridAxesTransform$: observer.gridAxesTransform$,
29
+ gridAxesReverseTransform$: observer.gridAxesReverseTransform$,
30
+ gridAxesSize$: observer.gridAxesSize$,
31
+ gridContainerPosition$: observer.gridContainerPosition$,
32
+ isSeriesSeprate$: observer.isSeriesSeprate$,
33
+ })
34
+
35
+ return () => {
36
+ destroy$.next(undefined)
37
+ unsubscribeBaseValueAxis()
38
+ }
39
39
  })
package/src/grid/types.ts CHANGED
@@ -1,123 +1,124 @@
1
- import type { ColorType } from '@orbcharts/core'
2
- // import type { BaseLegendParams } from '../base/BaseLegend'
3
-
4
- // export type LineType = 'line' | 'area' | 'gradientArea'
5
- // export type BarType = 'rect' | 'triangle'
6
-
7
- export interface LinesParams {
8
- lineCurve: string
9
- lineWidth: number
10
- // labelFn: (d: ComputedDatumSeries) => string
11
- // labelPositionFn: (d: ComputedDatumSeries) => 'top' | 'bottom' | 'left' | 'right' | 'center'
12
- // labelStyleFn: (d: ComputedDatumSeries) => string
13
- // labelFontSizeFn: (d: ComputedDatumSeries) => number
14
- // labelColorFn: (d: ComputedDatumSeries) => string
15
- // labelPadding: number
16
- }
17
-
18
- export interface LineAreasParams {
19
- lineCurve: string
20
- linearGradientOpacity: [number, number]
21
- }
22
-
23
- export interface DotsParams {
24
- radius: number
25
- fillColorType: ColorType
26
- strokeColorType: ColorType
27
- strokeWidth: number
28
- // strokeWidthWhileHighlight: number
29
- onlyShowHighlighted: boolean
30
- }
31
-
32
- export interface GroupAuxParams {
33
- showLine: boolean
34
- showLabel: boolean
35
- lineDashArray: string
36
- lineColorType: ColorType
37
- labelColorType: ColorType
38
- labelTextColorType: ColorType
39
- labelTextFormat: string | ((text: any) => string)
40
- labelPadding: number
41
- }
42
-
43
- export interface BarsParams {
44
- // barType: BarType
45
- barWidth: number
46
- barPadding: number
47
- barGroupPadding: number // 群組和群組間的間隔
48
- barRadius: number | boolean
49
- }
50
-
51
- export interface BarsPNParams extends BarsParams {}
52
-
53
- export interface BarStackParams {
54
- barWidth: number
55
- barGroupPadding: number
56
- barRadius: number | boolean
57
- }
58
-
59
- export interface BarsTriangleParams {
60
- barWidth: number
61
- barPadding: number
62
- barGroupPadding: number // 群組和群組間的間隔
63
- linearGradientOpacity: [number, number]
64
- }
65
-
66
- export interface GroupAxisParams {
67
- // xLabel: string
68
- // labelAnchor: 'start' | 'end'
69
- labelOffset: [number, number]
70
- labelColorType: ColorType
71
- axisLineVisible: boolean
72
- axisLineColorType: ColorType
73
- ticks: number | null | 'all'
74
- tickFormat: string | ((text: any) => string)
75
- tickLineVisible: boolean
76
- tickPadding: number
77
- tickFullLine: boolean
78
- tickFullLineDasharray: string
79
- tickColorType: ColorType
80
- // axisLineColor: string
81
- // axisLabelColor: string
82
- tickTextRotate: number
83
- tickTextColorType: ColorType
84
- }
85
-
86
- export interface ValueAxisParams {
87
- // xLabel: string
88
- // labelAnchor: 'start' | 'end'
89
- labelOffset: [number, number]
90
- labelColorType: ColorType
91
- axisLineVisible: boolean
92
- axisLineColorType: ColorType
93
- ticks: number | null
94
- tickFormat: string | ((text: d3.NumberValue) => string)
95
- tickLineVisible: boolean
96
- tickPadding: number
97
- tickFullLine: boolean
98
- tickFullLineDasharray: string
99
- tickColorType: ColorType
100
- // axisLineColor: string
101
- // axisLabelColor: string
102
- tickTextRotate: number
103
- tickTextColorType: ColorType
104
- }
105
-
106
- export interface ValueStackAxisParams extends ValueAxisParams {}
107
-
108
- export interface ScalingAreaParams {
109
-
110
- }
111
-
112
- export interface GridLegendParams {
113
- position: 'top' | 'bottom' | 'left' | 'right'
114
- justify: 'start' | 'center' | 'end'
115
- padding: number
116
- backgroundFill: ColorType
117
- backgroundStroke: ColorType
118
- gap: number
119
- listRectWidth: number
120
- listRectHeight: number
121
- listRectRadius: number
122
- textColorType: ColorType
1
+ import type { ColorType } from '@orbcharts/core'
2
+ // import type { BaseLegendParams } from '../base/BaseLegend'
3
+
4
+ // export type LineType = 'line' | 'area' | 'gradientArea'
5
+ // export type BarType = 'rect' | 'triangle'
6
+
7
+ export interface LinesParams {
8
+ lineCurve: string
9
+ lineWidth: number
10
+ // labelFn: (d: ComputedDatumSeries) => string
11
+ // labelPositionFn: (d: ComputedDatumSeries) => 'top' | 'bottom' | 'left' | 'right' | 'center'
12
+ // labelStyleFn: (d: ComputedDatumSeries) => string
13
+ // labelFontSizeFn: (d: ComputedDatumSeries) => number
14
+ // labelColorFn: (d: ComputedDatumSeries) => string
15
+ // labelPadding: number
16
+ }
17
+
18
+ export interface LineAreasParams {
19
+ lineCurve: string
20
+ linearGradientOpacity: [number, number]
21
+ }
22
+
23
+ export interface DotsParams {
24
+ radius: number
25
+ fillColorType: ColorType
26
+ strokeColorType: ColorType
27
+ strokeWidth: number
28
+ // strokeWidthWhileHighlight: number
29
+ onlyShowHighlighted: boolean
30
+ }
31
+
32
+ export interface GroupAuxParams {
33
+ showLine: boolean
34
+ showLabel: boolean
35
+ lineDashArray: string
36
+ lineColorType: ColorType
37
+ labelColorType: ColorType
38
+ labelTextColorType: ColorType
39
+ labelTextFormat: string | ((text: any) => string)
40
+ labelPadding: number
41
+ labelRotate: number
42
+ }
43
+
44
+ export interface BarsParams {
45
+ // barType: BarType
46
+ barWidth: number
47
+ barPadding: number
48
+ barGroupPadding: number // 群組和群組間的間隔
49
+ barRadius: number | boolean
50
+ }
51
+
52
+ export interface BarsPNParams extends BarsParams {}
53
+
54
+ export interface BarStackParams {
55
+ barWidth: number
56
+ barGroupPadding: number
57
+ barRadius: number | boolean
58
+ }
59
+
60
+ export interface BarsTriangleParams {
61
+ barWidth: number
62
+ barPadding: number
63
+ barGroupPadding: number // 群組和群組間的間隔
64
+ linearGradientOpacity: [number, number]
65
+ }
66
+
67
+ export interface GroupAxisParams {
68
+ // xLabel: string
69
+ // labelAnchor: 'start' | 'end'
70
+ labelOffset: [number, number]
71
+ labelColorType: ColorType
72
+ axisLineVisible: boolean
73
+ axisLineColorType: ColorType
74
+ ticks: number | null | 'all'
75
+ tickFormat: string | ((text: any) => string)
76
+ tickLineVisible: boolean
77
+ tickPadding: number
78
+ tickFullLine: boolean
79
+ tickFullLineDasharray: string
80
+ tickColorType: ColorType
81
+ // axisLineColor: string
82
+ // axisLabelColor: string
83
+ tickTextRotate: number
84
+ tickTextColorType: ColorType
85
+ }
86
+
87
+ export interface ValueAxisParams {
88
+ // xLabel: string
89
+ // labelAnchor: 'start' | 'end'
90
+ labelOffset: [number, number]
91
+ labelColorType: ColorType
92
+ axisLineVisible: boolean
93
+ axisLineColorType: ColorType
94
+ ticks: number | null
95
+ tickFormat: string | ((text: d3.NumberValue) => string)
96
+ tickLineVisible: boolean
97
+ tickPadding: number
98
+ tickFullLine: boolean
99
+ tickFullLineDasharray: string
100
+ tickColorType: ColorType
101
+ // axisLineColor: string
102
+ // axisLabelColor: string
103
+ tickTextRotate: number
104
+ tickTextColorType: ColorType
105
+ }
106
+
107
+ export interface ValueStackAxisParams extends ValueAxisParams {}
108
+
109
+ export interface ScalingAreaParams {
110
+
111
+ }
112
+
113
+ export interface GridLegendParams {
114
+ position: 'top' | 'bottom' | 'left' | 'right'
115
+ justify: 'start' | 'center' | 'end'
116
+ padding: number
117
+ backgroundFill: ColorType
118
+ backgroundStroke: ColorType
119
+ gap: number
120
+ listRectWidth: number
121
+ listRectHeight: number
122
+ listRectRadius: number
123
+ textColorType: ColorType
123
124
  }
package/src/index.ts CHANGED
@@ -1,10 +1,10 @@
1
- // export { default as container } from './noneDataPlugins/container'
2
- // export { default as pie } from './seriesPlugins/pie'
3
- // export { default as pieEventTexts } from './seriesPlugins/pieEventTexts'
4
- // export { default as pieLabels } from './seriesPlugins/pieLabels'
5
-
6
- export * from './grid'
7
- export * from './multiGrid'
8
- export * from './noneData'
9
- export * from './series'
1
+ // export { default as container } from './noneDataPlugins/container'
2
+ // export { default as pie } from './seriesPlugins/pie'
3
+ // export { default as pieEventTexts } from './seriesPlugins/pieEventTexts'
4
+ // export { default as pieLabels } from './seriesPlugins/pieLabels'
5
+
6
+ export * from './grid'
7
+ export * from './multiGrid'
8
+ export * from './noneData'
9
+ export * from './series'
10
10
  export * from './tree'
@@ -1,159 +1,159 @@
1
- import type {
2
- MultiGridLegendParams,
3
- MultiBarsParams,
4
- MultiBarStackParams,
5
- MultiBarsTriangleParams,
6
- MultiLinesParams,
7
- MultiLineAreasParams,
8
- MultiDotsParams,
9
- MultiGroupAxisParams,
10
- MultiValueAxisParams,
11
- MultiValueStackAxisParams,
12
- OverlappingValueAxesParams,
13
- OverlappingValueStackAxesParams
14
- } from './types'
15
-
16
- export const DEFAULT_MULTI_GRID_LEGEND_PARAMS: MultiGridLegendParams = {
17
- position: 'right',
18
- justify: 'end',
19
- padding: 28,
20
- backgroundFill: 'none',
21
- backgroundStroke: 'none',
22
- gap: 10,
23
- listRectWidth: 14,
24
- listRectHeight: 14,
25
- listRectRadius: 0,
26
- gridList: [
27
- {
28
- listRectWidth: 14,
29
- listRectHeight: 14,
30
- listRectRadius: 0,
31
- }
32
- ],
33
- textColorType: 'primary'
34
- }
35
-
36
- export const DEFAULT_MULTI_GROUP_AXIS_PARAMS: MultiGroupAxisParams = {
37
- // labelAnchor: 'start',
38
- labelOffset: [0, 0],
39
- labelColorType: 'primary',
40
- axisLineVisible: true,
41
- axisLineColorType: 'primary',
42
- ticks: 'all',
43
- tickFormat: text => text,
44
- tickLineVisible: true,
45
- tickPadding: 20,
46
- tickFullLine: false,
47
- tickFullLineDasharray: 'none',
48
- tickColorType: 'secondary',
49
- tickTextRotate: 0,
50
- tickTextColorType: 'primary',
51
- gridIndexes: [0]
52
- }
53
- DEFAULT_MULTI_GROUP_AXIS_PARAMS.tickFormat.toString = () => `text => text`
54
-
55
- export const DEFAULT_MULTI_VALUE_AXIS_PARAMS: MultiValueAxisParams = {
56
- // labelAnchor: 'end',
57
- labelOffset: [0, 0],
58
- labelColorType: 'primary',
59
- axisLineVisible: false,
60
- axisLineColorType: 'primary',
61
- ticks: 4,
62
- tickFormat: ',.0f',
63
- tickLineVisible: true,
64
- tickPadding: 20,
65
- tickFullLine: true,
66
- tickFullLineDasharray: 'none',
67
- tickColorType: 'secondary',
68
- tickTextRotate: 0,
69
- tickTextColorType: 'primary',
70
- gridIndexes: [0]
71
- }
72
-
73
- export const DEFAULT_MULTI_VALUE_STACK_AXIS_PARAMS: MultiValueStackAxisParams = {
74
- ...DEFAULT_MULTI_VALUE_AXIS_PARAMS
75
- }
76
-
77
- export const DEFAULT_MULTI_BARS_PARAMS: MultiBarsParams = {
78
- barWidth: 0,
79
- barPadding: 1,
80
- barGroupPadding: 40,
81
- barRadius: false,
82
- gridIndexes: [0]
83
- }
84
-
85
- export const DEFAULT_MULTI_BAR_STACK_PARAMS: MultiBarStackParams = {
86
- barWidth: 0,
87
- barGroupPadding: 10,
88
- barRadius: false,
89
- gridIndexes: [0]
90
- }
91
-
92
- export const DEFAULT_MULTI_BARS_TRIANGLE_PARAMS: MultiBarsTriangleParams = {
93
- barWidth: 0,
94
- barPadding: 1,
95
- barGroupPadding: 20,
96
- linearGradientOpacity: [1, 0],
97
- gridIndexes: [0]
98
- }
99
-
100
- export const DEFAULT_MULTI_LINES_PARAMS: MultiLinesParams = {
101
- lineCurve: 'curveLinear',
102
- lineWidth: 2,
103
- gridIndexes: [1]
104
- }
105
-
106
- export const DEFAULT_MULTI_LINE_AREAS_PARAMS: MultiLineAreasParams = {
107
- lineCurve: 'curveLinear',
108
- linearGradientOpacity: [1, 0],
109
- gridIndexes: [1]
110
- }
111
-
112
- export const DEFAULT_MULTI_DOTS_PARAMS: MultiDotsParams = {
113
- radius: 4,
114
- fillColorType: 'white',
115
- strokeColorType: 'series',
116
- strokeWidth: 2,
117
- onlyShowHighlighted: false,
118
- gridIndexes: [1]
119
- }
120
-
121
- export const DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS: OverlappingValueAxesParams = {
122
- firstAxis: {
123
- // labelAnchor: 'end',
124
- labelOffset: [0, 0],
125
- labelColorType: 'primary',
126
- axisLineVisible: false,
127
- axisLineColorType: 'primary',
128
- ticks: 4,
129
- tickFormat: ',.0f',
130
- tickLineVisible: true,
131
- tickPadding: 20,
132
- tickFullLine: true,
133
- tickFullLineDasharray: 'none',
134
- tickColorType: 'secondary',
135
- tickTextRotate: 0,
136
- tickTextColorType: 'primary',
137
- },
138
- secondAxis: {
139
- // labelAnchor: 'end',
140
- labelOffset: [0, 0],
141
- labelColorType: 'primary',
142
- axisLineVisible: false,
143
- axisLineColorType: 'primary',
144
- ticks: 4,
145
- tickFormat: ',.0f',
146
- tickLineVisible: true,
147
- tickPadding: 20,
148
- tickFullLine: true,
149
- tickFullLineDasharray: 'none',
150
- tickColorType: 'secondary',
151
- tickTextRotate: 0,
152
- tickTextColorType: 'primary',
153
- },
154
- gridIndexes: [0, 1]
155
- }
156
-
157
- export const DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS: OverlappingValueStackAxesParams = {
158
- ...DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS
1
+ import type {
2
+ MultiGridLegendParams,
3
+ MultiBarsParams,
4
+ MultiBarStackParams,
5
+ MultiBarsTriangleParams,
6
+ MultiLinesParams,
7
+ MultiLineAreasParams,
8
+ MultiDotsParams,
9
+ MultiGroupAxisParams,
10
+ MultiValueAxisParams,
11
+ MultiValueStackAxisParams,
12
+ OverlappingValueAxesParams,
13
+ OverlappingValueStackAxesParams
14
+ } from './types'
15
+
16
+ export const DEFAULT_MULTI_GRID_LEGEND_PARAMS: MultiGridLegendParams = {
17
+ position: 'right',
18
+ justify: 'end',
19
+ padding: 28,
20
+ backgroundFill: 'none',
21
+ backgroundStroke: 'none',
22
+ gap: 10,
23
+ listRectWidth: 14,
24
+ listRectHeight: 14,
25
+ listRectRadius: 0,
26
+ gridList: [
27
+ {
28
+ listRectWidth: 14,
29
+ listRectHeight: 14,
30
+ listRectRadius: 0,
31
+ }
32
+ ],
33
+ textColorType: 'primary'
34
+ }
35
+
36
+ export const DEFAULT_MULTI_GROUP_AXIS_PARAMS: MultiGroupAxisParams = {
37
+ // labelAnchor: 'start',
38
+ labelOffset: [0, 0],
39
+ labelColorType: 'primary',
40
+ axisLineVisible: true,
41
+ axisLineColorType: 'primary',
42
+ ticks: 'all',
43
+ tickFormat: text => text,
44
+ tickLineVisible: true,
45
+ tickPadding: 20,
46
+ tickFullLine: false,
47
+ tickFullLineDasharray: 'none',
48
+ tickColorType: 'secondary',
49
+ tickTextRotate: 0,
50
+ tickTextColorType: 'primary',
51
+ gridIndexes: [0]
52
+ }
53
+ DEFAULT_MULTI_GROUP_AXIS_PARAMS.tickFormat.toString = () => `text => text`
54
+
55
+ export const DEFAULT_MULTI_VALUE_AXIS_PARAMS: MultiValueAxisParams = {
56
+ // labelAnchor: 'end',
57
+ labelOffset: [0, 0],
58
+ labelColorType: 'primary',
59
+ axisLineVisible: false,
60
+ axisLineColorType: 'primary',
61
+ ticks: 4,
62
+ tickFormat: ',.0f',
63
+ tickLineVisible: true,
64
+ tickPadding: 20,
65
+ tickFullLine: true,
66
+ tickFullLineDasharray: 'none',
67
+ tickColorType: 'secondary',
68
+ tickTextRotate: 0,
69
+ tickTextColorType: 'primary',
70
+ gridIndexes: [0]
71
+ }
72
+
73
+ export const DEFAULT_MULTI_VALUE_STACK_AXIS_PARAMS: MultiValueStackAxisParams = {
74
+ ...DEFAULT_MULTI_VALUE_AXIS_PARAMS
75
+ }
76
+
77
+ export const DEFAULT_MULTI_BARS_PARAMS: MultiBarsParams = {
78
+ barWidth: 0,
79
+ barPadding: 1,
80
+ barGroupPadding: 40,
81
+ barRadius: false,
82
+ gridIndexes: [0]
83
+ }
84
+
85
+ export const DEFAULT_MULTI_BAR_STACK_PARAMS: MultiBarStackParams = {
86
+ barWidth: 0,
87
+ barGroupPadding: 10,
88
+ barRadius: false,
89
+ gridIndexes: [0]
90
+ }
91
+
92
+ export const DEFAULT_MULTI_BARS_TRIANGLE_PARAMS: MultiBarsTriangleParams = {
93
+ barWidth: 0,
94
+ barPadding: 1,
95
+ barGroupPadding: 20,
96
+ linearGradientOpacity: [1, 0],
97
+ gridIndexes: [0]
98
+ }
99
+
100
+ export const DEFAULT_MULTI_LINES_PARAMS: MultiLinesParams = {
101
+ lineCurve: 'curveLinear',
102
+ lineWidth: 2,
103
+ gridIndexes: [1]
104
+ }
105
+
106
+ export const DEFAULT_MULTI_LINE_AREAS_PARAMS: MultiLineAreasParams = {
107
+ lineCurve: 'curveLinear',
108
+ linearGradientOpacity: [1, 0],
109
+ gridIndexes: [1]
110
+ }
111
+
112
+ export const DEFAULT_MULTI_DOTS_PARAMS: MultiDotsParams = {
113
+ radius: 4,
114
+ fillColorType: 'white',
115
+ strokeColorType: 'series',
116
+ strokeWidth: 2,
117
+ onlyShowHighlighted: false,
118
+ gridIndexes: [1]
119
+ }
120
+
121
+ export const DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS: OverlappingValueAxesParams = {
122
+ firstAxis: {
123
+ // labelAnchor: 'end',
124
+ labelOffset: [0, 0],
125
+ labelColorType: 'primary',
126
+ axisLineVisible: false,
127
+ axisLineColorType: 'primary',
128
+ ticks: 4,
129
+ tickFormat: ',.0f',
130
+ tickLineVisible: true,
131
+ tickPadding: 20,
132
+ tickFullLine: true,
133
+ tickFullLineDasharray: 'none',
134
+ tickColorType: 'secondary',
135
+ tickTextRotate: 0,
136
+ tickTextColorType: 'primary',
137
+ },
138
+ secondAxis: {
139
+ // labelAnchor: 'end',
140
+ labelOffset: [0, 0],
141
+ labelColorType: 'primary',
142
+ axisLineVisible: false,
143
+ axisLineColorType: 'primary',
144
+ ticks: 4,
145
+ tickFormat: ',.0f',
146
+ tickLineVisible: true,
147
+ tickPadding: 20,
148
+ tickFullLine: true,
149
+ tickFullLineDasharray: 'none',
150
+ tickColorType: 'secondary',
151
+ tickTextRotate: 0,
152
+ tickTextColorType: 'primary',
153
+ },
154
+ gridIndexes: [0, 1]
155
+ }
156
+
157
+ export const DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS: OverlappingValueStackAxesParams = {
158
+ ...DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS
159
159
  }