@visactor/vrender-components 0.21.9-alpha.1 → 0.21.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/cjs/axis/type.js.map +1 -1
- package/cjs/brush/brush.js +1 -2
- package/cjs/brush/type.js +2 -1
- package/cjs/core/type.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/label/base.js +4 -1
- package/cjs/label/base.js.map +1 -1
- package/cjs/label/type.js.map +1 -1
- package/cjs/legend/discrete/type.js.map +1 -1
- package/cjs/marker/area.js +5 -14
- package/cjs/marker/area.js.map +1 -1
- package/cjs/marker/type.js.map +1 -1
- package/cjs/poptip/type.js.map +1 -1
- package/dist/index.es.js +53 -152
- package/es/axis/type.js.map +1 -1
- package/es/brush/brush.js +1 -2
- package/es/brush/type.js +2 -1
- package/es/core/type.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/label/base.js +4 -1
- package/es/label/base.js.map +1 -1
- package/es/label/type.js.map +1 -1
- package/es/legend/discrete/type.js.map +1 -1
- package/es/marker/area.js +5 -14
- package/es/marker/area.js.map +1 -1
- package/es/marker/type.js.map +1 -1
- package/es/poptip/type.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/legend/discrete/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n EasingType,\n IGroupGraphicAttribute,\n ILinearGradient,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { BaseGraphicAttributes, Padding } from '../../core/type';\nimport type { PagerAttributes } from '../../pager/type';\nimport type { LegendBaseAttributes } from '../type';\nimport type { ScrollBarAttributes } from '../../scrollbar/type';\nimport type { GraphicEventType } from '@visactor/vrender-core';\n\nexport interface LegendSwitchComponentAttributes {\n /**\n * 翻页组件同图例内容项之间的间距\n */\n space?: number;\n /**\n * the default page\n */\n defaultCurrent?: number;\n /**\n * 翻页是否开启动画\n */\n animation?: boolean;\n /**\n * 动画执行时间\n */\n animationDuration?: number;\n /**\n * 动画执行效果\n */\n animationEasing?: EasingType;\n}\n\nexport type LegendPagerAttributes = Omit<PagerAttributes, 'total'> &\n LegendSwitchComponentAttributes & {\n /**\n * 分页器的显示位置,默认 'middle'\n * @default 'middle'\n */\n position?: 'start' | 'middle' | 'end';\n };\n\nexport type LegendScrollbarAttributes = Omit<ScrollBarAttributes, 'range' | 'limitRange'> &\n LegendSwitchComponentAttributes & {\n type: 'scrollbar';\n /**\n * @deprecated since 0.20.13\n * 滚动条的位置是否支持展示在分页的中间。\n * 0.20.13 版本改造了滚动条逻辑后,此配置废弃。改造内容:\n * 由分页拟合的滚动调整为滚动窗口的逻辑,不再与分页绑定\n */\n scrollByPosition?: boolean;\n /**\n * 是否支持鼠标/触控板滚动\n * @default false\n */\n roamScroll?: boolean;\n /**\n * @since 0.20.13\n * 是否隐藏滚动条\n */\n visible?: boolean;\n /**\n * @since 0.20.13\n * 滚动时,图例区域未到尽头时的前后遮罩\n */\n scrollMask?: {\n /** 是否显示 @default false */\n visible?: boolean;\n /** 渐变区域长度 @default 16 */\n gradientLength?: number;\n /** 渐变配置 */\n gradientStops: ILinearGradient['stops'];\n };\n };\n\nexport type LegendItemDatum = {\n /**\n * 该条数据的唯一标识,可用于动画或者查找\n */\n id?: string;\n /** 显示文本 */\n label: string;\n /** 显示数据 */\n value?: string | number;\n /** 图例项前的 shape 形状定义 */\n shape: {\n symbolType?: string;\n fill?: string;\n stroke?: string;\n };\n [key: string]: any;\n};\n\nexport type StyleCallback<T> = (\n item: LegendItemDatum,\n isSelected: boolean,\n index: number,\n allItems: LegendItemDatum[]\n) => T;\n\nexport type formatterCallback = (text: string | number, item: LegendItemDatum, index: number) => any;\n\nexport type LegendItem = {\n /**\n * 是否展示图例项\n * @default true\n */\n visible?: boolean;\n /**\n * 图例项的列间距 水平间距\n */\n spaceCol?: number;\n /**\n * 图例项的行间距 垂直间距\n */\n spaceRow?: number;\n /**\n * 图例项的最大宽度,默认为 null,由上层传入\n */\n maxWidth?: number;\n /**\n * 图例项的宽度, 默认自动计算\n */\n width?: number;\n /**\n * 图例的高度,默认自动计算\n */\n height?: number;\n /**\n * 图例项自身的内边距\n */\n padding?: Padding;\n /**\n * 图例项背景配置\n */\n background?: {\n visible?: boolean;\n } & BaseGraphicAttributes<Partial<IGroupGraphicAttribute> | StyleCallback<Partial<IGroupGraphicAttribute>>>;\n /**\n * 图例项的 shape 图标的配置\n */\n shape?: {\n visible?: boolean;\n /** shape 同后面 label 的间距 */\n space?: number;\n } & BaseGraphicAttributes<Partial<ISymbolGraphicAttribute> | StyleCallback<Partial<ISymbolGraphicAttribute>>>;\n\n /**\n * 当label+ value同时存在的时候,自动省略的策略\n * 'labelFirst' - 尽量保证完整展示`label`\n * 'valueFirst' - 尽量保证完整展示`value`\n * 'none' - 按照`widthRatio`展示label 和 value\n */\n autoEllipsisStrategy?: 'labelFirst' | 'valueFirst' | 'none';\n\n /**\n * 图例项的 label 文本配置\n */\n label?: {\n /**\n * 当 label + value 同时展示,切超长的时候,label的宽度占比\n */\n widthRatio?: number;\n /**\n * 图例项 label 同后面 value 的间距\n */\n space?: number;\n /**\n * 格式化文本函数\n */\n formatMethod?: formatterCallback;\n } & BaseGraphicAttributes<Partial<ITextGraphicAttribute> | StyleCallback<Partial<ITextGraphicAttribute>>>;\n /**\n * 图例项 value 配置\n */\n value?: {\n /**\n * 当 label + value 同时展示,切超长的时候,label的宽度占比\n */\n widthRatio?: number;\n /** value 同后面元素的间距 */\n space?: number;\n /**\n * 是否右对齐显示,仅当设置图例项宽度 itemWidth 时生效\n * 默认为 false,\n */\n alignRight?: boolean;\n /**\n * 格式化文本函数\n */\n formatMethod?: formatterCallback;\n } & BaseGraphicAttributes<Partial<ITextGraphicAttribute> | StyleCallback<Partial<ITextGraphicAttribute>>>;\n /**\n * 是否开启聚焦功能,默认关闭\n */\n focus?: boolean;\n /**\n * 聚焦按钮配置\n */\n focusIconStyle?: Partial<ISymbolGraphicAttribute>;\n /**\n * 指定图例项中图标和文字的摆放位置,可选值为:\n * 'left' 图标在左侧\n * 'right' 图标在右侧\n */\n align?: 'left' | 'right';\n /**\n * @since 0.21.3\n
|
|
1
|
+
{"version":3,"sources":["../src/legend/discrete/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n EasingType,\n IGroupGraphicAttribute,\n ILinearGradient,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { BaseGraphicAttributes, Padding } from '../../core/type';\nimport type { PagerAttributes } from '../../pager/type';\nimport type { LegendBaseAttributes } from '../type';\nimport type { ScrollBarAttributes } from '../../scrollbar/type';\nimport type { GraphicEventType } from '@visactor/vrender-core';\n\nexport interface LegendSwitchComponentAttributes {\n /**\n * 翻页组件同图例内容项之间的间距\n */\n space?: number;\n /**\n * the default page\n */\n defaultCurrent?: number;\n /**\n * 翻页是否开启动画\n */\n animation?: boolean;\n /**\n * 动画执行时间\n */\n animationDuration?: number;\n /**\n * 动画执行效果\n */\n animationEasing?: EasingType;\n}\n\n/**\n * 离散类型的图例组件,当图例项较多的时候,默认使用分页器组件\n */\nexport type LegendPagerAttributes = Omit<PagerAttributes, 'total'> &\n LegendSwitchComponentAttributes & {\n /**\n * 分页器的显示位置,默认 'middle'\n * @default 'middle'\n */\n position?: 'start' | 'middle' | 'end';\n };\n\n/**\n * 离散类型的图例组件使用滚动条组件的时候对应的配置\n */\nexport type LegendScrollbarAttributes = Omit<ScrollBarAttributes, 'range' | 'limitRange'> &\n LegendSwitchComponentAttributes & {\n /**\n * 将翻页器的类型设置为 'scrollbar'\n * 申明图例组件使用滚动条进行翻页展示更多的图例项\n */\n type: 'scrollbar';\n /**\n * @deprecated since 0.20.13\n * 滚动条的位置是否支持展示在分页的中间。\n * 0.20.13 版本改造了滚动条逻辑后,此配置废弃。改造内容:\n * 由分页拟合的滚动调整为滚动窗口的逻辑,不再与分页绑定\n */\n scrollByPosition?: boolean;\n /**\n * 是否支持鼠标/触控板滚动\n * @default false\n */\n roamScroll?: boolean;\n /**\n * @since 0.20.13\n * 是否隐藏滚动条\n */\n visible?: boolean;\n /**\n * @since 0.20.13\n * 滚动时,图例区域未到尽头时的前后遮罩\n */\n scrollMask?: {\n /** 是否显示 @default false */\n visible?: boolean;\n /** 渐变区域长度 @default 16 */\n gradientLength?: number;\n /** 渐变配置 */\n gradientStops: ILinearGradient['stops'];\n };\n };\n\nexport type LegendItemDatum = {\n /**\n * 该条数据的唯一标识,可用于动画或者查找\n */\n id?: string;\n /** 显示文本 */\n label: string;\n /** 显示数据 */\n value?: string | number;\n /** 图例项前的 shape 形状定义 */\n shape: {\n symbolType?: string;\n fill?: string;\n stroke?: string;\n };\n [key: string]: any;\n};\n\nexport type StyleCallback<T> = (\n item: LegendItemDatum,\n isSelected: boolean,\n index: number,\n allItems: LegendItemDatum[]\n) => T;\n\nexport type formatterCallback = (text: string | number, item: LegendItemDatum, index: number) => any;\n\nexport type LegendItem = {\n /**\n * 是否展示图例项\n * @default true\n */\n visible?: boolean;\n /**\n * 图例项的列间距 水平间距\n */\n spaceCol?: number;\n /**\n * 图例项的行间距 垂直间距\n */\n spaceRow?: number;\n /**\n * 图例项的最大宽度,默认为 null,由上层传入\n */\n maxWidth?: number;\n /**\n * 图例项的宽度, 默认自动计算\n */\n width?: number;\n /**\n * 图例的高度,默认自动计算\n */\n height?: number;\n /**\n * 图例项自身的内边距\n */\n padding?: Padding;\n /**\n * 图例项背景配置\n */\n background?: {\n visible?: boolean;\n } & BaseGraphicAttributes<Partial<IGroupGraphicAttribute> | StyleCallback<Partial<IGroupGraphicAttribute>>>;\n /**\n * 图例项的 shape 图标的配置\n */\n shape?: {\n visible?: boolean;\n /** shape 同后面 label 的间距 */\n space?: number;\n } & BaseGraphicAttributes<Partial<ISymbolGraphicAttribute> | StyleCallback<Partial<ISymbolGraphicAttribute>>>;\n\n /**\n * 当label+ value同时存在的时候,自动省略的策略\n * 'labelFirst' - 尽量保证完整展示`label`\n * 'valueFirst' - 尽量保证完整展示`value`\n * 'none' - 按照`widthRatio`展示label 和 value\n */\n autoEllipsisStrategy?: 'labelFirst' | 'valueFirst' | 'none';\n\n /**\n * 图例项的 label 文本配置\n */\n label?: {\n /**\n * 当 label + value 同时展示,切超长的时候,label的宽度占比\n */\n widthRatio?: number;\n /**\n * 图例项 label 同后面 value 的间距\n */\n space?: number;\n /**\n * 格式化文本函数\n */\n formatMethod?: formatterCallback;\n } & BaseGraphicAttributes<Partial<ITextGraphicAttribute> | StyleCallback<Partial<ITextGraphicAttribute>>>;\n /**\n * 图例项 value 配置\n */\n value?: {\n /**\n * 当 label + value 同时展示,切超长的时候,label的宽度占比\n */\n widthRatio?: number;\n /** value 同后面元素的间距 */\n space?: number;\n /**\n * 是否右对齐显示,仅当设置图例项宽度 itemWidth 时生效\n * 默认为 false,\n */\n alignRight?: boolean;\n /**\n * 格式化文本函数\n */\n formatMethod?: formatterCallback;\n } & BaseGraphicAttributes<Partial<ITextGraphicAttribute> | StyleCallback<Partial<ITextGraphicAttribute>>>;\n /**\n * 是否开启聚焦功能,默认关闭\n */\n focus?: boolean;\n /**\n * 聚焦按钮配置\n */\n focusIconStyle?: Partial<ISymbolGraphicAttribute>;\n /**\n * 指定图例项中图标和文字的摆放位置,可选值为:\n * 'left' 图标在左侧\n * 'right' 图标在右侧\n */\n align?: 'left' | 'right';\n /**\n * 水平方向时,一行中多个图例的垂直对齐方式\n * @since 0.21.3\n */\n verticalAlign?: 'top' | 'middle' | 'bottom';\n};\n\nexport type DiscreteLegendAttrs = {\n /**\n * 是否开启选中交互\n */\n select?:\n | boolean\n | {\n /**\n * 触发选中交互的事件类型\n * @since 0.20.13\n **/\n trigger?: GraphicEventType;\n };\n\n /**\n * 是否开启 hover 交互\n */\n hover?:\n | boolean\n | {\n /**\n * 触发hover交互的事件类型\n * @since 0.20.13\n **/\n trigger?: GraphicEventType;\n /**\n * 触发取消hover交互的事件类型\n * @since 0.20.13\n **/\n triggerOff?: GraphicEventType;\n };\n /**\n * 图例数据\n */\n items: LegendItemDatum[];\n /**\n * 默认选中的图例项\n */\n defaultSelected?: (string | number)[];\n /**\n * 单选/多选模式配置,默认 'multiple'。\n * - `single` 表示单选\n * - `multiple` 表示多选\n * - `focus` 表示聚焦模式 (自 0.19.2版本开始支持)\n */\n selectMode?: 'single' | 'multiple' | 'focus';\n /**\n * 是否允许图例全部取消,多选模式下生效\n */\n allowAllCanceled?: boolean;\n /**\n * 图例项的顺序是否要逆序,默认为 false\n */\n reversed?: boolean;\n /**\n * 图例项相关的配置\n */\n item?: LegendItem;\n /**\n * 最大宽度,决定 layout : 'horizontal' 是否自动换行\n */\n maxWidth?: number;\n /**\n * 最大高度,决定是否分页\n */\n maxHeight?: number;\n /**\n * 最大行数,当且仅当 layout 为 'horizontal' 时生效\n */\n maxRow?: number;\n /**\n * 最大列数,当且仅当 layout 为 'vertical' 时生效\n */\n maxCol?: number;\n /**\n * 延迟渲染,按需渲染图例项目\n */\n lazyload?: boolean;\n /**\n * 是否进行自动分页,默认为 true\n */\n autoPage?: boolean;\n /**\n * 翻页器配置\n */\n pager?: LegendPagerAttributes | LegendScrollbarAttributes;\n} & LegendBaseAttributes;\n"]}
|
package/cjs/marker/area.js
CHANGED
|
@@ -28,23 +28,14 @@ class MarkArea extends base_1.Marker {
|
|
|
28
28
|
this.defaultExitAnimation = animate_1.DefaultExitMarkerAnimation;
|
|
29
29
|
}
|
|
30
30
|
getPointAttrByPosition(position) {
|
|
31
|
-
const {x1: x1, x2: x2, y1: y1, y2: y2} = this._area.AABBBounds
|
|
32
|
-
return position.includes("left") || position.includes("Left") ? {
|
|
33
|
-
x: x1,
|
|
34
|
-
y: (y1 + y2) / 2
|
|
35
|
-
} : position.includes("right") || position.includes("Right") ? {
|
|
36
|
-
x: x2,
|
|
37
|
-
y: (y1 + y2) / 2
|
|
38
|
-
} : position.includes("top") || position.includes("Top") ? {
|
|
39
|
-
x: (x1 + x2) / 2,
|
|
40
|
-
y: y1
|
|
41
|
-
} : position.includes("bottom") || position.includes("Bottom") ? {
|
|
42
|
-
x: (x1 + x2) / 2,
|
|
43
|
-
y: y2
|
|
44
|
-
} : {
|
|
31
|
+
const {x1: x1, x2: x2, y1: y1, y2: y2} = this._area.AABBBounds, result = {
|
|
45
32
|
x: (x1 + x2) / 2,
|
|
46
33
|
y: (y1 + y2) / 2
|
|
47
34
|
};
|
|
35
|
+
return (position.includes("left") || position.includes("Left")) && (result.x = x1),
|
|
36
|
+
(position.includes("right") || position.includes("Right")) && (result.x = x2), (position.includes("top") || position.includes("Top")) && (result.y = y1),
|
|
37
|
+
(position.includes("bottom") || position.includes("Bottom")) && (result.y = y2),
|
|
38
|
+
result;
|
|
48
39
|
}
|
|
49
40
|
setLabelPos() {
|
|
50
41
|
var _a;
|
package/cjs/marker/area.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/area.ts"],"names":[],"mappings":";;;AAEA,yDAAwD;AACxD,6CAAwD;AAGxD,gCAA6B;AAC7B,iCAAgC;AAChC,qCAA+F;AAE/F,qDAAyD;AAEzD,yCAAmD;AAEnD,0CAA6C;AAC7C,+CAAgH;AAEhH,IAAA,gCAAqB,GAAE,CAAC;AAExB,SAAgB,uBAAuB;IACrC,QAAQ,CAAC,QAAQ,GAAG,yBAAe,CAAC;AACtC,CAAC;AAFD,0DAEC;AAED,MAAa,QAAS,SAAQ,aAAkD;IAOpE,aAAa,CAAC,KAA2B;QACjD,IAAI,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,gBAAgB,EAAE;YAC9C,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;SAC1E;IACH,CAAC;IAGD,OAAO;QACL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AL,KAAK,uBAAL,KAAK,CAAE,eAAe,CAAC;oBACxD,IAAI,EAAE,IAAA,cAAK,EAAC,EAAE,EAAE,yBAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CAAC;iBAC9C,IACD,CAAC;SACJ;QACD,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAES,aAAa;QACrB,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,SAA0B,CAAC;QACnD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;YAChC,OAAO,KAAK,CAAC;SACd;QACD,IAAI,SAAS,GAAG,IAAI,CAAC;QACrB,MAAM,CAAC,OAAO,CAAC,CAAC,KAAY,EAAE,EAAE;YAC9B,IAAI,CAAC,IAAA,sBAAa,EAAE,KAAe,CAAC,CAAC,CAAC,IAAI,CAAC,IAAA,sBAAa,EAAE,KAAe,CAAC,CAAC,CAAC,EAAE;gBAC5E,SAAS,GAAG,KAAK,CAAC;gBAClB,OAAO;aACR;QACH,CAAC,CAAC,CAAC;QACH,OAAO,SAAS,CAAC;IACnB,CAAC;;AAtIH,4BAuIC;AArIQ,0BAAiB,GAAG,gCAAuB,CAAC","file":"area.js","sourcesContent":["import type { IGroup, INode, IPolygon } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport { isValidNumber, merge } from '@visactor/vutils';\nimport type { TagAttributes } from '../tag';\n// eslint-disable-next-line no-duplicate-imports\nimport { Tag } from '../tag';\nimport { Marker } from './base';\nimport { DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP, DEFAULT_MARK_AREA_THEME } from './config';\nimport type { CommonMarkAreaAnimationType, IMarkAreaLabelPosition, MarkAreaAttrs, MarkerAnimationState } from './type';\nimport { limitShapeInBounds } from '../util/limit-shape';\nimport type { ComponentOptions } from '../interface';\nimport { loadMarkAreaComponent } from './register';\nimport type { Point } from '../core/type';\nimport { DEFAULT_STATES } from '../constant';\nimport { DefaultExitMarkerAnimation, DefaultUpdateMarkAreaAnimation, markAreaAnimate } from './animate/animate';\n\nloadMarkAreaComponent();\n\nexport function registerMarkAreaAnimate() {\n MarkArea._animate = markAreaAnimate;\n}\n\nexport class MarkArea extends Marker<MarkAreaAttrs, CommonMarkAreaAnimationType> {\n name = 'markArea';\n static defaultAttributes = DEFAULT_MARK_AREA_THEME;\n\n /** animate */\n defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation;\n defaultExitAnimation = DefaultExitMarkerAnimation;\n protected markerAnimate(state: MarkerAnimationState) {\n if (MarkArea._animate && this._animationConfig) {\n MarkArea._animate(this._area, this._label, this._animationConfig, state);\n }\n }\n\n private _area!: IPolygon;\n getArea() {\n return this._area;\n }\n\n getLabel() {\n return this._label;\n }\n\n constructor(attributes: MarkAreaAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, MarkArea.defaultAttributes, attributes));\n }\n\n protected getPointAttrByPosition(position: IMarkAreaLabelPosition) {\n const { x1, x2, y1, y2 } = this._area.AABBBounds;\n const result = {\n x: (x1 + x2) / 2,\n y: (y1 + y2) / 2\n };\n\n if (position.includes('left') || position.includes('Left')) {\n result.x = x1;\n }\n if (position.includes('right') || position.includes('Right')) {\n result.x = x2;\n }\n if (position.includes('top') || position.includes('Top')) {\n result.y = y1;\n }\n if (position.includes('bottom') || position.includes('Bottom')) {\n result.y = y2;\n }\n\n return result;\n }\n\n protected setLabelPos() {\n if (this._label && this._area) {\n const { label = {} } = this.attribute as MarkAreaAttrs;\n const labelPosition = label.position ?? 'middle';\n const labelPoint = this.getPointAttrByPosition(labelPosition as IMarkAreaLabelPosition);\n this._label.setAttributes({\n ...labelPoint,\n textStyle: {\n ...DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP[labelPosition],\n ...label.textStyle\n }\n });\n\n if (this.attribute.limitRect && label.confine) {\n const { x, y, width, height } = this.attribute.limitRect;\n limitShapeInBounds(this._label, {\n x1: x,\n y1: y,\n x2: x + width,\n y2: y + height\n });\n }\n }\n }\n\n protected initMarker(container: IGroup) {\n const { points, label, areaStyle, state } = this.attribute as MarkAreaAttrs;\n const area = graphicCreator.polygon({\n points: points,\n ...areaStyle\n });\n area.states = merge({}, DEFAULT_STATES, state?.area);\n area.name = 'mark-area-polygon';\n this._area = area;\n container.add(area);\n\n const markLabel = new Tag({\n ...(label as TagAttributes),\n state: {\n panel: merge({}, DEFAULT_STATES, state?.labelBackground),\n text: merge({}, DEFAULT_STATES, state?.label)\n }\n });\n markLabel.name = 'mark-area-label';\n this._label = markLabel;\n container.add(markLabel as unknown as INode);\n this.setLabelPos();\n }\n\n protected updateMarker() {\n const { points, label, areaStyle, state } = this.attribute as MarkAreaAttrs;\n if (this._area) {\n this._area.setAttributes({\n points: points,\n ...areaStyle\n });\n this._area.states = merge({}, DEFAULT_STATES, state?.area);\n }\n if (this._label) {\n this._label.setAttributes({\n dx: 0,\n dy: 0, // 需要进行复位\n ...(label as TagAttributes),\n state: {\n panel: merge({}, DEFAULT_STATES, state?.labelBackground),\n text: merge({}, DEFAULT_STATES, state?.label)\n }\n });\n }\n this.setLabelPos();\n }\n\n protected isValidPoints() {\n const { points } = this.attribute as MarkAreaAttrs;\n if (!points || points.length < 3) {\n return false;\n }\n let validFlag = true;\n points.forEach((point: Point) => {\n if (!isValidNumber((point as Point).x) || !isValidNumber((point as Point).y)) {\n validFlag = false;\n return;\n }\n });\n return validFlag;\n }\n}\n"]}
|
package/cjs/marker/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/type.ts"],"names":[],"mappings":";;;AAmBA,IAAY,sBAkBX;AAlBD,WAAY,sBAAsB;IAChC,yCAAe,CAAA;IACf,+CAAqB,CAAA;IACrB,qDAA2B,CAAA;IAC3B,qDAA2B,CAAA;IAC3B,2DAAiC,CAAA;IACjC,iEAAuC,CAAA;IAEvC,2CAAiB,CAAA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,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPolygonAttribute,\n IPolygonGraphicAttribute,\n IRectGraphicAttribute,\n IRichTextGraphicAttribute,\n ISymbol,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { CommonSegmentAttributes, ILineGraphicWithCornerRadius, SegmentAttributes } from '../segment/type';\nimport type { TagAttributes } from '../tag/type';\nimport type { Point, State } from '../core/type';\n\nexport enum IMarkLineLabelPosition {\n start = 'start',\n startTop = 'startTop',\n startBottom = 'startBottom',\n insideStart = 'insideStart',\n insideStartTop = 'insideStartTop',\n insideStartBottom = 'insideStartBottom',\n\n middle = 'middle',\n insideMiddleTop = 'insideMiddleTop',\n insideMiddleBottom = 'insideMiddleBottom',\n\n end = 'end',\n endTop = 'endTop',\n endBottom = 'endBottom',\n insideEnd = 'insideEnd',\n insideEndTop = 'insideEndTop',\n insideEndBottom = 'insideEndBottom'\n}\n\nexport enum IMarkAreaLabelPosition {\n left = 'left',\n right = 'right',\n top = 'top',\n bottom = 'bottom',\n topLeft = 'topLeft',\n topRight = 'topRight',\n bottomLeft = 'bottomLeft',\n bottomRight = 'bottomRight',\n\n middle = 'middle',\n\n insideLeft = 'insideLeft',\n insideRight = 'insideRight',\n insideTop = 'insideTop',\n insideBottom = 'insideBottom',\n insideTopLeft = 'insideTopLeft',\n insideTopRight = 'insideTopRight',\n insideBottomLeft = 'insideBottomLeft',\n insideBottomRight = 'insideBottomRight'\n}\n\nexport enum IMarkCommonArcLabelPosition {\n arcInnerStart = 'arcInnerStart',\n arcInnerEnd = 'arcInnerEnd',\n arcInnerMiddle = 'arcInnerMiddle',\n arcOuterStart = 'arcOuterStart',\n arcOuterEnd = 'arcOuterEnd',\n arcOuterMiddle = 'arcOuterMiddle',\n center = 'center'\n}\n\nexport enum IMarkPointItemPosition {\n top = 'top',\n bottom = 'bottom',\n middle = 'middle',\n insideTop = 'insideTop',\n insideBottom = 'insideBottom',\n insideMiddle = 'insideMiddle'\n}\n\nexport type IMarkBackgroundAttributes = {\n /**\n * 是否绘制背景层\n */\n visible: boolean;\n /**\n * TODO: 根据文字宽度进行背景 panel size自适应\n */\n autoHeight?: boolean;\n /**\n * TODO: 根据文高度度进行背景 panel size自适应\n */\n autoWidth?: boolean;\n} & Partial<IRectGraphicAttribute>;\n\nexport type IMarkLabel = Omit<TagAttributes, 'x' | 'y' | 'panel'> & {\n /**\n * 标签的背景面板配置\n */\n panel?: IMarkBackgroundAttributes;\n};\n\nexport type IMarkRef = {\n /**\n * 自动旋转,沿着线的方向\n * @default\n * mark-line/mark-area/mark-point: false - 旧逻辑里autoRotate是false, 保持不变\n * mark-arc-line/mark-arc-area: true - 新增逻辑, 如果不开启的话, 效果不太好, 所以默认true\n * mark-point - 旧逻辑里autoRotate是true, 保持不变\n */\n autoRotate?: boolean;\n /**\n * label 相对line平行方向上的偏移\n */\n refX?: number;\n /**\n * label 相对line正交方向上的偏移\n */\n refY?: number;\n /**\n * label 相对默认角度的偏移 (label跟随line的角度做自动旋转时,默认按照line的平行向量作为初始角度)\n */\n refAngle?: number;\n};\n\nexport type MarkerAttrs<AnimationType> = IGroupGraphicAttribute & {\n type?: 'line' | 'arc-line' | 'area' | 'arc-area' | 'point';\n /**\n * 是否支持交互\n * @default true\n */\n interactive?: boolean;\n /**\n * 是否开启选中交互\n * @default false\n */\n select?: boolean;\n /**\n * 是否开启 hover 交互\n * @default false\n */\n hover?: boolean;\n /**\n * 是否显示marker组件\n * @default true\n */\n visible?: boolean;\n /**\n * 是否将组件在绘制区域内进行剪切\n * @default true\n */\n clipInRange?: boolean;\n /**\n * 组件绘制范围配置\n */\n limitRect?: {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n} & BaseMarkerAnimation<AnimationType>;\n\n/** animation type */\nexport type BaseMarkerAnimation<T> = {\n animation?: MarkerAnimation<T> | boolean;\n animationEnter?: MarkerUpdateAnimation<T>;\n animationUpdate?: MarkerUpdateAnimation<T>;\n animationExit?: MarkerExitAnimation;\n};\nexport type MarkerAnimation<T> = MarkerUpdateAnimation<T> | MarkerUpdateAnimation<T>;\n\nexport type MarkerUpdateAnimation<T> = {\n type: T;\n} & MarkerExitAnimation;\n\nexport type MarkCommonLineAnimationType = 'clipIn' | 'fadeIn';\n\nexport type CommonMarkAreaAnimationType = 'fadeIn';\n\nexport type MarkPointAnimationType = 'callIn' | 'fadeIn';\n\nexport type MarkerExitAnimation = {\n type: 'fadeOut';\n duration?: number;\n delay?: number;\n easing?: EasingType;\n};\n\nexport type MarkerAnimationState = 'enter' | 'update' | 'exit';\n\n/** state type */\nexport type MarkCommonLineState<LineAttr> = {\n line?: State<LineAttr>;\n lineStartSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n lineEndSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n label?: State<Partial<ITextGraphicAttribute>>;\n labelBackground?: State<Partial<IRectGraphicAttribute>>;\n};\n\nexport type CommonMarkAreaState<AreaAttr> = {\n area?: State<Partial<AreaAttr>>;\n label?: State<Partial<ITextGraphicAttribute>>;\n labelBackground?: State<Partial<IRectGraphicAttribute>>;\n};\n\nexport type MarkPointState = {\n line?: State<ILineGraphicWithCornerRadius | Partial<ILineGraphicAttribute>[]>;\n lineStartSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n lineEndSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n symbol?: State<Partial<ISymbolGraphicAttribute>>;\n image?: State<Partial<IImageGraphicAttribute>>;\n text?: State<Partial<ITextGraphicAttribute>>;\n textBackground?: State<Partial<IRectGraphicAttribute>>;\n richText?: State<Partial<IRichTextGraphicAttribute>>;\n customMark?: State<Partial<IGroupGraphicAttribute>>;\n targetItem?: State<Partial<ISymbolGraphicAttribute>>;\n};\n\nexport type MarkCommonLineAttrs<LineAttr, LineLabelPosition, MarkCommonLineAnimationType> =\n MarkerAttrs<MarkCommonLineAnimationType> &\n Omit<CommonSegmentAttributes, 'state' | 'lineStyle'> & {\n /**\n * 标签\n */\n label?: {\n /**\n * label 相对line的位置\n */\n position?: LineLabelPosition;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n } & IMarkRef &\n IMarkLabel;\n state?: MarkCommonLineState<LineAttr>;\n };\n\nexport type MarkLineAttrs = MarkCommonLineAttrs<\n ILineGraphicWithCornerRadius | ILineGraphicAttribute[],\n keyof typeof IMarkLineLabelPosition,\n MarkCommonLineAnimationType\n> & {\n type?: 'line';\n /**\n * 是否对 points 进行多段处理,默认为 false,即直接将所有的点连接成线。\n * 如果需要进行多段处理,需要将 points 属性配置为 Point[][] 类型\n * @default false\n */\n multiSegment?: boolean;\n /**\n * 在 `multiSegment` 属性开启的前提下,用于声明那一段线段用来作为主线段,如果不声明,默认全段为主线段\n */\n mainSegmentIndex?: number;\n /**\n * 构成line的点: 如果是两个点,则为直线;多个点则为曲线\n */\n points: Point[] | Point[][];\n lineStyle?: ILineGraphicAttribute;\n};\n\nexport type MarkArcLineAttrs = MarkCommonLineAttrs<\n IArcGraphicAttribute,\n keyof typeof IMarkCommonArcLabelPosition,\n MarkCommonLineAnimationType\n> & {\n type?: 'arc-line';\n /**\n * 弧线中心位置\n */\n center: {\n x: number;\n y: number;\n };\n /**\n * 弧线半径\n */\n radius: number;\n /**\n * 弧线起始角度(弧度)\n */\n startAngle: number;\n /**\n * 弧线终点角度(弧度)\n */\n endAngle: number;\n lineStyle?: IArcGraphicAttribute;\n};\n\nexport type MarkAreaAttrs = MarkerAttrs<CommonMarkAreaAnimationType> & {\n type?: 'area';\n /**\n * 构成area的点\n */\n points: Point[];\n /**\n * 标签\n */\n label?: {\n position?: keyof typeof IMarkAreaLabelPosition;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n } & IMarkLabel;\n /**\n * area的样式\n */\n areaStyle?: IPolygonAttribute;\n\n state?: CommonMarkAreaState<IPolygonGraphicAttribute>;\n};\n\nexport type MarkArcAreaAttrs = MarkerAttrs<CommonMarkAreaAnimationType> & {\n type?: 'arc-area';\n /**\n * 扇区中心位置\n */\n center: {\n x: number;\n y: number;\n };\n /**\n * 扇区内半径\n */\n innerRadius: number;\n /**\n * 扇区外半径\n */\n outerRadius: number;\n /**\n * 扇区起始角度(弧度)\n */\n startAngle: number;\n /**\n * 扇区终点角度(弧度)\n */\n endAngle: number;\n /**\n * 标签\n */\n label?: {\n position?: keyof typeof IMarkCommonArcLabelPosition;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n } & IMarkRef &\n IMarkLabel;\n /**\n * area的样式\n */\n areaStyle?: IArcGraphicAttribute;\n\n state?: CommonMarkAreaState<IArcGraphicAttribute>;\n};\n\nexport type IItemContent = IMarkRef & {\n /**\n * 标注类型\n * Tips: 保留'richText'与之前的定义做兼容\n */\n type?: 'symbol' | 'text' | 'image' | 'richText' | 'custom';\n position?: keyof typeof IMarkPointItemPosition;\n /**\n * x 方向偏移量\n */\n offsetX?: number;\n /**\n * y 方向偏移量\n */\n offsetY?: number;\n /**\n * type为symbol时, symbol的样式\n */\n symbolStyle?: ISymbolGraphicAttribute;\n /**\n * type为image时, image的样式\n */\n imageStyle?: IImageGraphicAttribute;\n /**\n * type为text时, text的配置\n * 'text'类型的ItemContent新增三种子类型:'text','rich','html'。配置在textStyle.type上,继承自TagAttributes。\n */\n textStyle?: IMarkLabel;\n /**\n * type为rich text时, rich text的样式\n */\n richTextStyle?: IRichTextGraphicAttribute;\n /**\n * type为custom时,允许以callback的方式传入需要render的item\n */\n renderCustomCallback?: () => IGroup;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n};\n\nexport type IItemLine = {\n /** TODO:'type-opo' */\n type?: 'type-s' | 'type-do' | 'type-po' | 'type-op' | 'type-arc';\n visible?: boolean;\n /**\n * 当type为type-arc时生效, 数值决定曲率, 符号决定法向, 不能等于0\n * @default 0.8\n */\n arcRatio?: number;\n /**\n * 垂直于引导线的装饰线,参考案例: https://observablehq.com/@mikelotis/edmonton-population-history-line-chart\n */\n decorativeLine?: {\n visible?: boolean;\n length?: number;\n };\n} & Omit<SegmentAttributes, 'points'>;\n\nexport type MarkPointAttrs = Omit<MarkerAttrs<MarkPointAnimationType>, 'labelStyle'> & {\n /**\n * markPoint的位置(也是path的起点)\n */\n position: Point;\n /**\n * 标注引导线\n */\n itemLine?: IItemLine;\n\n /**\n * 标注内容\n */\n itemContent?: IItemContent;\n\n /**\n * 被标注的内容\n */\n targetSymbol?: {\n /**\n * 被标注内容与标记线间的间隙\n * @default 0\n */\n offset?: number;\n /**\n * 是否显示\n * @default false\n */\n visible?: boolean;\n /**\n * 大小\n * @default 20\n */\n size?: number;\n style?: ISymbol;\n };\n\n state?: MarkPointState;\n} & BaseMarkerAnimation<MarkPointAnimationType>;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/marker/type.ts"],"names":[],"mappings":";;;AAmBA,IAAY,sBAkBX;AAlBD,WAAY,sBAAsB;IAChC,yCAAe,CAAA;IACf,+CAAqB,CAAA;IACrB,qDAA2B,CAAA;IAC3B,qDAA2B,CAAA;IAC3B,2DAAiC,CAAA;IACjC,iEAAuC,CAAA;IAEvC,2CAAiB,CAAA;IACjB,6DAAmC,CAAA;IACnC,mEAAyC,CAAA;IAEzC,qCAAW,CAAA;IACX,2CAAiB,CAAA;IACjB,iDAAuB,CAAA;IACvB,iDAAuB,CAAA;IACvB,uDAA6B,CAAA;IAC7B,6DAAmC,CAAA;AACrC,CAAC,EAlBW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAkBjC;AAED,IAAY,sBAoBX;AApBD,WAAY,sBAAsB;IAChC,uCAAa,CAAA;IACb,yCAAe,CAAA;IACf,qCAAW,CAAA;IACX,2CAAiB,CAAA;IACjB,6CAAmB,CAAA;IACnB,+CAAqB,CAAA;IACrB,mDAAyB,CAAA;IACzB,qDAA2B,CAAA;IAE3B,2CAAiB,CAAA;IAEjB,mDAAyB,CAAA;IACzB,qDAA2B,CAAA;IAC3B,iDAAuB,CAAA;IACvB,uDAA6B,CAAA;IAC7B,yDAA+B,CAAA;IAC/B,2DAAiC,CAAA;IACjC,+DAAqC,CAAA;IACrC,iEAAuC,CAAA;AACzC,CAAC,EApBW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAoBjC;AAED,IAAY,2BAQX;AARD,WAAY,2BAA2B;IACrC,8DAA+B,CAAA;IAC/B,0DAA2B,CAAA;IAC3B,gEAAiC,CAAA;IACjC,8DAA+B,CAAA;IAC/B,0DAA2B,CAAA;IAC3B,gEAAiC,CAAA;IACjC,gDAAiB,CAAA;AACnB,CAAC,EARW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAQtC;AAED,IAAY,sBAOX;AAPD,WAAY,sBAAsB;IAChC,qCAAW,CAAA;IACX,2CAAiB,CAAA;IACjB,2CAAiB,CAAA;IACjB,iDAAuB,CAAA;IACvB,uDAA6B,CAAA;IAC7B,uDAA6B,CAAA;AAC/B,CAAC,EAPW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAOjC","file":"type.js","sourcesContent":["import type {\n EasingType,\n IArcGraphicAttribute,\n IGroup,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ILineGraphicAttribute,\n IPolygonAttribute,\n IPolygonGraphicAttribute,\n IRectGraphicAttribute,\n IRichTextGraphicAttribute,\n ISymbol,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { CommonSegmentAttributes, ILineGraphicWithCornerRadius, SegmentAttributes } from '../segment/type';\nimport type { TagAttributes } from '../tag/type';\nimport type { Point, State } from '../core/type';\n\nexport enum IMarkLineLabelPosition {\n start = 'start',\n startTop = 'startTop',\n startBottom = 'startBottom',\n insideStart = 'insideStart',\n insideStartTop = 'insideStartTop',\n insideStartBottom = 'insideStartBottom',\n\n middle = 'middle',\n insideMiddleTop = 'insideMiddleTop',\n insideMiddleBottom = 'insideMiddleBottom',\n\n end = 'end',\n endTop = 'endTop',\n endBottom = 'endBottom',\n insideEnd = 'insideEnd',\n insideEndTop = 'insideEndTop',\n insideEndBottom = 'insideEndBottom'\n}\n\nexport enum IMarkAreaLabelPosition {\n left = 'left',\n right = 'right',\n top = 'top',\n bottom = 'bottom',\n topLeft = 'topLeft',\n topRight = 'topRight',\n bottomLeft = 'bottomLeft',\n bottomRight = 'bottomRight',\n\n middle = 'middle',\n\n insideLeft = 'insideLeft',\n insideRight = 'insideRight',\n insideTop = 'insideTop',\n insideBottom = 'insideBottom',\n insideTopLeft = 'insideTopLeft',\n insideTopRight = 'insideTopRight',\n insideBottomLeft = 'insideBottomLeft',\n insideBottomRight = 'insideBottomRight'\n}\n\nexport enum IMarkCommonArcLabelPosition {\n arcInnerStart = 'arcInnerStart',\n arcInnerEnd = 'arcInnerEnd',\n arcInnerMiddle = 'arcInnerMiddle',\n arcOuterStart = 'arcOuterStart',\n arcOuterEnd = 'arcOuterEnd',\n arcOuterMiddle = 'arcOuterMiddle',\n center = 'center'\n}\n\nexport enum IMarkPointItemPosition {\n top = 'top',\n bottom = 'bottom',\n middle = 'middle',\n insideTop = 'insideTop',\n insideBottom = 'insideBottom',\n insideMiddle = 'insideMiddle'\n}\n\nexport type IMarkBackgroundAttributes = {\n /**\n * 是否绘制背景层\n */\n visible: boolean;\n /**\n * TODO: 根据文字宽度进行背景 panel size自适应\n */\n autoHeight?: boolean;\n /**\n * TODO: 根据文高度度进行背景 panel size自适应\n */\n autoWidth?: boolean;\n} & Partial<IRectGraphicAttribute>;\n\nexport type IMarkLabel = Omit<TagAttributes, 'x' | 'y' | 'panel'> & {\n /**\n * 标签的背景面板配置\n */\n panel?: IMarkBackgroundAttributes;\n};\n\nexport type IMarkRef = {\n /**\n * 自动旋转,沿着线的方向\n * @default\n * mark-line/mark-area/mark-point: false - 旧逻辑里autoRotate是false, 保持不变\n * mark-arc-line/mark-arc-area: true - 新增逻辑, 如果不开启的话, 效果不太好, 所以默认true\n * mark-point - 旧逻辑里autoRotate是true, 保持不变\n */\n autoRotate?: boolean;\n /**\n * label 相对line平行方向上的偏移\n */\n refX?: number;\n /**\n * label 相对line正交方向上的偏移\n */\n refY?: number;\n /**\n * label 相对默认角度的偏移 (label跟随line的角度做自动旋转时,默认按照line的平行向量作为初始角度)\n */\n refAngle?: number;\n};\n\nexport type MarkerAttrs<AnimationType> = IGroupGraphicAttribute & {\n /**\n * 设置标注的类型\n */\n type?: 'line' | 'arc-line' | 'area' | 'arc-area' | 'point';\n /**\n * 是否支持交互\n * @default true\n */\n interactive?: boolean;\n /**\n * 是否开启选中交互\n * @default false\n */\n select?: boolean;\n /**\n * 是否开启 hover 交互\n * @default false\n */\n hover?: boolean;\n /**\n * 是否显示marker组件\n * @default true\n */\n visible?: boolean;\n /**\n * 是否将组件在绘制区域内进行剪切\n * @default true\n */\n clipInRange?: boolean;\n /**\n * 组件绘制范围配置\n */\n limitRect?: {\n /**\n * 绘制范围的起点x坐标\n */\n x: number;\n /**\n * 绘制范围的起点y坐标\n */\n y: number;\n /**\n * 绘制范围的宽度\n */\n width: number;\n /**\n * 绘制范围的高度\n */\n height: number;\n };\n} & BaseMarkerAnimation<AnimationType>;\n\n/** animation type */\nexport type BaseMarkerAnimation<T> = {\n /**\n * 动画公共配置\n */\n animation?: MarkerAnimation<T> | boolean;\n /**\n * 入场动画配置\n */\n animationEnter?: MarkerUpdateAnimation<T>;\n /**\n * 更新动画配置\n */\n animationUpdate?: MarkerUpdateAnimation<T>;\n /**\n * 离场动画配置\n */\n animationExit?: MarkerExitAnimation;\n};\nexport type MarkerAnimation<T> = MarkerUpdateAnimation<T> | MarkerUpdateAnimation<T>;\n\nexport type MarkerUpdateAnimation<T> = {\n /**\n * 设置动画的类型\n */\n type: T;\n} & MarkerExitAnimation;\n\nexport type MarkCommonLineAnimationType = 'clipIn' | 'fadeIn';\n\nexport type CommonMarkAreaAnimationType = 'fadeIn';\n\nexport type MarkPointAnimationType = 'callIn' | 'fadeIn';\n\nexport type MarkerExitAnimation = {\n /**\n * 设置离场动画的类型为fadeOut,即淡出\n */\n type: 'fadeOut';\n /**\n * 动画的时长\n */\n duration?: number;\n /**\n * 动画延迟的时长\n */\n delay?: number;\n /**\n * 动画的缓动函数\n */\n easing?: EasingType;\n};\n\nexport type MarkerAnimationState = 'enter' | 'update' | 'exit';\n\n/** state type */\nexport type MarkCommonLineState<LineAttr> = {\n /**\n * 设置线图形的在特定状态下的样式\n */\n line?: State<LineAttr>;\n /**\n * 设置线的起点在特定状态下的样式\n */\n lineStartSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置线的终点在特定状态下的样式\n */\n lineEndSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置标签在特定状态下的样式\n */\n label?: State<Partial<ITextGraphicAttribute>>;\n /**\n * 设置标签背景区块在特定状态下的样式\n */\n labelBackground?: State<Partial<IRectGraphicAttribute>>;\n};\n\nexport type CommonMarkAreaState<AreaAttr> = {\n /**\n * 设置标注区域在特定状态下的样式\n */\n area?: State<Partial<AreaAttr>>;\n /**\n * 设置标注区域标签在特定状态下的样式\n */\n label?: State<Partial<ITextGraphicAttribute>>;\n /**\n * 设置标签背景区块在特定状态下的样式\n */\n labelBackground?: State<Partial<IRectGraphicAttribute>>;\n};\n\nexport type MarkPointState = {\n /**\n * 设置标注点连线在特定状态下的样式\n */\n line?: State<ILineGraphicWithCornerRadius | Partial<ILineGraphicAttribute>[]>;\n /**\n * 设置线起点图形在特定状态下的样式\n */\n lineStartSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置线终点图形在特定状态下的样式\n */\n lineEndSymbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置标注图形在特定状态下的样式\n */\n symbol?: State<Partial<ISymbolGraphicAttribute>>;\n /**\n * 设置标注图形在特定状态下的样式\n */\n image?: State<Partial<IImageGraphicAttribute>>;\n /**\n * 设置标签在特定状态下的样式\n */\n text?: State<Partial<ITextGraphicAttribute>>;\n /**\n * 设置标签背景区块在特定状态下的样式\n */\n textBackground?: State<Partial<IRectGraphicAttribute>>;\n /**\n * 设置富文本在特定状态下的样式\n */\n richText?: State<Partial<IRichTextGraphicAttribute>>;\n /**\n * 设置自定义标注图形在特定状态下的样式\n */\n customMark?: State<Partial<IGroupGraphicAttribute>>;\n /**\n * 设置目标元素在特定状态下的样式\n */\n targetItem?: State<Partial<ISymbolGraphicAttribute>>;\n};\n\nexport type MarkCommonLineAttrs<LineAttr, LineLabelPosition, MarkCommonLineAnimationType> =\n MarkerAttrs<MarkCommonLineAnimationType> &\n Omit<CommonSegmentAttributes, 'state' | 'lineStyle'> & {\n /**\n * 标签\n */\n label?: {\n /**\n * label 相对line的位置\n */\n position?: LineLabelPosition;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n } & IMarkRef &\n IMarkLabel;\n /**\n * 辅助线各种状态下的样式\n */\n state?: MarkCommonLineState<LineAttr>;\n };\n\nexport type MarkLineAttrs = MarkCommonLineAttrs<\n ILineGraphicWithCornerRadius | ILineGraphicAttribute[],\n keyof typeof IMarkLineLabelPosition,\n MarkCommonLineAnimationType\n> & {\n /**\n * 将辅助线的类型设置为 'line'\n */\n type?: 'line';\n /**\n * 是否对 points 进行多段处理,默认为 false,即直接将所有的点连接成线。\n * 如果需要进行多段处理,需要将 points 属性配置为 Point[][] 类型\n * @default false\n */\n multiSegment?: boolean;\n /**\n * 在 `multiSegment` 属性开启的前提下,用于声明那一段线段用来作为主线段,如果不声明,默认全段为主线段\n */\n mainSegmentIndex?: number;\n /**\n * 构成line的点: 如果是两个点,则为直线;多个点则为折线\n */\n points: Point[] | Point[][];\n /**\n * 线的样式设置\n */\n lineStyle?: ILineGraphicAttribute;\n};\n\nexport type MarkArcLineAttrs = MarkCommonLineAttrs<\n IArcGraphicAttribute,\n keyof typeof IMarkCommonArcLabelPosition,\n MarkCommonLineAnimationType\n> & {\n /**\n * 将辅助线的类型设置为 'arc-line',即弧线\n */\n type?: 'arc-line';\n /**\n * 弧线中心位置\n */\n center: {\n x: number;\n y: number;\n };\n /**\n * 弧线半径\n */\n radius: number;\n /**\n * 弧线起始角度(弧度)\n */\n startAngle: number;\n /**\n * 弧线终点角度(弧度)\n */\n endAngle: number;\n /**\n * 设置弧线的样式\n */\n lineStyle?: IArcGraphicAttribute;\n};\n\nexport type MarkAreaAttrs = MarkerAttrs<CommonMarkAreaAnimationType> & {\n type?: 'area';\n /**\n * 构成area的点\n */\n points: Point[];\n /**\n * 标签\n */\n label?: {\n /**\n * 设置标签的位置\n */\n position?: keyof typeof IMarkAreaLabelPosition;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n } & IMarkLabel;\n /**\n * area的样式\n */\n areaStyle?: IPolygonAttribute;\n /**\n * 设置标注区域在各种状态下的样式\n */\n state?: CommonMarkAreaState<IPolygonGraphicAttribute>;\n};\n\nexport type MarkArcAreaAttrs = MarkerAttrs<CommonMarkAreaAnimationType> & {\n type?: 'arc-area';\n /**\n * 扇区中心位置\n */\n center: {\n x: number;\n y: number;\n };\n /**\n * 扇区内半径\n */\n innerRadius: number;\n /**\n * 扇区外半径\n */\n outerRadius: number;\n /**\n * 扇区起始角度(弧度)\n */\n startAngle: number;\n /**\n * 扇区终点角度(弧度)\n */\n endAngle: number;\n /**\n * 标签\n */\n label?: {\n /**\n * 标签的位置\n */\n position?: keyof typeof IMarkCommonArcLabelPosition;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n } & IMarkRef &\n IMarkLabel;\n /**\n * area的样式\n */\n areaStyle?: IArcGraphicAttribute;\n /**\n * 辅助区域这种状态下各个图元的样式设置\n */\n state?: CommonMarkAreaState<IArcGraphicAttribute>;\n};\n\nexport type IItemContent = IMarkRef & {\n /**\n * 标注类型\n * Tips: 保留'richText'与之前的定义做兼容\n */\n type?: 'symbol' | 'text' | 'image' | 'richText' | 'custom';\n /**\n * 设置标注的位置\n */\n position?: keyof typeof IMarkPointItemPosition;\n /**\n * x 方向偏移量\n */\n offsetX?: number;\n /**\n * y 方向偏移量\n */\n offsetY?: number;\n /**\n * type为symbol时, symbol的样式\n */\n symbolStyle?: ISymbolGraphicAttribute;\n /**\n * type为image时, image的样式\n */\n imageStyle?: IImageGraphicAttribute;\n /**\n * type为text时, text的配置\n * 'text'类型的ItemContent新增三种子类型:'text','rich','html'。配置在textStyle.type上,继承自TagAttributes。\n */\n textStyle?: IMarkLabel;\n /**\n * type为rich text时, rich text的样式\n */\n richTextStyle?: IRichTextGraphicAttribute;\n /**\n * type为custom时,允许以callback的方式传入需要render的item\n */\n renderCustomCallback?: () => IGroup;\n /**\n * 当 mark 配置了 limitRect 之后,label 是否自动调整位置\n * @default false\n */\n confine?: boolean;\n};\n\nexport type IItemLine = {\n /** TODO:'type-opo' */\n type?: 'type-s' | 'type-do' | 'type-po' | 'type-op' | 'type-arc';\n /**\n * 是否展示该标注\n */\n visible?: boolean;\n /**\n * 当type为type-arc时生效, 数值决定曲率, 符号决定法向, 不能等于0\n * @default 0.8\n */\n arcRatio?: number;\n /**\n * 垂直于引导线的装饰线,参考案例: https://observablehq.com/@mikelotis/edmonton-population-history-line-chart\n */\n decorativeLine?: {\n /**\n * 是否显示引导线的装饰线\n */\n visible?: boolean;\n /**\n * 装饰线的长度\n */\n length?: number;\n };\n} & Omit<SegmentAttributes, 'points'>;\n\nexport type MarkPointAttrs = Omit<MarkerAttrs<MarkPointAnimationType>, 'labelStyle'> & {\n /**\n * markPoint的位置(也是path的起点)\n */\n position: Point;\n /**\n * 标注引导线\n */\n itemLine?: IItemLine;\n\n /**\n * 标注内容\n */\n itemContent?: IItemContent;\n\n /**\n * 被标注的内容\n */\n targetSymbol?: {\n /**\n * 被标注内容与标记线间的间隙\n * @default 0\n */\n offset?: number;\n /**\n * 是否显示\n * @default false\n */\n visible?: boolean;\n /**\n * 大小\n * @default 20\n */\n size?: number;\n /**\n * 被标注内容的样式设置\n */\n style?: ISymbol;\n };\n /**\n * 标注点各个状态下的样式\n */\n state?: MarkPointState;\n} & BaseMarkerAnimation<MarkPointAnimationType>;\n"]}
|
package/cjs/poptip/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/poptip/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n IGraphic,\n IGroupGraphicAttribute,\n IRectGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { Padding, State } from '../core/type';\nimport type { BackgroundAttributes } from '../interface';\n\ntype StateStyle = {\n /**\n * title 文本的状态配置\n */\n title?: State<Partial<ITextGraphicAttribute>>;\n /**\n * content 文本的状态配置\n */\n content?: State<Partial<ITextGraphicAttribute>>;\n /**\n * panel 背景的状态配置ß\n */\n panel?: State<Partial<IRectGraphicAttribute>>;\n};\n\nexport type PopTipAttributes = {\n
|
|
1
|
+
{"version":3,"sources":["../src/poptip/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n IGraphic,\n IGroupGraphicAttribute,\n IRectGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { Padding, State } from '../core/type';\nimport type { BackgroundAttributes } from '../interface';\n\ntype StateStyle = {\n /**\n * title 文本的状态配置\n */\n title?: State<Partial<ITextGraphicAttribute>>;\n /**\n * content 文本的状态配置\n */\n content?: State<Partial<ITextGraphicAttribute>>;\n /**\n * panel 背景的状态配置ß\n */\n panel?: State<Partial<IRectGraphicAttribute>>;\n};\n\nexport type PopTipAttributes = {\n /**\n * 弹出框的方位,有 12 个方位可供选择\n */\n position?: 'auto' | 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br' | 'left' | 'lt' | 'lb' | 'right' | 'rt' | 'rb';\n /**\n * 标题内容,如果需要进行换行,则使用数组形式,如 ['abc', '123']\n */\n title?: string | string[] | number | number[];\n /**\n * 标题样式\n */\n titleStyle?: Partial<ITextGraphicAttribute>;\n /**\n * 标题的格式化方法\n */\n titleFormatMethod?: (t: string | string[] | number | number[]) => string | string[] | number | number[];\n /**\n * 内容文本,如果需要进行换行,则使用数组形式,如 ['abc', '123']\n */\n content?: string | string[] | number | number[];\n /**\n * 内容文本样式\n */\n contentStyle?: Partial<ITextGraphicAttribute>;\n /**\n * 内容的格式化方法\n */\n contentFormatMethod?: (t: string | string[] | number | number[]) => string | string[] | number | number[];\n /**\n * 标题与内容的间距\n */\n space?: number;\n /**\n * 内部边距\n */\n padding?: Padding;\n /**\n * 标签的背景面板配置, TODO: 支持symbol形状\n */\n panel?: BackgroundAttributes & ISymbolGraphicAttribute & { space?: number };\n\n /**\n * 最小宽度,像素值\n * @default 30\n */\n minWidth?: number;\n /**\n * 最大宽度,像素值。当文字超过最大宽度时,会自动省略。\n */\n maxWidth?: number;\n\n /**\n * 最大宽度比例\n */\n maxWidthPercent?: number;\n /**\n * 是否展示\n */\n visible?: boolean;\n /**\n * 自定义的展示逻辑\n */\n visibleFunc?: (graphic: IGraphic) => boolean;\n state?: StateStyle;\n dx?: number;\n dy?: number;\n} & Omit<IGroupGraphicAttribute, 'background'>;\n\nexport type PoptipShapeAttributes = {\n /**\n * 是否展示 shape\n */\n visible: boolean;\n} & Partial<ISymbolGraphicAttribute>;\n"]}
|
package/dist/index.es.js
CHANGED
|
@@ -1494,7 +1494,7 @@ let Step$1 = class Step {
|
|
|
1494
1494
|
default:
|
|
1495
1495
|
if (this._t <= 0) this.context.lineTo(this._x, y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x, y, !1 !== this._lastDefined && !1 !== p.defined, p);else {
|
|
1496
1496
|
const x1 = this._x * (1 - this._t) + x * this._t;
|
|
1497
|
-
this.context.lineTo(x1, this._y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x1, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
1497
|
+
.5 === this._t ? this.context.lineTo(x1, this._y, !1 !== this._lastDefined, this.lastPoint) : this.context.lineTo(x1, this._y, !1 !== this._lastDefined && !1 !== p.defined, this.lastPoint), this.context.lineTo(x1, y, !1 !== this._lastDefined && !1 !== p.defined, p);
|
|
1498
1498
|
}
|
|
1499
1499
|
}
|
|
1500
1500
|
this._lastDefined = p.defined, this._x = x, this._y = y, this.lastPoint = p;
|
|
@@ -4177,7 +4177,7 @@ class Animate {
|
|
|
4177
4177
|
let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : Generator.GenAutoIncrementId();
|
|
4178
4178
|
let timeline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultTimeline;
|
|
4179
4179
|
let slience = arguments.length > 2 ? arguments[2] : undefined;
|
|
4180
|
-
this.id = id, this.timeline = timeline, this.status = AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
|
|
4180
|
+
this.id = id, this.timeline = timeline || defaultTimeline, this.status = AnimateStatus.INITIAL, this.tailAnimate = new SubAnimate(this), this.subAnimates = [this.tailAnimate], this.timeScale = 1, this.rawPosition = -1, this._startTime = 0, this._duringTime = 0, this.timeline.addAnimate(this), this.slience = slience;
|
|
4181
4181
|
}
|
|
4182
4182
|
setTimeline(timeline) {
|
|
4183
4183
|
timeline !== this.timeline && (this.timeline.removeAnimate(this, !1), timeline.addAnimate(this));
|
|
@@ -7887,7 +7887,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
7887
7887
|
this._draw(line, lineAttribute, !1, drawContext, params);
|
|
7888
7888
|
}
|
|
7889
7889
|
drawSegmentItem(context, cache, fill, stroke, fillOpacity, strokeOpacity, attribute, defaultAttribute, clipRange, clipRangeByDimension, offsetX, offsetY, line, fillCb, strokeCb) {
|
|
7890
|
-
var _a
|
|
7890
|
+
var _a;
|
|
7891
7891
|
if (!cache) return;
|
|
7892
7892
|
context.beginPath();
|
|
7893
7893
|
const z = null !== (_a = this.z) && void 0 !== _a ? _a : 0;
|
|
@@ -7900,27 +7900,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
7900
7900
|
x: originX = 0,
|
|
7901
7901
|
x: originY = 0
|
|
7902
7902
|
} = attribute;
|
|
7903
|
-
!1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke()));
|
|
7904
|
-
let {
|
|
7905
|
-
connectedType: connectedType,
|
|
7906
|
-
connectedX: connectedX,
|
|
7907
|
-
connectedY: connectedY,
|
|
7908
|
-
connectedStyle: connectedStyle
|
|
7909
|
-
} = attribute;
|
|
7910
|
-
if (isArray(defaultAttribute) ? (connectedType = null !== (_b = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _b ? _b : defaultAttribute[1].connectedType, connectedX = null !== (_c = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _c ? _c : defaultAttribute[1].connectedX, connectedY = null !== (_d = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _d ? _d : defaultAttribute[1].connectedY, connectedStyle = null !== (_e = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _e ? _e : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), "none" !== connectedType) {
|
|
7911
|
-
context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, cache, clipRange, clipRangeByDimension, {
|
|
7912
|
-
offsetX: offsetX,
|
|
7913
|
-
offsetY: offsetY,
|
|
7914
|
-
offsetZ: z,
|
|
7915
|
-
drawConnect: !0,
|
|
7916
|
-
mode: connectedType,
|
|
7917
|
-
zeroX: connectedX,
|
|
7918
|
-
zeroY: connectedY
|
|
7919
|
-
});
|
|
7920
|
-
const da = [];
|
|
7921
|
-
isArray(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute), !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, connectedStyle, originX - offsetX, originY - offsetY, da), context.stroke()));
|
|
7922
|
-
}
|
|
7923
|
-
return !1;
|
|
7903
|
+
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), !1 !== stroke && (strokeCb ? strokeCb(context, attribute, defaultAttribute) : strokeOpacity && (context.setStrokeStyle(line, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke())), !1;
|
|
7924
7904
|
}
|
|
7925
7905
|
drawLinearLineHighPerformance(line, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, lineAttribute, drawContext, params, fillCb, strokeCb) {
|
|
7926
7906
|
var _a;
|
|
@@ -7952,7 +7932,8 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
7952
7932
|
segments: segments,
|
|
7953
7933
|
points: points,
|
|
7954
7934
|
closePath: closePath,
|
|
7955
|
-
curveTension = lineAttribute.curveTension
|
|
7935
|
+
curveTension = lineAttribute.curveTension,
|
|
7936
|
+
connectedType = lineAttribute.connectedType
|
|
7956
7937
|
} = line.attribute;
|
|
7957
7938
|
if (!this.valid(line, lineAttribute, fillCb, strokeCb)) return;
|
|
7958
7939
|
let {
|
|
@@ -7964,6 +7945,9 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
7964
7945
|
clipRangeByDimension = lineAttribute.clipRangeByDimension
|
|
7965
7946
|
} = line.attribute;
|
|
7966
7947
|
if (1 === clipRange && !segments && !points.some(p => !1 === p.defined) && "linear" === curveType) return this.drawLinearLineHighPerformance(line, context, !!fill, !!stroke, fillOpacity, strokeOpacity, x, y, lineAttribute, drawContext, params, fillCb, strokeCb);
|
|
7948
|
+
function parsePoint(points, connectedType) {
|
|
7949
|
+
return "none" === connectedType ? points : points.filter(p => !1 !== p.defined);
|
|
7950
|
+
}
|
|
7967
7951
|
if (line.shouldUpdateShape()) {
|
|
7968
7952
|
const {
|
|
7969
7953
|
points: points,
|
|
@@ -7985,7 +7969,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
7985
7969
|
y: lastSeg.endY,
|
|
7986
7970
|
defined: lastSeg.curves[lastSeg.curves.length - 1].defined
|
|
7987
7971
|
} : index > 1 && (startPoint.x = lastSeg.endX, startPoint.y = lastSeg.endY, startPoint.defined = lastSeg.curves[lastSeg.curves.length - 1].defined);
|
|
7988
|
-
const data = calcLineCache(seg.points, curveType, {
|
|
7972
|
+
const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
|
|
7989
7973
|
startPoint: startPoint,
|
|
7990
7974
|
curveTension: curveTension
|
|
7991
7975
|
});
|
|
@@ -8004,7 +7988,7 @@ let DefaultCanvasLineRender = class extends BaseRender {
|
|
|
8004
7988
|
}
|
|
8005
7989
|
} else {
|
|
8006
7990
|
if (!points || !points.length) return line.cache = null, void line.clearUpdateShapeTag();
|
|
8007
|
-
line.cache = calcLineCache(_points, curveType, {
|
|
7991
|
+
line.cache = calcLineCache(parsePoint(_points, connectedType), curveType, {
|
|
8008
7992
|
curveTension: curveTension
|
|
8009
7993
|
});
|
|
8010
7994
|
}
|
|
@@ -8036,11 +8020,6 @@ DefaultCanvasLineRender = __decorate$E([injectable()], DefaultCanvasLineRender);
|
|
|
8036
8020
|
|
|
8037
8021
|
function drawAreaSegments(path, segPath, percent, params) {
|
|
8038
8022
|
var _a;
|
|
8039
|
-
const {
|
|
8040
|
-
drawConnect = !1,
|
|
8041
|
-
mode = "none"
|
|
8042
|
-
} = params || {};
|
|
8043
|
-
if (drawConnect && "none" === mode) return;
|
|
8044
8023
|
const {
|
|
8045
8024
|
top: top,
|
|
8046
8025
|
bottom: bottom
|
|
@@ -8050,34 +8029,11 @@ function drawAreaSegments(path, segPath, percent, params) {
|
|
|
8050
8029
|
const topList = [],
|
|
8051
8030
|
bottomList = [];
|
|
8052
8031
|
let lastDefined = !0;
|
|
8053
|
-
|
|
8054
|
-
|
|
8055
|
-
|
|
8056
|
-
defined0 = !0;
|
|
8057
|
-
const n = top.curves.length;
|
|
8058
|
-
top.curves.forEach((curve, i) => {
|
|
8059
|
-
const bototmCurve = bottom.curves[n - i - 1];
|
|
8060
|
-
let currentTopCurve = curve,
|
|
8061
|
-
currentBottomCurve = bototmCurve;
|
|
8062
|
-
if (curve.originP1 === curve.originP2) return lastCurve = curve, void (lastBottomCurve = bototmCurve);
|
|
8063
|
-
if (lastCurve && lastCurve.originP1 === lastCurve.originP2 && (currentTopCurve = lastCurve, currentBottomCurve = lastBottomCurve), curve.defined) defined0 || (topList.push(currentTopCurve), bottomList.push(currentBottomCurve), drawAreaConnectBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0, defined0 = !defined0);else {
|
|
8064
|
-
const {
|
|
8065
|
-
originP1: originP1,
|
|
8066
|
-
originP2: originP2
|
|
8067
|
-
} = curve;
|
|
8068
|
-
let validTopCurve, validBottomCurve;
|
|
8069
|
-
originP1 && !1 !== originP1.defined ? (validTopCurve = currentTopCurve, validBottomCurve = currentBottomCurve) : originP1 && !1 !== originP2.defined && (validTopCurve = curve, validBottomCurve = bototmCurve), defined0 ? (defined0 = !defined0, topList.push(validTopCurve || curve), bottomList.push(validBottomCurve || bototmCurve)) : validTopCurve && (defined0 = !defined0, topList.push(validTopCurve || curve), bottomList.push(validBottomCurve || bototmCurve), drawAreaConnectBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0);
|
|
8070
|
-
}
|
|
8071
|
-
lastCurve = curve;
|
|
8072
|
-
}), drawAreaConnectBlock(path, topList, bottomList, params);
|
|
8073
|
-
} else {
|
|
8074
|
-
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
8075
|
-
const topCurve = top.curves[i];
|
|
8076
|
-
lastDefined !== topCurve.defined ? (lastDefined ? (drawAreaBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (topList.push(topCurve), bottomList.push(bottom.curves[n - i - 1])), lastDefined = !lastDefined) : lastDefined && (topList.push(topCurve), bottomList.push(bottom.curves[n - i - 1]));
|
|
8077
|
-
}
|
|
8078
|
-
drawAreaBlock(path, topList, bottomList, params);
|
|
8032
|
+
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
8033
|
+
const topCurve = top.curves[i];
|
|
8034
|
+
lastDefined !== topCurve.defined ? (lastDefined ? (drawAreaBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (topList.push(topCurve), bottomList.push(bottom.curves[n - i - 1])), lastDefined = !lastDefined) : lastDefined && (topList.push(topCurve), bottomList.push(bottom.curves[n - i - 1]));
|
|
8079
8035
|
}
|
|
8080
|
-
return;
|
|
8036
|
+
return void drawAreaBlock(path, topList, bottomList, params);
|
|
8081
8037
|
}
|
|
8082
8038
|
if (percent <= 0) return;
|
|
8083
8039
|
let {
|
|
@@ -8095,51 +8051,17 @@ function drawAreaSegments(path, segPath, percent, params) {
|
|
|
8095
8051
|
lastDefined = !0;
|
|
8096
8052
|
const topList = [],
|
|
8097
8053
|
bottomList = [];
|
|
8098
|
-
let lastTopCurve,
|
|
8099
|
-
lastBottomCurve,
|
|
8100
|
-
defined0 = !0;
|
|
8101
8054
|
for (let i = 0, n = top.curves.length; i < n; i++) {
|
|
8102
8055
|
const topCurve = top.curves[i],
|
|
8103
8056
|
curCurveLength = topCurve.getLength(direction),
|
|
8104
8057
|
percent = (totalDrawLength - drawedLengthUntilLast) / curCurveLength;
|
|
8105
8058
|
if (percent < 0) break;
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
if (topCurve.originP1 === topCurve.originP2) {
|
|
8111
|
-
lastTopCurve = topCurve, lastBottomCurve = bototmCurve;
|
|
8112
|
-
continue;
|
|
8113
|
-
}
|
|
8114
|
-
if (lastTopCurve && lastTopCurve.originP1 === lastTopCurve.originP2 && (currentTopCurve = lastTopCurve, currentBottomCurve = lastBottomCurve), topCurve.defined) defined0 || (topList.push(currentTopCurve), bottomList.push(currentBottomCurve), drawAreaConnectBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0, defined0 = !defined0);else {
|
|
8115
|
-
const {
|
|
8116
|
-
originP1: originP1,
|
|
8117
|
-
originP2: originP2
|
|
8118
|
-
} = topCurve;
|
|
8119
|
-
let validTopCurve, validBottomCurve;
|
|
8120
|
-
originP1 && !1 !== originP1.defined ? (validTopCurve = currentTopCurve, validBottomCurve = currentBottomCurve) : originP1 && !1 !== originP2.defined && (validTopCurve = topCurve, validBottomCurve = bototmCurve), defined0 ? (defined0 = !defined0, topList.push(validTopCurve || topCurve), bottomList.push(validBottomCurve || bototmCurve)) : validTopCurve && (defined0 = !defined0, topList.push(validTopCurve || topCurve), bottomList.push(validBottomCurve || bototmCurve), drawAreaConnectBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0);
|
|
8121
|
-
}
|
|
8122
|
-
lastTopCurve = topCurve;
|
|
8123
|
-
} else {
|
|
8124
|
-
let tc = null,
|
|
8125
|
-
bc = null;
|
|
8126
|
-
lastDefined !== topCurve.defined ? (lastDefined ? (drawAreaBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (tc = topCurve, bc = bottom.curves[n - i - 1]), lastDefined = !lastDefined) : lastDefined && (tc = topCurve, bc = bottom.curves[n - i - 1]), tc && bc && (percent < 1 && (tc = tc.p2 && tc.p3 ? divideCubic(tc, percent)[0] : divideLinear(tc, percent)[0], bc = bc.p2 && bc.p3 ? divideCubic(bc, 1 - percent)[1] : divideLinear(bc, 1 - percent)[1]), tc.defined = lastDefined, bc.defined = lastDefined, topList.push(tc), bottomList.push(bc)), tc = null, bc = null;
|
|
8127
|
-
}
|
|
8059
|
+
drawedLengthUntilLast += curCurveLength;
|
|
8060
|
+
let tc = null,
|
|
8061
|
+
bc = null;
|
|
8062
|
+
lastDefined !== topCurve.defined ? (lastDefined ? (drawAreaBlock(path, topList, bottomList, params), topList.length = 0, bottomList.length = 0) : (tc = topCurve, bc = bottom.curves[n - i - 1]), lastDefined = !lastDefined) : lastDefined && (tc = topCurve, bc = bottom.curves[n - i - 1]), tc && bc && (percent < 1 && (tc = tc.p2 && tc.p3 ? divideCubic(tc, percent)[0] : divideLinear(tc, percent)[0], bc = bc.p2 && bc.p3 ? divideCubic(bc, 1 - percent)[1] : divideLinear(bc, 1 - percent)[1]), tc.defined = lastDefined, bc.defined = lastDefined, topList.push(tc), bottomList.push(bc)), tc = null, bc = null;
|
|
8128
8063
|
}
|
|
8129
|
-
|
|
8130
|
-
}
|
|
8131
|
-
function drawAreaConnectBlock(path, topList, bottomList, params) {
|
|
8132
|
-
if (topList.length < 2) return;
|
|
8133
|
-
const {
|
|
8134
|
-
offsetX = 0,
|
|
8135
|
-
offsetY = 0,
|
|
8136
|
-
offsetZ = 0,
|
|
8137
|
-
mode: mode
|
|
8138
|
-
} = params || {};
|
|
8139
|
-
let curve = topList[0];
|
|
8140
|
-
path.moveTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), curve = topList[topList.length - 1];
|
|
8141
|
-
let end = curve.p3 || curve.p1;
|
|
8142
|
-
path.lineTo(end.x + offsetX, end.y + offsetY, offsetZ), curve = bottomList[bottomList.length - 1], path.lineTo(curve.p0.x + offsetX, curve.p0.y + offsetY, offsetZ), curve = bottomList[0], end = curve.p3 || curve.p1, path.lineTo(end.x + offsetX, end.y + offsetY, offsetZ), path.closePath();
|
|
8064
|
+
drawAreaBlock(path, topList, bottomList, params);
|
|
8143
8065
|
}
|
|
8144
8066
|
function drawAreaBlock(path, topList, bottomList, params) {
|
|
8145
8067
|
const {
|
|
@@ -8240,7 +8162,8 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
8240
8162
|
fillOpacity = areaAttribute.fillOpacity,
|
|
8241
8163
|
z = areaAttribute.z,
|
|
8242
8164
|
strokeOpacity = areaAttribute.strokeOpacity,
|
|
8243
|
-
curveTension = areaAttribute.curveTension
|
|
8165
|
+
curveTension = areaAttribute.curveTension,
|
|
8166
|
+
connectedType = areaAttribute.connectedType
|
|
8244
8167
|
} = area.attribute,
|
|
8245
8168
|
data = this.valid(area, areaAttribute, fillCb, strokeCb);
|
|
8246
8169
|
if (!data) return;
|
|
@@ -8257,6 +8180,9 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
8257
8180
|
let {
|
|
8258
8181
|
curveType = areaAttribute.curveType
|
|
8259
8182
|
} = area.attribute;
|
|
8183
|
+
function parsePoint(points, connectedType) {
|
|
8184
|
+
return "connect" !== connectedType ? points : points.filter(p => !1 !== p.defined);
|
|
8185
|
+
}
|
|
8260
8186
|
if (closePath && "linear" === curveType && (curveType = "linearClosed"), 1 === clipRange && !segments && !points.some(p => !1 === p.defined) && "linear" === curveType) return this.drawLinearAreaHighPerformance(area, context, !!fill, doStroke, fillOpacity, strokeOpacity, x, y, areaAttribute, drawContext, params, fillCb, strokeCb);
|
|
8261
8187
|
if (area.shouldUpdateShape()) {
|
|
8262
8188
|
if (segments && segments.length) {
|
|
@@ -8270,7 +8196,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
8270
8196
|
x: lastTopSeg.endX,
|
|
8271
8197
|
y: lastTopSeg.endY
|
|
8272
8198
|
} : index > 1 && (startPoint.x = lastTopSeg.endX, startPoint.y = lastTopSeg.endY);
|
|
8273
|
-
const data = calcLineCache(seg.points, curveType, {
|
|
8199
|
+
const data = calcLineCache(parsePoint(seg.points, connectedType), curveType, {
|
|
8274
8200
|
startPoint: startPoint,
|
|
8275
8201
|
curveTension: curveTension
|
|
8276
8202
|
});
|
|
@@ -8293,7 +8219,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
8293
8219
|
y: null !== (_d = endPoint.y1) && void 0 !== _d ? _d : endPoint.y
|
|
8294
8220
|
});
|
|
8295
8221
|
}
|
|
8296
|
-
bottomPoints.length > 1 && (lastBottomSeg = calcLineCache(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType, {
|
|
8222
|
+
bottomPoints.length > 1 && (lastBottomSeg = calcLineCache(parsePoint(bottomPoints, connectedType), "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType, {
|
|
8297
8223
|
curveTension: curveTension
|
|
8298
8224
|
}), bottomCaches.unshift(lastBottomSeg));
|
|
8299
8225
|
}
|
|
@@ -8304,11 +8230,11 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
8304
8230
|
} else {
|
|
8305
8231
|
if (!points || !points.length) return area.cacheArea = null, void area.clearUpdateShapeTag();
|
|
8306
8232
|
{
|
|
8307
|
-
const topPoints = points,
|
|
8233
|
+
const topPoints = parsePoint(points, connectedType),
|
|
8308
8234
|
bottomPoints = [];
|
|
8309
|
-
for (let i =
|
|
8310
|
-
x: null !== (_e = points[i].x1) && void 0 !== _e ? _e :
|
|
8311
|
-
y: null !== (_f = points[i].y1) && void 0 !== _f ? _f :
|
|
8235
|
+
for (let i = topPoints.length - 1; i >= 0; i--) bottomPoints.push({
|
|
8236
|
+
x: null !== (_e = points[i].x1) && void 0 !== _e ? _e : topPoints[i].x,
|
|
8237
|
+
y: null !== (_f = points[i].y1) && void 0 !== _f ? _f : topPoints[i].y
|
|
8312
8238
|
});
|
|
8313
8239
|
const topCache = calcLineCache(topPoints, curveType, {
|
|
8314
8240
|
curveTension: curveTension
|
|
@@ -8350,20 +8276,10 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
8350
8276
|
this._draw(area, areaAttribute, !1, drawContext, params);
|
|
8351
8277
|
}
|
|
8352
8278
|
drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
|
|
8353
|
-
|
|
8354
|
-
return ret = ret || this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, !1, fillCb, strokeCb), ret = ret || this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, !0, fillCb, strokeCb), ret;
|
|
8279
|
+
return this._drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb);
|
|
8355
8280
|
}
|
|
8356
|
-
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext,
|
|
8357
|
-
var _a, _b, _c, _d;
|
|
8281
|
+
_drawSegmentItem(context, cache, fill, fillOpacity, stroke, strokeOpacity, attribute, defaultAttribute, clipRange, offsetX, offsetY, offsetZ, area, drawContext, fillCb, strokeCb) {
|
|
8358
8282
|
if (!(cache && cache.top && cache.bottom && cache.top.curves && cache.top.curves.length && cache.bottom.curves && cache.bottom.curves.length)) return;
|
|
8359
|
-
let {
|
|
8360
|
-
connectedType: connectedType,
|
|
8361
|
-
connectedX: connectedX,
|
|
8362
|
-
connectedY: connectedY,
|
|
8363
|
-
connectedStyle: connectedStyle
|
|
8364
|
-
} = attribute;
|
|
8365
|
-
const da = [];
|
|
8366
|
-
if (connect && (isArray(defaultAttribute) ? (connectedType = null !== (_a = null != connectedType ? connectedType : defaultAttribute[0].connectedType) && void 0 !== _a ? _a : defaultAttribute[1].connectedType, connectedX = null !== (_b = null != connectedX ? connectedX : defaultAttribute[0].connectedX) && void 0 !== _b ? _b : defaultAttribute[1].connectedX, connectedY = null !== (_c = null != connectedY ? connectedY : defaultAttribute[0].connectedY) && void 0 !== _c ? _c : defaultAttribute[1].connectedY, connectedStyle = null !== (_d = null != connectedStyle ? connectedStyle : defaultAttribute[0].connectedStyle) && void 0 !== _d ? _d : defaultAttribute[1].connectedStyle) : (connectedType = null != connectedType ? connectedType : defaultAttribute.connectedType, connectedX = null != connectedX ? connectedX : defaultAttribute.connectedX, connectedY = null != connectedY ? connectedY : defaultAttribute.connectedY, connectedStyle = null != connectedStyle ? connectedStyle : defaultAttribute.connectedStyle), "connect" !== connectedType && "zero" !== connectedType && (connectedType = "none"), isArray(defaultAttribute) ? defaultAttribute.forEach(i => da.push(i)) : da.push(defaultAttribute), da.push(attribute)), connect && "none" === connectedType) return !1;
|
|
8367
8283
|
context.beginPath();
|
|
8368
8284
|
const {
|
|
8369
8285
|
points: points,
|
|
@@ -8382,11 +8298,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
8382
8298
|
offsetX: offsetX,
|
|
8383
8299
|
offsetY: offsetY,
|
|
8384
8300
|
offsetZ: offsetZ,
|
|
8385
|
-
direction: direction
|
|
8386
|
-
drawConnect: connect,
|
|
8387
|
-
mode: connectedType,
|
|
8388
|
-
zeroX: connectedX,
|
|
8389
|
-
zeroY: connectedY
|
|
8301
|
+
direction: direction
|
|
8390
8302
|
}), this.beforeRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
|
|
8391
8303
|
attribute: attribute
|
|
8392
8304
|
}), context.setShadowBlendStyle && context.setShadowBlendStyle(area, attribute, defaultAttribute);
|
|
@@ -8394,7 +8306,7 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
8394
8306
|
x: originX = 0,
|
|
8395
8307
|
x: originY = 0
|
|
8396
8308
|
} = attribute;
|
|
8397
|
-
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area,
|
|
8309
|
+
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
|
|
8398
8310
|
attribute: attribute
|
|
8399
8311
|
}), (() => {
|
|
8400
8312
|
if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
|
|
@@ -8404,12 +8316,8 @@ let DefaultCanvasAreaRender = class extends BaseRender {
|
|
|
8404
8316
|
isArray(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? "x" : "y", {
|
|
8405
8317
|
offsetX: offsetX,
|
|
8406
8318
|
offsetY: offsetY,
|
|
8407
|
-
offsetZ: offsetZ
|
|
8408
|
-
|
|
8409
|
-
mode: connectedType,
|
|
8410
|
-
zeroX: connectedX,
|
|
8411
|
-
zeroY: connectedY
|
|
8412
|
-
})), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
|
|
8319
|
+
offsetZ: offsetZ
|
|
8320
|
+
})), context.setStrokeStyle(area, attribute, originX - offsetX, originY - offsetY, defaultAttribute), context.stroke();
|
|
8413
8321
|
}
|
|
8414
8322
|
})(), !1;
|
|
8415
8323
|
}
|
|
@@ -10846,7 +10754,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
10846
10754
|
} = attribute,
|
|
10847
10755
|
b = aabbBounds;
|
|
10848
10756
|
return points.forEach(p => {
|
|
10849
|
-
!1 === p.defined && "
|
|
10757
|
+
!1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
|
|
10850
10758
|
}), b;
|
|
10851
10759
|
}
|
|
10852
10760
|
updateLineAABBBoundsBySegments(attribute, lineTheme, aabbBounds, graphic) {
|
|
@@ -10857,7 +10765,7 @@ let Line$1 = class Line extends Graphic {
|
|
|
10857
10765
|
b = aabbBounds;
|
|
10858
10766
|
return segments.forEach(s => {
|
|
10859
10767
|
s.points.forEach(p => {
|
|
10860
|
-
!1 === p.defined && "
|
|
10768
|
+
!1 === p.defined && "connect" !== connectedType || b.add(p.x, p.y);
|
|
10861
10769
|
});
|
|
10862
10770
|
}), b;
|
|
10863
10771
|
}
|
|
@@ -19956,6 +19864,10 @@ class LabelBase extends AbstractComponent {
|
|
|
19956
19864
|
if (isFunction(dataFilter)) {
|
|
19957
19865
|
data = dataFilter(data);
|
|
19958
19866
|
}
|
|
19867
|
+
if (data && data.length) {
|
|
19868
|
+
const seenIds = new Set();
|
|
19869
|
+
data = data.filter(d => !seenIds.has(d.id) && seenIds.add(d.id));
|
|
19870
|
+
}
|
|
19959
19871
|
let labels = this._initText(data);
|
|
19960
19872
|
if (isFunction(customLayoutFunc)) {
|
|
19961
19873
|
labels = customLayoutFunc(data, labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null);
|
|
@@ -24074,34 +23986,23 @@ class MarkArea extends Marker {
|
|
|
24074
23986
|
}
|
|
24075
23987
|
getPointAttrByPosition(position) {
|
|
24076
23988
|
const { x1, x2, y1, y2 } = this._area.AABBBounds;
|
|
23989
|
+
const result = {
|
|
23990
|
+
x: (x1 + x2) / 2,
|
|
23991
|
+
y: (y1 + y2) / 2
|
|
23992
|
+
};
|
|
24077
23993
|
if (position.includes('left') || position.includes('Left')) {
|
|
24078
|
-
|
|
24079
|
-
x: x1,
|
|
24080
|
-
y: (y1 + y2) / 2
|
|
24081
|
-
};
|
|
23994
|
+
result.x = x1;
|
|
24082
23995
|
}
|
|
24083
23996
|
if (position.includes('right') || position.includes('Right')) {
|
|
24084
|
-
|
|
24085
|
-
x: x2,
|
|
24086
|
-
y: (y1 + y2) / 2
|
|
24087
|
-
};
|
|
23997
|
+
result.x = x2;
|
|
24088
23998
|
}
|
|
24089
23999
|
if (position.includes('top') || position.includes('Top')) {
|
|
24090
|
-
|
|
24091
|
-
x: (x1 + x2) / 2,
|
|
24092
|
-
y: y1
|
|
24093
|
-
};
|
|
24000
|
+
result.y = y1;
|
|
24094
24001
|
}
|
|
24095
24002
|
if (position.includes('bottom') || position.includes('Bottom')) {
|
|
24096
|
-
|
|
24097
|
-
x: (x1 + x2) / 2,
|
|
24098
|
-
y: y2
|
|
24099
|
-
};
|
|
24003
|
+
result.y = y2;
|
|
24100
24004
|
}
|
|
24101
|
-
return
|
|
24102
|
-
x: (x1 + x2) / 2,
|
|
24103
|
-
y: (y1 + y2) / 2
|
|
24104
|
-
};
|
|
24005
|
+
return result;
|
|
24105
24006
|
}
|
|
24106
24007
|
setLabelPos() {
|
|
24107
24008
|
var _a;
|
|
@@ -30360,6 +30261,6 @@ Switch.defaultAttributes = {
|
|
|
30360
30261
|
spaceBetweenTextAndCircle: 6
|
|
30361
30262
|
};
|
|
30362
30263
|
|
|
30363
|
-
const version = "0.21.
|
|
30264
|
+
const version = "0.21.10";
|
|
30364
30265
|
|
|
30365
30266
|
export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PolygonSectorCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, Switch, SymbolLabel, Tag, Timeline, Title, Tooltip, TopZIndex, VTag, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, cartesianTicks, clampRadian, computeOffsetForlimit, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, fuzzyEqualNumber, getAxisBreakSymbolAttrs, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, hasOverlap, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, limitShapeInBounds, linearDiscreteTicks, loadPoptip, loadScrollbar, measureTextSize, normalize, polarAngleAxisDiscreteTicks, polarTicks, reactAttributeTransform, registerArcDataLabel, registerLineDataLabel, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerRectDataLabel, registerSymbolDataLabel, removeRepeatPoint, richTextAttributeTransform, scale, scrollbarModule, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, textIntersect, ticks, traverseGroup, version };
|