@orbcharts/core 3.0.0-beta.8 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +200 -200
- package/dist/orbcharts-core.es.js +2734 -2353
- package/dist/orbcharts-core.umd.js +4 -4
- package/dist/src/defaults.d.ts +2 -1
- package/dist/src/utils/gridObservables.d.ts +8 -4
- package/dist/src/utils/index.d.ts +0 -3
- package/dist/src/utils/multiGridObservables.d.ts +3 -2
- package/dist/src/utils/multiValueObservables.d.ts +76 -29
- package/dist/src/utils/observables.d.ts +8 -1
- package/dist/src/utils/orbchartsUtils.d.ts +9 -9
- package/dist/src/utils/seriesObservables.d.ts +1 -1
- package/lib/core-types.ts +7 -7
- package/package.json +42 -42
- package/src/AbstractChart.ts +57 -57
- package/src/GridChart.ts +24 -24
- package/src/MultiGridChart.ts +24 -24
- package/src/MultiValueChart.ts +24 -24
- package/src/RelationshipChart.ts +24 -24
- package/src/SeriesChart.ts +24 -24
- package/src/TreeChart.ts +24 -24
- package/src/base/createBaseChart.ts +506 -505
- package/src/base/createBasePlugin.ts +154 -153
- package/src/base/validators/chartOptionsValidator.ts +23 -23
- package/src/base/validators/chartParamsValidator.ts +133 -133
- package/src/base/validators/elementValidator.ts +13 -13
- package/src/base/validators/pluginsValidator.ts +14 -14
- package/src/defaults.ts +282 -238
- package/src/defineGridPlugin.ts +3 -3
- package/src/defineMultiGridPlugin.ts +3 -3
- package/src/defineMultiValuePlugin.ts +3 -3
- package/src/defineNoneDataPlugin.ts +4 -4
- package/src/defineRelationshipPlugin.ts +3 -3
- package/src/defineSeriesPlugin.ts +3 -3
- package/src/defineTreePlugin.ts +3 -3
- package/src/grid/computedDataFn.ts +129 -129
- package/src/grid/contextObserverCallback.ts +198 -176
- package/src/grid/dataFormatterValidator.ts +120 -101
- package/src/grid/dataValidator.ts +12 -12
- package/src/index.ts +20 -20
- package/src/multiGrid/computedDataFn.ts +123 -123
- package/src/multiGrid/contextObserverCallback.ts +72 -41
- package/src/multiGrid/dataFormatterValidator.ts +115 -115
- package/src/multiGrid/dataValidator.ts +12 -12
- package/src/multiValue/computedDataFn.ts +113 -110
- package/src/multiValue/contextObserverCallback.ts +276 -160
- package/src/multiValue/dataFormatterValidator.ts +89 -9
- package/src/multiValue/dataValidator.ts +12 -9
- package/src/relationship/computedDataFn.ts +159 -144
- package/src/relationship/contextObserverCallback.ts +80 -80
- package/src/relationship/dataFormatterValidator.ts +13 -9
- package/src/relationship/dataValidator.ts +13 -9
- package/src/series/computedDataFn.ts +88 -88
- package/src/series/contextObserverCallback.ts +107 -100
- package/src/series/dataFormatterValidator.ts +41 -41
- package/src/series/dataValidator.ts +12 -12
- package/src/tree/computedDataFn.ts +129 -129
- package/src/tree/contextObserverCallback.ts +58 -58
- package/src/tree/dataFormatterValidator.ts +13 -13
- package/src/tree/dataValidator.ts +13 -13
- package/src/utils/commonUtils.ts +55 -55
- package/src/utils/d3Scale.ts +198 -198
- package/src/utils/errorMessage.ts +42 -42
- package/src/utils/gridObservables.ts +705 -683
- package/src/utils/index.ts +10 -10
- package/src/utils/multiGridObservables.ts +401 -392
- package/src/utils/multiValueObservables.ts +1044 -662
- package/src/utils/observables.ts +281 -219
- package/src/utils/orbchartsUtils.ts +377 -377
- package/src/utils/relationshipObservables.ts +84 -84
- package/src/utils/seriesObservables.ts +175 -175
- package/src/utils/treeObservables.ts +105 -105
- package/src/utils/validator.ts +126 -126
- package/tsconfig.base.json +13 -13
- package/tsconfig.json +2 -2
- package/vite-env.d.ts +6 -6
- package/vite.config.js +22 -22
package/dist/src/defaults.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ChartOptionsPartial, DataSeries, DataGrid, DataMultiGrid, DataMultiValue, DataTree, DataRelationship, DataFormatterValueAxis, DataFormatterGroupAxis, DataFormatterContainer, DataFormatterSeries, DataFormatterGrid, DataFormatterGridGrid, DataFormatterMultiGrid, DataFormatterMultiGridGrid, DataFormatterMultiValue, DataFormatterTree, DataFormatterRelationship, ChartParams, Padding } from '../lib/core-types';
|
1
|
+
import { ChartOptionsPartial, DataSeries, DataGrid, DataMultiGrid, DataMultiValue, DataTree, DataRelationship, DataFormatterValueAxis, DataFormatterGroupAxis, DataFormatterXYAxis, DataFormatterContainer, DataFormatterSeries, DataFormatterGrid, DataFormatterGridGrid, DataFormatterMultiGrid, DataFormatterMultiGridGrid, DataFormatterMultiValue, DataFormatterTree, DataFormatterRelationship, ChartParams, Padding } from '../lib/core-types';
|
2
2
|
|
3
3
|
export declare const DEFAULT_CHART_OPTIONS: ChartOptionsPartial<any>;
|
4
4
|
export declare const DEFAULT_PADDING: Padding;
|
@@ -13,6 +13,7 @@ export declare const DEFAULT_DATA_TREE: DataTree;
|
|
13
13
|
export declare const DEFAULTL_DATA_RELATIONA: DataRelationship;
|
14
14
|
export declare const DEFAULT_DATA_FORMATTER_VALUE_AXIS: DataFormatterValueAxis;
|
15
15
|
export declare const DEFAULT_DATA_FORMATTER_GROUP_AXIS: DataFormatterGroupAxis;
|
16
|
+
export declare const DEFAULT_DATA_FORMATTER_X_Y_AXIS: DataFormatterXYAxis;
|
16
17
|
export declare const DEFAULT_DATA_FORMATTER_CONTAINER: DataFormatterContainer;
|
17
18
|
export declare const DEFAULT_DATA_FORMATTER_SERIES: DataFormatterSeries;
|
18
19
|
export declare const DEFAULT_DATA_FORMATTER_GRID_GRID: DataFormatterGridGrid;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Observable } from 'rxjs';
|
2
|
-
import { ComputedDataTypeMap, ComputedDataGrid, ComputedDatumGrid, DataFormatterTypeMap, DataFormatterGrid, ComputedLayoutDatumGrid,
|
2
|
+
import { ComputedDataTypeMap, ComputedDataGrid, ContainerSize, ComputedDatumGrid, DataFormatterTypeMap, DataFormatterGrid, ComputedLayoutDatumGrid, ComputedAxesDataGrid, ContainerPositionScaled, Layout, TransformData } from '../../lib/core-types';
|
3
3
|
|
4
|
-
export declare const
|
4
|
+
export declare const gridComputedAxesDataObservable: ({ computedData$, fullDataFormatter$, layout$ }: {
|
5
5
|
computedData$: Observable<ComputedDataTypeMap<"grid">>;
|
6
6
|
fullDataFormatter$: Observable<DataFormatterTypeMap<"grid">>;
|
7
7
|
layout$: Observable<Layout>;
|
@@ -13,14 +13,18 @@ export declare const gridAxesSizeObservable: ({ fullDataFormatter$, layout$ }: {
|
|
13
13
|
width: number;
|
14
14
|
height: number;
|
15
15
|
}>;
|
16
|
+
export declare const gridAxesContainerSizeObservable: ({ fullDataFormatter$, containerSize$ }: {
|
17
|
+
containerSize$: Observable<ContainerSize>;
|
18
|
+
fullDataFormatter$: Observable<DataFormatterTypeMap<"grid">>;
|
19
|
+
}) => Observable<ContainerSize>;
|
16
20
|
export declare const gridSeriesLabelsObservable: ({ computedData$ }: {
|
17
21
|
computedData$: Observable<ComputedDataTypeMap<"grid">>;
|
18
22
|
}) => Observable<string[]>;
|
19
23
|
export declare const gridVisibleComputedDataObservable: ({ computedData$ }: {
|
20
24
|
computedData$: Observable<ComputedDataTypeMap<"grid">>;
|
21
25
|
}) => Observable<ComputedDatumGrid[][]>;
|
22
|
-
export declare const
|
23
|
-
|
26
|
+
export declare const gridVisibleComputedAxesDataObservable: ({ computedAxesData$ }: {
|
27
|
+
computedAxesData$: Observable<ComputedAxesDataGrid>;
|
24
28
|
}) => Observable<ComputedLayoutDatumGrid[][]>;
|
25
29
|
export declare const gridContainerPositionObservable: ({ computedData$, fullDataFormatter$, layout$ }: {
|
26
30
|
computedData$: Observable<ComputedDataTypeMap<"grid">>;
|
@@ -1,8 +1,5 @@
|
|
1
1
|
export * from './commonUtils';
|
2
2
|
export * from './d3Scale';
|
3
3
|
export * from './gridObservables';
|
4
|
-
export * from './multiGridObservables';
|
5
4
|
export * from './observables';
|
6
5
|
export * from './orbchartsUtils';
|
7
|
-
export * from './seriesObservables';
|
8
|
-
export * from './treeObservables';
|
@@ -1,12 +1,13 @@
|
|
1
1
|
import { Subject, Observable } from 'rxjs';
|
2
|
-
import { ChartParams, ComputedDataTypeMap, ContextObserverMultiGridDetail, DataFormatterTypeMap, EventMultiGrid, ContainerPositionScaled, Layout } from '../../lib/core-types';
|
2
|
+
import { ChartParams, ComputedDataTypeMap, ContextObserverMultiGridDetail, ContainerSize, DataFormatterTypeMap, EventMultiGrid, ContainerPositionScaled, Layout } from '../../lib/core-types';
|
3
3
|
|
4
|
-
export declare const multiGridEachDetailObservable: ({ fullDataFormatter$, computedData$, layout$, fullChartParams$, event$ }: {
|
4
|
+
export declare const multiGridEachDetailObservable: ({ fullDataFormatter$, computedData$, layout$, fullChartParams$, event$, containerSize$ }: {
|
5
5
|
fullDataFormatter$: Observable<DataFormatterTypeMap<"multiGrid">>;
|
6
6
|
computedData$: Observable<ComputedDataTypeMap<"multiGrid">>;
|
7
7
|
layout$: Observable<Layout>;
|
8
8
|
fullChartParams$: Observable<ChartParams>;
|
9
9
|
event$: Subject<EventMultiGrid>;
|
10
|
+
containerSize$: Observable<ContainerSize>;
|
10
11
|
}) => Observable<ContextObserverMultiGridDetail[]>;
|
11
12
|
export declare const multiGridContainerObservable: ({ computedData$, fullDataFormatter$, layout$ }: {
|
12
13
|
computedData$: Observable<ComputedDataTypeMap<"multiGrid">>;
|
@@ -1,73 +1,120 @@
|
|
1
1
|
import { Observable } from 'rxjs';
|
2
|
-
import { ComputedDataTypeMap, ComputedDatumMultiValue, DataFormatterTypeMap,
|
2
|
+
import { ComputedDataTypeMap, ComputedDataMultiValue, ComputedDatumMultiValue, ComputedDatumWithSumMultiValue, ContainerSize, DataFormatterTypeMap, DataFormatterMultiValue, ComputedXYDatumMultiValue, ComputedXYDataMultiValue, ContainerPositionScaled, Layout, TransformData } from '../../lib/core-types';
|
3
3
|
|
4
|
-
export declare const
|
4
|
+
export declare const xyMinMaxObservable: ({ computedData$, xyValueIndex$ }: {
|
5
5
|
computedData$: Observable<ComputedDataTypeMap<"multiValue">>;
|
6
|
+
xyValueIndex$: Observable<[number, number]>;
|
6
7
|
}) => Observable<{
|
7
8
|
minX: number;
|
8
9
|
maxX: number;
|
9
10
|
minY: number;
|
10
11
|
maxY: number;
|
11
12
|
}>;
|
12
|
-
export declare const
|
13
|
+
export declare const computedXYDataObservable: ({ computedData$, xyMinMax$, xyValueIndex$, fullDataFormatter$, layout$ }: {
|
13
14
|
computedData$: Observable<ComputedDataTypeMap<"multiValue">>;
|
14
|
-
|
15
|
+
xyMinMax$: Observable<{
|
15
16
|
minX: number;
|
16
17
|
maxX: number;
|
17
18
|
minY: number;
|
18
19
|
maxY: number;
|
19
20
|
}>;
|
21
|
+
xyValueIndex$: Observable<[number, number]>;
|
20
22
|
fullDataFormatter$: Observable<DataFormatterTypeMap<"multiValue">>;
|
21
23
|
layout$: Observable<Layout>;
|
22
|
-
}) => Observable<
|
23
|
-
export declare const
|
24
|
+
}) => Observable<ComputedXYDataMultiValue>;
|
25
|
+
export declare const categoryLabelsObservable: ({ computedData$, fullDataFormatter$ }: {
|
24
26
|
computedData$: Observable<ComputedDataTypeMap<"multiValue">>;
|
25
27
|
fullDataFormatter$: Observable<DataFormatterTypeMap<"multiValue">>;
|
26
28
|
}) => Observable<string[]>;
|
27
|
-
export declare const
|
29
|
+
export declare const visibleComputedDataObservable: ({ computedData$ }: {
|
28
30
|
computedData$: Observable<ComputedDataTypeMap<"multiValue">>;
|
29
31
|
}) => Observable<ComputedDatumMultiValue[][]>;
|
30
|
-
export declare const
|
31
|
-
|
32
|
-
}) => Observable<
|
33
|
-
export declare const
|
32
|
+
export declare const visibleComputedSumDataObservable: ({ visibleComputedData$ }: {
|
33
|
+
visibleComputedData$: Observable<ComputedDataMultiValue>;
|
34
|
+
}) => Observable<ComputedDatumWithSumMultiValue[][]>;
|
35
|
+
export declare const visibleComputedRankingByIndexDataObservable: ({ xyValueIndex$, isCategorySeprate$, visibleComputedData$ }: {
|
36
|
+
xyValueIndex$: Observable<[number, number]>;
|
37
|
+
isCategorySeprate$: Observable<boolean>;
|
38
|
+
visibleComputedData$: Observable<ComputedDatumMultiValue[][]>;
|
39
|
+
}) => Observable<ComputedDatumMultiValue[][]>;
|
40
|
+
export declare const visibleComputedRankingBySumDataObservable: ({ isCategorySeprate$, visibleComputedSumData$ }: {
|
41
|
+
isCategorySeprate$: Observable<boolean>;
|
42
|
+
visibleComputedSumData$: Observable<ComputedDatumWithSumMultiValue[][]>;
|
43
|
+
}) => Observable<ComputedDatumWithSumMultiValue[][]>;
|
44
|
+
export declare const visibleComputedXYDataObservable: ({ computedXYData$ }: {
|
45
|
+
computedXYData$: Observable<ComputedXYDataMultiValue>;
|
46
|
+
}) => Observable<ComputedXYDatumMultiValue[][]>;
|
47
|
+
export declare const containerPositionObservable: ({ computedData$, fullDataFormatter$, layout$ }: {
|
34
48
|
computedData$: Observable<ComputedDataTypeMap<"multiValue">>;
|
35
49
|
fullDataFormatter$: Observable<DataFormatterTypeMap<"multiValue">>;
|
36
50
|
layout$: Observable<Layout>;
|
37
51
|
}) => Observable<ContainerPositionScaled[]>;
|
38
|
-
export declare const
|
39
|
-
|
40
|
-
|
52
|
+
export declare const filteredXYMinMaxDataObservable: ({ visibleComputedXYData$, xyMinMax$, xyValueIndex$, fullDataFormatter$ }: {
|
53
|
+
visibleComputedXYData$: Observable<ComputedXYDataMultiValue>;
|
54
|
+
xyMinMax$: Observable<{
|
41
55
|
minX: number;
|
42
56
|
maxX: number;
|
43
57
|
minY: number;
|
44
58
|
maxY: number;
|
45
59
|
}>;
|
60
|
+
xyValueIndex$: Observable<[number, number]>;
|
46
61
|
fullDataFormatter$: Observable<DataFormatterTypeMap<"multiValue">>;
|
47
62
|
}) => Observable<{
|
48
|
-
datumList:
|
49
|
-
minXDatum:
|
50
|
-
maxXDatum:
|
51
|
-
minYDatum:
|
52
|
-
maxYDatum:
|
63
|
+
datumList: ComputedXYDatumMultiValue[];
|
64
|
+
minXDatum: ComputedXYDatumMultiValue;
|
65
|
+
maxXDatum: ComputedXYDatumMultiValue;
|
66
|
+
minYDatum: ComputedXYDatumMultiValue;
|
67
|
+
maxYDatum: ComputedXYDatumMultiValue;
|
53
68
|
}>;
|
54
|
-
export declare const
|
55
|
-
|
69
|
+
export declare const graphicTransformObservable: ({ xyMinMax$, xyValueIndex$, filteredXYMinMaxData$, fullDataFormatter$, layout$ }: {
|
70
|
+
xyMinMax$: Observable<{
|
56
71
|
minX: number;
|
57
72
|
maxX: number;
|
58
73
|
minY: number;
|
59
74
|
maxY: number;
|
60
75
|
}>;
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
76
|
+
xyValueIndex$: Observable<[number, number]>;
|
77
|
+
filteredXYMinMaxData$: Observable<{
|
78
|
+
minXDatum: ComputedXYDatumMultiValue;
|
79
|
+
maxXDatum: ComputedXYDatumMultiValue;
|
80
|
+
minYDatum: ComputedXYDatumMultiValue;
|
81
|
+
maxYDatum: ComputedXYDatumMultiValue;
|
66
82
|
}>;
|
67
83
|
fullDataFormatter$: Observable<DataFormatterTypeMap<"multiValue">>;
|
68
84
|
layout$: Observable<Layout>;
|
69
85
|
}) => Observable<TransformData>;
|
70
|
-
export declare const
|
71
|
-
|
72
|
-
|
86
|
+
export declare const graphicReverseScaleObservable: ({ containerPosition$, graphicTransform$ }: {
|
87
|
+
containerPosition$: Observable<ContainerPositionScaled[]>;
|
88
|
+
graphicTransform$: Observable<TransformData>;
|
73
89
|
}) => Observable<[number, number][]>;
|
90
|
+
export declare const xScaleObservable: ({ visibleComputedSumData$, fullDataFormatter$, filteredXYMinMaxData$, containerSize$ }: {
|
91
|
+
visibleComputedSumData$: Observable<ComputedDatumMultiValue[][]>;
|
92
|
+
fullDataFormatter$: Observable<DataFormatterMultiValue>;
|
93
|
+
filteredXYMinMaxData$: Observable<{
|
94
|
+
minXDatum: ComputedXYDatumMultiValue;
|
95
|
+
maxXDatum: ComputedXYDatumMultiValue;
|
96
|
+
minYDatum: ComputedXYDatumMultiValue;
|
97
|
+
maxYDatum: ComputedXYDatumMultiValue;
|
98
|
+
}>;
|
99
|
+
containerSize$: Observable<ContainerSize>;
|
100
|
+
}) => Observable<import('d3-scale').ScaleLinear<number, number, never>>;
|
101
|
+
export declare const xSumScaleObservable: ({ fullDataFormatter$, filteredXYMinMaxData$, containerSize$ }: {
|
102
|
+
fullDataFormatter$: Observable<DataFormatterMultiValue>;
|
103
|
+
filteredXYMinMaxData$: Observable<{
|
104
|
+
minXDatum: ComputedXYDatumMultiValue;
|
105
|
+
maxXDatum: ComputedXYDatumMultiValue;
|
106
|
+
minYDatum: ComputedXYDatumMultiValue;
|
107
|
+
maxYDatum: ComputedXYDatumMultiValue;
|
108
|
+
}>;
|
109
|
+
containerSize$: Observable<ContainerSize>;
|
110
|
+
}) => Observable<import('d3-scale').ScaleLinear<number, number, never>>;
|
111
|
+
export declare const yScaleObservable: ({ fullDataFormatter$, filteredXYMinMaxData$, containerSize$ }: {
|
112
|
+
fullDataFormatter$: Observable<DataFormatterMultiValue>;
|
113
|
+
filteredXYMinMaxData$: Observable<{
|
114
|
+
minXDatum: ComputedXYDatumMultiValue;
|
115
|
+
maxXDatum: ComputedXYDatumMultiValue;
|
116
|
+
minYDatum: ComputedXYDatumMultiValue;
|
117
|
+
maxYDatum: ComputedXYDatumMultiValue;
|
118
|
+
}>;
|
119
|
+
containerSize$: Observable<ContainerSize>;
|
120
|
+
}) => Observable<import('d3-scale').ScaleLinear<number, number, never>>;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Subject, Observable } from 'rxjs';
|
2
|
-
import { ChartType, ChartParams, ComputedDatumTypeMap, EventTypeMap } from '../../lib/core-types';
|
2
|
+
import { ChartType, ChartParams, ComputedDatumTypeMap, ContainerPositionScaled, EventTypeMap, Layout } from '../../lib/core-types';
|
3
3
|
|
4
4
|
export declare function resizeObservable(elem: HTMLElement | Element): Observable<DOMRectReadOnly>;
|
5
5
|
export declare const highlightObservable: <T extends ChartType, D>({ datumList$, fullChartParams$, event$ }: {
|
@@ -17,3 +17,10 @@ export declare const categoryDataMapObservable: <DatumType extends ComputedDatum
|
|
17
17
|
datumList$: Observable<DatumType[]>;
|
18
18
|
}) => Observable<Map<string, DatumType[]>>;
|
19
19
|
export declare const textSizePxObservable: (chartParams$: Observable<ChartParams>) => Observable<number>;
|
20
|
+
export declare const containerSizeObservable: ({ layout$, containerPosition$ }: {
|
21
|
+
layout$: Observable<Layout>;
|
22
|
+
containerPosition$: Observable<ContainerPositionScaled[]>;
|
23
|
+
}) => Observable<{
|
24
|
+
width: number;
|
25
|
+
height: number;
|
26
|
+
}>;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ChartType, ChartParams, DatumValue, DataSeries, DataGrid, DataGridDatum, DataMultiGrid, DataMultiValue,
|
1
|
+
import { ChartType, ChartParams, DatumValue, DataSeries, DataGrid, DataGridDatum, DataMultiGrid, DataMultiValue, ComputedXYDatumMultiValue, DataFormatterContainer, SeriesDirection, DataFormatterGridGrid, ContainerPosition, ContainerPositionScaled, Layout } from '../../lib/core-types';
|
2
2
|
import * as d3 from 'd3';
|
3
3
|
export declare function formatValueToLabel(value: any, valueFormatter: string | ((text: d3.NumberValue) => string)): string;
|
4
4
|
export declare function createDefaultDatumId(chartTypeOrPrefix: string, levelOneIndex: number, levelTwoIndex?: number, levelThreeIndex?: number): string;
|
@@ -34,19 +34,19 @@ export declare function getMinMaxGrid(data: DataGrid): [number, number];
|
|
34
34
|
export declare function getMinMaxMultiGrid(data: DataMultiGrid): [number, number];
|
35
35
|
export declare function getMinMaxMultiValue(data: DataMultiValue, valueIndex: number): [number, number];
|
36
36
|
export declare function getMinMaxMultiValueXY({ data, minX, maxX, minY, maxY }: {
|
37
|
-
data:
|
37
|
+
data: ComputedXYDatumMultiValue[][];
|
38
38
|
minX: number;
|
39
39
|
maxX: number;
|
40
40
|
minY: number;
|
41
41
|
maxY: number;
|
42
42
|
}): {
|
43
|
-
minXDatum:
|
44
|
-
maxXDatum:
|
45
|
-
minYDatum:
|
46
|
-
maxYDatum:
|
47
|
-
filteredData:
|
43
|
+
minXDatum: ComputedXYDatumMultiValue;
|
44
|
+
maxXDatum: ComputedXYDatumMultiValue;
|
45
|
+
minYDatum: ComputedXYDatumMultiValue;
|
46
|
+
maxYDatum: ComputedXYDatumMultiValue;
|
47
|
+
filteredData: ComputedXYDatumMultiValue[][];
|
48
48
|
};
|
49
49
|
export declare function transposeData<T>(seriesDirection: SeriesDirection, data: T[][]): T[][];
|
50
50
|
export declare function seriesColorPredicate(seriesIndex: number, chartParams: ChartParams): string;
|
51
|
-
export declare function
|
52
|
-
export declare function
|
51
|
+
export declare function calcContainerPosition(layout: Layout, container: DataFormatterContainer, amount: number): ContainerPosition[];
|
52
|
+
export declare function calcContainerPositionScaled(layout: Layout, container: DataFormatterContainer, amount: number): ContainerPositionScaled[];
|
@@ -10,7 +10,7 @@ export declare const seriesLabelsObservable: ({ computedData$ }: {
|
|
10
10
|
export declare const seriesVisibleComputedDataObservable: ({ computedData$ }: {
|
11
11
|
computedData$: Observable<ComputedDataTypeMap<"series">>;
|
12
12
|
}) => Observable<ComputedDatumSeries[][]>;
|
13
|
-
export declare const
|
13
|
+
export declare const seriesComputedSortedDataObservable: ({ computedData$, fullDataFormatter$ }: {
|
14
14
|
computedData$: Observable<ComputedDataTypeMap<"series">>;
|
15
15
|
fullDataFormatter$: Observable<DataFormatterTypeMap<"series">>;
|
16
16
|
}) => Observable<ComputedDatumSeries[][]>;
|
package/lib/core-types.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export * from '@orbcharts/core-types'
|
4
|
-
|
5
|
-
// test
|
6
|
-
// export * from '../../orbcharts-core-types/src'
|
7
|
-
|
1
|
+
|
2
|
+
|
3
|
+
export * from '@orbcharts/core-types'
|
4
|
+
|
5
|
+
// test
|
6
|
+
// export * from '../../orbcharts-core-types/src'
|
7
|
+
|
package/package.json
CHANGED
@@ -1,42 +1,42 @@
|
|
1
|
-
{
|
2
|
-
"name": "@orbcharts/core",
|
3
|
-
"version": "3.0.0
|
4
|
-
"description": "OrbCharts is an open source chart library based on d3.js and rx.js",
|
5
|
-
"author": "Blue Planet Inc.",
|
6
|
-
"license": "Apache-2.0",
|
7
|
-
"keywords": [
|
8
|
-
"d3",
|
9
|
-
"rxjs",
|
10
|
-
"svg",
|
11
|
-
"visualization",
|
12
|
-
"infographic",
|
13
|
-
"graph",
|
14
|
-
"chart"
|
15
|
-
],
|
16
|
-
"private": false,
|
17
|
-
"publishConfig": {
|
18
|
-
"access": "public",
|
19
|
-
"registry": "https://registry.npmjs.org/"
|
20
|
-
},
|
21
|
-
"files": [
|
22
|
-
"*"
|
23
|
-
],
|
24
|
-
"module": "./dist/orbcharts-core.es.js",
|
25
|
-
"types": "./dist/src/index.d.ts",
|
26
|
-
"scripts": {
|
27
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
28
|
-
"build": "vite build --mode production"
|
29
|
-
},
|
30
|
-
"devDependencies": {
|
31
|
-
"@types/d3": "^7.4.0",
|
32
|
-
"ts-loader": "^9.4.2",
|
33
|
-
"typescript": "^5.0.4",
|
34
|
-
"vite": "^5.3.5",
|
35
|
-
"vite-plugin-dts": "^3.7.3"
|
36
|
-
},
|
37
|
-
"dependencies": {
|
38
|
-
"@orbcharts/core-types": "^3.0.0
|
39
|
-
"d3": "^7.8.5",
|
40
|
-
"rxjs": "^7.8.1"
|
41
|
-
}
|
42
|
-
}
|
1
|
+
{
|
2
|
+
"name": "@orbcharts/core",
|
3
|
+
"version": "3.0.0",
|
4
|
+
"description": "OrbCharts is an open source chart library based on d3.js and rx.js",
|
5
|
+
"author": "Blue Planet Inc.",
|
6
|
+
"license": "Apache-2.0",
|
7
|
+
"keywords": [
|
8
|
+
"d3",
|
9
|
+
"rxjs",
|
10
|
+
"svg",
|
11
|
+
"visualization",
|
12
|
+
"infographic",
|
13
|
+
"graph",
|
14
|
+
"chart"
|
15
|
+
],
|
16
|
+
"private": false,
|
17
|
+
"publishConfig": {
|
18
|
+
"access": "public",
|
19
|
+
"registry": "https://registry.npmjs.org/"
|
20
|
+
},
|
21
|
+
"files": [
|
22
|
+
"*"
|
23
|
+
],
|
24
|
+
"module": "./dist/orbcharts-core.es.js",
|
25
|
+
"types": "./dist/src/index.d.ts",
|
26
|
+
"scripts": {
|
27
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
28
|
+
"build": "vite build --mode production"
|
29
|
+
},
|
30
|
+
"devDependencies": {
|
31
|
+
"@types/d3": "^7.4.0",
|
32
|
+
"ts-loader": "^9.4.2",
|
33
|
+
"typescript": "^5.0.4",
|
34
|
+
"vite": "^5.3.5",
|
35
|
+
"vite-plugin-dts": "^3.7.3"
|
36
|
+
},
|
37
|
+
"dependencies": {
|
38
|
+
"@orbcharts/core-types": "^3.0.0",
|
39
|
+
"d3": "^7.8.5",
|
40
|
+
"rxjs": "^7.8.1"
|
41
|
+
}
|
42
|
+
}
|
package/src/AbstractChart.ts
CHANGED
@@ -1,57 +1,57 @@
|
|
1
|
-
import * as d3 from 'd3'
|
2
|
-
import {
|
3
|
-
Subject } from 'rxjs'
|
4
|
-
import type {
|
5
|
-
ComputedDataFn,
|
6
|
-
DataValidator,
|
7
|
-
ChartEntity,
|
8
|
-
ChartType,
|
9
|
-
ChartParamsPartial,
|
10
|
-
ContextObserverCallback,
|
11
|
-
ChartOptionsPartial,
|
12
|
-
DataTypeMap,
|
13
|
-
DataFormatterTypeMap,
|
14
|
-
DataFormatterPartialTypeMap,
|
15
|
-
DataFormatterValidator,
|
16
|
-
EventTypeMap,
|
17
|
-
PluginEntity } from '../lib/core-types'
|
18
|
-
import { createBaseChart } from './base/createBaseChart'
|
19
|
-
import { createOrbChartsErrorMessage } from './utils/errorMessage'
|
20
|
-
|
21
|
-
export abstract class AbstractChart<T extends ChartType> implements ChartEntity<T> {
|
22
|
-
selection: d3.Selection<SVGGElement, unknown, HTMLElement, unknown>
|
23
|
-
destroy: () => void
|
24
|
-
data$: Subject<DataTypeMap<T>> = new Subject()
|
25
|
-
dataFormatter$: Subject<DataFormatterPartialTypeMap<T>> = new Subject()
|
26
|
-
plugins$: Subject<PluginEntity<T, any, any>[]> = new Subject()
|
27
|
-
chartParams$: Subject<ChartParamsPartial> = new Subject()
|
28
|
-
event$: Subject<EventTypeMap<T>> = new Subject()
|
29
|
-
|
30
|
-
constructor (
|
31
|
-
{ defaultDataFormatter, dataFormatterValidator, computedDataFn, dataValidator, contextObserverCallback }: {
|
32
|
-
defaultDataFormatter: DataFormatterTypeMap<T>
|
33
|
-
dataFormatterValidator: DataFormatterValidator<T>
|
34
|
-
computedDataFn: ComputedDataFn<T>
|
35
|
-
dataValidator: DataValidator<T>
|
36
|
-
contextObserverCallback: ContextObserverCallback<T>
|
37
|
-
},
|
38
|
-
element: HTMLElement | Element,
|
39
|
-
options?: ChartOptionsPartial<T>
|
40
|
-
) {
|
41
|
-
try {
|
42
|
-
const baseChart = createBaseChart({ defaultDataFormatter, dataFormatterValidator, computedDataFn, dataValidator, contextObserverCallback })
|
43
|
-
const chartEntity = baseChart(element, options)
|
44
|
-
|
45
|
-
this.selection = chartEntity.selection
|
46
|
-
this.destroy = chartEntity.destroy
|
47
|
-
this.data$ = chartEntity.data$
|
48
|
-
this.dataFormatter$ = chartEntity.dataFormatter$
|
49
|
-
this.plugins$ = chartEntity.plugins$
|
50
|
-
this.chartParams$ = chartEntity.chartParams$
|
51
|
-
this.event$ = chartEntity.event$
|
52
|
-
} catch (e) {
|
53
|
-
console.error(createOrbChartsErrorMessage(e))
|
54
|
-
}
|
55
|
-
}
|
56
|
-
|
57
|
-
}
|
1
|
+
import * as d3 from 'd3'
|
2
|
+
import {
|
3
|
+
Subject } from 'rxjs'
|
4
|
+
import type {
|
5
|
+
ComputedDataFn,
|
6
|
+
DataValidator,
|
7
|
+
ChartEntity,
|
8
|
+
ChartType,
|
9
|
+
ChartParamsPartial,
|
10
|
+
ContextObserverCallback,
|
11
|
+
ChartOptionsPartial,
|
12
|
+
DataTypeMap,
|
13
|
+
DataFormatterTypeMap,
|
14
|
+
DataFormatterPartialTypeMap,
|
15
|
+
DataFormatterValidator,
|
16
|
+
EventTypeMap,
|
17
|
+
PluginEntity } from '../lib/core-types'
|
18
|
+
import { createBaseChart } from './base/createBaseChart'
|
19
|
+
import { createOrbChartsErrorMessage } from './utils/errorMessage'
|
20
|
+
|
21
|
+
export abstract class AbstractChart<T extends ChartType> implements ChartEntity<T> {
|
22
|
+
selection: d3.Selection<SVGGElement, unknown, HTMLElement, unknown>
|
23
|
+
destroy: () => void
|
24
|
+
data$: Subject<DataTypeMap<T>> = new Subject()
|
25
|
+
dataFormatter$: Subject<DataFormatterPartialTypeMap<T>> = new Subject()
|
26
|
+
plugins$: Subject<PluginEntity<T, any, any>[]> = new Subject()
|
27
|
+
chartParams$: Subject<ChartParamsPartial> = new Subject()
|
28
|
+
event$: Subject<EventTypeMap<T>> = new Subject()
|
29
|
+
|
30
|
+
constructor (
|
31
|
+
{ defaultDataFormatter, dataFormatterValidator, computedDataFn, dataValidator, contextObserverCallback }: {
|
32
|
+
defaultDataFormatter: DataFormatterTypeMap<T>
|
33
|
+
dataFormatterValidator: DataFormatterValidator<T>
|
34
|
+
computedDataFn: ComputedDataFn<T>
|
35
|
+
dataValidator: DataValidator<T>
|
36
|
+
contextObserverCallback: ContextObserverCallback<T>
|
37
|
+
},
|
38
|
+
element: HTMLElement | Element,
|
39
|
+
options?: ChartOptionsPartial<T>
|
40
|
+
) {
|
41
|
+
try {
|
42
|
+
const baseChart = createBaseChart({ defaultDataFormatter, dataFormatterValidator, computedDataFn, dataValidator, contextObserverCallback })
|
43
|
+
const chartEntity = baseChart(element, options)
|
44
|
+
|
45
|
+
this.selection = chartEntity.selection
|
46
|
+
this.destroy = chartEntity.destroy
|
47
|
+
this.data$ = chartEntity.data$
|
48
|
+
this.dataFormatter$ = chartEntity.dataFormatter$
|
49
|
+
this.plugins$ = chartEntity.plugins$
|
50
|
+
this.chartParams$ = chartEntity.chartParams$
|
51
|
+
this.event$ = chartEntity.event$
|
52
|
+
} catch (e) {
|
53
|
+
console.error(createOrbChartsErrorMessage(e))
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
}
|
package/src/GridChart.ts
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
import type {
|
2
|
-
ChartEntity,
|
3
|
-
ChartOptionsPartial } from '../lib/core-types'
|
4
|
-
import { DEFAULT_DATA_FORMATTER_GRID } from './defaults'
|
5
|
-
import { dataFormatterValidator } from './grid/dataFormatterValidator'
|
6
|
-
import { computedDataFn } from './grid/computedDataFn'
|
7
|
-
import { dataValidator } from './grid/dataValidator'
|
8
|
-
import { contextObserverCallback } from './grid/contextObserverCallback'
|
9
|
-
import { AbstractChart } from './AbstractChart'
|
10
|
-
|
11
|
-
export class GridChart extends AbstractChart<'grid'> implements ChartEntity<'grid'> {
|
12
|
-
constructor (element: HTMLElement | Element, options?: ChartOptionsPartial<'grid'>) {
|
13
|
-
super(
|
14
|
-
{
|
15
|
-
defaultDataFormatter: DEFAULT_DATA_FORMATTER_GRID,
|
16
|
-
dataFormatterValidator,
|
17
|
-
computedDataFn,
|
18
|
-
dataValidator,
|
19
|
-
contextObserverCallback
|
20
|
-
},
|
21
|
-
element,
|
22
|
-
options
|
23
|
-
)
|
24
|
-
}
|
1
|
+
import type {
|
2
|
+
ChartEntity,
|
3
|
+
ChartOptionsPartial } from '../lib/core-types'
|
4
|
+
import { DEFAULT_DATA_FORMATTER_GRID } from './defaults'
|
5
|
+
import { dataFormatterValidator } from './grid/dataFormatterValidator'
|
6
|
+
import { computedDataFn } from './grid/computedDataFn'
|
7
|
+
import { dataValidator } from './grid/dataValidator'
|
8
|
+
import { contextObserverCallback } from './grid/contextObserverCallback'
|
9
|
+
import { AbstractChart } from './AbstractChart'
|
10
|
+
|
11
|
+
export class GridChart extends AbstractChart<'grid'> implements ChartEntity<'grid'> {
|
12
|
+
constructor (element: HTMLElement | Element, options?: ChartOptionsPartial<'grid'>) {
|
13
|
+
super(
|
14
|
+
{
|
15
|
+
defaultDataFormatter: DEFAULT_DATA_FORMATTER_GRID,
|
16
|
+
dataFormatterValidator,
|
17
|
+
computedDataFn,
|
18
|
+
dataValidator,
|
19
|
+
contextObserverCallback
|
20
|
+
},
|
21
|
+
element,
|
22
|
+
options
|
23
|
+
)
|
24
|
+
}
|
25
25
|
}
|
package/src/MultiGridChart.ts
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
import type {
|
2
|
-
ChartEntity,
|
3
|
-
ChartOptionsPartial } from '../lib/core-types'
|
4
|
-
import { DEFAULT_DATA_FORMATTER_MULTI_GRID } from './defaults'
|
5
|
-
import { dataFormatterValidator } from './multiGrid/dataFormatterValidator'
|
6
|
-
import { computedDataFn } from './multiGrid/computedDataFn'
|
7
|
-
import { dataValidator } from './multiGrid/dataValidator'
|
8
|
-
import { contextObserverCallback } from './multiGrid/contextObserverCallback'
|
9
|
-
import { AbstractChart } from './AbstractChart'
|
10
|
-
|
11
|
-
export class MultiGridChart extends AbstractChart<'multiGrid'> implements ChartEntity<'multiGrid'> {
|
12
|
-
constructor (element: HTMLElement | Element, options?: ChartOptionsPartial<'multiGrid'>) {
|
13
|
-
super(
|
14
|
-
{
|
15
|
-
defaultDataFormatter: DEFAULT_DATA_FORMATTER_MULTI_GRID,
|
16
|
-
dataFormatterValidator,
|
17
|
-
computedDataFn,
|
18
|
-
dataValidator,
|
19
|
-
contextObserverCallback
|
20
|
-
},
|
21
|
-
element,
|
22
|
-
options
|
23
|
-
)
|
24
|
-
}
|
1
|
+
import type {
|
2
|
+
ChartEntity,
|
3
|
+
ChartOptionsPartial } from '../lib/core-types'
|
4
|
+
import { DEFAULT_DATA_FORMATTER_MULTI_GRID } from './defaults'
|
5
|
+
import { dataFormatterValidator } from './multiGrid/dataFormatterValidator'
|
6
|
+
import { computedDataFn } from './multiGrid/computedDataFn'
|
7
|
+
import { dataValidator } from './multiGrid/dataValidator'
|
8
|
+
import { contextObserverCallback } from './multiGrid/contextObserverCallback'
|
9
|
+
import { AbstractChart } from './AbstractChart'
|
10
|
+
|
11
|
+
export class MultiGridChart extends AbstractChart<'multiGrid'> implements ChartEntity<'multiGrid'> {
|
12
|
+
constructor (element: HTMLElement | Element, options?: ChartOptionsPartial<'multiGrid'>) {
|
13
|
+
super(
|
14
|
+
{
|
15
|
+
defaultDataFormatter: DEFAULT_DATA_FORMATTER_MULTI_GRID,
|
16
|
+
dataFormatterValidator,
|
17
|
+
computedDataFn,
|
18
|
+
dataValidator,
|
19
|
+
contextObserverCallback
|
20
|
+
},
|
21
|
+
element,
|
22
|
+
options
|
23
|
+
)
|
24
|
+
}
|
25
25
|
}
|