@orbcharts/plugins-basic 3.0.0-alpha.70 → 3.0.0-alpha.72
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/lib/core-types.d.ts +1 -0
- package/dist/lib/core.d.ts +1 -0
- package/dist/orbcharts-plugins-basic.es.js +8863 -7397
- package/dist/orbcharts-plugins-basic.umd.js +19 -15
- package/dist/src/base/BaseBarStack.d.ts +1 -1
- package/dist/src/base/BaseBars.d.ts +1 -1
- package/dist/src/base/BaseBarsTriangle.d.ts +1 -1
- package/dist/src/base/BaseDots.d.ts +1 -1
- package/dist/src/base/BaseGroupAxis.d.ts +1 -1
- package/dist/src/base/BaseLegend.d.ts +1 -1
- package/dist/src/base/BaseLineAreas.d.ts +1 -1
- package/dist/src/base/BaseLines.d.ts +1 -1
- package/dist/src/base/BaseValueAxis.d.ts +1 -1
- package/dist/src/const.d.ts +10 -0
- package/dist/src/grid/gridObservables.d.ts +1 -1
- package/dist/src/grid/plugins/BarStack.d.ts +1 -1
- package/dist/src/grid/plugins/Bars.d.ts +1 -1
- package/dist/src/grid/plugins/BarsPN.d.ts +1 -1
- package/dist/src/grid/plugins/BarsTriangle.d.ts +1 -1
- package/dist/src/grid/plugins/Dots.d.ts +1 -1
- package/dist/src/grid/plugins/GridLegend.d.ts +1 -1
- package/dist/src/grid/plugins/GroupAux.d.ts +1 -1
- package/dist/src/grid/plugins/GroupAxis.d.ts +1 -1
- package/dist/src/grid/plugins/LineAreas.d.ts +1 -1
- package/dist/src/grid/plugins/Lines.d.ts +1 -1
- package/dist/src/grid/plugins/ScalingArea.d.ts +1 -1
- package/dist/src/grid/plugins/ValueAxis.d.ts +1 -1
- package/dist/src/grid/plugins/ValueStackAxis.d.ts +1 -1
- package/dist/src/grid/types.d.ts +1 -1
- package/dist/src/multiGrid/multiGridObservables.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiBarStack.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiBars.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiBarsTriangle.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiDots.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiGridLegend.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiGroupAxis.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiLineAreas.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiLines.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiValueAxis.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiValueStackAxis.d.ts +1 -1
- package/dist/src/multiGrid/plugins/OverlappingValueAxes.d.ts +1 -1
- package/dist/src/multiGrid/plugins/OverlappingValueStackAxes.d.ts +1 -1
- package/dist/src/multiGrid/types.d.ts +1 -1
- package/dist/src/noneData/plugins/Container.d.ts +1 -1
- package/dist/src/noneData/plugins/Tooltip.d.ts +2 -2
- package/dist/src/noneData/types.d.ts +1 -1
- package/dist/src/series/plugins/Bubbles.d.ts +1 -1
- package/dist/src/series/plugins/Pie.d.ts +1 -1
- package/dist/src/series/plugins/PieEventTexts.d.ts +1 -1
- package/dist/src/series/plugins/PieLabels.d.ts +1 -1
- package/dist/src/series/plugins/Rose.d.ts +2 -2
- package/dist/src/series/plugins/RoseLabels.d.ts +1 -1
- package/dist/src/series/plugins/SeriesLegend.d.ts +1 -1
- package/dist/src/series/seriesObservables.d.ts +1 -1
- package/dist/src/series/seriesUtils.d.ts +1 -1
- package/dist/src/series/types.d.ts +1 -1
- package/dist/src/tree/plugins/TreeLegend.d.ts +1 -1
- package/dist/src/tree/plugins/TreeMap.d.ts +1 -1
- package/dist/src/tree/types.d.ts +1 -1
- package/dist/src/utils/orbchartsUtils.d.ts +1 -1
- package/lib/core-types.ts +7 -0
- package/lib/core.ts +6 -0
- package/package.json +3 -2
- package/src/base/BaseBarStack.ts +1 -1
- package/src/base/BaseBars.ts +1 -1
- package/src/base/BaseBarsTriangle.ts +1 -1
- package/src/base/BaseDots.ts +1 -1
- package/src/base/BaseGroupAxis.ts +7 -4
- package/src/base/BaseLegend.ts +1 -1
- package/src/base/BaseLineAreas.ts +1 -2
- package/src/base/BaseLines.ts +1 -1
- package/src/base/BaseValueAxis.ts +2 -2
- package/src/const.ts +30 -0
- package/src/grid/gridObservables.ts +5 -3
- package/src/grid/plugins/BarStack.ts +23 -2
- package/src/grid/plugins/Bars.ts +27 -2
- package/src/grid/plugins/BarsPN.ts +27 -2
- package/src/grid/plugins/BarsTriangle.ts +33 -2
- package/src/grid/plugins/Dots.ts +33 -2
- package/src/grid/plugins/GridLegend.ts +39 -2
- package/src/grid/plugins/GroupAux.ts +115 -31
- package/src/grid/plugins/GroupAxis.ts +63 -2
- package/src/grid/plugins/LineAreas.ts +27 -2
- package/src/grid/plugins/Lines.ts +21 -2
- package/src/grid/plugins/ScalingArea.ts +103 -61
- package/src/grid/plugins/ValueAxis.ts +60 -3
- package/src/grid/plugins/ValueStackAxis.ts +60 -3
- package/src/grid/types.ts +1 -1
- package/src/multiGrid/multiGridObservables.ts +1 -1
- package/src/multiGrid/plugins/MultiBarStack.ts +30 -2
- package/src/multiGrid/plugins/MultiBars.ts +33 -2
- package/src/multiGrid/plugins/MultiBarsTriangle.ts +39 -2
- package/src/multiGrid/plugins/MultiDots.ts +39 -2
- package/src/multiGrid/plugins/MultiGridLegend.ts +61 -2
- package/src/multiGrid/plugins/MultiGroupAxis.ts +69 -2
- package/src/multiGrid/plugins/MultiLineAreas.ts +33 -3
- package/src/multiGrid/plugins/MultiLines.ts +27 -3
- package/src/multiGrid/plugins/MultiValueAxis.ts +66 -2
- package/src/multiGrid/plugins/MultiValueStackAxis.ts +66 -2
- package/src/multiGrid/plugins/OverlappingValueAxes.ts +133 -4
- package/src/multiGrid/plugins/OverlappingValueStackAxes.ts +133 -4
- package/src/multiGrid/types.ts +1 -1
- package/src/noneData/defaults.ts +8 -8
- package/src/noneData/plugins/Container.ts +19 -2
- package/src/noneData/plugins/Tooltip.ts +46 -4
- package/src/noneData/types.ts +1 -1
- package/src/series/defaults.ts +1 -1
- package/src/series/plugins/Bubbles.ts +61 -3
- package/src/series/plugins/Pie.ts +43 -4
- package/src/series/plugins/PieEventTexts.ts +25 -4
- package/src/series/plugins/PieLabels.ts +39 -3
- package/src/series/plugins/Rose.ts +38 -3
- package/src/series/plugins/RoseLabels.ts +32 -3
- package/src/series/plugins/SeriesLegend.ts +39 -2
- package/src/series/seriesObservables.ts +1 -1
- package/src/series/seriesUtils.ts +1 -1
- package/src/series/types.ts +1 -1
- package/src/tree/plugins/TreeLegend.ts +39 -2
- package/src/tree/plugins/TreeMap.ts +31 -3
- package/src/tree/types.ts +1 -1
- package/src/utils/orbchartsUtils.ts +1 -1
@@ -6,15 +6,74 @@ import {
|
|
6
6
|
takeUntil,
|
7
7
|
Observable,
|
8
8
|
Subject } from 'rxjs'
|
9
|
+
import type { DefinePluginConfig } from '../../../lib/core-types'
|
9
10
|
import {
|
10
|
-
defineMultiGridPlugin, mergeOptionsWithDefault } from '
|
11
|
+
defineMultiGridPlugin, mergeOptionsWithDefault } from '../../../lib/core'
|
11
12
|
import { DEFAULT_MULTI_GRID_LEGEND_PARAMS } from '../defaults'
|
12
13
|
import { createBaseLegend } from '../../base/BaseLegend'
|
13
14
|
import type { BaseLegendParams } from '../../base/BaseLegend'
|
15
|
+
import { LAYER_INDEX_OF_INFO } from '../../const'
|
14
16
|
|
15
17
|
const pluginName = 'MultiGridLegend'
|
16
18
|
|
17
|
-
|
19
|
+
const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_MULTI_GRID_LEGEND_PARAMS> = {
|
20
|
+
name: pluginName,
|
21
|
+
defaultParams: DEFAULT_MULTI_GRID_LEGEND_PARAMS,
|
22
|
+
layerIndex: LAYER_INDEX_OF_INFO,
|
23
|
+
validator: (params, { validateColumns }) => {
|
24
|
+
const result = validateColumns(params, {
|
25
|
+
padding: {
|
26
|
+
toBeTypes: ['number']
|
27
|
+
},
|
28
|
+
backgroundFill: {
|
29
|
+
toBeOption: 'ColorType',
|
30
|
+
},
|
31
|
+
backgroundStroke: {
|
32
|
+
toBeOption: 'ColorType',
|
33
|
+
},
|
34
|
+
gap: {
|
35
|
+
toBeTypes: ['number']
|
36
|
+
},
|
37
|
+
listRectWidth: {
|
38
|
+
toBeTypes: ['number']
|
39
|
+
},
|
40
|
+
listRectHeight: {
|
41
|
+
toBeTypes: ['number']
|
42
|
+
},
|
43
|
+
listRectRadius: {
|
44
|
+
toBeTypes: ['number']
|
45
|
+
},
|
46
|
+
gridList: {
|
47
|
+
toBeTypes: ['object[]']
|
48
|
+
},
|
49
|
+
textColorType: {
|
50
|
+
toBeOption: 'ColorType',
|
51
|
+
}
|
52
|
+
})
|
53
|
+
if (params.gridList) {
|
54
|
+
const gridListResult = params.gridList.map((grid, gridIndex) => {
|
55
|
+
return validateColumns(grid, {
|
56
|
+
listRectWidth: {
|
57
|
+
toBeTypes: ['number']
|
58
|
+
},
|
59
|
+
listRectHeight: {
|
60
|
+
toBeTypes: ['number']
|
61
|
+
},
|
62
|
+
listRectRadius: {
|
63
|
+
toBeTypes: ['number']
|
64
|
+
}
|
65
|
+
})
|
66
|
+
})
|
67
|
+
const errorResult = gridListResult.find(r => r.status === 'error')
|
68
|
+
if (errorResult) {
|
69
|
+
return errorResult
|
70
|
+
}
|
71
|
+
}
|
72
|
+
return result
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
export const MultiGridLegend = defineMultiGridPlugin(pluginConfig)(({ selection, rootSelection, observer, subject }) => {
|
18
77
|
|
19
78
|
const destroy$ = new Subject()
|
20
79
|
|
@@ -6,18 +6,85 @@ import {
|
|
6
6
|
shareReplay,
|
7
7
|
takeUntil
|
8
8
|
} from 'rxjs'
|
9
|
+
import type { DefinePluginConfig } from '../../../lib/core-types'
|
9
10
|
import {
|
10
|
-
defineMultiGridPlugin } from '
|
11
|
+
defineMultiGridPlugin } from '../../../lib/core'
|
11
12
|
import { DEFAULT_MULTI_GROUP_AXIS_PARAMS } from '../defaults'
|
12
13
|
import { createBaseGroupAxis } from '../../base/BaseGroupAxis'
|
13
14
|
import { multiGridPluginDetailObservables } from '../multiGridObservables'
|
14
15
|
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
16
|
+
import { LAYER_INDEX_OF_AXIS } from '../../const'
|
15
17
|
|
16
18
|
const pluginName = 'MultiGroupAxis'
|
17
19
|
|
18
20
|
const gridClassName = getClassName(pluginName, 'grid')
|
19
21
|
|
20
|
-
|
22
|
+
const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_MULTI_GROUP_AXIS_PARAMS> = {
|
23
|
+
name: pluginName,
|
24
|
+
defaultParams: DEFAULT_MULTI_GROUP_AXIS_PARAMS,
|
25
|
+
layerIndex: LAYER_INDEX_OF_AXIS,
|
26
|
+
validator: (params, { validateColumns }) => {
|
27
|
+
const result = validateColumns(params, {
|
28
|
+
gridIndexes: {
|
29
|
+
toBe: 'number[] | "all"',
|
30
|
+
test: (value: any) => {
|
31
|
+
return value === 'all' || (Array.isArray(value) && value.every((v: any) => typeof v === 'number'))
|
32
|
+
}
|
33
|
+
},
|
34
|
+
labelOffset: {
|
35
|
+
toBe: '[number, number]',
|
36
|
+
test: (value: any) => {
|
37
|
+
return Array.isArray(value)
|
38
|
+
&& value.length === 2
|
39
|
+
&& typeof value[0] === 'number'
|
40
|
+
&& typeof value[1] === 'number'
|
41
|
+
}
|
42
|
+
},
|
43
|
+
labelColorType: {
|
44
|
+
toBeOption: 'ColorType',
|
45
|
+
},
|
46
|
+
axisLineVisible: {
|
47
|
+
toBeTypes: ['boolean']
|
48
|
+
},
|
49
|
+
axisLineColorType: {
|
50
|
+
toBeOption: 'ColorType',
|
51
|
+
},
|
52
|
+
ticks: {
|
53
|
+
toBe: 'number | null | "all"',
|
54
|
+
test: (value: any) => {
|
55
|
+
return value === null || value === 'all' || typeof value === 'number'
|
56
|
+
}
|
57
|
+
},
|
58
|
+
tickFormat: {
|
59
|
+
toBeTypes: ['string', 'Function']
|
60
|
+
},
|
61
|
+
tickLineVisible: {
|
62
|
+
toBeTypes: ['boolean']
|
63
|
+
},
|
64
|
+
tickPadding: {
|
65
|
+
toBeTypes: ['number']
|
66
|
+
},
|
67
|
+
tickFullLine: {
|
68
|
+
toBeTypes: ['boolean']
|
69
|
+
},
|
70
|
+
tickFullLineDasharray: {
|
71
|
+
toBeTypes: ['string']
|
72
|
+
},
|
73
|
+
tickColorType: {
|
74
|
+
toBeOption: 'ColorType',
|
75
|
+
},
|
76
|
+
tickTextRotate: {
|
77
|
+
toBeTypes: ['number']
|
78
|
+
},
|
79
|
+
tickTextColorType: {
|
80
|
+
toBeOption: 'ColorType',
|
81
|
+
}
|
82
|
+
})
|
83
|
+
return result
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
export const MultiGroupAxis = defineMultiGridPlugin(pluginConfig)(({ selection, name, subject, observer }) => {
|
21
88
|
const destroy$ = new Subject()
|
22
89
|
|
23
90
|
const unsubscribeFnArr: (() => void)[] = []
|
@@ -3,19 +3,49 @@ import {
|
|
3
3
|
map,
|
4
4
|
takeUntil,
|
5
5
|
Subject } from 'rxjs'
|
6
|
+
import type { DefinePluginConfig } from '../../../lib/core-types'
|
6
7
|
import {
|
7
|
-
defineMultiGridPlugin } from '
|
8
|
-
|
8
|
+
defineMultiGridPlugin } from '../../../lib/core'
|
9
9
|
import { DEFAULT_MULTI_LINE_AREAS_PARAMS } from '../defaults'
|
10
10
|
import { createBaseLineAreas } from '../../base/BaseLineAreas'
|
11
11
|
import { multiGridPluginDetailObservables } from '../multiGridObservables'
|
12
12
|
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
13
|
+
import { LAYER_INDEX_OF_GRAPHIC_GROUND } from '../../const'
|
13
14
|
|
14
15
|
const pluginName = 'MultiLineAreas'
|
15
16
|
|
16
17
|
const gridClassName = getClassName(pluginName, 'grid')
|
17
18
|
|
18
|
-
|
19
|
+
const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_MULTI_LINE_AREAS_PARAMS> = {
|
20
|
+
name: pluginName,
|
21
|
+
defaultParams: DEFAULT_MULTI_LINE_AREAS_PARAMS,
|
22
|
+
layerIndex: LAYER_INDEX_OF_GRAPHIC_GROUND,
|
23
|
+
validator: (params, { validateColumns }) => {
|
24
|
+
const result = validateColumns(params, {
|
25
|
+
gridIndexes: {
|
26
|
+
toBe: 'number[] | "all"',
|
27
|
+
test: (value: any) => {
|
28
|
+
return value === 'all' || (Array.isArray(value) && value.every((v: any) => typeof v === 'number'))
|
29
|
+
}
|
30
|
+
},
|
31
|
+
lineCurve: {
|
32
|
+
toBeTypes: ['string']
|
33
|
+
},
|
34
|
+
linearGradientOpacity: {
|
35
|
+
toBe: '[number, number]',
|
36
|
+
test: (value: any) => {
|
37
|
+
return Array.isArray(value)
|
38
|
+
&& value.length === 2
|
39
|
+
&& typeof value[0] === 'number'
|
40
|
+
&& typeof value[1] === 'number'
|
41
|
+
}
|
42
|
+
},
|
43
|
+
})
|
44
|
+
return result
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
export const MultiLineAreas = defineMultiGridPlugin(pluginConfig)(({ selection, name, subject, observer }) => {
|
19
49
|
const destroy$ = new Subject()
|
20
50
|
|
21
51
|
const unsubscribeFnArr: (() => void)[] = []
|
@@ -3,19 +3,43 @@ import {
|
|
3
3
|
map,
|
4
4
|
takeUntil,
|
5
5
|
Subject } from 'rxjs'
|
6
|
+
import type { DefinePluginConfig } from '../../../lib/core-types'
|
6
7
|
import {
|
7
|
-
defineMultiGridPlugin } from '
|
8
|
-
|
8
|
+
defineMultiGridPlugin } from '../../../lib/core'
|
9
9
|
import { DEFAULT_MULTI_LINES_PARAMS } from '../defaults'
|
10
10
|
import { createBaseLines } from '../../base/BaseLines'
|
11
11
|
import { multiGridPluginDetailObservables } from '../multiGridObservables'
|
12
12
|
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
13
|
+
import { LAYER_INDEX_OF_GRAPHIC } from '../../const'
|
13
14
|
|
14
15
|
const pluginName = 'MultiLines'
|
15
16
|
|
16
17
|
const gridClassName = getClassName(pluginName, 'grid')
|
17
18
|
|
18
|
-
|
19
|
+
const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_MULTI_LINES_PARAMS> = {
|
20
|
+
name: pluginName,
|
21
|
+
defaultParams: DEFAULT_MULTI_LINES_PARAMS,
|
22
|
+
layerIndex: LAYER_INDEX_OF_GRAPHIC,
|
23
|
+
validator: (params, { validateColumns }) => {
|
24
|
+
const result = validateColumns(params, {
|
25
|
+
gridIndexes: {
|
26
|
+
toBe: 'number[] | "all"',
|
27
|
+
test: (value: any) => {
|
28
|
+
return value === 'all' || (Array.isArray(value) && value.every((v: any) => typeof v === 'number'))
|
29
|
+
}
|
30
|
+
},
|
31
|
+
lineCurve: {
|
32
|
+
toBeTypes: ['string']
|
33
|
+
},
|
34
|
+
lineWidth: {
|
35
|
+
toBeTypes: ['number']
|
36
|
+
},
|
37
|
+
})
|
38
|
+
return result
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
export const MultiLines = defineMultiGridPlugin(pluginConfig)(({ selection, rootSelection, name, subject, observer }) => {
|
19
43
|
const destroy$ = new Subject()
|
20
44
|
|
21
45
|
const unsubscribeFnArr: (() => void)[] = []
|
@@ -6,18 +6,82 @@ import {
|
|
6
6
|
shareReplay,
|
7
7
|
takeUntil
|
8
8
|
} from 'rxjs'
|
9
|
+
import type { DefinePluginConfig } from '../../../lib/core-types'
|
9
10
|
import {
|
10
|
-
defineMultiGridPlugin } from '
|
11
|
+
defineMultiGridPlugin } from '../../../lib/core'
|
11
12
|
import { DEFAULT_MULTI_VALUE_AXIS_PARAMS } from '../defaults'
|
12
13
|
import { createBaseValueAxis } from '../../base/BaseValueAxis'
|
13
14
|
import { multiGridPluginDetailObservables } from '../multiGridObservables'
|
14
15
|
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
16
|
+
import { LAYER_INDEX_OF_AXIS } from '../../const'
|
15
17
|
|
16
18
|
const pluginName = 'MultiValueAxis'
|
17
19
|
|
18
20
|
const gridClassName = getClassName(pluginName, 'grid')
|
19
21
|
|
20
|
-
|
22
|
+
const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_MULTI_VALUE_AXIS_PARAMS> = {
|
23
|
+
name: pluginName,
|
24
|
+
defaultParams: DEFAULT_MULTI_VALUE_AXIS_PARAMS,
|
25
|
+
layerIndex: LAYER_INDEX_OF_AXIS,
|
26
|
+
validator: (params, { validateColumns }) => {
|
27
|
+
const result = validateColumns(params, {
|
28
|
+
gridIndexes: {
|
29
|
+
toBe: 'number[] | "all"',
|
30
|
+
test: (value: any) => {
|
31
|
+
return value === 'all' || (Array.isArray(value) && value.every((v: any) => typeof v === 'number'))
|
32
|
+
}
|
33
|
+
},
|
34
|
+
labelOffset: {
|
35
|
+
toBe: '[number, number]',
|
36
|
+
test: (value: any) => {
|
37
|
+
return Array.isArray(value)
|
38
|
+
&& value.length === 2
|
39
|
+
&& typeof value[0] === 'number'
|
40
|
+
&& typeof value[1] === 'number'
|
41
|
+
}
|
42
|
+
},
|
43
|
+
labelColorType: {
|
44
|
+
toBeOption: 'ColorType',
|
45
|
+
},
|
46
|
+
axisLineVisible: {
|
47
|
+
toBeTypes: ['boolean']
|
48
|
+
},
|
49
|
+
axisLineColorType: {
|
50
|
+
toBeOption: 'ColorType',
|
51
|
+
},
|
52
|
+
ticks: {
|
53
|
+
toBeTypes: ['number', 'null']
|
54
|
+
},
|
55
|
+
tickFormat: {
|
56
|
+
toBeTypes: ['string', 'Function']
|
57
|
+
},
|
58
|
+
tickLineVisible: {
|
59
|
+
toBeTypes: ['boolean']
|
60
|
+
},
|
61
|
+
tickPadding: {
|
62
|
+
toBeTypes: ['number']
|
63
|
+
},
|
64
|
+
tickFullLine: {
|
65
|
+
toBeTypes: ['boolean']
|
66
|
+
},
|
67
|
+
tickFullLineDasharray: {
|
68
|
+
toBeTypes: ['string']
|
69
|
+
},
|
70
|
+
tickColorType: {
|
71
|
+
toBeOption: 'ColorType',
|
72
|
+
},
|
73
|
+
tickTextRotate: {
|
74
|
+
toBeTypes: ['number']
|
75
|
+
},
|
76
|
+
tickTextColorType: {
|
77
|
+
toBeOption: 'ColorType',
|
78
|
+
}
|
79
|
+
})
|
80
|
+
return result
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
export const MultiValueAxis = defineMultiGridPlugin(pluginConfig)(({ selection, name, subject, observer }) => {
|
21
85
|
const destroy$ = new Subject()
|
22
86
|
|
23
87
|
const unsubscribeFnArr: (() => void)[] = []
|
@@ -6,18 +6,82 @@ import {
|
|
6
6
|
shareReplay,
|
7
7
|
takeUntil
|
8
8
|
} from 'rxjs'
|
9
|
+
import type { DefinePluginConfig } from '../../../lib/core-types'
|
9
10
|
import {
|
10
|
-
defineMultiGridPlugin } from '
|
11
|
+
defineMultiGridPlugin } from '../../../lib/core'
|
11
12
|
import { DEFAULT_MULTI_VALUE_AXIS_PARAMS } from '../defaults'
|
12
13
|
import { createBaseValueAxis } from '../../base/BaseValueAxis'
|
13
14
|
import { multiGridPluginDetailObservables } from '../multiGridObservables'
|
14
15
|
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
16
|
+
import { LAYER_INDEX_OF_AXIS } from '../../const'
|
15
17
|
|
16
18
|
const pluginName = 'MultiValueStackAxis'
|
17
19
|
|
18
20
|
const gridClassName = getClassName(pluginName, 'grid')
|
19
21
|
|
20
|
-
|
22
|
+
const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_MULTI_VALUE_AXIS_PARAMS> = {
|
23
|
+
name: pluginName,
|
24
|
+
defaultParams: DEFAULT_MULTI_VALUE_AXIS_PARAMS,
|
25
|
+
layerIndex: LAYER_INDEX_OF_AXIS,
|
26
|
+
validator: (params, { validateColumns }) => {
|
27
|
+
const result = validateColumns(params, {
|
28
|
+
gridIndexes: {
|
29
|
+
toBe: 'number[] | "all"',
|
30
|
+
test: (value: any) => {
|
31
|
+
return value === 'all' || (Array.isArray(value) && value.every((v: any) => typeof v === 'number'))
|
32
|
+
}
|
33
|
+
},
|
34
|
+
labelOffset: {
|
35
|
+
toBe: '[number, number]',
|
36
|
+
test: (value: any) => {
|
37
|
+
return Array.isArray(value)
|
38
|
+
&& value.length === 2
|
39
|
+
&& typeof value[0] === 'number'
|
40
|
+
&& typeof value[1] === 'number'
|
41
|
+
}
|
42
|
+
},
|
43
|
+
labelColorType: {
|
44
|
+
toBeOption: 'ColorType',
|
45
|
+
},
|
46
|
+
axisLineVisible: {
|
47
|
+
toBeTypes: ['boolean']
|
48
|
+
},
|
49
|
+
axisLineColorType: {
|
50
|
+
toBeOption: 'ColorType',
|
51
|
+
},
|
52
|
+
ticks: {
|
53
|
+
toBeTypes: ['number', 'null']
|
54
|
+
},
|
55
|
+
tickFormat: {
|
56
|
+
toBeTypes: ['string', 'Function']
|
57
|
+
},
|
58
|
+
tickLineVisible: {
|
59
|
+
toBeTypes: ['boolean']
|
60
|
+
},
|
61
|
+
tickPadding: {
|
62
|
+
toBeTypes: ['number']
|
63
|
+
},
|
64
|
+
tickFullLine: {
|
65
|
+
toBeTypes: ['boolean']
|
66
|
+
},
|
67
|
+
tickFullLineDasharray: {
|
68
|
+
toBeTypes: ['string']
|
69
|
+
},
|
70
|
+
tickColorType: {
|
71
|
+
toBeOption: 'ColorType',
|
72
|
+
},
|
73
|
+
tickTextRotate: {
|
74
|
+
toBeTypes: ['number']
|
75
|
+
},
|
76
|
+
tickTextColorType: {
|
77
|
+
toBeOption: 'ColorType',
|
78
|
+
}
|
79
|
+
})
|
80
|
+
return result
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
export const MultiValueStackAxis = defineMultiGridPlugin(pluginConfig)(({ selection, name, subject, observer }) => {
|
21
85
|
const destroy$ = new Subject()
|
22
86
|
|
23
87
|
const unsubscribeFnArr: (() => void)[] = []
|
@@ -10,20 +10,149 @@ import {
|
|
10
10
|
iif,
|
11
11
|
Observable,
|
12
12
|
Subject } from 'rxjs'
|
13
|
-
import type {
|
13
|
+
import type { DefinePluginConfig } from '../../../lib/core-types'
|
14
|
+
import type { ContextObserverMultiGrid, DataFormatterGrid, DataFormatterTypeMap, Layout } from '../../../lib/core-types'
|
14
15
|
import {
|
15
|
-
defineMultiGridPlugin } from '
|
16
|
+
defineMultiGridPlugin } from '../../../lib/core'
|
16
17
|
import { DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS } from '../defaults'
|
17
18
|
import { createBaseValueAxis } from '../../base/BaseValueAxis'
|
18
19
|
import { multiGridPluginDetailObservables } from '../multiGridObservables'
|
19
20
|
import { getClassName, getUniID } from '../../utils/orbchartsUtils'
|
20
|
-
import { gridAxesTransformObservable, gridAxesReverseTransformObservable, gridContainerPositionObservable } from '
|
21
|
+
import { gridAxesTransformObservable, gridAxesReverseTransformObservable, gridContainerPositionObservable } from '../../../lib/core'
|
22
|
+
import { LAYER_INDEX_OF_AXIS } from '../../const'
|
21
23
|
|
22
24
|
const pluginName = 'OverlappingValueAxes'
|
23
25
|
|
24
26
|
const gridClassName = getClassName(pluginName, 'grid')
|
25
27
|
|
26
|
-
|
28
|
+
const pluginConfig: DefinePluginConfig<typeof pluginName, typeof DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS> = {
|
29
|
+
name: pluginName,
|
30
|
+
defaultParams: DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS,
|
31
|
+
layerIndex: LAYER_INDEX_OF_AXIS,
|
32
|
+
validator: (params, { validateColumns }) => {
|
33
|
+
const result = validateColumns(params, {
|
34
|
+
firstAxis: {
|
35
|
+
toBeTypes: ['object']
|
36
|
+
},
|
37
|
+
secondAxis: {
|
38
|
+
toBeTypes: ['object']
|
39
|
+
},
|
40
|
+
gridIndexes: {
|
41
|
+
toBe: '[number, number]',
|
42
|
+
test: (value: any) => {
|
43
|
+
return Array.isArray(value) && value.length === 2
|
44
|
+
}
|
45
|
+
}
|
46
|
+
})
|
47
|
+
if (params.firstAxis) {
|
48
|
+
const firstAxisResult = validateColumns(params.firstAxis, {
|
49
|
+
labelOffset: {
|
50
|
+
toBe: '[number, number]',
|
51
|
+
test: (value: any) => {
|
52
|
+
return Array.isArray(value)
|
53
|
+
&& value.length === 2
|
54
|
+
&& typeof value[0] === 'number'
|
55
|
+
&& typeof value[1] === 'number'
|
56
|
+
}
|
57
|
+
},
|
58
|
+
labelColorType: {
|
59
|
+
toBeOption: 'ColorType',
|
60
|
+
},
|
61
|
+
axisLineVisible: {
|
62
|
+
toBeTypes: ['boolean']
|
63
|
+
},
|
64
|
+
axisLineColorType: {
|
65
|
+
toBeOption: 'ColorType',
|
66
|
+
},
|
67
|
+
ticks: {
|
68
|
+
toBeTypes: ['number']
|
69
|
+
},
|
70
|
+
tickFormat: {
|
71
|
+
toBeTypes: ['string', 'Function']
|
72
|
+
},
|
73
|
+
tickLineVisible: {
|
74
|
+
toBeTypes: ['boolean']
|
75
|
+
},
|
76
|
+
tickPadding: {
|
77
|
+
toBeTypes: ['number']
|
78
|
+
},
|
79
|
+
tickFullLine: {
|
80
|
+
toBeTypes: ['boolean']
|
81
|
+
},
|
82
|
+
tickFullLineDasharray: {
|
83
|
+
toBeTypes: ['string']
|
84
|
+
},
|
85
|
+
tickColorType: {
|
86
|
+
toBeOption: 'ColorType',
|
87
|
+
},
|
88
|
+
tickTextRotate: {
|
89
|
+
toBeTypes: ['number']
|
90
|
+
},
|
91
|
+
tickTextColorType: {
|
92
|
+
toBeOption: 'ColorType',
|
93
|
+
}
|
94
|
+
})
|
95
|
+
if (firstAxisResult.status === 'error') {
|
96
|
+
return firstAxisResult
|
97
|
+
}
|
98
|
+
}
|
99
|
+
if (params.secondAxis) {
|
100
|
+
const secondAxisResult = validateColumns(params.secondAxis, {
|
101
|
+
labelOffset: {
|
102
|
+
toBe: '[number, number]',
|
103
|
+
test: (value: any) => {
|
104
|
+
return Array.isArray(value)
|
105
|
+
&& value.length === 2
|
106
|
+
&& typeof value[0] === 'number'
|
107
|
+
&& typeof value[1] === 'number'
|
108
|
+
}
|
109
|
+
},
|
110
|
+
labelColorType: {
|
111
|
+
toBeOption: 'ColorType',
|
112
|
+
},
|
113
|
+
axisLineVisible: {
|
114
|
+
toBeTypes: ['boolean']
|
115
|
+
},
|
116
|
+
axisLineColorType: {
|
117
|
+
toBeOption: 'ColorType',
|
118
|
+
},
|
119
|
+
ticks: {
|
120
|
+
toBeTypes: ['number']
|
121
|
+
},
|
122
|
+
tickFormat: {
|
123
|
+
toBeTypes: ['string', 'Function']
|
124
|
+
},
|
125
|
+
tickLineVisible: {
|
126
|
+
toBeTypes: ['boolean']
|
127
|
+
},
|
128
|
+
tickPadding: {
|
129
|
+
toBeTypes: ['number']
|
130
|
+
},
|
131
|
+
tickFullLine: {
|
132
|
+
toBeTypes: ['boolean']
|
133
|
+
},
|
134
|
+
tickFullLineDasharray: {
|
135
|
+
toBeTypes: ['string']
|
136
|
+
},
|
137
|
+
tickColorType: {
|
138
|
+
toBeOption: 'ColorType',
|
139
|
+
},
|
140
|
+
tickTextRotate: {
|
141
|
+
toBeTypes: ['number']
|
142
|
+
},
|
143
|
+
tickTextColorType: {
|
144
|
+
toBeOption: 'ColorType',
|
145
|
+
}
|
146
|
+
})
|
147
|
+
if (secondAxisResult.status === 'error') {
|
148
|
+
return secondAxisResult
|
149
|
+
}
|
150
|
+
}
|
151
|
+
return result
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
export const OverlappingValueAxes = defineMultiGridPlugin(pluginConfig)(({ selection, name, subject, observer }) => {
|
27
156
|
const destroy$ = new Subject()
|
28
157
|
|
29
158
|
const unsubscribeFnArr: (() => void)[] = []
|