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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/dist/orbcharts-plugins-basic.es.js +15995 -15706
  2. package/dist/orbcharts-plugins-basic.umd.js +8 -8
  3. package/dist/src/base/BaseBarStack.d.ts +29 -0
  4. package/dist/src/base/BaseBars.d.ts +29 -0
  5. package/dist/src/base/BaseBarsTriangle.d.ts +28 -0
  6. package/dist/src/base/BaseLegend.d.ts +17 -6
  7. package/dist/src/base/BaseLines.d.ts +27 -0
  8. package/dist/src/base/types.d.ts +2 -2
  9. package/dist/src/grid/defaults.d.ts +10 -10
  10. package/dist/src/grid/plugins/BarStack.d.ts +1 -3
  11. package/dist/src/grid/plugins/Bars.d.ts +1 -3
  12. package/dist/src/grid/plugins/BarsTriangle.d.ts +1 -3
  13. package/dist/src/grid/plugins/Lines.d.ts +1 -3
  14. package/dist/src/grid/types.d.ts +10 -2
  15. package/dist/src/index.d.ts +1 -0
  16. package/dist/src/multiGrid/defaults.d.ts +4 -0
  17. package/dist/src/multiGrid/index.d.ts +4 -0
  18. package/dist/src/multiGrid/plugins/BarsAndLines.d.ts +1 -0
  19. package/dist/src/multiGrid/plugins/MultiGridLegend.d.ts +1 -0
  20. package/dist/src/multiGrid/types.d.ts +24 -0
  21. package/dist/src/series/defaults.d.ts +2 -2
  22. package/dist/src/series/types.d.ts +10 -2
  23. package/package.json +2 -2
  24. package/src/base/BaseBarStack.ts +699 -0
  25. package/src/base/BaseBars.ts +639 -0
  26. package/src/base/BaseBarsTriangle.ts +626 -0
  27. package/src/base/BaseLegend.ts +50 -20
  28. package/src/base/BaseLines.ts +566 -0
  29. package/src/base/types.ts +2 -2
  30. package/src/grid/defaults.ts +10 -10
  31. package/src/grid/plugins/BarStack.ts +18 -645
  32. package/src/grid/plugins/Bars.ts +17 -588
  33. package/src/grid/plugins/BarsTriangle.ts +16 -579
  34. package/src/grid/plugins/Dots.ts +2 -2
  35. package/src/grid/plugins/GridLegend.ts +19 -1
  36. package/src/grid/plugins/GroupArea.ts +2 -2
  37. package/src/grid/plugins/GroupAxis.ts +2 -2
  38. package/src/grid/plugins/Lines.ts +15 -509
  39. package/src/grid/plugins/ScalingArea.ts +2 -2
  40. package/src/grid/plugins/ValueAxis.ts +2 -2
  41. package/src/grid/plugins/ValueStackAxis.ts +2 -2
  42. package/src/grid/types.ts +12 -2
  43. package/src/index.ts +1 -0
  44. package/src/multiGrid/defaults.ts +33 -0
  45. package/src/multiGrid/index.ts +4 -0
  46. package/src/multiGrid/plugins/BarsAndLines.ts +110 -0
  47. package/src/multiGrid/plugins/BarsTriangleAndLines.ts +0 -0
  48. package/src/multiGrid/plugins/DivergingValueAxes.ts +0 -0
  49. package/src/multiGrid/plugins/FirstGroupScaleAxis.ts +0 -0
  50. package/src/multiGrid/plugins/MultiGridLegend.ts +89 -0
  51. package/src/multiGrid/plugins/TwoValueScaleAxes.ts +0 -0
  52. package/src/multiGrid/types.ts +27 -0
  53. package/src/series/defaults.ts +2 -2
  54. package/src/series/plugins/Bubbles.ts +2 -2
  55. package/src/series/plugins/Pie.ts +2 -2
  56. package/src/series/plugins/SeriesLegend.ts +19 -1
  57. package/src/series/types.ts +12 -2
  58. /package/dist/src/multiGrid/plugins/{DivergingAxes.d.ts → BarStackAndLines.d.ts} +0 -0
  59. /package/dist/src/multiGrid/plugins/{TwoScaleAxes.d.ts → BarsTriangleAndLines.d.ts} +0 -0
  60. /package/dist/src/multiGrid/plugins/{TwoScales.d.ts → DivergingValueAxes.d.ts} +0 -0
  61. /package/{src/multiGrid/plugins/DivergingAxes.ts → dist/src/multiGrid/plugins/FirstGroupScaleAxis.d.ts} +0 -0
  62. /package/{src/multiGrid/plugins/TwoScaleAxes.ts → dist/src/multiGrid/plugins/TwoValueScaleAxes.d.ts} +0 -0
  63. /package/src/multiGrid/plugins/{TwoScales.ts → BarStackAndLines.ts} +0 -0
