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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/dist/orbcharts-plugins-basic.es.js +7770 -7580
  2. package/dist/orbcharts-plugins-basic.umd.js +8 -8
  3. package/dist/src/base/BaseBarStack.d.ts +6 -4
  4. package/dist/src/base/BaseBars.d.ts +6 -4
  5. package/dist/src/base/BaseBarsTriangle.d.ts +7 -4
  6. package/dist/src/base/BaseDots.d.ts +5 -3
  7. package/dist/src/base/BaseGroupAxis.d.ts +3 -3
  8. package/dist/src/base/BaseLineAreas.d.ts +6 -3
  9. package/dist/src/base/BaseLines.d.ts +6 -3
  10. package/dist/src/base/BaseValueAxis.d.ts +3 -3
  11. package/dist/src/grid/gridObservables.d.ts +4 -4
  12. package/dist/src/multiGrid/multiGridObservables.d.ts +2 -6
  13. package/dist/src/series/plugins/PieEventTexts.d.ts +3 -1
  14. package/dist/src/series/seriesObservables.d.ts +21 -0
  15. package/dist/src/series/seriesUtils.d.ts +3 -3
  16. package/package.json +2 -2
  17. package/src/base/BaseBarStack.ts +105 -208
  18. package/src/base/BaseBars.ts +78 -64
  19. package/src/base/BaseBarsTriangle.ts +76 -63
  20. package/src/base/BaseDots.ts +41 -178
  21. package/src/base/BaseGroupAxis.ts +13 -13
  22. package/src/base/BaseLineAreas.ts +85 -81
  23. package/src/base/BaseLines.ts +82 -75
  24. package/src/base/BaseValueAxis.ts +14 -15
  25. package/src/grid/gridObservables.ts +22 -38
  26. package/src/grid/plugins/BarStack.ts +16 -3
  27. package/src/grid/plugins/Bars.ts +18 -4
  28. package/src/grid/plugins/BarsDiverging.ts +6 -4
  29. package/src/grid/plugins/BarsTriangle.ts +20 -4
  30. package/src/grid/plugins/Dots.ts +4 -2
  31. package/src/grid/plugins/GroupAux.ts +1 -2
  32. package/src/grid/plugins/GroupAxis.ts +15 -3
  33. package/src/grid/plugins/LineAreas.ts +5 -2
  34. package/src/grid/plugins/Lines.ts +5 -2
  35. package/src/grid/plugins/ScalingArea.ts +0 -1
  36. package/src/grid/plugins/ValueAxis.ts +15 -3
  37. package/src/grid/plugins/ValueStackAxis.ts +14 -5
  38. package/src/multiGrid/multiGridObservables.ts +14 -261
  39. package/src/multiGrid/plugins/MultiBarStack.ts +22 -8
  40. package/src/multiGrid/plugins/MultiBars.ts +21 -7
  41. package/src/multiGrid/plugins/MultiBarsTriangle.ts +22 -7
  42. package/src/multiGrid/plugins/MultiDots.ts +7 -5
  43. package/src/multiGrid/plugins/MultiGridLegend.ts +1 -1
  44. package/src/multiGrid/plugins/MultiGroupAxis.ts +19 -7
  45. package/src/multiGrid/plugins/MultiLineAreas.ts +9 -6
  46. package/src/multiGrid/plugins/MultiLines.ts +9 -6
  47. package/src/multiGrid/plugins/MultiValueAxis.ts +19 -7
  48. package/src/multiGrid/plugins/OverlappingValueAxes.ts +52 -47
  49. package/src/noneData/defaults.ts +3 -0
  50. package/src/series/defaults.ts +13 -3
  51. package/src/series/plugins/Bubbles.ts +139 -88
  52. package/src/series/plugins/Pie.ts +307 -352
  53. package/src/series/plugins/PieEventTexts.ts +102 -38
  54. package/src/series/plugins/PieLabels.ts +95 -48
  55. package/src/series/seriesObservables.ts +145 -0
  56. package/src/series/seriesUtils.ts +4 -4
  57. package/tsconfig.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { Observable, Subject } from 'rxjs';
