@orbcharts/plugins-basic 3.0.0-alpha.58 → 3.0.0-alpha.59
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +200 -200
- package/package.json +43 -43
- package/src/base/BaseBarStack.ts +778 -778
- package/src/base/BaseBars.ts +764 -764
- package/src/base/BaseBarsTriangle.ts +672 -672
- package/src/base/BaseDots.ts +513 -513
- package/src/base/BaseGroupAxis.ts +558 -558
- package/src/base/BaseLegend.ts +641 -641
- package/src/base/BaseLineAreas.ts +628 -628
- package/src/base/BaseLines.ts +704 -704
- package/src/base/BaseValueAxis.ts +478 -478
- package/src/base/types.ts +2 -2
- package/src/grid/defaults.ts +128 -128
- package/src/grid/gridObservables.ts +541 -541
- package/src/grid/index.ts +15 -15
- package/src/grid/plugins/BarStack.ts +43 -43
- package/src/grid/plugins/Bars.ts +44 -44
- package/src/grid/plugins/BarsPN.ts +41 -41
- package/src/grid/plugins/BarsTriangle.ts +42 -42
- package/src/grid/plugins/Dots.ts +37 -37
- package/src/grid/plugins/GridLegend.ts +59 -59
- package/src/grid/plugins/GroupAux.ts +976 -976
- package/src/grid/plugins/GroupAxis.ts +35 -35
- package/src/grid/plugins/LineAreas.ts +40 -40
- package/src/grid/plugins/Lines.ts +40 -40
- package/src/grid/plugins/ScalingArea.ts +173 -173
- package/src/grid/plugins/ValueAxis.ts +36 -36
- package/src/grid/plugins/ValueStackAxis.ts +38 -38
- package/src/grid/types.ts +123 -123
- package/src/index.ts +9 -9
- package/src/multiGrid/defaults.ts +158 -158
- package/src/multiGrid/index.ts +13 -13
- package/src/multiGrid/multiGridObservables.ts +49 -49
- package/src/multiGrid/plugins/MultiBarStack.ts +78 -78
- package/src/multiGrid/plugins/MultiBars.ts +77 -77
- package/src/multiGrid/plugins/MultiBarsTriangle.ts +77 -77
- package/src/multiGrid/plugins/MultiDots.ts +65 -65
- package/src/multiGrid/plugins/MultiGridLegend.ts +89 -89
- package/src/multiGrid/plugins/MultiGroupAxis.ts +69 -69
- package/src/multiGrid/plugins/MultiLineAreas.ts +77 -77
- package/src/multiGrid/plugins/MultiLines.ts +77 -77
- package/src/multiGrid/plugins/MultiValueAxis.ts +69 -69
- package/src/multiGrid/plugins/MultiValueStackAxis.ts +69 -69
- package/src/multiGrid/plugins/OverlappingValueAxes.ts +167 -167
- package/src/multiGrid/plugins/OverlappingValueStackAxes.ts +168 -168
- package/src/multiGrid/types.ts +72 -72
- package/src/noneData/defaults.ts +102 -102
- package/src/noneData/index.ts +3 -3
- package/src/noneData/plugins/Container.ts +10 -10
- package/src/noneData/plugins/Tooltip.ts +310 -310
- package/src/noneData/types.ts +26 -26
- package/src/series/defaults.ts +144 -144
- package/src/series/index.ts +9 -9
- package/src/series/plugins/Bubbles.ts +545 -545
- package/src/series/plugins/Pie.ts +576 -576
- package/src/series/plugins/PieEventTexts.ts +262 -262
- package/src/series/plugins/PieLabels.ts +304 -304
- package/src/series/plugins/Rose.ts +472 -472
- package/src/series/plugins/RoseLabels.ts +362 -362
- package/src/series/plugins/SeriesLegend.ts +59 -59
- package/src/series/seriesObservables.ts +145 -145
- package/src/series/seriesUtils.ts +51 -51
- package/src/series/types.ts +83 -83
- package/src/tree/defaults.ts +23 -23
- package/src/tree/index.ts +3 -3
- package/src/tree/plugins/TreeLegend.ts +59 -59
- package/src/tree/plugins/TreeMap.ts +305 -305
- package/src/tree/types.ts +23 -23
- package/src/utils/commonUtils.ts +21 -21
- package/src/utils/d3Graphics.ts +124 -124
- package/src/utils/d3Utils.ts +73 -73
- package/src/utils/observables.ts +14 -14
- package/src/utils/orbchartsUtils.ts +100 -100
- package/tsconfig.base.json +13 -13
- package/{tsconfig.json.bak.vite-plugin-tsconfig → tsconfig.json} +7 -7
- package/tsconfig.prod.json +2 -2
- package/vite.config.mjs +40 -40
@@ -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,124 +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
|
-
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
|
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
|
124
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
|
}
|