@visactor/vchart 2.0.7-alpha.0 → 2.0.7-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.es.js +5225 -928
- package/build/index.js +5630 -946
- package/build/index.min.js +2 -3
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/interface.js +1 -2
- package/cjs/chart/box-plot/box-plot.js +3 -2
- package/cjs/chart/box-plot/box-plot.js.map +1 -1
- package/cjs/chart/histogram/histogram.js +2 -2
- package/cjs/chart/histogram/histogram.js.map +1 -1
- package/cjs/compile/grammar-item.js +2 -1
- package/cjs/component/crosshair/base.d.ts +1 -1
- package/cjs/component/crosshair/base.js +10 -6
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/geo/geo-coordinate.js.map +1 -1
- package/cjs/component/legend/discrete/util.js +5 -1
- package/cjs/component/legend/discrete/util.js.map +1 -1
- package/cjs/constant/attribute.js +1 -2
- package/cjs/constant/gradient.js +2 -1
- package/cjs/constant/sunburst.js +1 -1
- package/cjs/constant/waterfall.js +1 -2
- package/cjs/constant/word-cloud.js +1 -1
- package/cjs/core/expression-function.js +2 -1
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/core/vchart.js +3 -2
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/initialize.js +1 -1
- package/cjs/data/register.js +1 -1
- package/cjs/index.d.ts +8 -0
- package/cjs/index.js +141 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/base-layout.d.ts +2 -2
- package/cjs/layout/base-layout.js +12 -7
- package/cjs/layout/base-layout.js.map +1 -1
- package/cjs/layout/interface.d.ts +1 -0
- package/cjs/layout/interface.js.map +1 -1
- package/cjs/plugin/chart/index.d.ts +1 -0
- package/cjs/plugin/chart/index.js +2 -1
- package/cjs/plugin/chart/index.js.map +1 -1
- package/cjs/plugin/chart/interface.d.ts +2 -0
- package/cjs/plugin/chart/interface.js.map +1 -1
- package/cjs/plugin/chart/plugin-service.d.ts +1 -0
- package/cjs/plugin/chart/plugin-service.js +5 -0
- package/cjs/plugin/chart/plugin-service.js.map +1 -1
- package/cjs/plugin/chart/resize-zoom/index.d.ts +1 -0
- package/cjs/plugin/chart/resize-zoom/index.js +21 -0
- package/cjs/plugin/chart/resize-zoom/index.js.map +1 -0
- package/cjs/plugin/chart/resize-zoom/zoom.d.ts +21 -0
- package/cjs/plugin/chart/resize-zoom/zoom.js +62 -0
- package/cjs/plugin/chart/resize-zoom/zoom.js.map +1 -0
- package/cjs/series/index.d.ts +2 -2
- package/cjs/series/index.js +6 -1
- package/cjs/series/index.js.map +1 -1
- package/cjs/series/waterfall/waterfall.d.ts +1 -0
- package/cjs/series/waterfall/waterfall.js +7 -3
- package/cjs/series/waterfall/waterfall.js.map +1 -1
- package/esm/animation/interface.js +1 -2
- package/esm/chart/box-plot/box-plot.js +4 -1
- package/esm/chart/box-plot/box-plot.js.map +1 -1
- package/esm/chart/histogram/histogram.js +4 -1
- package/esm/chart/histogram/histogram.js.map +1 -1
- package/esm/compile/grammar-item.js +2 -1
- package/esm/component/crosshair/base.d.ts +1 -1
- package/esm/component/crosshair/base.js +10 -6
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/geo/geo-coordinate.js.map +1 -1
- package/esm/component/legend/discrete/util.js +5 -2
- package/esm/component/legend/discrete/util.js.map +1 -1
- package/esm/constant/attribute.js +1 -2
- package/esm/constant/gradient.js +2 -1
- package/esm/constant/sunburst.js +1 -1
- package/esm/constant/waterfall.js +1 -2
- package/esm/constant/word-cloud.js +1 -1
- package/esm/core/expression-function.js +2 -1
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/core/vchart.js +3 -2
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/initialize.js +1 -1
- package/esm/data/register.js +1 -1
- package/esm/index.d.ts +8 -0
- package/esm/index.js +14 -0
- package/esm/index.js.map +1 -1
- package/esm/layout/base-layout.d.ts +2 -2
- package/esm/layout/base-layout.js +12 -7
- package/esm/layout/base-layout.js.map +1 -1
- package/esm/layout/interface.d.ts +1 -0
- package/esm/layout/interface.js.map +1 -1
- package/esm/plugin/chart/index.d.ts +1 -0
- package/esm/plugin/chart/index.js +2 -0
- package/esm/plugin/chart/index.js.map +1 -1
- package/esm/plugin/chart/interface.d.ts +2 -0
- package/esm/plugin/chart/interface.js.map +1 -1
- package/esm/plugin/chart/plugin-service.d.ts +1 -0
- package/esm/plugin/chart/plugin-service.js +5 -0
- package/esm/plugin/chart/plugin-service.js.map +1 -1
- package/esm/plugin/chart/resize-zoom/index.d.ts +1 -0
- package/esm/plugin/chart/resize-zoom/index.js +2 -0
- package/esm/plugin/chart/resize-zoom/index.js.map +1 -0
- package/esm/plugin/chart/resize-zoom/zoom.d.ts +21 -0
- package/esm/plugin/chart/resize-zoom/zoom.js +59 -0
- package/esm/plugin/chart/resize-zoom/zoom.js.map +1 -0
- package/esm/series/index.d.ts +2 -2
- package/esm/series/index.js +2 -2
- package/esm/series/index.js.map +1 -1
- package/esm/series/waterfall/waterfall.d.ts +1 -0
- package/esm/series/waterfall/waterfall.js +8 -2
- package/esm/series/waterfall/waterfall.js.map +1 -1
- package/package.json +12 -12
package/esm/index.js
CHANGED
|
@@ -55,4 +55,18 @@ export * from "./compile/data/compilable-data";
|
|
|
55
55
|
export * from "./animation";
|
|
56
56
|
|
|
57
57
|
export * from "./interaction";
|
|
58
|
+
|
|
59
|
+
export { createImage, createPath, createArc3d, createPyramid3d, createRect3d, registerDirectionalLight, registerOrthoCamera, registerViewTransform3dPlugin, graphicCreator } from "@visactor/vrender-core";
|
|
60
|
+
|
|
61
|
+
export { ACustomAnimate, AnimateExecutor, RotateBySphereAnimate } from "@visactor/vrender-animate";
|
|
62
|
+
|
|
63
|
+
export { AbstractComponent, Segment, MarkPoint } from "@visactor/vrender-components";
|
|
64
|
+
|
|
65
|
+
export { registerLine, registerRect, registerArc3d, registerPyramid3d, registerRect3d, registerShadowRoot } from "@visactor/vrender-kits";
|
|
66
|
+
|
|
67
|
+
export * from "@visactor/vlayouts";
|
|
68
|
+
|
|
69
|
+
export { DataView, DataSet, svgParser } from "@visactor/vdataset";
|
|
70
|
+
|
|
71
|
+
export * from "@visactor/vutils";
|
|
58
72
|
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,eAAe,MAAM,CAAC;AAEtB,cAAc,QAAQ,CAAC;AAGvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AAExB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAEhC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAG7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC","file":"index.js","sourcesContent":["import { VChart } from './vchart-all';\n\nexport default VChart;\n\nexport * from './core';\n\n// chart model for extension\nexport * from './chart';\nexport * from './chart/base';\nexport * from './chart/cartesian';\nexport * from './chart/common';\nexport * from './chart/stack';\nexport * from './series';\nexport * from './mark';\nexport * from './component';\nexport * from './layout';\nexport * from './env';\nexport * from './event';\n// plugin路径太深,如果直接引用,会导致tree-shaking失效\nexport * from './plugin/chart';\nexport * from './plugin/components/tooltip-handler';\nexport * from './plugin/components/axis-sync';\nexport * from './plugin/other';\nexport * from './plugin/base/base-plugin';\nexport * from './vrender-tools';\n// util\nexport * from './util/data';\nexport * from './util/spec/transform';\nexport * from './util/mark';\nexport * from './util/region';\nexport * from './util/scale';\n\n// base component model for extension\nexport * from './component/base';\nexport * from './compile/data/compilable-data';\nexport * from './animation';\nexport * from './interaction';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,eAAe,MAAM,CAAC;AAEtB,cAAc,QAAQ,CAAC;AAGvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AAExB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAEhC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAG7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAE9B,OAAO,EACL,WAAW,EACX,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,6BAA6B,EAC7B,cAAc,EAoBf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGnG,OAAO,EACL,iBAAiB,EACjB,OAAO,EACP,SAAS,EAGV,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EACnB,MAAM,wBAAwB,CAAC;AAGhC,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAKlE,cAAc,kBAAkB,CAAC","file":"index.js","sourcesContent":["import { VChart } from './vchart-all';\n\nexport default VChart;\n\nexport * from './core';\n\n// chart model for extension\nexport * from './chart';\nexport * from './chart/base';\nexport * from './chart/cartesian';\nexport * from './chart/common';\nexport * from './chart/stack';\nexport * from './series';\nexport * from './mark';\nexport * from './component';\nexport * from './layout';\nexport * from './env';\nexport * from './event';\n// plugin路径太深,如果直接引用,会导致tree-shaking失效\nexport * from './plugin/chart';\nexport * from './plugin/components/tooltip-handler';\nexport * from './plugin/components/axis-sync';\nexport * from './plugin/other';\nexport * from './plugin/base/base-plugin';\nexport * from './vrender-tools';\n// util\nexport * from './util/data';\nexport * from './util/spec/transform';\nexport * from './util/mark';\nexport * from './util/region';\nexport * from './util/scale';\n\n// base component model for extension\nexport * from './component/base';\nexport * from './compile/data/compilable-data';\nexport * from './animation';\nexport * from './interaction';\n\nexport {\n createImage,\n createPath,\n createArc3d,\n createPyramid3d,\n createRect3d,\n registerDirectionalLight,\n registerOrthoCamera,\n registerViewTransform3dPlugin,\n graphicCreator,\n type IGraphic,\n type IGlyph,\n type IGroup,\n type IText,\n type ILine,\n type IArea,\n type IRect,\n type INode,\n type IStage,\n type EasingType,\n type ILineGraphicAttribute,\n type ITextGraphicAttribute,\n type IRectGraphicAttribute,\n type IGroupGraphicAttribute,\n type TextAlignType,\n type TextBaselineType,\n type GraphicEventType,\n type IAreaGraphicAttribute,\n type ISymbolGraphicAttribute\n} from '@visactor/vrender-core';\n\nexport { ACustomAnimate, AnimateExecutor, RotateBySphereAnimate } from '@visactor/vrender-animate';\n\n// vrender-components\nexport {\n AbstractComponent,\n Segment,\n MarkPoint,\n type SegmentAttributes,\n type Point\n} from '@visactor/vrender-components';\n\n// vrender-kits\nexport {\n registerLine,\n registerRect,\n registerArc3d,\n registerPyramid3d,\n registerRect3d,\n registerShadowRoot\n} from '@visactor/vrender-kits';\n\n// vlayouts\nexport * from '@visactor/vlayouts';\n\n// vdataset\nexport { DataView, DataSet, svgParser } from '@visactor/vdataset';\nexport type { SVGParsedElement, SVGParserResult, ISVGSourceOption } from '@visactor/vdataset';\n\n// vutils\n// @ts-ignore\nexport * from '@visactor/vutils';\n"]}
|
|
@@ -51,7 +51,7 @@ export declare class Layout implements IBaseLayout {
|
|
|
51
51
|
layoutItems(_chart: IChart, items: ILayoutItem[], chartLayoutRect: IRect, chartViewBox: IBoundsLike): void;
|
|
52
52
|
protected _processAutoIndent(regionItems: ILayoutItem[], relativeItems: ILayoutItem[], relativeOverlapItems: ILayoutItem[], overlapItems: {
|
|
53
53
|
[key in IOrientType]: overlapInfo;
|
|
54
|
-
}, allRelatives: ILayoutItem[], layoutTemp: LayoutSideType, recompute: IRecompute): void;
|
|
54
|
+
}, allRelatives: ILayoutItem[], layoutTemp: LayoutSideType, recompute: IRecompute, secondLayoutLeftRight?: boolean): void;
|
|
55
55
|
protected layoutNormalItems(normalItems: ILayoutItem[], recompute: IRecompute): void;
|
|
56
56
|
protected layoutNormalInlineItems(normalItems: ILayoutItem[], recompute: IRecompute): boolean;
|
|
57
57
|
protected _layoutRelativeOverlap(orient: IOrientType, info: overlapInfo, recompute: IRecompute): void;
|
|
@@ -62,7 +62,7 @@ export declare class Layout implements IBaseLayout {
|
|
|
62
62
|
};
|
|
63
63
|
protected layoutRegionItems(regionItems: ILayoutItem[], regionRelativeItems: ILayoutItem[], regionRelativeOverlapItems: ILayoutItem[], overlapItems: {
|
|
64
64
|
[key in IOrientType]: overlapInfo;
|
|
65
|
-
}, recompute: IRecompute): void;
|
|
65
|
+
}, recompute: IRecompute, secondLayoutLeftRight?: boolean): void;
|
|
66
66
|
protected layoutAbsoluteItems(absoluteItems: ILayoutItem[]): void;
|
|
67
67
|
filterRegionsWithID(items: ILayoutItem[], id: number): ILayoutItem;
|
|
68
68
|
getItemComputeLayoutRect(item: ILayoutItem): {
|
|
@@ -68,11 +68,12 @@ export class Layout {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
layoutItems(_chart, items, chartLayoutRect, chartViewBox) {
|
|
71
|
+
var _a, _b, _c;
|
|
71
72
|
this._layoutInit(_chart, items, chartLayoutRect, chartViewBox);
|
|
72
73
|
const recompute = {
|
|
73
74
|
recomputeWidth: this.recomputeWidth,
|
|
74
75
|
recomputeHeight: this.recomputeHeight
|
|
75
|
-
};
|
|
76
|
+
}, secondLayoutLeftRight = null !== (_c = null === (_b = null === (_a = null == _chart ? void 0 : _chart.getSpec()) || void 0 === _a ? void 0 : _a.layout) || void 0 === _b ? void 0 : _b.secondLayoutLeftRight) && void 0 !== _c && _c;
|
|
76
77
|
this._layoutNormalItems(items, recompute);
|
|
77
78
|
const layoutTemp = {
|
|
78
79
|
left: this.leftCurrent,
|
|
@@ -80,8 +81,8 @@ export class Layout {
|
|
|
80
81
|
right: this.rightCurrent,
|
|
81
82
|
bottom: this.bottomCurrent
|
|
82
83
|
}, {regionItems: regionItems, relativeItems: relativeItems, relativeOverlapItems: relativeOverlapItems, allRelatives: allRelatives, overlapItems: overlapItems} = this._groupItems(items);
|
|
83
|
-
this.layoutRegionItems(regionItems, relativeItems, relativeOverlapItems, overlapItems, recompute),
|
|
84
|
-
this._processAutoIndent(regionItems, relativeItems, relativeOverlapItems, overlapItems, allRelatives, layoutTemp, recompute),
|
|
84
|
+
this.layoutRegionItems(regionItems, relativeItems, relativeOverlapItems, overlapItems, recompute, secondLayoutLeftRight),
|
|
85
|
+
this._processAutoIndent(regionItems, relativeItems, relativeOverlapItems, overlapItems, allRelatives, layoutTemp, recompute, secondLayoutLeftRight),
|
|
85
86
|
this.layoutAbsoluteItems(items.filter((x => "absolute" === x.layoutType))), items.forEach((item => {
|
|
86
87
|
item.clearWillLayoutTag();
|
|
87
88
|
}));
|
|
@@ -122,12 +123,12 @@ export class Layout {
|
|
|
122
123
|
height: 0
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
|
-
}, allRelatives, layoutTemp, recompute) {
|
|
126
|
+
}, allRelatives, layoutTemp, recompute, secondLayoutLeftRight = !1) {
|
|
126
127
|
if (allRelatives.some((i => i.autoIndent))) {
|
|
127
128
|
const {top: top, bottom: bottom, left: left, right: right} = this._checkAutoIndent(allRelatives, layoutTemp);
|
|
128
129
|
(top || bottom || left || right) && (this.topCurrent = layoutTemp.top + top, this.bottomCurrent = layoutTemp.bottom - bottom,
|
|
129
130
|
this.leftCurrent = layoutTemp.left + left, this.rightCurrent = layoutTemp.right - right,
|
|
130
|
-
this.layoutRegionItems(regionItems, relativeItems, relativeOverlapItems, overlapItems, recompute));
|
|
131
|
+
this.layoutRegionItems(regionItems, relativeItems, relativeOverlapItems, overlapItems, recompute, secondLayoutLeftRight));
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
134
|
layoutNormalItems(normalItems, recompute) {
|
|
@@ -249,7 +250,8 @@ export class Layout {
|
|
|
249
250
|
height: 0
|
|
250
251
|
}
|
|
251
252
|
}
|
|
252
|
-
}, recompute) {
|
|
253
|
+
}, recompute, secondLayoutLeftRight = !1) {
|
|
254
|
+
const leftBeforeLayout = this.leftCurrent, rightBeforeLayout = this.rightCurrent;
|
|
253
255
|
let regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent, regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;
|
|
254
256
|
regionRelativeItems.filter((x => "left" === x.layoutOrient || "right" === x.layoutOrient)).forEach((item => {
|
|
255
257
|
this._layoutRelativeItem(item, recompute);
|
|
@@ -257,7 +259,10 @@ export class Layout {
|
|
|
257
259
|
regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent, regionRelativeItems.filter((x => "top" === x.layoutOrient || "bottom" === x.layoutOrient)).forEach((item => {
|
|
258
260
|
this._layoutRelativeItem(item, recompute);
|
|
259
261
|
})), this._layoutRelativeOverlap("top", overlapItems.top, recompute), this._layoutRelativeOverlap("bottom", overlapItems.bottom, recompute),
|
|
260
|
-
regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent
|
|
262
|
+
regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent, secondLayoutLeftRight && (this.leftCurrent = leftBeforeLayout,
|
|
263
|
+
this.rightCurrent = rightBeforeLayout, regionRelativeItems.filter((x => "left" === x.layoutOrient || "right" === x.layoutOrient)).forEach((item => {
|
|
264
|
+
this._layoutRelativeItem(item, recompute);
|
|
265
|
+
})), regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent);
|
|
261
266
|
const {regionWidth: regionWidth, regionHeight: regionHeight} = this._layoutRegionItem(regionItems, regionRelativeTotalWidth, regionRelativeTotalHeight);
|
|
262
267
|
regionRelativeItems.concat(regionRelativeOverlapItems).forEach((item => {
|
|
263
268
|
if ([ "left", "right" ].includes(item.layoutOrient)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/layout/base-layout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAoB,MAAM,kBAAkB,CAAC;AAG7D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACrB,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C,CAAC,aAAa,EAAE,CAAC;QAE5C,MAAM,MAAM,GAAmB;YAC7B,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;YAC1C,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,SAAS,CAAC,EAAE,GAAG,UAAU,CAAC,KAAK;YAClD,GAAG,EAAE,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;YACxC,MAAM,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,UAAU,CAAC,MAAM;SACtD,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;;AAjeM,WAAI,GAAG,MAAM,CAAC","file":"base-layout.js","sourcesContent":["import type { utilFunctionCtx } from '../typings/params';\nimport type { IChart } from '../chart/interface/chart';\nimport { isEqual, type IBoundsLike } from '@visactor/vutils';\nimport type { IBaseLayout, ILayoutItem } from './interface';\nimport type { IOrientType, IPadding, IRect } from '../typings/space';\nimport { error } from '../util/debug';\nimport type { IRecompute } from './util';\nimport {\n getItemLayoutWithTag,\n layoutBottomInlineItems,\n layoutLeftInlineItems,\n layoutRightInlineItems,\n layoutTopInlineItems\n} from './util';\nimport type { ILayoutRect } from '../typings/layout';\n\nexport type LayoutSideType = {\n top: number;\n left: number;\n bottom: number;\n right: number;\n};\n\nexport interface IOffset {\n offsetLeft: number;\n offsetRight: number;\n offsetTop: number;\n offsetBottom: number;\n}\n\ntype overlapInfo = {\n items: ILayoutItem[];\n rect: ILayoutRect;\n};\n\nexport class Layout implements IBaseLayout {\n static type = 'base';\n\n leftCurrent: number = 0;\n topCurrent: number = 0;\n rightCurrent: number = 0;\n bottomCurrent: number = 0;\n\n _chartLayoutRect!: IRect;\n _chartViewBox!: IBoundsLike;\n\n recomputeWidth: boolean = false;\n recomputeHeight: boolean = false;\n\n protected _onError: (msg: string) => void;\n\n constructor(_spec?: unknown, ctx?: utilFunctionCtx) {\n this._onError = ctx?.onError;\n }\n\n protected _layoutInit(_chart: IChart, items: ILayoutItem[], chartLayoutRect: IRect, chartViewBox: IBoundsLike) {\n this._chartLayoutRect = chartLayoutRect;\n this._chartViewBox = chartViewBox;\n this.leftCurrent = chartLayoutRect.x;\n this.topCurrent = chartLayoutRect.y;\n this.rightCurrent = chartLayoutRect.x + chartLayoutRect.width;\n this.bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;\n this.recomputeWidth = false;\n this.recomputeHeight = false;\n\n // 越大越先处理,进行排序调整,利用原地排序特性,排序会受 level 和传进来的数组顺序共同影响\n items.sort((a, b) => b.layoutLevel - a.layoutLevel);\n }\n\n protected _layoutNormalItems(items: ILayoutItem[], recompute: IRecompute) {\n this.layoutNormalInlineItems(\n items.filter(x => x.layoutType === 'normal-inline'),\n recompute\n );\n this.layoutNormalItems(\n items.filter(x => x.layoutType === 'normal'),\n recompute\n );\n }\n\n protected _groupItems(items: ILayoutItem[]) {\n const regionItems = items.filter(x => x.layoutType === 'region');\n const relativeItems = items.filter(x => x.layoutType === 'region-relative');\n const relativeOverlapItems = items.filter(x => x.layoutType === 'region-relative-overlap');\n const allRelatives = relativeItems.concat(relativeOverlapItems);\n // 允许重叠元素 ,目前允许重叠元素认为是紧贴region的。最后布局\n const overlapItems: {\n [key in IOrientType]: overlapInfo;\n } = {\n left: { items: [], rect: { width: 0, height: 0 } },\n right: { items: [], rect: { width: 0, height: 0 } },\n top: { items: [], rect: { width: 0, height: 0 } },\n bottom: { items: [], rect: { width: 0, height: 0 } },\n z: { items: [], rect: { width: 0, height: 0 } }\n };\n relativeOverlapItems.forEach(i => {\n overlapItems[i.layoutOrient].items.push(i);\n });\n\n return {\n regionItems,\n relativeItems,\n relativeOverlapItems,\n allRelatives,\n overlapItems\n };\n }\n\n layoutItems(_chart: IChart, items: ILayoutItem[], chartLayoutRect: IRect, chartViewBox: IBoundsLike): void {\n // 布局初始化\n this._layoutInit(_chart, items, chartLayoutRect, chartViewBox);\n const recompute = {\n recomputeWidth: this.recomputeWidth,\n recomputeHeight: this.recomputeHeight\n };\n // 先布局 normal 类型的元素\n this._layoutNormalItems(items, recompute);\n // 开始布局 region 相关元素\n // 为了缩进先保存一下当前的布局空间\n const layoutTemp: LayoutSideType = {\n left: this.leftCurrent,\n top: this.topCurrent,\n right: this.rightCurrent,\n bottom: this.bottomCurrent\n };\n const { regionItems, relativeItems, relativeOverlapItems, allRelatives, overlapItems } = this._groupItems(items);\n // 有元素开启了自动缩进\n // TODO:目前只有普通占位布局下的 region-relative 元素支持\n // 主要考虑常规元素超出画布一般为用户个性设置,而且可以设置padding规避裁剪,不需要使用自动缩进\n this.layoutRegionItems(regionItems, relativeItems, relativeOverlapItems, overlapItems, recompute);\n // 缩进\n this._processAutoIndent(\n regionItems,\n relativeItems,\n relativeOverlapItems,\n overlapItems,\n allRelatives,\n layoutTemp,\n recompute\n );\n\n this.layoutAbsoluteItems(items.filter(x => x.layoutType === 'absolute'));\n\n items.forEach(item => {\n // 布局完成 ,清除标记\n item.clearWillLayoutTag();\n });\n }\n\n protected _processAutoIndent(\n regionItems: ILayoutItem[],\n relativeItems: ILayoutItem[],\n relativeOverlapItems: ILayoutItem[],\n overlapItems: {\n [key in IOrientType]: overlapInfo;\n } = {\n left: { items: [], rect: { width: 0, height: 0 } },\n right: { items: [], rect: { width: 0, height: 0 } },\n top: { items: [], rect: { width: 0, height: 0 } },\n bottom: { items: [], rect: { width: 0, height: 0 } },\n z: { items: [], rect: { width: 0, height: 0 } }\n },\n allRelatives: ILayoutItem[],\n layoutTemp: LayoutSideType,\n recompute: IRecompute\n ): void {\n // 如果有缩进\n if (allRelatives.some(i => i.autoIndent)) {\n // check auto indent\n const { top, bottom, left, right } = this._checkAutoIndent(allRelatives, layoutTemp);\n // 如果出现了需要自动缩进的场景 则基于缩进再次布局\n if (top || bottom || left || right) {\n // set outer bounds to padding\n this.topCurrent = layoutTemp.top + top;\n this.bottomCurrent = layoutTemp.bottom - bottom;\n this.leftCurrent = layoutTemp.left + left;\n this.rightCurrent = layoutTemp.right - right;\n // reLayout\n this.layoutRegionItems(regionItems, relativeItems, relativeOverlapItems, overlapItems, recompute);\n }\n }\n }\n\n protected layoutNormalItems(normalItems: ILayoutItem[], recompute: IRecompute): void {\n normalItems.forEach(item => {\n // const layoutRect = this.getItemComputeLayoutRect(item);\n // const rect = item.computeBoundsInRect(layoutRect);\n // item.setLayoutRect(rect);\n const { rect } = getItemLayoutWithTag(item, this, recompute);\n if (item.layoutOrient === 'left') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n } else if (item.layoutOrient === 'top') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n } else if (item.layoutOrient === 'right') {\n item.setLayoutStartPosition({\n x: this.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n } else if (item.layoutOrient === 'bottom') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingRight,\n y: this.bottomCurrent + item.layoutOffsetY - rect.height - item.layoutPaddingBottom\n });\n this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n }\n });\n }\n\n protected layoutNormalInlineItems(normalItems: ILayoutItem[], recompute: IRecompute): boolean {\n const leftItems = normalItems.filter(item => item.layoutOrient === 'left');\n const rightItems = normalItems.filter(item => item.layoutOrient === 'right');\n const topItems = normalItems.filter(item => item.layoutOrient === 'top');\n const bottomItems = normalItems.filter(item => item.layoutOrient === 'bottom');\n\n const limitWidth = this._chartLayoutRect.width + this._chartLayoutRect.x;\n const limitHeight = this._chartLayoutRect.height + this._chartLayoutRect.y;\n\n // 同 normal,按照 left、top、right、bottom 的顺序进行布局\n // 各个方向上再按照 position 进行分组布局,顺序为 start middle end\n leftItems.length && layoutLeftInlineItems(leftItems, this, limitHeight, recompute);\n topItems.length && layoutTopInlineItems(topItems, this, limitWidth, recompute);\n rightItems.length && layoutRightInlineItems(rightItems, this, limitHeight, recompute);\n bottomItems.length && layoutBottomInlineItems(bottomItems, this, limitWidth, recompute);\n return true;\n }\n\n protected _layoutRelativeOverlap(orient: IOrientType, info: overlapInfo, recompute: IRecompute) {\n // 得到 max rect\n info.items.forEach((item: ILayoutItem) => {\n const { rect } = getItemLayoutWithTag(item, this, recompute);\n info.rect.width = Math.max(rect.width + item.layoutPaddingLeft + item.layoutPaddingRight, info.rect.width);\n info.rect.height = Math.max(rect.height + item.layoutPaddingTop + item.layoutPaddingBottom, info.rect.height);\n });\n\n // 统一设置rect和pos\n info.items.forEach((item: ILayoutItem) => {\n if (!isEqual(item.getLayoutRect(), info.rect)) {\n item.setLayoutRect(info.rect);\n }\n if (orient === 'left') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX\n });\n } else if (orient === 'right') {\n item.setLayoutStartPosition({\n x: this.rightCurrent - info.rect.width + item.layoutOffsetX\n });\n } else if (orient === 'top') {\n item.setLayoutStartPosition({\n x: this.topCurrent + item.layoutOffsetY\n });\n } else {\n item.setLayoutStartPosition({\n x: this.bottomCurrent - info.rect.height + item.layoutOffsetY\n });\n }\n });\n\n if (orient === 'left') {\n this.leftCurrent += info.rect.width;\n } else if (orient === 'right') {\n this.rightCurrent -= info.rect.width;\n } else if (orient === 'top') {\n this.topCurrent += info.rect.height;\n } else {\n this.bottomCurrent -= info.rect.height;\n }\n }\n\n protected _layoutRelativeItem(item: ILayoutItem, recompute: IRecompute) {\n const { rect } = getItemLayoutWithTag(item, this, recompute, false);\n if (item.layoutOrient === 'left' || item.layoutOrient === 'right') {\n item.setLayoutRect({ width: rect.width });\n } else {\n item.setLayoutRect({ height: rect.height });\n }\n // 减少尺寸\n if (item.layoutOrient === 'left') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft\n });\n this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n } else if (item.layoutOrient === 'right') {\n this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n item.setLayoutStartPosition({\n x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft\n });\n } // 减少尺寸\n else if (item.layoutOrient === 'top') {\n item.setLayoutStartPosition({\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n } else if (item.layoutOrient === 'bottom') {\n this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n item.setLayoutStartPosition({\n y: this.bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n }\n }\n\n protected _layoutRegionItem(\n regionItems: ILayoutItem[],\n regionRelativeTotalWidth: number,\n regionRelativeTotalHeight: number\n ) {\n // region 处理\n const regionWidth = Math.max(\n Math.min(regionRelativeTotalWidth, ...regionItems.map(region => region.maxWidth ?? Number.MAX_VALUE)),\n 0\n );\n const regionHeight = Math.max(\n Math.min(regionRelativeTotalHeight, ...regionItems.map(region => region.maxHeight ?? Number.MAX_VALUE)),\n 0\n );\n regionItems.forEach(region => {\n const width = regionWidth - region.layoutPaddingLeft - region.layoutPaddingRight;\n const height = regionHeight - region.layoutPaddingTop - region.layoutPaddingBottom;\n\n region.setLayoutRect({\n width: width,\n height: height\n });\n\n region.setLayoutStartPosition({\n x: this.leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,\n y: this.topCurrent + region.layoutOffsetY + region.layoutPaddingTop\n });\n });\n\n return {\n regionHeight,\n regionWidth\n };\n }\n\n /**\n *\n * 1. 补全 region-relative rect 和部分 layoutStartPoint\n * 2. 补全 region rect 和 layoutStartPoint\n *\n */\n protected layoutRegionItems(\n regionItems: ILayoutItem[],\n regionRelativeItems: ILayoutItem[],\n regionRelativeOverlapItems: ILayoutItem[],\n overlapItems: {\n [key in IOrientType]: overlapInfo;\n } = {\n left: { items: [], rect: { width: 0, height: 0 } },\n right: { items: [], rect: { width: 0, height: 0 } },\n top: { items: [], rect: { width: 0, height: 0 } },\n bottom: { items: [], rect: { width: 0, height: 0 } },\n z: { items: [], rect: { width: 0, height: 0 } }\n },\n recompute: IRecompute\n ): void {\n let regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;\n let regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;\n\n regionRelativeItems\n .filter(x => x.layoutOrient === 'left' || x.layoutOrient === 'right')\n .forEach(item => {\n this._layoutRelativeItem(item, recompute);\n });\n\n this._layoutRelativeOverlap('left', overlapItems.left, recompute);\n this._layoutRelativeOverlap('right', overlapItems.right, recompute);\n\n regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;\n\n regionRelativeItems\n .filter(x => x.layoutOrient === 'top' || x.layoutOrient === 'bottom')\n .forEach(item => {\n this._layoutRelativeItem(item, recompute);\n });\n\n this._layoutRelativeOverlap('top', overlapItems.top, recompute);\n this._layoutRelativeOverlap('bottom', overlapItems.bottom, recompute);\n\n // 此时得到height\n regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;\n\n // region 处理\n const { regionWidth, regionHeight } = this._layoutRegionItem(\n regionItems,\n regionRelativeTotalWidth,\n regionRelativeTotalHeight\n );\n\n // region-relative 特殊处理\n regionRelativeItems.concat(regionRelativeOverlapItems).forEach(item => {\n // 处理特殊元素的宽高\n if (['left', 'right'].includes(item.layoutOrient)) {\n // 用户有配置的话,已经处理过,不需要再次处理\n const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);\n\n item.setLayoutRect({\n height: relativeRegion.getLayoutRect().height\n });\n item.setLayoutStartPosition({\n y: relativeRegion.getLayoutStartPoint().y + item.layoutOffsetY + item.layoutPaddingTop\n });\n\n if (item.layoutOrient === 'right') {\n item.setLayoutStartPosition({\n x: item.getLayoutStartPoint().x + regionWidth - regionRelativeTotalWidth\n });\n }\n } else if (['top', 'bottom'].includes(item.layoutOrient)) {\n const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);\n\n item.setLayoutRect({\n width: relativeRegion.getLayoutRect().width\n });\n\n item.setLayoutStartPosition({\n x: relativeRegion.getLayoutStartPoint().x + item.layoutOffsetX + item.layoutPaddingLeft\n });\n\n if (item.layoutOrient === 'bottom') {\n item.setLayoutStartPosition({\n y: item.getLayoutStartPoint().y + regionHeight - regionRelativeTotalHeight\n });\n }\n }\n });\n }\n\n /**\n * 再找出对 absolute 元素,无需排序,在 compiler 层需要排序放置\n *\n * 重要:absolute 默认依据 region 进行相对依赖\n */\n protected layoutAbsoluteItems(absoluteItems: ILayoutItem[]) {\n absoluteItems.forEach(item => {\n if (item.willLayoutTag) {\n // 设置盒子\n item.absoluteLayoutInRect(this._chartLayoutRect);\n }\n });\n }\n\n // 对普通布局来说,只出一个 region 绑定\n filterRegionsWithID(items: ILayoutItem[], id: number): ILayoutItem {\n const target = items.find(x => x.getModelId() === id);\n if (!target) {\n (this._onError ?? error)('can not find target region item, invalid id');\n }\n return target as ILayoutItem;\n }\n\n /**\n * 工具方法 根据item属性获取给item提供的布局空间\n * @param item\n */\n getItemComputeLayoutRect(item: ILayoutItem) {\n const result = {\n width: this.rightCurrent - this.leftCurrent - item.layoutPaddingLeft - item.layoutPaddingRight,\n height: this.bottomCurrent - this.topCurrent - item.layoutPaddingTop - item.layoutPaddingBottom\n };\n return result;\n }\n\n protected _checkAutoIndent(\n items: ILayoutItem[],\n layoutTemp: {\n top: number;\n left: number;\n bottom: number;\n right: number;\n }\n ): IPadding {\n const result = {\n top: 0,\n left: 0,\n bottom: 0,\n right: 0\n };\n items.forEach(i => {\n if (!i.getModelVisible() || !i.autoIndent) {\n return;\n }\n const vOrH = i.layoutOrient === 'left' || i.layoutOrient === 'right';\n const itemOuter = i.getLastComputeOutBounds();\n const outer = this._getOutInLayout(itemOuter, i, layoutTemp);\n if (vOrH) {\n result.top = Math.max(result.top, outer.top);\n result.bottom = Math.max(result.bottom, outer.bottom);\n } else {\n result.left = Math.max(result.left, outer.left);\n result.right = Math.max(result.right, outer.right);\n }\n });\n return result;\n }\n\n private _getOutInLayout(itemOuter: IBoundsLike, i: ILayoutItem, tempBorder: LayoutSideType): LayoutSideType {\n const { x, y } = i.getLayoutStartPoint();\n const { width, height } = i.getLayoutRect();\n\n const result: LayoutSideType = {\n left: tempBorder.left - (x - itemOuter.x1),\n right: x + width + itemOuter.x2 - tempBorder.right,\n top: tempBorder.top - (y - itemOuter.y1),\n bottom: y + height + itemOuter.y2 - tempBorder.bottom\n };\n return result;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/layout/base-layout.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAoB,MAAM,kBAAkB,CAAC;AAG7D,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,QAAQ,CAAC;AAsBhB,MAAM,OAAO,MAAM;IAgBjB,YAAY,KAAe,EAAE,GAAqB;QAblD,gBAAW,GAAW,CAAC,CAAC;QACxB,eAAU,GAAW,CAAC,CAAC;QACvB,iBAAY,GAAW,CAAC,CAAC;QACzB,kBAAa,GAAW,CAAC,CAAC;QAK1B,mBAAc,GAAY,KAAK,CAAC;QAChC,oBAAe,GAAY,KAAK,CAAC;QAK/B,IAAI,CAAC,QAAQ,GAAG,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,OAAO,CAAC;IAC/B,CAAC;IAES,WAAW,CAAC,MAAc,EAAE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AAC,IAAI,CAAC,CAAC;gBAChD,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;aACpD;QACH,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,eAAe,CAAC,SAAsB,EAAE,CAAc,EAAE,UAA0B;QACxF,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,mBAAmB,EAAE,CAAC;QACzC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC;QAE5C,MAAM,MAAM,GAAmB;YAC7B,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;YAC1C,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,SAAS,CAAC,EAAE,GAAG,UAAU,CAAC,KAAK;YAClD,GAAG,EAAE,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;YACxC,MAAM,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,GAAG,UAAU,CAAC,MAAM;SACtD,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;;AAtgBM,WAAI,GAAG,MAAM,CAAC","file":"base-layout.js","sourcesContent":["import type { utilFunctionCtx } from '../typings/params';\nimport type { IChart } from '../chart/interface/chart';\nimport { isEqual, type IBoundsLike } from '@visactor/vutils';\nimport type { IBaseLayout, ILayoutItem } from './interface';\nimport type { IOrientType, IPadding, IRect } from '../typings/space';\nimport { error } from '../util/debug';\nimport type { IRecompute } from './util';\nimport {\n getItemLayoutWithTag,\n layoutBottomInlineItems,\n layoutLeftInlineItems,\n layoutRightInlineItems,\n layoutTopInlineItems\n} from './util';\nimport type { ILayoutRect } from '../typings/layout';\n\nexport type LayoutSideType = {\n top: number;\n left: number;\n bottom: number;\n right: number;\n};\n\nexport interface IOffset {\n offsetLeft: number;\n offsetRight: number;\n offsetTop: number;\n offsetBottom: number;\n}\n\ntype overlapInfo = {\n items: ILayoutItem[];\n rect: ILayoutRect;\n};\n\nexport class Layout implements IBaseLayout {\n static type = 'base';\n\n leftCurrent: number = 0;\n topCurrent: number = 0;\n rightCurrent: number = 0;\n bottomCurrent: number = 0;\n\n _chartLayoutRect!: IRect;\n _chartViewBox!: IBoundsLike;\n\n recomputeWidth: boolean = false;\n recomputeHeight: boolean = false;\n\n protected _onError: (msg: string) => void;\n\n constructor(_spec?: unknown, ctx?: utilFunctionCtx) {\n this._onError = ctx?.onError;\n }\n\n protected _layoutInit(_chart: IChart, items: ILayoutItem[], chartLayoutRect: IRect, chartViewBox: IBoundsLike) {\n this._chartLayoutRect = chartLayoutRect;\n this._chartViewBox = chartViewBox;\n this.leftCurrent = chartLayoutRect.x;\n this.topCurrent = chartLayoutRect.y;\n this.rightCurrent = chartLayoutRect.x + chartLayoutRect.width;\n this.bottomCurrent = chartLayoutRect.height + chartLayoutRect.y;\n this.recomputeWidth = false;\n this.recomputeHeight = false;\n\n // 越大越先处理,进行排序调整,利用原地排序特性,排序会受 level 和传进来的数组顺序共同影响\n items.sort((a, b) => b.layoutLevel - a.layoutLevel);\n }\n\n protected _layoutNormalItems(items: ILayoutItem[], recompute: IRecompute) {\n this.layoutNormalInlineItems(\n items.filter(x => x.layoutType === 'normal-inline'),\n recompute\n );\n this.layoutNormalItems(\n items.filter(x => x.layoutType === 'normal'),\n recompute\n );\n }\n\n protected _groupItems(items: ILayoutItem[]) {\n const regionItems = items.filter(x => x.layoutType === 'region');\n const relativeItems = items.filter(x => x.layoutType === 'region-relative');\n const relativeOverlapItems = items.filter(x => x.layoutType === 'region-relative-overlap');\n const allRelatives = relativeItems.concat(relativeOverlapItems);\n // 允许重叠元素 ,目前允许重叠元素认为是紧贴region的。最后布局\n const overlapItems: {\n [key in IOrientType]: overlapInfo;\n } = {\n left: { items: [], rect: { width: 0, height: 0 } },\n right: { items: [], rect: { width: 0, height: 0 } },\n top: { items: [], rect: { width: 0, height: 0 } },\n bottom: { items: [], rect: { width: 0, height: 0 } },\n z: { items: [], rect: { width: 0, height: 0 } }\n };\n relativeOverlapItems.forEach(i => {\n overlapItems[i.layoutOrient].items.push(i);\n });\n\n return {\n regionItems,\n relativeItems,\n relativeOverlapItems,\n allRelatives,\n overlapItems\n };\n }\n\n layoutItems(_chart: IChart, items: ILayoutItem[], chartLayoutRect: IRect, chartViewBox: IBoundsLike): void {\n // 布局初始化\n this._layoutInit(_chart, items, chartLayoutRect, chartViewBox);\n const recompute = {\n recomputeWidth: this.recomputeWidth,\n recomputeHeight: this.recomputeHeight\n };\n const secondLayoutLeftRight = _chart?.getSpec()?.layout?.secondLayoutLeftRight ?? false;\n // 先布局 normal 类型的元素\n this._layoutNormalItems(items, recompute);\n // 开始布局 region 相关元素\n // 为了缩进先保存一下当前的布局空间\n const layoutTemp: LayoutSideType = {\n left: this.leftCurrent,\n top: this.topCurrent,\n right: this.rightCurrent,\n bottom: this.bottomCurrent\n };\n const { regionItems, relativeItems, relativeOverlapItems, allRelatives, overlapItems } = this._groupItems(items);\n // 有元素开启了自动缩进\n // TODO:目前只有普通占位布局下的 region-relative 元素支持\n // 主要考虑常规元素超出画布一般为用户个性设置,而且可以设置padding规避裁剪,不需要使用自动缩进\n this.layoutRegionItems(\n regionItems,\n relativeItems,\n relativeOverlapItems,\n overlapItems,\n recompute,\n secondLayoutLeftRight\n );\n // 缩进\n this._processAutoIndent(\n regionItems,\n relativeItems,\n relativeOverlapItems,\n overlapItems,\n allRelatives,\n layoutTemp,\n recompute,\n secondLayoutLeftRight\n );\n\n this.layoutAbsoluteItems(items.filter(x => x.layoutType === 'absolute'));\n\n items.forEach(item => {\n // 布局完成 ,清除标记\n item.clearWillLayoutTag();\n });\n }\n\n protected _processAutoIndent(\n regionItems: ILayoutItem[],\n relativeItems: ILayoutItem[],\n relativeOverlapItems: ILayoutItem[],\n overlapItems: {\n [key in IOrientType]: overlapInfo;\n } = {\n left: { items: [], rect: { width: 0, height: 0 } },\n right: { items: [], rect: { width: 0, height: 0 } },\n top: { items: [], rect: { width: 0, height: 0 } },\n bottom: { items: [], rect: { width: 0, height: 0 } },\n z: { items: [], rect: { width: 0, height: 0 } }\n },\n allRelatives: ILayoutItem[],\n layoutTemp: LayoutSideType,\n recompute: IRecompute,\n secondLayoutLeftRight: boolean = false\n ): void {\n // 如果有缩进\n if (allRelatives.some(i => i.autoIndent)) {\n // check auto indent\n const { top, bottom, left, right } = this._checkAutoIndent(allRelatives, layoutTemp);\n // 如果出现了需要自动缩进的场景 则基于缩进再次布局\n if (top || bottom || left || right) {\n // set outer bounds to padding\n this.topCurrent = layoutTemp.top + top;\n this.bottomCurrent = layoutTemp.bottom - bottom;\n this.leftCurrent = layoutTemp.left + left;\n this.rightCurrent = layoutTemp.right - right;\n // reLayout\n this.layoutRegionItems(\n regionItems,\n relativeItems,\n relativeOverlapItems,\n overlapItems,\n recompute,\n secondLayoutLeftRight\n );\n }\n }\n }\n\n protected layoutNormalItems(normalItems: ILayoutItem[], recompute: IRecompute): void {\n normalItems.forEach(item => {\n // const layoutRect = this.getItemComputeLayoutRect(item);\n // const rect = item.computeBoundsInRect(layoutRect);\n // item.setLayoutRect(rect);\n const { rect } = getItemLayoutWithTag(item, this, recompute);\n if (item.layoutOrient === 'left') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n } else if (item.layoutOrient === 'top') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft,\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n } else if (item.layoutOrient === 'right') {\n item.setLayoutStartPosition({\n x: this.rightCurrent + item.layoutOffsetX - rect.width - item.layoutPaddingRight,\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n } else if (item.layoutOrient === 'bottom') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingRight,\n y: this.bottomCurrent + item.layoutOffsetY - rect.height - item.layoutPaddingBottom\n });\n this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n }\n });\n }\n\n protected layoutNormalInlineItems(normalItems: ILayoutItem[], recompute: IRecompute): boolean {\n const leftItems = normalItems.filter(item => item.layoutOrient === 'left');\n const rightItems = normalItems.filter(item => item.layoutOrient === 'right');\n const topItems = normalItems.filter(item => item.layoutOrient === 'top');\n const bottomItems = normalItems.filter(item => item.layoutOrient === 'bottom');\n\n const limitWidth = this._chartLayoutRect.width + this._chartLayoutRect.x;\n const limitHeight = this._chartLayoutRect.height + this._chartLayoutRect.y;\n\n // 同 normal,按照 left、top、right、bottom 的顺序进行布局\n // 各个方向上再按照 position 进行分组布局,顺序为 start middle end\n leftItems.length && layoutLeftInlineItems(leftItems, this, limitHeight, recompute);\n topItems.length && layoutTopInlineItems(topItems, this, limitWidth, recompute);\n rightItems.length && layoutRightInlineItems(rightItems, this, limitHeight, recompute);\n bottomItems.length && layoutBottomInlineItems(bottomItems, this, limitWidth, recompute);\n return true;\n }\n\n protected _layoutRelativeOverlap(orient: IOrientType, info: overlapInfo, recompute: IRecompute) {\n // 得到 max rect\n info.items.forEach((item: ILayoutItem) => {\n const { rect } = getItemLayoutWithTag(item, this, recompute);\n info.rect.width = Math.max(rect.width + item.layoutPaddingLeft + item.layoutPaddingRight, info.rect.width);\n info.rect.height = Math.max(rect.height + item.layoutPaddingTop + item.layoutPaddingBottom, info.rect.height);\n });\n\n // 统一设置rect和pos\n info.items.forEach((item: ILayoutItem) => {\n if (!isEqual(item.getLayoutRect(), info.rect)) {\n item.setLayoutRect(info.rect);\n }\n if (orient === 'left') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX\n });\n } else if (orient === 'right') {\n item.setLayoutStartPosition({\n x: this.rightCurrent - info.rect.width + item.layoutOffsetX\n });\n } else if (orient === 'top') {\n item.setLayoutStartPosition({\n x: this.topCurrent + item.layoutOffsetY\n });\n } else {\n item.setLayoutStartPosition({\n x: this.bottomCurrent - info.rect.height + item.layoutOffsetY\n });\n }\n });\n\n if (orient === 'left') {\n this.leftCurrent += info.rect.width;\n } else if (orient === 'right') {\n this.rightCurrent -= info.rect.width;\n } else if (orient === 'top') {\n this.topCurrent += info.rect.height;\n } else {\n this.bottomCurrent -= info.rect.height;\n }\n }\n\n protected _layoutRelativeItem(item: ILayoutItem, recompute: IRecompute) {\n const { rect } = getItemLayoutWithTag(item, this, recompute, false);\n if (item.layoutOrient === 'left' || item.layoutOrient === 'right') {\n item.setLayoutRect({ width: rect.width });\n } else {\n item.setLayoutRect({ height: rect.height });\n }\n // 减少尺寸\n if (item.layoutOrient === 'left') {\n item.setLayoutStartPosition({\n x: this.leftCurrent + item.layoutOffsetX + item.layoutPaddingLeft\n });\n this.leftCurrent += rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n } else if (item.layoutOrient === 'right') {\n this.rightCurrent -= rect.width + item.layoutPaddingLeft + item.layoutPaddingRight;\n item.setLayoutStartPosition({\n x: this.rightCurrent + item.layoutOffsetX + item.layoutPaddingLeft\n });\n } // 减少尺寸\n else if (item.layoutOrient === 'top') {\n item.setLayoutStartPosition({\n y: this.topCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n this.topCurrent += rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n } else if (item.layoutOrient === 'bottom') {\n this.bottomCurrent -= rect.height + item.layoutPaddingTop + item.layoutPaddingBottom;\n item.setLayoutStartPosition({\n y: this.bottomCurrent + item.layoutOffsetY + item.layoutPaddingTop\n });\n }\n }\n\n protected _layoutRegionItem(\n regionItems: ILayoutItem[],\n regionRelativeTotalWidth: number,\n regionRelativeTotalHeight: number\n ) {\n // region 处理\n const regionWidth = Math.max(\n Math.min(regionRelativeTotalWidth, ...regionItems.map(region => region.maxWidth ?? Number.MAX_VALUE)),\n 0\n );\n const regionHeight = Math.max(\n Math.min(regionRelativeTotalHeight, ...regionItems.map(region => region.maxHeight ?? Number.MAX_VALUE)),\n 0\n );\n regionItems.forEach(region => {\n const width = regionWidth - region.layoutPaddingLeft - region.layoutPaddingRight;\n const height = regionHeight - region.layoutPaddingTop - region.layoutPaddingBottom;\n\n region.setLayoutRect({\n width: width,\n height: height\n });\n\n region.setLayoutStartPosition({\n x: this.leftCurrent + region.layoutOffsetX + region.layoutPaddingLeft,\n y: this.topCurrent + region.layoutOffsetY + region.layoutPaddingTop\n });\n });\n\n return {\n regionHeight,\n regionWidth\n };\n }\n\n /**\n *\n * 1. 补全 region-relative rect 和部分 layoutStartPoint\n * 2. 补全 region rect 和 layoutStartPoint\n *\n */\n protected layoutRegionItems(\n regionItems: ILayoutItem[],\n regionRelativeItems: ILayoutItem[],\n regionRelativeOverlapItems: ILayoutItem[],\n overlapItems: {\n [key in IOrientType]: overlapInfo;\n } = {\n left: { items: [], rect: { width: 0, height: 0 } },\n right: { items: [], rect: { width: 0, height: 0 } },\n top: { items: [], rect: { width: 0, height: 0 } },\n bottom: { items: [], rect: { width: 0, height: 0 } },\n z: { items: [], rect: { width: 0, height: 0 } }\n },\n recompute: IRecompute,\n secondLayoutLeftRight: boolean = false\n ): void {\n const leftBeforeLayout = this.leftCurrent;\n const rightBeforeLayout = this.rightCurrent;\n\n let regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;\n let regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;\n\n regionRelativeItems\n .filter(x => x.layoutOrient === 'left' || x.layoutOrient === 'right')\n .forEach(item => {\n this._layoutRelativeItem(item, recompute);\n });\n\n this._layoutRelativeOverlap('left', overlapItems.left, recompute);\n this._layoutRelativeOverlap('right', overlapItems.right, recompute);\n\n // 此时得到宽度\n regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;\n\n regionRelativeItems\n .filter(x => x.layoutOrient === 'top' || x.layoutOrient === 'bottom')\n .forEach(item => {\n this._layoutRelativeItem(item, recompute);\n });\n\n this._layoutRelativeOverlap('top', overlapItems.top, recompute);\n this._layoutRelativeOverlap('bottom', overlapItems.bottom, recompute);\n\n // 此时得到height\n regionRelativeTotalHeight = this.bottomCurrent - this.topCurrent;\n\n if (secondLayoutLeftRight) {\n /** 多次布局保证不被裁减 */\n // 使用高度再次布局一次\n this.leftCurrent = leftBeforeLayout;\n this.rightCurrent = rightBeforeLayout;\n regionRelativeItems\n .filter(x => x.layoutOrient === 'left' || x.layoutOrient === 'right')\n .forEach(item => {\n this._layoutRelativeItem(item, recompute);\n });\n\n // 此时得到宽度\n regionRelativeTotalWidth = this.rightCurrent - this.leftCurrent;\n }\n\n // region 处理\n const { regionWidth, regionHeight } = this._layoutRegionItem(\n regionItems,\n regionRelativeTotalWidth,\n regionRelativeTotalHeight\n );\n\n // region-relative 特殊处理\n regionRelativeItems.concat(regionRelativeOverlapItems).forEach(item => {\n // 处理特殊元素的宽高\n if (['left', 'right'].includes(item.layoutOrient)) {\n // 用户有配置的话,已经处理过,不需要再次处理\n const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);\n\n item.setLayoutRect({\n height: relativeRegion.getLayoutRect().height\n });\n item.setLayoutStartPosition({\n y: relativeRegion.getLayoutStartPoint().y + item.layoutOffsetY + item.layoutPaddingTop\n });\n\n if (item.layoutOrient === 'right') {\n item.setLayoutStartPosition({\n x: item.getLayoutStartPoint().x + regionWidth - regionRelativeTotalWidth\n });\n }\n } else if (['top', 'bottom'].includes(item.layoutOrient)) {\n const relativeRegion = this.filterRegionsWithID(regionItems, item.layoutBindRegionID[0]);\n\n item.setLayoutRect({\n width: relativeRegion.getLayoutRect().width\n });\n\n item.setLayoutStartPosition({\n x: relativeRegion.getLayoutStartPoint().x + item.layoutOffsetX + item.layoutPaddingLeft\n });\n\n if (item.layoutOrient === 'bottom') {\n item.setLayoutStartPosition({\n y: item.getLayoutStartPoint().y + regionHeight - regionRelativeTotalHeight\n });\n }\n }\n });\n }\n\n /**\n * 再找出对 absolute 元素,无需排序,在 compiler 层需要排序放置\n *\n * 重要:absolute 默认依据 region 进行相对依赖\n */\n protected layoutAbsoluteItems(absoluteItems: ILayoutItem[]) {\n absoluteItems.forEach(item => {\n if (item.willLayoutTag) {\n // 设置盒子\n item.absoluteLayoutInRect(this._chartLayoutRect);\n }\n });\n }\n\n // 对普通布局来说,只出一个 region 绑定\n filterRegionsWithID(items: ILayoutItem[], id: number): ILayoutItem {\n const target = items.find(x => x.getModelId() === id);\n if (!target) {\n (this._onError ?? error)('can not find target region item, invalid id');\n }\n return target as ILayoutItem;\n }\n\n /**\n * 工具方法 根据item属性获取给item提供的布局空间\n * @param item\n */\n getItemComputeLayoutRect(item: ILayoutItem) {\n const result = {\n width: this.rightCurrent - this.leftCurrent - item.layoutPaddingLeft - item.layoutPaddingRight,\n height: this.bottomCurrent - this.topCurrent - item.layoutPaddingTop - item.layoutPaddingBottom\n };\n return result;\n }\n\n protected _checkAutoIndent(\n items: ILayoutItem[],\n layoutTemp: {\n top: number;\n left: number;\n bottom: number;\n right: number;\n }\n ): IPadding {\n const result = {\n top: 0,\n left: 0,\n bottom: 0,\n right: 0\n };\n items.forEach(i => {\n if (!i.getModelVisible() || !i.autoIndent) {\n return;\n }\n const vOrH = i.layoutOrient === 'left' || i.layoutOrient === 'right';\n const itemOuter = i.getLastComputeOutBounds();\n const outer = this._getOutInLayout(itemOuter, i, layoutTemp);\n if (vOrH) {\n result.top = Math.max(result.top, outer.top);\n result.bottom = Math.max(result.bottom, outer.bottom);\n } else {\n result.left = Math.max(result.left, outer.left);\n result.right = Math.max(result.right, outer.right);\n }\n });\n return result;\n }\n\n private _getOutInLayout(itemOuter: IBoundsLike, i: ILayoutItem, tempBorder: LayoutSideType): LayoutSideType {\n const { x, y } = i.getLayoutStartPoint();\n const { width, height } = i.getLayoutRect();\n\n const result: LayoutSideType = {\n left: tempBorder.left - (x - itemOuter.x1),\n right: x + width + itemOuter.x2 - tempBorder.right,\n top: tempBorder.top - (y - itemOuter.y1),\n bottom: y + height + itemOuter.y2 - tempBorder.bottom\n };\n return result;\n }\n}\n"]}
|
|
@@ -38,6 +38,7 @@ export interface IGridLayoutSpec extends ILayoutSpecBase {
|
|
|
38
38
|
}
|
|
39
39
|
export interface IBaseLayoutSpec extends ILayoutSpecBase {
|
|
40
40
|
type: 'base';
|
|
41
|
+
secondLayoutLeftRight?: boolean;
|
|
41
42
|
}
|
|
42
43
|
export type ILayoutSpec = IBaseLayoutSpec | IGridLayoutSpec;
|
|
43
44
|
export interface ILayoutConstructor {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/layout/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { StringOrNumber } from '../typings/common';\nimport type { IOrientType, IPadding, IRect } from '../typings/space';\nimport type { IPoint } from '../typings/coordinate';\nimport type { ILayoutNumber, ILayoutPaddingSpec, ILayoutPoint, ILayoutRect, ILayoutType } from '../typings/layout';\nimport type { ILayoutModel } from '../model/interface';\n\nexport interface IBaseLayout {\n /**\n * 对一组布局元素布局\n * 布局策略随意\n * @param item 布局元素数组\n * @param chartLayoutRect 排除图表 padding 后的图表的布局矩形,原点是图表绘制区域左上角。\n * @param chartViewBox 图表在画布中的可用空间,包含图表padding,原点是画布左上角\n * @returns\n */\n layoutItems: LayoutCallBack;\n}\n\nexport type LayoutCallBack = (\n chart: any,\n item: ILayoutItem[],\n chartLayoutRect: IRect,\n chartViewBox: IBoundsLike\n) => void;\n\nexport interface ILayoutSpecBase {\n /**\n * 布局的类型,现在支持 grid布局和默认布局(基于占位的布局)\n */\n type: string;\n}\n\nexport type ElementSpec = (\n | {\n /**\n * 组件对应的spec key,如'legends'表示图例\n */\n modelKey: string;\n /**\n * 组件对应的序号\n */\n modelIndex: number;\n }\n | {\n /**\n * 组件对应的id\n */\n modelId: string;\n }\n) & {\n /**\n * 组件在grid布局中所在的列。从左向右,从 0 开始计数\n */\n col: number;\n /**\n * 组件在grid布局中所在的列跨度,即占了几列,默认值为1\n */\n colSpan?: number;\n /**\n * 组件在grid布局中所在的行。从上向下,从 0 开始计数。\n */\n row: number;\n /**\n * 组件在grid布局中所在的行跨度,即占了几行,默认值为1\n */\n rowSpan?: number;\n};\n\nexport interface IGridLayoutSpec extends ILayoutSpecBase {\n /**\n * 设置布局类型为grid布局\n */\n type: 'grid';\n /**\n * grid布局的总列数\n */\n col: number;\n /**\n * grid布局的总行数\n */\n row: number;\n /**\n * 可选配置,指定某几列的宽度\n */\n colWidth?: {\n /**\n * 指定列数,序号从 0 开始\n */\n index: number;\n /**\n * 设置指定列的宽度,单位为像素\n */\n size: number | ((maxSize: number) => number);\n }[];\n /**\n * 可选配置,指定某几行的高度\n */\n rowHeight?: {\n /**\n * 指定行数,序号从 0 开始\n */\n index: number;\n /**\n * 设置指定行的高度,单位为像素\n */\n size: number | ((maxSize: number) => number);\n }[];\n /**\n *\n * 指定所有图表元素所在位置,图表元素的位置起点和占几行几列,可以占多行多列\n * 图表元素位置允许配置重叠。\n */\n elements: ElementSpec[];\n}\n\nexport interface IBaseLayoutSpec extends ILayoutSpecBase {\n /**\n * 设置布局类型为默认布局\n */\n type: 'base';\n}\n\nexport type ILayoutSpec = IBaseLayoutSpec | IGridLayoutSpec;\n\nexport interface ILayoutConstructor {\n type: string;\n // TODO: spec 类型生命\n new (spec: ILayoutSpec | any, ctx?: any): IBaseLayout;\n}\n\n/**\n * 因为这些元素都会继承到各个模块,所以这里统一有前缀避免语意冲突\n */\nexport interface ILayoutItem {\n readonly type: string;\n /**\n * 标记当前布局元素是否需要重新计算布局属性\n * 图表模块可能部分需要重新布局,部分不需要,根据这个tag在布局过程中进行优化\n */\n readonly willLayoutTag: boolean;\n /**\n * 上一次布局的布局尺寸\n */\n readonly lastComputeRect: ILayoutRect;\n /**\n * 标记这个布局Item的方向(left->right, right->left, top->bottom, bottom->top)\n */\n directionStr?: 'l2r' | 'r2l' | 't2b' | 'b2t';\n layoutClip: boolean;\n layoutType: ILayoutType;\n layoutBindRegionID: number | number[];\n layoutOrient: IOrientType;\n /** 是否自动缩进 */\n autoIndent: boolean;\n\n /**\n * inline元素和其他同行元素的对齐方式\n * 顶部的inline元素,'start' - 顶部对齐;'end' - '底部对齐'; 'middle' - 居中对齐\n * 底部的inline元素,'start' - 底部对齐;'end' - '顶部对齐'; 'middle' - 居中对齐\n * 左侧的inline元素,'start' - 左侧对齐;'end' - '右侧对齐'; 'middle' - 居中对齐\n * 右侧的inline元素,'start' - 右侧对齐;'end' - '左侧对齐'; 'middle' - 居中对齐\n */\n alignSelf?: 'start' | 'end' | 'middle';\n\n layoutPaddingLeft: number;\n layoutPaddingTop: number;\n layoutPaddingRight: number;\n layoutPaddingBottom: number;\n\n layoutOffsetX: number;\n layoutOffsetY: number;\n\n // 越大越先处理\n layoutLevel: number;\n\n chartLayoutRect: ILayoutRect;\n\n readonly layoutRectLevelMap: ILayoutRect;\n minWidth: number;\n maxWidth: number;\n minHeight: number;\n maxHeight: number;\n\n readonly model: ILayoutModel;\n\n getModelId: () => StringOrNumber;\n getModelVisible: () => boolean;\n\n getSpec?: () => any;\n setAttrFromSpec: (spec: ILayoutItemSpec, chartViewRect: ILayoutRect) => void;\n\n setRectInSpec: (rect: ILayoutRect) => ILayoutRect;\n\n getLayoutStartPoint: () => ILayoutPoint;\n getLayoutRect: () => ILayoutRect;\n getLayout: () => IRect;\n getLastComputeOutBounds: () => IBoundsLike;\n\n /** 生命周期 */\n onLayoutStart: (layoutRect: IRect, viewRect: ILayoutRect) => void;\n onLayoutEnd: () => void;\n\n /**\n * 更新元素布局的 layoutRect 大小,用来更新指定布局空间\n */\n setLayoutRect: (rect: Partial<ILayoutRect>, levelMap?: Partial<ILayoutRect>) => void;\n /**\n * 基于元素内部逻辑计算占位空间,rect表示可用空间\n */\n computeBoundsInRect: (rect: ILayoutRect) => ILayoutRect;\n /**\n * 更新元素布局的起始点位置\n */\n setLayoutStartPosition: (pos: Partial<IPoint>) => void;\n /**\n * 更新绝对布局元素的位置信息\n */\n absoluteLayoutInRect: (rect: IRect) => void;\n /**\n * 布局完成后,清楚标记\n */\n clearWillLayoutTag: () => void;\n /**\n * 标记要重新布局\n */\n setWillLayoutTag: () => void;\n}\n\nexport interface ILayoutItemSpec {\n /** 当前模块的布局类型,配置为 absolute 的话,当前元素会以图表左上角为原点进行绝对布局 */\n layoutType?: ILayoutType;\n /**\n * 布局顺序等级,等级越大的,越优先布局\n * 比如顶部同时有标题和图例的场景,期望标题先放在顶部,然后放置图例。\n */\n layoutLevel?: number;\n\n /**\n * inline元素和其他同行元素的对齐方式\n * 顶部的inline元素,'start' - 顶部对齐;'end' - '底部对齐'; 'middle' - 居中对齐\n * 底部的inline元素,'start' - 底部对齐;'end' - '顶部对齐'; 'middle' - 居中对齐\n * 左侧的inline元素,'start' - 左侧对齐;'end' - '右侧对齐'; 'middle' - 居中对齐\n * 右侧的inline元素,'start' - 右侧对齐;'end' - '左侧对齐'; 'middle' - 居中对齐\n */\n alignSelf?: 'start' | 'end' | 'middle';\n\n // 基础的布局配置\n /** 模块布局位置 */\n orient?: IOrientType;\n /** 模块的布局间距 */\n padding?: ILayoutPaddingSpec;\n /** 是否按照 orient 自动修改 padding,隐藏位于外侧的 padding。目前只在组件上生效 */\n noOuterPadding?: boolean;\n /** 模块的布局大小:宽度 */\n width?: ILayoutNumber;\n /** 模块的布局最大宽度 */\n maxWidth?: ILayoutNumber;\n /** 模块的布局最小宽度 */\n minWidth?: ILayoutNumber;\n /** 模块的布局大小:高度 */\n height?: ILayoutNumber;\n /** 模块的布局最大高度 */\n maxHeight?: ILayoutNumber;\n /** 模块的布局最小高度 */\n minHeight?: ILayoutNumber;\n /** 模块的布局位置偏移:X */\n offsetX?: ILayoutNumber;\n /** 模块的布局位置偏移:Y */\n offsetY?: ILayoutNumber;\n\n /** 模块的展示层级,当2个模块重叠时,层级较大的展示在上方 */\n zIndex?: number;\n /** 模块是否裁剪超出布局区域外的绘图内容 */\n clip?: boolean;\n\n // 绝对布局下的对齐设置\n\n /** 模块绝对布局下,与图表左侧的距离。注意仅在 layoutType === 'absolute' 时生效 */\n left?: ILayoutNumber;\n /** 模块绝对布局下,与图表右侧的距离。注意仅在 layoutType === 'absolute' 时生效 */\n right?: ILayoutNumber;\n /** 模块绝对布局下,与图表顶部的距离。注意仅在 layoutType === 'absolute' 时生效 */\n top?: ILayoutNumber;\n /** 模块绝对布局下,与图表底部的距离。注意仅在 layoutType === 'absolute' 时生效 */\n bottom?: ILayoutNumber;\n /** 模块绝对布局下,元素将放置在图表的正中间。注意仅在 layoutType === 'absolute' 时生效,同时将忽略 padding 属性 */\n center?: boolean;\n}\n\nexport interface ILayoutItemInitOption {\n layoutType: ILayoutType;\n layoutLevel: number;\n layoutOrient?: IOrientType;\n transformLayoutRect?: (rect: ILayoutRect) => ILayoutRect;\n transformLayoutPosition?: (pos: Partial<IPoint>) => Partial<IPoint>;\n transformLayoutPadding?: (padding: IPadding) => IPadding;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/layout/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { StringOrNumber } from '../typings/common';\nimport type { IOrientType, IPadding, IRect } from '../typings/space';\nimport type { IPoint } from '../typings/coordinate';\nimport type { ILayoutNumber, ILayoutPaddingSpec, ILayoutPoint, ILayoutRect, ILayoutType } from '../typings/layout';\nimport type { ILayoutModel } from '../model/interface';\n\nexport interface IBaseLayout {\n /**\n * 对一组布局元素布局\n * 布局策略随意\n * @param item 布局元素数组\n * @param chartLayoutRect 排除图表 padding 后的图表的布局矩形,原点是图表绘制区域左上角。\n * @param chartViewBox 图表在画布中的可用空间,包含图表padding,原点是画布左上角\n * @returns\n */\n layoutItems: LayoutCallBack;\n}\n\nexport type LayoutCallBack = (\n chart: any,\n item: ILayoutItem[],\n chartLayoutRect: IRect,\n chartViewBox: IBoundsLike\n) => void;\n\nexport interface ILayoutSpecBase {\n /**\n * 布局的类型,现在支持 grid布局和默认布局(基于占位的布局)\n */\n type: string;\n}\n\nexport type ElementSpec = (\n | {\n /**\n * 组件对应的spec key,如'legends'表示图例\n */\n modelKey: string;\n /**\n * 组件对应的序号\n */\n modelIndex: number;\n }\n | {\n /**\n * 组件对应的id\n */\n modelId: string;\n }\n) & {\n /**\n * 组件在grid布局中所在的列。从左向右,从 0 开始计数\n */\n col: number;\n /**\n * 组件在grid布局中所在的列跨度,即占了几列,默认值为1\n */\n colSpan?: number;\n /**\n * 组件在grid布局中所在的行。从上向下,从 0 开始计数。\n */\n row: number;\n /**\n * 组件在grid布局中所在的行跨度,即占了几行,默认值为1\n */\n rowSpan?: number;\n};\n\nexport interface IGridLayoutSpec extends ILayoutSpecBase {\n /**\n * 设置布局类型为grid布局\n */\n type: 'grid';\n /**\n * grid布局的总列数\n */\n col: number;\n /**\n * grid布局的总行数\n */\n row: number;\n /**\n * 可选配置,指定某几列的宽度\n */\n colWidth?: {\n /**\n * 指定列数,序号从 0 开始\n */\n index: number;\n /**\n * 设置指定列的宽度,单位为像素\n */\n size: number | ((maxSize: number) => number);\n }[];\n /**\n * 可选配置,指定某几行的高度\n */\n rowHeight?: {\n /**\n * 指定行数,序号从 0 开始\n */\n index: number;\n /**\n * 设置指定行的高度,单位为像素\n */\n size: number | ((maxSize: number) => number);\n }[];\n /**\n *\n * 指定所有图表元素所在位置,图表元素的位置起点和占几行几列,可以占多行多列\n * 图表元素位置允许配置重叠。\n */\n elements: ElementSpec[];\n}\n\nexport interface IBaseLayoutSpec extends ILayoutSpecBase {\n /**\n * 设置布局类型为默认布局\n */\n type: 'base';\n /**\n * 是否在第一次布局完成后,再次布局一次,用于解决第一次布局时,元素宽度或高度为0的问题\n * @since 2.0.7\n */\n secondLayoutLeftRight?: boolean;\n}\n\nexport type ILayoutSpec = IBaseLayoutSpec | IGridLayoutSpec;\n\nexport interface ILayoutConstructor {\n type: string;\n // TODO: spec 类型生命\n new (spec: ILayoutSpec | any, ctx?: any): IBaseLayout;\n}\n\n/**\n * 因为这些元素都会继承到各个模块,所以这里统一有前缀避免语意冲突\n */\nexport interface ILayoutItem {\n readonly type: string;\n /**\n * 标记当前布局元素是否需要重新计算布局属性\n * 图表模块可能部分需要重新布局,部分不需要,根据这个tag在布局过程中进行优化\n */\n readonly willLayoutTag: boolean;\n /**\n * 上一次布局的布局尺寸\n */\n readonly lastComputeRect: ILayoutRect;\n /**\n * 标记这个布局Item的方向(left->right, right->left, top->bottom, bottom->top)\n */\n directionStr?: 'l2r' | 'r2l' | 't2b' | 'b2t';\n layoutClip: boolean;\n layoutType: ILayoutType;\n layoutBindRegionID: number | number[];\n layoutOrient: IOrientType;\n /** 是否自动缩进 */\n autoIndent: boolean;\n\n /**\n * inline元素和其他同行元素的对齐方式\n * 顶部的inline元素,'start' - 顶部对齐;'end' - '底部对齐'; 'middle' - 居中对齐\n * 底部的inline元素,'start' - 底部对齐;'end' - '顶部对齐'; 'middle' - 居中对齐\n * 左侧的inline元素,'start' - 左侧对齐;'end' - '右侧对齐'; 'middle' - 居中对齐\n * 右侧的inline元素,'start' - 右侧对齐;'end' - '左侧对齐'; 'middle' - 居中对齐\n */\n alignSelf?: 'start' | 'end' | 'middle';\n\n layoutPaddingLeft: number;\n layoutPaddingTop: number;\n layoutPaddingRight: number;\n layoutPaddingBottom: number;\n\n layoutOffsetX: number;\n layoutOffsetY: number;\n\n // 越大越先处理\n layoutLevel: number;\n\n chartLayoutRect: ILayoutRect;\n\n readonly layoutRectLevelMap: ILayoutRect;\n minWidth: number;\n maxWidth: number;\n minHeight: number;\n maxHeight: number;\n\n readonly model: ILayoutModel;\n\n getModelId: () => StringOrNumber;\n getModelVisible: () => boolean;\n\n getSpec?: () => any;\n setAttrFromSpec: (spec: ILayoutItemSpec, chartViewRect: ILayoutRect) => void;\n\n setRectInSpec: (rect: ILayoutRect) => ILayoutRect;\n\n getLayoutStartPoint: () => ILayoutPoint;\n getLayoutRect: () => ILayoutRect;\n getLayout: () => IRect;\n getLastComputeOutBounds: () => IBoundsLike;\n\n /** 生命周期 */\n onLayoutStart: (layoutRect: IRect, viewRect: ILayoutRect) => void;\n onLayoutEnd: () => void;\n\n /**\n * 更新元素布局的 layoutRect 大小,用来更新指定布局空间\n */\n setLayoutRect: (rect: Partial<ILayoutRect>, levelMap?: Partial<ILayoutRect>) => void;\n /**\n * 基于元素内部逻辑计算占位空间,rect表示可用空间\n */\n computeBoundsInRect: (rect: ILayoutRect) => ILayoutRect;\n /**\n * 更新元素布局的起始点位置\n */\n setLayoutStartPosition: (pos: Partial<IPoint>) => void;\n /**\n * 更新绝对布局元素的位置信息\n */\n absoluteLayoutInRect: (rect: IRect) => void;\n /**\n * 布局完成后,清楚标记\n */\n clearWillLayoutTag: () => void;\n /**\n * 标记要重新布局\n */\n setWillLayoutTag: () => void;\n}\n\nexport interface ILayoutItemSpec {\n /** 当前模块的布局类型,配置为 absolute 的话,当前元素会以图表左上角为原点进行绝对布局 */\n layoutType?: ILayoutType;\n /**\n * 布局顺序等级,等级越大的,越优先布局\n * 比如顶部同时有标题和图例的场景,期望标题先放在顶部,然后放置图例。\n */\n layoutLevel?: number;\n\n /**\n * inline元素和其他同行元素的对齐方式\n * 顶部的inline元素,'start' - 顶部对齐;'end' - '底部对齐'; 'middle' - 居中对齐\n * 底部的inline元素,'start' - 底部对齐;'end' - '顶部对齐'; 'middle' - 居中对齐\n * 左侧的inline元素,'start' - 左侧对齐;'end' - '右侧对齐'; 'middle' - 居中对齐\n * 右侧的inline元素,'start' - 右侧对齐;'end' - '左侧对齐'; 'middle' - 居中对齐\n */\n alignSelf?: 'start' | 'end' | 'middle';\n\n // 基础的布局配置\n /** 模块布局位置 */\n orient?: IOrientType;\n /** 模块的布局间距 */\n padding?: ILayoutPaddingSpec;\n /** 是否按照 orient 自动修改 padding,隐藏位于外侧的 padding。目前只在组件上生效 */\n noOuterPadding?: boolean;\n /** 模块的布局大小:宽度 */\n width?: ILayoutNumber;\n /** 模块的布局最大宽度 */\n maxWidth?: ILayoutNumber;\n /** 模块的布局最小宽度 */\n minWidth?: ILayoutNumber;\n /** 模块的布局大小:高度 */\n height?: ILayoutNumber;\n /** 模块的布局最大高度 */\n maxHeight?: ILayoutNumber;\n /** 模块的布局最小高度 */\n minHeight?: ILayoutNumber;\n /** 模块的布局位置偏移:X */\n offsetX?: ILayoutNumber;\n /** 模块的布局位置偏移:Y */\n offsetY?: ILayoutNumber;\n\n /** 模块的展示层级,当2个模块重叠时,层级较大的展示在上方 */\n zIndex?: number;\n /** 模块是否裁剪超出布局区域外的绘图内容 */\n clip?: boolean;\n\n // 绝对布局下的对齐设置\n\n /** 模块绝对布局下,与图表左侧的距离。注意仅在 layoutType === 'absolute' 时生效 */\n left?: ILayoutNumber;\n /** 模块绝对布局下,与图表右侧的距离。注意仅在 layoutType === 'absolute' 时生效 */\n right?: ILayoutNumber;\n /** 模块绝对布局下,与图表顶部的距离。注意仅在 layoutType === 'absolute' 时生效 */\n top?: ILayoutNumber;\n /** 模块绝对布局下,与图表底部的距离。注意仅在 layoutType === 'absolute' 时生效 */\n bottom?: ILayoutNumber;\n /** 模块绝对布局下,元素将放置在图表的正中间。注意仅在 layoutType === 'absolute' 时生效,同时将忽略 padding 属性 */\n center?: boolean;\n}\n\nexport interface ILayoutItemInitOption {\n layoutType: ILayoutType;\n layoutLevel: number;\n layoutOrient?: IOrientType;\n transformLayoutRect?: (rect: ILayoutRect) => ILayoutRect;\n transformLayoutPosition?: (pos: Partial<IPoint>) => Partial<IPoint>;\n transformLayoutPadding?: (padding: IPadding) => IPadding;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/chart/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC","file":"index.js","sourcesContent":["export * from './media-query';\nexport * from './formatter';\nexport * from './register';\nexport * from './interface';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/plugin/chart/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC","file":"index.js","sourcesContent":["export * from './media-query';\nexport * from './formatter';\nexport * from './register';\nexport * from './interface';\nexport * from './resize-zoom';\n"]}
|
|
@@ -8,6 +8,7 @@ export interface IChartPlugin<T extends IChartPluginService = any> extends IBase
|
|
|
8
8
|
onAfterChartSpecTransform?: (service: T, chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
9
9
|
onAfterModelSpecTransform?: (service: T, chartSpec: any, chartSpecInfo: IChartSpecInfo, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
10
10
|
onBeforeInitChart?: (service: T, chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
11
|
+
onAfterInitChart?: (service: T, chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
11
12
|
}
|
|
12
13
|
export interface IChartPluginConstructor {
|
|
13
14
|
readonly pluginType: 'chart';
|
|
@@ -22,4 +23,5 @@ export interface IChartPluginService<T extends IChartPlugin = any> extends IBase
|
|
|
22
23
|
onAfterChartSpecTransform?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
23
24
|
onAfterModelSpecTransform?: (chartSpec: any, chartSpecInfo: IChartSpecInfo, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
24
25
|
onBeforeInitChart?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
26
|
+
onAfterInitChart?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;
|
|
25
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/chart/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IChartSpecInfo } from '../../chart/interface';\nimport type { VChartRenderActionSource, IVChart } from '../../core/interface';\nimport type { IBasePlugin, IBasePluginService, MaybePromise } from '../base/interface';\n\nexport interface IChartPlugin<T extends IChartPluginService = any> extends IBasePlugin<T> {\n specKey?: string;\n onInit?: (service: T, chartSpec: any) => MaybePromise<void>;\n onBeforeResize?: (service: T, width: number, height: number) => MaybePromise<void>;\n onAfterChartSpecTransform?: (\n service: T,\n chartSpec: any,\n actionSource: VChartRenderActionSource\n ) => MaybePromise<void>;\n onAfterModelSpecTransform?: (\n service: T,\n chartSpec: any,\n chartSpecInfo: IChartSpecInfo,\n actionSource: VChartRenderActionSource\n ) => MaybePromise<void>;\n onBeforeInitChart?: (service: T, chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;\n}\n\nexport interface IChartPluginConstructor {\n readonly pluginType: 'chart';\n readonly specKey?: string;\n readonly type: string;\n new (): IChartPlugin;\n}\n\nexport interface IChartPluginService<T extends IChartPlugin = any> extends IBasePluginService<T> {\n globalInstance: IVChart;\n onInit?: (chartSpec: any) => MaybePromise<void>;\n onBeforeResize?: (width: number, height: number) => MaybePromise<void>;\n onAfterChartSpecTransform?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;\n onAfterModelSpecTransform?: (\n chartSpec: any,\n chartSpecInfo: IChartSpecInfo,\n actionSource: VChartRenderActionSource\n ) => MaybePromise<void>;\n onBeforeInitChart?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/plugin/chart/interface.ts"],"names":[],"mappings":"","file":"interface.js","sourcesContent":["import type { IChartSpecInfo } from '../../chart/interface';\nimport type { VChartRenderActionSource, IVChart } from '../../core/interface';\nimport type { IBasePlugin, IBasePluginService, MaybePromise } from '../base/interface';\n\nexport interface IChartPlugin<T extends IChartPluginService = any> extends IBasePlugin<T> {\n specKey?: string;\n onInit?: (service: T, chartSpec: any) => MaybePromise<void>;\n onBeforeResize?: (service: T, width: number, height: number) => MaybePromise<void>;\n onAfterChartSpecTransform?: (\n service: T,\n chartSpec: any,\n actionSource: VChartRenderActionSource\n ) => MaybePromise<void>;\n onAfterModelSpecTransform?: (\n service: T,\n chartSpec: any,\n chartSpecInfo: IChartSpecInfo,\n actionSource: VChartRenderActionSource\n ) => MaybePromise<void>;\n onBeforeInitChart?: (service: T, chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;\n onAfterInitChart?: (service: T, chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;\n}\n\nexport interface IChartPluginConstructor {\n readonly pluginType: 'chart';\n readonly specKey?: string;\n readonly type: string;\n new (): IChartPlugin;\n}\n\nexport interface IChartPluginService<T extends IChartPlugin = any> extends IBasePluginService<T> {\n globalInstance: IVChart;\n onInit?: (chartSpec: any) => MaybePromise<void>;\n onBeforeResize?: (width: number, height: number) => MaybePromise<void>;\n onAfterChartSpecTransform?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;\n onAfterModelSpecTransform?: (\n chartSpec: any,\n chartSpecInfo: IChartSpecInfo,\n actionSource: VChartRenderActionSource\n ) => MaybePromise<void>;\n onBeforeInitChart?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;\n onAfterInitChart?: (chartSpec: any, actionSource: VChartRenderActionSource) => MaybePromise<void>;\n}\n"]}
|
|
@@ -11,5 +11,6 @@ export declare class ChartPluginService<T extends IChartPlugin = IChartPlugin> e
|
|
|
11
11
|
onAfterChartSpecTransform(chartSpec: any, actionSource: VChartRenderActionSource): void;
|
|
12
12
|
onAfterModelSpecTransform(chartSpec: any, chartSpecInfo: IChartSpecInfo, actionSource: VChartRenderActionSource): void;
|
|
13
13
|
onBeforeInitChart(chartSpec: any, actionSource: VChartRenderActionSource): void;
|
|
14
|
+
onAfterInitChart(chartSpec: any, actionSource: VChartRenderActionSource): void;
|
|
14
15
|
releaseAll(): void;
|
|
15
16
|
}
|
|
@@ -29,6 +29,11 @@ export class ChartPluginService extends BasePluginService {
|
|
|
29
29
|
plugin.onBeforeInitChart && plugin.onBeforeInitChart(this, chartSpec, actionSource);
|
|
30
30
|
}));
|
|
31
31
|
}
|
|
32
|
+
onAfterInitChart(chartSpec, actionSource) {
|
|
33
|
+
this._plugins.forEach((plugin => {
|
|
34
|
+
plugin.onAfterInitChart && plugin.onAfterInitChart(this, chartSpec, actionSource);
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
32
37
|
releaseAll() {
|
|
33
38
|
super.releaseAll(), this.globalInstance = null;
|
|
34
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/plugin/chart/plugin-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIhE,MAAM,OAAO,kBACX,SAAQ,iBAAoB;IAK5B,YAAY,cAAuB;QACjC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,SAAc;QACnB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,cAAc,CAAC,KAAa,EAAE,MAAc;QAC1C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,yBAAyB,CAAC,SAAc,EAAE,YAAsC;QAC9E,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,MAAM,CAAC,yBAAyB,IAAI,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;QACtG,CAAC,CAAC,CAAC;IACL,CAAC;IAED,yBAAyB,CAAC,SAAc,EAAE,aAA6B,EAAE,YAAsC;QAC7G,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,MAAM,CAAC,yBAAyB;gBAC9B,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACL,CAAC;IAED,iBAAiB,CAAC,SAAc,EAAE,YAAsC;QACtE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,MAAM,CAAC,iBAAiB,IAAI,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;QACtF,CAAC,CAAC,CAAC;IACL,CAAC;IAED,UAAU;QACR,KAAK,CAAC,UAAU,EAAE,CAAC;QACnB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC7B,CAAC;CACF","file":"plugin-service.js","sourcesContent":["import type { IChartPlugin, IChartPluginService } from './interface';\nimport type { IVChart } from '../../core';\nimport { BasePluginService } from '../base/base-plugin-service';\nimport type { VChartRenderActionSource } from '../../core/interface';\nimport type { IChartSpecInfo } from '../../chart/interface/common';\n\nexport class ChartPluginService<T extends IChartPlugin = IChartPlugin>\n extends BasePluginService<T>\n implements IChartPluginService<T>\n{\n globalInstance: IVChart;\n\n constructor(globalInstance: IVChart) {\n super();\n this.globalInstance = globalInstance;\n }\n\n onInit(chartSpec: any) {\n this._plugins.forEach(plugin => {\n plugin.onInit && plugin.onInit(this, chartSpec);\n });\n }\n\n onBeforeResize(width: number, height: number) {\n this._plugins.forEach(plugin => {\n plugin.onBeforeResize && plugin.onBeforeResize(this, width, height);\n });\n }\n\n onAfterChartSpecTransform(chartSpec: any, actionSource: VChartRenderActionSource) {\n this._plugins.forEach(plugin => {\n plugin.onAfterChartSpecTransform && plugin.onAfterChartSpecTransform(this, chartSpec, actionSource);\n });\n }\n\n onAfterModelSpecTransform(chartSpec: any, chartSpecInfo: IChartSpecInfo, actionSource: VChartRenderActionSource) {\n this._plugins.forEach(plugin => {\n plugin.onAfterModelSpecTransform &&\n plugin.onAfterModelSpecTransform(this, chartSpec, chartSpecInfo, actionSource);\n });\n }\n\n onBeforeInitChart(chartSpec: any, actionSource: VChartRenderActionSource) {\n this._plugins.forEach(plugin => {\n plugin.onBeforeInitChart && plugin.onBeforeInitChart(this, chartSpec, actionSource);\n });\n }\n\n releaseAll(): void {\n super.releaseAll();\n this.globalInstance = null;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/plugin/chart/plugin-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIhE,MAAM,OAAO,kBACX,SAAQ,iBAAoB;IAK5B,YAAY,cAAuB;QACjC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,SAAc;QACnB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;IAED,cAAc,CAAC,KAAa,EAAE,MAAc;QAC1C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;IACL,CAAC;IAED,yBAAyB,CAAC,SAAc,EAAE,YAAsC;QAC9E,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,MAAM,CAAC,yBAAyB,IAAI,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;QACtG,CAAC,CAAC,CAAC;IACL,CAAC;IAED,yBAAyB,CAAC,SAAc,EAAE,aAA6B,EAAE,YAAsC;QAC7G,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,MAAM,CAAC,yBAAyB;gBAC9B,MAAM,CAAC,yBAAyB,CAAC,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACL,CAAC;IAED,iBAAiB,CAAC,SAAc,EAAE,YAAsC;QACtE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,MAAM,CAAC,iBAAiB,IAAI,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;QACtF,CAAC,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB,CAAC,SAAc,EAAE,YAAsC;QACrE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,MAAM,CAAC,gBAAgB,IAAI,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;QACpF,CAAC,CAAC,CAAC;IACL,CAAC;IAED,UAAU;QACR,KAAK,CAAC,UAAU,EAAE,CAAC;QACnB,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC7B,CAAC;CACF","file":"plugin-service.js","sourcesContent":["import type { IChartPlugin, IChartPluginService } from './interface';\nimport type { IVChart } from '../../core';\nimport { BasePluginService } from '../base/base-plugin-service';\nimport type { VChartRenderActionSource } from '../../core/interface';\nimport type { IChartSpecInfo } from '../../chart/interface/common';\n\nexport class ChartPluginService<T extends IChartPlugin = IChartPlugin>\n extends BasePluginService<T>\n implements IChartPluginService<T>\n{\n globalInstance: IVChart;\n\n constructor(globalInstance: IVChart) {\n super();\n this.globalInstance = globalInstance;\n }\n\n onInit(chartSpec: any) {\n this._plugins.forEach(plugin => {\n plugin.onInit && plugin.onInit(this, chartSpec);\n });\n }\n\n onBeforeResize(width: number, height: number) {\n this._plugins.forEach(plugin => {\n plugin.onBeforeResize && plugin.onBeforeResize(this, width, height);\n });\n }\n\n onAfterChartSpecTransform(chartSpec: any, actionSource: VChartRenderActionSource) {\n this._plugins.forEach(plugin => {\n plugin.onAfterChartSpecTransform && plugin.onAfterChartSpecTransform(this, chartSpec, actionSource);\n });\n }\n\n onAfterModelSpecTransform(chartSpec: any, chartSpecInfo: IChartSpecInfo, actionSource: VChartRenderActionSource) {\n this._plugins.forEach(plugin => {\n plugin.onAfterModelSpecTransform &&\n plugin.onAfterModelSpecTransform(this, chartSpec, chartSpecInfo, actionSource);\n });\n }\n\n onBeforeInitChart(chartSpec: any, actionSource: VChartRenderActionSource) {\n this._plugins.forEach(plugin => {\n plugin.onBeforeInitChart && plugin.onBeforeInitChart(this, chartSpec, actionSource);\n });\n }\n\n onAfterInitChart(chartSpec: any, actionSource: VChartRenderActionSource) {\n this._plugins.forEach(plugin => {\n plugin.onAfterInitChart && plugin.onAfterInitChart(this, chartSpec, actionSource);\n });\n }\n\n releaseAll(): void {\n super.releaseAll();\n this.globalInstance = null;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './zoom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugin/chart/resize-zoom/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["export * from './zoom';\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IChartPlugin, IChartPluginService } from '../interface';
|
|
2
|
+
import { BasePlugin } from '../../base/base-plugin';
|
|
3
|
+
import type { IPoint } from '../../../typings';
|
|
4
|
+
export declare class ChartResizeZoomPlugin extends BasePlugin<IChartPluginService> implements IChartPlugin {
|
|
5
|
+
static readonly pluginType: 'chart';
|
|
6
|
+
static readonly specKey = "resizeZoom";
|
|
7
|
+
static readonly type: string;
|
|
8
|
+
readonly type: string;
|
|
9
|
+
protected _container?: HTMLElement;
|
|
10
|
+
protected _triggerEvent?: string;
|
|
11
|
+
protected _minZoom?: number;
|
|
12
|
+
protected _maxZoom?: number;
|
|
13
|
+
protected _zoom: number;
|
|
14
|
+
protected _rate?: number;
|
|
15
|
+
constructor();
|
|
16
|
+
onAfterInitChart(service: IChartPluginService, chartSpec: any): void;
|
|
17
|
+
protected _onWheel: (e: WheelEvent) => void;
|
|
18
|
+
zoom(zoom: number, pointerPos?: IPoint): void;
|
|
19
|
+
release(): void;
|
|
20
|
+
}
|
|
21
|
+
export declare const registerChartResizeZoomPlugin: () => void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { BasePlugin } from "../../base/base-plugin";
|
|
2
|
+
|
|
3
|
+
import { registerChartPlugin } from "../register";
|
|
4
|
+
|
|
5
|
+
import { getDefaultTriggerEventByMode } from "../../../component/common/trigger/config";
|
|
6
|
+
|
|
7
|
+
const MIN_ZOOM = .1, MAX_ZOOM = 10;
|
|
8
|
+
|
|
9
|
+
export class ChartResizeZoomPlugin extends BasePlugin {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(ChartResizeZoomPlugin.type), this.type = "ChartResizeZoomPlugin", this._zoom = 1,
|
|
12
|
+
this._onWheel = e => {
|
|
13
|
+
e.preventDefault(), e.stopImmediatePropagation();
|
|
14
|
+
const zoom = Math.pow(1.005, -e.deltaY * Math.pow(16, e.deltaMode) * .2 * this._rate), center = {
|
|
15
|
+
x: e.offsetX,
|
|
16
|
+
y: e.offsetY
|
|
17
|
+
};
|
|
18
|
+
this.zoom(zoom, center);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
onAfterInitChart(service, chartSpec) {
|
|
22
|
+
var _a, _b, _c, _d, _e;
|
|
23
|
+
const chart = service.globalInstance, spec = null !== (_b = null === (_a = chart.getSpec()) || void 0 === _a ? void 0 : _a[ChartResizeZoomPlugin.specKey]) && void 0 !== _b ? _b : {
|
|
24
|
+
enabled: !1
|
|
25
|
+
};
|
|
26
|
+
!0 === spec.enabled && (this._minZoom = null !== (_c = spec.min) && void 0 !== _c ? _c : .1,
|
|
27
|
+
this._maxZoom = null !== (_d = spec.max) && void 0 !== _d ? _d : 10, this._rate = null !== (_e = spec.rate) && void 0 !== _e ? _e : .1,
|
|
28
|
+
this._container = chart.getContainer(), this._triggerEvent = getDefaultTriggerEventByMode(service.globalInstance.getChart().getOption().mode).zoom,
|
|
29
|
+
this._container && this._triggerEvent && this._container.addEventListener(this._triggerEvent, this._onWheel));
|
|
30
|
+
}
|
|
31
|
+
zoom(zoom, pointerPos) {
|
|
32
|
+
const vchart = this.service.globalInstance;
|
|
33
|
+
if (!vchart) return;
|
|
34
|
+
const oldZoom = this._zoom;
|
|
35
|
+
let tempZoom = this._zoom * zoom;
|
|
36
|
+
if (tempZoom <= this._minZoom && zoom < 1 || tempZoom >= this._maxZoom && zoom > 1) if (tempZoom <= this._minZoom && this._zoom > this._minZoom) tempZoom = this._minZoom; else {
|
|
37
|
+
if (!(tempZoom >= this._maxZoom && this._zoom < this._maxZoom)) return;
|
|
38
|
+
tempZoom = this._maxZoom;
|
|
39
|
+
}
|
|
40
|
+
if (tempZoom === oldZoom) return;
|
|
41
|
+
const actualZoomRatio = tempZoom / oldZoom;
|
|
42
|
+
if (this._zoom = tempZoom, vchart.resize(vchart.getCurrentSize().width * this._zoom, vchart.getCurrentSize().height * this._zoom),
|
|
43
|
+
pointerPos && this._container) {
|
|
44
|
+
const {scrollLeft: scrollLeft, scrollTop: scrollTop} = this._container;
|
|
45
|
+
this._container.scrollLeft = scrollLeft + pointerPos.x * (actualZoomRatio - 1),
|
|
46
|
+
this._container.scrollTop = scrollTop + pointerPos.y * (actualZoomRatio - 1);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
release() {
|
|
50
|
+
this._container && this._triggerEvent && this._container.removeEventListener(this._triggerEvent, this._onWheel);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
ChartResizeZoomPlugin.specKey = "resizeZoom", ChartResizeZoomPlugin.type = "ChartResizeZoomPlugin";
|
|
55
|
+
|
|
56
|
+
export const registerChartResizeZoomPlugin = () => {
|
|
57
|
+
registerChartPlugin(ChartResizeZoomPlugin);
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=zoom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugin/chart/resize-zoom/zoom.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAExF,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM,QAAQ,GAAG,EAAE,CAAC;AAEpB,MAAM,OAAO,qBAAsB,SAAQ,UAA+B;IAaxE;QACE,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAV3B,SAAI,GAAW,uBAAuB,CAAC;QAMtC,UAAK,GAAW,CAAC,CAAC;QAuBlB,aAAQ,GAAG,CAAC,CAAa,EAAE,EAAE;YACrC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,CAAC,CAAC,wBAAwB,EAAE,CAAC;YAE7B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAA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C;YAC/E,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC,GAAG,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;SAC9E;IACH,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,aAAa,EAAE;YACzC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CACjC,IAAI,CAAC,aAA0C,EAC/C,IAAI,CAAC,QAAyB,CAC/B,CAAC;SACH;IACH,CAAC;;AArFe,6BAAO,GAAG,YAAY,CAAC;AACvB,0BAAI,GAAW,uBAAuB,CAAC;AAuFzD,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,EAAE;IAChD,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;AAC7C,CAAC,CAAC","file":"zoom.js","sourcesContent":["import type { IChartPlugin, IChartPluginService } from '../interface';\nimport { BasePlugin } from '../../base/base-plugin';\nimport { registerChartPlugin } from '../register';\nimport type { IPoint } from '../../../typings';\nimport { getDefaultTriggerEventByMode } from '../../../component/common/trigger/config';\n\nconst MIN_ZOOM = 0.1;\nconst MAX_ZOOM = 10;\n\nexport class ChartResizeZoomPlugin extends BasePlugin<IChartPluginService> implements IChartPlugin {\n static readonly pluginType: 'chart';\n static readonly specKey = 'resizeZoom';\n static readonly type: string = 'ChartResizeZoomPlugin';\n readonly type: string = 'ChartResizeZoomPlugin';\n\n protected _container?: HTMLElement;\n protected _triggerEvent?: string;\n protected _minZoom?: number;\n protected _maxZoom?: number;\n protected _zoom: number = 1;\n protected _rate?: number;\n\n constructor() {\n super(ChartResizeZoomPlugin.type);\n }\n\n onAfterInitChart(service: IChartPluginService, chartSpec: any) {\n const chart = service.globalInstance;\n const spec = chart.getSpec()?.[ChartResizeZoomPlugin.specKey] ?? { enabled: false };\n if (spec.enabled !== true) {\n return;\n }\n this._minZoom = spec.min ?? MIN_ZOOM;\n this._maxZoom = spec.max ?? MAX_ZOOM;\n this._rate = spec.rate ?? 0.1;\n this._container = chart.getContainer();\n this._triggerEvent = getDefaultTriggerEventByMode(service.globalInstance.getChart().getOption().mode).zoom;\n if (this._container && this._triggerEvent) {\n this._container.addEventListener(this._triggerEvent as keyof HTMLElementEventMap, this._onWheel as EventListener);\n }\n }\n\n protected _onWheel = (e: WheelEvent) => {\n e.preventDefault();\n e.stopImmediatePropagation();\n\n const zoom = Math.pow(1.005, -e.deltaY * Math.pow(16, e.deltaMode) * 0.2 * this._rate);\n const center = { x: e.offsetX, y: e.offsetY };\n this.zoom(zoom, center);\n };\n\n /**\n * 缩放图表\n * @param zoom 缩放比例\n * @param pointerPos 缩放中心,即鼠标位置\n */\n zoom(zoom: number, pointerPos?: IPoint) {\n const vchart = this.service.globalInstance;\n if (!vchart) {\n return;\n }\n const oldZoom = this._zoom;\n let tempZoom = this._zoom * zoom;\n if ((tempZoom <= this._minZoom && zoom < 1) || (tempZoom >= this._maxZoom && zoom > 1)) {\n if (tempZoom <= this._minZoom && this._zoom > this._minZoom) {\n tempZoom = this._minZoom;\n } else if (tempZoom >= this._maxZoom && this._zoom < this._maxZoom) {\n tempZoom = this._maxZoom;\n } else {\n return;\n }\n }\n\n if (tempZoom === oldZoom) {\n return;\n }\n\n const actualZoomRatio = tempZoom / oldZoom;\n this._zoom = tempZoom;\n\n vchart.resize(vchart.getCurrentSize().width * this._zoom, vchart.getCurrentSize().height * this._zoom);\n // 滚动容器滚动, 保持当前鼠标位置在缩放后不变\n if (pointerPos && this._container) {\n const { scrollLeft, scrollTop } = this._container;\n this._container.scrollLeft = scrollLeft + pointerPos.x * (actualZoomRatio - 1);\n this._container.scrollTop = scrollTop + pointerPos.y * (actualZoomRatio - 1);\n }\n }\n\n release(): void {\n if (this._container && this._triggerEvent) {\n this._container.removeEventListener(\n this._triggerEvent as keyof HTMLElementEventMap,\n this._onWheel as EventListener\n );\n }\n }\n}\n\nexport const registerChartResizeZoomPlugin = () => {\n registerChartPlugin(ChartResizeZoomPlugin);\n};\n"]}
|
package/esm/series/index.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ import { VennSeries, registerVennSeries } from './venn/venn';
|
|
|
66
66
|
import type { IMosaicSeriesSpec } from './mosaic/interface';
|
|
67
67
|
import { MosaicSeries, registerMosaicSeries } from './mosaic/mosaic';
|
|
68
68
|
import type { ISeries, ICartesianSeries, IPolarSeries, IGeoSeries } from './interface';
|
|
69
|
-
import { barGrowIn, barGrowOut, barPresetAnimation } from './bar/animation';
|
|
69
|
+
import { barGrowIn, barGrowOut, barPresetAnimation, registerBarAnimation } from './bar/animation';
|
|
70
70
|
import { BaseWordCloudSeries } from './word-cloud/base';
|
|
71
71
|
import { RangeColumnSeriesSpecTransformer } from './range-column/range-column-transformer';
|
|
72
72
|
import { pieDisappear, pieEnter, pieExit, piePresetAnimation } from './pie/animation/animation';
|
|
@@ -78,7 +78,7 @@ import { BaseSeriesSpecTransformer } from './base/base-series-transformer';
|
|
|
78
78
|
import { GeoSeries } from './geo/geo';
|
|
79
79
|
export { PositionEnum, barPresetAnimation, barGrowIn, barGrowOut, piePresetAnimation, pieEnter, pieExit, pieDisappear, baseSeriesMark };
|
|
80
80
|
export { GeoSeries, BaseSeriesSpecTransformer, BaseSeriesTooltipHelper, WaterfallSeries, BarSeries, BarSeriesSpecTransformer, BoxPlotSeries, LineSeries, RadarSeries, RangeAreaSeries, RangeColumnSeriesSpecTransformer, RangeColumnSeries, MapSeries, PieSeriesSpecTransformer, BasePieSeries, PieSeries, SankeySeries, ScatterSeries, SunburstSeries, RoseLikeSeries, RoseSeries, AreaSeries, DotSeries, LinearProgressSeries, LinkSeries, CirclePackingSeries, CircularProgressSeries, BaseWordCloudSeries, WordCloudSeries, FunnelSeriesSpecTransformer, FunnelSeries, TreemapSeries, GaugePointerSeries, GaugeSeries, HeatmapSeries, BaseSeries, CartesianSeries, PolarSeries, ProgressLikeSeries, CorrelationSeries, LiquidSeries, VennSeries, MosaicSeries };
|
|
81
|
-
export { registerAreaSeries, registerBarSeries, registerBoxplotSeries, registerCirclePackingSeries, registerCircularProgressSeries, registerDotSeries, registerFunnelSeries, registerGaugePointerSeries, registerGaugeSeries, registerHeatmapSeries, registerLineSeries, registerLinearProgressSeries, registerLinkSeries, registerMapSeries, registerPieSeries, registerRadarSeries, registerRangeAreaSeries, registerRangeColumnSeries, registerRoseSeries, registerSankeySeries, registerScatterSeries, registerSunBurstSeries, registerTreemapSeries, registerWaterfallSeries, registerWordCloudSeries, registerLiquidSeries, registerVennSeries, registerMosaicSeries };
|
|
81
|
+
export { registerAreaSeries, registerBarSeries, registerBarAnimation, registerBoxplotSeries, registerCirclePackingSeries, registerCircularProgressSeries, registerDotSeries, registerFunnelSeries, registerGaugePointerSeries, registerGaugeSeries, registerHeatmapSeries, registerLineSeries, registerLinearProgressSeries, registerLinkSeries, registerMapSeries, registerPieSeries, registerRadarSeries, registerRangeAreaSeries, registerRangeColumnSeries, registerRoseSeries, registerSankeySeries, registerScatterSeries, registerSunBurstSeries, registerTreemapSeries, registerWaterfallSeries, registerWordCloudSeries, registerLiquidSeries, registerVennSeries, registerMosaicSeries };
|
|
82
82
|
export type { ICartesianSeriesTheme, IPolarSeriesTheme, IArcLabelSpec, IBarAnimationParams, BarAppearPreset, ISeries, ICartesianSeries, IPolarSeries, IGeoSeries, IRoseLikeSeriesSpec, IAreaSeriesSpec, IBarSeriesSpec, IBoxPlotSeriesSpec, ICartesianSeriesSpec, ICirclePackingSeriesSpec, ICircularProgressSeriesSpec, IDotSeriesSpec, IFunnelSeriesSpec, IGaugePointerSeriesSpec, IGaugeSeriesSpec, IHeatmapSeriesSpec, ILineSeriesSpec, ILinearProgressSeriesSpec, ILinkSeriesSpec, IMapSeriesSpec, IPieAnimationParams, PieAppearPreset, IPieSeriesSpec, IPolarSeriesSpec, IProgressLikeSeriesSpec, IRadarSeriesSpec, IRangeAreaSeriesSpec, IRangeColumnSeriesTheme, IRangeColumnSeriesSpec, IRoseSeriesSpec, ISankeySeriesSpec, IScatterSeriesSpec, ISunburstSeriesSpec, ITreemapSeriesSpec, IWaterfallSeriesSpec, IWordCloudSeriesBaseSpec, IWordCloudSeriesSpec, ICorrelationSeriesSpec, ILiquidSeriesSpec, IVennSeriesSpec, IMosaicSeriesSpec };
|
|
83
83
|
export * from './interface';
|
|
84
84
|
export * from './util/utils';
|