@orbcharts/plugins-basic 3.0.0-alpha.43 → 3.0.0-alpha.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. package/LICENSE +200 -200
  2. package/dist/orbcharts-plugins-basic.es.js +5611 -5571
  3. package/dist/orbcharts-plugins-basic.umd.js +7 -7
  4. package/dist/src/base/BaseLegend.d.ts +1 -0
  5. package/package.json +42 -42
  6. package/src/base/BaseBarStack.ts +881 -881
  7. package/src/base/BaseBars.ts +750 -750
  8. package/src/base/BaseBarsTriangle.ts +659 -659
  9. package/src/base/BaseDots.ts +639 -639
  10. package/src/base/BaseGroupAxis.ts +496 -496
  11. package/src/base/BaseLegend.ts +641 -636
  12. package/src/base/BaseLineAreas.ts +621 -621
  13. package/src/base/BaseLines.ts +692 -692
  14. package/src/base/BaseValueAxis.ts +479 -479
  15. package/src/base/types.ts +2 -2
  16. package/src/grid/defaults.ts +121 -121
  17. package/src/grid/gridObservables.ts +263 -263
  18. package/src/grid/index.ts +15 -15
  19. package/src/grid/plugins/BarStack.ts +37 -37
  20. package/src/grid/plugins/Bars.ts +37 -37
  21. package/src/grid/plugins/BarsDiverging.ts +39 -39
  22. package/src/grid/plugins/BarsTriangle.ts +34 -34
  23. package/src/grid/plugins/Dots.ts +35 -35
  24. package/src/grid/plugins/GridLegend.ts +59 -58
  25. package/src/grid/plugins/GroupAux.ts +646 -643
  26. package/src/grid/plugins/GroupAxis.ts +30 -30
  27. package/src/grid/plugins/LineAreas.ts +36 -36
  28. package/src/grid/plugins/Lines.ts +35 -35
  29. package/src/grid/plugins/ScalingArea.ts +174 -174
  30. package/src/grid/plugins/ValueAxis.ts +31 -31
  31. package/src/grid/plugins/ValueStackAxis.ts +70 -70
  32. package/src/grid/types.ts +120 -120
  33. package/src/index.ts +9 -9
  34. package/src/multiGrid/defaults.ts +147 -147
  35. package/src/multiGrid/index.ts +11 -11
  36. package/src/multiGrid/multiGridObservables.ts +289 -289
  37. package/src/multiGrid/plugins/MultiBarStack.ts +60 -60
  38. package/src/multiGrid/plugins/MultiBars.ts +59 -59
  39. package/src/multiGrid/plugins/MultiBarsTriangle.ts +58 -58
  40. package/src/multiGrid/plugins/MultiDots.ts +58 -58
  41. package/src/multiGrid/plugins/MultiGridLegend.ts +89 -88
  42. package/src/multiGrid/plugins/MultiGroupAxis.ts +53 -53
  43. package/src/multiGrid/plugins/MultiLineAreas.ts +59 -59
  44. package/src/multiGrid/plugins/MultiLines.ts +58 -58
  45. package/src/multiGrid/plugins/MultiValueAxis.ts +53 -53
  46. package/src/multiGrid/plugins/OverlappingValueAxes.ts +164 -164
  47. package/src/multiGrid/types.ts +67 -67
  48. package/src/noneData/defaults.ts +61 -61
  49. package/src/noneData/index.ts +3 -3
  50. package/src/noneData/plugins/Container.ts +10 -10
  51. package/src/noneData/plugins/Tooltip.ts +310 -304
  52. package/src/noneData/types.ts +26 -26
  53. package/src/series/defaults.ts +99 -99
  54. package/src/series/index.ts +6 -6
  55. package/src/series/plugins/Bubbles.ts +551 -551
  56. package/src/series/plugins/Pie.ts +600 -600
  57. package/src/series/plugins/PieEventTexts.ts +194 -194
  58. package/src/series/plugins/PieLabels.ts +288 -288
  59. package/src/series/plugins/SeriesLegend.ts +59 -58
  60. package/src/series/seriesUtils.ts +50 -50
  61. package/src/series/types.ts +67 -67
  62. package/src/tree/defaults.ts +22 -22
  63. package/src/tree/index.ts +3 -3
  64. package/src/tree/plugins/TreeLegend.ts +59 -58
  65. package/src/tree/plugins/TreeMap.ts +305 -302
  66. package/src/tree/types.ts +23 -23
  67. package/src/utils/commonUtils.ts +21 -21
  68. package/src/utils/d3Graphics.ts +124 -124
  69. package/src/utils/d3Utils.ts +73 -73
  70. package/src/utils/observables.ts +14 -14
  71. package/src/utils/orbchartsUtils.ts +100 -100
  72. package/tsconfig.dev.json +16 -16
  73. package/tsconfig.json +13 -13
  74. package/tsconfig.prod.json +13 -13
  75. package/vite.config.js +49 -49
