@orbcharts/plugins-basic 3.0.0-alpha.32 → 3.0.0-alpha.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbcharts/plugins-basic",
3
- "version": "3.0.0-alpha.32",
3
+ "version": "3.0.0-alpha.33",
4
4
  "description": "plugins for OrbCharts",
5
5
  "author": "Blue Planet Inc.",
6
6
  "license": "Apache-2.0",
@@ -7,6 +7,7 @@ import {
7
7
  Observable } from 'rxjs'
8
8
  import {
9
9
  defineMultiGridPlugin } from '@orbcharts/core'
10
+ import { DATA_FORMATTER_MULTI_GRID_DEFAULT } from '@orbcharts/core/src/defaults'
10
11
  // import { defineMultiGridPlugin } from '../../../../orbcharts-core/src'
11
12
  import { getClassName, getUniID } from '../../utils/orbchartsUtils'
12
13
  import { DEFAULT_BARS_AND_LINES_PARAMS } from '../defaults'
@@ -40,23 +41,38 @@ export const BarsAndLines = defineMultiGridPlugin(pluginName, DEFAULT_BARS_AND_L
40
41
  // })
41
42
 
42
43
  const barsComputedData$ = observer.computedData$.pipe(
44
+ takeUntil(destroy$),
43
45
  map((computedData) => computedData[0] || [])
44
46
  )
45
47
 
46
48
  const linesComputedData$ = observer.computedData$.pipe(
49
+ takeUntil(destroy$),
47
50
  map((computedData) => computedData[1] || [])
48
51
  )
49
52
 
50
53
  const barsFullParams$ = observer.fullParams$.pipe(
54
+ takeUntil(destroy$),
51
55
  map((fullParams) => fullParams.bars)
52
56
  )
53
57
 
54
58
  const linesFullParams$ = observer.fullParams$.pipe(
59
+ takeUntil(destroy$),
55
60
  map((fullParams) => fullParams.lines)
56
61
  )
57
62
 
58
- const linesFullDataFormatter$ = observer.fullDataFormatter$.pipe(
59
- map((fullDataFormatter) => fullDataFormatter.multiGrid[1])
63
+ const defaultFullDataFormatter$ = observer.fullDataFormatter$.pipe(
64
+ takeUntil(destroy$),
65
+ map((fullDataFormatter) => fullDataFormatter.multiGrid[0] || DATA_FORMATTER_MULTI_GRID_DEFAULT.multiGrid[0])
66
+ )
67
+
68
+ const linesFullDataFormatter$ = combineLatest({
69
+ fullDataFormatter: observer.fullDataFormatter$,
70
+ defaultFullDataFormatter: defaultFullDataFormatter$,
71
+ }).pipe(
72
+ takeUntil(destroy$),
73
+ map((data) => {
74
+ return data.fullDataFormatter.multiGrid[1] ?? data.defaultFullDataFormatter
75
+ })
60
76
  )
61
77
 
62
78
  observer.multiGrid$.subscribe((multiGrid) => {