@orbcharts/plugins-basic 3.0.0-beta.15 → 3.0.0-beta.16
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/orbcharts-plugins-basic.es.js +15129 -13927
- package/dist/orbcharts-plugins-basic.umd.js +72 -72
- package/dist/{orbcharts-plugins-basic/src → src}/base/BaseBars.d.ts +3 -3
- package/dist/{orbcharts-plugins-basic/src → src}/base/BaseBarsTriangle.d.ts +3 -3
- package/dist/{orbcharts-plugins-basic/src → src}/base/BaseDots.d.ts +3 -3
- package/dist/{orbcharts-plugins-basic/src → src}/base/BaseLineAreas.d.ts +3 -3
- package/dist/{orbcharts-plugins-basic/src → src}/base/BaseLines.d.ts +3 -3
- package/dist/src/base/BaseRacingBars.d.ts +23 -0
- package/dist/src/base/BaseRacingLabels.d.ts +20 -0
- package/dist/src/base/BaseRacingValueLabels.d.ts +20 -0
- package/dist/{orbcharts-plugins-basic/src/base/BaseStackedBar.d.ts → src/base/BaseStackedBars.d.ts} +7 -7
- package/dist/{orbcharts-plugins-basic/src → src}/base/BaseValueAxis.d.ts +4 -7
- package/dist/src/base/BaseXAxis.d.ts +20 -0
- package/dist/src/base/BaseYAxis.d.ts +18 -0
- package/dist/{orbcharts-plugins-basic/src → src}/grid/defaults.d.ts +3 -3
- package/dist/{orbcharts-plugins-basic/src → src}/grid/gridObservables.d.ts +8 -1
- package/dist/{orbcharts-plugins-basic/src → src}/grid/index.d.ts +2 -2
- package/dist/src/grid/plugins/GroupZoom.d.ts +1 -0
- package/dist/src/grid/plugins/StackedBars.d.ts +1 -0
- package/dist/src/index.d.ts +7 -1
- package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/defaults.d.ts +2 -2
- package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/index.d.ts +1 -1
- package/dist/src/multiGrid/plugins/MultiStackedBars.d.ts +1 -0
- package/dist/src/multiValue/defaults.d.ts +13 -0
- package/dist/{orbcharts-plugins-basic/src → src}/multiValue/index.d.ts +5 -1
- package/dist/src/multiValue/multiValueObservables.d.ts +56 -0
- package/dist/src/multiValue/plugins/RacingBars.d.ts +1 -0
- package/dist/src/multiValue/plugins/RacingCounterTexts.d.ts +3 -0
- package/dist/src/multiValue/plugins/RacingValueAxis.d.ts +1 -0
- package/dist/src/multiValue/plugins/XAxis.d.ts +1 -0
- package/dist/src/multiValue/plugins/XYAxes.d.ts +1 -0
- package/dist/src/multiValue/plugins/XZoom.d.ts +1 -0
- package/lib/core.ts +1 -1
- package/package.json +4 -4
- package/src/base/BaseBars.ts +11 -11
- package/src/base/BaseBarsTriangle.ts +11 -11
- package/src/base/BaseDots.ts +10 -10
- package/src/base/BaseGroupAxis.ts +2 -0
- package/src/base/BaseLineAreas.ts +8 -8
- package/src/base/BaseLines.ts +7 -7
- package/src/base/BaseRacingBars.ts +552 -0
- package/src/base/BaseRacingLabels.ts +392 -0
- package/src/base/BaseRacingValueLabels.ts +403 -0
- package/src/base/{BaseStackedBar.ts → BaseStackedBars.ts} +22 -22
- package/src/base/BaseValueAxis.ts +70 -53
- package/src/base/BaseXAxis.ts +427 -0
- package/src/base/BaseYAxis.ts +389 -0
- package/src/grid/defaults.ts +4 -56
- package/src/grid/gridObservables.ts +58 -0
- package/src/grid/index.ts +2 -2
- package/src/grid/plugins/Bars.ts +2 -2
- package/src/grid/plugins/BarsPN.ts +2 -2
- package/src/grid/plugins/BarsTriangle.ts +2 -2
- package/src/grid/plugins/Dots.ts +2 -2
- package/src/grid/plugins/GridLegend.ts +7 -7
- package/src/grid/plugins/GroupAxis.ts +0 -24
- package/src/grid/plugins/{GridZoom.ts → GroupZoom.ts} +2 -2
- package/src/grid/plugins/LineAreas.ts +2 -2
- package/src/grid/plugins/Lines.ts +2 -2
- package/src/grid/plugins/{StackedBar.ts → StackedBars.ts} +6 -6
- package/src/multiGrid/defaults.ts +2 -2
- package/src/multiGrid/index.ts +1 -1
- package/src/multiGrid/multiGridObservables.ts +1 -0
- package/src/multiGrid/plugins/MultiBars.ts +3 -3
- package/src/multiGrid/plugins/MultiBarsTriangle.ts +3 -3
- package/src/multiGrid/plugins/MultiDots.ts +3 -3
- package/src/multiGrid/plugins/MultiGridLegend.ts +20 -10
- package/src/multiGrid/plugins/MultiLineAreas.ts +3 -3
- package/src/multiGrid/plugins/MultiLines.ts +3 -3
- package/src/multiGrid/plugins/{MultiStackedBar.ts → MultiStackedBars.ts} +7 -7
- package/src/multiGrid/plugins/OverlappingStackedValueAxes.ts +1 -0
- package/src/multiValue/defaults.ts +137 -4
- package/src/multiValue/index.ts +5 -1
- package/src/multiValue/multiValueObservables.ts +414 -44
- package/src/multiValue/plugins/OrdinalBubbles.ts +0 -0
- package/src/multiValue/plugins/OrdinalXAxis.ts +0 -0
- package/src/multiValue/plugins/RacingBars.ts +362 -0
- package/src/multiValue/plugins/RacingCounterAxis.ts +0 -0
- package/src/multiValue/plugins/RacingCounterTexts.ts +300 -0
- package/src/multiValue/plugins/RacingValueAxis.ts +115 -0
- package/src/multiValue/plugins/RankingAxis_legacy.ts +109 -0
- package/src/multiValue/plugins/Scatter.ts +13 -13
- package/src/multiValue/plugins/ScatterBubbles.ts +13 -13
- package/src/multiValue/plugins/XAxis.ts +108 -0
- package/src/multiValue/plugins/XYAux.ts +13 -13
- package/src/multiValue/plugins/XYAxes.ts +38 -528
- package/src/multiValue/plugins/XYAxes_legacy.ts +684 -0
- package/src/multiValue/plugins/{XYZoom.ts → XZoom.ts} +14 -14
- package/src/series/defaults.ts +2 -13
- package/src/series/plugins/Bubbles.ts +45 -29
- package/src/series/plugins/Pie.ts +5 -5
- package/src/series/plugins/PieEventTexts.ts +3 -3
- package/src/series/plugins/PieLabels.ts +5 -5
- package/src/series/plugins/Rose.ts +11 -11
- package/src/series/plugins/RoseLabels.ts +9 -9
- package/dist/orbcharts-plugins-basic/src/grid/plugins/GridZoom.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedBar.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/index.d.ts +0 -7
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedBar.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiValue/defaults.d.ts +0 -9
- package/dist/orbcharts-plugins-basic/src/multiValue/multiValueObservables.d.ts +0 -33
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYZoom.d.ts +0 -1
- /package/dist/{orbcharts-plugins-basic/lib → lib}/core-types.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/lib → lib}/core.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/lib → lib}/plugins-basic-types.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/base/BaseGroupAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/base/BaseLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/base/BaseTooltip.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/base/types.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/const.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/Bars.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/BarsPN.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/BarsTriangle.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/Dots.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/GridLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/GridTooltip.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/GroupAux.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/GroupAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/LineAreas.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/Lines.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/StackedValueAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/grid/plugins/ValueAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/multiGridObservables.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiBars.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiBarsTriangle.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiDots.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiGridLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiGridTooltip.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiGroupAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiLineAreas.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiLines.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiStackedValueAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/MultiValueAxis.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/OverlappingStackedValueAxes.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiGrid/plugins/OverlappingValueAxes.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/MultiValueLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/MultiValueTooltip.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src/multiValue/plugins/Ranking.d.ts → src/multiValue/plugins/OrdinalBubbles.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src/multiValue/plugins/RankingAxis.d.ts → src/multiValue/plugins/OrdinalXAxis.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src/noneData/plugins/Container.d.ts → src/multiValue/plugins/RacingCounterAxis.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src/noneData/plugins/Tooltip.d.ts → src/multiValue/plugins/RankingAxis_legacy.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/Scatter.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/ScatterBubbles.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/multiValue/plugins/XYAux.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src/multiValue/plugins/XYAxes.d.ts → src/multiValue/plugins/XYAxes_legacy.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/noneData/defaults.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/noneData/index.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src/series/plugins/Waffle.d.ts → src/noneData/plugins/Container.d.ts} +0 -0
- /package/{src/multiValue/plugins/Ranking.ts → dist/src/noneData/plugins/Tooltip.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/defaults.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/index.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/plugins/ForceDirected.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/plugins/ForceDirectedBubbles.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/plugins/RelationshipLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/plugins/RelationshipTooltip.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/relationship/relationshipObservables.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/defaults.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/index.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/Bubbles.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/Pie.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/PieEventTexts.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/PieLabels.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/Rose.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/RoseLabels.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/SeriesLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/SeriesTooltip.d.ts +0 -0
- /package/{src/multiValue/plugins/RankingAxis.ts → dist/src/series/plugins/Waffle.d.ts} +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/seriesObservables.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/series/seriesUtils.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/tree/defaults.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/tree/index.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/tree/plugins/TreeLegend.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/tree/plugins/TreeMap.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/tree/plugins/TreeTooltip.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/utils/commonUtils.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/utils/d3Graphics.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/utils/d3Utils.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/utils/observables.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/src → src}/utils/orbchartsUtils.d.ts +0 -0
- /package/dist/{orbcharts-plugins-basic/vite.config.d.ts → vite.config.d.ts} +0 -0
@@ -13,7 +13,7 @@ import type {
|
|
13
13
|
ComputedDatumGrid,
|
14
14
|
ComputedDataGrid,
|
15
15
|
ComputedLayoutDatumGrid,
|
16
|
-
|
16
|
+
ComputedAxesDataGrid,
|
17
17
|
DataFormatterTypeMap,
|
18
18
|
EventGrid,
|
19
19
|
ChartParams,
|
@@ -36,9 +36,9 @@ import { gridSelectionsObservable } from '../grid/gridObservables'
|
|
36
36
|
interface BaseBarsContext {
|
37
37
|
selection: d3.Selection<any, unknown, any, unknown>
|
38
38
|
computedData$: Observable<ComputedDataGrid>
|
39
|
-
|
39
|
+
computedAxesData$: Observable<ComputedAxesDataGrid>
|
40
40
|
visibleComputedData$: Observable<ComputedDatumGrid[][]>
|
41
|
-
|
41
|
+
visibleComputedAxesData$: Observable<ComputedAxesDataGrid>
|
42
42
|
fullDataFormatter$: Observable<DataFormatterTypeMap<'grid'>>
|
43
43
|
seriesLabels$: Observable<string[]>
|
44
44
|
SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
@@ -62,7 +62,7 @@ interface RenderBarParams {
|
|
62
62
|
graphicGSelection: d3.Selection<SVGGElement, unknown, any, any>
|
63
63
|
pathGClassName: string
|
64
64
|
pathClassName: string
|
65
|
-
|
65
|
+
visibleComputedAxesData: ComputedAxesDataGrid
|
66
66
|
linearGradientIds: string[]
|
67
67
|
zeroYArr: number[]
|
68
68
|
groupLabels: string[]
|
@@ -131,7 +131,7 @@ function calctransitionItem (barGroupAmount: number, totalDuration: number) {
|
|
131
131
|
return totalDuration * (1 - groupDelayProportionOfDuration) // delay後剩餘的時間
|
132
132
|
}
|
133
133
|
|
134
|
-
function renderTriangleBars ({ graphicGSelection, pathGClassName, pathClassName,
|
134
|
+
function renderTriangleBars ({ graphicGSelection, pathGClassName, pathClassName, visibleComputedAxesData, linearGradientIds, zeroYArr, groupLabels, barScale, params, chartParams, barWidth, delayGroup, transitionItem, isSeriesSeprate }: RenderBarParams) {
|
135
135
|
|
136
136
|
const barHalfWidth = barWidth! / 2
|
137
137
|
|
@@ -140,7 +140,7 @@ function renderTriangleBars ({ graphicGSelection, pathGClassName, pathClassName,
|
|
140
140
|
// g
|
141
141
|
const gSelection = d3.select(g[seriesIndex])
|
142
142
|
.selectAll<SVGGElement, ComputedDatumGrid>(`g.${pathGClassName}`)
|
143
|
-
.data(
|
143
|
+
.data(visibleComputedAxesData[seriesIndex] ?? [])
|
144
144
|
.join(
|
145
145
|
enter => {
|
146
146
|
const enterSelection = enter
|
@@ -299,9 +299,9 @@ function highlight ({ selection, ids, fullChartParams }: {
|
|
299
299
|
export const createBaseBarsTriangle: BasePluginFn<BaseBarsContext> = (pluginName: string, {
|
300
300
|
selection,
|
301
301
|
computedData$,
|
302
|
-
|
302
|
+
computedAxesData$,
|
303
303
|
visibleComputedData$,
|
304
|
-
|
304
|
+
visibleComputedAxesData$,
|
305
305
|
fullDataFormatter$,
|
306
306
|
seriesLabels$,
|
307
307
|
SeriesDataMap$,
|
@@ -346,7 +346,7 @@ export const createBaseBarsTriangle: BasePluginFn<BaseBarsContext> = (pluginName
|
|
346
346
|
})
|
347
347
|
)
|
348
348
|
|
349
|
-
const zeroYArr$ =
|
349
|
+
const zeroYArr$ = visibleComputedAxesData$.pipe(
|
350
350
|
// map(d => d[0] && d[0][0]
|
351
351
|
// ? d[0][0].axisY - d[0][0].axisYFromZero
|
352
352
|
// : 0),
|
@@ -522,7 +522,7 @@ export const createBaseBarsTriangle: BasePluginFn<BaseBarsContext> = (pluginName
|
|
522
522
|
graphicGSelection: graphicGSelection$,
|
523
523
|
defsSelection: defsSelection$,
|
524
524
|
computedData: computedData$,
|
525
|
-
|
525
|
+
visibleComputedAxesData: visibleComputedAxesData$,
|
526
526
|
linearGradientIds: linearGradientIds$,
|
527
527
|
zeroYArr: zeroYArr$,
|
528
528
|
groupLabels: groupLabels$,
|
@@ -548,7 +548,7 @@ export const createBaseBarsTriangle: BasePluginFn<BaseBarsContext> = (pluginName
|
|
548
548
|
graphicGSelection: data.graphicGSelection,
|
549
549
|
pathGClassName,
|
550
550
|
pathClassName,
|
551
|
-
|
551
|
+
visibleComputedAxesData: data.visibleComputedAxesData,
|
552
552
|
linearGradientIds: data.linearGradientIds,
|
553
553
|
zeroYArr: data.zeroYArr,
|
554
554
|
groupLabels: data.groupLabels,
|
package/src/base/BaseDots.ts
CHANGED
@@ -11,7 +11,7 @@ import type { BasePluginFn } from './types'
|
|
11
11
|
import type {
|
12
12
|
ComputedDatumGrid,
|
13
13
|
ComputedDataGrid,
|
14
|
-
|
14
|
+
ComputedAxesDataGrid,
|
15
15
|
EventGrid,
|
16
16
|
ChartParams,
|
17
17
|
ContainerPositionScaled,
|
@@ -35,9 +35,9 @@ import { gridSelectionsObservable } from '../grid/gridObservables'
|
|
35
35
|
interface BaseDotsContext {
|
36
36
|
selection: d3.Selection<any, unknown, any, unknown>
|
37
37
|
computedData$: Observable<ComputedDataGrid>
|
38
|
-
|
38
|
+
computedAxesData$: Observable<ComputedAxesDataGrid>
|
39
39
|
visibleComputedData$: Observable<ComputedDatumGrid[][]>
|
40
|
-
|
40
|
+
visibleComputedAxesData$: Observable<ComputedAxesDataGrid>
|
41
41
|
seriesLabels$: Observable<string[]>
|
42
42
|
SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
43
43
|
GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
@@ -68,11 +68,11 @@ type ClipPathDatum = {
|
|
68
68
|
// const circleGClassName = getClassName(pluginName, 'circleG')
|
69
69
|
// const circleClassName = getClassName(pluginName, 'circle')
|
70
70
|
|
71
|
-
function renderDots ({ graphicGSelection, circleGClassName, circleClassName,
|
71
|
+
function renderDots ({ graphicGSelection, circleGClassName, circleClassName, visibleComputedAxesData, fullParams, fullChartParams, graphicReverseScale }: {
|
72
72
|
graphicGSelection: d3.Selection<SVGGElement, any, any, any>
|
73
73
|
circleGClassName: string
|
74
74
|
circleClassName: string
|
75
|
-
|
75
|
+
visibleComputedAxesData: ComputedAxesDataGrid
|
76
76
|
fullParams: BaseDotsParams
|
77
77
|
fullChartParams: ChartParams
|
78
78
|
graphicReverseScale: [number, number][]
|
@@ -89,7 +89,7 @@ function renderDots ({ graphicGSelection, circleGClassName, circleClassName, vis
|
|
89
89
|
.each((seriesData, seriesIndex, g) => {
|
90
90
|
d3.select(g[seriesIndex])
|
91
91
|
.selectAll<SVGGElement, ComputedDatumGrid>('g')
|
92
|
-
.data(
|
92
|
+
.data(visibleComputedAxesData[seriesIndex], d => d.id)
|
93
93
|
.join(
|
94
94
|
enter => {
|
95
95
|
// enterDuration
|
@@ -222,9 +222,9 @@ function renderClipPath ({ defsSelection, clipPathData }: {
|
|
222
222
|
export const createBaseDots: BasePluginFn<BaseDotsContext> = (pluginName: string, {
|
223
223
|
selection,
|
224
224
|
computedData$,
|
225
|
-
|
225
|
+
computedAxesData$,
|
226
226
|
visibleComputedData$,
|
227
|
-
|
227
|
+
visibleComputedAxesData$,
|
228
228
|
seriesLabels$,
|
229
229
|
SeriesDataMap$,
|
230
230
|
GroupDataMap$,
|
@@ -310,7 +310,7 @@ export const createBaseDots: BasePluginFn<BaseDotsContext> = (pluginName: string
|
|
310
310
|
|
311
311
|
const graphicSelection$ = combineLatest({
|
312
312
|
graphicGSelection: graphicGSelection$,
|
313
|
-
|
313
|
+
visibleComputedAxesData: visibleComputedAxesData$,
|
314
314
|
graphicReverseScale: graphicReverseScale$,
|
315
315
|
fullChartParams: fullChartParams$,
|
316
316
|
fullParams: fullParams$,
|
@@ -322,7 +322,7 @@ export const createBaseDots: BasePluginFn<BaseDotsContext> = (pluginName: string
|
|
322
322
|
graphicGSelection: data.graphicGSelection,
|
323
323
|
circleGClassName,
|
324
324
|
circleClassName,
|
325
|
-
|
325
|
+
visibleComputedAxesData: data.visibleComputedAxesData,
|
326
326
|
fullParams: data.fullParams,
|
327
327
|
fullChartParams: data.fullChartParams,
|
328
328
|
graphicReverseScale: data.graphicReverseScale
|
@@ -234,6 +234,7 @@ function renderAxis ({ selection, xAxisClassName, fullParams, tickTextAlign, gri
|
|
234
234
|
const xAxisEl = xAxisSelection
|
235
235
|
.transition()
|
236
236
|
.duration(100)
|
237
|
+
.ease(d3.easeLinear) // 線性的 - 當托曳或快速變動的時候比較滑順
|
237
238
|
.call(xAxis)
|
238
239
|
.on('end', (self, t) => {
|
239
240
|
// 先等transition結束再處理文字,否則會被原本的文字覆蓋
|
@@ -257,6 +258,7 @@ function renderAxis ({ selection, xAxisClassName, fullParams, tickTextAlign, gri
|
|
257
258
|
.style('fill', 'none')
|
258
259
|
.style('stroke', fullParams.tickLineVisible == true ? getColor(fullParams.tickColorType, chartParams) : 'none')
|
259
260
|
.style('stroke-dasharray', fullParams.tickFullLineDasharray)
|
261
|
+
.style('vector-effect', 'non-scaling-stroke') // 避免 scale 導致線條變形
|
260
262
|
.attr('pointer-events', 'none')
|
261
263
|
|
262
264
|
xAxisEl.selectAll('path')
|
@@ -13,7 +13,7 @@ import type {
|
|
13
13
|
ComputedDatumGrid,
|
14
14
|
ComputedDataGrid,
|
15
15
|
ComputedLayoutDatumGrid,
|
16
|
-
|
16
|
+
ComputedAxesDataGrid,
|
17
17
|
DataFormatterGrid,
|
18
18
|
EventGrid,
|
19
19
|
ContainerPositionScaled,
|
@@ -36,9 +36,9 @@ import { gridSelectionsObservable } from '../grid/gridObservables'
|
|
36
36
|
interface BaseLineAreasContext {
|
37
37
|
selection: d3.Selection<any, unknown, any, unknown>
|
38
38
|
computedData$: Observable<ComputedDataGrid>
|
39
|
-
|
39
|
+
computedAxesData$: Observable<ComputedAxesDataGrid>
|
40
40
|
visibleComputedData$: Observable<ComputedDatumGrid[][]>
|
41
|
-
|
41
|
+
visibleComputedAxesData$: Observable<ComputedAxesDataGrid>
|
42
42
|
seriesLabels$: Observable<string[]>
|
43
43
|
SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
44
44
|
GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
@@ -262,9 +262,9 @@ function renderClipPath ({ defsSelection, clipPathData, transitionDuration, tran
|
|
262
262
|
export const createBaseLineAreas: BasePluginFn<BaseLineAreasContext> = (pluginName: string, {
|
263
263
|
selection,
|
264
264
|
computedData$,
|
265
|
-
|
265
|
+
computedAxesData$,
|
266
266
|
visibleComputedData$,
|
267
|
-
|
267
|
+
visibleComputedAxesData$,
|
268
268
|
seriesLabels$,
|
269
269
|
SeriesDataMap$,
|
270
270
|
GroupDataMap$,
|
@@ -431,7 +431,7 @@ export const createBaseLineAreas: BasePluginFn<BaseLineAreasContext> = (pluginNa
|
|
431
431
|
const pathSelectionArr$ = combineLatest({
|
432
432
|
graphicGSelection: graphicGSelection$,
|
433
433
|
defsSelection: defsSelection$,
|
434
|
-
|
434
|
+
visibleComputedAxesData: visibleComputedAxesData$,
|
435
435
|
linearGradientIds: linearGradientIds$,
|
436
436
|
areaPath: areaPath$,
|
437
437
|
params: fullParams$,
|
@@ -453,7 +453,7 @@ export const createBaseLineAreas: BasePluginFn<BaseLineAreasContext> = (pluginNa
|
|
453
453
|
// 繪圖
|
454
454
|
data.graphicGSelection.each((d, i, all) => {
|
455
455
|
// 將資料分段
|
456
|
-
const segmentData = makeSegmentData(data.
|
456
|
+
const segmentData = makeSegmentData(data.visibleComputedAxesData[i] ?? [])
|
457
457
|
|
458
458
|
pathSelectionArr[i] = renderLineAreas({
|
459
459
|
selection: d3.select(all[i]),
|
@@ -465,7 +465,7 @@ export const createBaseLineAreas: BasePluginFn<BaseLineAreasContext> = (pluginNa
|
|
465
465
|
})
|
466
466
|
renderLinearGradient({
|
467
467
|
defsSelection: data.defsSelection,
|
468
|
-
computedData: data.
|
468
|
+
computedData: data.visibleComputedAxesData,
|
469
469
|
linearGradientIds: data.linearGradientIds,
|
470
470
|
params: data.params
|
471
471
|
})
|
package/src/base/BaseLines.ts
CHANGED
@@ -13,7 +13,7 @@ import type {
|
|
13
13
|
ComputedDatumGrid,
|
14
14
|
ComputedDataGrid,
|
15
15
|
ComputedLayoutDatumGrid,
|
16
|
-
|
16
|
+
ComputedAxesDataGrid,
|
17
17
|
DataFormatterGrid,
|
18
18
|
EventGrid,
|
19
19
|
ContainerPositionScaled,
|
@@ -42,9 +42,9 @@ import { gridSelectionsObservable } from '../grid/gridObservables'
|
|
42
42
|
interface BaseLinesContext {
|
43
43
|
selection: d3.Selection<any, unknown, any, unknown>
|
44
44
|
computedData$: Observable<ComputedDataGrid>
|
45
|
-
|
45
|
+
computedAxesData$: Observable<ComputedAxesDataGrid>
|
46
46
|
visibleComputedData$: Observable<ComputedDatumGrid[][]>
|
47
|
-
|
47
|
+
visibleComputedAxesData$: Observable<ComputedAxesDataGrid>
|
48
48
|
seriesLabels$: Observable<string[]>
|
49
49
|
SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
50
50
|
GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>
|
@@ -230,9 +230,9 @@ function renderClipPath ({ defsSelection, clipPathData, transitionDuration, tran
|
|
230
230
|
export const createBaseLines: BasePluginFn<BaseLinesContext> = (pluginName: string, {
|
231
231
|
selection,
|
232
232
|
computedData$,
|
233
|
-
|
233
|
+
computedAxesData$,
|
234
234
|
visibleComputedData$,
|
235
|
-
|
235
|
+
visibleComputedAxesData$,
|
236
236
|
seriesLabels$,
|
237
237
|
SeriesDataMap$,
|
238
238
|
GroupDataMap$,
|
@@ -515,7 +515,7 @@ export const createBaseLines: BasePluginFn<BaseLinesContext> = (pluginName: stri
|
|
515
515
|
|
516
516
|
const pathSelectionArr$ = combineLatest({
|
517
517
|
graphicGSelection: graphicGSelection$,
|
518
|
-
|
518
|
+
visibleComputedAxesData: visibleComputedAxesData$,
|
519
519
|
linePath: linePath$,
|
520
520
|
params: fullParams$,
|
521
521
|
}).pipe(
|
@@ -536,7 +536,7 @@ export const createBaseLines: BasePluginFn<BaseLinesContext> = (pluginName: stri
|
|
536
536
|
// 繪圖
|
537
537
|
data.graphicGSelection.each((d, i, all) => {
|
538
538
|
// 將資料分段
|
539
|
-
const segmentData = makeSegmentData(data.
|
539
|
+
const segmentData = makeSegmentData(data.visibleComputedAxesData[i] ?? [])
|
540
540
|
|
541
541
|
pathSelectionArr[i] = renderLines({
|
542
542
|
selection: d3.select(all[i]),
|