@orbcharts/core 3.0.0-beta.4 → 3.0.0-beta.5
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 +167 -163
- package/dist/orbcharts-core.umd.js +3 -3
- 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 +505 -505
- package/src/base/createBasePlugin.ts +153 -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 +235 -235
- 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 +176 -176
- package/src/grid/dataFormatterValidator.ts +101 -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 +41 -41
- package/src/multiGrid/dataFormatterValidator.ts +115 -115
- package/src/multiGrid/dataValidator.ts +12 -12
- package/src/multiValue/computedDataFn.ts +110 -110
- package/src/multiValue/contextObserverCallback.ts +160 -160
- package/src/multiValue/dataFormatterValidator.ts +9 -9
- package/src/multiValue/dataValidator.ts +9 -9
- package/src/relationship/computedDataFn.ts +125 -125
- package/src/relationship/contextObserverCallback.ts +12 -12
- package/src/relationship/dataFormatterValidator.ts +9 -9
- package/src/relationship/dataValidator.ts +9 -9
- package/src/series/computedDataFn.ts +88 -88
- package/src/series/contextObserverCallback.ts +100 -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 +683 -671
- package/src/utils/index.ts +9 -9
- package/src/utils/multiGridObservables.ts +392 -392
- package/src/utils/multiValueObservables.ts +661 -642
- package/src/utils/observables.ts +219 -219
- package/src/utils/orbchartsUtils.ts +377 -377
- 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/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-beta.
|
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-beta.
|
39
|
-
"d3": "^7.8.5",
|
40
|
-
"rxjs": "^7.8.1"
|
41
|
-
}
|
42
|
-
}
|
1
|
+
{
|
2
|
+
"name": "@orbcharts/core",
|
3
|
+
"version": "3.0.0-beta.5",
|
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-beta.4",
|
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 { DATA_FORMATTER_GRID_DEFAULT } 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: DATA_FORMATTER_GRID_DEFAULT,
|
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 { DATA_FORMATTER_GRID_DEFAULT } 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: DATA_FORMATTER_GRID_DEFAULT,
|
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 { DATA_FORMATTER_MULTI_GRID_DEFAULT } 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: DATA_FORMATTER_MULTI_GRID_DEFAULT,
|
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 { DATA_FORMATTER_MULTI_GRID_DEFAULT } 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: DATA_FORMATTER_MULTI_GRID_DEFAULT,
|
16
|
+
dataFormatterValidator,
|
17
|
+
computedDataFn,
|
18
|
+
dataValidator,
|
19
|
+
contextObserverCallback
|
20
|
+
},
|
21
|
+
element,
|
22
|
+
options
|
23
|
+
)
|
24
|
+
}
|
25
25
|
}
|
package/src/MultiValueChart.ts
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
import type {
|
2
|
-
ChartEntity,
|
3
|
-
ChartOptionsPartial } from '../lib/core-types'
|
4
|
-
import { DATA_FORMATTER_MULTI_VALUE_DEFAULT } from './defaults'
|
5
|
-
import { dataFormatterValidator } from './multiValue/dataFormatterValidator'
|
6
|
-
import { computedDataFn } from './multiValue/computedDataFn'
|
7
|
-
import { dataValidator } from './multiValue/dataValidator'
|
8
|
-
import { contextObserverCallback } from './multiValue/contextObserverCallback'
|
9
|
-
import { AbstractChart } from './AbstractChart'
|
10
|
-
|
11
|
-
export class MultiValueChart extends AbstractChart<'multiValue'> implements ChartEntity<'multiValue'> {
|
12
|
-
constructor (element: HTMLElement | Element, options?: ChartOptionsPartial<'multiValue'>) {
|
13
|
-
super(
|
14
|
-
{
|
15
|
-
defaultDataFormatter: DATA_FORMATTER_MULTI_VALUE_DEFAULT,
|
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 { DATA_FORMATTER_MULTI_VALUE_DEFAULT } from './defaults'
|
5
|
+
import { dataFormatterValidator } from './multiValue/dataFormatterValidator'
|
6
|
+
import { computedDataFn } from './multiValue/computedDataFn'
|
7
|
+
import { dataValidator } from './multiValue/dataValidator'
|
8
|
+
import { contextObserverCallback } from './multiValue/contextObserverCallback'
|
9
|
+
import { AbstractChart } from './AbstractChart'
|
10
|
+
|
11
|
+
export class MultiValueChart extends AbstractChart<'multiValue'> implements ChartEntity<'multiValue'> {
|
12
|
+
constructor (element: HTMLElement | Element, options?: ChartOptionsPartial<'multiValue'>) {
|
13
|
+
super(
|
14
|
+
{
|
15
|
+
defaultDataFormatter: DATA_FORMATTER_MULTI_VALUE_DEFAULT,
|
16
|
+
dataFormatterValidator,
|
17
|
+
computedDataFn,
|
18
|
+
dataValidator,
|
19
|
+
contextObserverCallback
|
20
|
+
},
|
21
|
+
element,
|
22
|
+
options
|
23
|
+
)
|
24
|
+
}
|
25
25
|
}
|
package/src/RelationshipChart.ts
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
import type {
|
2
|
-
ChartEntity,
|
3
|
-
ChartOptionsPartial } from '../lib/core-types'
|
4
|
-
import { DATA_FORMATTER_RELATIONAL_DEFAULT} from './defaults'
|
5
|
-
import { dataFormatterValidator } from './relationship/dataFormatterValidator'
|
6
|
-
import { computedDataFn } from './relationship/computedDataFn'
|
7
|
-
import { dataValidator } from './relationship/dataValidator'
|
8
|
-
import { contextObserverCallback } from './relationship/contextObserverCallback'
|
9
|
-
import { AbstractChart } from './AbstractChart'
|
10
|
-
|
11
|
-
export class RelationshipChart extends AbstractChart<'relationship'> implements ChartEntity<'relationship'> {
|
12
|
-
constructor (element: HTMLElement | Element, options?: ChartOptionsPartial<'relationship'>) {
|
13
|
-
super(
|
14
|
-
{
|
15
|
-
defaultDataFormatter: DATA_FORMATTER_RELATIONAL_DEFAULT,
|
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 { DATA_FORMATTER_RELATIONAL_DEFAULT} from './defaults'
|
5
|
+
import { dataFormatterValidator } from './relationship/dataFormatterValidator'
|
6
|
+
import { computedDataFn } from './relationship/computedDataFn'
|
7
|
+
import { dataValidator } from './relationship/dataValidator'
|
8
|
+
import { contextObserverCallback } from './relationship/contextObserverCallback'
|
9
|
+
import { AbstractChart } from './AbstractChart'
|
10
|
+
|
11
|
+
export class RelationshipChart extends AbstractChart<'relationship'> implements ChartEntity<'relationship'> {
|
12
|
+
constructor (element: HTMLElement | Element, options?: ChartOptionsPartial<'relationship'>) {
|
13
|
+
super(
|
14
|
+
{
|
15
|
+
defaultDataFormatter: DATA_FORMATTER_RELATIONAL_DEFAULT,
|
16
|
+
dataFormatterValidator,
|
17
|
+
computedDataFn,
|
18
|
+
dataValidator,
|
19
|
+
contextObserverCallback
|
20
|
+
},
|
21
|
+
element,
|
22
|
+
options
|
23
|
+
)
|
24
|
+
}
|
25
25
|
}
|
package/src/SeriesChart.ts
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
import type {
|
2
|
-
ChartEntity,
|
3
|
-
ChartOptionsPartial } from '../lib/core-types'
|
4
|
-
import { DATA_FORMATTER_SERIES_DEFAULT } from './defaults'
|
5
|
-
import { dataFormatterValidator } from './series/dataFormatterValidator'
|
6
|
-
import { computedDataFn } from './series/computedDataFn'
|
7
|
-
import { dataValidator } from './series/dataValidator'
|
8
|
-
import { contextObserverCallback } from './series/contextObserverCallback'
|
9
|
-
import { AbstractChart } from './AbstractChart'
|
10
|
-
|
11
|
-
export class SeriesChart extends AbstractChart<'series'> implements ChartEntity<'series'> {
|
12
|
-
constructor (element: HTMLElement | Element, options?: ChartOptionsPartial<'series'>) {
|
13
|
-
super(
|
14
|
-
{
|
15
|
-
defaultDataFormatter: DATA_FORMATTER_SERIES_DEFAULT,
|
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 { DATA_FORMATTER_SERIES_DEFAULT } from './defaults'
|
5
|
+
import { dataFormatterValidator } from './series/dataFormatterValidator'
|
6
|
+
import { computedDataFn } from './series/computedDataFn'
|
7
|
+
import { dataValidator } from './series/dataValidator'
|
8
|
+
import { contextObserverCallback } from './series/contextObserverCallback'
|
9
|
+
import { AbstractChart } from './AbstractChart'
|
10
|
+
|
11
|
+
export class SeriesChart extends AbstractChart<'series'> implements ChartEntity<'series'> {
|
12
|
+
constructor (element: HTMLElement | Element, options?: ChartOptionsPartial<'series'>) {
|
13
|
+
super(
|
14
|
+
{
|
15
|
+
defaultDataFormatter: DATA_FORMATTER_SERIES_DEFAULT,
|
16
|
+
dataFormatterValidator,
|
17
|
+
computedDataFn,
|
18
|
+
dataValidator,
|
19
|
+
contextObserverCallback
|
20
|
+
},
|
21
|
+
element,
|
22
|
+
options
|
23
|
+
)
|
24
|
+
}
|
25
25
|
}
|
package/src/TreeChart.ts
CHANGED
@@ -1,25 +1,25 @@
|
|
1
|
-
import type {
|
2
|
-
ChartEntity,
|
3
|
-
ChartOptionsPartial } from '../lib/core-types'
|
4
|
-
import { DATA_FORMATTER_TREE_DEFAULT } from './defaults'
|
5
|
-
import { dataFormatterValidator } from './tree/dataFormatterValidator'
|
6
|
-
import { computedDataFn } from './tree/computedDataFn'
|
7
|
-
import { dataValidator } from './tree/dataValidator'
|
8
|
-
import { contextObserverCallback } from './tree/contextObserverCallback'
|
9
|
-
import { AbstractChart } from './AbstractChart'
|
10
|
-
|
11
|
-
export class TreeChart extends AbstractChart<'tree'> implements ChartEntity<'tree'> {
|
12
|
-
constructor (element: HTMLElement | Element, options?: ChartOptionsPartial<'tree'>) {
|
13
|
-
super(
|
14
|
-
{
|
15
|
-
defaultDataFormatter: DATA_FORMATTER_TREE_DEFAULT,
|
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 { DATA_FORMATTER_TREE_DEFAULT } from './defaults'
|
5
|
+
import { dataFormatterValidator } from './tree/dataFormatterValidator'
|
6
|
+
import { computedDataFn } from './tree/computedDataFn'
|
7
|
+
import { dataValidator } from './tree/dataValidator'
|
8
|
+
import { contextObserverCallback } from './tree/contextObserverCallback'
|
9
|
+
import { AbstractChart } from './AbstractChart'
|
10
|
+
|
11
|
+
export class TreeChart extends AbstractChart<'tree'> implements ChartEntity<'tree'> {
|
12
|
+
constructor (element: HTMLElement | Element, options?: ChartOptionsPartial<'tree'>) {
|
13
|
+
super(
|
14
|
+
{
|
15
|
+
defaultDataFormatter: DATA_FORMATTER_TREE_DEFAULT,
|
16
|
+
dataFormatterValidator,
|
17
|
+
computedDataFn,
|
18
|
+
dataValidator,
|
19
|
+
contextObserverCallback
|
20
|
+
},
|
21
|
+
element,
|
22
|
+
options
|
23
|
+
)
|
24
|
+
}
|
25
25
|
}
|