@@ -0,0 +1,29 @@
1
+ import { Observable, Subject } from 'rxjs';
2
+ import { BasePluginFn } from './types';
3
+ import { ComputedDatumGrid, ComputedDataGrid, DataFormatterGrid, EventGrid, ChartParams, TransformData } from '@orbcharts/core';
4
+ import * as d3 from 'd3';
5
+ export interface BaseBarStackParams {
6
+ barWidth: number;
7
+ barGroupPadding: number;
8
+ barRadius: number | boolean;
9
+ }
10
+ interface BaseBarStackContext {
11
+ selection: d3.Selection<any, unknown, any, unknown>;
12
+ computedData$: Observable<ComputedDataGrid>;
13
+ visibleComputedData$: Observable<ComputedDatumGrid[][]>;
14
+ SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
15
+ GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
16
+ fullParams$: Observable<BaseBarStackParams>;
17
+ fullDataFormatter$: Observable<DataFormatterGrid>;
18
+ fullChartParams$: Observable<ChartParams>;
19
+ gridAxesTransform$: Observable<TransformData>;
20
+ gridGraphicTransform$: Observable<TransformData>;
21
+ gridAxesSize$: Observable<{
22
+ width: number;
23
+ height: number;
24
+ }>;
25
+ gridHighlight$: Observable<string[]>;
26
+ event$: Subject<EventGrid>;
27
+ }
28
+ export declare const createBaseBarStack: BasePluginFn<BaseBarStackContext>;
29
+ export {};
@@ -0,0 +1,29 @@
1
+ import { Observable, Subject } from 'rxjs';
2
+ import { BasePluginFn } from './types';
3
+ import { ComputedDatumGrid, ComputedDataGrid, EventGrid, ChartParams, TransformData } from '@orbcharts/core';
4
+ import * as d3 from 'd3';
5
+ export interface BaseBarsParams {
6
+ barWidth: number;
7
+ barPadding: number;
8
+ barGroupPadding: number;
9
+ barRadius: number | boolean;
10
+ }
11
+ interface BaseBarsContext {
12
+ selection: d3.Selection<any, unknown, any, unknown>;
13
+ computedData$: Observable<ComputedDataGrid>;
14
+ visibleComputedData$: Observable<ComputedDatumGrid[][]>;
15
+ SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
16
+ GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
17
+ fullParams$: Observable<BaseBarsParams>;
18
+ fullChartParams$: Observable<ChartParams>;
19
+ gridAxesTransform$: Observable<TransformData>;
20
+ gridGraphicTransform$: Observable<TransformData>;
21
+ gridAxesSize$: Observable<{
22
+ width: number;
23
+ height: number;
24
+ }>;
25
+ gridHighlight$: Observable<string[]>;
26
+ event$: Subject<EventGrid>;
27
+ }
28
+ export declare const createBaseBars: BasePluginFn<BaseBarsContext>;
29
+ export {};
@@ -0,0 +1,28 @@
1
+ import { Observable, Subject } from 'rxjs';
2
+ import { BasePluginFn } from './types';
3
+ import { ComputedDatumGrid, ComputedDataGrid, EventGrid, ChartParams, TransformData } from '@orbcharts/core';
4
+ import * as d3 from 'd3';
5
+ export interface BaseBarsTriangleParams {
6
+ barWidth: number;
7
+ barPadding: number;
8
+ barGroupPadding: number;
9
+ linearGradientOpacity: [number, number];
10
+ }
11
+ interface BaseBarsContext {
12
+ selection: d3.Selection<any, unknown, any, unknown>;
13
+ computedData$: Observable<ComputedDataGrid>;
14
+ SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
15
+ GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
16
+ fullParams$: Observable<BaseBarsTriangleParams>;
17
+ fullChartParams$: Observable<ChartParams>;
18
+ gridAxesTransform$: Observable<TransformData>;
19
+ gridGraphicTransform$: Observable<TransformData>;
20
+ gridAxesSize$: Observable<{
21
+ width: number;
22
+ height: number;
23
+ }>;
24
+ gridHighlight$: Observable<string[]>;
25
+ event$: Subject<EventGrid>;
26
+ }
27
+ export declare const createBaseBarsTriangle: BasePluginFn<BaseBarsContext>;
28
+ export {};
@@ -1,6 +1,7 @@
1
+ import { Observable } from 'rxjs';
1
2
  import { BasePluginFn } from './types';
