@orbcharts/plugins-basic 3.0.0-alpha.52 → 3.0.0-alpha.54

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- import { MultiGridLegendParams, MultiBarsParams, MultiBarStackParams, MultiBarsTriangleParams, MultiLinesParams, MultiLineAreasParams, MultiDotsParams, MultiGroupAxisParams, MultiValueAxisParams, MultiValueStackAxisParams, OverlappingValueAxesParams } from './types';
1
+ import { MultiGridLegendParams, MultiBarsParams, MultiBarStackParams, MultiBarsTriangleParams, MultiLinesParams, MultiLineAreasParams, MultiDotsParams, MultiGroupAxisParams, MultiValueAxisParams, MultiValueStackAxisParams, OverlappingValueAxesParams, OverlappingValueStackAxesParams } from './types';
2
2
 
3
3
  export declare const DEFAULT_MULTI_GRID_LEGEND_PARAMS: MultiGridLegendParams;
4
4
  export declare const DEFAULT_MULTI_GROUP_AXIS_PARAMS: MultiGroupAxisParams;
@@ -11,3 +11,4 @@ export declare const DEFAULT_MULTI_LINES_PARAMS: MultiLinesParams;
11
11
  export declare const DEFAULT_MULTI_LINE_AREAS_PARAMS: MultiLineAreasParams;
12
12
  export declare const DEFAULT_MULTI_DOTS_PARAMS: MultiDotsParams;
13
13
  export declare const DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS: OverlappingValueAxesParams;
14
+ export declare const DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS: OverlappingValueStackAxesParams;
@@ -2,7 +2,7 @@ import { Observable } from 'rxjs';
2
2
  import { ContextObserverMultiGrid, ContextObserverMultiGridDetail } from '@orbcharts/core';
3
3
 
4
4
  interface MultiGridPluginParams {
5
- gridIndexes: number[];
5
+ gridIndexes: number[] | 'all';
6
6
  }
7
7
  export declare const multiGridPluginDetailObservables: (observer: ContextObserverMultiGrid<MultiGridPluginParams>) => Observable<ContextObserverMultiGridDetail[]>;
8
8
  export {};
@@ -1 +1 @@
1
- export declare const OverlappingValueStackAxes: import('@orbcharts/core').PluginConstructor<"multiGrid", string, import('..').OverlappingValueAxesParams>;
1
+ export declare const OverlappingValueStackAxes: import('@orbcharts/core').PluginConstructor<"multiGrid", string, import('..').OverlappingValueStackAxesParams>;
@@ -26,34 +26,36 @@ export interface MultiGridLegendParams {
26
26
  textColorType: ColorType;
27
27
  }
28
28
  export interface MultiGroupAxisParams extends BaseGroupAxisParams {
29
- gridIndexes: number[];
29
+ gridIndexes: number[] | 'all';
30
30
  }
31
31
  export interface MultiValueAxisParams extends BaseValueAxisParams {
32
- gridIndexes: number[];
32
+ gridIndexes: number[] | 'all';
33
33
  }
34
34
  export interface MultiValueStackAxisParams extends BaseValueAxisParams {
35
- gridIndexes: number[];
35
+ gridIndexes: number[] | 'all';
36
36
  }
37
37
  export interface MultiBarsParams extends BaseBarsParams {
38
- gridIndexes: number[];
38
+ gridIndexes: number[] | 'all';
39
39
  }
40
40
  export interface MultiBarStackParams extends BaseBarStackParams {
41
- gridIndexes: number[];
41
+ gridIndexes: number[] | 'all';
42
42
  }
43
43
  export interface MultiBarsTriangleParams extends BaseBarsTriangleParams {
44
- gridIndexes: number[];
44
+ gridIndexes: number[] | 'all';
45
45
  }
46
46
  export interface MultiLinesParams extends BaseLinesParams {
47
- gridIndexes: number[];
47
+ gridIndexes: number[] | 'all';
48
48
  }
49
49
  export interface MultiLineAreasParams extends BaseLineAreasParams {
50
- gridIndexes: number[];
50
+ gridIndexes: number[] | 'all';
51
51
  }
52
52
  export interface MultiDotsParams extends BaseDotsParams {
53
- gridIndexes: number[];
53
+ gridIndexes: number[] | 'all';
54
54
  }
55
55
  export interface OverlappingValueAxesParams {
56
56
  firstAxis: BaseValueAxisParams;
57
57
  secondAxis: BaseValueAxisParams;
58
58
  gridIndexes: [number, number];
59
59
  }
60
+ export interface OverlappingValueStackAxesParams extends OverlappingValueAxesParams {
61
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbcharts/plugins-basic",
3
- "version": "3.0.0-alpha.52",
3
+ "version": "3.0.0-alpha.54",
4
4
  "description": "plugins for OrbCharts",
5
5
  "author": "Blue Planet Inc.",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  "vite-plugin-dts": "^3.7.3"
36
36
  },
37
37
  "dependencies": {
38
- "@orbcharts/core": "^3.0.0-alpha.48",
38
+ "@orbcharts/core": "^3.0.0-alpha.50",
39
39
  "d3": "^7.8.5",
40
40
  "rxjs": "^7.8.1"
41
41
  }
