@orbcharts/plugins-basic 3.0.0-beta.9 → 3.0.1
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/lib/plugins-basic-types.d.ts +1 -0
- package/dist/orbcharts-plugins-basic.es.js +12358 -10836
- package/dist/orbcharts-plugins-basic.umd.js +273 -110
- 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/Bars.d.ts +1 -0
- package/dist/src/grid/plugins/BarsPN.d.ts +1 -0
- package/dist/src/grid/plugins/BarsTriangle.d.ts +1 -0
- package/dist/src/grid/plugins/Dots.d.ts +1 -0
- package/dist/src/grid/plugins/GridLegend.d.ts +1 -0
- package/dist/src/grid/plugins/GridTooltip.d.ts +1 -0
- package/dist/src/grid/plugins/GroupAux.d.ts +3 -0
- package/dist/src/grid/plugins/GroupAxis.d.ts +1 -0
- package/dist/src/grid/plugins/GroupZoom.d.ts +1 -0
- package/dist/src/grid/plugins/LineAreas.d.ts +1 -0
- package/dist/src/grid/plugins/Lines.d.ts +1 -0
- package/dist/src/grid/plugins/StackedBars.d.ts +1 -0
- package/dist/src/grid/plugins/StackedValueAxis.d.ts +1 -0
- package/dist/src/grid/plugins/ValueAxis.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/MultiBars.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiBarsTriangle.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiDots.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiGridLegend.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiGridTooltip.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiGroupAxis.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiLineAreas.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiLines.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiStackedBars.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiStackedValueAxis.d.ts +1 -0
- package/dist/src/multiGrid/plugins/MultiValueAxis.d.ts +1 -0
- package/dist/src/multiGrid/plugins/OverlappingStackedValueAxes.d.ts +1 -0
- package/dist/src/multiGrid/plugins/OverlappingValueAxes.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/MultiValueLegend.d.ts +1 -0
- package/dist/src/multiValue/plugins/MultiValueTooltip.d.ts +1 -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/Scatter.d.ts +3 -0
- package/dist/src/multiValue/plugins/ScatterBubbles.d.ts +3 -0
- package/dist/src/multiValue/plugins/XAxis.d.ts +1 -0
- package/dist/src/multiValue/plugins/XYAux.d.ts +3 -0
- package/dist/src/multiValue/plugins/XYAxes.d.ts +1 -0
- package/dist/src/multiValue/plugins/XYAxes_legacy.d.ts +3 -0
- package/dist/src/multiValue/plugins/XZoom.d.ts +1 -0
- package/dist/src/relationship/plugins/ForceDirected.d.ts +3 -0
- package/dist/src/relationship/plugins/ForceDirectedBubbles.d.ts +3 -0
- package/dist/src/relationship/plugins/RelationshipLegend.d.ts +1 -0
- package/dist/src/relationship/plugins/RelationshipTooltip.d.ts +1 -0
- package/dist/src/series/plugins/Bubbles.d.ts +3 -0
- package/dist/src/series/plugins/Pie.d.ts +3 -0
- package/dist/src/series/plugins/PieEventTexts.d.ts +3 -0
- package/dist/src/series/plugins/PieLabels.d.ts +3 -0
- package/dist/{orbcharts-plugins-basic/src → src}/series/plugins/Rose.d.ts +1 -1
- package/dist/src/series/plugins/RoseLabels.d.ts +3 -0
- package/dist/src/series/plugins/SeriesLegend.d.ts +1 -0
- package/dist/src/series/plugins/SeriesTooltip.d.ts +1 -0
- package/dist/src/tree/plugins/TreeLegend.d.ts +1 -0
- package/dist/src/tree/plugins/TreeMap.d.ts +3 -0
- package/dist/src/tree/plugins/TreeTooltip.d.ts +1 -0
- package/dist/{orbcharts-plugins-basic/src → src}/utils/commonUtils.d.ts +1 -0
- package/dist/{orbcharts-plugins-basic/src → src}/utils/d3Graphics.d.ts +2 -1
- package/dist/{orbcharts-plugins-basic/src → src}/utils/d3Utils.d.ts +1 -0
- package/lib/core.ts +1 -1
- package/lib/plugins-basic-types.ts +2 -2
- package/package.json +4 -4
- package/src/base/BaseBars.ts +15 -15
- package/src/base/BaseBarsTriangle.ts +15 -15
- package/src/base/BaseDots.ts +14 -14
- package/src/base/BaseGroupAxis.ts +18 -6
- package/src/base/BaseLineAreas.ts +12 -12
- package/src/base/BaseLines.ts +11 -11
- package/src/base/BaseRacingBars.ts +552 -0
- package/src/base/BaseRacingLabels.ts +396 -0
- package/src/base/BaseRacingValueLabels.ts +403 -0
- package/src/base/{BaseStackedBar.ts → BaseStackedBars.ts} +26 -26
- package/src/base/BaseTooltip.ts +2 -1
- 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 +44 -77
- 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/GroupAux.ts +41 -24
- package/src/grid/plugins/GroupAxis.ts +0 -24
- package/src/grid/plugins/{GridZoom.ts → GroupZoom.ts} +5 -5
- package/src/grid/plugins/LineAreas.ts +2 -2
- package/src/grid/plugins/Lines.ts +2 -2
- package/src/grid/plugins/{StackedBar.ts → StackedBars.ts} +9 -9
- package/src/multiGrid/defaults.ts +44 -24
- 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} +10 -10
- package/src/multiGrid/plugins/OverlappingStackedValueAxes.ts +1 -0
- package/src/multiValue/defaults.ts +277 -12
- 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 +373 -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 +15 -14
- 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} +17 -17
- package/src/relationship/defaults.ts +42 -16
- package/src/relationship/plugins/ForceDirected.ts +26 -19
- package/src/relationship/plugins/ForceDirectedBubbles.ts +46 -25
- package/src/series/defaults.ts +51 -36
- package/src/series/plugins/Bubbles.ts +67 -37
- 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/src/tree/defaults.ts +46 -22
- package/src/tree/plugins/TreeMap.ts +11 -3
- package/src/utils/commonUtils.ts +10 -1
- package/src/utils/d3Graphics.ts +4 -2
- package/src/utils/d3Utils.ts +18 -0
- package/src/utils/orbchartsUtils.ts +30 -16
- package/dist/orbcharts-plugins-basic/lib/plugins-basic-types.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/Bars.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/BarsPN.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/BarsTriangle.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/Dots.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/GridLegend.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/GridTooltip.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/GridZoom.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/GroupAux.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/grid/plugins/GroupAxis.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/LineAreas.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/Lines.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedBar.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/StackedValueAxis.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/grid/plugins/ValueAxis.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/index.d.ts +0 -7
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiBars.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiBarsTriangle.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiDots.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiGridLegend.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiGridTooltip.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiGroupAxis.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiLineAreas.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiLines.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedBar.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiStackedValueAxis.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/MultiValueAxis.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/OverlappingStackedValueAxes.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiGrid/plugins/OverlappingValueAxes.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/MultiValueLegend.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/MultiValueTooltip.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/Scatter.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/ScatterBubbles.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYAux.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYAxes.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/multiValue/plugins/XYZoom.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/ForceDirected.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/ForceDirectedBubbles.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/RelationshipLegend.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/relationship/plugins/RelationshipTooltip.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/series/plugins/Bubbles.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/series/plugins/Pie.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/series/plugins/PieEventTexts.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/series/plugins/PieLabels.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/series/plugins/RoseLabels.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/series/plugins/SeriesLegend.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/series/plugins/SeriesTooltip.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/tree/plugins/TreeLegend.d.ts +0 -1
- package/dist/orbcharts-plugins-basic/src/tree/plugins/TreeMap.d.ts +0 -3
- package/dist/orbcharts-plugins-basic/src/tree/plugins/TreeTooltip.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/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}/multiGrid/multiGridObservables.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}/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/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/{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}/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
@@ -0,0 +1 @@
|
|
1
|
+
export declare const XZoom: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"multiValue", "XZoom", import('@orbcharts/plugins-basic-types').XZoomParams>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const RelationshipLegend: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"relationship", "RelationshipLegend", import('@orbcharts/plugins-basic-types').RelationshipLegendParams>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const RelationshipTooltip: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"relationship", "RelationshipTooltip", import('@orbcharts/plugins-basic-types').RelationshipTooltipParams>;
|
@@ -7,4 +7,4 @@ export interface PieDatum extends D3PieDatum {
|
|
7
7
|
id: string;
|
8
8
|
prevValue: number;
|
9
9
|
}
|
10
|
-
export declare const Rose: import('
|
10
|
+
export declare const Rose: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"series", "Rose", RoseParams>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const SeriesLegend: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"series", "SeriesLegend", import('@orbcharts/plugins-basic-types').SeriesLegendParams>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const SeriesTooltip: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"series", "SeriesTooltip", import('@orbcharts/plugins-basic-types').SeriesTooltipParams>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const TreeLegend: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"tree", "TreeLegend", import('@orbcharts/plugins-basic-types').TreeLegendParams>;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const TreeTooltip: import('@orbcharts/core-types/dist/src/types/Plugin').PluginConstructor<"tree", "TreeTooltip", import('@orbcharts/plugins-basic-types').TreeTooltipParams>;
|
@@ -10,10 +10,11 @@ type Line = {
|
|
10
10
|
text: string;
|
11
11
|
};
|
12
12
|
export declare function renderCircleText(selection: d3.Selection<any, any, any, any>, { text, radius, lineHeight, isBreakAll, limit }: RenderCircleTextParams): d3.Selection<SVGTSpanElement, Line, SVGTextElement, any> | undefined;
|
13
|
-
export declare function renderTspansOnAxis(textSelection: d3.Selection<d3.BaseType, unknown, null, undefined>, { textArr, textSizePx, groupAxisPosition }: {
|
13
|
+
export declare function renderTspansOnAxis(textSelection: d3.Selection<d3.BaseType, unknown, null, undefined>, { textArr, textSizePx, groupAxisPosition, isContainerRotated }: {
|
14
14
|
textArr: string[];
|
15
15
|
textSizePx: number;
|
16
16
|
groupAxisPosition: 'top' | 'right' | 'bottom' | 'left';
|
17
|
+
isContainerRotated: boolean;
|
17
18
|
}): void;
|
18
19
|
export declare function renderTspansOnQuadrant(textSelection: d3.Selection<d3.BaseType, unknown, null, undefined>, { textArr, textSizePx, quadrant }: {
|
19
20
|
textArr: string[];
|
@@ -11,3 +11,4 @@ export declare function makeD3Arc({ axisWidth, innerRadius, outerRadius, padAngl
|
|
11
11
|
}): d3.Arc<any, d3.DefaultArcObject>;
|
12
12
|
export declare const parseTickFormatValue: (value: any, tickFormat: string | ((text: d3.NumberValue) => string | d3.NumberValue)) => string;
|
13
13
|
export declare const parseDateTickFormatValue: (value: any, tickFormat: string | ((text: d3.NumberValue) => string | d3.NumberValue)) => string;
|
14
|
+
export declare function isLightColor(color: string): boolean;
|
package/lib/core.ts
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@orbcharts/plugins-basic",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.1",
|
4
4
|
"description": "plugins for OrbCharts",
|
5
5
|
"author": "Blue Planet Inc.",
|
6
6
|
"license": "Apache-2.0",
|
@@ -35,9 +35,9 @@
|
|
35
35
|
"vite-plugin-dts": "^3.7.3"
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
|
-
"@orbcharts/core": "^3.0.
|
39
|
-
"@orbcharts/core-types": "^3.0.0
|
40
|
-
"@orbcharts/plugins-basic-types": "^3.0.0
|
38
|
+
"@orbcharts/core": "^3.0.1",
|
39
|
+
"@orbcharts/core-types": "^3.0.0",
|
40
|
+
"@orbcharts/plugins-basic-types": "^3.0.0",
|
41
41
|
"d3": "^7.8.5",
|
42
42
|
"rxjs": "^7.8.1"
|
43
43
|
}
|
package/src/base/BaseBars.ts
CHANGED
@@ -12,7 +12,7 @@ import type { BasePluginFn } from './types'
|
|
12
12
|
import type {
|
13
13
|
ComputedDatumGrid,
|
14
14
|
ComputedDataGrid,
|
15
|
-
|
15
|
+
ComputedAxesDataGrid,
|
16
16
|
DataFormatterTypeMap,
|
17
17
|
ContainerPositionScaled,
|
18
18
|
EventGrid,
|
@@ -35,9 +35,9 @@ import { gridSelectionsObservable } from '../grid/gridObservables'
|
|
35
35
|
interface BaseBarsContext {
|
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[]>>
|
@@ -59,7 +59,7 @@ interface BaseBarsContext {
|
|
59
59
|
interface RenderBarParams {
|
60
60
|
graphicGSelection: d3.Selection<SVGGElement, string, any, any>
|
61
61
|
rectClassName: string
|
62
|
-
|
62
|
+
visibleComputedAxesData: ComputedAxesDataGrid
|
63
63
|
zeroYArr: number[]
|
64
64
|
groupLabels: string[]
|
65
65
|
barScale: d3.ScalePoint<string>
|
@@ -124,7 +124,7 @@ function calctransitionItem (barGroupAmount: number, totalDuration: number) {
|
|
124
124
|
}
|
125
125
|
// let _data: ComputedDatumGrid[][] = []
|
126
126
|
|
127
|
-
function renderRectBars ({ graphicGSelection, rectClassName,
|
127
|
+
function renderRectBars ({ graphicGSelection, rectClassName, visibleComputedAxesData, zeroYArr, groupLabels, barScale, params, chartParams, barWidth, transformedBarRadius, delayGroup, transitionItem, isSeriesSeprate }: RenderBarParams) {
|
128
128
|
|
129
129
|
const barHalfWidth = barWidth! / 2
|
130
130
|
|
@@ -132,7 +132,7 @@ function renderRectBars ({ graphicGSelection, rectClassName, visibleComputedLayo
|
|
132
132
|
.each((seriesData, seriesIndex, g) => {
|
133
133
|
d3.select(g[seriesIndex])
|
134
134
|
.selectAll<SVGGElement, ComputedDatumGrid>(`rect.${rectClassName}`)
|
135
|
-
.data(
|
135
|
+
.data(visibleComputedAxesData[seriesIndex] ?? [], d => d.id)
|
136
136
|
.join(
|
137
137
|
enter => {
|
138
138
|
// console.log('enter')
|
@@ -274,9 +274,9 @@ function highlight ({ selection, ids, fullChartParams }: {
|
|
274
274
|
export const createBaseBars: BasePluginFn<BaseBarsContext> = (pluginName: string, {
|
275
275
|
selection,
|
276
276
|
computedData$,
|
277
|
-
|
277
|
+
computedAxesData$,
|
278
278
|
visibleComputedData$,
|
279
|
-
|
279
|
+
visibleComputedAxesData$,
|
280
280
|
seriesLabels$,
|
281
281
|
SeriesDataMap$,
|
282
282
|
GroupDataMap$,
|
@@ -413,7 +413,7 @@ export const createBaseBars: BasePluginFn<BaseBarsContext> = (pluginName: string
|
|
413
413
|
gridGraphicTransform$
|
414
414
|
})
|
415
415
|
|
416
|
-
const zeroYArr$ =
|
416
|
+
const zeroYArr$ = visibleComputedAxesData$.pipe(
|
417
417
|
takeUntil(destroy$),
|
418
418
|
map(data => {
|
419
419
|
return data.map(d => {
|
@@ -613,7 +613,7 @@ export const createBaseBars: BasePluginFn<BaseBarsContext> = (pluginName: string
|
|
613
613
|
|
614
614
|
const barSelection$ = combineLatest({
|
615
615
|
graphicGSelection: graphicGSelection$,
|
616
|
-
|
616
|
+
visibleComputedAxesData: visibleComputedAxesData$,
|
617
617
|
// barData$: barData$,
|
618
618
|
zeroYArr: zeroYArr$,
|
619
619
|
groupLabels: groupLabels$,
|
@@ -633,7 +633,7 @@ export const createBaseBars: BasePluginFn<BaseBarsContext> = (pluginName: string
|
|
633
633
|
return renderRectBars({
|
634
634
|
graphicGSelection: data.graphicGSelection,
|
635
635
|
rectClassName,
|
636
|
-
|
636
|
+
visibleComputedAxesData: data.visibleComputedAxesData,
|
637
637
|
zeroYArr: data.zeroYArr,
|
638
638
|
groupLabels: data.groupLabels,
|
639
639
|
barScale: data.barScale,
|
@@ -672,7 +672,7 @@ export const createBaseBars: BasePluginFn<BaseBarsContext> = (pluginName: string
|
|
672
672
|
series: data.SeriesDataMap.get(datum.seriesLabel)!,
|
673
673
|
seriesIndex: datum.seriesIndex,
|
674
674
|
seriesLabel: datum.seriesLabel,
|
675
|
-
|
675
|
+
group: data.GroupDataMap.get(datum.groupLabel)!,
|
676
676
|
groupIndex: datum.groupIndex,
|
677
677
|
groupLabel: datum.groupLabel,
|
678
678
|
event,
|
@@ -692,7 +692,7 @@ export const createBaseBars: BasePluginFn<BaseBarsContext> = (pluginName: string
|
|
692
692
|
series: data.SeriesDataMap.get(datum.seriesLabel)!,
|
693
693
|
seriesIndex: datum.seriesIndex,
|
694
694
|
seriesLabel: datum.seriesLabel,
|
695
|
-
|
695
|
+
group: data.GroupDataMap.get(datum.groupLabel)!,
|
696
696
|
groupIndex: datum.groupIndex,
|
697
697
|
groupLabel: datum.groupLabel,
|
698
698
|
event,
|
@@ -712,7 +712,7 @@ export const createBaseBars: BasePluginFn<BaseBarsContext> = (pluginName: string
|
|
712
712
|
series: data.SeriesDataMap.get(datum.seriesLabel)!,
|
713
713
|
seriesIndex: datum.seriesIndex,
|
714
714
|
seriesLabel: datum.seriesLabel,
|
715
|
-
|
715
|
+
group: data.GroupDataMap.get(datum.groupLabel)!,
|
716
716
|
groupIndex: datum.groupIndex,
|
717
717
|
groupLabel: datum.groupLabel,
|
718
718
|
event,
|
@@ -732,7 +732,7 @@ export const createBaseBars: BasePluginFn<BaseBarsContext> = (pluginName: string
|
|
732
732
|
series: data.SeriesDataMap.get(datum.seriesLabel)!,
|
733
733
|
seriesIndex: datum.seriesIndex,
|
734
734
|
seriesLabel: datum.seriesLabel,
|
735
|
-
|
735
|
+
group: data.GroupDataMap.get(datum.groupLabel)!,
|
736
736
|
groupIndex: datum.groupIndex,
|
737
737
|
groupLabel: datum.groupLabel,
|
738
738
|
event,
|
@@ -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,
|
@@ -585,7 +585,7 @@ export const createBaseBarsTriangle: BasePluginFn<BaseBarsContext> = (pluginName
|
|
585
585
|
series: data.SeriesDataMap.get(datum.seriesLabel)!,
|
586
586
|
seriesIndex: datum.seriesIndex,
|
587
587
|
seriesLabel: datum.seriesLabel,
|
588
|
-
|
588
|
+
group: data.GroupDataMap.get(datum.groupLabel)!,
|
589
589
|
groupIndex: datum.groupIndex,
|
590
590
|
groupLabel: datum.groupLabel,
|
591
591
|
event,
|
@@ -605,7 +605,7 @@ export const createBaseBarsTriangle: BasePluginFn<BaseBarsContext> = (pluginName
|
|
605
605
|
series: data.SeriesDataMap.get(datum.seriesLabel)!,
|
606
606
|
seriesIndex: datum.seriesIndex,
|
607
607
|
seriesLabel: datum.seriesLabel,
|
608
|
-
|
608
|
+
group: data.GroupDataMap.get(datum.groupLabel)!,
|
609
609
|
groupIndex: datum.groupIndex,
|
610
610
|
groupLabel: datum.groupLabel,
|
611
611
|
event,
|
@@ -625,7 +625,7 @@ export const createBaseBarsTriangle: BasePluginFn<BaseBarsContext> = (pluginName
|
|
625
625
|
series: data.SeriesDataMap.get(datum.seriesLabel)!,
|
626
626
|
seriesIndex: datum.seriesIndex,
|
627
627
|
seriesLabel: datum.seriesLabel,
|
628
|
-
|
628
|
+
group: data.GroupDataMap.get(datum.groupLabel)!,
|
629
629
|
groupIndex: datum.groupIndex,
|
630
630
|
groupLabel: datum.groupLabel,
|
631
631
|
event,
|
@@ -645,7 +645,7 @@ export const createBaseBarsTriangle: BasePluginFn<BaseBarsContext> = (pluginName
|
|
645
645
|
series: data.SeriesDataMap.get(datum.seriesLabel)!,
|
646
646
|
seriesIndex: datum.seriesIndex,
|
647
647
|
seriesLabel: datum.seriesLabel,
|
648
|
-
|
648
|
+
group: data.GroupDataMap.get(datum.groupLabel)!,
|
649
649
|
groupIndex: datum.groupIndex,
|
650
650
|
groupLabel: datum.groupLabel,
|
651
651
|
event,
|
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
|
@@ -355,7 +355,7 @@ export const createBaseDots: BasePluginFn<BaseDotsContext> = (pluginName: string
|
|
355
355
|
series: data.SeriesDataMap.get(datum.seriesLabel)!,
|
356
356
|
seriesIndex: datum.seriesIndex,
|
357
357
|
seriesLabel: datum.seriesLabel,
|
358
|
-
|
358
|
+
group: data.GroupDataMap.get(datum.groupLabel)!,
|
359
359
|
groupIndex: datum.groupIndex,
|
360
360
|
groupLabel: datum.groupLabel,
|
361
361
|
event,
|
@@ -376,7 +376,7 @@ export const createBaseDots: BasePluginFn<BaseDotsContext> = (pluginName: string
|
|
376
376
|
series: data.SeriesDataMap.get(datum.seriesLabel)!,
|
377
377
|
seriesIndex: datum.seriesIndex,
|
378
378
|
seriesLabel: datum.seriesLabel,
|
379
|
-
|
379
|
+
group: data.GroupDataMap.get(datum.groupLabel)!,
|
380
380
|
groupIndex: datum.groupIndex,
|
381
381
|
groupLabel: datum.groupLabel,
|
382
382
|
event
|
@@ -395,7 +395,7 @@ export const createBaseDots: BasePluginFn<BaseDotsContext> = (pluginName: string
|
|
395
395
|
series: data.SeriesDataMap.get(datum.seriesLabel)!,
|
396
396
|
seriesIndex: datum.seriesIndex,
|
397
397
|
seriesLabel: datum.seriesLabel,
|
398
|
-
|
398
|
+
group: data.GroupDataMap.get(datum.groupLabel)!,
|
399
399
|
groupIndex: datum.groupIndex,
|
400
400
|
groupLabel: datum.groupLabel,
|
401
401
|
event,
|
@@ -415,7 +415,7 @@ export const createBaseDots: BasePluginFn<BaseDotsContext> = (pluginName: string
|
|
415
415
|
series: data.SeriesDataMap.get(datum.seriesLabel)!,
|
416
416
|
seriesIndex: datum.seriesIndex,
|
417
417
|
seriesLabel: datum.seriesLabel,
|
418
|
-
|
418
|
+
group: data.GroupDataMap.get(datum.groupLabel)!,
|
419
419
|
groupIndex: datum.groupIndex,
|
420
420
|
groupLabel: datum.groupLabel,
|
421
421
|
event,
|
@@ -204,15 +204,23 @@ function renderAxis ({ selection, xAxisClassName, fullParams, tickTextAlign, gri
|
|
204
204
|
tickPadding = 0
|
205
205
|
textX = fullParams.tickPadding
|
206
206
|
} else if (fullDataFormatter.groupAxis.position === 'bottom') {
|
207
|
-
|
207
|
+
if (fullParams.tickFullLine == true) {
|
208
|
+
tickPadding = - fullParams.tickPadding
|
209
|
+
} else {
|
210
|
+
tickPadding = - fullParams.tickPadding - defaultTickSize
|
211
|
+
}
|
208
212
|
textX = 0
|
209
213
|
} else if (fullDataFormatter.groupAxis.position === 'top') {
|
210
|
-
|
214
|
+
if (fullParams.tickFullLine == true) {
|
215
|
+
tickPadding = fullParams.tickPadding
|
216
|
+
} else {
|
217
|
+
tickPadding = fullParams.tickPadding - defaultTickSize
|
218
|
+
}
|
211
219
|
textX = - 0
|
212
220
|
}
|
213
221
|
|
214
222
|
// 設定X軸刻度
|
215
|
-
const xAxis = d3.
|
223
|
+
const xAxis = d3.axisTop(groupScale)
|
216
224
|
.scale(groupScale)
|
217
225
|
.ticks(fullParams.ticks === 'all'
|
218
226
|
? allTicksAmount
|
@@ -220,8 +228,8 @@ function renderAxis ({ selection, xAxisClassName, fullParams, tickTextAlign, gri
|
|
220
228
|
? allTicksAmount // 不顯示超過groupLabels數量的刻度
|
221
229
|
: fullParams.ticks)
|
222
230
|
.tickSize(fullParams.tickFullLine == true
|
223
|
-
? gridAxesSize.height
|
224
|
-
:
|
231
|
+
? - gridAxesSize.height
|
232
|
+
: defaultTickSize)
|
225
233
|
.tickSizeOuter(0)
|
226
234
|
.tickFormat((groupIndex: number) => {
|
227
235
|
// 用index對應到groupLabel
|
@@ -234,7 +242,9 @@ function renderAxis ({ selection, xAxisClassName, fullParams, tickTextAlign, gri
|
|
234
242
|
const xAxisEl = xAxisSelection
|
235
243
|
.transition()
|
236
244
|
.duration(100)
|
245
|
+
.ease(d3.easeLinear) // 線性的 - 當托曳或快速變動的時候比較滑順
|
237
246
|
.call(xAxis)
|
247
|
+
|
238
248
|
.on('end', (self, t) => {
|
239
249
|
// 先等transition結束再處理文字,否則會被原本的文字覆蓋
|
240
250
|
xAxisSelection
|
@@ -248,7 +258,8 @@ function renderAxis ({ selection, xAxisClassName, fullParams, tickTextAlign, gri
|
|
248
258
|
renderTspansOnAxis(d3.select(n[i]), {
|
249
259
|
textArr,
|
250
260
|
textSizePx,
|
251
|
-
groupAxisPosition: fullDataFormatter.groupAxis.position
|
261
|
+
groupAxisPosition: fullDataFormatter.groupAxis.position,
|
262
|
+
isContainerRotated: true
|
252
263
|
})
|
253
264
|
})
|
254
265
|
})
|
@@ -257,6 +268,7 @@ function renderAxis ({ selection, xAxisClassName, fullParams, tickTextAlign, gri
|
|
257
268
|
.style('fill', 'none')
|
258
269
|
.style('stroke', fullParams.tickLineVisible == true ? getColor(fullParams.tickColorType, chartParams) : 'none')
|
259
270
|
.style('stroke-dasharray', fullParams.tickFullLineDasharray)
|
271
|
+
.style('vector-effect', 'non-scaling-stroke') // 避免 scale 導致線條變形
|
260
272
|
.attr('pointer-events', 'none')
|
261
273
|
|
262
274
|
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
|
})
|
@@ -507,7 +507,7 @@ export const createBaseLineAreas: BasePluginFn<BaseLineAreasContext> = (pluginNa
|
|
507
507
|
series: data.SeriesDataMap.get(_datum.seriesLabel)!,
|
508
508
|
seriesIndex: _datum.seriesIndex,
|
509
509
|
seriesLabel: _datum.seriesLabel,
|
510
|
-
|
510
|
+
group: data.GroupDataMap.get(_datum.groupLabel)!,
|
511
511
|
groupIndex: _datum.groupIndex,
|
512
512
|
groupLabel: _datum.groupLabel,
|
513
513
|
event,
|
@@ -533,7 +533,7 @@ export const createBaseLineAreas: BasePluginFn<BaseLineAreasContext> = (pluginNa
|
|
533
533
|
series: data.SeriesDataMap.get(_datum.seriesLabel)!,
|
534
534
|
seriesIndex: _datum.seriesIndex,
|
535
535
|
seriesLabel: _datum.seriesLabel,
|
536
|
-
|
536
|
+
group: data.GroupDataMap.get(_datum.groupLabel)!,
|
537
537
|
groupIndex: _datum.groupIndex,
|
538
538
|
groupLabel: _datum.groupLabel,
|
539
539
|
event,
|
@@ -559,7 +559,7 @@ export const createBaseLineAreas: BasePluginFn<BaseLineAreasContext> = (pluginNa
|
|
559
559
|
series: data.SeriesDataMap.get(_datum.seriesLabel)!,
|
560
560
|
seriesIndex: _datum.seriesIndex,
|
561
561
|
seriesLabel: _datum.seriesLabel,
|
562
|
-
|
562
|
+
group: data.GroupDataMap.get(_datum.groupLabel)!,
|
563
563
|
groupIndex: _datum.groupIndex,
|
564
564
|
groupLabel: _datum.groupLabel,
|
565
565
|
event,
|
@@ -585,7 +585,7 @@ export const createBaseLineAreas: BasePluginFn<BaseLineAreasContext> = (pluginNa
|
|
585
585
|
series: data.SeriesDataMap.get(_datum.seriesLabel)!,
|
586
586
|
seriesIndex: _datum.seriesIndex,
|
587
587
|
seriesLabel: _datum.seriesLabel,
|
588
|
-
|
588
|
+
group: data.GroupDataMap.get(_datum.groupLabel)!,
|
589
589
|
groupIndex: _datum.groupIndex,
|
590
590
|
groupLabel: _datum.groupLabel,
|
591
591
|
event,
|