@orbcharts/core 3.0.0-alpha.40 → 3.0.0-alpha.42

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. package/LICENSE +200 -200
  2. package/dist/orbcharts-core.es.js +1152 -1124
  3. package/dist/orbcharts-core.umd.js +2 -2
  4. package/dist/src/types/ChartParams.d.ts +1 -1
  5. package/dist/src/types/ContextObserverGrid.d.ts +1 -0
  6. package/dist/src/types/ContextObserverMultiGrid.d.ts +1 -0
  7. package/dist/src/types/ContextObserverSeries.d.ts +1 -0
  8. package/dist/src/types/ContextObserverTree.d.ts +1 -0
  9. package/dist/src/utils/observables.d.ts +1 -0
  10. package/package.json +41 -41
  11. package/src/AbstractChart.ts +48 -48
  12. package/src/GridChart.ts +20 -20
  13. package/src/MultiGridChart.ts +20 -20
  14. package/src/MultiValueChart.ts +20 -20
  15. package/src/RelationshipChart.ts +20 -20
  16. package/src/SeriesChart.ts +20 -20
  17. package/src/TreeChart.ts +20 -20
  18. package/src/base/createBaseChart.ts +367 -367
  19. package/src/base/createBasePlugin.ts +89 -89
  20. package/src/defaults.ts +248 -247
  21. package/src/defineGridPlugin.ts +3 -3
  22. package/src/defineMultiGridPlugin.ts +3 -3
  23. package/src/defineMultiValuePlugin.ts +3 -3
  24. package/src/defineNoneDataPlugin.ts +4 -4
  25. package/src/defineRelationshipPlugin.ts +3 -3
  26. package/src/defineSeriesPlugin.ts +3 -3
  27. package/src/defineTreePlugin.ts +3 -3
  28. package/src/grid/computeGridData.ts +205 -205
  29. package/src/grid/createGridContextObserver.ts +130 -124
  30. package/src/grid/gridObservables.ts +486 -486
  31. package/src/index.ts +21 -21
  32. package/src/multiGrid/computeMultiGridData.ts +173 -173
  33. package/src/multiGrid/createMultiGridContextObserver.ts +40 -34
  34. package/src/multiGrid/multiGridObservables.ts +285 -285
  35. package/src/multiValue/computeMultiValueData.ts +136 -136
  36. package/src/multiValue/createMultiValueContextObserver.ts +12 -12
  37. package/src/relationship/computeRelationshipData.ts +106 -106
  38. package/src/relationship/createRelationshipContextObserver.ts +12 -12
  39. package/src/series/computeSeriesData.ts +153 -153
  40. package/src/series/createSeriesContextObserver.ts +38 -33
  41. package/src/series/seriesObservables.ts +23 -23
  42. package/src/tree/computeTreeData.ts +128 -128
  43. package/src/tree/createTreeContextObserver.ts +61 -56
  44. package/src/tree/treeObservables.ts +94 -94
  45. package/src/types/Chart.ts +48 -48
  46. package/src/types/ChartParams.ts +51 -51
  47. package/src/types/ComputedData.ts +82 -82
  48. package/src/types/ComputedDataGrid.ts +13 -13
  49. package/src/types/ComputedDataMultiGrid.ts +2 -2
  50. package/src/types/ComputedDataMultiValue.ts +9 -9
  51. package/src/types/ComputedDataRelationship.ts +19 -19
  52. package/src/types/ComputedDataSeries.ts +7 -7
  53. package/src/types/ComputedDataTree.ts +19 -19
  54. package/src/types/ContextObserver.ts +38 -38
  55. package/src/types/ContextObserverGrid.ts +33 -33
  56. package/src/types/ContextObserverMultiGrid.ts +28 -27
  57. package/src/types/ContextObserverMultiValue.ts +4 -4
  58. package/src/types/ContextObserverRelationship.ts +4 -4
  59. package/src/types/ContextObserverSeries.ts +8 -7
  60. package/src/types/ContextObserverTree.ts +11 -10
  61. package/src/types/ContextSubject.ts +18 -18
  62. package/src/types/Data.ts +45 -45
  63. package/src/types/DataFormatter.ts +95 -95
  64. package/src/types/DataFormatterGrid.ts +55 -55
  65. package/src/types/DataFormatterMultiGrid.ts +42 -42
  66. package/src/types/DataFormatterMultiValue.ts +20 -20
  67. package/src/types/DataFormatterRelationship.ts +22 -22
  68. package/src/types/DataFormatterSeries.ts +29 -29
  69. package/src/types/DataFormatterTree.ts +12 -12
  70. package/src/types/DataGrid.ts +11 -11
  71. package/src/types/DataMultiGrid.ts +6 -6
  72. package/src/types/DataMultiValue.ts +12 -12
  73. package/src/types/DataRelationship.ts +27 -27
  74. package/src/types/DataSeries.ts +11 -11
  75. package/src/types/DataTree.ts +20 -20
  76. package/src/types/Event.ts +153 -153
  77. package/src/types/Layout.ts +11 -11
  78. package/src/types/Padding.ts +5 -5
  79. package/src/types/Plugin.ts +60 -60
  80. package/src/types/TransformData.ts +7 -7
  81. package/src/types/index.ts +37 -37
  82. package/src/utils/commonUtils.ts +50 -50
  83. package/src/utils/d3Utils.ts +89 -89
  84. package/src/utils/index.ts +4 -4
  85. package/src/utils/observables.ts +202 -181
  86. package/src/utils/orbchartsUtils.ts +253 -253
  87. package/tsconfig.json +13 -13
  88. package/vite.config.js +44 -44