@@ -9,7 +9,8 @@ import type {
9
9
  MultiGroupAxisParams,
10
10
  MultiValueAxisParams,
11
11
  MultiValueStackAxisParams,
12
- OverlappingValueAxesParams
12
+ OverlappingValueAxesParams,
13
+ OverlappingValueStackAxesParams
13
14
  } from './types'
14
15
 
15
16
  export const DEFAULT_MULTI_GRID_LEGEND_PARAMS: MultiGridLegendParams = {
@@ -151,3 +152,7 @@ export const DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS: OverlappingValueAxesParams =
151
152
  },
152
153
  gridIndexes: [0, 1]
153
154
  }
155
+
156
+ export const DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS: OverlappingValueStackAxesParams = {
157
+ ...DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS
158
+ }
@@ -19,7 +19,7 @@ import type {
19
19
 
20
20
  // 可設定多個gridIndex的params
21
21
  interface MultiGridPluginParams {
22
- gridIndexes: number[]
22
+ gridIndexes: number[] | 'all'
23
23
  }
24
24
 
25
25
  // 對應grid資料的plugin所需Observable(必須有gridIndexes)
@@ -35,6 +35,11 @@ export const multiGridPluginDetailObservables = (observer: ContextObserverMultiG
35
35
  gridIndexes: gridIndexes$,
36
36
  }).pipe(
37
37
  map(data => {
38
+ // 對應所有grid
39
+ if (data.gridIndexes === 'all') {
40
+ return data.multiGridEachDetail
41
+ }
42
+ // 自訂對應grid
38
43
  return data.gridIndexes.map(gridIndex => {
39
44
  return data.multiGridEachDetail[gridIndex] ?? data.multiGridEachDetail[0]
40
45
  })
@@ -13,7 +13,7 @@ import {
13
13
  import type { ContextObserverMultiGrid, DataFormatterGrid, DataFormatterTypeMap, Layout } from '@orbcharts/core'
14
14
  import {
15
15
  defineMultiGridPlugin } from '@orbcharts/core'
16
- import { DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS } from '../defaults'
16
+ import { DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS } from '../defaults'
17
17
  import { createBaseValueAxis } from '../../base/BaseValueAxis'
18
18
  import { multiGridPluginDetailObservables } from '../multiGridObservables'
19
19
  import { getClassName, getUniID } from '../../utils/orbchartsUtils'
@@ -24,7 +24,7 @@ const pluginName = 'OverlappingValueStackAxes'
24
24
  const gridClassName = getClassName(pluginName, 'grid')
25
25
 
26
26
  // 第一個圖軸使用堆疊的資料,第二個圖軸使用原始資料
27
- export const OverlappingValueStackAxes = defineMultiGridPlugin(pluginName, DEFAULT_OVERLAPPING_VALUE_AXES_PARAMS)(({ selection, name, subject, observer }) => {
27
+ export const OverlappingValueStackAxes = defineMultiGridPlugin(pluginName, DEFAULT_OVERLAPPING_VALUE_STACK_AXES_PARAMS)(({ selection, name, subject, observer }) => {
28
28
  const destroy$ = new Subject()
29
29
 
30
30
  const unsubscribeFnArr: (() => void)[] = []
@@ -29,39 +29,39 @@ export interface MultiGridLegendParams {
29
29
  }
30
30
 
31
31
  export interface MultiGroupAxisParams extends BaseGroupAxisParams {
32
- gridIndexes: number[]
32
+ gridIndexes: number[] | 'all'
33
33
  }
34
34
 
35
35
  export interface MultiValueAxisParams extends BaseValueAxisParams {
36
- gridIndexes: number[]
36
+ gridIndexes: number[] | 'all'
37
37
  }
38
38
 
39
39
  export interface MultiValueStackAxisParams extends BaseValueAxisParams {
40
- gridIndexes: number[]
40
+ gridIndexes: number[] | 'all'
41
41
  }
42
42
 
43
43
  export interface MultiBarsParams extends BaseBarsParams {
44
- gridIndexes: number[]
44
+ gridIndexes: number[] | 'all'
45
45
  }
46
46
 
47
47
  export interface MultiBarStackParams extends BaseBarStackParams {
48
- gridIndexes: number[]
48
+ gridIndexes: number[] | 'all'
49
49
  }
50
50
 
51
51
  export interface MultiBarsTriangleParams extends BaseBarsTriangleParams {
52
- gridIndexes: number[]
52
+ gridIndexes: number[] | 'all'
53
53
  }
54
54
 
55
55
  export interface MultiLinesParams extends BaseLinesParams {
56
- gridIndexes: number[]
56
+ gridIndexes: number[] | 'all'
57
57
  }
58
58
 
59
59
  export interface MultiLineAreasParams extends BaseLineAreasParams {
60
- gridIndexes: number[]
60
+ gridIndexes: number[] | 'all'
61
61
  }
62
62
 
63
63
  export interface MultiDotsParams extends BaseDotsParams {
64
- gridIndexes: number[]
64
+ gridIndexes: number[] | 'all'
65
65
  }
66
66
 
67
67
  export interface OverlappingValueAxesParams {
@@ -69,3 +69,5 @@ export interface OverlappingValueAxesParams {
69
69
  secondAxis: BaseValueAxisParams
70
70
  gridIndexes: [number, number]
71
71
  }
72
+
73
+ export interface OverlappingValueStackAxesParams extends OverlappingValueAxesParams {}