2
2
  import { BasePluginFn } from './types';
3
- import { ComputedDatumGrid, ComputedDataGrid, DataFormatterGrid, EventGrid, ChartParams, ContainerPosition, TransformData } from '@orbcharts/core';
3
+ import { ComputedDatumGrid, ComputedDataGrid, ComputedLayoutDataGrid, DataFormatterGrid, EventGrid, ChartParams, GridContainerPosition, TransformData } from '@orbcharts/core';
4
4
  import * as d3 from 'd3';
5
5
  export interface BaseBarStackParams {
6
6
  barWidth: number;
@@ -10,8 +10,10 @@ export interface BaseBarStackParams {
10
10
  interface BaseBarStackContext {
11
11
  selection: d3.Selection<any, unknown, any, unknown>;
12
12
  computedData$: Observable<ComputedDataGrid>;
13
+ computedLayoutData$: Observable<ComputedLayoutDataGrid>;
13
14
  visibleComputedData$: Observable<ComputedDatumGrid[][]>;
14
- existSeriesLabels$: Observable<string[]>;
15
+ visibleComputedLayoutData$: Observable<ComputedLayoutDataGrid>;
16
+ seriesLabels$: Observable<string[]>;
15
17
  SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
16
18
  GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
17
19
  fullParams$: Observable<BaseBarStackParams>;
@@ -25,8 +27,8 @@ interface BaseBarStackContext {
25
27
  height: number;
26
28
  }>;
27
29
  gridHighlight$: Observable<ComputedDatumGrid[]>;
28
- gridContainer$: Observable<ContainerPosition[]>;
29
- isSeriesPositionSeprate$: Observable<boolean>;
30
+ gridContainerPosition$: Observable<GridContainerPosition[]>;
31
+ isSeriesSeprate$: Observable<boolean>;
30
32
  event$: Subject<EventGrid>;
31
33
  }
32
34
  export declare const createBaseBarStack: BasePluginFn<BaseBarStackContext>;
@@ -1,6 +1,6 @@
1
1
  import { Observable, Subject } from 'rxjs';
2
2
  import { BasePluginFn } from './types';
3
- import { ComputedDatumGrid, ComputedDataGrid, ContainerPosition, EventGrid, ChartParams, TransformData } from '@orbcharts/core';
3
+ import { ComputedDatumGrid, ComputedDataGrid, ComputedLayoutDataGrid, GridContainerPosition, EventGrid, ChartParams, TransformData } from '@orbcharts/core';
4
4
  import * as d3 from 'd3';
5
5
  export interface BaseBarsParams {
6
6
  barWidth: number;
@@ -11,8 +11,10 @@ export interface BaseBarsParams {
11
11
  interface BaseBarsContext {
12
12
  selection: d3.Selection<any, unknown, any, unknown>;
13
13
  computedData$: Observable<ComputedDataGrid>;
14
+ computedLayoutData$: Observable<ComputedLayoutDataGrid>;
14
15
  visibleComputedData$: Observable<ComputedDatumGrid[][]>;
15
- existSeriesLabels$: Observable<string[]>;
16
+ visibleComputedLayoutData$: Observable<ComputedLayoutDataGrid>;
17
+ seriesLabels$: Observable<string[]>;
16
18
  SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
17
19
  GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
18
20
  fullParams$: Observable<BaseBarsParams>;
@@ -25,8 +27,8 @@ interface BaseBarsContext {
25
27
  height: number;
26
28
  }>;
27
29
  gridHighlight$: Observable<ComputedDatumGrid[]>;
28
- gridContainer$: Observable<ContainerPosition[]>;
29
- isSeriesPositionSeprate$: Observable<boolean>;
30
+ gridContainerPosition$: Observable<GridContainerPosition[]>;
31
+ isSeriesSeprate$: Observable<boolean>;
30
32
  event$: Subject<EventGrid>;
31
33
  }
32
34
  export declare const createBaseBars: BasePluginFn<BaseBarsContext>;
@@ -1,6 +1,6 @@
1
1
  import { Observable, Subject } from 'rxjs';
2
2
  import { BasePluginFn } from './types';
3
- import { ComputedDatumGrid, ComputedDataGrid, EventGrid, ChartParams, ContainerPosition, TransformData } from '@orbcharts/core';
3
+ import { ComputedDatumGrid, ComputedDataGrid, ComputedLayoutDataGrid, DataFormatterTypeMap, EventGrid, ChartParams, GridContainerPosition, TransformData } from '@orbcharts/core';
4
4
  import * as d3 from 'd3';
5
5
  export interface BaseBarsTriangleParams {
6
6
  barWidth: number;
@@ -11,8 +11,11 @@ export interface BaseBarsTriangleParams {
11
11
  interface BaseBarsContext {
12
12
  selection: d3.Selection<any, unknown, any, unknown>;
13
13
  computedData$: Observable<ComputedDataGrid>;
14
+ computedLayoutData$: Observable<ComputedLayoutDataGrid>;
14
15
  visibleComputedData$: Observable<ComputedDatumGrid[][]>;
15
- existSeriesLabels$: Observable<string[]>;
16
+ visibleComputedLayoutData$: Observable<ComputedLayoutDataGrid>;
17
+ fullDataFormatter$: Observable<DataFormatterTypeMap<'grid'>>;
18
+ seriesLabels$: Observable<string[]>;
16
19
  SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
17
20
  GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
18
21
  fullParams$: Observable<BaseBarsTriangleParams>;
@@ -24,8 +27,8 @@ interface BaseBarsContext {
24
27
  height: number;
25
28
  }>;
26
29
  gridHighlight$: Observable<ComputedDatumGrid[]>;
27
- gridContainer$: Observable<ContainerPosition[]>;
28
- isSeriesPositionSeprate$: Observable<boolean>;
30
+ gridContainerPosition$: Observable<GridContainerPosition[]>;
31
+ isSeriesSeprate$: Observable<boolean>;
29
32
  event$: Subject<EventGrid>;
30
33
  }
31
34
  export declare const createBaseBarsTriangle: BasePluginFn<BaseBarsContext>;
@@ -1,6 +1,6 @@
1
1
  import { Observable, Subject } from 'rxjs';
2
2
  import { BasePluginFn } from './types';
3
- import { ComputedDatumGrid, ComputedDataGrid, EventGrid, ChartParams, ContainerPosition, TransformData, ColorType } from '@orbcharts/core';
3
+ import { ComputedDatumGrid, ComputedDataGrid, ComputedLayoutDataGrid, EventGrid, ChartParams, GridContainerPosition, TransformData, ColorType } from '@orbcharts/core';
4
4
  import * as d3 from 'd3';
5
5
  export interface BaseDotsParams {
6
6
  radius: number;
@@ -12,8 +12,10 @@ export interface BaseDotsParams {
12
12
  interface BaseDotsContext {
13
13
  selection: d3.Selection<any, unknown, any, unknown>;
14
14
  computedData$: Observable<ComputedDataGrid>;
15
+ computedLayoutData$: Observable<ComputedLayoutDataGrid>;
15
16
  visibleComputedData$: Observable<ComputedDatumGrid[][]>;
16
- existSeriesLabels$: Observable<string[]>;
17
+ visibleComputedLayoutData$: Observable<ComputedLayoutDataGrid>;
18
+ seriesLabels$: Observable<string[]>;
17
19
  SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
18
20
  GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
19
21
  fullParams$: Observable<BaseDotsParams>;
@@ -26,7 +28,7 @@ interface BaseDotsContext {
26
28
  height: number;
27
29
  }>;
28
30
  gridHighlight$: Observable<ComputedDatumGrid[]>;
29
- gridContainer$: Observable<ContainerPosition[]>;
31
+ gridContainerPosition$: Observable<GridContainerPosition[]>;
30
32
  event$: Subject<EventGrid>;
31
33
  }
32
34
  export declare const createBaseDots: BasePluginFn<BaseDotsContext>;
@@ -1,5 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ColorType, ComputedDataGrid, ContainerPosition, DataFormatterGrid, ChartParams, TransformData } from '@orbcharts/core';
2
+ import { ColorType, ComputedDataGrid, GridContainerPosition, DataFormatterGrid, ChartParams, TransformData } from '@orbcharts/core';
3
3
  import { BasePluginFn } from './types';
4
4
  import * as d3 from 'd3';
5
5
  export interface BaseGroupAxisParams {
@@ -28,8 +28,8 @@ interface BaseGroupAxisContext {
28
28
  width: number;
29
29
  height: number;
30
30
  }>;
31
- gridContainer$: Observable<ContainerPosition[]>;
32
- isSeriesPositionSeprate$: Observable<boolean>;
31
+ gridContainerPosition$: Observable<GridContainerPosition[]>;
32
+ isSeriesSeprate$: Observable<boolean>;
33
33
  }
34
34
  export declare const createBaseGroupAxis: BasePluginFn<BaseGroupAxisContext>;
35
35
  export {};
@@ -1,6 +1,6 @@
1
1
  import { Observable, Subject } from 'rxjs';
2
2
  import { BasePluginFn } from './types';
3
- import { ComputedDatumGrid, ComputedDataGrid, DataFormatterGrid, EventGrid, ContainerPosition, ChartParams, Layout, TransformData } from '@orbcharts/core';
3
+ import { ComputedDatumGrid, ComputedDataGrid, ComputedLayoutDataGrid, DataFormatterGrid, EventGrid, GridContainerPosition, ChartParams, Layout, TransformData } from '@orbcharts/core';
4
4
  import * as d3 from 'd3';
5
5
  export interface BaseLineAreasParams {
6
6
  lineCurve: string;
@@ -9,7 +9,10 @@ export interface BaseLineAreasParams {
9
9
  interface BaseLineAreasContext {
10
10
  selection: d3.Selection<any, unknown, any, unknown>;
11
11
  computedData$: Observable<ComputedDataGrid>;
12
- existSeriesLabels$: Observable<string[]>;
12
+ computedLayoutData$: Observable<ComputedLayoutDataGrid>;
13
+ visibleComputedData$: Observable<ComputedDatumGrid[][]>;
14
+ visibleComputedLayoutData$: Observable<ComputedLayoutDataGrid>;
15
+ seriesLabels$: Observable<string[]>;
13
16
  SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
14
17
  GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
15
18
  fullDataFormatter$: Observable<DataFormatterGrid>;
@@ -22,7 +25,7 @@ interface BaseLineAreasContext {
22
25
  height: number;
23
26
  }>;
24
27
  gridHighlight$: Observable<ComputedDatumGrid[]>;
25
- gridContainer$: Observable<ContainerPosition[]>;
28
+ gridContainerPosition$: Observable<GridContainerPosition[]>;
26
29
  layout$: Observable<Layout>;
27
30
  event$: Subject<EventGrid>;
28
31
  }
@@ -1,6 +1,6 @@
1
1
  import { Observable, Subject } from 'rxjs';
2
2
  import { BasePluginFn } from './types';
3
- import { ComputedDatumGrid, ComputedDataGrid, DataFormatterGrid, EventGrid, ContainerPosition, ChartParams, TransformData } from '@orbcharts/core';
3
+ import { ComputedDatumGrid, ComputedDataGrid, ComputedLayoutDataGrid, DataFormatterGrid, EventGrid, GridContainerPosition, ChartParams, TransformData } from '@orbcharts/core';
4
4
  import * as d3 from 'd3';
5
5
  export interface BaseLinesParams {
6
6
  lineCurve: string;
@@ -9,7 +9,10 @@ export interface BaseLinesParams {
9
9
  interface BaseLinesContext {
10
10
  selection: d3.Selection<any, unknown, any, unknown>;
11
11
  computedData$: Observable<ComputedDataGrid>;
12
- existSeriesLabels$: Observable<string[]>;
12
+ computedLayoutData$: Observable<ComputedLayoutDataGrid>;
13
+ visibleComputedData$: Observable<ComputedDatumGrid[][]>;
14
+ visibleComputedLayoutData$: Observable<ComputedLayoutDataGrid>;
15
+ seriesLabels$: Observable<string[]>;
13
16
  SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
14
17
  GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
15
18
  fullDataFormatter$: Observable<DataFormatterGrid>;
@@ -22,7 +25,7 @@ interface BaseLinesContext {
22
25
  height: number;
23
26
  }>;
24
27
  gridHighlight$: Observable<ComputedDatumGrid[]>;
25
- gridContainer$: Observable<ContainerPosition[]>;
28
+ gridContainerPosition$: Observable<GridContainerPosition[]>;
26
29
  event$: Subject<EventGrid>;
27
30
  }
28
31
  export declare const createBaseLines: BasePluginFn<BaseLinesContext>;
@@ -1,6 +1,6 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { BasePluginFn } from './types';
3
- import { ComputedDataGrid, DataFormatterGrid, ChartParams, ContainerPosition, TransformData, ColorType } from '@orbcharts/core';
3
+ import { ComputedDataGrid, DataFormatterGrid, ChartParams, GridContainerPosition, TransformData, ColorType } from '@orbcharts/core';
4
4
  import * as d3 from 'd3';
5
5
  export interface BaseValueAxisParams {
6
6
  labelOffset: [number, number];
@@ -29,8 +29,8 @@ interface BaseLinesContext {
29
29
  width: number;
30
30
  height: number;
31
31
  }>;
32
- gridContainer$: Observable<ContainerPosition[]>;
33
- isSeriesPositionSeprate$: Observable<boolean>;
32
+ gridContainerPosition$: Observable<GridContainerPosition[]>;
33
+ isSeriesSeprate$: Observable<boolean>;
34
34
  }
35
35
  export declare const createBaseValueAxis: BasePluginFn<BaseLinesContext>;
36
36
  export {};
@@ -1,12 +1,12 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ChartParams, DataFormatterGrid, ComputedDataGrid, TransformData, ContainerPosition } from '@orbcharts/core';
2
+ import { ChartParams, DataFormatterGrid, ComputedDataGrid, TransformData, GridContainerPosition } from '@orbcharts/core';
3
3
  import * as d3 from 'd3';
4
- export declare const gridSelectionsObservable: ({ selection, pluginName, clipPathID, existSeriesLabels$, gridContainer$, gridAxesTransform$, gridGraphicTransform$ }: {
4
+ export declare const gridSelectionsObservable: ({ selection, pluginName, clipPathID, seriesLabels$, gridContainerPosition$, gridAxesTransform$, gridGraphicTransform$ }: {
5
5
  selection: d3.Selection<any, unknown, any, unknown>;
6
6
  pluginName: string;
7
7
  clipPathID: string;
8
- existSeriesLabels$: Observable<string[]>;
9
- gridContainer$: Observable<ContainerPosition[]>;
8
+ seriesLabels$: Observable<string[]>;
9
+ gridContainerPosition$: Observable<GridContainerPosition[]>;
10
10
  gridAxesTransform$: Observable<TransformData>;
11
11
  gridGraphicTransform$: Observable<TransformData>;
12
12
  }) => {
@@ -1,12 +1,8 @@
1
1
  import { Observable } from 'rxjs';
2
- import { ContextObserverMultiGrid, ComputedDataGrid, DataFormatterGrid, ContextObserverGridDetail } from '@orbcharts/core';
2
+ import { ContextObserverMultiGrid, ContextObserverMultiGridDetail } from '@orbcharts/core';
3
3
 
4
4
  interface MultiGridPluginParams {
5
5
  gridIndexes: number[];
6
6
  }
7
- interface MultiGridDetailObservables extends ContextObserverGridDetail {
8
- gridComputedData$: Observable<ComputedDataGrid>;
9
- gridDataFormatter$: Observable<DataFormatterGrid>;
10
- }
11
- export declare const multiGridDetailObservables: (observer: ContextObserverMultiGrid<MultiGridPluginParams>) => Observable<MultiGridDetailObservables[]>;
7
+ export declare const multiGridPluginObservables: (observer: ContextObserverMultiGrid<MultiGridPluginParams>) => Observable<ContextObserverMultiGridDetail[]>;
12
8
  export {};
@@ -1 +1,3 @@
1
- export declare const PieEventTexts: import('@orbcharts/core').PluginConstructor<"series", string, import('..').PieEventTextsParams>;
1
+ import { PieEventTextsParams } from '../types';
2
+
3
+ export declare const PieEventTexts: import('@orbcharts/core').PluginConstructor<"series", string, PieEventTextsParams>;
@@ -0,0 +1,21 @@
1
+ import { Observable } from 'rxjs';
2
+ import { SeriesContainerPosition } from '@orbcharts/core';
3
+ import * as d3 from 'd3';
4
+ export declare const seriesStartSelectionObservable: ({ selection, pluginName, separateSeries$, seriesLabels$, seriesContainerPosition$ }: {
5
+ selection: d3.Selection<any, unknown, any, unknown>;
6
+ pluginName: string;
7
+ separateSeries$: Observable<boolean>;
8
+ seriesLabels$: Observable<string[]>;
9
+ seriesContainerPosition$: Observable<SeriesContainerPosition[]>;
10
+ }) => {
11
+ seriesStartSelection$: Observable<d3.Selection<SVGGElement, string, any, unknown>>;
12
+ };
13
+ export declare const seriesCenterSelectionObservable: ({ selection, pluginName, separateSeries$, seriesLabels$, seriesContainerPosition$ }: {
14
+ selection: d3.Selection<any, unknown, any, unknown>;
15
+ pluginName: string;
16
+ separateSeries$: Observable<boolean>;
17
+ seriesLabels$: Observable<string[]>;
18
+ seriesContainerPosition$: Observable<SeriesContainerPosition[]>;
19
+ }) => {
20
+ seriesCenterSelection$: Observable<d3.Selection<SVGGElement, string, any, unknown>>;
21
+ };
@@ -1,4 +1,4 @@
1
- import { ComputedDataSeries, ComputedDatumSeries } from '@orbcharts/core';
1
+ import { ComputedDatumSeries } from '@orbcharts/core';
2
2
 
3
3
  export interface D3PieDatum {
4
4
  data: any;
@@ -12,8 +12,8 @@ export interface PieDatum extends D3PieDatum {
12
12
  data: ComputedDatumSeries;
13
13
  id: string;
14
14
  }
15
- export declare function makePieData({ computedDataSeries, startAngle, endAngle }: {
16
- computedDataSeries: ComputedDataSeries;
15
+ export declare function makePieData({ data, startAngle, endAngle }: {
16
+ data: ComputedDatumSeries[];
17
17
  startAngle: number;
18
18
  endAngle: number;
19
19
  }): PieDatum[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbcharts/plugins-basic",
3
- "version": "3.0.0-alpha.44",
3
+ "version": "3.0.0-alpha.46",
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.42",
38
+ "@orbcharts/core": "^3.0.0-alpha.44",
39
39
  "d3": "^7.8.5",
40
40
  "rxjs": "^7.8.1"
41
41
  }