@orbcharts/core 3.0.0-alpha.60 → 3.0.0-alpha.62
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +200 -200
- package/dist/lib/core-types.d.ts +1 -0
- package/dist/orbcharts-core.es.js +3056 -2609
- package/dist/orbcharts-core.umd.js +6 -2
- package/dist/src/AbstractChart.d.ts +5 -3
- package/dist/src/GridChart.d.ts +1 -1
- package/dist/src/MultiGridChart.d.ts +1 -1
- package/dist/src/MultiValueChart.d.ts +1 -1
- package/dist/src/RelationshipChart.d.ts +1 -1
- package/dist/src/SeriesChart.d.ts +1 -1
- package/dist/src/TreeChart.d.ts +1 -1
- package/dist/src/base/createBaseChart.d.ts +1 -1
- package/dist/src/base/createBasePlugin.d.ts +1 -1
- package/dist/src/base/validators/chartOptionsValidator.d.ts +3 -0
- package/dist/src/base/validators/chartParamsValidator.d.ts +3 -0
- package/dist/src/base/validators/elementValidator.d.ts +3 -0
- package/dist/src/base/validators/pluginsValidator.d.ts +3 -0
- package/dist/src/defaults.d.ts +1 -16
- package/dist/src/defineGridPlugin.d.ts +1 -1
- package/dist/src/defineMultiGridPlugin.d.ts +1 -1
- package/dist/src/defineMultiValuePlugin.d.ts +1 -1
- package/dist/src/defineNoneDataPlugin.d.ts +1 -1
- package/dist/src/defineRelationshipPlugin.d.ts +1 -1
- package/dist/src/defineSeriesPlugin.d.ts +1 -1
- package/dist/src/defineTreePlugin.d.ts +1 -1
- package/dist/src/grid/computedDataFn.d.ts +4 -0
- package/dist/src/grid/contextObserverCallback.d.ts +3 -0
- package/dist/src/grid/dataFormatterValidator.d.ts +3 -0
- package/dist/src/grid/dataValidator.d.ts +3 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/multiGrid/computedDataFn.d.ts +3 -0
- package/dist/src/multiGrid/contextObserverCallback.d.ts +3 -0
- package/dist/src/multiGrid/dataFormatterValidator.d.ts +3 -0
- package/dist/src/multiGrid/dataValidator.d.ts +3 -0
- package/dist/src/multiValue/computedDataFn.d.ts +3 -0
- package/dist/src/multiValue/contextObserverCallback.d.ts +3 -0
- package/dist/src/multiValue/dataFormatterValidator.d.ts +3 -0
- package/dist/src/multiValue/dataValidator.d.ts +3 -0
- package/dist/src/relationship/computedDataFn.d.ts +3 -0
- package/dist/src/relationship/contextObserverCallback.d.ts +3 -0
- package/dist/src/relationship/dataFormatterValidator.d.ts +3 -0
- package/dist/src/relationship/dataValidator.d.ts +3 -0
- package/dist/src/series/computedDataFn.d.ts +3 -0
- package/dist/src/series/contextObserverCallback.d.ts +3 -0
- package/dist/src/series/dataFormatterValidator.d.ts +3 -0
- package/dist/src/series/dataValidator.d.ts +3 -0
- package/dist/src/tree/computedDataFn.d.ts +3 -0
- package/dist/src/tree/contextObserverCallback.d.ts +3 -0
- package/dist/src/tree/dataFormatterValidator.d.ts +3 -0
- package/dist/src/tree/dataValidator.d.ts +3 -0
- package/dist/src/utils/commonUtils.d.ts +1 -0
- package/dist/src/utils/errorMessage.d.ts +14 -0
- package/dist/src/{grid → utils}/gridObservables.d.ts +2 -2
- package/dist/src/utils/index.d.ts +7 -3
- package/dist/src/{multiGrid → utils}/multiGridObservables.d.ts +1 -1
- package/dist/src/utils/observables.d.ts +2 -1
- package/dist/src/utils/orbchartsUtils.d.ts +1 -12
- package/dist/src/{series → utils}/seriesObservables.d.ts +3 -3
- package/dist/src/{tree → utils}/treeObservables.d.ts +1 -1
- package/dist/src/utils/validator.d.ts +3 -0
- package/lib/core-types.ts +7 -0
- package/package.json +42 -41
- package/src/AbstractChart.ts +57 -48
- package/src/GridChart.ts +24 -20
- package/src/MultiGridChart.ts +24 -20
- package/src/MultiValueChart.ts +24 -20
- package/src/RelationshipChart.ts +24 -20
- package/src/SeriesChart.ts +24 -20
- package/src/TreeChart.ts +24 -20
- package/src/base/createBaseChart.ts +500 -386
- package/src/base/createBasePlugin.ts +152 -95
- package/src/base/validators/chartOptionsValidator.ts +24 -0
- package/src/base/validators/chartParamsValidator.ts +134 -0
- package/src/base/validators/elementValidator.ts +14 -0
- package/src/base/validators/pluginsValidator.ts +15 -0
- package/src/defaults.ts +232 -226
- 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/{computeGridData.ts → computedDataFn.ts} +129 -134
- package/src/grid/{createGridContextObserver.ts → contextObserverCallback.ts} +155 -155
- package/src/grid/dataFormatterValidator.ts +9 -0
- package/src/grid/dataValidator.ts +9 -0
- package/src/index.ts +20 -21
- package/src/multiGrid/{computeMultiGridData.ts → computedDataFn.ts} +123 -130
- package/src/multiGrid/{createMultiGridContextObserver.ts → contextObserverCallback.ts} +41 -41
- package/src/multiGrid/dataFormatterValidator.ts +9 -0
- package/src/multiGrid/dataValidator.ts +9 -0
- package/src/multiValue/{computeMultiValueData.ts → computedDataFn.ts} +176 -179
- package/src/multiValue/{createMultiValueContextObserver.ts → contextObserverCallback.ts} +12 -12
- package/src/multiValue/dataFormatterValidator.ts +9 -0
- package/src/multiValue/dataValidator.ts +9 -0
- package/src/relationship/{computeRelationshipData.ts → computedDataFn.ts} +125 -118
- package/src/relationship/{createRelationshipContextObserver.ts → contextObserverCallback.ts} +12 -12
- package/src/relationship/dataFormatterValidator.ts +9 -0
- package/src/relationship/dataValidator.ts +9 -0
- package/src/series/{computeSeriesData.ts → computedDataFn.ts} +88 -90
- package/src/series/{createSeriesContextObserver.ts → contextObserverCallback.ts} +100 -93
- package/src/series/dataFormatterValidator.ts +9 -0
- package/src/series/dataValidator.ts +9 -0
- package/src/tree/{computeTreeData.ts → computedDataFn.ts} +130 -132
- package/src/tree/{createTreeContextObserver.ts → contextObserverCallback.ts} +61 -61
- package/src/tree/dataFormatterValidator.ts +9 -0
- package/src/tree/dataValidator.ts +9 -0
- package/src/utils/commonUtils.ts +54 -50
- package/src/utils/d3Utils.ts +108 -108
- package/src/utils/errorMessage.ts +43 -0
- package/src/{grid → utils}/gridObservables.ts +611 -614
- package/src/utils/index.ts +10 -4
- package/src/{multiGrid → utils}/multiGridObservables.ts +366 -365
- package/src/utils/observables.ts +218 -202
- package/src/utils/orbchartsUtils.ts +352 -349
- package/src/{series → utils}/seriesObservables.ts +175 -175
- package/src/{tree → utils}/treeObservables.ts +94 -94
- package/src/utils/validator.ts +126 -0
- package/tsconfig.base.json +13 -13
- package/tsconfig.json +2 -2
- package/vite-env.d.ts +7 -0
- package/vite.config.js +22 -22
- package/dist/src/grid/computeGridData.d.ts +0 -6
- package/dist/src/grid/createGridContextObserver.d.ts +0 -3
- package/dist/src/multiGrid/computeMultiGridData.d.ts +0 -3
- package/dist/src/multiGrid/createMultiGridContextObserver.d.ts +0 -3
- package/dist/src/multiValue/computeMultiValueData.d.ts +0 -3
- package/dist/src/multiValue/createMultiValueContextObserver.d.ts +0 -3
- package/dist/src/relationship/computeRelationshipData.d.ts +0 -3
- package/dist/src/relationship/createRelationshipContextObserver.d.ts +0 -3
- package/dist/src/series/computeSeriesData.d.ts +0 -3
- package/dist/src/series/createSeriesContextObserver.d.ts +0 -3
- package/dist/src/tree/computeTreeData.d.ts +0 -3
- package/dist/src/tree/createTreeContextObserver.d.ts +0 -3
- package/dist/src/types/Axis.d.ts +0 -1
- package/dist/src/types/Chart.d.ts +0 -45
- package/dist/src/types/ChartParams.d.ts +0 -36
- package/dist/src/types/ComputedData.d.ts +0 -42
- package/dist/src/types/ComputedDataGrid.d.ts +0 -5
- package/dist/src/types/ComputedDataMultiGrid.d.ts +0 -3
- package/dist/src/types/ComputedDataMultiValue.d.ts +0 -6
- package/dist/src/types/ComputedDataRelationship.d.ts +0 -18
- package/dist/src/types/ComputedDataSeries.d.ts +0 -5
- package/dist/src/types/ComputedDataTree.d.ts +0 -7
- package/dist/src/types/ContextObserver.d.ts +0 -28
- package/dist/src/types/ContextObserverGrid.d.ts +0 -41
- package/dist/src/types/ContextObserverMultiGrid.d.ts +0 -15
- package/dist/src/types/ContextObserverMultiValue.d.ts +0 -4
- package/dist/src/types/ContextObserverRelationship.d.ts +0 -4
- package/dist/src/types/ContextObserverSeries.d.ts +0 -27
- package/dist/src/types/ContextObserverTree.d.ts +0 -11
- package/dist/src/types/ContextSubject.d.ts +0 -15
- package/dist/src/types/Data.d.ts +0 -19
- package/dist/src/types/DataFormatter.d.ts +0 -41
- package/dist/src/types/DataFormatterGrid.d.ts +0 -34
- package/dist/src/types/DataFormatterMultiGrid.d.ts +0 -20
- package/dist/src/types/DataFormatterMultiValue.d.ts +0 -18
- package/dist/src/types/DataFormatterRelationship.d.ts +0 -10
- package/dist/src/types/DataFormatterSeries.d.ts +0 -19
- package/dist/src/types/DataFormatterTree.d.ts +0 -7
- package/dist/src/types/DataGrid.d.ts +0 -6
- package/dist/src/types/DataMultiGrid.d.ts +0 -6
- package/dist/src/types/DataMultiValue.d.ts +0 -7
- package/dist/src/types/DataRelationship.d.ts +0 -21
- package/dist/src/types/DataSeries.d.ts +0 -6
- package/dist/src/types/DataTree.d.ts +0 -15
- package/dist/src/types/Event.d.ts +0 -56
- package/dist/src/types/Layout.d.ts +0 -8
- package/dist/src/types/Padding.d.ts +0 -6
- package/dist/src/types/Plugin.d.ts +0 -37
- package/dist/src/types/TransformData.d.ts +0 -8
- package/dist/src/types/index.d.ts +0 -37
- package/src/types/Axis.ts +0 -1
- package/src/types/Chart.ts +0 -54
- package/src/types/ChartParams.ts +0 -51
- package/src/types/ComputedData.ts +0 -84
- package/src/types/ComputedDataGrid.ts +0 -14
- package/src/types/ComputedDataMultiGrid.ts +0 -3
- package/src/types/ComputedDataMultiValue.ts +0 -9
- package/src/types/ComputedDataRelationship.ts +0 -20
- package/src/types/ComputedDataSeries.ts +0 -8
- package/src/types/ComputedDataTree.ts +0 -20
- package/src/types/ContextObserver.ts +0 -38
- package/src/types/ContextObserverGrid.ts +0 -43
- package/src/types/ContextObserverMultiGrid.ts +0 -17
- package/src/types/ContextObserverMultiValue.ts +0 -5
- package/src/types/ContextObserverRelationship.ts +0 -5
- package/src/types/ContextObserverSeries.ts +0 -29
- package/src/types/ContextObserverTree.ts +0 -11
- package/src/types/ContextSubject.ts +0 -18
- package/src/types/Data.ts +0 -45
- package/src/types/DataFormatter.ts +0 -74
- package/src/types/DataFormatterGrid.ts +0 -68
- package/src/types/DataFormatterMultiGrid.ts +0 -45
- package/src/types/DataFormatterMultiValue.ts +0 -24
- package/src/types/DataFormatterRelationship.ts +0 -26
- package/src/types/DataFormatterSeries.ts +0 -20
- package/src/types/DataFormatterTree.ts +0 -12
- package/src/types/DataGrid.ts +0 -11
- package/src/types/DataMultiGrid.ts +0 -7
- package/src/types/DataMultiValue.ts +0 -12
- package/src/types/DataRelationship.ts +0 -28
- package/src/types/DataSeries.ts +0 -11
- package/src/types/DataTree.ts +0 -20
- package/src/types/Event.ts +0 -153
- package/src/types/Layout.ts +0 -12
- package/src/types/Padding.ts +0 -6
- package/src/types/Plugin.ts +0 -60
- package/src/types/TransformData.ts +0 -8
- package/src/types/index.ts +0 -37
- /package/dist/src/{multiValue → utils}/multiValueObservables.d.ts +0 -0
- /package/dist/src/{relationship → utils}/relationshipObservables.d.ts +0 -0
- /package/src/{multiValue → utils}/multiValueObservables.ts +0 -0
- /package/src/{relationship → utils}/relationshipObservables.ts +0 -0
package/tsconfig.base.json
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
{
|
2
|
-
"compilerOptions": {
|
3
|
-
"outDir": "./dist/",
|
4
|
-
"sourceMap": true,
|
5
|
-
"noImplicitAny": true,
|
6
|
-
"module": "
|
7
|
-
"target": "es5",
|
8
|
-
"jsx": "react",
|
9
|
-
"allowJs": true,
|
10
|
-
"moduleResolution": "node",
|
11
|
-
"allowSyntheticDefaultImports" : true,
|
12
|
-
"esModuleInterop" : true
|
13
|
-
}
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"outDir": "./dist/",
|
4
|
+
"sourceMap": true,
|
5
|
+
"noImplicitAny": true,
|
6
|
+
"module": "esnext",
|
7
|
+
"target": "es5",
|
8
|
+
"jsx": "react",
|
9
|
+
"allowJs": true,
|
10
|
+
"moduleResolution": "node",
|
11
|
+
"allowSyntheticDefaultImports" : true,
|
12
|
+
"esModuleInterop" : true
|
13
|
+
}
|
14
14
|
}
|
package/tsconfig.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
{
|
2
|
-
"extends": "./tsconfig.base.json"
|
1
|
+
{
|
2
|
+
"extends": "./tsconfig.base.json"
|
3
3
|
}
|
package/vite-env.d.ts
ADDED
package/vite.config.js
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
import { defineConfig } from 'vite'
|
2
|
-
import dts from 'vite-plugin-dts'
|
3
|
-
|
4
|
-
export default defineConfig(({ command, mode }) => {
|
5
|
-
return {
|
6
|
-
plugins: [
|
7
|
-
dts({
|
8
|
-
insertTypesEntry: true
|
9
|
-
})
|
10
|
-
],
|
11
|
-
compilerOptions: {
|
12
|
-
composite: true
|
13
|
-
},
|
14
|
-
build: {
|
15
|
-
lib: {
|
16
|
-
entry: "src/index.ts",
|
17
|
-
name: 'orbcharts-core',
|
18
|
-
formats: ["es", "umd"],
|
19
|
-
fileName: format => `orbcharts-core.${format}.js`
|
20
|
-
},
|
21
|
-
}
|
22
|
-
}
|
1
|
+
import { defineConfig } from 'vite'
|
2
|
+
import dts from 'vite-plugin-dts'
|
3
|
+
|
4
|
+
export default defineConfig(({ command, mode }) => {
|
5
|
+
return {
|
6
|
+
plugins: [
|
7
|
+
dts({
|
8
|
+
insertTypesEntry: true
|
9
|
+
})
|
10
|
+
],
|
11
|
+
compilerOptions: {
|
12
|
+
composite: true
|
13
|
+
},
|
14
|
+
build: {
|
15
|
+
lib: {
|
16
|
+
entry: "src/index.ts",
|
17
|
+
name: 'orbcharts-core',
|
18
|
+
formats: ["es", "umd"],
|
19
|
+
fileName: format => `orbcharts-core.${format}.js`
|
20
|
+
},
|
21
|
+
}
|
22
|
+
}
|
23
23
|
})
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { ComputedDataFn } from '../types/ComputedData';
|
2
|
-
import { DataGrid, DataGridDatum } from '../types/DataGrid';
|
3
|
-
import { DataFormatterGridGrid } from '../types/DataFormatterGrid';
|
4
|
-
|
5
|
-
export declare function createTransposedDataGrid(data: DataGrid, dataFormatterGrid: DataFormatterGridGrid): DataGridDatum[][];
|
6
|
-
export declare const computeGridData: ComputedDataFn<'grid'>;
|
package/dist/src/types/Axis.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export type AxisPosition = 'top' | 'bottom' | 'left' | 'right';
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import { ChartParams, ChartParamsPartial } from './ChartParams';
|
2
|
-
import { ContextSubject } from './ContextSubject';
|
3
|
-
import { ContextObserverFn } from './ContextObserver';
|
4
|
-
import { ComputedDataFn } from './ComputedData';
|
5
|
-
import { DataFormatterTypeMap, DataFormatterPartialTypeMap } from './DataFormatter';
|
6
|
-
|
7
|
-
export type ChartType = 'series' | 'grid' | 'multiGrid' | 'multiValue' | 'tree' | 'relationship';
|
8
|
-
export interface CreateBaseChart {
|
9
|
-
<T extends ChartType>({ defaultDataFormatter, computedDataFn, contextObserverFn }: {
|
10
|
-
defaultDataFormatter: DataFormatterTypeMap<T>;
|
11
|
-
computedDataFn: ComputedDataFn<T>;
|
12
|
-
contextObserverFn: ContextObserverFn<T>;
|
13
|
-
}): CreateChart<T>;
|
14
|
-
}
|
15
|
-
export interface CreateChart<T extends ChartType> {
|
16
|
-
(element: HTMLElement | Element, options?: ChartOptionsPartial<T>): ChartEntity<T>;
|
17
|
-
}
|
18
|
-
export interface ChartEntity<T extends ChartType> extends ContextSubject<T> {
|
19
|
-
selection: d3.Selection<SVGGElement, unknown, HTMLElement, unknown>;
|
20
|
-
destroy: () => void;
|
21
|
-
}
|
22
|
-
export interface ChartOptions<T extends ChartType> {
|
23
|
-
preset: Preset<T, unknown>;
|
24
|
-
width: number | 'auto';
|
25
|
-
height: number | 'auto';
|
26
|
-
}
|
27
|
-
export interface ChartOptionsPartial<T extends ChartType> {
|
28
|
-
preset?: Preset<T, unknown>;
|
29
|
-
width?: number | 'auto';
|
30
|
-
height?: number | 'auto';
|
31
|
-
}
|
32
|
-
export interface Preset<T extends ChartType, AllPluginParams> {
|
33
|
-
name: string;
|
34
|
-
description: string;
|
35
|
-
chartParams: ChartParams;
|
36
|
-
dataFormatter: DataFormatterTypeMap<T>;
|
37
|
-
allPluginParams: AllPluginParams;
|
38
|
-
}
|
39
|
-
export interface PresetPartial<T extends ChartType, AllPluginParams> {
|
40
|
-
name?: string;
|
41
|
-
description?: string;
|
42
|
-
chartParams?: ChartParamsPartial;
|
43
|
-
dataFormatter?: DataFormatterPartialTypeMap<T>;
|
44
|
-
allPluginParams?: AllPluginParams;
|
45
|
-
}
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import { Padding } from './Padding';
|
2
|
-
|
3
|
-
export interface ChartParams {
|
4
|
-
padding: Padding;
|
5
|
-
highlightTarget: HighlightTarget;
|
6
|
-
highlightDefault: string | null;
|
7
|
-
colorScheme: 'dark' | 'light';
|
8
|
-
colors: {
|
9
|
-
light: ColorScheme;
|
10
|
-
dark: ColorScheme;
|
11
|
-
};
|
12
|
-
styles: Styles;
|
13
|
-
transitionDuration: number;
|
14
|
-
transitionEase: string;
|
15
|
-
}
|
16
|
-
export type ChartParamsPartial = Partial<ChartParams | {
|
17
|
-
padding: Partial<Padding>;
|
18
|
-
colors: Partial<{
|
19
|
-
light: Partial<ColorScheme>;
|
20
|
-
dark: Partial<ColorScheme>;
|
21
|
-
}>;
|
22
|
-
styles: Partial<Styles>;
|
23
|
-
}>;
|
24
|
-
export type HighlightTarget = 'series' | 'group' | 'category' | 'datum' | 'none';
|
25
|
-
export interface Styles {
|
26
|
-
textSize: string | number;
|
27
|
-
unhighlightedOpacity: number;
|
28
|
-
}
|
29
|
-
export interface ColorScheme {
|
30
|
-
series: string[];
|
31
|
-
primary: string;
|
32
|
-
secondary: string;
|
33
|
-
white: string;
|
34
|
-
background: string;
|
35
|
-
}
|
36
|
-
export type ColorType = 'none' | keyof ColorScheme;
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import { ChartType } from './Chart';
|
2
|
-
import { ComputedDataSeries, ComputedDatumSeries } from './ComputedDataSeries';
|
3
|
-
import { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid';
|
4
|
-
import { ComputedDataMultiGrid } from './ComputedDataMultiGrid';
|
5
|
-
import { ComputedDataMultiValue, ComputedDatumMultiValue } from './ComputedDataMultiValue';
|
6
|
-
import { ComputedDataRelationship, ComputedNode } from './ComputedDataRelationship';
|
7
|
-
import { ComputedDataTree } from './ComputedDataTree';
|
8
|
-
import { DataFormatterContext } from './DataFormatter';
|
9
|
-
|
10
|
-
export interface ComputedDataFn<T extends ChartType> {
|
11
|
-
(dataFormatterContext: DataFormatterContext<T>): ComputedDataTypeMap<T>;
|
12
|
-
}
|
13
|
-
export interface ComputedDatumBase {
|
14
|
-
id: string;
|
15
|
-
index: number;
|
16
|
-
label: string;
|
17
|
-
value: number | null;
|
18
|
-
visible: boolean;
|
19
|
-
description: string;
|
20
|
-
data: any;
|
21
|
-
}
|
22
|
-
export interface ComputedDatumSeriesValue {
|
23
|
-
color: string;
|
24
|
-
seriesIndex: number;
|
25
|
-
seriesLabel: string;
|
26
|
-
seq: number;
|
27
|
-
}
|
28
|
-
export interface ComputedDatumGridValue {
|
29
|
-
gridIndex: number;
|
30
|
-
color: string;
|
31
|
-
seriesIndex: number;
|
32
|
-
seriesLabel: string;
|
33
|
-
groupIndex: number;
|
34
|
-
groupLabel: string;
|
35
|
-
}
|
36
|
-
export interface ComputedDatumCategoryValue {
|
37
|
-
color: string;
|
38
|
-
categoryIndex: number;
|
39
|
-
categoryLabel: string | null;
|
40
|
-
}
|
41
|
-
export type ComputedDataTypeMap<T extends ChartType> = T extends 'series' ? ComputedDataSeries : T extends 'grid' ? ComputedDataGrid : T extends 'multiGrid' ? ComputedDataMultiGrid : T extends 'multiValue' ? ComputedDataMultiValue : T extends 'relationship' ? ComputedDataRelationship : T extends 'tree' ? ComputedDataTree : ComputedDatumBase;
|
42
|
-
export type ComputedDatumTypeMap<T extends ChartType> = T extends 'series' ? ComputedDatumSeries : T extends 'grid' ? ComputedDatumGrid : T extends 'multiGrid' ? ComputedDatumGrid : T extends 'multiValue' ? ComputedDatumMultiValue : T extends 'relationship' ? ComputedNode : T extends 'tree' ? ComputedDataTree : unknown;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { ComputedDatumBase, ComputedDatumCategoryValue } from './ComputedData';
|
2
|
-
|
3
|
-
export type ComputedDataRelationship = {
|
4
|
-
nodes: ComputedNode[];
|
5
|
-
edges: ComputedEdge[];
|
6
|
-
};
|
7
|
-
export interface ComputedNode extends ComputedDatumBase, ComputedDatumCategoryValue {
|
8
|
-
startNodes: ComputedNode[];
|
9
|
-
startNodeIds: string[];
|
10
|
-
endNodes: ComputedNode[];
|
11
|
-
endNodeIds: string[];
|
12
|
-
}
|
13
|
-
export interface ComputedEdge extends ComputedDatumBase {
|
14
|
-
startNode: ComputedNode;
|
15
|
-
startNodeId: string;
|
16
|
-
endNode: ComputedNode;
|
17
|
-
endNodeId: string;
|
18
|
-
}
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import { Observable } from 'rxjs';
|
2
|
-
import { ChartType } from './Chart';
|
3
|
-
import { ChartParams } from './ChartParams';
|
4
|
-
import { DataFormatterTypeMap } from './DataFormatter';
|
5
|
-
import { ComputedDataTypeMap } from './ComputedData';
|
6
|
-
import { Layout } from './Layout';
|
7
|
-
import { ContextObserverGrid } from './ContextObserverGrid';
|
8
|
-
import { ContextObserverMultiGrid } from './ContextObserverMultiGrid';
|
9
|
-
import { ContextObserverMultiValue } from './ContextObserverMultiValue';
|
10
|
-
import { ContextObserverRelationship } from './ContextObserverRelationship';
|
11
|
-
import { ContextObserverSeries } from './ContextObserverSeries';
|
12
|
-
import { ContextObserverTree } from './ContextObserverTree';
|
13
|
-
import { ContextSubject } from './ContextSubject';
|
14
|
-
|
15
|
-
export interface ContextObserverFn<T extends ChartType> {
|
16
|
-
({ subject, observer }: {
|
17
|
-
subject: ContextSubject<T>;
|
18
|
-
observer: ContextObserverBase<T, unknown>;
|
19
|
-
}): ContextObserverTypeMap<T, unknown>;
|
20
|
-
}
|
21
|
-
export type ContextObserverTypeMap<T extends ChartType, PluginParams> = T extends 'series' ? ContextObserverSeries<PluginParams> : T extends 'grid' ? ContextObserverGrid<PluginParams> : T extends 'multiGrid' ? ContextObserverMultiGrid<PluginParams> : T extends 'multiValue' ? ContextObserverMultiValue<PluginParams> : T extends 'relationship' ? ContextObserverRelationship<PluginParams> : T extends 'tree' ? ContextObserverTree<PluginParams> : ContextObserverBase<ChartType, PluginParams>;
|
22
|
-
export interface ContextObserverBase<T extends ChartType, PluginParams> {
|
23
|
-
fullParams$: Observable<PluginParams>;
|
24
|
-
fullChartParams$: Observable<ChartParams>;
|
25
|
-
fullDataFormatter$: Observable<DataFormatterTypeMap<T>>;
|
26
|
-
computedData$: Observable<ComputedDataTypeMap<T>>;
|
27
|
-
layout$: Observable<Layout>;
|
28
|
-
}
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import { Observable } from 'rxjs';
|
2
|
-
import { ContextObserverBase } from './ContextObserver';
|
3
|
-
import { ComputedDataGrid, ComputedDatumGrid } from './ComputedDataGrid';
|
4
|
-
import { TransformData } from './TransformData';
|
5
|
-
|
6
|
-
export interface ContextObserverGrid<PluginParams> extends ContextObserverBase<'grid', PluginParams>, ContextObserverGridDetail {
|
7
|
-
textSizePx$: Observable<number>;
|
8
|
-
}
|
9
|
-
export interface ContextObserverGridDetail {
|
10
|
-
isSeriesSeprate$: Observable<boolean>;
|
11
|
-
gridContainerPosition$: Observable<GridContainerPosition[]>;
|
12
|
-
gridAxesTransform$: Observable<TransformData>;
|
13
|
-
gridAxesReverseTransform$: Observable<TransformData>;
|
14
|
-
gridGraphicTransform$: Observable<TransformData>;
|
15
|
-
gridGraphicReverseScale$: Observable<[number, number][]>;
|
16
|
-
gridAxesSize$: Observable<{
|
17
|
-
width: number;
|
18
|
-
height: number;
|
19
|
-
}>;
|
20
|
-
gridHighlight$: Observable<ComputedDatumGrid[]>;
|
21
|
-
seriesLabels$: Observable<string[]>;
|
22
|
-
SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
|
23
|
-
GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
|
24
|
-
computedLayoutData$: Observable<ComputedLayoutDataGrid>;
|
25
|
-
visibleComputedData$: Observable<ComputedDataGrid>;
|
26
|
-
visibleComputedLayoutData$: Observable<ComputedLayoutDataGrid>;
|
27
|
-
computedStackedData$: Observable<ComputedDataGrid>;
|
28
|
-
}
|
29
|
-
export type ComputedLayoutDataGrid = ComputedLayoutDatumGrid[][];
|
30
|
-
export interface ComputedLayoutDatumGrid extends ComputedDatumGrid {
|
31
|
-
axisX: number;
|
32
|
-
axisY: number;
|
33
|
-
axisYFromZero: number;
|
34
|
-
}
|
35
|
-
export interface GridContainerPosition {
|
36
|
-
slotIndex: number;
|
37
|
-
rowIndex: number;
|
38
|
-
columnIndex: number;
|
39
|
-
translate: [number, number];
|
40
|
-
scale: [number, number];
|
41
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { Observable } from 'rxjs';
|
2
|
-
import { ContextObserverBase } from './ContextObserver';
|
3
|
-
import { ComputedDataGrid } from './ComputedDataGrid';
|
4
|
-
import { DataFormatterGrid } from './DataFormatterGrid';
|
5
|
-
import { GridContainerPosition, ContextObserverGridDetail } from './ContextObserverGrid';
|
6
|
-
|
7
|
-
export interface ContextObserverMultiGrid<PluginParams> extends ContextObserverBase<'multiGrid', PluginParams> {
|
8
|
-
textSizePx$: Observable<number>;
|
9
|
-
multiGridContainerPosition$: Observable<GridContainerPosition[][]>;
|
10
|
-
multiGridEachDetail$: Observable<ContextObserverMultiGridDetail[]>;
|
11
|
-
}
|
12
|
-
export interface ContextObserverMultiGridDetail extends ContextObserverGridDetail {
|
13
|
-
computedData$: Observable<ComputedDataGrid>;
|
14
|
-
dataFormatter$: Observable<DataFormatterGrid>;
|
15
|
-
}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import { Observable } from 'rxjs';
|
2
|
-
import { ContextObserverBase } from './ContextObserver';
|
3
|
-
import { ComputedDatumSeries } from './ComputedDataSeries';
|
4
|
-
|
5
|
-
export interface ContextObserverSeries<PluginParams> extends ContextObserverBase<'series', PluginParams> {
|
6
|
-
textSizePx$: Observable<number>;
|
7
|
-
separateSeries$: Observable<boolean>;
|
8
|
-
visibleComputedData$: Observable<ComputedDatumSeries[][]>;
|
9
|
-
computedLayoutData$: Observable<ComputedDatumSeries[][]>;
|
10
|
-
visibleComputedLayoutData$: Observable<ComputedDatumSeries[][]>;
|
11
|
-
seriesHighlight$: Observable<ComputedDatumSeries[]>;
|
12
|
-
seriesLabels$: Observable<string[]>;
|
13
|
-
SeriesDataMap$: Observable<Map<string, ComputedDatumSeries[]>>;
|
14
|
-
seriesContainerPosition$: Observable<SeriesContainerPosition[]>;
|
15
|
-
SeriesContainerPositionMap$: Observable<Map<string, SeriesContainerPosition>>;
|
16
|
-
}
|
17
|
-
export interface SeriesContainerPosition {
|
18
|
-
slotIndex: number;
|
19
|
-
rowIndex: number;
|
20
|
-
columnIndex: number;
|
21
|
-
startX: number;
|
22
|
-
startY: number;
|
23
|
-
centerX: number;
|
24
|
-
centerY: number;
|
25
|
-
width: number;
|
26
|
-
height: number;
|
27
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { Observable } from 'rxjs';
|
2
|
-
import { ContextObserverBase } from './ContextObserver';
|
3
|
-
import { ComputedDataTree } from './ComputedDataTree';
|
4
|
-
|
5
|
-
export interface ContextObserverTree<PluginParams> extends ContextObserverBase<'tree', PluginParams> {
|
6
|
-
textSizePx$: Observable<number>;
|
7
|
-
treeHighlight$: Observable<ComputedDataTree[]>;
|
8
|
-
existCategoryLabels$: Observable<string[]>;
|
9
|
-
CategoryDataMap$: Observable<Map<string, ComputedDataTree[]>>;
|
10
|
-
visibleComputedData$: Observable<ComputedDataTree>;
|
11
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { Subject } from 'rxjs';
|
2
|
-
import { ChartType } from './Chart';
|
3
|
-
import { EventTypeMap } from './Event';
|
4
|
-
import { ChartParamsPartial } from './ChartParams';
|
5
|
-
import { DataFormatterPartialTypeMap } from './DataFormatter';
|
6
|
-
import { DataTypeMap } from './Data';
|
7
|
-
import { PluginEntity } from './Plugin';
|
8
|
-
|
9
|
-
export interface ContextSubject<T extends ChartType> {
|
10
|
-
data$: Subject<DataTypeMap<T>>;
|
11
|
-
dataFormatter$: Subject<DataFormatterPartialTypeMap<T>>;
|
12
|
-
plugins$: Subject<PluginEntity<T, any, any>[]>;
|
13
|
-
chartParams$: Subject<ChartParamsPartial>;
|
14
|
-
event$: Subject<EventTypeMap<T>>;
|
15
|
-
}
|
package/dist/src/types/Data.d.ts
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
import { ChartType } from './Chart';
|
2
|
-
import { DataSeries, DataSeriesDatum, DataSeriesValue } from './DataSeries';
|
3
|
-
import { DataGrid, DataGridDatum, DataGridValue } from './DataGrid';
|
4
|
-
import { DataMultiGrid, DataMultiGridDatum, DataMultiGridValue } from './DataMultiGrid';
|
5
|
-
import { DataMultiValue, DataMultiValueDatum, DataMultiValueValue } from './DataMultiValue';
|
6
|
-
import { DataTree, DataTreeDatum, DataTreeObj } from './DataTree';
|
7
|
-
import { DataRelationship, Node, Edge } from './DataRelationship';
|
8
|
-
|
9
|
-
export interface DatumBase {
|
10
|
-
id?: string;
|
11
|
-
label?: string;
|
12
|
-
description?: string;
|
13
|
-
data?: any;
|
14
|
-
}
|
15
|
-
export interface DatumValue {
|
16
|
-
value: number | null;
|
17
|
-
}
|
18
|
-
export type DataTypeMap<T extends ChartType> = T extends 'series' ? DataSeries : T extends 'grid' ? DataGrid : T extends 'multiGrid' ? DataMultiGrid : T extends 'multiValue' ? DataMultiValue : T extends 'relationship' ? DataRelationship : T extends 'tree' ? DataTree : unknown;
|
19
|
-
export type DatumTypeMap<T extends ChartType> = T extends 'series' ? DataSeriesDatum | DataSeriesValue : T extends 'grid' ? DataGridDatum | DataGridValue : T extends 'multiGrid' ? DataMultiGridDatum | DataMultiGridValue : T extends 'multiValue' ? DataMultiValueDatum | DataMultiValueValue : T extends 'relationship' ? Node | Edge : T extends 'tree' ? DataTreeDatum | DataTreeObj : unknown;
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import { ChartType } from './Chart';
|
2
|
-
import { ChartParams } from './ChartParams';
|
3
|
-
import { DataTypeMap } from './Data';
|
4
|
-
import { ComputedDatumTypeMap } from './ComputedData';
|
5
|
-
import { DataFormatterSeries, DataFormatterSeriesPartial } from './DataFormatterSeries';
|
6
|
-
import { DataFormatterGrid, DataFormatterGridPartial } from './DataFormatterGrid';
|
7
|
-
import { DataFormatterMultiGrid, DataFormatterMultiGridPartial } from './DataFormatterMultiGrid';
|
8
|
-
import { DataFormatterMultiValue, DataFormatterMultiValuePartial } from './DataFormatterMultiValue';
|
9
|
-
import { DataFormatterTree, DataFormatterTreePartial } from './DataFormatterTree';
|
10
|
-
import { DataFormatterRelationship, DataFormatterRelationshipPartial } from './DataFormatterRelationship';
|
11
|
-
import { AxisPosition } from './Axis';
|
12
|
-
|
13
|
-
export interface DataFormatterContext<T extends ChartType> {
|
14
|
-
data: DataTypeMap<T>;
|
15
|
-
dataFormatter: DataFormatterTypeMap<T>;
|
16
|
-
chartParams: ChartParams;
|
17
|
-
}
|
18
|
-
export type DataFormatterTypeMap<T extends ChartType> = T extends 'series' ? DataFormatterSeries : T extends 'grid' ? DataFormatterGrid : T extends 'multiGrid' ? DataFormatterMultiGrid : T extends 'multiValue' ? DataFormatterMultiValue : T extends 'relationship' ? DataFormatterRelationship : T extends 'tree' ? DataFormatterTree : DataFormatterBase<T>;
|
19
|
-
export type DataFormatterPartialTypeMap<T extends ChartType> = T extends 'series' ? DataFormatterSeriesPartial : T extends 'grid' ? DataFormatterGridPartial : T extends 'multiGrid' ? DataFormatterMultiGridPartial : T extends 'multiValue' ? DataFormatterMultiValuePartial : T extends 'relationship' ? DataFormatterRelationshipPartial : T extends 'tree' ? DataFormatterTreePartial : DataFormatterBasePartial<T>;
|
20
|
-
export interface DataFormatterBase<T extends ChartType> {
|
21
|
-
type: T;
|
22
|
-
}
|
23
|
-
export type DataFormatterBasePartial<T extends ChartType> = Partial<DataFormatterBase<T>>;
|
24
|
-
export interface DataFormatterValueAxis {
|
25
|
-
position: AxisPosition;
|
26
|
-
scaleDomain: [number | 'min' | 'auto', number | 'max' | 'auto'];
|
27
|
-
scaleRange: [number, number];
|
28
|
-
label: string;
|
29
|
-
}
|
30
|
-
export interface DataFormatterGroupAxis {
|
31
|
-
position: AxisPosition;
|
32
|
-
scaleDomain: [number, number | 'max'];
|
33
|
-
scalePadding: number;
|
34
|
-
label: string;
|
35
|
-
}
|
36
|
-
export type VisibleFilter<T extends ChartType> = (datum: ComputedDatumTypeMap<T>, context: DataFormatterContext<T>) => boolean | null;
|
37
|
-
export interface DataFormatterContainer {
|
38
|
-
gap: number;
|
39
|
-
rowAmount: number;
|
40
|
-
columnAmount: number;
|
41
|
-
}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import { DataFormatterBase, DataFormatterBasePartial, DataFormatterValueAxis, DataFormatterGroupAxis, VisibleFilter, DataFormatterContainer } from './DataFormatter';
|
2
|
-
|
3
|
-
export type SeriesDirection = 'row' | 'column';
|
4
|
-
export interface DataFormatterGrid extends DataFormatterBase<'grid'> {
|
5
|
-
visibleFilter: VisibleFilter<'grid'>;
|
6
|
-
grid: DataFormatterGridGrid;
|
7
|
-
container: DataFormatterContainer;
|
8
|
-
}
|
9
|
-
export interface DataFormatterGridPartial extends DataFormatterBasePartial<'grid'> {
|
10
|
-
visibleFilter?: VisibleFilter<'grid'>;
|
11
|
-
grid?: DataFormatterGridGridPartial;
|
12
|
-
container?: Partial<DataFormatterContainer>;
|
13
|
-
}
|
14
|
-
export interface DataFormatterGridGrid {
|
15
|
-
seriesDirection: SeriesDirection;
|
16
|
-
rowLabels: string[];
|
17
|
-
columnLabels: string[];
|
18
|
-
valueAxis: DataFormatterValueAxis;
|
19
|
-
groupAxis: DataFormatterGroupAxis;
|
20
|
-
separateSeries: boolean;
|
21
|
-
}
|
22
|
-
export interface DataFormatterGridGridPartial {
|
23
|
-
seriesDirection?: SeriesDirection;
|
24
|
-
rowLabels?: string[];
|
25
|
-
columnLabels?: string[];
|
26
|
-
valueAxis?: Partial<DataFormatterValueAxis>;
|
27
|
-
groupAxis?: Partial<DataFormatterGroupAxis>;
|
28
|
-
separateSeries?: boolean;
|
29
|
-
}
|
30
|
-
export interface DataFormatterGridContainer {
|
31
|
-
gap: number;
|
32
|
-
rowAmount: number;
|
33
|
-
columnAmount: number;
|
34
|
-
}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { VisibleFilter, DataFormatterContainer, DataFormatterBase, DataFormatterBasePartial } from './DataFormatter';
|
2
|
-
import { DataFormatterGridGrid, DataFormatterGridGridPartial } from './DataFormatterGrid';
|
3
|
-
|
4
|
-
export interface DataFormatterMultiGrid extends DataFormatterBase<'multiGrid'> {
|
5
|
-
visibleFilter: VisibleFilter<'multiGrid'>;
|
6
|
-
gridList: Array<DataFormatterGridGrid>;
|
7
|
-
container: DataFormatterMultiGridContainer;
|
8
|
-
separateGrid: boolean;
|
9
|
-
}
|
10
|
-
export interface DataFormatterMultiGridPartial extends DataFormatterBasePartial<'multiGrid'> {
|
11
|
-
gridList?: Array<DataFormatterGridGridPartial>;
|
12
|
-
container?: Partial<DataFormatterMultiGridContainer>;
|
13
|
-
separateGrid?: boolean;
|
14
|
-
}
|
15
|
-
export interface DataFormatterMultiGridGrid extends DataFormatterGridGrid {
|
16
|
-
}
|
17
|
-
export interface DataFormatterMultiGridGridPartial extends DataFormatterGridGridPartial {
|
18
|
-
}
|
19
|
-
export interface DataFormatterMultiGridContainer extends DataFormatterContainer {
|
20
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { DataFormatterBase, DataFormatterBasePartial, DataFormatterValueAxis, VisibleFilter } from './DataFormatter';
|
2
|
-
|
3
|
-
export interface DataFormatterMultiValue extends DataFormatterBase<'multiValue'> {
|
4
|
-
visibleFilter: VisibleFilter<'multiValue'>;
|
5
|
-
categoryLabels: string[];
|
6
|
-
multiValue: Array<DataFormatterMultiValueMultiValue>;
|
7
|
-
xAxis: DataFormatterValueAxis;
|
8
|
-
yAxis: DataFormatterValueAxis;
|
9
|
-
}
|
10
|
-
export interface DataFormatterMultiValuePartial extends DataFormatterBasePartial<'multiValue'> {
|
11
|
-
visibleFilter?: VisibleFilter<'multiValue'>;
|
12
|
-
categoryLabels?: string[];
|
13
|
-
multiValue?: Array<Partial<DataFormatterMultiValueMultiValue>>;
|
14
|
-
xAxis?: Partial<DataFormatterValueAxis>;
|
15
|
-
yAxis?: Partial<DataFormatterValueAxis>;
|
16
|
-
}
|
17
|
-
export interface DataFormatterMultiValueMultiValue {
|
18
|
-
}
|