@orbcharts/plugins-basic 3.0.0-beta.1 → 3.0.0-beta.11
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/dist/{src → orbcharts-plugins-basic/src}/base/BaseBars.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseBarsTriangle.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseDots.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseGroupAxis.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLegend.d.ts +1 -1
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLineAreas.d.ts +3 -3
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseLines.d.ts +3 -3
- package/dist/{src/base/BaseBarStack.d.ts → orbcharts-plugins-basic/src/base/BaseStackedBar.d.ts} +6 -6
- package/dist/{src → orbcharts-plugins-basic/src}/base/BaseValueAxis.d.ts +3 -2
- package/dist/{src → orbcharts-plugins-basic/src}/grid/defaults.d.ts +4 -4
- package/dist/{src → orbcharts-plugins-basic/src}/grid/gridObservables.d.ts +5 -5
- package/dist/{src → orbcharts-plugins-basic/src}/grid/index.d.ts +2 -2
- package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedBar.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedValueAxis.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/index.d.ts +7 -0
- package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/defaults.d.ts +4 -4
- package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/index.d.ts +3 -3
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedBar.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedValueAxis.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/OverlappingStackedValueAxes.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/defaults.d.ts +9 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/index.d.ts +8 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/multiValueObservables.d.ts +33 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/MultiValueLegend.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/MultiValueTooltip.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/Scatter.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/ScatterBubbles.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYAux.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYAxes.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYZoom.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/relationship/defaults.d.ts +6 -0
- package/dist/orbcharts-plugins-basic/src/relationship/index.d.ts +5 -0
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/ForceDirected.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/ForceDirectedBubbles.d.ts +3 -0
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/RelationshipLegend.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/RelationshipTooltip.d.ts +1 -0
- package/dist/orbcharts-plugins-basic/src/relationship/relationshipObservables.d.ts +1 -0
- package/dist/{src → orbcharts-plugins-basic/src}/series/seriesObservables.d.ts +3 -3
- package/dist/{src → orbcharts-plugins-basic/src}/utils/commonUtils.d.ts +1 -1
- package/dist/{src → orbcharts-plugins-basic/src}/utils/d3Utils.d.ts +2 -2
- package/dist/{src → orbcharts-plugins-basic/src}/utils/observables.d.ts +1 -1
- package/dist/{src → orbcharts-plugins-basic/src}/utils/orbchartsUtils.d.ts +3 -3
- package/dist/orbcharts-plugins-basic.es.js +13327 -10361
- package/dist/orbcharts-plugins-basic.umd.js +99 -49
- package/dist/src/index.d.ts +1 -5
- package/package.json +4 -4
- package/src/base/BaseBars.ts +5 -5
- package/src/base/BaseBarsTriangle.ts +6 -4
- package/src/base/BaseDots.ts +3 -54
- package/src/base/BaseGroupAxis.ts +50 -50
- package/src/base/BaseLegend.ts +25 -21
- package/src/base/BaseLineAreas.ts +4 -4
- package/src/base/BaseLines.ts +3 -3
- package/src/base/{BaseBarStack.ts → BaseStackedBar.ts} +22 -20
- package/src/base/BaseTooltip.ts +5 -2
- package/src/base/BaseValueAxis.ts +84 -81
- package/src/grid/defaults.ts +15 -13
- package/src/grid/gridObservables.ts +56 -47
- package/src/grid/index.ts +2 -2
- package/src/grid/plugins/GridLegend.ts +2 -2
- package/src/grid/plugins/GridZoom.ts +20 -20
- package/src/grid/plugins/GroupAux.ts +216 -211
- package/src/grid/plugins/{BarStack.ts → StackedBar.ts} +7 -7
- package/src/grid/plugins/{ValueStackAxis.ts → StackedValueAxis.ts} +6 -5
- package/src/grid/plugins/ValueAxis.ts +1 -0
- package/src/index.ts +2 -5
- package/src/multiGrid/defaults.ts +11 -11
- package/src/multiGrid/index.ts +3 -3
- package/src/multiGrid/plugins/MultiBars.ts +1 -1
- package/src/multiGrid/plugins/MultiBarsTriangle.ts +1 -1
- package/src/multiGrid/plugins/MultiGridLegend.ts +2 -2
- package/src/multiGrid/plugins/MultiGroupAxis.ts +1 -1
- package/src/multiGrid/plugins/{MultiBarStack.ts → MultiStackedBar.ts} +8 -8
- package/src/multiGrid/plugins/{MultiValueStackAxis.ts → MultiStackedValueAxis.ts} +4 -3
- package/src/multiGrid/plugins/MultiValueAxis.ts +2 -1
- package/src/multiGrid/plugins/{OverlappingValueStackAxes.ts → OverlappingStackedValueAxes.ts} +9 -8
- package/src/multiGrid/plugins/OverlappingValueAxes.ts +4 -3
- package/src/multiValue/defaults.ts +167 -0
- package/src/multiValue/index.ts +9 -0
- package/src/multiValue/multiValueObservables.ts +297 -0
- package/src/multiValue/plugins/MultiValueLegend.ts +107 -0
- package/src/multiValue/plugins/MultiValueTooltip.ts +66 -0
- package/src/multiValue/plugins/Scatter.ts +426 -0
- package/src/multiValue/plugins/ScatterBubbles.ts +554 -0
- package/src/multiValue/plugins/XYAux.ts +682 -0
- package/src/multiValue/plugins/XYAxes.ts +685 -0
- package/src/multiValue/plugins/XYZoom.ts +300 -0
- package/src/noneData/plugins/Container.ts +23 -23
- package/src/noneData/plugins/Tooltip.ts +365 -365
- package/src/relationship/defaults.ts +197 -0
- package/src/relationship/index.ts +5 -0
- package/src/relationship/plugins/ForceDirected.ts +1169 -0
- package/src/relationship/plugins/ForceDirectedBubbles.ts +1394 -0
- package/src/relationship/plugins/RelationshipLegend.ts +100 -0
- package/src/relationship/plugins/RelationshipTooltip.ts +66 -0
- package/src/relationship/relationshipObservables.ts +50 -0
- package/src/series/defaults.ts +13 -12
- package/src/series/plugins/Bubbles.ts +22 -22
- package/src/series/plugins/Pie.ts +2 -2
- package/src/series/plugins/PieEventTexts.ts +22 -21
- package/src/series/plugins/PieLabels.ts +2 -2
- package/src/series/plugins/Rose.ts +2 -2
- package/src/series/plugins/RoseLabels.ts +2 -2
- package/src/series/plugins/SeriesLegend.ts +4 -4
- package/src/series/seriesObservables.ts +3 -3
- package/src/tree/defaults.ts +3 -3
- package/src/tree/plugins/TreeLegend.ts +3 -10
- package/src/utils/commonUtils.ts +5 -5
- package/src/utils/d3Utils.ts +4 -3
- package/src/utils/observables.ts +2 -2
- package/src/utils/orbchartsUtils.ts +28 -12
- package/dist/src/grid/plugins/BarStack.d.ts +0 -1
- package/dist/src/grid/plugins/ValueStackAxis.d.ts +0 -1
- package/dist/src/multiGrid/plugins/MultiBarStack.d.ts +0 -1
- package/dist/src/multiGrid/plugins/MultiValueStackAxis.d.ts +0 -1
- package/dist/src/multiGrid/plugins/OverlappingValueStackAxes.d.ts +0 -1
- package/dist/src/multiValue/plugins/Scatter.d.ts +0 -0
- package/dist/src/multiValue/plugins/ScatterAxes.d.ts +0 -0
- package/dist/src/noneData/plugins/Container.d.ts +0 -1
- package/dist/src/noneData/plugins/Tooltip.d.ts +0 -3
- package/dist/src/relationship/index.d.ts +0 -0
- package/dist/src/relationship/plugins/Relationship.d.ts +0 -0
- package/src/base/BaseGroupArea.ts +0 -0
- package/src/multiValue/plugins/ScatterAxes.ts +0 -0
- package/src/relationship/plugins/Relationship.ts +0 -0
- /package/dist/{lib → orbcharts-plugins-basic/lib}/core-types.d.ts +0 -0
- /package/dist/{lib → orbcharts-plugins-basic/lib}/core.d.ts +0 -0
- /package/dist/{lib → orbcharts-plugins-basic/lib}/plugins-basic-types.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/base/BaseTooltip.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/base/types.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/const.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Bars.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/BarsPN.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/BarsTriangle.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Dots.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GridLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GridTooltip.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GridZoom.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GroupAux.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/GroupAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/LineAreas.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/Lines.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/grid/plugins/ValueAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/multiGridObservables.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiBars.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiBarsTriangle.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiDots.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGridLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGridTooltip.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiGroupAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiLineAreas.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiLines.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/MultiValueAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/OverlappingValueAxes.d.ts +0 -0
- /package/dist/{src/grid → orbcharts-plugins-basic/src/multiValue}/plugins/Ranking.d.ts +0 -0
- /package/dist/{src/grid → orbcharts-plugins-basic/src/multiValue}/plugins/RankingAxis.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/noneData/defaults.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/noneData/index.d.ts +0 -0
- /package/dist/{src/base/BaseGroupArea.d.ts → orbcharts-plugins-basic/src/noneData/plugins/Container.d.ts} +0 -0
- /package/dist/{src/multiValue/index.d.ts → orbcharts-plugins-basic/src/noneData/plugins/Tooltip.d.ts} +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/defaults.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/index.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Bubbles.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Pie.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/PieEventTexts.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/PieLabels.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Rose.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/RoseLabels.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/SeriesLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/SeriesTooltip.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/plugins/Waffle.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/series/seriesUtils.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/defaults.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/index.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeLegend.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeMap.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/tree/plugins/TreeTooltip.d.ts +0 -0
- /package/dist/{src → orbcharts-plugins-basic/src}/utils/d3Graphics.d.ts +0 -0
- /package/dist/{vite.config.d.ts → orbcharts-plugins-basic/vite.config.d.ts} +0 -0
- /package/src/{grid → multiValue}/plugins/Ranking.ts +0 -0
- /package/src/{grid → multiValue}/plugins/RankingAxis.ts +0 -0
package/src/tree/defaults.ts
CHANGED
@@ -12,7 +12,7 @@ DEFAULT_TREE_MAP_PARAMS.sort.toString = () => `(a, b) => b.value - a.value`
|
|
12
12
|
export const DEFAULT_TREE_LEGEND_PARAMS: TreeLegendParams = {
|
13
13
|
// position: 'right',
|
14
14
|
// justify: 'end',
|
15
|
-
placement: '
|
15
|
+
placement: 'right-end',
|
16
16
|
padding: 28,
|
17
17
|
backgroundFill: 'none',
|
18
18
|
backgroundStroke: 'none',
|
@@ -30,7 +30,7 @@ export const DEFAULT_TREE_TOOLTIP_PARAMS: TreeTooltipParams = {
|
|
30
30
|
textColorType: 'primary',
|
31
31
|
offset: [20, 5],
|
32
32
|
padding: 10,
|
33
|
-
renderFn: (eventData, { styles }) => {
|
33
|
+
renderFn: (eventData, { styles, utils }) => {
|
34
34
|
const hasCategoryLabel = eventData.categoryLabel ? true : false
|
35
35
|
const hasDatumLabel = eventData.datum.label ? true : false
|
36
36
|
const bulletWidth = styles.textSizePx * 0.7
|
@@ -54,7 +54,7 @@ export const DEFAULT_TREE_TOOLTIP_PARAMS: TreeTooltipParams = {
|
|
54
54
|
</g>`
|
55
55
|
},
|
56
56
|
}
|
57
|
-
DEFAULT_TREE_TOOLTIP_PARAMS.renderFn.toString = () => `(eventData, { styles }) => {
|
57
|
+
DEFAULT_TREE_TOOLTIP_PARAMS.renderFn.toString = () => `(eventData, { styles, utils }) => {
|
58
58
|
const hasCategoryLabel = eventData.categoryLabel ? true : false
|
59
59
|
const hasDatumLabel = eventData.datum.label ? true : false
|
60
60
|
const bulletWidth = styles.textSizePx * 0.7
|
@@ -65,18 +65,11 @@ export const TreeLegend = defineTreePlugin(pluginConfig)(({ selection, rootSelec
|
|
65
65
|
|
66
66
|
const destroy$ = new Subject()
|
67
67
|
|
68
|
-
const categoryLabels$: Observable<string[]> = observer.CategoryDataMap$.pipe(
|
69
|
-
takeUntil(destroy$),
|
70
|
-
map(data => {
|
71
|
-
return Array.from(data.keys())
|
72
|
-
})
|
73
|
-
)
|
74
|
-
|
75
68
|
// 全部列點矩型使用相同樣式參數
|
76
69
|
const fullParams$ = observer.fullParams$.pipe(
|
77
70
|
takeUntil(destroy$),
|
78
71
|
map(d => {
|
79
|
-
const
|
72
|
+
const labelList = [
|
80
73
|
{
|
81
74
|
listRectWidth: d.listRectWidth,
|
82
75
|
listRectHeight: d.listRectHeight,
|
@@ -85,14 +78,14 @@ export const TreeLegend = defineTreePlugin(pluginConfig)(({ selection, rootSelec
|
|
85
78
|
]
|
86
79
|
return {
|
87
80
|
...d,
|
88
|
-
|
81
|
+
labelList
|
89
82
|
}
|
90
83
|
})
|
91
84
|
)
|
92
85
|
|
93
86
|
const unsubscribeBaseLegend = createBaseLegend(pluginName, {
|
94
87
|
rootSelection,
|
95
|
-
|
88
|
+
legendLabels$: observer.categoryLabels$,
|
96
89
|
fullParams$,
|
97
90
|
layout$: observer.layout$,
|
98
91
|
fullChartParams$: observer.fullChartParams$,
|
package/src/utils/commonUtils.ts
CHANGED
@@ -6,17 +6,17 @@ export function measureTextWidth (text: string, size: number = 10) {
|
|
6
6
|
}
|
7
7
|
|
8
8
|
// 取得最小及最大值 - 數字陣列
|
9
|
-
export function
|
10
|
-
const
|
9
|
+
export function getMinMax (data: number[]): [number, number] {
|
10
|
+
const defaultMinMax: [number, number] = [0, 0] // default
|
11
11
|
if (!data.length) {
|
12
|
-
return
|
12
|
+
return defaultMinMax
|
13
13
|
}
|
14
|
-
const
|
14
|
+
const minMax: [number, number] = data.reduce((prev, current) => {
|
15
15
|
// [min, max]
|
16
16
|
return [
|
17
17
|
current < prev[0] ? current : prev[0],
|
18
18
|
current > prev[1] ? current : prev[1]
|
19
19
|
]
|
20
20
|
}, [data[0], data[0]])
|
21
|
-
return
|
21
|
+
return minMax
|
22
22
|
}
|
package/src/utils/d3Utils.ts
CHANGED
@@ -56,14 +56,15 @@ export function makeD3Arc ({ axisWidth, innerRadius, outerRadius, padAngle, corn
|
|
56
56
|
.cornerRadius(cornerRadius)
|
57
57
|
}
|
58
58
|
|
59
|
-
export const parseTickFormatValue = (value: any, tickFormat: string | ((text: d3.NumberValue) =>
|
59
|
+
export const parseTickFormatValue = (value: any, tickFormat: string | ((text: d3.NumberValue) => string | d3.NumberValue)) => {
|
60
60
|
if (tickFormat! instanceof Function == true) {
|
61
|
-
|
61
|
+
const v = (tickFormat as ((text: d3.NumberValue) => string))(value)
|
62
|
+
return String(v ?? '')
|
62
63
|
}
|
63
64
|
return d3.format(tickFormat as string)!(value)
|
64
65
|
}
|
65
66
|
|
66
|
-
export const parseDateTickFormatValue = (value: any, tickFormat: string | ((text: d3.NumberValue) =>
|
67
|
+
export const parseDateTickFormatValue = (value: any, tickFormat: string | ((text: d3.NumberValue) => string | d3.NumberValue)) => {
|
67
68
|
if (tickFormat! instanceof Function == true) {
|
68
69
|
return (tickFormat as ((text: d3.NumberValue) => string))(value)
|
69
70
|
}
|
package/src/utils/observables.ts
CHANGED
@@ -3,10 +3,10 @@ import { Observable, merge, distinctUntilChanged, fromEvent } from 'rxjs'
|
|
3
3
|
|
4
4
|
export function d3EventObservable(selection: d3.Selection<any, any, any, any>, event: any) {
|
5
5
|
// Start with an observable that will never emit
|
6
|
-
let obs = new Observable(() => {});
|
6
|
+
let obs: Observable<MouseEvent> = new Observable(() => {});
|
7
7
|
selection.each(function () {
|
8
8
|
// Create observables from each of the elements
|
9
|
-
const events = fromEvent(this
|
9
|
+
const events: Observable<MouseEvent> = fromEvent(this, event);
|
10
10
|
// Merge the observables into one
|
11
11
|
obs = merge(obs, events);
|
12
12
|
});
|
@@ -3,24 +3,25 @@ import type {
|
|
3
3
|
ColorType,
|
4
4
|
ChartParams,
|
5
5
|
ComputedDatumBase,
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
ComputedDatumBaseValue,
|
7
|
+
ComputedDatumBaseSeries,
|
8
|
+
ComputedDatumBaseCategory } from '../../lib/core-types'
|
9
|
+
import { getMinMax } from './commonUtils'
|
9
10
|
|
10
11
|
// 取得最小及最大值 - datum格式陣列資料
|
11
|
-
export function
|
12
|
+
export function getMinMaxValue (data: (ComputedDatumBase & ComputedDatumBaseValue)[]): [number, number] {
|
12
13
|
const arr = data
|
13
14
|
.filter(d => d.value != null && d.visible != false)
|
14
15
|
.map(d => d.value as number)
|
15
|
-
return
|
16
|
+
return getMinMax(arr)
|
16
17
|
}
|
17
18
|
|
18
19
|
// 取得colorType顏色
|
19
20
|
export function getColor (colorType: ColorType, fullChartParams: ChartParams) {
|
20
21
|
const colors = fullChartParams.colors[fullChartParams.colorScheme]
|
21
22
|
// 對應series資料中第1個顏色
|
22
|
-
if (colorType === '
|
23
|
-
return colors.
|
23
|
+
if (colorType === 'label') {
|
24
|
+
return colors.label[0]
|
24
25
|
}
|
25
26
|
// 對應colorType設定的顏色
|
26
27
|
// return colors[colorType] != null
|
@@ -37,7 +38,7 @@ export function getSeriesValueColor () {
|
|
37
38
|
|
38
39
|
}
|
39
40
|
|
40
|
-
export function getCategoryValueColor ({ datum, colorType, fullChartParams }: { datum:
|
41
|
+
export function getCategoryValueColor ({ datum, colorType, fullChartParams }: { datum: ComputedDatumBaseCategory, colorType: ColorType, fullChartParams: ChartParams }) {
|
41
42
|
|
42
43
|
}
|
43
44
|
|
@@ -52,12 +53,12 @@ export function getCategoryValueColor ({ datum, colorType, fullChartParams }: {
|
|
52
53
|
// 取得Datum顏色 @Q@ 待重構完後刪除
|
53
54
|
export function getDatumColor ({ datum, colorType, fullChartParams }: { datum: ComputedDatumBase, colorType: ColorType, fullChartParams: ChartParams }) {
|
54
55
|
// 對應series資料中的顏色
|
55
|
-
if (colorType === '
|
56
|
-
if ((datum as unknown as
|
57
|
-
return (datum as unknown as
|
56
|
+
if (colorType === 'label') {
|
57
|
+
if ((datum as unknown as ComputedDatumBaseSeries).color) {
|
58
|
+
return (datum as unknown as ComputedDatumBaseSeries).color
|
58
59
|
} else {
|
59
60
|
// 非series類型的資料則回傳陣列中第1個顏色
|
60
|
-
return fullChartParams.colors[fullChartParams.colorScheme].
|
61
|
+
return fullChartParams.colors[fullChartParams.colorScheme].label[0]
|
61
62
|
}
|
62
63
|
}
|
63
64
|
// 對應colorType設定的顏色
|
@@ -98,3 +99,18 @@ export function calcAxesSize ({ xAxisPosition, yAxisPosition, width, height }: {
|
|
98
99
|
}
|
99
100
|
}
|
100
101
|
|
102
|
+
// export function getTicks (minValue: number, maxValue: number, defaultTicks: number | null) {
|
103
|
+
// let valueLength = maxValue - minValue
|
104
|
+
// if (defaultTicks === null) {
|
105
|
+
// if (valueLength <= 1) {
|
106
|
+
// return 1
|
107
|
+
// } else {
|
108
|
+
// // d3.js自動判斷
|
109
|
+
// return null
|
110
|
+
// }
|
111
|
+
// } else if (valueLength < defaultTicks) {
|
112
|
+
// return Math.ceil(valueLength)
|
113
|
+
// } else {
|
114
|
+
// return defaultTicks
|
115
|
+
// }
|
116
|
+
// }
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const BarStack: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"grid", "BarStack", import('@orbcharts/plugins-basic-types').BarStackParams>;
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const ValueStackAxis: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"grid", "ValueStackAxis", import('@orbcharts/plugins-basic-types').ValueStackAxisParams>;
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const MultiBarStack: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"multiGrid", "MultiBarStack", import('@orbcharts/plugins-basic-types').MultiBarStackParams>;
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const MultiValueStackAxis: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"multiGrid", "MultiValueStackAxis", import('@orbcharts/plugins-basic-types').MultiValueAxisParams>;
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const OverlappingValueStackAxes: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"multiGrid", "OverlappingValueStackAxes", import('@orbcharts/plugins-basic-types').OverlappingValueStackAxesParams>;
|
File without changes
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const Container: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<any, "Container", import('@orbcharts/plugins-basic-types').ContainerPluginParams>;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/dist/{src → orbcharts-plugins-basic/src}/multiGrid/plugins/OverlappingValueAxes.d.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|