@orbcharts/plugins-basic 3.0.0-alpha.28 → 3.0.0-alpha.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,11 @@
1
- import { LinesPluginParams, GroupAreaPluginParams, DotsPluginParams, BarsPluginParams, BarStackPluginParams, BarsTrianglePluginParams, GroupAxisParams, ValueAxisParams, ValueStackAxisParams, ScalingAreaParams, GridLegendParams } from './types';
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: LinesPluginParams;
4
- export declare const DEFAULT_DOTS_PLUGIN_PARAMS: DotsPluginParams;
5
- export declare const DEFAULT_GROUP_AREA_PLUGIN_PARAMS: GroupAreaPluginParams;
6
- export declare const DEFAULT_BARS_PLUGIN_PARAMS: BarsPluginParams;
7
- export declare const DEFAULT_BAR_STACK_PLUGIN_PARAMS: BarStackPluginParams;
8
- export declare const DEFAULT_BARS_TRIANGLE_PLUGIN_PARAMS: BarsTrianglePluginParams;
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
9
  export declare const DEFAULT_GROUPING_AXIS_PLUGIN_PARAMS: GroupAxisParams;
10
10
  export declare const DEFAULT_VALUE_AXIS_PLUGIN_PARAMS: ValueAxisParams;
11
11
  export declare const DEFAULT_VALUE_STACK_AXIS_PLUGIN_PARAMS: ValueStackAxisParams;
@@ -1,3 +1,3 @@
1
- import { BarStackPluginParams } from '../types';
1
+ import { BarStackParams } from '../types';
2
2
 
3
- export declare const BarStack: import('@orbcharts/core').PluginConstructor<"grid", string, BarStackPluginParams>;
3
+ export declare const BarStack: import('@orbcharts/core').PluginConstructor<"grid", string, BarStackParams>;
@@ -1,3 +1,3 @@
1
- import { BarsPluginParams } from '../types';
1
+ import { BarsParams } from '../types';
2
2
 
3
- export declare const Bars: import('@orbcharts/core').PluginConstructor<"grid", string, BarsPluginParams>;
3
+ export declare const Bars: import('@orbcharts/core').PluginConstructor<"grid", string, BarsParams>;
@@ -1,3 +1,3 @@
1
- import { BarsTrianglePluginParams } from '../types';
1
+ import { BarsTriangleParams } from '../types';
2
2
 
3
- export declare const BarsTriangle: import('@orbcharts/core').PluginConstructor<"grid", string, BarsTrianglePluginParams>;
3
+ export declare const BarsTriangle: import('@orbcharts/core').PluginConstructor<"grid", string, BarsTriangleParams>;
@@ -1,3 +1,3 @@
1
- import { DotsPluginParams } from '../types';
1
+ import { DotsParams } from '../types';
2
2
 
3
- export declare const Dots: import('@orbcharts/core').PluginConstructor<"grid", string, DotsPluginParams>;
3
+ export declare const Dots: import('@orbcharts/core').PluginConstructor<"grid", string, DotsParams>;
@@ -1,3 +1,3 @@
1
- import { GroupAreaPluginParams } from '../types';
1
+ import { GroupAreaParams } from '../types';
2
2
 
3
- export declare const GroupArea: import('@orbcharts/core').PluginConstructor<"grid", string, GroupAreaPluginParams>;
3
+ export declare const GroupArea: import('@orbcharts/core').PluginConstructor<"grid", string, GroupAreaParams>;
@@ -1,3 +1,3 @@
1
- import { LinesPluginParams } from '../types';
1
+ import { LinesParams } from '../types';
2
2
 
3
- export declare const Lines: import('@orbcharts/core').PluginConstructor<"grid", string, LinesPluginParams>;
3
+ export declare const Lines: import('@orbcharts/core').PluginConstructor<"grid", string, LinesParams>;
@@ -1,18 +1,18 @@
1
1
  import { ColorType } from '@orbcharts/core';
2
2
  import { BaseLegendParams } from '../base/BaseLegend';
3
3
 
