@orbcharts/plugins-basic 3.0.0-alpha.46 → 3.0.0-alpha.47

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbcharts/plugins-basic",
3
- "version": "3.0.0-alpha.46",
3
+ "version": "3.0.0-alpha.47",
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.44",
38
+ "@orbcharts/core": "^3.0.0-alpha.45",
39
39
  "d3": "^7.8.5",
40
40
  "rxjs": "^7.8.1"
41
41
  }
@@ -24,48 +24,52 @@ export const MultiBarStack = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_BAR
24
24
 
25
25
  const multiGridPlugin$ = multiGridPluginObservables(observer)
26
26
 
27
- multiGridPlugin$.subscribe(data => {
28
- // 每次重新計算時,清除之前的訂閱
29
- unsubscribeFnArr.forEach(fn => fn())
27
+ multiGridPlugin$
28
+ .pipe(
29
+ takeUntil(destroy$)
30
+ )
31
+ .subscribe(data => {
32
+ // 每次重新計算時,清除之前的訂閱
33
+ unsubscribeFnArr.forEach(fn => fn())
30
34
 
31
- selection.selectAll(`g.${gridClassName}`)
32
- .data(data)
33
- .join('g')
34
- .attr('class', gridClassName)
35
- .each((d, i, g) => {
35
+ selection.selectAll(`g.${gridClassName}`)
36
+ .data(data)
37
+ .join('g')
38
+ .attr('class', gridClassName)
39
+ .each((d, i, g) => {
36
40
 
37
- const gridSelection = d3.select(g[i])
41
+ const gridSelection = d3.select(g[i])
38
42
 
39
- const isSeriesSeprate$ = d.dataFormatter$.pipe(
40
- takeUntil(destroy$),
41
- map(d => d.grid.separateSeries),
42
- distinctUntilChanged(),
43
- shareReplay(1)
44
- )
43
+ const isSeriesSeprate$ = d.dataFormatter$.pipe(
44
+ takeUntil(destroy$),
45
+ map(d => d.grid.separateSeries),
46
+ distinctUntilChanged(),
47
+ shareReplay(1)
48
+ )
45
49
 
46
- unsubscribeFnArr[i] = createBaseBarStack(pluginName, {
47
- selection: gridSelection,
48
- computedData$: d.computedData$,
49
- visibleComputedData$: d.visibleComputedData$,
50
- computedLayoutData$: d.computedLayoutData$,
51
- visibleComputedLayoutData$: d.visibleComputedLayoutData$,
52
- seriesLabels$: d.seriesLabels$,
53
- SeriesDataMap$: d.SeriesDataMap$,
54
- GroupDataMap$: d.GroupDataMap$,
55
- fullParams$: observer.fullParams$,
56
- fullDataFormatter$: d.dataFormatter$,
57
- fullChartParams$: observer.fullChartParams$,
58
- gridAxesTransform$: d.gridAxesTransform$,
59
- gridGraphicTransform$: d.gridGraphicTransform$,
60
- gridGraphicReverseScale$: d.gridGraphicReverseScale$,
61
- gridAxesSize$: d.gridAxesSize$,
62
- gridHighlight$: d.gridHighlight$,
63
- gridContainerPosition$: d.gridContainerPosition$,
64
- isSeriesSeprate$,
65
- event$: subject.event$ as Subject<any>,
50
+ unsubscribeFnArr[i] = createBaseBarStack(pluginName, {
51
+ selection: gridSelection,
52
+ computedData$: d.computedData$,
53
+ visibleComputedData$: d.visibleComputedData$,
54
+ computedLayoutData$: d.computedLayoutData$,
55
+ visibleComputedLayoutData$: d.visibleComputedLayoutData$,
56
+ seriesLabels$: d.seriesLabels$,
57
+ SeriesDataMap$: d.SeriesDataMap$,
58
+ GroupDataMap$: d.GroupDataMap$,
59
+ fullParams$: observer.fullParams$,
60
+ fullDataFormatter$: d.dataFormatter$,
61
+ fullChartParams$: observer.fullChartParams$,
62
+ gridAxesTransform$: d.gridAxesTransform$,
63
+ gridGraphicTransform$: d.gridGraphicTransform$,
64
+ gridGraphicReverseScale$: d.gridGraphicReverseScale$,
65
+ gridAxesSize$: d.gridAxesSize$,
66
+ gridHighlight$: d.gridHighlight$,
67
+ gridContainerPosition$: d.gridContainerPosition$,
68
+ isSeriesSeprate$,
69
+ event$: subject.event$ as Subject<any>,
70
+ })
66
71
  })
67
- })
68
- })
72
+ })
69
73
 
70
74
  return () => {
71
75
  destroy$.next(undefined)
@@ -24,47 +24,51 @@ export const MultiBars = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_BARS_PA
24
24
 
25
25
  const multiGridPlugin$ = multiGridPluginObservables(observer)
26
26
 
27
- multiGridPlugin$.subscribe(data => {
28
- // 每次重新計算時,清除之前的訂閱
29
- unsubscribeFnArr.forEach(fn => fn())
27
+ multiGridPlugin$
28
+ .pipe(
29
+ takeUntil(destroy$)
30
+ )
31
+ .subscribe(data => {
32
+ // 每次重新計算時,清除之前的訂閱
33
+ unsubscribeFnArr.forEach(fn => fn())
30
34
 
31
- selection.selectAll(`g.${gridClassName}`)
32
- .data(data)
33
- .join('g')
34
- .attr('class', gridClassName)
35
- .each((d, i, g) => {
35
+ selection.selectAll(`g.${gridClassName}`)
36
+ .data(data)
37
+ .join('g')
38
+ .attr('class', gridClassName)
39
+ .each((d, i, g) => {
36
40
 
37
- const gridSelection = d3.select(g[i])
41
+ const gridSelection = d3.select(g[i])
38
42
 
39
- const isSeriesSeprate$ = d.dataFormatter$.pipe(
40
- takeUntil(destroy$),
41
- map(d => d.grid.separateSeries),
42
- distinctUntilChanged(),
43
- shareReplay(1)
44
- )
43
+ const isSeriesSeprate$ = d.dataFormatter$.pipe(
44
+ takeUntil(destroy$),
45
+ map(d => d.grid.separateSeries),
46
+ distinctUntilChanged(),
47
+ shareReplay(1)
48
+ )
45
49
 
46
- unsubscribeFnArr[i] = createBaseBars(pluginName, {
47
- selection: gridSelection,
48
- computedData$: d.computedData$,
49
- visibleComputedData$: d.visibleComputedData$,
50
- computedLayoutData$: d.computedLayoutData$,
51
- visibleComputedLayoutData$: d.visibleComputedLayoutData$,
52
- seriesLabels$: d.seriesLabels$,
53
- SeriesDataMap$: d.SeriesDataMap$,
54
- GroupDataMap$: d.GroupDataMap$,
55
- fullParams$: observer.fullParams$,
56
- fullChartParams$: observer.fullChartParams$,
57
- gridAxesTransform$: d.gridAxesTransform$,
58
- gridGraphicTransform$: d.gridGraphicTransform$,
59
- gridGraphicReverseScale$: d.gridGraphicReverseScale$,
60
- gridAxesSize$: d.gridAxesSize$,
61
- gridHighlight$: d.gridHighlight$,
62
- gridContainerPosition$: d.gridContainerPosition$,
63
- isSeriesSeprate$,
64
- event$: subject.event$ as Subject<any>,
50
+ unsubscribeFnArr[i] = createBaseBars(pluginName, {
51
+ selection: gridSelection,
52
+ computedData$: d.computedData$,
53
+ visibleComputedData$: d.visibleComputedData$,
54
+ computedLayoutData$: d.computedLayoutData$,
55
+ visibleComputedLayoutData$: d.visibleComputedLayoutData$,
56
+ seriesLabels$: d.seriesLabels$,
57
+ SeriesDataMap$: d.SeriesDataMap$,
58
+ GroupDataMap$: d.GroupDataMap$,
59
+ fullParams$: observer.fullParams$,
60
+ fullChartParams$: observer.fullChartParams$,
61
+ gridAxesTransform$: d.gridAxesTransform$,
62
+ gridGraphicTransform$: d.gridGraphicTransform$,
63
+ gridGraphicReverseScale$: d.gridGraphicReverseScale$,
64
+ gridAxesSize$: d.gridAxesSize$,
65
+ gridHighlight$: d.gridHighlight$,
66
+ gridContainerPosition$: d.gridContainerPosition$,
67
+ isSeriesSeprate$,
68
+ event$: subject.event$ as Subject<any>,
69
+ })
65
70
  })
66
- })
67
- })
71
+ })
68
72
 
69
73
  return () => {
70
74
  destroy$.next(undefined)
@@ -24,47 +24,51 @@ export const MultiBarsTriangle = defineMultiGridPlugin(pluginName, DEFAULT_MULTI
24
24
 
25
25
  const multiGridPlugin$ = multiGridPluginObservables(observer)
26
26
 
27
- multiGridPlugin$.subscribe(data => {
28
- // 每次重新計算時,清除之前的訂閱
29
- unsubscribeFnArr.forEach(fn => fn())
27
+ multiGridPlugin$
28
+ .pipe(
29
+ takeUntil(destroy$)
30
+ )
31
+ .subscribe(data => {
32
+ // 每次重新計算時,清除之前的訂閱
33
+ unsubscribeFnArr.forEach(fn => fn())
30
34
 
31
- selection.selectAll(`g.${gridClassName}`)
32
- .data(data)
33
- .join('g')
34
- .attr('class', gridClassName)
35
- .each((d, i, g) => {
35
+ selection.selectAll(`g.${gridClassName}`)
36
+ .data(data)
37
+ .join('g')
38
+ .attr('class', gridClassName)
39
+ .each((d, i, g) => {
36
40
 
37
- const gridSelection = d3.select(g[i])
41
+ const gridSelection = d3.select(g[i])
38
42
 
39
- const isSeriesSeprate$ = d.dataFormatter$.pipe(
40
- takeUntil(destroy$),
41
- map(d => d.grid.separateSeries),
42
- distinctUntilChanged(),
43
- shareReplay(1)
44
- )
43
+ const isSeriesSeprate$ = d.dataFormatter$.pipe(
44
+ takeUntil(destroy$),
45
+ map(d => d.grid.separateSeries),
46
+ distinctUntilChanged(),
47
+ shareReplay(1)
48
+ )
45
49
 
46
- unsubscribeFnArr[i] = createBaseBarsTriangle(pluginName, {
47
- selection: gridSelection,
48
- computedData$: d.computedData$,
49
- visibleComputedData$: d.visibleComputedData$,
50
- computedLayoutData$: d.computedLayoutData$,
51
- visibleComputedLayoutData$: d.visibleComputedLayoutData$,
52
- seriesLabels$: d.seriesLabels$,
53
- SeriesDataMap$: d.SeriesDataMap$,
54
- GroupDataMap$: d.GroupDataMap$,
55
- fullParams$: observer.fullParams$,
56
- fullChartParams$: observer.fullChartParams$,
57
- fullDataFormatter$: d.dataFormatter$,
58
- gridAxesTransform$: d.gridAxesTransform$,
59
- gridGraphicTransform$: d.gridGraphicTransform$,
60
- gridAxesSize$: d.gridAxesSize$,
61
- gridHighlight$: d.gridHighlight$,
62
- gridContainerPosition$: d.gridContainerPosition$,
63
- isSeriesSeprate$: isSeriesSeprate$,
64
- event$: subject.event$ as Subject<any>,
50
+ unsubscribeFnArr[i] = createBaseBarsTriangle(pluginName, {
51
+ selection: gridSelection,
52
+ computedData$: d.computedData$,
53
+ visibleComputedData$: d.visibleComputedData$,
54
+ computedLayoutData$: d.computedLayoutData$,
55
+ visibleComputedLayoutData$: d.visibleComputedLayoutData$,
56
+ seriesLabels$: d.seriesLabels$,
57
+ SeriesDataMap$: d.SeriesDataMap$,
58
+ GroupDataMap$: d.GroupDataMap$,
59
+ fullParams$: observer.fullParams$,
60
+ fullChartParams$: observer.fullChartParams$,
61
+ fullDataFormatter$: d.dataFormatter$,
62
+ gridAxesTransform$: d.gridAxesTransform$,
63
+ gridGraphicTransform$: d.gridGraphicTransform$,
64
+ gridAxesSize$: d.gridAxesSize$,
65
+ gridHighlight$: d.gridHighlight$,
66
+ gridContainerPosition$: d.gridContainerPosition$,
67
+ isSeriesSeprate$: isSeriesSeprate$,
68
+ event$: subject.event$ as Subject<any>,
69
+ })
65
70
  })
66
- })
67
- })
71
+ })
68
72
 
69
73
  return () => {
70
74
  destroy$.next(undefined)
@@ -1,5 +1,6 @@
1
1
  import * as d3 from 'd3'
2
2
  import {
3
+ takeUntil,
3
4
  Subject } from 'rxjs'
4
5
  import {
5
6
  defineMultiGridPlugin } from '@orbcharts/core'
@@ -19,39 +20,43 @@ export const MultiDots = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_DOTS_PA
19
20
 
20
21
  const multiGridPlugin$ = multiGridPluginObservables(observer)
21
22
 
22
- multiGridPlugin$.subscribe(data => {
23
- // 每次重新計算時,清除之前的訂閱
24
- unsubscribeFnArr.forEach(fn => fn())
23
+ multiGridPlugin$
24
+ .pipe(
25
+ takeUntil(destroy$)
26
+ )
27
+ .subscribe(data => {
28
+ // 每次重新計算時,清除之前的訂閱
29
+ unsubscribeFnArr.forEach(fn => fn())
30
+
31
+ selection.selectAll(`g.${gridClassName}`)
32
+ .data(data)
33
+ .join('g')
34
+ .attr('class', gridClassName)
35
+ .each((d, i, g) => {
36
+
37
+ const gridSelection = d3.select(g[i])
25
38
 
26
- selection.selectAll(`g.${gridClassName}`)
27
- .data(data)
28
- .join('g')
29
- .attr('class', gridClassName)
30
- .each((d, i, g) => {
31
-
32
- const gridSelection = d3.select(g[i])
33
-
34
- unsubscribeFnArr[i] = createBaseDots(pluginName, {
35
- selection: gridSelection,
36
- computedData$: d.computedData$,
37
- visibleComputedData$: d.visibleComputedData$,
38
- computedLayoutData$: d.computedLayoutData$,
39
- visibleComputedLayoutData$: d.visibleComputedLayoutData$,
40
- seriesLabels$: d.seriesLabels$,
41
- SeriesDataMap$: d.SeriesDataMap$,
42
- GroupDataMap$: d.GroupDataMap$,
43
- fullParams$: observer.fullParams$,
44
- fullChartParams$: observer.fullChartParams$,
45
- gridAxesTransform$: d.gridAxesTransform$,
46
- gridGraphicTransform$: d.gridGraphicTransform$,
47
- gridGraphicReverseScale$: d.gridGraphicReverseScale$,
48
- gridAxesSize$: d.gridAxesSize$,
49
- gridHighlight$: d.gridHighlight$,
50
- gridContainerPosition$: d.gridContainerPosition$,
51
- event$: subject.event$ as Subject<any>,
39
+ unsubscribeFnArr[i] = createBaseDots(pluginName, {
40
+ selection: gridSelection,
41
+ computedData$: d.computedData$,
42
+ visibleComputedData$: d.visibleComputedData$,
43
+ computedLayoutData$: d.computedLayoutData$,
44
+ visibleComputedLayoutData$: d.visibleComputedLayoutData$,
45
+ seriesLabels$: d.seriesLabels$,
46
+ SeriesDataMap$: d.SeriesDataMap$,
47
+ GroupDataMap$: d.GroupDataMap$,
48
+ fullParams$: observer.fullParams$,
49
+ fullChartParams$: observer.fullChartParams$,
50
+ gridAxesTransform$: d.gridAxesTransform$,
51
+ gridGraphicTransform$: d.gridGraphicTransform$,
52
+ gridGraphicReverseScale$: d.gridGraphicReverseScale$,
53
+ gridAxesSize$: d.gridAxesSize$,
54
+ gridHighlight$: d.gridHighlight$,
55
+ gridContainerPosition$: d.gridContainerPosition$,
56
+ event$: subject.event$ as Subject<any>,
57
+ })
52
58
  })
53
- })
54
- })
59
+ })
55
60
 
56
61
  return () => {
57
62
  destroy$.next(undefined)
@@ -24,39 +24,43 @@ export const MultiGroupAxis = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_GR
24
24
 
25
25
  const multiGridPlugin$ = multiGridPluginObservables(observer)
26
26
 
27
- multiGridPlugin$.subscribe(data => {
28
- // 每次重新計算時,清除之前的訂閱
29
- unsubscribeFnArr.forEach(fn => fn())
27
+ multiGridPlugin$
28
+ .pipe(
29
+ takeUntil(destroy$)
30
+ )
31
+ .subscribe(data => {
32
+ // 每次重新計算時,清除之前的訂閱
33
+ unsubscribeFnArr.forEach(fn => fn())
30
34
 
31
- selection.selectAll(`g.${gridClassName}`)
32
- .data(data)
33
- .join('g')
34
- .attr('class', gridClassName)
35
- .each((d, i, g) => {
35
+ selection.selectAll(`g.${gridClassName}`)
36
+ .data(data)
37
+ .join('g')
38
+ .attr('class', gridClassName)
39
+ .each((d, i, g) => {
36
40
 
37
- const gridSelection = d3.select(g[i])
41
+ const gridSelection = d3.select(g[i])
38
42
 
39
- const isSeriesSeprate$ = d.dataFormatter$.pipe(
40
- takeUntil(destroy$),
41
- map(d => d.grid.separateSeries),
42
- distinctUntilChanged(),
43
- shareReplay(1)
44
- )
43
+ const isSeriesSeprate$ = d.dataFormatter$.pipe(
44
+ takeUntil(destroy$),
45
+ map(d => d.grid.separateSeries),
46
+ distinctUntilChanged(),
47
+ shareReplay(1)
48
+ )
45
49
 
46
- unsubscribeFnArr[i] = createBaseGroupAxis(pluginName, {
47
- selection: gridSelection,
48
- computedData$: d.computedData$,
49
- fullParams$: observer.fullParams$,
50
- fullDataFormatter$: d.dataFormatter$,
51
- fullChartParams$: observer.fullChartParams$,
52
- gridAxesTransform$: d.gridAxesTransform$,
53
- gridAxesReverseTransform$: d.gridAxesReverseTransform$,
54
- gridAxesSize$: d.gridAxesSize$,
55
- gridContainerPosition$: d.gridContainerPosition$,
56
- isSeriesSeprate$,
50
+ unsubscribeFnArr[i] = createBaseGroupAxis(pluginName, {
51
+ selection: gridSelection,
52
+ computedData$: d.computedData$,
53
+ fullParams$: observer.fullParams$,
54
+ fullDataFormatter$: d.dataFormatter$,
55
+ fullChartParams$: observer.fullChartParams$,
56
+ gridAxesTransform$: d.gridAxesTransform$,
57
+ gridAxesReverseTransform$: d.gridAxesReverseTransform$,
58
+ gridAxesSize$: d.gridAxesSize$,
59
+ gridContainerPosition$: d.gridContainerPosition$,
60
+ isSeriesSeprate$,
61
+ })
57
62
  })
58
- })
59
- })
63
+ })
60
64
 
61
65
  return () => {
62
66
  destroy$.next(undefined)
@@ -1,5 +1,6 @@
1
1
  import * as d3 from 'd3'
2
2
  import {
3
+ takeUntil,
3
4
  Subject } from 'rxjs'
4
5
  import {
5
6
  defineMultiGridPlugin } from '@orbcharts/core'
@@ -20,40 +21,44 @@ export const MultiLineAreas = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_LI
20
21
 
21
22
  const multiGridPlugin$ = multiGridPluginObservables(observer)
22
23
 
23
- multiGridPlugin$.subscribe(data => {
24
- // 每次重新計算時,清除之前的訂閱
25
- unsubscribeFnArr.forEach(fn => fn())
24
+ multiGridPlugin$
25
+ .pipe(
26
+ takeUntil(destroy$)
27
+ )
28
+ .subscribe(data => {
29
+ // 每次重新計算時,清除之前的訂閱
30
+ unsubscribeFnArr.forEach(fn => fn())
31
+
32
+ selection.selectAll(`g.${gridClassName}`)
33
+ .data(data)
34
+ .join('g')
35
+ .attr('class', gridClassName)
36
+ .each((d, i, g) => {
37
+
38
+ const gridSelection = d3.select(g[i])
26
39
 
27
- selection.selectAll(`g.${gridClassName}`)
28
- .data(data)
29
- .join('g')
30
- .attr('class', gridClassName)
31
- .each((d, i, g) => {
32
-
33
- const gridSelection = d3.select(g[i])
34
-
35
- unsubscribeFnArr[i] = createBaseLineAreas(pluginName, {
36
- selection: gridSelection,
37
- computedData$: d.computedData$,
38
- computedLayoutData$: d.computedLayoutData$,
39
- visibleComputedData$: d.visibleComputedData$,
40
- visibleComputedLayoutData$: d.visibleComputedLayoutData$,
41
- seriesLabels$: d.seriesLabels$,
42
- SeriesDataMap$: d.SeriesDataMap$,
43
- GroupDataMap$: d.GroupDataMap$,
44
- fullDataFormatter$: d.dataFormatter$,
45
- fullParams$: observer.fullParams$,
46
- fullChartParams$: observer.fullChartParams$,
47
- gridAxesTransform$: d.gridAxesTransform$,
48
- gridGraphicTransform$: d.gridGraphicTransform$,
49
- gridAxesSize$: d.gridAxesSize$,
50
- gridHighlight$: d.gridHighlight$,
51
- gridContainerPosition$: d.gridContainerPosition$,
52
- layout$: observer.layout$,
53
- event$: subject.event$ as Subject<any>,
40
+ unsubscribeFnArr[i] = createBaseLineAreas(pluginName, {
41
+ selection: gridSelection,
42
+ computedData$: d.computedData$,
43
+ computedLayoutData$: d.computedLayoutData$,
44
+ visibleComputedData$: d.visibleComputedData$,
45
+ visibleComputedLayoutData$: d.visibleComputedLayoutData$,
46
+ seriesLabels$: d.seriesLabels$,
47
+ SeriesDataMap$: d.SeriesDataMap$,
48
+ GroupDataMap$: d.GroupDataMap$,
49
+ fullDataFormatter$: d.dataFormatter$,
50
+ fullParams$: observer.fullParams$,
51
+ fullChartParams$: observer.fullChartParams$,
52
+ gridAxesTransform$: d.gridAxesTransform$,
53
+ gridGraphicTransform$: d.gridGraphicTransform$,
54
+ gridAxesSize$: d.gridAxesSize$,
55
+ gridHighlight$: d.gridHighlight$,
56
+ gridContainerPosition$: d.gridContainerPosition$,
57
+ layout$: observer.layout$,
58
+ event$: subject.event$ as Subject<any>,
59
+ })
54
60
  })
55
- })
56
- })
61
+ })
57
62
 
58
63
  return () => {
59
64
  destroy$.next(undefined)
@@ -1,5 +1,6 @@
1
1
  import * as d3 from 'd3'
2
2
  import {
3
+ takeUntil,
3
4
  Subject } from 'rxjs'
4
5
  import {
5
6
  defineMultiGridPlugin } from '@orbcharts/core'
@@ -20,39 +21,43 @@ export const MultiLines = defineMultiGridPlugin(pluginName, DEFAULT_MULTI_LINES_
20
21
 
21
22
  const multiGridPlugin$ = multiGridPluginObservables(observer)
22
23
 
23
- multiGridPlugin$.subscribe(data => {
24
- // 每次重新計算時,清除之前的訂閱
25
- unsubscribeFnArr.forEach(fn => fn())
24
+ multiGridPlugin$
25
+ .pipe(
26
+ takeUntil(destroy$)
27
+ )
28
+ .subscribe(data => {
29
+ // 每次重新計算時,清除之前的訂閱
30
+ unsubscribeFnArr.forEach(fn => fn())
31
+
32
+ selection.selectAll(`g.${gridClassName}`)
33
+ .data(data)
34
+ .join('g')
35
+ .attr('class', gridClassName)
36
+ .each((d, i, g) => {
37
+
38
+ const gridSelection = d3.select(g[i])
26
39
 
27
- selection.selectAll(`g.${gridClassName}`)
28
- .data(data)
29
- .join('g')
30
- .attr('class', gridClassName)
31
- .each((d, i, g) => {
32
-
33
- const gridSelection = d3.select(g[i])
34
-
35
- unsubscribeFnArr[i] = createBaseLines(pluginName, {
36
- selection: gridSelection,
37
- computedData$: d.computedData$,
38
- computedLayoutData$: d.computedLayoutData$,
39
- visibleComputedData$: d.visibleComputedData$,
40
- visibleComputedLayoutData$: d.visibleComputedLayoutData$,
41
- seriesLabels$: d.seriesLabels$,
42
- SeriesDataMap$: d.SeriesDataMap$,
43
- GroupDataMap$: d.GroupDataMap$,
44
- fullDataFormatter$: d.dataFormatter$,
45
- fullParams$: observer.fullParams$,
46
- fullChartParams$: observer.fullChartParams$,
47
- gridAxesTransform$: d.gridAxesTransform$,
48
- gridGraphicTransform$: d.gridGraphicTransform$,
49
- gridAxesSize$: d.gridAxesSize$,
50
- gridHighlight$: d.gridHighlight$,
51
- gridContainerPosition$: d.gridContainerPosition$,
52
- event$: subject.event$ as Subject<any>,
40
+ unsubscribeFnArr[i] = createBaseLines(pluginName, {
41
+ selection: gridSelection,
42
+ computedData$: d.computedData$,
43
+ computedLayoutData$: d.computedLayoutData$,
44
+ visibleComputedData$: d.visibleComputedData$,
45
+ visibleComputedLayoutData$: d.visibleComputedLayoutData$,
46
+ seriesLabels$: d.seriesLabels$,
47
+ SeriesDataMap$: d.SeriesDataMap$,
48
+ GroupDataMap$: d.GroupDataMap$,
49
+ fullDataFormatter$: d.dataFormatter$,
50
+ fullParams$: observer.fullParams$,
51
+ fullChartParams$: observer.fullChartParams$,
52
+ gridAxesTransform$: d.gridAxesTransform$,
53
+ gridGraphicTransform$: d.gridGraphicTransform$,
54
+ gridAxesSize$: d.gridAxesSize$,
55
+ gridHighlight$: d.gridHighlight$,
56
+ gridContainerPosition$: d.gridContainerPosition$,
57
+ event$: subject.event$ as Subject<any>,
58
+ })
53
59
  })
54
- })
55
- })
60
+ })
56
61
 
57
62
  return () => {
58
63
  destroy$.next(undefined)