@orbcharts/core 3.0.0-alpha.61 → 3.0.0-alpha.63
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/lib/core-types.d.ts +1 -0
- package/dist/orbcharts-core.es.js +3418 -2726
- 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 -388
- 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 -228
- 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 +102 -0
- package/src/grid/dataValidator.ts +13 -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 +116 -0
- package/src/multiGrid/dataValidator.ts +13 -0
- package/src/multiValue/{computeMultiValueData.ts → computedDataFn.ts} +176 -179
- package/src/multiValue/{createMultiValueContextObserver.ts → contextObserverCallback.ts} +12 -12
- package/src/multiValue/dataFormatterValidator.ts +10 -0
- package/src/multiValue/dataValidator.ts +10 -0
- package/src/relationship/{computeRelationshipData.ts → computedDataFn.ts} +125 -118
- package/src/relationship/{createRelationshipContextObserver.ts → contextObserverCallback.ts} +12 -12
- package/src/relationship/dataFormatterValidator.ts +10 -0
- package/src/relationship/dataValidator.ts +10 -0
- package/src/series/{computeSeriesData.ts → computedDataFn.ts} +88 -90
- package/src/series/{createSeriesContextObserver.ts → contextObserverCallback.ts} +100 -93
- package/src/series/dataFormatterValidator.ts +42 -0
- package/src/series/dataValidator.ts +13 -0
- package/src/tree/{computeTreeData.ts → computedDataFn.ts} +130 -132
- package/src/tree/{createTreeContextObserver.ts → contextObserverCallback.ts} +61 -61
- package/src/tree/dataFormatterValidator.ts +14 -0
- package/src/tree/dataValidator.ts +14 -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 +219 -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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Subject } from 'rxjs';
|
|
2
|
-
import { ComputedDataFn, ChartEntity, ChartType, ChartParamsPartial,
|
|
2
|
+
import { ComputedDataFn, DataValidator, ChartEntity, ChartType, ChartParamsPartial, ContextObserverCallback, ChartOptionsPartial, DataTypeMap, DataFormatterTypeMap, DataFormatterPartialTypeMap, DataFormatterValidator, EventTypeMap, PluginEntity } from '../lib/core-types';
|
|
3
3
|
import * as d3 from 'd3';
|
|
4
4
|
export declare abstract class AbstractChart<T extends ChartType> implements ChartEntity<T> {
|
|
5
5
|
selection: d3.Selection<SVGGElement, unknown, HTMLElement, unknown>;
|
|
@@ -9,9 +9,11 @@ export declare abstract class AbstractChart<T extends ChartType> implements Char
|
|
|
9
9
|
plugins$: Subject<PluginEntity<T, any, any>[]>;
|
|
10
10
|
chartParams$: Subject<ChartParamsPartial>;
|
|
11
11
|
event$: Subject<EventTypeMap<T>>;
|
|
12
|
-
constructor({ defaultDataFormatter, computedDataFn,
|
|
12
|
+
constructor({ defaultDataFormatter, dataFormatterValidator, computedDataFn, dataValidator, contextObserverCallback }: {
|
|
13
13
|
defaultDataFormatter: DataFormatterTypeMap<T>;
|
|
14
|
+
dataFormatterValidator: DataFormatterValidator<T>;
|
|
14
15
|
computedDataFn: ComputedDataFn<T>;
|
|
15
|
-
|
|
16
|
+
dataValidator: DataValidator<T>;
|
|
17
|
+
contextObserverCallback: ContextObserverCallback<T>;
|
|
16
18
|
}, element: HTMLElement | Element, options?: ChartOptionsPartial<T>);
|
|
17
19
|
}
|
package/dist/src/GridChart.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartEntity, ChartOptionsPartial } from '
|
|
1
|
+
import { ChartEntity, ChartOptionsPartial } from '../lib/core-types';
|
|
2
2
|
import { AbstractChart } from './AbstractChart';
|
|
3
3
|
|
|
4
4
|
export declare class GridChart extends AbstractChart<'grid'> implements ChartEntity<'grid'> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartEntity, ChartOptionsPartial } from '
|
|
1
|
+
import { ChartEntity, ChartOptionsPartial } from '../lib/core-types';
|
|
2
2
|
import { AbstractChart } from './AbstractChart';
|
|
3
3
|
|
|
4
4
|
export declare class MultiGridChart extends AbstractChart<'multiGrid'> implements ChartEntity<'multiGrid'> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartEntity, ChartOptionsPartial } from '
|
|
1
|
+
import { ChartEntity, ChartOptionsPartial } from '../lib/core-types';
|
|
2
2
|
import { AbstractChart } from './AbstractChart';
|
|
3
3
|
|
|
4
4
|
export declare class MultiValueChart extends AbstractChart<'multiValue'> implements ChartEntity<'multiValue'> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartEntity, ChartOptionsPartial } from '
|
|
1
|
+
import { ChartEntity, ChartOptionsPartial } from '../lib/core-types';
|
|
2
2
|
import { AbstractChart } from './AbstractChart';
|
|
3
3
|
|
|
4
4
|
export declare class RelationshipChart extends AbstractChart<'relationship'> implements ChartEntity<'relationship'> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartEntity, ChartOptionsPartial } from '
|
|
1
|
+
import { ChartEntity, ChartOptionsPartial } from '../lib/core-types';
|
|
2
2
|
import { AbstractChart } from './AbstractChart';
|
|
3
3
|
|
|
4
4
|
export declare class SeriesChart extends AbstractChart<'series'> implements ChartEntity<'series'> {
|
package/dist/src/TreeChart.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartEntity, ChartOptionsPartial } from '
|
|
1
|
+
import { ChartEntity, ChartOptionsPartial } from '../lib/core-types';
|
|
2
2
|
import { AbstractChart } from './AbstractChart';
|
|
3
3
|
|
|
4
4
|
export declare class TreeChart extends AbstractChart<'tree'> implements ChartEntity<'tree'> {
|
package/dist/src/defaults.d.ts
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import { ChartOptionsPartial } from '
|
|
2
|
-
import { DataSeries } from './types/DataSeries';
|
|
3
|
-
import { DataGrid } from './types/DataGrid';
|
|
4
|
-
import { DataMultiGrid } from './types/DataMultiGrid';
|
|
5
|
-
import { DataMultiValue } from './types/DataMultiValue';
|
|
6
|
-
import { DataTree } from './types/DataTree';
|
|
7
|
-
import { DataRelationship } from './types/DataRelationship';
|
|
8
|
-
import { DataFormatterValueAxis, DataFormatterGroupAxis, DataFormatterContainer } from './types/DataFormatter';
|
|
9
|
-
import { DataFormatterSeries } from './types/DataFormatterSeries';
|
|
10
|
-
import { DataFormatterGrid, DataFormatterGridGrid } from './types/DataFormatterGrid';
|
|
11
|
-
import { DataFormatterMultiGrid, DataFormatterMultiGridGrid } from './types/DataFormatterMultiGrid';
|
|
12
|
-
import { DataFormatterMultiValue } from './types/DataFormatterMultiValue';
|
|
13
|
-
import { DataFormatterTree } from './types/DataFormatterTree';
|
|
14
|
-
import { DataFormatterRelationship } from './types/DataFormatterRelationship';
|
|
15
|
-
import { ChartParams } from './types/ChartParams';
|
|
16
|
-
import { Padding } from './types/Padding';
|
|
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';
|
|
17
2
|
|
|
18
3
|
export declare const CHART_OPTIONS_DEFAULT: ChartOptionsPartial<any>;
|
|
19
4
|
export declare const PADDING_DEFAULT: Padding;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const defineGridPlugin: import('
|
|
1
|
+
export declare const defineGridPlugin: import('@orbcharts/core-types').DefinePlugin<"grid">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const defineMultiGridPlugin: import('
|
|
1
|
+
export declare const defineMultiGridPlugin: import('@orbcharts/core-types').DefinePlugin<"multiGrid">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const defineMultiValuePlugin: import('
|
|
1
|
+
export declare const defineMultiValuePlugin: import('@orbcharts/core-types').DefinePlugin<"multiValue">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const defineNoneDataPlugin: import('
|
|
1
|
+
export declare const defineNoneDataPlugin: import('@orbcharts/core-types').DefinePlugin<any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const defineRelationshipPlugin: import('
|
|
1
|
+
export declare const defineRelationshipPlugin: import('@orbcharts/core-types').DefinePlugin<"relationship">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const defineSeriesPlugin: import('
|
|
1
|
+
export declare const defineSeriesPlugin: import('@orbcharts/core-types').DefinePlugin<"series">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const defineTreePlugin: import('
|
|
1
|
+
export declare const defineTreePlugin: import('@orbcharts/core-types').DefinePlugin<"tree">;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ComputedDataFn, DataGrid, DataGridDatum, DataFormatterGridGrid } from '../../lib/core-types';
|
|
2
|
+
|
|
3
|
+
export declare function createTransposedDataGrid(data: DataGrid, dataFormatterGrid: DataFormatterGridGrid): DataGridDatum[][];
|
|
4
|
+
export declare const computedDataFn: ComputedDataFn<'grid'>;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -11,5 +11,5 @@ export { defineMultiValuePlugin } from './defineMultiValuePlugin';
|
|
|
11
11
|
export { defineNoneDataPlugin } from './defineNoneDataPlugin';
|
|
12
12
|
export { defineRelationshipPlugin } from './defineRelationshipPlugin';
|
|
13
13
|
export { defineTreePlugin } from './defineTreePlugin';
|
|
14
|
-
export * from './types';
|
|
15
14
|
export * from './utils';
|
|
15
|
+
export * from './defaults';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare function isPlainObject(variable: any): boolean;
|
|
2
2
|
export declare function isFunction(fn: any): boolean;
|
|
3
|
+
export declare function isDom(obj: any): boolean;
|
|
3
4
|
export declare function mergeOptionsWithDefault<Options extends {
|
|
4
5
|
[key: string]: any;
|
|
5
6
|
}>(options: {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function createOrbChartsErrorMessage(e: {
|
|
2
|
+
message: string;
|
|
3
|
+
stack: string;
|
|
4
|
+
}): string;
|
|
5
|
+
export declare function createValidatorErrorMessage({ columnName, expectToBe, from }: {
|
|
6
|
+
columnName: string;
|
|
7
|
+
expectToBe: string;
|
|
8
|
+
from: string;
|
|
9
|
+
}): string;
|
|
10
|
+
export declare function createValidatorWarningMessage({ columnName, expectToBe, from }: {
|
|
11
|
+
columnName: string;
|
|
12
|
+
expectToBe: string;
|
|
13
|
+
from: string;
|
|
14
|
+
}): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { ComputedDataTypeMap, ComputedDataGrid, ComputedDatumGrid, DataFormatterTypeMap, DataFormatterGrid, ComputedLayoutDatumGrid, ComputedLayoutDataGrid, GridContainerPosition, Layout, TransformData } from '
|
|
2
|
+
import { ComputedDataTypeMap, ComputedDataGrid, ComputedDatumGrid, DataFormatterTypeMap, DataFormatterGrid, ComputedLayoutDatumGrid, ComputedLayoutDataGrid, GridContainerPosition, Layout, TransformData } from '../../lib/core-types';
|
|
3
3
|
|
|
4
4
|
export declare const gridComputedLayoutDataObservable: ({ computedData$, fullDataFormatter$, layout$ }: {
|
|
5
5
|
computedData$: Observable<ComputedDataTypeMap<"grid">>;
|
|
@@ -30,7 +30,7 @@ export declare const gridAxesSizeObservable: ({ fullDataFormatter$, layout$ }: {
|
|
|
30
30
|
width: number;
|
|
31
31
|
height: number;
|
|
32
32
|
}>;
|
|
33
|
-
export declare const
|
|
33
|
+
export declare const gridSeriesLabelsObservable: ({ computedData$ }: {
|
|
34
34
|
computedData$: Observable<ComputedDataTypeMap<"grid">>;
|
|
35
35
|
}) => Observable<string[]>;
|
|
36
36
|
export declare const gridVisibleComputedDataObservable: ({ computedData$ }: {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export * from './orbchartsUtils';
|
|
2
|
-
export * from './observables';
|
|
3
|
-
export * from './d3Utils';
|
|
4
1
|
export * from './commonUtils';
|
|
2
|
+
export * from './d3Utils';
|
|
3
|
+
export * from './gridObservables';
|
|
4
|
+
export * from './multiGridObservables';
|
|
5
|
+
export * from './observables';
|
|
6
|
+
export * from './orbchartsUtils';
|
|
7
|
+
export * from './seriesObservables';
|
|
8
|
+
export * from './treeObservables';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Subject, Observable } from 'rxjs';
|
|
2
|
-
import { ChartParams, ComputedDataTypeMap, DataFormatterTypeMap, EventMultiGrid,
|
|
2
|
+
import { ChartParams, ComputedDataTypeMap, ContextObserverMultiGridDetail, DataFormatterTypeMap, EventMultiGrid, GridContainerPosition, Layout } from '../../lib/core-types';
|
|
3
3
|
|
|
4
4
|
export declare const multiGridEachDetailObservable: ({ fullDataFormatter$, computedData$, layout$, fullChartParams$, event$ }: {
|
|
5
5
|
fullDataFormatter$: Observable<DataFormatterTypeMap<"multiGrid">>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Subject, Observable } from 'rxjs';
|
|
2
|
-
import { ChartType, ChartParams, ComputedDatumTypeMap, EventTypeMap } from '
|
|
2
|
+
import { ChartType, ChartParams, ComputedDatumTypeMap, EventTypeMap } from '../../lib/core-types';
|
|
3
3
|
|
|
4
|
+
export declare function resizeObservable(elem: HTMLElement | Element): Observable<DOMRectReadOnly>;
|
|
4
5
|
export declare const highlightObservable: <T extends ChartType, D>({ datumList$, fullChartParams$, event$ }: {
|
|
5
6
|
datumList$: Observable<D[]>;
|
|
6
7
|
fullChartParams$: Observable<ChartParams>;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
import { ChartType } from '
|
|
2
|
-
import { ChartParams } from '../types/ChartParams';
|
|
3
|
-
import { DatumValue } from '../types/Data';
|
|
4
|
-
import { DataSeries } from '../types/DataSeries';
|
|
5
|
-
import { DataGrid, DataGridDatum } from '../types/DataGrid';
|
|
6
|
-
import { DataMultiGrid } from '../types/DataMultiGrid';
|
|
7
|
-
import { DataMultiValue } from '../types/DataMultiValue';
|
|
8
|
-
import { DataFormatterContainer } from '../types/DataFormatter';
|
|
9
|
-
import { SeriesDirection, DataFormatterGridGrid } from '../types/DataFormatterGrid';
|
|
10
|
-
import { SeriesContainerPosition } from '../types/ContextObserverSeries';
|
|
11
|
-
import { GridContainerPosition } from '../types/ContextObserverGrid';
|
|
12
|
-
import { Layout } from '../types/Layout';
|
|
1
|
+
import { ChartType, ChartParams, DatumValue, DataSeries, DataGrid, DataGridDatum, DataMultiGrid, DataMultiValue, DataFormatterContainer, SeriesDirection, DataFormatterGridGrid, SeriesContainerPosition, GridContainerPosition, Layout } from '../../lib/core-types';
|
|
13
2
|
import * as d3 from 'd3';
|
|
14
3
|
export declare function formatValueToLabel(value: any, valueFormatter: string | ((text: d3.NumberValue) => string)): string;
|
|
15
4
|
export declare function createDefaultDatumId(chartTypeOrPrefix: string, levelOneIndex: number, levelTwoIndex: number, levelThreeIndex?: number): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { ComputedDatumSeries, ComputedDataTypeMap, DataFormatterTypeMap, SeriesContainerPosition, Layout } from '
|
|
2
|
+
import { ComputedDatumSeries, ComputedDataTypeMap, DataFormatterTypeMap, SeriesContainerPosition, Layout } from '../../lib/core-types';
|
|
3
3
|
|
|
4
4
|
export declare const separateSeriesObservable: ({ fullDataFormatter$ }: {
|
|
5
5
|
fullDataFormatter$: Observable<DataFormatterTypeMap<"series">>;
|
|
@@ -7,10 +7,10 @@ export declare const separateSeriesObservable: ({ fullDataFormatter$ }: {
|
|
|
7
7
|
export declare const seriesLabelsObservable: ({ computedData$ }: {
|
|
8
8
|
computedData$: Observable<ComputedDataTypeMap<"series">>;
|
|
9
9
|
}) => Observable<string[]>;
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const seriesVisibleComputedDataObservable: ({ computedData$ }: {
|
|
11
11
|
computedData$: Observable<ComputedDataTypeMap<"series">>;
|
|
12
12
|
}) => Observable<ComputedDatumSeries[][]>;
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const seriesComputedLayoutDataObservable: ({ computedData$, fullDataFormatter$ }: {
|
|
14
14
|
computedData$: Observable<ComputedDataTypeMap<"series">>;
|
|
15
15
|
fullDataFormatter$: Observable<DataFormatterTypeMap<"series">>;
|
|
16
16
|
}) => Observable<ComputedDatumSeries[][]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { ComputedDataTree, DataFormatterTree } from '
|
|
2
|
+
import { ComputedDataTree, DataFormatterTree } from '../../lib/core-types';
|
|
3
3
|
|
|
4
4
|
export declare const nodeListObservable: ({ computedData$ }: {
|
|
5
5
|
computedData$: Observable<ComputedDataTree>;
|
package/package.json
CHANGED
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@orbcharts/core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
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
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@orbcharts/core",
|
|
3
|
+
"version": "3.0.0-alpha.63",
|
|
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-alpha.2",
|
|
39
|
+
"d3": "^7.8.5",
|
|
40
|
+
"rxjs": "^7.8.1"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/src/AbstractChart.ts
CHANGED
|
@@ -1,48 +1,57 @@
|
|
|
1
|
-
import * as d3 from 'd3'
|
|
2
|
-
import {
|
|
3
|
-
Subject } from 'rxjs'
|
|
4
|
-
import type {
|
|
5
|
-
ComputedDataFn,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
+
}
|