2
- import { ColorType } from '@orbcharts/core';
3
-
3
+ import { ChartParams, Layout, ColorType } from '@orbcharts/core';
4
+ import * as d3 from 'd3';
4
5
  export interface BaseLegendParams {
5
6
  position: 'top' | 'bottom' | 'left' | 'right';
6
7
  justify: 'start' | 'center' | 'end';
@@ -8,8 +9,18 @@ export interface BaseLegendParams {
8
9
  backgroundFill: ColorType;
9
10
  backgroundStroke: ColorType;
10
11
  gap: number;
11
- listRectWidth: number;
12
- listRectHeight: number;
13
- listRectRadius: number;
12
+ seriesList: Array<{
13
+ listRectWidth: number;
14
+ listRectHeight: number;
15
+ listRectRadius: number;
16
+ }>;
14
17
  }
15
- export declare const createBaseLegend: BasePluginFn;
18
+ interface BaseLegendContext {
19
+ rootSelection: d3.Selection<any, unknown, any, unknown>;
20
+ seriesLabels$: Observable<string[]>;
21
+ fullParams$: Observable<BaseLegendParams>;
22
+ layout$: Observable<Layout>;
23
+ fullChartParams$: Observable<ChartParams>;
24
+ }
25
+ export declare const createBaseLegend: BasePluginFn<BaseLegendContext>;
26
+ export {};
@@ -0,0 +1,27 @@
1
+ import { Observable, Subject } from 'rxjs';
2
+ import { BasePluginFn } from './types';
3
+ import { ComputedDatumGrid, ComputedDataGrid, DataFormatterGrid, EventGrid, ChartParams, TransformData } from '@orbcharts/core';
4
+ import * as d3 from 'd3';
5
+ export interface BaseLinesParams {
6
+ lineCurve: string;
7
+ lineWidth: number;
8
+ }
9
+ interface BaseLinesContext {
10
+ selection: d3.Selection<any, unknown, any, unknown>;
11
+ computedData$: Observable<ComputedDataGrid>;
12
+ SeriesDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
13
+ GroupDataMap$: Observable<Map<string, ComputedDatumGrid[]>>;
14
+ fullDataFormatter$: Observable<DataFormatterGrid>;
15
+ fullParams$: Observable<BaseLinesParams>;
16
+ fullChartParams$: Observable<ChartParams>;
17
+ gridAxesTransform$: Observable<TransformData>;
18
+ gridGraphicTransform$: Observable<TransformData>;
19
+ gridAxesSize$: Observable<{
20
+ width: number;
21
+ height: number;
22
+ }>;
23
+ gridHighlight$: Observable<string[]>;
24
+ event$: Subject<EventGrid>;
25
+ }
26
+ export declare const createBaseLines: BasePluginFn<BaseLinesContext>;
27
+ export {};
@@ -1,3 +1,3 @@
1
- export interface BasePluginFn {
2
- (pluginName: string, context: any): () => void;
1
+ export interface BasePluginFn<Context> {
2
+ (pluginName: string, context: Context): () => void;
3
3
  }
@@ -1,13 +1,13 @@
1
1
  import { LinesParams, GroupAreaParams, DotsParams, BarsParams, BarStackParams, BarsTriangleParams, GroupAxisParams, ValueAxisParams, ValueStackAxisParams, ScalingAreaParams, GridLegendParams } from './types';
2
2
 
3
- export declare const DEFAULT_LINES_PLUGIN_PARAMS: LinesParams;
4
- export declare const DEFAULT_DOTS_PLUGIN_PARAMS: DotsParams;
5
- export declare const DEFAULT_GROUP_AREA_PLUGIN_PARAMS: GroupAreaParams;
6
- export declare const DEFAULT_BARS_PLUGIN_PARAMS: BarsParams;
7
- export declare const DEFAULT_BAR_STACK_PLUGIN_PARAMS: BarStackParams;
8
- export declare const DEFAULT_BARS_TRIANGLE_PLUGIN_PARAMS: BarsTriangleParams;
9
- export declare const DEFAULT_GROUPING_AXIS_PLUGIN_PARAMS: GroupAxisParams;
10
- export declare const DEFAULT_VALUE_AXIS_PLUGIN_PARAMS: ValueAxisParams;
11
- export declare const DEFAULT_VALUE_STACK_AXIS_PLUGIN_PARAMS: ValueStackAxisParams;
12
- export declare const DEFAULT_SCALING_AREA_PLUGIN_PARAMS: ScalingAreaParams;
3
+ export declare const DEFAULT_LINES_PARAMS: LinesParams;
4
+ export declare const DEFAULT_DOTS_PARAMS: DotsParams;
5
+ export declare const DEFAULT_GROUP_AREA_PARAMS: GroupAreaParams;
6
+ export declare const DEFAULT_BARS_PARAMS: BarsParams;
7
+ export declare const DEFAULT_BAR_STACK_PARAMS: BarStackParams;
8
+ export declare const DEFAULT_BARS_TRIANGLE_PARAMS: BarsTriangleParams;
9
+ export declare const DEFAULT_GROUPING_AXIS_PARAMS: GroupAxisParams;
10
+ export declare const DEFAULT_VALUE_AXIS_PARAMS: ValueAxisParams;
11
+ export declare const DEFAULT_VALUE_STACK_AXIS_PARAMS: ValueStackAxisParams;
12
+ export declare const DEFAULT_SCALING_AREA_PARAMS: ScalingAreaParams;
13
13
  export declare const DEFAULT_GRID_LEGEND_PARAMS: GridLegendParams;
@@ -1,3 +1 @@
1
- import { BarStackParams } from '../types';
2
-
3
- export declare const BarStack: import('@orbcharts/core').PluginConstructor<"grid", string, BarStackParams>;
1
+ export declare const BarStack: import('@orbcharts/core').PluginConstructor<"grid", string, import('..').BarStackParams>;
@@ -1,3 +1 @@
1
- import { BarsParams } from '../types';
2
-
3
- export declare const Bars: import('@orbcharts/core').PluginConstructor<"grid", string, BarsParams>;
1
+ export declare const Bars: import('@orbcharts/core').PluginConstructor<"grid", string, import('..').BarsParams>;
@@ -1,3 +1 @@
1
- import { BarsTriangleParams } from '../types';
2
-
3
- export declare const BarsTriangle: import('@orbcharts/core').PluginConstructor<"grid", string, BarsTriangleParams>;
1
+ export declare const BarsTriangle: import('@orbcharts/core').PluginConstructor<"grid", string, import('..').BarsTriangleParams>;
@@ -1,3 +1 @@
1
- import { LinesParams } from '../types';
2
-
3
- export declare const Lines: import('@orbcharts/core').PluginConstructor<"grid", string, LinesParams>;
1
+ export declare const Lines: import('@orbcharts/core').PluginConstructor<"grid", string, import('..').LinesParams>;
@@ -1,5 +1,4 @@
1
1
  import { ColorType } from '@orbcharts/core';
2
- import { BaseLegendParams } from '../base/BaseLegend';
3
2
 
4
3
  export interface LinesParams {
5
4
  lineCurve: string;
@@ -72,5 +71,14 @@ export interface ValueStackAxisParams extends ValueAxisParams {
72
71
  }
73
72
  export interface ScalingAreaParams {
74
73
  }
75
- export interface GridLegendParams extends BaseLegendParams {
74
+ export interface GridLegendParams {
75
+ position: 'top' | 'bottom' | 'left' | 'right';
76
+ justify: 'start' | 'center' | 'end';
77
+ padding: number;
78
+ backgroundFill: ColorType;
79
+ backgroundStroke: ColorType;
80
+ gap: number;
81
+ listRectWidth: number;
82
+ listRectHeight: number;
83
+ listRectRadius: number;
76
84
  }
@@ -1,3 +1,4 @@
1
1
  export * from './grid';
2
+ export * from './multiGrid';
2
3
  export * from './noneData';
3
4
  export * from './series';
@@ -0,0 +1,4 @@
1
+ import { BarsAndLinesParams, MultiGridLegendParams } from './types';
2
+
3
+ export declare const DEFAULT_BARS_AND_LINES_PARAMS: BarsAndLinesParams;
4
+ export declare const DEFAULT_MULTI_GRID_LEGEND_PARAMS: MultiGridLegendParams;
@@ -0,0 +1,4 @@
1
+ export * from './defaults';
2
+ export * from './types';
3
+ export { BarsAndLines } from './plugins/BarsAndLines';
4
+ export { MultiGridLegend } from './plugins/MultiGridLegend';
@@ -0,0 +1 @@
1
+ export declare const BarsAndLines: import('@orbcharts/core').PluginConstructor<"multiGrid", string, import('..').BarsAndLinesParams>;
@@ -0,0 +1 @@
1
+ export declare const MultiGridLegend: import('@orbcharts/core').PluginConstructor<"multiGrid", string, import('..').MultiGridLegendParams>;
@@ -0,0 +1,24 @@
1
+ import { BaseBarsParams } from '../base/BaseBars';
2
+ import { BaseLinesParams } from '../base/BaseLines';
3
+ import { ColorType } from '@orbcharts/core';
4
+
5
+ export interface BarsAndLinesParams {
6
+ bars: BaseBarsParams;
7
+ lines: BaseLinesParams;
8
+ }
9
+ export interface MultiGridLegendParams {
10
+ position: 'top' | 'bottom' | 'left' | 'right';
11
+ justify: 'start' | 'center' | 'end';
12
+ padding: number;
13
+ backgroundFill: ColorType;
14
+ backgroundStroke: ColorType;
15
+ gap: number;
16
+ listRectWidth: number;
17
+ listRectHeight: number;
18
+ listRectRadius: number;
19
+ gridList: Array<{
20
+ listRectWidth: number;
21
+ listRectHeight: number;
22
+ listRectRadius: number;
23
+ }>;
24
+ }
@@ -1,7 +1,7 @@
1
1
  import { BubblesParams, PieParams, PieEventTextsParams, PieLabelsParams, SeriesLegendParams } from './types';
2
2
 
3
- export declare const DEFAULT_BUBBLES_PLUGIN_PARAMS: BubblesParams;
4
- export declare const DEFAULT_PIE_PLUGIN_PARAMS: PieParams;
3
+ export declare const DEFAULT_BUBBLES_PARAMS: BubblesParams;
4
+ export declare const DEFAULT_PIE_PARAMS: PieParams;
5
5
  export declare const DEFAULT_PIE_EVENT_TEXTS_PARAMS: PieEventTextsParams;
6
6
  export declare const DEFAULT_PIE_LABELS_PARAMS: PieLabelsParams;
7
7
  export declare const DEFAULT_SERIES_LEGEND_PARAMS: SeriesLegendParams;
@@ -1,5 +1,4 @@
1
1
  import { ComputedDatumSeries, EventSeries, EventName, ColorType } from '@orbcharts/core';
2
- import { BaseLegendParams } from '../base/BaseLegend';
3
2
 
4
3
  export type BubbleScaleType = 'area' | 'radius';
5
4
  export interface BubblesParams {
@@ -44,5 +43,14 @@ export interface PieLabelsParams {
44
43
  labelFn: ((d: ComputedDatumSeries) => string);
45
44
  labelColorType: ColorType;
46
45
  }
47
- export interface SeriesLegendParams extends BaseLegendParams {
46
+ export interface SeriesLegendParams {
47
+ position: 'top' | 'bottom' | 'left' | 'right';
48
+ justify: 'start' | 'center' | 'end';
49
+ padding: number;
50
+ backgroundFill: ColorType;
51
+ backgroundStroke: ColorType;
52
+ gap: number;
53
+ listRectWidth: number;
54
+ listRectHeight: number;
55
+ listRectRadius: number;
48
56
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbcharts/plugins-basic",
3
- "version": "3.0.0-alpha.30",
3
+ "version": "3.0.0-alpha.32",
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.26",
38
+ "@orbcharts/core": "^3.0.0-alpha.29",
39
39
  "d3": "^7.8.5",
40
40
  "rxjs": "^7.8.1"
41
41
  }