@@ -1,8 +1,9 @@
1
- import { Observable } from 'rxjs'
2
- import type { ContextObserverBase } from './ContextObserver'
3
- import type { ComputedDatumSeries } from './ComputedDataSeries'
4
-
5
- export interface ContextObserverSeries<PluginParams> extends ContextObserverBase<'series', PluginParams> {
6
- seriesHighlight$: Observable<ComputedDatumSeries[]>
7
- SeriesDataMap$: Observable<Map<string, ComputedDatumSeries[]>>
1
+ import { Observable } from 'rxjs'
2
+ import type { ContextObserverBase } from './ContextObserver'
3
+ import type { ComputedDatumSeries } from './ComputedDataSeries'
4
+
5
+ export interface ContextObserverSeries<PluginParams> extends ContextObserverBase<'series', PluginParams> {
6
+ textSizePx$: Observable<number>
7
+ seriesHighlight$: Observable<ComputedDatumSeries[]>
8
+ SeriesDataMap$: Observable<Map<string, ComputedDatumSeries[]>>
8
9
  }
@@ -1,10 +1,11 @@
1
- import { Observable } from 'rxjs'
2
- import type { ContextObserverBase } from './ContextObserver'
3
- import type { ComputedDataTree } from './ComputedDataTree'
4
-
5
- export interface ContextObserverTree<PluginParams> extends ContextObserverBase<'tree', PluginParams> {
6
- treeHighlight$: Observable<ComputedDataTree[]>
7
- existCategoryLabels$: Observable<string[]>
8
- CategoryDataMap$: Observable<Map<string, ComputedDataTree[]>>
9
- visibleComputedData$: Observable<ComputedDataTree>
10
- }
1
+ import { Observable } from 'rxjs'
2
+ import type { ContextObserverBase } from './ContextObserver'
3
+ import type { 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,18 +1,18 @@
1
- import { Observable, Subject, BehaviorSubject } from 'rxjs'
2
- import type { ChartType } from './Chart'
3
- import type { EventTypeMap } from './Event'
4
- import type { ChartParamsPartial } from './ChartParams'
5
- // import type { Data } from './Data'
6
- import type { DataFormatterPartialTypeMap } from './DataFormatter'
7
- import type { DataTypeMap } from './Data'
8
- import type { DataFormatterTypeMap } from './DataFormatter'
9
- import type { PluginEntity } from './Plugin'
10
-
11
- export interface ContextSubject<T extends ChartType> {
12
- data$: Subject<DataTypeMap<T>>
13
- dataFormatter$: Subject<DataFormatterPartialTypeMap<T>>
14
- plugins$: Subject<PluginEntity<T, any, any>[]>
15
- // pluginParams$: Subject<{[keys: string]: unknown}>
16
- chartParams$: Subject<ChartParamsPartial>
17
- event$: Subject<EventTypeMap<T>>
18
- }
1
+ import { Observable, Subject, BehaviorSubject } from 'rxjs'
2
+ import type { ChartType } from './Chart'
3
+ import type { EventTypeMap } from './Event'
4
+ import type { ChartParamsPartial } from './ChartParams'
5
+ // import type { Data } from './Data'
6
+ import type { DataFormatterPartialTypeMap } from './DataFormatter'
7
+ import type { DataTypeMap } from './Data'
8
+ import type { DataFormatterTypeMap } from './DataFormatter'
9
+ import type { PluginEntity } from './Plugin'
10
+
11
+ export interface ContextSubject<T extends ChartType> {
12
+ data$: Subject<DataTypeMap<T>>
13
+ dataFormatter$: Subject<DataFormatterPartialTypeMap<T>>
14
+ plugins$: Subject<PluginEntity<T, any, any>[]>
15
+ // pluginParams$: Subject<{[keys: string]: unknown}>
16
+ chartParams$: Subject<ChartParamsPartial>
17
+ event$: Subject<EventTypeMap<T>>
18
+ }
package/src/types/Data.ts CHANGED
@@ -1,45 +1,45 @@
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
- // 基本欄位(皆為可選,無填寫則在計算時產生預設值)
10
- export interface DatumBase {
11
- id?: string
12
- label?: string
13
- description?: string
14
- data?: any // 使用者注入的資料
15
- }
16
-
17
- // 需具備value的datum
18
- export interface DatumValue {
19
- value: number | null
20
- }
21
-
22
- // 透過類型選擇Data
23
- export type DataTypeMap<T extends ChartType> = T extends 'series' ? DataSeries
24
- : T extends 'grid' ? DataGrid
25
- : T extends 'multiGrid' ? DataMultiGrid
26
- : T extends 'multiValue' ? DataMultiValue
27
- : T extends 'relationship' ? DataRelationship
28
- : T extends 'tree' ? DataTree
29
- : unknown
30
-
31
- // 透過類型選擇Datum
32
- export type DatumTypeMap<T extends ChartType> = T extends 'series' ? DataSeriesDatum | DataSeriesValue
33
- : T extends 'grid' ? DataGridDatum | DataGridValue
34
- : T extends 'multiGrid' ? DataMultiGridDatum | DataMultiGridValue
35
- : T extends 'multiValue' ? DataMultiValueDatum | DataMultiValueValue
36
- : T extends 'relationship' ? Node | Edge
37
- : T extends 'tree' ? DataTreeDatum | DataTreeObj
38
- : unknown
39
-
40
- // export type Data = DataSeries
41
- // | DataGrid
42
- // | DataMultiGrid
43
- // | DataMultiValue
44
- // | DataTree
45
- // | DataRelationship
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
+ // 基本欄位(皆為可選,無填寫則在計算時產生預設值)
10
+ export interface DatumBase {
11
+ id?: string
12
+ label?: string
13
+ description?: string
14
+ data?: any // 使用者注入的資料
15
+ }
16
+
17
+ // 需具備value的datum
18
+ export interface DatumValue {
19
+ value: number | null
20
+ }
21
+
22
+ // 透過類型選擇Data
23
+ export type DataTypeMap<T extends ChartType> = T extends 'series' ? DataSeries
24
+ : T extends 'grid' ? DataGrid
25
+ : T extends 'multiGrid' ? DataMultiGrid
26
+ : T extends 'multiValue' ? DataMultiValue
27
+ : T extends 'relationship' ? DataRelationship
28
+ : T extends 'tree' ? DataTree
29
+ : unknown
30
+
31
+ // 透過類型選擇Datum
32
+ export type DatumTypeMap<T extends ChartType> = T extends 'series' ? DataSeriesDatum | DataSeriesValue
33
+ : T extends 'grid' ? DataGridDatum | DataGridValue
34
+ : T extends 'multiGrid' ? DataMultiGridDatum | DataMultiGridValue
35
+ : T extends 'multiValue' ? DataMultiValueDatum | DataMultiValueValue
36
+ : T extends 'relationship' ? Node | Edge
37
+ : T extends 'tree' ? DataTreeDatum | DataTreeObj
38
+ : unknown
39
+
40
+ // export type Data = DataSeries
41
+ // | DataGrid
42
+ // | DataMultiGrid
43
+ // | DataMultiValue
44
+ // | DataTree
45
+ // | DataRelationship
@@ -1,95 +1,95 @@
1
- import type { ChartType } from './Chart'
2
- import type { ChartParams } from './ChartParams'
3
- import type { DataTypeMap, DatumTypeMap } from './Data'
4
- import type { DataFormatterSeries, DataFormatterSeriesPartial } from './DataFormatterSeries'
5
- import type { DataFormatterGrid, DataFormatterGridPartial } from './DataFormatterGrid'
6
- import type { DataFormatterMultiGrid, DataFormatterMultiGridPartial } from './DataFormatterMultiGrid'
7
- import type { DataFormatterMultiValue, DataFormatterMultiValuePartial } from './DataFormatterMultiValue'
8
- import type { DataFormatterTree, DataFormatterTreePartial } from './DataFormatterTree'
9
- import type { DataFormatterRelationship, DataFormatterRelationshipPartial } from './DataFormatterRelationship'
10
- import type { AxisPosition } from './Axis'
11
- import type { Layout } from './Layout'
12
-
13
- // export type DataFormatter = DataFormatterSeries
14
- // | DataFormatterGrid
15
- // | DataFormatterMultiGrid
16
- // | DataFormatterMultiValue
17
- // | DataFormatterTree
18
- // | DataFormatterRelationship
19
-
20
- // export type DataFormatterPartial = DataFormatterSeriesPartial
21
- // | DataFormatterGridPartial
22
- // | DataFormatterMultiGridPartial
23
- // | DataFormatterMultiValuePartial
24
- // | DataFormatterTreePartial
25
- // | DataFormatterRelationshipPartial
26
-
27
- // dataFormatter計算當中會使用的資料
28
- export interface DataFormatterContext<T extends ChartType> {
29
- data: DataTypeMap<T>
30
- dataFormatter: DataFormatterTypeMap<T>
31
- chartParams: ChartParams
32
- layout: Layout
33
- }
34
-
35
-
36
- // 透過類型選擇DataFormatter
37
- export type DataFormatterTypeMap<T extends ChartType> = T extends 'series' ? DataFormatterSeries
38
- : T extends 'grid' ? DataFormatterGrid
39
- : T extends 'multiGrid' ? DataFormatterMultiGrid
40
- : T extends 'multiValue' ? DataFormatterMultiValue
41
- : T extends 'relationship' ? DataFormatterRelationship
42
- : T extends 'tree' ? DataFormatterTree
43
- : DataFormatterBase<T>
44
-
45
- // 透過類型選擇DataFormatter(可選欄位)
46
- export type DataFormatterPartialTypeMap<T extends ChartType> = T extends 'series' ? DataFormatterSeriesPartial
47
- : T extends 'grid' ? DataFormatterGridPartial
48
- : T extends 'multiGrid' ? DataFormatterMultiGridPartial
49
- : T extends 'multiValue' ? DataFormatterMultiValuePartial
50
- : T extends 'relationship' ? DataFormatterRelationshipPartial
51
- : T extends 'tree' ? DataFormatterTreePartial
52
- : DataFormatterBasePartial<T>
53
-
54
- // 基本介面
55
- export interface DataFormatterBase<T extends ChartType> {
56
- type: T
57
- }
58
-
59
- export type DataFormatterBasePartial<T extends ChartType> = Partial<DataFormatterBase<T>>
60
-
61
- // 有value
62
- // export interface DataFormatterValue {
63
- // valueFormat: ValueFormat
64
- // }
65
-
66
- // 有axis
67
- // export interface DataFormatterAxis {
68
- // // domainMinValue?: number
69
- // // domainMaxValue?: number
70
- // // domainMinRange?: number
71
- // // domainMaxRange?: number
72
- // valueDomain: [number | 'auto', number | 'auto']
73
- // valueRange: [number, number] // 0-1
74
- // }
75
-
76
- export interface DataFormatterValueAxis {
77
- position: AxisPosition
78
- scaleDomain: [number | 'auto', number | 'auto']
79
- scaleRange: [number, number]
80
- label: string
81
- }
82
-
83
- export interface DataFormatterGroupAxis {
84
- position: AxisPosition
85
- scaleDomain: [number | 'auto', number | 'auto']
86
- scalePadding: number
87
- label: string
88
- }
89
-
90
-
91
- // export type ValueFormat = string | ((text: d3.NumberValue) => string)
92
-
93
- export type VisibleFilter<T extends ChartType> = (datum: DatumTypeMap<T>, rowIndex: number, columnIndex: number, context: DataFormatterContext<T>) => boolean | null
94
-
95
- export type TooltipContentFormat<T extends ChartType> = (datum: DatumTypeMap<T>, rowIndex: number, columnIndex: number, context: DataFormatterContext<T>) => string | null
1
+ import type { ChartType } from './Chart'
2
+ import type { ChartParams } from './ChartParams'
3
+ import type { DataTypeMap, DatumTypeMap } from './Data'
4
+ import type { DataFormatterSeries, DataFormatterSeriesPartial } from './DataFormatterSeries'
5
+ import type { DataFormatterGrid, DataFormatterGridPartial } from './DataFormatterGrid'
6
+ import type { DataFormatterMultiGrid, DataFormatterMultiGridPartial } from './DataFormatterMultiGrid'
7
+ import type { DataFormatterMultiValue, DataFormatterMultiValuePartial } from './DataFormatterMultiValue'
8
+ import type { DataFormatterTree, DataFormatterTreePartial } from './DataFormatterTree'
9
+ import type { DataFormatterRelationship, DataFormatterRelationshipPartial } from './DataFormatterRelationship'
10
+ import type { AxisPosition } from './Axis'
11
+ import type { Layout } from './Layout'
12
+
13
+ // export type DataFormatter = DataFormatterSeries
14
+ // | DataFormatterGrid
15
+ // | DataFormatterMultiGrid
16
+ // | DataFormatterMultiValue
17
+ // | DataFormatterTree
18
+ // | DataFormatterRelationship
19
+
20
+ // export type DataFormatterPartial = DataFormatterSeriesPartial
21
+ // | DataFormatterGridPartial
22
+ // | DataFormatterMultiGridPartial
23
+ // | DataFormatterMultiValuePartial
24
+ // | DataFormatterTreePartial
25
+ // | DataFormatterRelationshipPartial
26
+
27
+ // dataFormatter計算當中會使用的資料
28
+ export interface DataFormatterContext<T extends ChartType> {
29
+ data: DataTypeMap<T>
30
+ dataFormatter: DataFormatterTypeMap<T>
31
+ chartParams: ChartParams
32
+ layout: Layout
33
+ }
34
+
35
+
36
+ // 透過類型選擇DataFormatter
37
+ export type DataFormatterTypeMap<T extends ChartType> = T extends 'series' ? DataFormatterSeries
38
+ : T extends 'grid' ? DataFormatterGrid
39
+ : T extends 'multiGrid' ? DataFormatterMultiGrid
40
+ : T extends 'multiValue' ? DataFormatterMultiValue
41
+ : T extends 'relationship' ? DataFormatterRelationship
42
+ : T extends 'tree' ? DataFormatterTree
43
+ : DataFormatterBase<T>
44
+
45
+ // 透過類型選擇DataFormatter(可選欄位)
46
+ export type DataFormatterPartialTypeMap<T extends ChartType> = T extends 'series' ? DataFormatterSeriesPartial
47
+ : T extends 'grid' ? DataFormatterGridPartial
48
+ : T extends 'multiGrid' ? DataFormatterMultiGridPartial
49
+ : T extends 'multiValue' ? DataFormatterMultiValuePartial
50
+ : T extends 'relationship' ? DataFormatterRelationshipPartial
51
+ : T extends 'tree' ? DataFormatterTreePartial
52
+ : DataFormatterBasePartial<T>
53
+
54
+ // 基本介面
55
+ export interface DataFormatterBase<T extends ChartType> {
56
+ type: T
57
+ }
58
+
59
+ export type DataFormatterBasePartial<T extends ChartType> = Partial<DataFormatterBase<T>>
60
+
61
+ // 有value
62
+ // export interface DataFormatterValue {
63
+ // valueFormat: ValueFormat
64
+ // }
65
+
66
+ // 有axis
67
+ // export interface DataFormatterAxis {
68
+ // // domainMinValue?: number
69
+ // // domainMaxValue?: number
70
+ // // domainMinRange?: number
71
+ // // domainMaxRange?: number
72
+ // valueDomain: [number | 'auto', number | 'auto']
73
+ // valueRange: [number, number] // 0-1
74
+ // }
75
+
76
+ export interface DataFormatterValueAxis {
77
+ position: AxisPosition
78
+ scaleDomain: [number | 'auto', number | 'auto']
79
+ scaleRange: [number, number]
80
+ label: string
81
+ }
82
+
83
+ export interface DataFormatterGroupAxis {
84
+ position: AxisPosition
85
+ scaleDomain: [number | 'auto', number | 'auto']
86
+ scalePadding: number
87
+ label: string
88
+ }
89
+
90
+
91
+ // export type ValueFormat = string | ((text: d3.NumberValue) => string)
92
+
93
+ export type VisibleFilter<T extends ChartType> = (datum: DatumTypeMap<T>, rowIndex: number, columnIndex: number, context: DataFormatterContext<T>) => boolean | null
94
+
95
+ export type TooltipContentFormat<T extends ChartType> = (datum: DatumTypeMap<T>, rowIndex: number, columnIndex: number, context: DataFormatterContext<T>) => string | null
@@ -1,56 +1,56 @@
1
- import type { DataGridDatum, DataGridValue } from './DataGrid'
2
- import type { DataFormatterBase, DataFormatterBasePartial, DataFormatterValueAxis, DataFormatterGroupAxis, VisibleFilter } from './DataFormatter'
3
- // import type { AxisPosition } from './Axis'
4
-
5
- export type SeriesDirection = 'row' | 'column' // default: 'row'
6
-
7
- export interface DataFormatterGrid extends DataFormatterBase<'grid'> {
8
- grid: DataFormatterGridGrid
9
- container: DataFormatterGridContainer
10
- // visibleGroupRange: [number, number] | null
11
- // colorsPredicate: (datum: DataGridDatum | DataGridValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'grid'>) => string
12
- }
13
-
14
- export interface DataFormatterGridPartial extends DataFormatterBasePartial<'grid'> {
15
- grid?: DataFormatterGridGridPartial
16
- container?: Partial<DataFormatterGridContainer>
17
- }
18
-
19
- export interface DataFormatterGridGrid {
20
- visibleFilter: VisibleFilter<'grid'>
21
- gridData: DataFormatterGridGridData
22
- valueAxis: DataFormatterValueAxis
23
- groupAxis: DataFormatterGroupAxis
24
- slotIndex: number | null
25
- seriesSlotIndexes: number[] | null
26
- }
27
-
28
- export interface DataFormatterGridGridPartial {
29
- visibleFilter?: VisibleFilter<'grid'>
30
- gridData?: Partial<DataFormatterGridGridData>
31
- valueAxis?: Partial<DataFormatterValueAxis>
32
- groupAxis?: Partial<DataFormatterGroupAxis>
33
- slotIndex?: number | null
34
- seriesSlotIndexes?: number[] | null
35
- }
36
-
37
- export interface DataFormatterGridContainer {
38
- gap: number
39
- rowAmount: number
40
- columnAmount: number
41
- }
42
-
43
- // grid欄位
44
- export interface DataFormatterGridGridData {
45
- seriesDirection: SeriesDirection
46
- rowLabels: string[]
47
- columnLabels: string[]
48
- }
49
-
50
- // const test: DataFormatterGridPartial = {
51
- // type: 'grid',
52
- // grid: {
53
- // rowLabels: [],
54
- // // a: ''
55
- // }
1
+ import type { DataGridDatum, DataGridValue } from './DataGrid'
2
+ import type { DataFormatterBase, DataFormatterBasePartial, DataFormatterValueAxis, DataFormatterGroupAxis, VisibleFilter } from './DataFormatter'
3
+ // import type { AxisPosition } from './Axis'
4
+
5
+ export type SeriesDirection = 'row' | 'column' // default: 'row'
6
+
7
+ export interface DataFormatterGrid extends DataFormatterBase<'grid'> {
8
+ grid: DataFormatterGridGrid
9
+ container: DataFormatterGridContainer
10
+ // visibleGroupRange: [number, number] | null
11
+ // colorsPredicate: (datum: DataGridDatum | DataGridValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'grid'>) => string
12
+ }
13
+
14
+ export interface DataFormatterGridPartial extends DataFormatterBasePartial<'grid'> {
15
+ grid?: DataFormatterGridGridPartial
16
+ container?: Partial<DataFormatterGridContainer>
17
+ }
18
+
19
+ export interface DataFormatterGridGrid {
20
+ visibleFilter: VisibleFilter<'grid'>
21
+ gridData: DataFormatterGridGridData
22
+ valueAxis: DataFormatterValueAxis
23
+ groupAxis: DataFormatterGroupAxis
24
+ slotIndex: number | null
25
+ seriesSlotIndexes: number[] | null
26
+ }
27
+
28
+ export interface DataFormatterGridGridPartial {
29
+ visibleFilter?: VisibleFilter<'grid'>
30
+ gridData?: Partial<DataFormatterGridGridData>
31
+ valueAxis?: Partial<DataFormatterValueAxis>
32
+ groupAxis?: Partial<DataFormatterGroupAxis>
33
+ slotIndex?: number | null
34
+ seriesSlotIndexes?: number[] | null
35
+ }
36
+
37
+ export interface DataFormatterGridContainer {
38
+ gap: number
39
+ rowAmount: number
40
+ columnAmount: number
41
+ }
42
+
43
+ // grid欄位
44
+ export interface DataFormatterGridGridData {
45
+ seriesDirection: SeriesDirection
46
+ rowLabels: string[]
47
+ columnLabels: string[]
48
+ }
49
+
50
+ // const test: DataFormatterGridPartial = {
51
+ // type: 'grid',
52
+ // grid: {
53
+ // rowLabels: [],
54
+ // // a: ''
55
+ // }
56
56
  // }
@@ -1,43 +1,43 @@
1
- import type { VisibleFilter } from './DataFormatter'
2
- import type { DataFormatterGridGrid, DataFormatterGridGridPartial, DataFormatterGridContainer } from './DataFormatterGrid'
3
- import type {
4
- DataFormatterBase,
5
- DataFormatterBasePartial,
6
- DataFormatterValueAxis,
7
- DataFormatterGroupAxis,
8
- DataFormatterContext } from './DataFormatter'
9
- import type { AxisPosition } from './Axis'
10
-
11
- export interface DataFormatterMultiGrid extends DataFormatterBase<'multiGrid'> {
12
- // visibleFilter: VisibleFilter<'multiGrid'>
13
- gridList: Array<DataFormatterGridGrid>
14
- container: DataFormatterMultiGridContainer
15
- }
16
-
17
- export interface DataFormatterMultiGridPartial extends DataFormatterBasePartial<'multiGrid'> {
18
- // visibleFilter?: VisibleFilter<'multiGrid'>
19
- gridList?: Array<DataFormatterGridGridPartial>
20
- container?: Partial<DataFormatterMultiGridContainer>
21
- }
22
-
23
- export interface DataFormatterMultiGridGrid extends DataFormatterGridGrid {
24
-
25
- }
26
-
27
- export interface DataFormatterMultiGridGridPartial extends DataFormatterGridGridPartial {
28
-
29
- }
30
-
31
- // container
32
- export interface DataFormatterMultiGridContainer extends DataFormatterGridContainer {
33
-
34
- }
35
-
36
- // multiGrid欄位
37
- // export interface DataFormatterMultiGridMultiGrid {
38
- // grid: DataFormatterGridGridData
39
- // valueAxis: DataFormatterValueAxis // default: 'left'
40
- // groupAxis: DataFormatterGroupAxis // default: 'bottom'
41
- // colorsPredicate: (datum: DataGridDatum | DataGridValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'grid'>) => string
42
- // // colors: Colors
1
+ import type { VisibleFilter } from './DataFormatter'
2
+ import type { DataFormatterGridGrid, DataFormatterGridGridPartial, DataFormatterGridContainer } from './DataFormatterGrid'
3
+ import type {
4
+ DataFormatterBase,
5
+ DataFormatterBasePartial,
6
+ DataFormatterValueAxis,
7
+ DataFormatterGroupAxis,
8
+ DataFormatterContext } from './DataFormatter'
9
+ import type { AxisPosition } from './Axis'
10
+
11
+ export interface DataFormatterMultiGrid extends DataFormatterBase<'multiGrid'> {
12
+ // visibleFilter: VisibleFilter<'multiGrid'>
13
+ gridList: Array<DataFormatterGridGrid>
14
+ container: DataFormatterMultiGridContainer
15
+ }
16
+
17
+ export interface DataFormatterMultiGridPartial extends DataFormatterBasePartial<'multiGrid'> {
18
+ // visibleFilter?: VisibleFilter<'multiGrid'>
19
+ gridList?: Array<DataFormatterGridGridPartial>
20
+ container?: Partial<DataFormatterMultiGridContainer>
21
+ }
22
+
23
+ export interface DataFormatterMultiGridGrid extends DataFormatterGridGrid {
24
+
25
+ }
26
+
27
+ export interface DataFormatterMultiGridGridPartial extends DataFormatterGridGridPartial {
28
+
29
+ }
30
+
31
+ // container
32
+ export interface DataFormatterMultiGridContainer extends DataFormatterGridContainer {
33
+
34
+ }
35
+
36
+ // multiGrid欄位
37
+ // export interface DataFormatterMultiGridMultiGrid {
38
+ // grid: DataFormatterGridGridData
39
+ // valueAxis: DataFormatterValueAxis // default: 'left'
40
+ // groupAxis: DataFormatterGroupAxis // default: 'bottom'
41
+ // colorsPredicate: (datum: DataGridDatum | DataGridValue, rowIndex: number, columnIndex: number, context: DataFormatterContext<'grid'>) => string
42
+ // // colors: Colors
43
43
  // }
@@ -1,21 +1,21 @@
1
- import { DataMultiValueDatum, DataMultiValue } from './DataMultiValue'
2
- import { DataFormatterBase, DataFormatterBasePartial, DataFormatterValueAxis, VisibleFilter } from './DataFormatter'
3
-
4
- export interface DataFormatterMultiValue extends DataFormatterBase<'multiValue'> {
5
- visibleFilter: VisibleFilter<'multiValue'>
6
- // labelFormat: (datum: unknown) => string
7
- multiValue: Array<DataFormatterMultiValueMultiValue>
8
- xAxis: DataFormatterValueAxis
9
- yAxis: DataFormatterValueAxis
10
- }
11
-
12
- export interface DataFormatterMultiValuePartial extends DataFormatterBasePartial<'multiValue'> {
13
- multiValue?: Array<Partial<DataFormatterMultiValueMultiValue>>
14
- xAxis?: Partial<DataFormatterValueAxis>
15
- yAxis?: Partial<DataFormatterValueAxis>
16
- }
17
-
18
- // multiValue欄位
19
- export interface DataFormatterMultiValueMultiValue {
20
- // unitLabel: string
1
+ import { DataMultiValueDatum, DataMultiValue } from './DataMultiValue'
2
+ import { DataFormatterBase, DataFormatterBasePartial, DataFormatterValueAxis, VisibleFilter } from './DataFormatter'
3
+
4
+ export interface DataFormatterMultiValue extends DataFormatterBase<'multiValue'> {
5
+ visibleFilter: VisibleFilter<'multiValue'>
6
+ // labelFormat: (datum: unknown) => string
7
+ multiValue: Array<DataFormatterMultiValueMultiValue>
8
+ xAxis: DataFormatterValueAxis
9
+ yAxis: DataFormatterValueAxis
10
+ }
11
+
12
+ export interface DataFormatterMultiValuePartial extends DataFormatterBasePartial<'multiValue'> {
13
+ multiValue?: Array<Partial<DataFormatterMultiValueMultiValue>>
14
+ xAxis?: Partial<DataFormatterValueAxis>
15
+ yAxis?: Partial<DataFormatterValueAxis>
16
+ }
17
+
18
+ // multiValue欄位
19
+ export interface DataFormatterMultiValueMultiValue {
20
+ // unitLabel: string
21
21
  }
@@ -1,23 +1,23 @@
1
- import { Node, Edge, DataRelationship } from './DataRelationship'
2
- import { DataFormatterBase, DataFormatterBasePartial, VisibleFilter } from './DataFormatter'
3
-
4
- export interface DataFormatterRelationship extends DataFormatterBase<'relationship'> {
5
- visibleFilter: VisibleFilter<'relationship'>
6
- // node: DataFormatterRelationshipNode
7
- // edge: DataFormatterRelationshipEdge
8
- }
9
-
10
- export interface DataFormatterRelationshipPartial extends DataFormatterBasePartial<'relationship'> {
11
- // node: Partial<DataFormatterRelationshipNode>
12
- // edge: Partial<DataFormatterRelationshipEdge>
13
- }
14
-
15
- // export interface DataFormatterRelationshipNode {
16
- // labelFormat: (node: unknown) => string
17
- // descriptionFormat: (node: unknown) => string
18
- // }
19
-
20
- // export interface DataFormatterRelationshipEdge {
21
- // labelFormat: (edge: unknown, startNode: unknown, endNode: unknown) => string
22
- // descriptionFormat: (edge: unknown, startNode: unknown, endNode: unknown) => string
1
+ import { Node, Edge, DataRelationship } from './DataRelationship'
2
+ import { DataFormatterBase, DataFormatterBasePartial, VisibleFilter } from './DataFormatter'
3
+
4
+ export interface DataFormatterRelationship extends DataFormatterBase<'relationship'> {
5
+ visibleFilter: VisibleFilter<'relationship'>
6
+ // node: DataFormatterRelationshipNode
7
+ // edge: DataFormatterRelationshipEdge
8
+ }
9
+
10
+ export interface DataFormatterRelationshipPartial extends DataFormatterBasePartial<'relationship'> {
11
+ // node: Partial<DataFormatterRelationshipNode>
12
+ // edge: Partial<DataFormatterRelationshipEdge>
13
+ }
14
+
15
+ // export interface DataFormatterRelationshipNode {
16
+ // labelFormat: (node: unknown) => string
17
+ // descriptionFormat: (node: unknown) => string
18
+ // }
19
+
20
+ // export interface DataFormatterRelationshipEdge {
21
+ // labelFormat: (edge: unknown, startNode: unknown, endNode: unknown) => string
22
+ // descriptionFormat: (edge: unknown, startNode: unknown, endNode: unknown) => string
23
23
  // }