@orbcharts/plugins-basic 3.0.0-alpha.75 → 3.0.0-alpha.77
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/LICENSE +200 -200
- package/dist/lib/plugins-basic-types.d.ts +1 -0
- package/dist/orbcharts-plugins-basic.es.js +3461 -3468
- package/dist/orbcharts-plugins-basic.umd.js +17 -17
- package/dist/src/base/BaseBarStack.d.ts +1 -5
- package/dist/src/base/BaseBars.d.ts +1 -6
- package/dist/src/base/BaseBarsTriangle.d.ts +1 -6
- package/dist/src/base/BaseDots.d.ts +2 -8
- package/dist/src/base/BaseGroupAxis.d.ts +2 -16
- package/dist/src/base/BaseLegend.d.ts +2 -15
- package/dist/src/base/BaseLineAreas.d.ts +1 -4
- package/dist/src/base/BaseLines.d.ts +1 -4
- package/dist/src/base/BaseValueAxis.d.ts +2 -16
- package/dist/src/grid/defaults.d.ts +1 -1
- package/dist/src/grid/index.d.ts +0 -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/multiGrid/defaults.d.ts +1 -1
- package/dist/src/multiGrid/index.d.ts +0 -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/noneData/defaults.d.ts +1 -1
- package/dist/src/noneData/index.d.ts +0 -1
- package/dist/src/noneData/plugins/Container.d.ts +1 -1
- package/dist/src/noneData/plugins/Tooltip.d.ts +1 -1
- package/dist/src/series/defaults.d.ts +1 -1
- package/dist/src/series/index.d.ts +0 -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 +1 -1
- package/dist/src/series/plugins/RoseLabels.d.ts +1 -1
- package/dist/src/series/plugins/SeriesLegend.d.ts +1 -1
- package/dist/src/tree/defaults.d.ts +1 -1
- package/dist/src/tree/index.d.ts +0 -1
- package/dist/src/tree/plugins/TreeLegend.d.ts +1 -1
- package/dist/src/tree/plugins/TreeMap.d.ts +1 -1
- package/lib/core-types.ts +7 -7
- package/lib/core.ts +6 -6
- package/lib/plugins-basic-types.ts +6 -0
- package/package.json +44 -43
- package/src/base/BaseBarStack.ts +780 -779
- package/src/base/BaseBars.ts +765 -764
- package/src/base/BaseBarsTriangle.ts +674 -672
- package/src/base/BaseDots.ts +515 -513
- package/src/base/BaseGroupAxis.ts +679 -678
- package/src/base/BaseLegend.ts +644 -642
- package/src/base/BaseLineAreas.ts +629 -627
- package/src/base/BaseLines.ts +706 -704
- package/src/base/BaseValueAxis.ts +580 -578
- package/src/base/types.ts +2 -2
- package/src/const.ts +30 -30
- package/src/grid/defaults.ts +128 -128
- package/src/grid/gridObservables.ts +545 -545
- package/src/grid/index.ts +15 -15
- package/src/grid/plugins/BarStack.ts +64 -64
- package/src/grid/plugins/Bars.ts +69 -69
- package/src/grid/plugins/BarsPN.ts +66 -66
- package/src/grid/plugins/BarsTriangle.ts +73 -73
- package/src/grid/plugins/Dots.ts +68 -68
- package/src/grid/plugins/GridLegend.ts +96 -96
- package/src/grid/plugins/GroupAux.ts +1098 -1098
- package/src/grid/plugins/GroupAxis.ts +97 -97
- package/src/grid/plugins/LineAreas.ts +65 -65
- package/src/grid/plugins/Lines.ts +59 -59
- package/src/grid/plugins/ScalingArea.ts +218 -218
- package/src/grid/plugins/ValueAxis.ts +93 -93
- package/src/grid/plugins/ValueStackAxis.ts +95 -95
- 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 +106 -106
- package/src/multiGrid/plugins/MultiBars.ts +108 -108
- package/src/multiGrid/plugins/MultiBarsTriangle.ts +114 -114
- package/src/multiGrid/plugins/MultiDots.ts +102 -102
- package/src/multiGrid/plugins/MultiGridLegend.ts +148 -148
- package/src/multiGrid/plugins/MultiGroupAxis.ts +137 -137
- package/src/multiGrid/plugins/MultiLineAreas.ts +107 -107
- package/src/multiGrid/plugins/MultiLines.ts +101 -101
- package/src/multiGrid/plugins/MultiValueAxis.ts +133 -133
- package/src/multiGrid/plugins/MultiValueStackAxis.ts +133 -133
- package/src/multiGrid/plugins/OverlappingValueAxes.ts +299 -299
- package/src/multiGrid/plugins/OverlappingValueStackAxes.ts +298 -298
- package/src/noneData/defaults.ts +102 -102
- package/src/noneData/index.ts +3 -3
- package/src/noneData/plugins/Container.ts +27 -27
- package/src/noneData/plugins/Tooltip.ts +373 -373
- package/src/series/defaults.ts +149 -149
- package/src/series/index.ts +9 -9
- package/src/series/plugins/Bubbles.ts +603 -603
- package/src/series/plugins/Pie.ts +623 -623
- package/src/series/plugins/PieEventTexts.ts +283 -283
- package/src/series/plugins/PieLabels.ts +640 -640
- package/src/series/plugins/Rose.ts +516 -516
- package/src/series/plugins/RoseLabels.ts +600 -600
- package/src/series/plugins/SeriesLegend.ts +96 -96
- package/src/series/seriesObservables.ts +145 -145
- package/src/series/seriesUtils.ts +51 -51
- package/src/tree/defaults.ts +23 -23
- package/src/tree/index.ts +3 -3
- package/src/tree/plugins/TreeLegend.ts +96 -96
- package/src/tree/plugins/TreeMap.ts +333 -333
- package/src/utils/commonUtils.ts +21 -21
- package/src/utils/d3Graphics.ts +174 -174
- 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 +2 -2
- package/vite.config.js +22 -22
- package/dist/src/grid/types.d.ts +0 -93
- package/dist/src/multiGrid/types.d.ts +0 -61
- package/dist/src/noneData/types.d.ts +0 -24
- package/dist/src/series/types.d.ts +0 -73
- package/dist/src/tree/types.d.ts +0 -21
- package/src/grid/types.ts +0 -124
- package/src/multiGrid/types.ts +0 -73
- package/src/noneData/types.ts +0 -26
- package/src/series/types.ts +0 -87
- package/src/tree/types.ts +0 -23
@@ -1,100 +1,100 @@
|
|
1
|
-
import type {
|
2
|
-
AxisPosition,
|
3
|
-
ColorType,
|
4
|
-
ChartParams,
|
5
|
-
ComputedDatumBase,
|
6
|
-
ComputedDatumSeriesValue,
|
7
|
-
ComputedDatumCategoryValue } from '../../lib/core-types'
|
8
|
-
import { getMinAndMax } from './commonUtils'
|
9
|
-
|
10
|
-
// 取得最小及最大值 - datum格式陣列資料
|
11
|
-
export function getMinAndMaxValue (data: ComputedDatumBase[]): [number, number] {
|
12
|
-
const arr = data
|
13
|
-
.filter(d => d.value != null && d.visible != false)
|
14
|
-
.map(d => d.value as number)
|
15
|
-
return getMinAndMax(arr)
|
16
|
-
}
|
17
|
-
|
18
|
-
// 取得colorType顏色
|
19
|
-
export function getColor (colorType: ColorType, fullChartParams: ChartParams) {
|
20
|
-
const colors = fullChartParams.colors[fullChartParams.colorScheme]
|
21
|
-
// 對應series資料中第1個顏色
|
22
|
-
if (colorType === 'series') {
|
23
|
-
return colors.series[0]
|
24
|
-
}
|
25
|
-
// 對應colorType設定的顏色
|
26
|
-
// return colors[colorType] != null
|
27
|
-
// ? colors[colorType]
|
28
|
-
// : colors.primary
|
29
|
-
return colorType == 'none'
|
30
|
-
? 'none'
|
31
|
-
: colors[colorType] != undefined
|
32
|
-
? colors[colorType]
|
33
|
-
: colors.primary // 如果比對不到
|
34
|
-
}
|
35
|
-
|
36
|
-
export function getSeriesValueColor () {
|
37
|
-
|
38
|
-
}
|
39
|
-
|
40
|
-
export function getCategoryValueColor ({ datum, colorType, fullChartParams }: { datum: ComputedDatumCategoryValue, colorType: ColorType, fullChartParams: ChartParams }) {
|
41
|
-
|
42
|
-
}
|
43
|
-
|
44
|
-
// // 取得Series顏色 @Q@ 待重構完後刪除
|
45
|
-
// export function getSeriesColor (seriesIndex: number, fullChartParams: ChartParams) {
|
46
|
-
// const colorIndex = seriesIndex < fullChartParams.colors[fullChartParams.colorScheme].series.length
|
47
|
-
// ? seriesIndex
|
48
|
-
// : seriesIndex % fullChartParams.colors[fullChartParams.colorScheme].series.length
|
49
|
-
// return fullChartParams.colors[fullChartParams.colorScheme].series[colorIndex]
|
50
|
-
// }
|
51
|
-
|
52
|
-
// 取得Datum顏色 @Q@ 待重構完後刪除
|
53
|
-
export function getDatumColor ({ datum, colorType, fullChartParams }: { datum: ComputedDatumBase, colorType: ColorType, fullChartParams: ChartParams }) {
|
54
|
-
// 對應series資料中的顏色
|
55
|
-
if (colorType === 'series') {
|
56
|
-
if ((datum as unknown as ComputedDatumSeriesValue).color) {
|
57
|
-
return (datum as unknown as ComputedDatumSeriesValue).color
|
58
|
-
} else {
|
59
|
-
// 非series類型的資料則回傳陣列中第1個顏色
|
60
|
-
return fullChartParams.colors[fullChartParams.colorScheme].series[0]
|
61
|
-
}
|
62
|
-
}
|
63
|
-
// 對應colorType設定的顏色
|
64
|
-
return colorType == 'none'
|
65
|
-
? 'none'
|
66
|
-
: fullChartParams.colors[fullChartParams.colorScheme][colorType] != undefined
|
67
|
-
? fullChartParams.colors[fullChartParams.colorScheme][colorType]
|
68
|
-
: fullChartParams.colors[fullChartParams.colorScheme].primary
|
69
|
-
}
|
70
|
-
|
71
|
-
export function getClassName (pluginName: string, elementName: string, modifier?: string) {
|
72
|
-
const modifierText = modifier ? `--${modifier}` : ''
|
73
|
-
return `orbcharts-${pluginName}__${elementName}${modifierText}`
|
74
|
-
}
|
75
|
-
|
76
|
-
export function getUniID (pluginName: string, elementName: string) {
|
77
|
-
const textLength = 5
|
78
|
-
// 英文+數字
|
79
|
-
const randomText: string = Math.random().toString(36).substr(2, textLength)
|
80
|
-
|
81
|
-
return getClassName(pluginName, elementName, randomText)
|
82
|
-
}
|
83
|
-
|
84
|
-
|
85
|
-
export function calcAxesSize ({ xAxisPosition, yAxisPosition, width, height }: {
|
86
|
-
xAxisPosition: AxisPosition
|
87
|
-
yAxisPosition: AxisPosition
|
88
|
-
width: number
|
89
|
-
height: number
|
90
|
-
}) {
|
91
|
-
if ((xAxisPosition === 'bottom' || xAxisPosition === 'top') && (yAxisPosition === 'left' || yAxisPosition === 'right')) {
|
92
|
-
return { width, height }
|
93
|
-
} else if ((xAxisPosition === 'left' || xAxisPosition === 'right') && (yAxisPosition === 'bottom' || yAxisPosition === 'top')) {
|
94
|
-
return {
|
95
|
-
width: height,
|
96
|
-
height: width
|
97
|
-
}
|
98
|
-
}
|
99
|
-
}
|
100
|
-
|
1
|
+
import type {
|
2
|
+
AxisPosition,
|
3
|
+
ColorType,
|
4
|
+
ChartParams,
|
5
|
+
ComputedDatumBase,
|
6
|
+
ComputedDatumSeriesValue,
|
7
|
+
ComputedDatumCategoryValue } from '../../lib/core-types'
|
8
|
+
import { getMinAndMax } from './commonUtils'
|
9
|
+
|
10
|
+
// 取得最小及最大值 - datum格式陣列資料
|
11
|
+
export function getMinAndMaxValue (data: ComputedDatumBase[]): [number, number] {
|
12
|
+
const arr = data
|
13
|
+
.filter(d => d.value != null && d.visible != false)
|
14
|
+
.map(d => d.value as number)
|
15
|
+
return getMinAndMax(arr)
|
16
|
+
}
|
17
|
+
|
18
|
+
// 取得colorType顏色
|
19
|
+
export function getColor (colorType: ColorType, fullChartParams: ChartParams) {
|
20
|
+
const colors = fullChartParams.colors[fullChartParams.colorScheme]
|
21
|
+
// 對應series資料中第1個顏色
|
22
|
+
if (colorType === 'series') {
|
23
|
+
return colors.series[0]
|
24
|
+
}
|
25
|
+
// 對應colorType設定的顏色
|
26
|
+
// return colors[colorType] != null
|
27
|
+
// ? colors[colorType]
|
28
|
+
// : colors.primary
|
29
|
+
return colorType == 'none'
|
30
|
+
? 'none'
|
31
|
+
: colors[colorType] != undefined
|
32
|
+
? colors[colorType]
|
33
|
+
: colors.primary // 如果比對不到
|
34
|
+
}
|
35
|
+
|
36
|
+
export function getSeriesValueColor () {
|
37
|
+
|
38
|
+
}
|
39
|
+
|
40
|
+
export function getCategoryValueColor ({ datum, colorType, fullChartParams }: { datum: ComputedDatumCategoryValue, colorType: ColorType, fullChartParams: ChartParams }) {
|
41
|
+
|
42
|
+
}
|
43
|
+
|
44
|
+
// // 取得Series顏色 @Q@ 待重構完後刪除
|
45
|
+
// export function getSeriesColor (seriesIndex: number, fullChartParams: ChartParams) {
|
46
|
+
// const colorIndex = seriesIndex < fullChartParams.colors[fullChartParams.colorScheme].series.length
|
47
|
+
// ? seriesIndex
|
48
|
+
// : seriesIndex % fullChartParams.colors[fullChartParams.colorScheme].series.length
|
49
|
+
// return fullChartParams.colors[fullChartParams.colorScheme].series[colorIndex]
|
50
|
+
// }
|
51
|
+
|
52
|
+
// 取得Datum顏色 @Q@ 待重構完後刪除
|
53
|
+
export function getDatumColor ({ datum, colorType, fullChartParams }: { datum: ComputedDatumBase, colorType: ColorType, fullChartParams: ChartParams }) {
|
54
|
+
// 對應series資料中的顏色
|
55
|
+
if (colorType === 'series') {
|
56
|
+
if ((datum as unknown as ComputedDatumSeriesValue).color) {
|
57
|
+
return (datum as unknown as ComputedDatumSeriesValue).color
|
58
|
+
} else {
|
59
|
+
// 非series類型的資料則回傳陣列中第1個顏色
|
60
|
+
return fullChartParams.colors[fullChartParams.colorScheme].series[0]
|
61
|
+
}
|
62
|
+
}
|
63
|
+
// 對應colorType設定的顏色
|
64
|
+
return colorType == 'none'
|
65
|
+
? 'none'
|
66
|
+
: fullChartParams.colors[fullChartParams.colorScheme][colorType] != undefined
|
67
|
+
? fullChartParams.colors[fullChartParams.colorScheme][colorType]
|
68
|
+
: fullChartParams.colors[fullChartParams.colorScheme].primary
|
69
|
+
}
|
70
|
+
|
71
|
+
export function getClassName (pluginName: string, elementName: string, modifier?: string) {
|
72
|
+
const modifierText = modifier ? `--${modifier}` : ''
|
73
|
+
return `orbcharts-${pluginName}__${elementName}${modifierText}`
|
74
|
+
}
|
75
|
+
|
76
|
+
export function getUniID (pluginName: string, elementName: string) {
|
77
|
+
const textLength = 5
|
78
|
+
// 英文+數字
|
79
|
+
const randomText: string = Math.random().toString(36).substr(2, textLength)
|
80
|
+
|
81
|
+
return getClassName(pluginName, elementName, randomText)
|
82
|
+
}
|
83
|
+
|
84
|
+
|
85
|
+
export function calcAxesSize ({ xAxisPosition, yAxisPosition, width, height }: {
|
86
|
+
xAxisPosition: AxisPosition
|
87
|
+
yAxisPosition: AxisPosition
|
88
|
+
width: number
|
89
|
+
height: number
|
90
|
+
}) {
|
91
|
+
if ((xAxisPosition === 'bottom' || xAxisPosition === 'top') && (yAxisPosition === 'left' || yAxisPosition === 'right')) {
|
92
|
+
return { width, height }
|
93
|
+
} else if ((xAxisPosition === 'left' || xAxisPosition === 'right') && (yAxisPosition === 'bottom' || yAxisPosition === 'top')) {
|
94
|
+
return {
|
95
|
+
width: height,
|
96
|
+
height: width
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
package/tsconfig.base.json
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
{
|
2
|
-
"compilerOptions": {
|
3
|
-
"outDir": "./dist/",
|
4
|
-
"sourceMap": true,
|
5
|
-
"noImplicitAny": true,
|
6
|
-
"module": "esnext",
|
7
|
-
"target": "es5",
|
8
|
-
"jsx": "react",
|
9
|
-
"allowJs": true,
|
10
|
-
"moduleResolution": "node",
|
11
|
-
"allowSyntheticDefaultImports" : true,
|
12
|
-
"esModuleInterop" : true
|
13
|
-
}
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"outDir": "./dist/",
|
4
|
+
"sourceMap": true,
|
5
|
+
"noImplicitAny": true,
|
6
|
+
"module": "esnext",
|
7
|
+
"target": "es5",
|
8
|
+
"jsx": "react",
|
9
|
+
"allowJs": true,
|
10
|
+
"moduleResolution": "node",
|
11
|
+
"allowSyntheticDefaultImports" : true,
|
12
|
+
"esModuleInterop" : true
|
13
|
+
}
|
14
14
|
}
|
package/tsconfig.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
{
|
2
|
-
"extends": "./tsconfig.base.json"
|
1
|
+
{
|
2
|
+
"extends": "./tsconfig.base.json"
|
3
3
|
}
|
package/vite.config.js
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
import { defineConfig } from 'vite'
|
2
|
-
import dts from 'vite-plugin-dts'
|
3
|
-
|
4
|
-
export default defineConfig(({ command, mode }) => {
|
5
|
-
return {
|
6
|
-
plugins: [
|
7
|
-
dts({
|
8
|
-
insertTypesEntry: true
|
9
|
-
})
|
10
|
-
],
|
11
|
-
compilerOptions: {
|
12
|
-
composite: true
|
13
|
-
},
|
14
|
-
build: {
|
15
|
-
lib: {
|
16
|
-
entry: "src/index.ts",
|
17
|
-
name: 'orbcharts-plugins-basic',
|
18
|
-
formats: ["es", "umd"],
|
19
|
-
fileName: format => `orbcharts-plugins-basic.${format}.js`
|
20
|
-
},
|
21
|
-
}
|
22
|
-
}
|
1
|
+
import { defineConfig } from 'vite'
|
2
|
+
import dts from 'vite-plugin-dts'
|
3
|
+
|
4
|
+
export default defineConfig(({ command, mode }) => {
|
5
|
+
return {
|
6
|
+
plugins: [
|
7
|
+
dts({
|
8
|
+
insertTypesEntry: true
|
9
|
+
})
|
10
|
+
],
|
11
|
+
compilerOptions: {
|
12
|
+
composite: true
|
13
|
+
},
|
14
|
+
build: {
|
15
|
+
lib: {
|
16
|
+
entry: "src/index.ts",
|
17
|
+
name: 'orbcharts-plugins-basic',
|
18
|
+
formats: ["es", "umd"],
|
19
|
+
fileName: format => `orbcharts-plugins-basic.${format}.js`
|
20
|
+
},
|
21
|
+
}
|
22
|
+
}
|
23
23
|
})
|
package/dist/src/grid/types.d.ts
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
import { ColorType } from '../../lib/core-types';
|
2
|
-
|
3
|
-
export interface LinesParams {
|
4
|
-
lineCurve: string;
|
5
|
-
lineWidth: number;
|
6
|
-
}
|
7
|
-
export interface LineAreasParams {
|
8
|
-
lineCurve: string;
|
9
|
-
linearGradientOpacity: [number, number];
|
10
|
-
}
|
11
|
-
export interface DotsParams {
|
12
|
-
radius: number;
|
13
|
-
fillColorType: ColorType;
|
14
|
-
strokeColorType: ColorType;
|
15
|
-
strokeWidth: number;
|
16
|
-
onlyShowHighlighted: boolean;
|
17
|
-
}
|
18
|
-
export interface GroupAuxParams {
|
19
|
-
showLine: boolean;
|
20
|
-
showLabel: boolean;
|
21
|
-
lineDashArray: string;
|
22
|
-
lineColorType: ColorType;
|
23
|
-
labelColorType: ColorType;
|
24
|
-
labelTextColorType: ColorType;
|
25
|
-
labelTextFormat: string | ((text: any) => string);
|
26
|
-
labelPadding: number;
|
27
|
-
labelRotate: number;
|
28
|
-
}
|
29
|
-
export interface BarsParams {
|
30
|
-
barWidth: number;
|
31
|
-
barPadding: number;
|
32
|
-
barGroupPadding: number;
|
33
|
-
barRadius: number | boolean;
|
34
|
-
}
|
35
|
-
export interface BarsPNParams extends BarsParams {
|
36
|
-
}
|
37
|
-
export interface BarStackParams {
|
38
|
-
barWidth: number;
|
39
|
-
barGroupPadding: number;
|
40
|
-
barRadius: number | boolean;
|
41
|
-
}
|
42
|
-
export interface BarsTriangleParams {
|
43
|
-
barWidth: number;
|
44
|
-
barPadding: number;
|
45
|
-
barGroupPadding: number;
|
46
|
-
linearGradientOpacity: [number, number];
|
47
|
-
}
|
48
|
-
export interface GroupAxisParams {
|
49
|
-
labelOffset: [number, number];
|
50
|
-
labelColorType: ColorType;
|
51
|
-
axisLineVisible: boolean;
|
52
|
-
axisLineColorType: ColorType;
|
53
|
-
ticks: number | null | 'all';
|
54
|
-
tickFormat: string | ((text: any) => string);
|
55
|
-
tickLineVisible: boolean;
|
56
|
-
tickPadding: number;
|
57
|
-
tickFullLine: boolean;
|
58
|
-
tickFullLineDasharray: string;
|
59
|
-
tickColorType: ColorType;
|
60
|
-
tickTextRotate: number;
|
61
|
-
tickTextColorType: ColorType;
|
62
|
-
}
|
63
|
-
export interface ValueAxisParams {
|
64
|
-
labelOffset: [number, number];
|
65
|
-
labelColorType: ColorType;
|
66
|
-
axisLineVisible: boolean;
|
67
|
-
axisLineColorType: ColorType;
|
68
|
-
ticks: number | null;
|
69
|
-
tickFormat: string | ((text: d3.NumberValue) => string);
|
70
|
-
tickLineVisible: boolean;
|
71
|
-
tickPadding: number;
|
72
|
-
tickFullLine: boolean;
|
73
|
-
tickFullLineDasharray: string;
|
74
|
-
tickColorType: ColorType;
|
75
|
-
tickTextRotate: number;
|
76
|
-
tickTextColorType: ColorType;
|
77
|
-
}
|
78
|
-
export interface ValueStackAxisParams extends ValueAxisParams {
|
79
|
-
}
|
80
|
-
export interface ScalingAreaParams {
|
81
|
-
}
|
82
|
-
export interface GridLegendParams {
|
83
|
-
position: 'top' | 'bottom' | 'left' | 'right';
|
84
|
-
justify: 'start' | 'center' | 'end';
|
85
|
-
padding: number;
|
86
|
-
backgroundFill: ColorType;
|
87
|
-
backgroundStroke: ColorType;
|
88
|
-
gap: number;
|
89
|
-
listRectWidth: number;
|
90
|
-
listRectHeight: number;
|
91
|
-
listRectRadius: number;
|
92
|
-
textColorType: ColorType;
|
93
|
-
}
|
@@ -1,61 +0,0 @@
|
|
1
|
-
import { BaseBarsParams } from '../base/BaseBars';
|
2
|
-
import { BaseBarStackParams } from '../base/BaseBarStack';
|
3
|
-
import { BaseBarsTriangleParams } from '../base/BaseBarsTriangle';
|
4
|
-
import { BaseLinesParams } from '../base/BaseLines';
|
5
|
-
import { BaseLineAreasParams } from '../base/BaseLineAreas';
|
6
|
-
import { BaseDotsParams } from '../base/BaseDots';
|
7
|
-
import { BaseGroupAxisParams } from '../base/BaseGroupAxis';
|
8
|
-
import { BaseValueAxisParams } from '../base/BaseValueAxis';
|
9
|
-
import { ColorType } from '../../lib/core-types';
|
10
|
-
|
11
|
-
export interface MultiGridLegendParams {
|
12
|
-
position: 'top' | 'bottom' | 'left' | 'right';
|
13
|
-
justify: 'start' | 'center' | 'end';
|
14
|
-
padding: number;
|
15
|
-
backgroundFill: ColorType;
|
16
|
-
backgroundStroke: ColorType;
|
17
|
-
gap: number;
|
18
|
-
listRectWidth: number;
|
19
|
-
listRectHeight: number;
|
20
|
-
listRectRadius: number;
|
21
|
-
gridList: Array<{
|
22
|
-
listRectWidth: number;
|
23
|
-
listRectHeight: number;
|
24
|
-
listRectRadius: number;
|
25
|
-
}>;
|
26
|
-
textColorType: ColorType;
|
27
|
-
}
|
28
|
-
export interface MultiGroupAxisParams extends BaseGroupAxisParams {
|
29
|
-
gridIndexes: number[] | 'all';
|
30
|
-
}
|
31
|
-
export interface MultiValueAxisParams extends BaseValueAxisParams {
|
32
|
-
gridIndexes: number[] | 'all';
|
33
|
-
}
|
34
|
-
export interface MultiValueStackAxisParams extends BaseValueAxisParams {
|
35
|
-
gridIndexes: number[] | 'all';
|
36
|
-
}
|
37
|
-
export interface MultiBarsParams extends BaseBarsParams {
|
38
|
-
gridIndexes: number[] | 'all';
|
39
|
-
}
|
40
|
-
export interface MultiBarStackParams extends BaseBarStackParams {
|
41
|
-
gridIndexes: number[] | 'all';
|
42
|
-
}
|
43
|
-
export interface MultiBarsTriangleParams extends BaseBarsTriangleParams {
|
44
|
-
gridIndexes: number[] | 'all';
|
45
|
-
}
|
46
|
-
export interface MultiLinesParams extends BaseLinesParams {
|
47
|
-
gridIndexes: number[] | 'all';
|
48
|
-
}
|
49
|
-
export interface MultiLineAreasParams extends BaseLineAreasParams {
|
50
|
-
gridIndexes: number[] | 'all';
|
51
|
-
}
|
52
|
-
export interface MultiDotsParams extends BaseDotsParams {
|
53
|
-
gridIndexes: number[] | 'all';
|
54
|
-
}
|
55
|
-
export interface OverlappingValueAxesParams {
|
56
|
-
firstAxis: BaseValueAxisParams;
|
57
|
-
secondAxis: BaseValueAxisParams;
|
58
|
-
gridIndexes: [number, number];
|
59
|
-
}
|
60
|
-
export interface OverlappingValueStackAxesParams extends OverlappingValueAxesParams {
|
61
|
-
}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import { ColorType, ChartType, EventTypeMap } from '../../lib/core-types';
|
2
|
-
|
3
|
-
export interface ContainerPluginParams {
|
4
|
-
header: {
|
5
|
-
height: number;
|
6
|
-
text: string[];
|
7
|
-
textStyle: string[];
|
8
|
-
};
|
9
|
-
footer: {
|
10
|
-
height: number;
|
11
|
-
text: string[];
|
12
|
-
textStyle: string[];
|
13
|
-
};
|
14
|
-
}
|
15
|
-
export type TooltipParams = {
|
16
|
-
backgroundColorType: ColorType;
|
17
|
-
backgroundOpacity: number;
|
18
|
-
strokeColorType: ColorType;
|
19
|
-
textColorType: ColorType;
|
20
|
-
offset: [number, number];
|
21
|
-
padding: number;
|
22
|
-
textRenderFn: (<T extends ChartType>(eventData: EventTypeMap<T>) => string[] | string) | null;
|
23
|
-
svgRenderFn: (<T extends ChartType>(eventData: EventTypeMap<T>) => string) | null;
|
24
|
-
};
|
@@ -1,73 +0,0 @@
|
|
1
|
-
import { ComputedDatumSeries, EventSeries, EventName, ColorType } from '../../lib/core-types';
|
2
|
-
|
3
|
-
export type ArcScaleType = 'area' | 'radius';
|
4
|
-
export interface BubblesParams {
|
5
|
-
force: {
|
6
|
-
strength: number;
|
7
|
-
velocityDecay: number;
|
8
|
-
collisionSpacing: number;
|
9
|
-
};
|
10
|
-
bubbleText: {
|
11
|
-
fillRate: number;
|
12
|
-
lineHeight: number;
|
13
|
-
lineLengthMin: number;
|
14
|
-
};
|
15
|
-
arcScaleType: ArcScaleType;
|
16
|
-
}
|
17
|
-
export interface PieParams {
|
18
|
-
outerRadius: number;
|
19
|
-
innerRadius: number;
|
20
|
-
outerRadiusWhileHighlight: number;
|
21
|
-
startAngle: number;
|
22
|
-
endAngle: number;
|
23
|
-
padAngle: number;
|
24
|
-
strokeColorType: ColorType;
|
25
|
-
strokeWidth: number;
|
26
|
-
cornerRadius: number;
|
27
|
-
}
|
28
|
-
export interface PieEventTextsParams {
|
29
|
-
eventFn: (d: EventSeries, eventName: EventName, t: number) => string[];
|
30
|
-
textAttrs: Array<{
|
31
|
-
[key: string]: string | number;
|
32
|
-
}>;
|
33
|
-
textStyles: Array<{
|
34
|
-
[key: string]: string | number;
|
35
|
-
}>;
|
36
|
-
}
|
37
|
-
export interface PieLabelsParams {
|
38
|
-
outerRadius: number;
|
39
|
-
outerRadiusWhileHighlight: number;
|
40
|
-
startAngle: number;
|
41
|
-
endAngle: number;
|
42
|
-
labelCentroid: number;
|
43
|
-
labelFn: ((d: ComputedDatumSeries) => string);
|
44
|
-
labelColorType: ColorType;
|
45
|
-
}
|
46
|
-
export interface RoseParams {
|
47
|
-
outerRadius: number;
|
48
|
-
padAngle: number;
|
49
|
-
strokeColorType: ColorType;
|
50
|
-
strokeWidth: number;
|
51
|
-
cornerRadius: number;
|
52
|
-
arcScaleType: ArcScaleType;
|
53
|
-
angleIncreaseWhileHighlight: number;
|
54
|
-
}
|
55
|
-
export interface RoseLabelsParams {
|
56
|
-
outerRadius: number;
|
57
|
-
labelCentroid: number;
|
58
|
-
labelFn: ((d: ComputedDatumSeries) => string);
|
59
|
-
labelColorType: ColorType;
|
60
|
-
arcScaleType: ArcScaleType;
|
61
|
-
}
|
62
|
-
export interface SeriesLegendParams {
|
63
|
-
position: 'top' | 'bottom' | 'left' | 'right';
|
64
|
-
justify: 'start' | 'center' | 'end';
|
65
|
-
padding: number;
|
66
|
-
backgroundFill: ColorType;
|
67
|
-
backgroundStroke: ColorType;
|
68
|
-
gap: number;
|
69
|
-
listRectWidth: number;
|
70
|
-
listRectHeight: number;
|
71
|
-
listRectRadius: number;
|
72
|
-
textColorType: ColorType;
|
73
|
-
}
|
package/dist/src/tree/types.d.ts
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
import { ColorType, ComputedDataTree } from '../../lib/core-types';
|
2
|
-
|
3
|
-
export interface TreeMapParams {
|
4
|
-
paddingInner: number;
|
5
|
-
paddingOuter: number;
|
6
|
-
labelColorType: ColorType;
|
7
|
-
squarifyRatio: number;
|
8
|
-
sort: (a: ComputedDataTree, b: ComputedDataTree) => number;
|
9
|
-
}
|
10
|
-
export interface TreeLegendParams {
|
11
|
-
position: 'top' | 'bottom' | 'left' | 'right';
|
12
|
-
justify: 'start' | 'center' | 'end';
|
13
|
-
padding: number;
|
14
|
-
backgroundFill: ColorType;
|
15
|
-
backgroundStroke: ColorType;
|
16
|
-
gap: number;
|
17
|
-
listRectWidth: number;
|
18
|
-
listRectHeight: number;
|
19
|
-
listRectRadius: number;
|
20
|
-
textColorType: ColorType;
|
21
|
-
}
|
package/src/grid/types.ts
DELETED
@@ -1,124 +0,0 @@
|
|
1
|
-
import type { ColorType } from '../../lib/core-types'
|
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
|
-
}
|