@@ -1,37 +1,37 @@
1
- import {
2
- Subject,
3
- Observable } from 'rxjs'
4
- import {
5
- defineGridPlugin } from '@orbcharts/core'
6
- import { DEFAULT_BARS_PARAMS } from '../defaults'
7
- import { createBaseBars } from '../../base/BaseBars'
8
-
9
- const pluginName = 'Bars'
10
-
11
- export const Bars = defineGridPlugin(pluginName, DEFAULT_BARS_PARAMS)(({ selection, name, subject, observer }) => {
12
- const destroy$ = new Subject()
13
-
14
- const unsubscribeBaseBars = createBaseBars(pluginName, {
15
- selection,
16
- computedData$: observer.computedData$,
17
- visibleComputedData$: observer.visibleComputedData$,
18
- existSeriesLabels$: observer.existSeriesLabels$,
19
- SeriesDataMap$: observer.SeriesDataMap$,
20
- GroupDataMap$: observer.GroupDataMap$,
21
- fullParams$: observer.fullParams$,
22
- fullChartParams$: observer.fullChartParams$,
23
- gridAxesTransform$: observer.gridAxesTransform$,
24
- gridGraphicTransform$: observer.gridGraphicTransform$,
25
- gridGraphicReverseScale$: observer.gridGraphicReverseScale$,
26
- gridAxesSize$: observer.gridAxesSize$,
27
- gridHighlight$: observer.gridHighlight$,
28
- gridContainer$: observer.gridContainer$,
29
- isSeriesPositionSeprate$: observer.isSeriesPositionSeprate$,
30
- event$: subject.event$,
31
- })
32
-
33
- return () => {
34
- destroy$.next(undefined)
35
- unsubscribeBaseBars()
36
- }
37
- })
1
+ import {
2
+ Subject,
3
+ Observable } from 'rxjs'
4
+ import {
5
+ defineGridPlugin } from '@orbcharts/core'
6
+ import { DEFAULT_BARS_PARAMS } from '../defaults'
7
+ import { createBaseBars } from '../../base/BaseBars'
8
+
9
+ const pluginName = 'Bars'
10
+
11
+ export const Bars = defineGridPlugin(pluginName, DEFAULT_BARS_PARAMS)(({ selection, name, subject, observer }) => {
12
+ const destroy$ = new Subject()
13
+
14
+ const unsubscribeBaseBars = createBaseBars(pluginName, {
15
+ selection,
16
+ computedData$: observer.computedData$,
17
+ visibleComputedData$: observer.visibleComputedData$,
18
+ existSeriesLabels$: observer.existSeriesLabels$,
19
+ SeriesDataMap$: observer.SeriesDataMap$,
20
+ GroupDataMap$: observer.GroupDataMap$,
21
+ fullParams$: observer.fullParams$,
22
+ fullChartParams$: observer.fullChartParams$,
23
+ gridAxesTransform$: observer.gridAxesTransform$,
24
+ gridGraphicTransform$: observer.gridGraphicTransform$,
25
+ gridGraphicReverseScale$: observer.gridGraphicReverseScale$,
26
+ gridAxesSize$: observer.gridAxesSize$,
27
+ gridHighlight$: observer.gridHighlight$,
28
+ gridContainer$: observer.gridContainer$,
29
+ isSeriesPositionSeprate$: observer.isSeriesPositionSeprate$,
30
+ event$: subject.event$,
31
+ })
32
+
33
+ return () => {
34
+ destroy$.next(undefined)
35
+ unsubscribeBaseBars()
36
+ }
37
+ })
@@ -1,39 +1,39 @@
1
- import {
2
- of,
3
- Subject,
4
- Observable } from 'rxjs'
5
- import {
6
- defineGridPlugin } from '@orbcharts/core'
7
- import { DEFAULT_BARS_PARAMS } from '../defaults'
8
- import { createBaseBars } from '../../base/BaseBars'
9
-
10
- const pluginName = 'BarsDiverging'
11
-
12
- export const BarsDiverging = defineGridPlugin(pluginName, DEFAULT_BARS_PARAMS)(({ selection, name, subject, observer }) => {
13
- const destroy$ = new Subject()
14
-
15
- const unsubscribeBaseBars = createBaseBars(pluginName, {
16
- selection,
17
- computedData$: observer.computedData$,
18
- visibleComputedData$: observer.visibleComputedData$,
19
- existSeriesLabels$: observer.existSeriesLabels$,
20
- SeriesDataMap$: observer.SeriesDataMap$,
21
- GroupDataMap$: observer.GroupDataMap$,
22
- fullParams$: observer.fullParams$,
23
- fullChartParams$: observer.fullChartParams$,
24
- gridAxesTransform$: observer.gridAxesTransform$,
25
- gridGraphicTransform$: observer.gridGraphicTransform$,
26
- gridGraphicReverseScale$: observer.gridGraphicReverseScale$,
27
- gridAxesSize$: observer.gridAxesSize$,
28
- gridHighlight$: observer.gridHighlight$,
29
- gridContainer$: observer.gridContainer$,
30
- // isSeriesPositionSeprate$: observer.isSeriesPositionSeprate$,
31
- isSeriesPositionSeprate$: of(true), // hack: 永遠為true,可以強制讓每組series的bars的x位置都是一樣的
32
- event$: subject.event$,
33
- })
34
-
35
- return () => {
36
- destroy$.next(undefined)
37
- unsubscribeBaseBars()
38
- }
39
- })
1
+ import {
2
+ of,
3
+ Subject,
4
+ Observable } from 'rxjs'
5
+ import {
6
+ defineGridPlugin } from '@orbcharts/core'
7
+ import { DEFAULT_BARS_PARAMS } from '../defaults'
8
+ import { createBaseBars } from '../../base/BaseBars'
9
+
10
+ const pluginName = 'BarsDiverging'
11
+
12
+ export const BarsDiverging = defineGridPlugin(pluginName, DEFAULT_BARS_PARAMS)(({ selection, name, subject, observer }) => {
13
+ const destroy$ = new Subject()
14
+
15
+ const unsubscribeBaseBars = createBaseBars(pluginName, {
16
+ selection,
17
+ computedData$: observer.computedData$,
18
+ visibleComputedData$: observer.visibleComputedData$,
19
+ existSeriesLabels$: observer.existSeriesLabels$,
20
+ SeriesDataMap$: observer.SeriesDataMap$,
21
+ GroupDataMap$: observer.GroupDataMap$,
22
+ fullParams$: observer.fullParams$,
23
+ fullChartParams$: observer.fullChartParams$,
24
+ gridAxesTransform$: observer.gridAxesTransform$,
25
+ gridGraphicTransform$: observer.gridGraphicTransform$,
26
+ gridGraphicReverseScale$: observer.gridGraphicReverseScale$,
27
+ gridAxesSize$: observer.gridAxesSize$,
28
+ gridHighlight$: observer.gridHighlight$,
29
+ gridContainer$: observer.gridContainer$,
30
+ // isSeriesPositionSeprate$: observer.isSeriesPositionSeprate$,
31
+ isSeriesPositionSeprate$: of(true), // hack: 永遠為true,可以強制讓每組series的bars的x位置都是一樣的
32
+ event$: subject.event$,
33
+ })
34
+
35
+ return () => {
36
+ destroy$.next(undefined)
37
+ unsubscribeBaseBars()
38
+ }
39
+ })
@@ -1,35 +1,35 @@
1
- import {
2
- Subject,
3
- Observable } from 'rxjs'
4
- import { defineGridPlugin } from '@orbcharts/core'
5
- import { DEFAULT_BARS_TRIANGLE_PARAMS } from '../defaults'
6
- import { createBaseBarsTriangle } from '../../base/BaseBarsTriangle'
7
-
8
- const pluginName = 'BarsTriangle'
9
-
10
- export const BarsTriangle = defineGridPlugin(pluginName, DEFAULT_BARS_TRIANGLE_PARAMS)(({ selection, name, subject, observer }) => {
11
- const destroy$ = new Subject()
12
-
13
- const unsubscribeBaseBars = createBaseBarsTriangle(pluginName, {
14
- selection,
15
- computedData$: observer.computedData$,
16
- visibleComputedData$: observer.visibleComputedData$,
17
- existSeriesLabels$: observer.existSeriesLabels$,
18
- SeriesDataMap$: observer.SeriesDataMap$,
19
- GroupDataMap$: observer.GroupDataMap$,
20
- fullParams$: observer.fullParams$,
21
- fullChartParams$: observer.fullChartParams$,
22
- gridAxesTransform$: observer.gridAxesTransform$,
23
- gridGraphicTransform$: observer.gridGraphicTransform$,
24
- gridAxesSize$: observer.gridAxesSize$,
25
- gridHighlight$: observer.gridHighlight$,
26
- gridContainer$: observer.gridContainer$,
27
- isSeriesPositionSeprate$: observer.isSeriesPositionSeprate$,
28
- event$: subject.event$,
29
- })
30
-
31
- return () => {
32
- destroy$.next(undefined)
33
- unsubscribeBaseBars()
34
- }
1
+ import {
2
+ Subject,
3
+ Observable } from 'rxjs'
4
+ import { defineGridPlugin } from '@orbcharts/core'
5
+ import { DEFAULT_BARS_TRIANGLE_PARAMS } from '../defaults'
6
+ import { createBaseBarsTriangle } from '../../base/BaseBarsTriangle'
7
+
8
+ const pluginName = 'BarsTriangle'
9
+
10
+ export const BarsTriangle = defineGridPlugin(pluginName, DEFAULT_BARS_TRIANGLE_PARAMS)(({ selection, name, subject, observer }) => {
11
+ const destroy$ = new Subject()
12
+
13
+ const unsubscribeBaseBars = createBaseBarsTriangle(pluginName, {
14
+ selection,
15
+ computedData$: observer.computedData$,
16
+ visibleComputedData$: observer.visibleComputedData$,
17
+ existSeriesLabels$: observer.existSeriesLabels$,
18
+ SeriesDataMap$: observer.SeriesDataMap$,
19
+ GroupDataMap$: observer.GroupDataMap$,
20
+ fullParams$: observer.fullParams$,
21
+ fullChartParams$: observer.fullChartParams$,
22
+ gridAxesTransform$: observer.gridAxesTransform$,
23
+ gridGraphicTransform$: observer.gridGraphicTransform$,
24
+ gridAxesSize$: observer.gridAxesSize$,
25
+ gridHighlight$: observer.gridHighlight$,
26
+ gridContainer$: observer.gridContainer$,
27
+ isSeriesPositionSeprate$: observer.isSeriesPositionSeprate$,
28
+ event$: subject.event$,
29
+ })
30
+
31
+ return () => {
32
+ destroy$.next(undefined)
33
+ unsubscribeBaseBars()
34
+ }
35
35
  })
@@ -1,36 +1,36 @@
1
- import {
2
- Subject } from 'rxjs'
3
- import {
4
- defineGridPlugin } from '@orbcharts/core'
5
- import { DEFAULT_DOTS_PARAMS } from '../defaults'
6
- import { createBaseDots } from '../../base/BaseDots'
7
-
8
- const pluginName = 'Dots'
9
-
10
- export const Dots = defineGridPlugin(pluginName, DEFAULT_DOTS_PARAMS)(({ selection, name, subject, observer }) => {
11
-
12
- const destroy$ = new Subject()
13
-
14
- const unsubscribeBaseBars = createBaseDots(pluginName, {
15
- selection,
16
- computedData$: observer.computedData$,
17
- visibleComputedData$: observer.visibleComputedData$,
18
- existSeriesLabels$: observer.existSeriesLabels$,
19
- SeriesDataMap$: observer.SeriesDataMap$,
20
- GroupDataMap$: observer.GroupDataMap$,
21
- fullParams$: observer.fullParams$,
22
- fullChartParams$: observer.fullChartParams$,
23
- gridAxesTransform$: observer.gridAxesTransform$,
24
- gridGraphicTransform$: observer.gridGraphicTransform$,
25
- gridGraphicReverseScale$: observer.gridGraphicReverseScale$,
26
- gridAxesSize$: observer.gridAxesSize$,
27
- gridHighlight$: observer.gridHighlight$,
28
- gridContainer$: observer.gridContainer$,
29
- event$: subject.event$,
30
- })
31
-
32
- return () => {
33
- destroy$.next(undefined)
34
- unsubscribeBaseBars()
35
- }
1
+ import {
2
+ Subject } from 'rxjs'
3
+ import {
4
+ defineGridPlugin } from '@orbcharts/core'
5
+ import { DEFAULT_DOTS_PARAMS } from '../defaults'
6
+ import { createBaseDots } from '../../base/BaseDots'
7
+
8
+ const pluginName = 'Dots'
9
+
10
+ export const Dots = defineGridPlugin(pluginName, DEFAULT_DOTS_PARAMS)(({ selection, name, subject, observer }) => {
11
+
12
+ const destroy$ = new Subject()
13
+
14
+ const unsubscribeBaseBars = createBaseDots(pluginName, {
15
+ selection,
16
+ computedData$: observer.computedData$,
17
+ visibleComputedData$: observer.visibleComputedData$,
18
+ existSeriesLabels$: observer.existSeriesLabels$,
19
+ SeriesDataMap$: observer.SeriesDataMap$,
20
+ GroupDataMap$: observer.GroupDataMap$,
21
+ fullParams$: observer.fullParams$,
22
+ fullChartParams$: observer.fullChartParams$,
23
+ gridAxesTransform$: observer.gridAxesTransform$,
24
+ gridGraphicTransform$: observer.gridGraphicTransform$,
25
+ gridGraphicReverseScale$: observer.gridGraphicReverseScale$,
26
+ gridAxesSize$: observer.gridAxesSize$,
27
+ gridHighlight$: observer.gridHighlight$,
28
+ gridContainer$: observer.gridContainer$,
29
+ event$: subject.event$,
30
+ })
31
+
32
+ return () => {
33
+ destroy$.next(undefined)
34
+ unsubscribeBaseBars()
35
+ }
36
36
  })
@@ -1,58 +1,59 @@
1
- import * as d3 from 'd3'
2
- import {
3
- combineLatest,
4
- map,
5
- switchMap,
6
- takeUntil,
7
- Observable,
8
- Subject } from 'rxjs'
9
- import {
10
- defineGridPlugin } from '@orbcharts/core'
11
- import { DEFAULT_GRID_LEGEND_PARAMS } from '../defaults'
12
- import { createBaseLegend } from '../../base/BaseLegend'
13
-
14
- const pluginName = 'GridLegend'
15
-
16
- export const GridLegend = defineGridPlugin(pluginName, DEFAULT_GRID_LEGEND_PARAMS)(({ selection, rootSelection, observer, subject }) => {
17
-
18
- const destroy$ = new Subject()
19
-
20
- const seriesLabels$: Observable<string[]> = observer.SeriesDataMap$.pipe(
21
- takeUntil(destroy$),
22
- map(data => {
23
- return Array.from(data.keys())
24
- })
25
- )
26
-
27
- // 全部列點矩型使用相同樣式參數
28
- const fullParams$ = observer.fullParams$.pipe(
29
- takeUntil(destroy$),
30
- map(d => {
31
- const seriesList = [
32
- {
33
- listRectWidth: d.listRectWidth,
34
- listRectHeight: d.listRectHeight,
35
- listRectRadius: d.listRectRadius,
36
- }
37
- ]
38
- return {
39
- ...d,
40
- seriesList
41
- }
42
- })
43
- )
44
-
45
- const unsubscribeBaseLegend = createBaseLegend(pluginName, {
46
- rootSelection,
47
- seriesLabels$,
48
- fullParams$,
49
- layout$: observer.layout$,
50
- fullChartParams$: observer.fullChartParams$
51
- })
52
-
53
- return () => {
54
- destroy$.next(undefined)
55
- unsubscribeBaseLegend()
56
- }
57
- })
58
-
1
+ import * as d3 from 'd3'
2
+ import {
3
+ combineLatest,
4
+ map,
5
+ switchMap,
6
+ takeUntil,
7
+ Observable,
8
+ Subject } from 'rxjs'
9
+ import {
10
+ defineGridPlugin } from '@orbcharts/core'
11
+ import { DEFAULT_GRID_LEGEND_PARAMS } from '../defaults'
12
+ import { createBaseLegend } from '../../base/BaseLegend'
13
+
14
+ const pluginName = 'GridLegend'
15
+
16
+ export const GridLegend = defineGridPlugin(pluginName, DEFAULT_GRID_LEGEND_PARAMS)(({ selection, rootSelection, observer, subject }) => {
17
+
18
+ const destroy$ = new Subject()
19
+
20
+ const seriesLabels$: Observable<string[]> = observer.SeriesDataMap$.pipe(
21
+ takeUntil(destroy$),
22
+ map(data => {
23
+ return Array.from(data.keys())
24
+ })
25
+ )
26
+
27
+ // 全部列點矩型使用相同樣式參數
28
+ const fullParams$ = observer.fullParams$.pipe(
29
+ takeUntil(destroy$),
30
+ map(d => {
31
+ const seriesList = [
32
+ {
33
+ listRectWidth: d.listRectWidth,
34
+ listRectHeight: d.listRectHeight,
35
+ listRectRadius: d.listRectRadius,
36
+ }
37
+ ]
38
+ return {
39
+ ...d,
40
+ seriesList
41
+ }
42
+ })
43
+ )
44
+
45
+ const unsubscribeBaseLegend = createBaseLegend(pluginName, {
46
+ rootSelection,
47
+ seriesLabels$,
48
+ fullParams$,
49
+ layout$: observer.layout$,
50
+ fullChartParams$: observer.fullChartParams$,
51
+ textSizePx$: observer.textSizePx$
52
+ })
53
+
54
+ return () => {
55
+ destroy$.next(undefined)
56
+ unsubscribeBaseLegend()
57
+ }
58
+ })
59
+