4
- export interface LinesPluginParams {
4
+ export interface LinesParams {
5
5
  lineCurve: string;
6
6
  lineWidth: number;
7
7
  }
8
- export interface DotsPluginParams {
8
+ export interface DotsParams {
9
9
  radius: number;
10
10
  fillColorType: ColorType;
11
11
  strokeColorType: ColorType;
12
12
  strokeWidth: number;
13
13
  onlyShowHighlighted: boolean;
14
14
  }
15
- export interface GroupAreaPluginParams {
15
+ export interface GroupAreaParams {
16
16
  showLine: boolean;
17
17
  showLabel: boolean;
18
18
  lineDashArray: string;
@@ -22,18 +22,18 @@ export interface GroupAreaPluginParams {
22
22
  labelTextFormat: string | ((text: any) => string);
23
23
  labelPadding: number;
24
24
  }
25
- export interface BarsPluginParams {
25
+ export interface BarsParams {
26
26
  barWidth: number;
27
27
  barPadding: number;
28
28
  barGroupPadding: number;
29
29
  barRadius: number | boolean;
30
30
  }
31
- export interface BarStackPluginParams {
31
+ export interface BarStackParams {
32
32
  barWidth: number;
33
33
  barGroupPadding: number;
34
34
  barRadius: number | boolean;
35
35
  }
36
- export interface BarsTrianglePluginParams {
36
+ export interface BarsTriangleParams {
37
37
  barWidth: number;
38
38
  barPadding: number;
39
39
  barGroupPadding: number;
@@ -1,7 +1,7 @@
1
- import { BubblesPluginParams, PiePluginParams, PieEventTextsPluginParams, PieLabelsPluginParams, SeriesLegendParams } from './types';
1
+ import { BubblesParams, PieParams, PieEventTextsParams, PieLabelsParams, SeriesLegendParams } from './types';
2
2
 
3
- export declare const DEFAULT_BUBBLES_PLUGIN_PARAMS: BubblesPluginParams;
4
- export declare const DEFAULT_PIE_PLUGIN_PARAMS: PiePluginParams;
5
- export declare const DEFAULT_PIE_EVENT_TEXTS_PARAMS: PieEventTextsPluginParams;
6
- export declare const DEFAULT_PIE_LABELS_PARAMS: PieLabelsPluginParams;
3
+ export declare const DEFAULT_BUBBLES_PLUGIN_PARAMS: BubblesParams;
4
+ export declare const DEFAULT_PIE_PLUGIN_PARAMS: PieParams;
5
+ export declare const DEFAULT_PIE_EVENT_TEXTS_PARAMS: PieEventTextsParams;
6
+ export declare const DEFAULT_PIE_LABELS_PARAMS: PieLabelsParams;
7
7
  export declare const DEFAULT_SERIES_LEGEND_PARAMS: SeriesLegendParams;
@@ -1,3 +1,3 @@
1
- import { BubblesPluginParams } from '../types';
1
+ import { BubblesParams } from '../types';
2
2
 
3
- export declare const Bubbles: import('@orbcharts/core').PluginConstructor<"series", string, BubblesPluginParams>;
3
+ export declare const Bubbles: import('@orbcharts/core').PluginConstructor<"series", string, BubblesParams>;
@@ -1,3 +1,3 @@
1
- import { PiePluginParams } from '../types';
1
+ import { PieParams } from '../types';
2
2
 
3
- export declare const Pie: import('@orbcharts/core').PluginConstructor<"series", string, PiePluginParams>;
3
+ export declare const Pie: import('@orbcharts/core').PluginConstructor<"series", string, PieParams>;
@@ -1 +1 @@
1
- export declare const PieEventTexts: import('@orbcharts/core').PluginConstructor<"series", string, import('..').PieEventTextsPluginParams>;
1
+ export declare const PieEventTexts: import('@orbcharts/core').PluginConstructor<"series", string, import('..').PieEventTextsParams>;
@@ -1,3 +1,3 @@
1
- import { PieLabelsPluginParams } from '../types';
1
+ import { PieLabelsParams } from '../types';
2
2
 
3
- export declare const PieLabels: import('@orbcharts/core').PluginConstructor<"series", string, PieLabelsPluginParams>;
3
+ export declare const PieLabels: import('@orbcharts/core').PluginConstructor<"series", string, PieLabelsParams>;
@@ -2,7 +2,7 @@ import { ComputedDatumSeries, EventSeries, EventName, ColorType } from '@orbchar
2
2
  import { BaseLegendParams } from '../base/BaseLegend';
3
3
 
4
4
  export type BubbleScaleType = 'area' | 'radius';
5
- export interface BubblesPluginParams {
5
+ export interface BubblesParams {
6
6
  force: {
7
7
  strength: number;
8
8
  velocityDecay: number;
@@ -16,7 +16,7 @@ export interface BubblesPluginParams {
16
16
  highlightRIncrease: number;
17
17
  bubbleScaleType: BubbleScaleType;
18
18
  }
19
- export interface PiePluginParams {
19
+ export interface PieParams {
20
20
  outerRadius: number;
21
21
  innerRadius: number;
22
22
  outerMouseoverRadius: number;
@@ -26,7 +26,7 @@ export interface PiePluginParams {
26
26
  padAngle: number;
27
27
  cornerRadius: number;
28
28
  }
29
- export interface PieEventTextsPluginParams {
29
+ export interface PieEventTextsParams {
30
30
  eventFn: (d: EventSeries, eventName: EventName, t: number) => string[];
31
31
  textAttrs: Array<{
32
32
  [key: string]: string | number;
@@ -35,7 +35,7 @@ export interface PieEventTextsPluginParams {
35
35
  [key: string]: string | number;
36
36
  }>;
37
37
  }
38
- export interface PieLabelsPluginParams {
38
+ export interface PieLabelsParams {
39
39
  outerRadius: number;
40
40
  outerMouseoverRadius: number;
41
41
  startAngle: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orbcharts/plugins-basic",
3
- "version": "3.0.0-alpha.28",
3
+ "version": "3.0.0-alpha.29",
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.24",
38
+ "@orbcharts/core": "^3.0.0-alpha.25",
39
39
  "d3": "^7.8.5",
40
40
  "rxjs": "^7.8.1"
41
41
  }
@@ -1,22 +1,22 @@
1
1
  import type {
2
- LinesPluginParams,
3
- GroupAreaPluginParams,
4
- DotsPluginParams,
5
- BarsPluginParams,
6
- BarStackPluginParams,
7
- BarsTrianglePluginParams,
2
+ LinesParams,
3
+ GroupAreaParams,
4
+ DotsParams,
5
+ BarsParams,
6
+ BarStackParams,
7
+ BarsTriangleParams,
8
8
  GroupAxisParams,
9
9
  ValueAxisParams,
10
10
  ValueStackAxisParams,
11
11
  ScalingAreaParams,
12
12
  GridLegendParams } from './types'
13
13
 
14
- export const DEFAULT_LINES_PLUGIN_PARAMS: LinesPluginParams = {
14
+ export const DEFAULT_LINES_PLUGIN_PARAMS: LinesParams = {
15
15
  lineCurve: 'curveLinear',
16
16
  lineWidth: 2
17
17
  }
18
18
 
19
- export const DEFAULT_DOTS_PLUGIN_PARAMS: DotsPluginParams = {
19
+ export const DEFAULT_DOTS_PLUGIN_PARAMS: DotsParams = {
20
20
  radius: 4,
21
21
  fillColorType: 'white',
22
22
  strokeColorType: 'series',
@@ -24,7 +24,7 @@ export const DEFAULT_DOTS_PLUGIN_PARAMS: DotsPluginParams = {
24
24
  onlyShowHighlighted: false
25
25
  }
26
26
 
27
- export const DEFAULT_GROUP_AREA_PLUGIN_PARAMS: GroupAreaPluginParams = {
27
+ export const DEFAULT_GROUP_AREA_PLUGIN_PARAMS: GroupAreaParams = {
28
28
  showLine: true,
29
29
  showLabel: true,
30
30
  lineDashArray: '3, 3',
@@ -35,7 +35,7 @@ export const DEFAULT_GROUP_AREA_PLUGIN_PARAMS: GroupAreaPluginParams = {
35
35
  labelPadding: 24,
36
36
  }
37
37
 
38
- export const DEFAULT_BARS_PLUGIN_PARAMS: BarsPluginParams = {
38
+ export const DEFAULT_BARS_PLUGIN_PARAMS: BarsParams = {
39
39
  // barType: 'rect',
40
40
  barWidth: 0,
41
41
  barPadding: 1,
@@ -43,13 +43,13 @@ export const DEFAULT_BARS_PLUGIN_PARAMS: BarsPluginParams = {
43
43
  barRadius: false,
44
44
  }
45
45
 
46
- export const DEFAULT_BAR_STACK_PLUGIN_PARAMS: BarStackPluginParams = {
46
+ export const DEFAULT_BAR_STACK_PLUGIN_PARAMS: BarStackParams = {
47
47
  barWidth: 0,
48
48
  barGroupPadding: 10,
49
49
  barRadius: false,
50
50
  }
51
51
 
52
- export const DEFAULT_BARS_TRIANGLE_PLUGIN_PARAMS: BarsTrianglePluginParams = {
52
+ export const DEFAULT_BARS_TRIANGLE_PLUGIN_PARAMS: BarsTriangleParams = {
53
53
  barWidth: 0,
54
54
  barPadding: 1,
55
55
  barGroupPadding: 20,
@@ -17,7 +17,7 @@ import type {
17
17
  ChartParams,
18
18
  DataSeriesDatum,
19
19
  Layout } from '@orbcharts/core'
20
- import type { BarStackPluginParams } from '../types'
20
+ import type { BarStackParams } from '../types'
21
21
  import { DEFAULT_BAR_STACK_PLUGIN_PARAMS } from '../defaults'
22
22
  import { getD3TransitionEase } from '../../utils/d3Utils'
23
23
  import { getClassName, getUniID } from '../../utils/orbchartsUtils'
@@ -33,7 +33,7 @@ interface RenderBarParams {
33
33
  zeroY: number
34
34
  groupLabels: string[]
35
35
  // barScale: d3.ScalePoint<string>
36
- params: BarStackPluginParams
36
+ params: BarStackParams
37
37
  chartParams: ChartParams
38
38
  barWidth: number
39
39
  transformedBarRadius: [number, number]
@@ -66,7 +66,7 @@ function calcBarWidth ({ axisWidth, groupAmount, barGroupPadding = 0 }: {
66
66
 
67
67
  }
68
68
 
69
- // function makeBarScale (barWidth: number, seriesLabels: string[], params: BarStackPluginParams) {
69
+ // function makeBarScale (barWidth: number, seriesLabels: string[], params: BarStackParams) {
70
70
  // const barHalfWidth = barWidth! / 2
71
71
  // const barGroupWidth = barWidth * seriesLabels.length + params.barPadding! * seriesLabels.length
72
72
  // return d3.scalePoint()
@@ -19,7 +19,7 @@ import type {
19
19
  EventGrid,
20
20
  ChartParams,
21
21
  Layout } from '@orbcharts/core'
22
- import type { BarsPluginParams } from '../types'
22
+ import type { BarsParams } from '../types'
23
23
  import { DEFAULT_BARS_PLUGIN_PARAMS } from '../defaults'
24
24
  import { getD3TransitionEase } from '../../utils/d3Utils'
25
25
  import { getClassName, getUniID } from '../../utils/orbchartsUtils'
@@ -30,7 +30,7 @@ interface RenderBarParams {
30
30
  zeroY: number
31
31
  groupLabels: string[]
32
32
  barScale: d3.ScalePoint<string>
33
- params: BarsPluginParams
33
+ params: BarsParams
34
34
  chartParams: ChartParams
35
35
  barWidth: number
36
36
  transformedBarRadius: [number, number]
@@ -64,7 +64,7 @@ function calcBarWidth ({ axisWidth, groupAmount, barAmountOfGroup, barPadding =
64
64
  return width > 1 ? width : 1
65
65
  }
66
66
 
67
- function makeBarScale (barWidth: number, seriesLabels: string[], params: BarsPluginParams) {
67
+ function makeBarScale (barWidth: number, seriesLabels: string[], params: BarsParams) {
68
68
  const barHalfWidth = barWidth! / 2
69
69
  const barGroupWidth = barWidth * seriesLabels.length + params.barPadding! * seriesLabels.length
70
70
  return d3.scalePoint()
@@ -16,7 +16,7 @@ import type {
16
16
  ChartParams,
17
17
  DataSeriesDatum,
18
18
  Layout } from '@orbcharts/core'
19
- import type { BarsTrianglePluginParams } from '../types'
19
+ import type { BarsTriangleParams } from '../types'
20
20
  import { DEFAULT_BARS_TRIANGLE_PLUGIN_PARAMS } from '../defaults'
21
21
  import { getD3TransitionEase } from '../../utils/d3Utils'
22
22
  import {
@@ -29,7 +29,7 @@ interface RenderBarParams {
29
29
  zeroY: number
30
30
  groupLabels: string[]
31
31
  barScale: d3.ScalePoint<string>
32
- params: BarsTrianglePluginParams
32
+ params: BarsTriangleParams
33
33
  chartParams: ChartParams
34
34
  barWidth: number
35
35
  delayGroup: number
@@ -65,7 +65,7 @@ function calcBarWidth ({ axisWidth, groupAmount, barAmountOfGroup, barPadding =
65
65
  return width > 1 ? width : 1
66
66
  }
67
67
 
68
- function makeBarScale (barWidth: number, seriesLabels: string[], params: BarsTrianglePluginParams) {
68
+ function makeBarScale (barWidth: number, seriesLabels: string[], params: BarsTriangleParams) {
69
69
  const barHalfWidth = barWidth! / 2
70
70
  const barGroupWidth = barWidth * seriesLabels.length + params.barPadding! * seriesLabels.length
71
71
  return d3.scalePoint()
@@ -165,7 +165,7 @@ function renderTriangleBars ({ selection, barData, zeroY, groupLabels, barScale,
165
165
  function renderLinearGradient ({ defsSelection, barData, params }: {
166
166
  defsSelection: d3.Selection<SVGDefsElement, ComputedDatumGrid, any, any>
167
167
  barData: BarDatumGrid[][]
168
- params: BarsTrianglePluginParams
168
+ params: BarsTriangleParams
169
169
  }) {
170
170
  const linearGradientUpdate = defsSelection!
171
171
  .selectAll<SVGLinearGradientElement, ComputedDatumGrid>('linearGradient')
@@ -15,7 +15,7 @@ import type {
15
15
  ChartParams,
16
16
  ComputedDatumGrid,
17
17
  Layout } from '@orbcharts/core'
18
- import type { DotsPluginParams } from '../types'
18
+ import type { DotsParams } from '../types'
19
19
  import { DEFAULT_DOTS_PLUGIN_PARAMS } from '../defaults'
20
20
  import { getDatumColor, getClassName, getUniID } from '../../utils/orbchartsUtils'
21
21
 
@@ -34,7 +34,7 @@ const circleClassName = getClassName(pluginName, 'circle')
34
34
  function renderDots ({ selection, data, fullParams, fullChartParams, graphicOppositeScale }: {
35
35
  selection: d3.Selection<SVGGElement, any, any, any>
36
36
  data: ComputedDatumGrid[]
37
- fullParams: DotsPluginParams
37
+ fullParams: DotsParams
38
38
  fullChartParams: ChartParams
39
39
  graphicOppositeScale: [number, number]
40
40
  }) {
@@ -24,7 +24,7 @@ import { getColor, getClassName, getUniID } from '../../utils/orbchartsUtils'
24
24
  import { d3EventObservable } from '../../utils/observables'
25
25
  import { gridGroupPositionFnObservable } from '../gridObservables'
26
26
  import { createAxisPointScale } from '@orbcharts/core'
27
- import type { GroupAreaPluginParams } from '../types'
27
+ import type { GroupAreaParams } from '../types'
28
28
 
29
29
  interface LineDatum {
30
30
  id: string
@@ -48,7 +48,7 @@ function createLineData ({ groupLabel, axisX, axisHeight, fullParams }: {
48
48
  groupLabel: string
49
49
  axisX: number
50
50
  axisHeight: number
51
- fullParams: GroupAreaPluginParams
51
+ fullParams: GroupAreaParams
52
52
  }): LineDatum[] {
53
53
  return fullParams.showLine && groupLabel
54
54
  ? [{
@@ -65,7 +65,7 @@ function renderLine ({ selection, pluginName, lineData, fullParams, fullChartPar
65
65
  selection: d3.Selection<any, unknown, any, unknown>
66
66
  pluginName: string
67
67
  lineData: LineDatum[]
68
- fullParams: GroupAreaPluginParams
68
+ fullParams: GroupAreaParams
69
69
  fullChartParams: ChartParams
70
70
  }) {
71
71
  const gClassName = getClassName(pluginName, 'auxline')
@@ -114,7 +114,7 @@ function removeLine (selection: d3.Selection<any, unknown, any, unknown>) {
114
114
  function createLabelData ({ groupLabel, axisX, fullParams }: {
115
115
  groupLabel: string
116
116
  axisX: number
117
- fullParams: GroupAreaPluginParams
117
+ fullParams: GroupAreaParams
118
118
  }) {
119
119
  return fullParams.showLabel && groupLabel
120
120
  ? [{
@@ -129,7 +129,7 @@ function createLabelData ({ groupLabel, axisX, fullParams }: {
129
129
  function renderLabel ({ selection, labelData, fullParams, fullChartParams, gridAxesOppositeTransformValue }: {
130
130
  selection: d3.Selection<any, unknown, any, unknown>
131
131
  labelData: LabelDatum[]
132
- fullParams: GroupAreaPluginParams
132
+ fullParams: GroupAreaParams
133
133
  fullChartParams: ChartParams
134
134
  gridAxesOppositeTransformValue: string
135
135
  }) {
@@ -17,7 +17,7 @@ import type {
17
17
  ComputedDatumGrid,
18
18
  ChartParams,
19
19
  Layout } from '@orbcharts/core'
20
- import type { LinesPluginParams } from '../types'
20
+ import type { LinesParams } from '../types'
21
21
  import { DEFAULT_LINES_PLUGIN_PARAMS } from '../defaults'
22
22
  import { getD3TransitionEase } from '../../utils/d3Utils'
23
23
  import { getClassName, getUniID } from '../../utils/orbchartsUtils'
@@ -71,7 +71,7 @@ function renderLine ({ selection, segmentData, linePath, params }: {
71
71
  selection: d3.Selection<SVGGElement, unknown, any, unknown>
72
72
  segmentData: ComputedDatumGrid[][]
73
73
  linePath: d3.Line<ComputedDatumGrid>
74
- params: LinesPluginParams
74
+ params: LinesParams
75
75
  }): d3.Selection<SVGPathElement, ComputedDatumGrid[], any, any> {
76
76
  // if (!data[0]) {
77
77
  // return undefined
package/src/grid/types.ts CHANGED
@@ -4,7 +4,7 @@ import type { BaseLegendParams } from '../base/BaseLegend'
4
4
  // export type LineType = 'line' | 'area' | 'gradientArea'
5
5
  // export type BarType = 'rect' | 'triangle'
6
6
 
7
- export interface LinesPluginParams {
7
+ export interface LinesParams {
8
8
  // lineType: LineType
9
9
  lineCurve: string
10
10
  lineWidth: number
@@ -16,7 +16,7 @@ export interface LinesPluginParams {
16
16
  // labelPadding: number
17
17
  }
18
18
 
19
- export interface DotsPluginParams {
19
+ export interface DotsParams {
20
20
  radius: number
21
21
  fillColorType: ColorType
22
22
  strokeColorType: ColorType
@@ -24,7 +24,7 @@ export interface DotsPluginParams {
24
24
  onlyShowHighlighted: boolean
25
25
  }
26
26
 
27
- export interface GroupAreaPluginParams {
27
+ export interface GroupAreaParams {
28
28
  showLine: boolean
29
29
  showLabel: boolean
30
30
  lineDashArray: string
@@ -35,7 +35,7 @@ export interface GroupAreaPluginParams {
35
35
  labelPadding: number
36
36
  }
37
37
 
38
- export interface BarsPluginParams {
38
+ export interface BarsParams {
39
39
  // barType: BarType
40
40
  barWidth: number
41
41
  barPadding: number
@@ -43,13 +43,13 @@ export interface BarsPluginParams {
43
43
  barRadius: number | boolean
44
44
  }
45
45
 
46
- export interface BarStackPluginParams {
46
+ export interface BarStackParams {
47
47
  barWidth: number
48
48
  barGroupPadding: number
49
49
  barRadius: number | boolean
50
50
  }
51
51
 
52
- export interface BarsTrianglePluginParams {
52
+ export interface BarsTriangleParams {
53
53
  barWidth: number
54
54
  barPadding: number
55
55
  barGroupPadding: number // 群組和群組間的間隔
@@ -1,13 +1,13 @@
1
1
  import type { ComputedDatumSeries, EventSeries, EventName, ColorType } from '@orbcharts/core'
2
2
  import type {
3
- BubblesPluginParams,
4
- PiePluginParams,
5
- PieEventTextsPluginParams,
6
- PieLabelsPluginParams,
3
+ BubblesParams,
4
+ PieParams,
5
+ PieEventTextsParams,
6
+ PieLabelsParams,
7
7
  SeriesLegendParams } from './types'
8
8
 
9
9
 
10
- export const DEFAULT_BUBBLES_PLUGIN_PARAMS: BubblesPluginParams = {
10
+ export const DEFAULT_BUBBLES_PLUGIN_PARAMS: BubblesParams = {
11
11
  force: {
12
12
  strength: 0.03, // 泡泡引力
13
13
  velocityDecay: 0.2, // 衰減數
@@ -22,7 +22,7 @@ export const DEFAULT_BUBBLES_PLUGIN_PARAMS: BubblesPluginParams = {
22
22
  bubbleScaleType: 'area'
23
23
  }
24
24
 
25
- export const DEFAULT_PIE_PLUGIN_PARAMS: PiePluginParams = {
25
+ export const DEFAULT_PIE_PLUGIN_PARAMS: PieParams = {
26
26
  // padding: {
27
27
  // top: 50,
28
28
  // right: 70,
@@ -44,7 +44,7 @@ export const DEFAULT_PIE_PLUGIN_PARAMS: PiePluginParams = {
44
44
  // highlightLabel: null,
45
45
  }
46
46
 
47
- export const DEFAULT_PIE_EVENT_TEXTS_PARAMS: PieEventTextsPluginParams = {
47
+ export const DEFAULT_PIE_EVENT_TEXTS_PARAMS: PieEventTextsParams = {
48
48
  eventFn: (d: EventSeries, eventName: EventName, t: number) => {
49
49
  if (eventName === 'mouseover' || eventName === 'mousemove') {
50
50
  return [String(d.datum!.value)]
@@ -68,7 +68,7 @@ export const DEFAULT_PIE_EVENT_TEXTS_PARAMS: PieEventTextsPluginParams = {
68
68
  ]
69
69
  }
70
70
 
71
- export const DEFAULT_PIE_LABELS_PARAMS: PieLabelsPluginParams = {
71
+ export const DEFAULT_PIE_LABELS_PARAMS: PieLabelsParams = {
72
72
  // solidColor: undefined,
73
73
  // colors: DEFAULT_COLORS,
74
74
  outerRadius: 0.95,
@@ -17,7 +17,7 @@ import type {
17
17
  ComputedDatumSeries } from '@orbcharts/core'
18
18
  import {
19
19
  defineSeriesPlugin } from '@orbcharts/core'
20
- import type { BubblesPluginParams, BubbleScaleType } from '../types'
20
+ import type { BubblesParams, BubbleScaleType } from '../types'
21
21
  import { DEFAULT_BUBBLES_PLUGIN_PARAMS } from '../defaults'
22
22
  import { renderCircleText } from '../../utils/d3Graphics'
23
23
 
@@ -30,7 +30,7 @@ interface BubblesDatum extends ComputedDatumSeries {
30
30
 
31
31
  let force: d3.Simulation<d3.SimulationNodeDatum, undefined> | undefined
32
32
 
33
- function makeForce (bubblesSelection: d3.Selection<SVGGElement, any, any, any>, fullParams: BubblesPluginParams) {
33
+ function makeForce (bubblesSelection: d3.Selection<SVGGElement, any, any, any>, fullParams: BubblesParams) {
34
34
  return d3.forceSimulation()
35
35
  .velocityDecay(fullParams.force!.velocityDecay!)
36
36
  // .alphaDecay(0.2)
@@ -140,7 +140,7 @@ function createBubblesData ({ data, LastBubbleDataMap, graphicWidth, graphicHeig
140
140
  function renderBubbles ({ graphicSelection, bubblesData, fullParams }: {
141
141
  graphicSelection: d3.Selection<SVGGElement, any, any, any>
142
142
  bubblesData: BubblesDatum[]
143
- fullParams: BubblesPluginParams
143
+ fullParams: BubblesParams
144
144
  }) {
145
145
  let update = graphicSelection.selectAll<SVGGElement, BubblesDatum>("g")
146
146
  .data(bubblesData, (d) => d.id)
@@ -203,7 +203,7 @@ function renderBubbles ({ graphicSelection, bubblesData, fullParams }: {
203
203
 
204
204
  function setHighlightData ({ data, highlightRIncrease, highlightIds }: {
205
205
  data: BubblesDatum[]
206
- // fullParams: BubblesPluginParams
206
+ // fullParams: BubblesParams
207
207
  highlightRIncrease: number
208
208
  highlightIds: string[]
209
209
  }) {
@@ -254,7 +254,7 @@ function drag (): d3.DragBehavior<Element, unknown, unknown> {
254
254
  // }
255
255
 
256
256
  function groupBubbles ({ fullParams, graphicWidth, graphicHeight }: {
257
- fullParams: BubblesPluginParams
257
+ fullParams: BubblesParams
258
258
  graphicWidth: number
259
259
  graphicHeight: number
260
260
  }) {
@@ -17,7 +17,7 @@ import {
17
17
  defineSeriesPlugin } from '@orbcharts/core'
18
18
  import type {
19
19
  ChartParams } from '@orbcharts/core'
20
- import type { PiePluginParams } from '../types'
20
+ import type { PieParams } from '../types'
21
21
  import type { PieDatum } from '../seriesUtils'
22
22
  import { DEFAULT_PIE_PLUGIN_PARAMS } from '../defaults'
23
23
  import { makePieData } from '../seriesUtils'
@@ -32,7 +32,7 @@ function makeTweenPieRenderDataFn ({ enter, exit, data, lastData, fullParams }:
32
32
  exit: d3.Selection<SVGPathElement, unknown, any, any>
33
33
  data: PieDatum[]
34
34
  lastData: PieDatum[]
35
- fullParams: PiePluginParams
35
+ fullParams: PieParams
36
36
  }): (t: number) => PieDatum[] {
37
37
  // 無更新資料項目則只計算資料變化 (新資料 * t + 舊資料 * (1 - t))
38
38
  if (!enter.size() && !exit.size()) {
@@ -10,7 +10,7 @@ import {
10
10
  defineSeriesPlugin } from '@orbcharts/core'
11
11
  import type {
12
12
  ChartParams } from '@orbcharts/core'
13
- import type { PieLabelsPluginParams } from '../types'
13
+ import type { PieLabelsParams } from '../types'
14
14
  import type { PieDatum } from '../seriesUtils'
15
15
  import { DEFAULT_PIE_LABELS_PARAMS } from '../defaults'
16
16
  import { makePieData } from '../seriesUtils'
@@ -49,7 +49,7 @@ function makeRenderData (pieData: PieDatum[], arc: d3.Arc<any, d3.DefaultArcObje
49
49
  }
50
50
 
51
51
  // 繪製圓餅圖
52
- function renderLabel (selection: d3.Selection<SVGGElement, undefined, any, any>, data: RenderDatum[], pluginParams: PieLabelsPluginParams, fullChartParams: ChartParams) {
52
+ function renderLabel (selection: d3.Selection<SVGGElement, undefined, any, any>, data: RenderDatum[], pluginParams: PieLabelsParams, fullChartParams: ChartParams) {
53
53
  // console.log(data)
54
54
  // let update = this.gSelection.selectAll('g').data(pieData)
55
55
  let update: d3.Selection<SVGPathElement, RenderDatum, any, any> = selection
@@ -3,7 +3,7 @@ import type { BaseLegendParams } from '../base/BaseLegend'
3
3
 
4
4
  export type BubbleScaleType = 'area' | 'radius'
5
5
 
6
- export interface BubblesPluginParams {
6
+ export interface BubblesParams {
7
7
  force: {
8
8
  strength: number; // 泡泡引力
9
9
  velocityDecay: number; // 衰減數
@@ -18,7 +18,7 @@ export interface BubblesPluginParams {
18
18
  bubbleScaleType: BubbleScaleType
19
19
  }
20
20
 
21
- export interface PiePluginParams {
21
+ export interface PieParams {
22
22
  // padding: Padding
23
23
  outerRadius: number;
24
24
  innerRadius: number;
@@ -32,13 +32,13 @@ export interface PiePluginParams {
32
32
  cornerRadius: number
33
33
  }
34
34
 
35
- export interface PieEventTextsPluginParams {
35
+ export interface PieEventTextsParams {
36
36
  eventFn: (d: EventSeries, eventName: EventName, t: number) => string[]
37
37
  textAttrs: Array<{ [key:string]: string | number }>
38
38
  textStyles: Array<{ [key:string]: string | number }>
39
39
  }
40
40
 
41
- export interface PieLabelsPluginParams {
41
+ export interface PieLabelsParams {
42
42
  // solidColor?: string;
43
43
  // colors?: string[];
44
44
  outerRadius: number