@visactor/vrender-components 0.18.0-alpha.4 → 0.18.0
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/grid/base.js +11 -2
- package/cjs/axis/grid/base.js.map +1 -1
- package/cjs/axis/line.js +1 -1
- package/cjs/axis/line.js.map +1 -1
- package/cjs/axis/overlap/auto-limit.js +6 -4
- package/cjs/axis/overlap/auto-limit.js.map +1 -1
- package/cjs/core/base.d.ts +1 -1
- package/cjs/core/base.js.map +1 -1
- package/cjs/data-zoom/data-zoom.d.ts +1 -0
- package/cjs/data-zoom/data-zoom.js +11 -7
- package/cjs/data-zoom/data-zoom.js.map +1 -1
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +13 -13
- package/cjs/index.js.map +1 -1
- package/cjs/label/arc.js +2 -5
- package/cjs/label/arc.js.map +1 -1
- package/cjs/label/area.js +2 -7
- package/cjs/label/area.js.map +1 -1
- package/cjs/label/base.js +1 -1
- package/cjs/label/base.js.map +1 -1
- package/cjs/label/dataLabel.js +2 -2
- package/cjs/label/dataLabel.js.map +1 -1
- package/cjs/label/line-data.js +2 -7
- package/cjs/label/line-data.js.map +1 -1
- package/cjs/label/line.js +2 -7
- package/cjs/label/line.js.map +1 -1
- package/cjs/label/overlap/scaler.d.ts +15 -4
- package/cjs/label/overlap/scaler.js +18 -13
- package/cjs/label/overlap/scaler.js.map +1 -1
- package/cjs/label/polygon.js +2 -7
- package/cjs/label/polygon.js.map +1 -1
- package/cjs/label/rect.js +2 -7
- package/cjs/label/rect.js.map +1 -1
- package/cjs/label/symbol.js +2 -7
- package/cjs/label/symbol.js.map +1 -1
- package/cjs/label/type.d.ts +6 -0
- package/cjs/label/type.js.map +1 -1
- package/cjs/legend/discrete/discrete.js +5 -4
- package/cjs/legend/discrete/discrete.js.map +1 -1
- package/cjs/marker/base.d.ts +1 -1
- package/cjs/marker/base.js.map +1 -1
- package/cjs/marker/point.js.map +1 -1
- package/cjs/scrollbar/scrollbar.js +3 -9
- package/cjs/scrollbar/scrollbar.js.map +1 -1
- package/cjs/tooltip/tooltip.js.map +1 -1
- package/es/axis/grid/base.js +11 -2
- package/es/axis/grid/base.js.map +1 -1
- package/es/axis/line.js +1 -1
- package/es/axis/line.js.map +1 -1
- package/es/axis/overlap/auto-limit.js +6 -4
- package/es/axis/overlap/auto-limit.js.map +1 -1
- package/es/core/base.d.ts +1 -1
- package/es/core/base.js.map +1 -1
- package/es/data-zoom/data-zoom.d.ts +1 -0
- package/es/data-zoom/data-zoom.js +11 -7
- package/es/data-zoom/data-zoom.js.map +1 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +3 -1
- package/es/index.js.map +1 -1
- package/es/label/arc.js +2 -5
- package/es/label/arc.js.map +1 -1
- package/es/label/area.js +2 -7
- package/es/label/area.js.map +1 -1
- package/es/label/base.js +1 -1
- package/es/label/base.js.map +1 -1
- package/es/label/dataLabel.js +2 -2
- package/es/label/dataLabel.js.map +1 -1
- package/es/label/line-data.js +2 -7
- package/es/label/line-data.js.map +1 -1
- package/es/label/line.js +2 -7
- package/es/label/line.js.map +1 -1
- package/es/label/overlap/scaler.d.ts +15 -4
- package/es/label/overlap/scaler.js +16 -11
- package/es/label/overlap/scaler.js.map +1 -1
- package/es/label/polygon.js +2 -7
- package/es/label/polygon.js.map +1 -1
- package/es/label/rect.js +2 -7
- package/es/label/rect.js.map +1 -1
- package/es/label/symbol.js +2 -7
- package/es/label/symbol.js.map +1 -1
- package/es/label/type.d.ts +6 -0
- package/es/label/type.js.map +1 -1
- package/es/legend/discrete/discrete.js +5 -4
- package/es/legend/discrete/discrete.js.map +1 -1
- package/es/marker/base.d.ts +1 -1
- package/es/marker/base.js.map +1 -1
- package/es/marker/point.js.map +1 -1
- package/es/scrollbar/scrollbar.js +3 -9
- package/es/scrollbar/scrollbar.js.map +1 -1
- package/es/tooltip/tooltip.js.map +1 -1
- package/package.json +6 -6
package/cjs/label/symbol.js
CHANGED
|
@@ -18,14 +18,9 @@ class SymbolLabel extends base_1.LabelBase {
|
|
|
18
18
|
|
|
19
19
|
exports.SymbolLabel = SymbolLabel, SymbolLabel.defaultAttributes = {
|
|
20
20
|
textStyle: {
|
|
21
|
-
|
|
22
|
-
fill: "#000",
|
|
23
|
-
textAlign: "center",
|
|
24
|
-
textBaseline: "middle",
|
|
25
|
-
boundsPadding: [ -1, 0, -1, 0 ]
|
|
21
|
+
fill: "#000"
|
|
26
22
|
},
|
|
27
23
|
position: "top",
|
|
28
|
-
offset: 5
|
|
29
|
-
pickable: !1
|
|
24
|
+
offset: 5
|
|
30
25
|
};
|
|
31
26
|
//# sourceMappingURL=symbol.js.map
|
package/cjs/label/symbol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/label/symbol.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAEzC,iCAAmC;AACnC,iCAAuC;AAGvC,MAAa,WAAY,SAAQ,gBAA2B;
|
|
1
|
+
{"version":3,"sources":["../src/label/symbol.ts"],"names":[],"mappings":";;;AACA,6CAAyC;AAEzC,iCAAmC;AACnC,iCAAuC;AAGvC,MAAa,WAAY,SAAQ,gBAA2B;IAW1D,YAAY,UAA4B,EAAE,OAA0B;QAClE,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,WAAW,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QAXlG,SAAI,GAAG,cAAc,CAAC;IAYtB,CAAC;IAES,QAAQ,CAAC,UAAuB,EAAE,aAA0B,EAAE,QAAQ,GAAG,KAAK,EAAE,MAAM,GAAG,CAAC;QAClG,OAAO,IAAA,oBAAa,EAAC,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACpE,CAAC;;AAjBH,kCAkBC;AAfQ,6BAAiB,GAA8B;IACpD,SAAS,EAAE;QACT,IAAI,EAAE,MAAM;KACb;IACD,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,CAAC;CACV,CAAC","file":"symbol.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport { merge } from '@visactor/vutils';\nimport type { SymbolLabelAttrs } from './type';\nimport { LabelBase } from './base';\nimport { labelingPoint } from './util';\nimport type { ComponentOptions } from '../interface';\n\nexport class SymbolLabel extends LabelBase<SymbolLabelAttrs> {\n name = 'symbol-label';\n\n static defaultAttributes: Partial<SymbolLabelAttrs> = {\n textStyle: {\n fill: '#000'\n },\n position: 'top',\n offset: 5\n };\n\n constructor(attributes: SymbolLabelAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, SymbolLabel.defaultAttributes, attributes));\n }\n\n protected labeling(textBounds: IBoundsLike, graphicBounds: IBoundsLike, position = 'top', offset = 0) {\n return labelingPoint(textBounds, graphicBounds, position, offset);\n }\n}\n"]}
|
package/cjs/label/type.d.ts
CHANGED
|
@@ -149,6 +149,12 @@ export interface DataLabelAttrs extends IGroupGraphicAttribute {
|
|
|
149
149
|
size: {
|
|
150
150
|
width: number;
|
|
151
151
|
height: number;
|
|
152
|
+
padding?: {
|
|
153
|
+
top?: number;
|
|
154
|
+
left?: number;
|
|
155
|
+
right?: number;
|
|
156
|
+
bottom?: number;
|
|
157
|
+
};
|
|
152
158
|
};
|
|
153
159
|
}
|
|
154
160
|
export type Functional<T> = T | ((data: any) => T);
|
package/cjs/label/type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/label/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n EasingType,\n IGraphic,\n IGroupGraphicAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n IText,\n TextAlignType,\n TextBaselineType,\n ILineGraphicAttribute,\n IRichTextCharacter,\n IRichText,\n ILine\n} from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\n\nexport type LabelItemStateStyle<T> = {\n hover?: T;\n hover_reverse?: T;\n selected?: T;\n selected_reverse?: T;\n [key: string]: T;\n};\n\nexport type LabelItem = {\n // 用于动画\n id?: string;\n // 原始数据\n data?: any;\n [key: string]: any;\n // 文本类型:text, rich, html (区分于图元类型)\n textType?: string;\n /**\n * 文本内容,如果需要进行换行,则使用数组形式,如 ['abc', '123']\n * 支持富文本内容, 如textConfig, html\n */\n text?: string | string[] | number | number[] | IRichTextCharacter[];\n /**\n * 兼容ITextGraphicAttribute与IRichTextGraphicAttribute的textAlign属性\n */\n textAlign?: 'left' | 'right' | 'center' | 'start' | 'end';\n textBaseline?: 'top' | 'middle' | 'bottom' | 'alphabetic';\n} & (\n | Omit<Partial<ITextGraphicAttribute>, 'textAlign' | 'textBaseline'>\n | Omit<Partial<IRichTextGraphicAttribute>, 'textAlign' | 'textBaseline'>\n);\n\nexport interface BaseLabelAttrs extends IGroupGraphicAttribute {\n type: string;\n /**\n * 图元 group 名称\n */\n baseMarkGroupName: string;\n /**\n * @hack not recommend to use\n * @returns\n */\n getBaseMarks?: () => IGraphic[];\n /**\n * 是否开启选中交互\n * @default false\n */\n select?: boolean;\n /**\n * 是否开启 hover 交互\n * @default false\n */\n hover?: boolean;\n /**\n * 标签数据\n */\n data: LabelItem[];\n\n /** 文本样式,优先级低于 data */\n textStyle?: Partial<ITextGraphicAttribute>;\n\n /** 文本交互样式 */\n state?: LabelItemStateStyle<ITextGraphicAttribute>;\n\n /** 连接线样式 */\n line?: ILabelLineSpec;\n\n /** 连线的交互样式 */\n labelLineState?: LabelItemStateStyle<ILineGraphicAttribute>;\n\n syncState?: boolean;\n\n /** 标签默认位置 */\n position?: Functional<string>;\n\n /** 偏移量 */\n offset?: number;\n\n /** 是否开启防重叠\n * @default true\n */\n overlap?: OverlapAttrs | boolean;\n\n /** 智能反色 */\n smartInvert?: SmartInvertAttrs | boolean;\n\n /** 动画配置 */\n animation?: ILabelAnimation | boolean;\n animationEnter?: ILabelUpdateAnimation;\n animationUpdate?: ILabelUpdateAnimation | ILabelUpdateChannelAnimation[];\n animationExit?: ILabelExitAnimation;\n\n // 排序 or 删减\n dataFilter?: (data: LabelItem[]) => LabelItem[];\n\n /** 自定义布局函数\n * @description 当配置了 customLayoutFunc 后,默认布局逻辑将不再生效。(position/offset不生效)\n */\n customLayoutFunc?: (\n item: LabelItem[],\n labels: (IText | IRichText)[],\n getRelatedGraphic: (data: LabelItem) => IGraphic,\n getRelatedPoint?: (data: LabelItem) => IPointLike\n ) => (IText | IRichText)[];\n\n /** 自定义标签躲避函数\n * @description 当配置了 customOverlapFunc 后,会根据 position 和 offset 进行初始布局。配置的防重叠逻辑(overlap)不生效。\n */\n customOverlapFunc?: (\n label: (IText | IRichText)[],\n getRelatedGraphic: (data: LabelItem) => IGraphic,\n getRelatedPoint?: (data: LabelItem) => IPointLike\n ) => (IText | IRichText)[];\n /**\n * 关闭交互效果\n * @default false\n */\n disableTriggerEvent?: boolean;\n /** 唯一标志符 */\n id?: string;\n}\n\nexport interface OverlapAttrs {\n /**\n * 防重叠的区域大小\n */\n size?: { width: number; height: number };\n\n /**\n * 发生重叠后,是否隐藏标签\n * @default true\n */\n hideOnHit?: boolean;\n\n /**\n * 是否约束标签在指定 size 的范围内。开启后若标签被区域裁剪,会向内收缩。\n * @default true\n */\n clampForce?: boolean;\n\n /**\n * 是否躲避基础图元\n * @default false\n */\n avoidBaseMark?: boolean;\n\n /**\n * 躲避指定图元\n * @default []\n */\n avoidMarks?: string[] | IGraphic[];\n\n /**\n * 发生重叠后的躲避策略\n */\n strategy?: Strategy[];\n\n /**\n * 文字在防重叠计算中预留的边距。\n * @default 0\n */\n overlapPadding?: number;\n}\n\nexport interface SmartInvertAttrs {\n /**\n * 对比度度量\n * 'WCAG' | 'lightness'\n * 默认使用'WCAG'\n */\n mode?: string;\n /**\n * 文本类型\n * 包含普通文本和大文本,对应不同的对比度标准,label默认为普通文本\n * 'normalText' | 'largeText'\n * @default 'normalText'\n */\n textType?: string;\n /**\n * 自定义对比度阈值\n */\n contrastRatiosThreshold?: number;\n /**\n * 自定义备选label颜色\n */\n alternativeColors?: string | string[];\n /**\n * fillStrategy四种策略:\n * - base(baseMark色),\n * - invertBase(执行智能反色),\n * - similarBase(智能反色的补色),\n * - null(不执行智能反色,保持fill设置的颜色)\n * @default 'invertBase'\n */\n fillStrategy?: 'base' | 'invertBase' | 'similarBase' | 'null';\n /**\n * strokeStrategy的四种策略:\n * - base(baseMark色),\n * - invertBase(执行智能反色),\n * - similarBase(智能反色的补色),\n * - null(不执行智能反色,保持stroke设置的颜色)\n * @default 'base'\n */\n strokeStrategy?: 'base' | 'invertBase' | 'similarBase' | 'null';\n /**\n * 前景色与亮色具有对比度时,similarSeries使用该色\n * @default '#ffffff'\n */\n brightColor?: string;\n /**\n * 前景色与暗色具有对比度时,similarSeries使用该色\n * @default '#000000'\n */\n darkColor?: string;\n /**\n * label超出mark范围,也以mark作为背景色进行反色\n */\n outsideEnable?: boolean;\n}\n\nexport type PositionStrategy = {\n /**\n * 可选位置策略。\n * 若默认位置没有足够的空间放置标签,则考虑 position 内的备选位置。\n */\n type: 'position';\n position?: Functional<LabelPosition[]>;\n};\n\nexport type BoundStrategy = {\n /**\n * 标签配置在图形内部时使用。\n * 当图形大小不足以放下标签,则考虑 position 内的备选位置。\n */\n type: 'bound';\n position?: Functional<LabelPosition[]>;\n};\n\nexport type MoveYStrategy = {\n /**\n * 可选位置策略。\n * 若默认位置没有足够的空间放置标签,则根据 offset 在Y方向上寻找位置。\n */\n type: 'moveY';\n /**\n * Y方向上的尝试的位置偏移量\n */\n offset: Functional<number[]>;\n};\n\nexport type MoveXStrategy = {\n /**\n * 可选位置策略。\n * 若默认位置没有足够的空间放置标签,则根据 offset 在X方向上寻找位置。\n */\n type: 'moveX';\n /**\n * X方向上的尝试的位置偏移量\n */\n offset: Functional<number[]>;\n};\n\nexport type Strategy = PositionStrategy | BoundStrategy | MoveYStrategy | MoveXStrategy;\n\nexport type LabelPosition = SymbolLabelAttrs['position'] | RectLabelAttrs['position'];\n\nexport interface SymbolLabelAttrs extends BaseLabelAttrs {\n type: 'symbol';\n\n /**\n * 标签位置\n * @default 'top'\n */\n position?: Functional<\n 'top' | 'bottom' | 'left' | 'right' | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center'\n >;\n}\n\nexport interface RectLabelAttrs extends BaseLabelAttrs {\n type: 'rect';\n /**\n * 标签位置\n * @default 'top'\n */\n position?: Functional<\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'inside'\n | 'inside-top'\n | 'inside-bottom'\n | 'inside-right'\n | 'inside-left'\n | 'top-right'\n | 'top-left'\n | 'bottom-right'\n | 'bottom-left'\n >;\n}\n\nexport interface LineLabelAttrs extends BaseLabelAttrs {\n type: 'line';\n /**\n * 标签位置\n * @default 'end'\n */\n position?: Functional<'start' | 'end'>;\n}\n\nexport interface AreaLabelAttrs extends BaseLabelAttrs {\n type: 'area';\n /**\n * 标签位置\n * @default 'end'\n */\n position?: Functional<'start' | 'end'>;\n}\n\nexport interface LineDataLabelAttrs extends BaseLabelAttrs {\n type: 'line-data';\n\n /**\n * 标签位置\n * @default 'top'\n */\n position?: Functional<\n 'top' | 'bottom' | 'left' | 'right' | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center'\n >;\n}\n\nexport interface PolygonLabelAttrs extends BaseLabelAttrs {\n type: 'polygon';\n /**\n * 标签位置\n * @default 'center'\n */\n position?: Functional<'center'>;\n}\n\nexport interface ArcLabelAttrs extends BaseLabelAttrs {\n type: 'arc';\n\n /**\n * 图元 group 名称\n */\n baseMarkGroupName: string;\n\n /**\n * 标签位置\n * @default 'outside'\n */\n position?: Functional<'inside' | 'outside' | 'inside-inner' | 'inside-outer'>;\n\n // 画布宽度\n width?: number;\n // 画布高度\n height?: number;\n\n /**\n * 是否允许标签重叠\n * @default false\n */\n coverEnable?: boolean;\n /**\n * 是否允许标签旋转\n * @default true\n */\n rotate?: boolean;\n\n /**\n * 文字与引导线间隔宽度\n * @default 5\n */\n spaceWidth?: number;\n /**\n * 标签旋转角度\n */\n angle?: number;\n /**\n * 标签旋转角度的偏移角度\n */\n offsetAngle?: number;\n /**\n * 标签相对于 `outerRadius` 的径向偏移,目前仅作用于 inside 标签\n */\n offsetRadius?: number;\n /**\n * 标签横向点对齐\n */\n textAlign?: TextAlignType;\n /**\n * 标签纵向点对齐\n */\n textBaseline?: TextBaselineType;\n /**\n * 扇区间标签的间隔\n * @default 6\n */\n layoutArcGap?: number;\n /** 标签引导线样式 */\n line?: IArcLabelLineSpec;\n /** 标签布局配置 */\n layout?: IArcLabelLayoutSpec;\n /** 标签引导线点集 */\n points?: IPoint[];\n /** 饼图扇区中心偏移 */\n centerOffset?: number;\n}\n\nexport interface ILabelLineSpec {\n /**\n * 是否显示引导线\n * @default true\n */\n visible?: boolean;\n /**\n * 引导线样式\n */\n style?: Partial<ILineGraphicAttribute>;\n}\n\nexport interface IArcLabelLineSpec extends ILabelLineSpec {\n /**\n * 引导线 line1 部分最小长度\n * @default 20\n */\n line1MinLength?: number;\n /**\n * 引导线 line2 部分最小长度\n * @default 10\n */\n line2MinLength?: number;\n /**\n * 引导线是否光滑\n * @default false\n */\n smooth?: boolean;\n}\n\nexport type ArcLabelAlignType = 'arc' | 'labelLine' | 'edge';\n\nexport type ArcLabelStrategyType = 'priority' | 'vertical' | 'none';\n\nexport interface IArcLabelLayoutSpec {\n /**\n * 标签对齐方式\n * @default 'arc'\n */\n textAlign?: ArcLabelAlignType;\n /** @deprecate 建议统一使用textAlign,后续将废除 */\n align?: ArcLabelAlignType;\n /**\n * 标签布局策略\n * @default 'priority'\n */\n strategy?: ArcLabelStrategyType;\n /**\n * 是否启用切线约束\n * @default true\n */\n tangentConstraint?: boolean;\n}\n\nexport interface DataLabelAttrs extends IGroupGraphicAttribute {\n dataLabels: (RectLabelAttrs | SymbolLabelAttrs | ArcLabelAttrs | LineDataLabelAttrs)[];\n /**\n * 防重叠的区域大小\n */\n size: { width: number; height: number };\n}\n\nexport type Functional<T> = T | ((data: any) => T);\n\nexport interface ILabelExitAnimation {\n duration?: number;\n delay?: number;\n easing?: EasingType;\n}\n\nexport interface ILabelEnterAnimation extends ILabelExitAnimation {\n mode?: 'same-time' | 'after' | 'after-all';\n}\n\nexport interface ILabelUpdateAnimation extends ILabelExitAnimation {\n /** 是否开启 increaseCount 动画\n * @default true\n */\n increaseEffect?: boolean;\n}\n\nexport interface ILabelUpdateChannelAnimation extends ILabelUpdateAnimation {\n channel?: string[];\n options?: { excludeChannels?: string[] };\n}\n\nexport interface ILabelAnimation extends ILabelEnterAnimation, ILabelExitAnimation, ILabelUpdateAnimation {}\n\nexport interface IPoint {\n x: number;\n y: number;\n}\n\nexport interface IPolarPoint {\n radius: number;\n angle: number;\n}\n\nexport type Quadrant = 1 | 2 | 3 | 4;\n\nexport type TextAlign = 'left' | 'right' | 'center';\n\nexport type LabelContent = {\n text: IText | IRichText;\n labelLine?: ILine;\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/label/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n EasingType,\n IGraphic,\n IGroupGraphicAttribute,\n ITextGraphicAttribute,\n IRichTextGraphicAttribute,\n IText,\n TextAlignType,\n TextBaselineType,\n ILineGraphicAttribute,\n IRichTextCharacter,\n IRichText,\n ILine\n} from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\n\nexport type LabelItemStateStyle<T> = {\n hover?: T;\n hover_reverse?: T;\n selected?: T;\n selected_reverse?: T;\n [key: string]: T;\n};\n\nexport type LabelItem = {\n // 用于动画\n id?: string;\n // 原始数据\n data?: any;\n [key: string]: any;\n // 文本类型:text, rich, html (区分于图元类型)\n textType?: string;\n /**\n * 文本内容,如果需要进行换行,则使用数组形式,如 ['abc', '123']\n * 支持富文本内容, 如textConfig, html\n */\n text?: string | string[] | number | number[] | IRichTextCharacter[];\n /**\n * 兼容ITextGraphicAttribute与IRichTextGraphicAttribute的textAlign属性\n */\n textAlign?: 'left' | 'right' | 'center' | 'start' | 'end';\n textBaseline?: 'top' | 'middle' | 'bottom' | 'alphabetic';\n} & (\n | Omit<Partial<ITextGraphicAttribute>, 'textAlign' | 'textBaseline'>\n | Omit<Partial<IRichTextGraphicAttribute>, 'textAlign' | 'textBaseline'>\n);\n\nexport interface BaseLabelAttrs extends IGroupGraphicAttribute {\n type: string;\n /**\n * 图元 group 名称\n */\n baseMarkGroupName: string;\n /**\n * @hack not recommend to use\n * @returns\n */\n getBaseMarks?: () => IGraphic[];\n /**\n * 是否开启选中交互\n * @default false\n */\n select?: boolean;\n /**\n * 是否开启 hover 交互\n * @default false\n */\n hover?: boolean;\n /**\n * 标签数据\n */\n data: LabelItem[];\n\n /** 文本样式,优先级低于 data */\n textStyle?: Partial<ITextGraphicAttribute>;\n\n /** 文本交互样式 */\n state?: LabelItemStateStyle<ITextGraphicAttribute>;\n\n /** 连接线样式 */\n line?: ILabelLineSpec;\n\n /** 连线的交互样式 */\n labelLineState?: LabelItemStateStyle<ILineGraphicAttribute>;\n\n syncState?: boolean;\n\n /** 标签默认位置 */\n position?: Functional<string>;\n\n /** 偏移量 */\n offset?: number;\n\n /** 是否开启防重叠\n * @default true\n */\n overlap?: OverlapAttrs | boolean;\n\n /** 智能反色 */\n smartInvert?: SmartInvertAttrs | boolean;\n\n /** 动画配置 */\n animation?: ILabelAnimation | boolean;\n animationEnter?: ILabelUpdateAnimation;\n animationUpdate?: ILabelUpdateAnimation | ILabelUpdateChannelAnimation[];\n animationExit?: ILabelExitAnimation;\n\n // 排序 or 删减\n dataFilter?: (data: LabelItem[]) => LabelItem[];\n\n /** 自定义布局函数\n * @description 当配置了 customLayoutFunc 后,默认布局逻辑将不再生效。(position/offset不生效)\n */\n customLayoutFunc?: (\n item: LabelItem[],\n labels: (IText | IRichText)[],\n getRelatedGraphic: (data: LabelItem) => IGraphic,\n getRelatedPoint?: (data: LabelItem) => IPointLike\n ) => (IText | IRichText)[];\n\n /** 自定义标签躲避函数\n * @description 当配置了 customOverlapFunc 后,会根据 position 和 offset 进行初始布局。配置的防重叠逻辑(overlap)不生效。\n */\n customOverlapFunc?: (\n label: (IText | IRichText)[],\n getRelatedGraphic: (data: LabelItem) => IGraphic,\n getRelatedPoint?: (data: LabelItem) => IPointLike\n ) => (IText | IRichText)[];\n /**\n * 关闭交互效果\n * @default false\n */\n disableTriggerEvent?: boolean;\n /** 唯一标志符 */\n id?: string;\n}\n\nexport interface OverlapAttrs {\n /**\n * 防重叠的区域大小\n */\n size?: { width: number; height: number };\n\n /**\n * 发生重叠后,是否隐藏标签\n * @default true\n */\n hideOnHit?: boolean;\n\n /**\n * 是否约束标签在指定 size 的范围内。开启后若标签被区域裁剪,会向内收缩。\n * @default true\n */\n clampForce?: boolean;\n\n /**\n * 是否躲避基础图元\n * @default false\n */\n avoidBaseMark?: boolean;\n\n /**\n * 躲避指定图元\n * @default []\n */\n avoidMarks?: string[] | IGraphic[];\n\n /**\n * 发生重叠后的躲避策略\n */\n strategy?: Strategy[];\n\n /**\n * 文字在防重叠计算中预留的边距。\n * @default 0\n */\n overlapPadding?: number;\n}\n\nexport interface SmartInvertAttrs {\n /**\n * 对比度度量\n * 'WCAG' | 'lightness'\n * 默认使用'WCAG'\n */\n mode?: string;\n /**\n * 文本类型\n * 包含普通文本和大文本,对应不同的对比度标准,label默认为普通文本\n * 'normalText' | 'largeText'\n * @default 'normalText'\n */\n textType?: string;\n /**\n * 自定义对比度阈值\n */\n contrastRatiosThreshold?: number;\n /**\n * 自定义备选label颜色\n */\n alternativeColors?: string | string[];\n /**\n * fillStrategy四种策略:\n * - base(baseMark色),\n * - invertBase(执行智能反色),\n * - similarBase(智能反色的补色),\n * - null(不执行智能反色,保持fill设置的颜色)\n * @default 'invertBase'\n */\n fillStrategy?: 'base' | 'invertBase' | 'similarBase' | 'null';\n /**\n * strokeStrategy的四种策略:\n * - base(baseMark色),\n * - invertBase(执行智能反色),\n * - similarBase(智能反色的补色),\n * - null(不执行智能反色,保持stroke设置的颜色)\n * @default 'base'\n */\n strokeStrategy?: 'base' | 'invertBase' | 'similarBase' | 'null';\n /**\n * 前景色与亮色具有对比度时,similarSeries使用该色\n * @default '#ffffff'\n */\n brightColor?: string;\n /**\n * 前景色与暗色具有对比度时,similarSeries使用该色\n * @default '#000000'\n */\n darkColor?: string;\n /**\n * label超出mark范围,也以mark作为背景色进行反色\n */\n outsideEnable?: boolean;\n}\n\nexport type PositionStrategy = {\n /**\n * 可选位置策略。\n * 若默认位置没有足够的空间放置标签,则考虑 position 内的备选位置。\n */\n type: 'position';\n position?: Functional<LabelPosition[]>;\n};\n\nexport type BoundStrategy = {\n /**\n * 标签配置在图形内部时使用。\n * 当图形大小不足以放下标签,则考虑 position 内的备选位置。\n */\n type: 'bound';\n position?: Functional<LabelPosition[]>;\n};\n\nexport type MoveYStrategy = {\n /**\n * 可选位置策略。\n * 若默认位置没有足够的空间放置标签,则根据 offset 在Y方向上寻找位置。\n */\n type: 'moveY';\n /**\n * Y方向上的尝试的位置偏移量\n */\n offset: Functional<number[]>;\n};\n\nexport type MoveXStrategy = {\n /**\n * 可选位置策略。\n * 若默认位置没有足够的空间放置标签,则根据 offset 在X方向上寻找位置。\n */\n type: 'moveX';\n /**\n * X方向上的尝试的位置偏移量\n */\n offset: Functional<number[]>;\n};\n\nexport type Strategy = PositionStrategy | BoundStrategy | MoveYStrategy | MoveXStrategy;\n\nexport type LabelPosition = SymbolLabelAttrs['position'] | RectLabelAttrs['position'];\n\nexport interface SymbolLabelAttrs extends BaseLabelAttrs {\n type: 'symbol';\n\n /**\n * 标签位置\n * @default 'top'\n */\n position?: Functional<\n 'top' | 'bottom' | 'left' | 'right' | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center'\n >;\n}\n\nexport interface RectLabelAttrs extends BaseLabelAttrs {\n type: 'rect';\n /**\n * 标签位置\n * @default 'top'\n */\n position?: Functional<\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'inside'\n | 'inside-top'\n | 'inside-bottom'\n | 'inside-right'\n | 'inside-left'\n | 'top-right'\n | 'top-left'\n | 'bottom-right'\n | 'bottom-left'\n >;\n}\n\nexport interface LineLabelAttrs extends BaseLabelAttrs {\n type: 'line';\n /**\n * 标签位置\n * @default 'end'\n */\n position?: Functional<'start' | 'end'>;\n}\n\nexport interface AreaLabelAttrs extends BaseLabelAttrs {\n type: 'area';\n /**\n * 标签位置\n * @default 'end'\n */\n position?: Functional<'start' | 'end'>;\n}\n\nexport interface LineDataLabelAttrs extends BaseLabelAttrs {\n type: 'line-data';\n\n /**\n * 标签位置\n * @default 'top'\n */\n position?: Functional<\n 'top' | 'bottom' | 'left' | 'right' | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center'\n >;\n}\n\nexport interface PolygonLabelAttrs extends BaseLabelAttrs {\n type: 'polygon';\n /**\n * 标签位置\n * @default 'center'\n */\n position?: Functional<'center'>;\n}\n\nexport interface ArcLabelAttrs extends BaseLabelAttrs {\n type: 'arc';\n\n /**\n * 图元 group 名称\n */\n baseMarkGroupName: string;\n\n /**\n * 标签位置\n * @default 'outside'\n */\n position?: Functional<'inside' | 'outside' | 'inside-inner' | 'inside-outer'>;\n\n // 画布宽度\n width?: number;\n // 画布高度\n height?: number;\n\n /**\n * 是否允许标签重叠\n * @default false\n */\n coverEnable?: boolean;\n /**\n * 是否允许标签旋转\n * @default true\n */\n rotate?: boolean;\n\n /**\n * 文字与引导线间隔宽度\n * @default 5\n */\n spaceWidth?: number;\n /**\n * 标签旋转角度\n */\n angle?: number;\n /**\n * 标签旋转角度的偏移角度\n */\n offsetAngle?: number;\n /**\n * 标签相对于 `outerRadius` 的径向偏移,目前仅作用于 inside 标签\n */\n offsetRadius?: number;\n /**\n * 标签横向点对齐\n */\n textAlign?: TextAlignType;\n /**\n * 标签纵向点对齐\n */\n textBaseline?: TextBaselineType;\n /**\n * 扇区间标签的间隔\n * @default 6\n */\n layoutArcGap?: number;\n /** 标签引导线样式 */\n line?: IArcLabelLineSpec;\n /** 标签布局配置 */\n layout?: IArcLabelLayoutSpec;\n /** 标签引导线点集 */\n points?: IPoint[];\n /** 饼图扇区中心偏移 */\n centerOffset?: number;\n}\n\nexport interface ILabelLineSpec {\n /**\n * 是否显示引导线\n * @default true\n */\n visible?: boolean;\n /**\n * 引导线样式\n */\n style?: Partial<ILineGraphicAttribute>;\n}\n\nexport interface IArcLabelLineSpec extends ILabelLineSpec {\n /**\n * 引导线 line1 部分最小长度\n * @default 20\n */\n line1MinLength?: number;\n /**\n * 引导线 line2 部分最小长度\n * @default 10\n */\n line2MinLength?: number;\n /**\n * 引导线是否光滑\n * @default false\n */\n smooth?: boolean;\n}\n\nexport type ArcLabelAlignType = 'arc' | 'labelLine' | 'edge';\n\nexport type ArcLabelStrategyType = 'priority' | 'vertical' | 'none';\n\nexport interface IArcLabelLayoutSpec {\n /**\n * 标签对齐方式\n * @default 'arc'\n */\n textAlign?: ArcLabelAlignType;\n /** @deprecate 建议统一使用textAlign,后续将废除 */\n align?: ArcLabelAlignType;\n /**\n * 标签布局策略\n * @default 'priority'\n */\n strategy?: ArcLabelStrategyType;\n /**\n * 是否启用切线约束\n * @default true\n */\n tangentConstraint?: boolean;\n}\n\nexport interface DataLabelAttrs extends IGroupGraphicAttribute {\n dataLabels: (RectLabelAttrs | SymbolLabelAttrs | ArcLabelAttrs | LineDataLabelAttrs)[];\n /**\n * 防重叠的区域大小\n */\n size: { width: number; height: number; padding?: { top?: number; left?: number; right?: number; bottom?: number } };\n}\n\nexport type Functional<T> = T | ((data: any) => T);\n\nexport interface ILabelExitAnimation {\n duration?: number;\n delay?: number;\n easing?: EasingType;\n}\n\nexport interface ILabelEnterAnimation extends ILabelExitAnimation {\n mode?: 'same-time' | 'after' | 'after-all';\n}\n\nexport interface ILabelUpdateAnimation extends ILabelExitAnimation {\n /** 是否开启 increaseCount 动画\n * @default true\n */\n increaseEffect?: boolean;\n}\n\nexport interface ILabelUpdateChannelAnimation extends ILabelUpdateAnimation {\n channel?: string[];\n options?: { excludeChannels?: string[] };\n}\n\nexport interface ILabelAnimation extends ILabelEnterAnimation, ILabelExitAnimation, ILabelUpdateAnimation {}\n\nexport interface IPoint {\n x: number;\n y: number;\n}\n\nexport interface IPolarPoint {\n radius: number;\n angle: number;\n}\n\nexport type Quadrant = 1 | 2 | 3 | 4;\n\nexport type TextAlign = 'left' | 'right' | 'center';\n\nexport type LabelContent = {\n text: IText | IRichText;\n labelLine?: ILine;\n};\n"]}
|
|
@@ -242,11 +242,12 @@ class DiscreteLegend extends base_1.LegendBase {
|
|
|
242
242
|
valueAttr.alignRight ? valueShape.setAttributes({
|
|
243
243
|
textAlign: "right",
|
|
244
244
|
x: this._itemWidthByUser - shapeSize / 2 - parsedPadding[1] - parsedPadding[3] - focusSpace - valueSpace
|
|
245
|
-
}) : valueShape.setAttribute("x", labelShape.AABBBounds.
|
|
246
|
-
} else valueShape.setAttribute("x", labelShape.AABBBounds.
|
|
247
|
-
focusStartX = valueShape.AABBBounds.
|
|
245
|
+
}) : valueShape.setAttribute("x", valueSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2));
|
|
246
|
+
} else valueShape.setAttribute("x", valueSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2));
|
|
247
|
+
focusStartX = valueSpace + (valueShape.AABBBounds.empty() ? 0 : valueShape.AABBBounds.x2),
|
|
248
|
+
innerGroup.add(valueShape);
|
|
248
249
|
} else this._itemWidthByUser ? (labelShape.setAttribute("maxLineWidth", this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - focusSpace),
|
|
249
|
-
focusStartX = labelShape.AABBBounds.
|
|
250
|
+
focusStartX = labelSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2)) : focusStartX = labelSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2);
|
|
250
251
|
focusShape && (focusShape.setAttribute("x", focusStartX), innerGroup.add(focusShape));
|
|
251
252
|
const innerGroupBounds = innerGroup.AABBBounds, innerGroupWidth = innerGroupBounds.width();
|
|
252
253
|
if ("right" === align) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/legend/discrete/discrete.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAIA,6CAA8G;AAa9G,yDAAwD;AACxD,kCAAqC;AACrC,uCAAoC;AACpC,0CAYqB;AASrB,0CAA0D;AAC1D,qCAAoE;AACpE,+CAA4C;AAE5C,MAAM,cAAc,GAAG;IACrB,CAAC,2BAAgB,CAAC,KAAK,CAAC,EAAE,EAAE;IAC5B,CAAC,2BAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;IAC/B,CAAC,2BAAgB,CAAC,aAAa,CAAC,EAAE,EAAE;IACpC,CAAC,2BAAgB,CAAC,UAAU,CAAC,EAAE,EAAE;IACjC,CAAC,2BAAgB,CAAC,eAAe,CAAC,EAAE,EAAE;CACvC,CAAC;AAEF,IAAA,sCAA2B,GAAE,CAAC;AAC9B,MAAa,cAAe,SAAQ,iBAA+B;IAoHjE,YAAY,UAA+B,EAAE,OAA0B;QACrE,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAK,EAAC,EAAE,EAAE,cAAc,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;QApHrG,SAAI,GAAG,gBAAgB,CAAC;QAEhB,oBAAe,GAAkB,IAAI,CAAC;QAEtC,sBAAiB,GAAuB,SAAS,CAAC;QAClD,gBAAW,GAAG,CAAC,CAAC;QAChB,kBAAa,GAAG,CAAC,CAAC;QAs1BlB,aAAQ,GAAG,CAAC,CAAwB,EAAE,EAAE;YAC9C,MAAM,MAAM,GAAG,CAAC,CAAC,MAA2B,CAAC;YAC7C,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,I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AC1B,KAAK,EAAE;gBACL,QAAQ,EAAE,EAAE;gBACZ,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,SAAS;aAClB;YACD,KAAK,EAAE;gBACL,aAAa,EAAE;oBACb,OAAO,EAAE,IAAI;iBACd;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,SAAS;iBAChB;aACF;SACF;QACD,KAAK,EAAE;YACL,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE;gBACL,QAAQ,EAAE,EAAE;gBACZ,IAAI,EAAE,MAAM;gBACZ,MAAM,EAAE,SAAS;aAClB;YACD,KAAK,EAAE;gBACL,aAAa,EAAE;oBACb,OAAO,EAAE,IAAI;iBACd;gBACD,UAAU,EAAE;oBACV,IAAI,EAAE,SAAS;iBAChB;aACF;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,MAAM,EAAE,SAAS;aAClB;SACF;QACD,KAAK,EAAE,KAAK;QACZ,cAAc,EAAE;YACd,IAAI,EAAE,6BAAkB;YACxB,UAAU,EACR,4pBAA4pB;YAC9pB,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,SAAS;SAClB;KACF;IACD,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,KAAK,EAAE,8BAAmB;QAC1B,OAAO,EAAE;YACP,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YACnB,KAAK,EAAE,CAAC;SACT;KACF;IACD,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,UAAU;IACtB,gBAAgB,EAAE,IAAI;CACvB,CAAC","file":"discrete.js","sourcesContent":["/**\n * @description 离散图例\n * @author 章伟星\n */\nimport { merge, isEmpty, normalizePadding, get, isValid, isNil, isFunction, isArray } from '@visactor/vutils';\nimport type {\n FederatedPointerEvent,\n IGroup,\n IGraphic,\n INode,\n IGroupGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute,\n CustomEvent,\n IText\n} from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport { LegendBase } from '../base';\nimport { Pager } from '../../pager';\nimport {\n DEFAULT_TITLE_SPACE,\n DEFAULT_ITEM_SPACE_COL,\n DEFAULT_ITEM_SPACE_ROW,\n DEFAULT_SHAPE_SPACE,\n DEFAULT_SHAPE_SIZE,\n DEFAULT_LABEL_SPACE,\n DEFAULT_PAGER_SPACE,\n LegendStateValue,\n DEFAULT_VALUE_SPACE,\n LegendEvent,\n LEGEND_ELEMENT_NAME\n} from '../constant';\nimport type {\n DiscreteLegendAttrs,\n LegendItem,\n LegendItemDatum,\n LegendPagerAttributes,\n LegendScrollbarAttributes\n} from './type';\nimport type { ComponentOptions } from '../../interface';\nimport { loadDiscreteLegendComponent } from '../register';\nimport { isRichText, richTextAttributeTransform } from '../../util';\nimport { ScrollBar } from '../../scrollbar';\n\nconst DEFAULT_STATES = {\n [LegendStateValue.focus]: {},\n [LegendStateValue.selected]: {},\n [LegendStateValue.selectedHover]: {},\n [LegendStateValue.unSelected]: {},\n [LegendStateValue.unSelectedHover]: {}\n};\n\nloadDiscreteLegendComponent();\nexport class DiscreteLegend extends LegendBase<DiscreteLegendAttrs> {\n name = 'discreteLegend';\n\n private _itemsContainer: IGroup | null = null;\n private _itemWidthByUser: number | undefined;\n private _itemHeightByUser: number | undefined = undefined;\n private _itemHeight = 0; // 存储每一个图例项的高度\n private _itemMaxWidth = 0; // 存储图例项的最大的宽度\n private _pagerComponent: Pager | ScrollBar;\n private _lastActiveItem: IGroup;\n private _itemContext: {\n // 水平布局换行标识\n doWrap: boolean;\n // 存储每一列最大的宽度,用于垂直布局的换列\n maxWidthInCol: number;\n startX: number;\n startY: number;\n maxPages: number;\n pages: number;\n // 开始渲染的序号\n startIndex: number;\n items: LegendItemDatum[];\n isHorizontal: boolean;\n currentPage: number;\n totalPage: number;\n };\n\n static defaultAttributes: Partial<DiscreteLegendAttrs> = {\n layout: 'horizontal',\n title: {\n align: 'start',\n space: DEFAULT_TITLE_SPACE,\n textStyle: {\n fontSize: 12,\n fontWeight: 'bold',\n fill: '#2C3542'\n }\n },\n item: {\n spaceCol: DEFAULT_ITEM_SPACE_COL,\n spaceRow: DEFAULT_ITEM_SPACE_ROW,\n shape: {\n space: DEFAULT_SHAPE_SPACE,\n style: {\n size: DEFAULT_SHAPE_SIZE,\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n opacity: 0.5\n }\n }\n },\n label: {\n space: DEFAULT_LABEL_SPACE,\n style: {\n fontSize: 12,\n fill: '#2C3542',\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8'\n }\n }\n },\n value: {\n alignRight: false,\n style: {\n fontSize: 12,\n fill: '#ccc',\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8'\n }\n }\n },\n background: {\n style: {\n cursor: 'pointer'\n }\n },\n focus: false,\n focusIconStyle: {\n size: DEFAULT_SHAPE_SIZE,\n symbolType:\n 'M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z',\n fill: '#333',\n cursor: 'pointer'\n }\n },\n autoPage: true,\n pager: {\n space: DEFAULT_PAGER_SPACE,\n handler: {\n style: { size: 10 },\n space: 4\n }\n },\n hover: true,\n select: true,\n selectMode: 'multiple',\n allowAllCanceled: true\n };\n\n constructor(attributes: DiscreteLegendAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, DiscreteLegend.defaultAttributes, attributes));\n }\n\n /**\n * 更新选中数据\n * @param value 选中数据范围\n * @returns\n */\n setSelected(selectedData: (string | number)[]) {\n (this._itemsContainer?.getChildren() as IGroup[]).forEach(item => {\n // @ts-ignore\n const itemData = item.data as LegendItemDatum;\n if (selectedData.includes(itemData.label)) {\n this._setLegendItemState(item, LegendStateValue.selected);\n this._removeLegendItemState(item, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover]);\n } else {\n // 如果当前为选中状态,则取消选中\n this._removeLegendItemState(item, [LegendStateValue.selected, LegendStateValue.selectedHover]);\n this._setLegendItemState(item, LegendStateValue.unSelected);\n }\n });\n }\n\n protected _renderItems() {\n const {\n item: itemAttrs = {},\n maxCol = 1,\n maxRow = 2,\n maxWidth,\n maxHeight,\n defaultSelected = [],\n lazyload\n } = this.attribute as DiscreteLegendAttrs;\n const { spaceCol = DEFAULT_ITEM_SPACE_COL, spaceRow = DEFAULT_ITEM_SPACE_ROW } = itemAttrs;\n\n const itemsContainer = this._itemsContainer;\n const { items: legendItems, isHorizontal, startIndex } = this._itemContext;\n const maxPages = isHorizontal ? maxRow : maxCol;\n\n let { doWrap, maxWidthInCol, startX, startY, pages } = this._itemContext;\n let item: LegendItemDatum;\n\n for (let index = startIndex, len = legendItems.length; index < len; index++) {\n if (lazyload && pages > this._itemContext.currentPage * maxPages) {\n this._itemContext.startIndex = index;\n break;\n }\n item = legendItems[index];\n\n if (!item.id) {\n item.id = item.label; // 如果没有设置 id,默认使用 label\n }\n item.index = index; // 用于维护图例的顺序\n\n const itemGroup = this._renderEachItem(\n item,\n isEmpty(defaultSelected) ? true : defaultSelected?.includes(item.label),\n index,\n legendItems\n );\n const itemWidth = itemGroup.attribute.width;\n const itemHeight = itemGroup.attribute.height;\n this._itemHeight = Math.max(this._itemHeight, itemHeight);\n maxWidthInCol = Math.max(itemWidth, maxWidthInCol);\n\n this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth);\n\n if (isHorizontal) {\n // 水平布局\n if (isValid(maxWidth)) {\n if (itemWidth >= maxWidth) {\n // 如果图例项本身就大于 maxWidth\n doWrap = true;\n if (index > 0) {\n startX = 0;\n startY += itemHeight + spaceRow;\n pages += 1;\n }\n } else if (maxWidth < startX + itemWidth) {\n // 检测是否需要换行:如果用户声明了 maxWidth 并且超出了,则进行换行\n doWrap = true;\n startX = 0;\n startY += itemHeight + spaceRow;\n pages += 1;\n }\n }\n if (index > 0) {\n itemGroup.setAttributes({\n x: startX,\n y: startY\n });\n }\n startX += spaceCol + itemWidth;\n } else {\n // 垂直布局\n if (isValid(maxHeight) && maxHeight < startY + itemHeight) {\n // 检测是否换列:如果用户声明了 maxHeight 并且超出了,则进行换列\n doWrap = true;\n startY = 0;\n startX += maxWidthInCol + spaceCol;\n maxWidthInCol = 0;\n pages += 1;\n }\n if (index > 0) {\n itemGroup.setAttributes({\n x: startX,\n y: startY\n });\n }\n startY += spaceRow + itemHeight;\n }\n\n itemsContainer.add(itemGroup);\n }\n\n this._itemContext.doWrap = doWrap;\n this._itemContext.startX = startX;\n this._itemContext.startY = startY;\n this._itemContext.maxWidthInCol = maxWidthInCol;\n this._itemContext.pages = pages;\n this._itemContext.maxPages = maxPages;\n\n if (!lazyload) {\n this._itemContext.startIndex = legendItems.length;\n }\n\n return this._itemContext;\n }\n\n protected _renderContent() {\n const { item = {}, items, reversed } = this.attribute as DiscreteLegendAttrs;\n if (item.visible === false || isEmpty(items)) {\n return;\n }\n\n let legendItems = items;\n if (reversed) {\n legendItems = items?.reverse();\n }\n\n const itemsContainer = graphicCreator.group({\n x: 0,\n y: 0\n });\n this._itemsContainer = itemsContainer;\n\n const { layout, autoPage } = this.attribute;\n const isHorizontal = layout === 'horizontal';\n\n const { maxWidth: maxItemWidth, width: itemWidth, height: itemHeight } = item;\n\n // 根据用户声明的 maxItemWidth 和 itemWidth 获取图例项宽度\n if (isValid(maxItemWidth)) {\n if (isValid(itemWidth)) {\n this._itemWidthByUser = Math.min(maxItemWidth, itemWidth);\n } else {\n this._itemWidthByUser = maxItemWidth;\n }\n } else if (isValid(itemWidth)) {\n this._itemWidthByUser = itemWidth;\n }\n\n // 存储用户指定图例项高度\n if (isValid(itemHeight)) {\n this._itemHeightByUser = itemHeight;\n }\n\n this._itemContext = {\n currentPage: this.attribute.pager ? this.attribute.pager.defaultCurrent || 1 : 1,\n doWrap: false,\n maxWidthInCol: 0,\n maxPages: 1,\n pages: 1,\n startX: 0,\n startY: 0,\n startIndex: 0,\n items: legendItems,\n isHorizontal,\n totalPage: Infinity\n };\n\n this._itemContext = this._renderItems();\n\n // TODO: 添加测试用例\n let pagerRendered = false;\n if (this._itemContext.doWrap && autoPage && this._itemContext.pages > this._itemContext.maxPages) {\n // 进行分页处理\n pagerRendered = this._renderPagerComponent(isHorizontal);\n }\n\n if (!pagerRendered) {\n itemsContainer.setAttribute(\n 'y',\n this._title ? this._title.AABBBounds.height() + get(this.attribute, 'title.space', 8) : 0\n );\n this._innerView.add(itemsContainer);\n }\n }\n\n protected _bindEvents() {\n if (this.attribute.disableTriggerEvent) {\n return;\n }\n if (!this._itemsContainer) {\n return;\n }\n\n const { hover = true, select = true } = this.attribute;\n if (hover) {\n this._itemsContainer.addEventListener('pointermove', this._onHover as EventListenerOrEventListenerObject);\n this._itemsContainer.addEventListener('pointerleave', this._onUnHover as EventListenerOrEventListenerObject);\n }\n\n if (select) {\n this._itemsContainer.addEventListener('pointerdown', this._onClick as EventListenerOrEventListenerObject);\n }\n }\n\n private _renderEachItem(item: LegendItemDatum, isSelected: boolean, index: number, items: LegendItemDatum[]) {\n const { id, label, value, shape } = item;\n const { padding = 0, focus, focusIconStyle, align } = this.attribute.item as LegendItem;\n\n const { shape: shapeAttr, label: labelAttr, value: valueAttr, background } = this.attribute.item as LegendItem;\n\n const shapeStyle = this._handleStyle(shapeAttr, item, isSelected, index, items);\n const labelStyle = this._handleStyle(labelAttr, item, isSelected, index, items);\n const valueStyle = this._handleStyle(valueAttr, item, isSelected, index, items);\n const backgroundStyle = this._handleStyle(background, item, isSelected, index, items);\n\n const parsedPadding = normalizePadding(padding);\n\n let itemGroup;\n if (background.visible === false) {\n itemGroup = graphicCreator.group({\n x: 0,\n y: 0,\n cursor: (backgroundStyle.style as IGroupGraphicAttribute)?.cursor\n });\n this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup);\n } else {\n itemGroup = graphicCreator.group({\n x: 0,\n y: 0,\n ...backgroundStyle.style\n });\n this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup, backgroundStyle.state);\n }\n itemGroup.id = `${id ?? label}-${index}`;\n\n itemGroup.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n\n const innerGroup = graphicCreator.group({\n x: 0,\n y: 0,\n pickable: false\n });\n itemGroup.add(innerGroup);\n\n let focusStartX = 0;\n let shapeSize = 0;\n let shapeSpace = 0;\n if (shapeAttr && shapeAttr.visible !== false) {\n const s = get(shapeStyle, 'style.size', DEFAULT_SHAPE_SIZE);\n if (isArray(s)) {\n shapeSize = s[0] || 0;\n } else {\n shapeSize = s;\n }\n shapeSpace = get(shapeAttr, 'space', DEFAULT_SHAPE_SPACE);\n const itemShape = graphicCreator.symbol({\n x: 0,\n y: 0,\n symbolType: 'circle',\n strokeBoundsBuffer: 0,\n ...shape,\n ...shapeStyle.style\n });\n // 处理下 shape 的 fill stroke\n Object.keys(shapeStyle.state || {}).forEach(key => {\n const color =\n (shapeStyle.state[key] as ISymbolGraphicAttribute).fill ||\n (shapeStyle.state[key] as ISymbolGraphicAttribute).stroke;\n if (shape.fill && isNil((shapeStyle.state[key] as ISymbolGraphicAttribute).fill) && color) {\n (shapeStyle.state[key] as ISymbolGraphicAttribute).fill = color as string;\n }\n\n if (shape.stroke && isNil((shapeStyle.state[key] as ISymbolGraphicAttribute).stroke) && color) {\n (shapeStyle.state[key] as ISymbolGraphicAttribute).stroke = color as string;\n }\n });\n this._appendDataToShape(itemShape, LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state);\n\n itemShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n innerGroup.add(itemShape);\n }\n\n let focusShape: IGraphic;\n let focusSpace = 0;\n\n if (focus) {\n const focusSize = get(focusIconStyle, 'size', DEFAULT_SHAPE_SIZE);\n // 绘制聚焦按钮\n focusShape = graphicCreator.symbol({\n x: 0,\n y: -focusSize / 2 - 1,\n strokeBoundsBuffer: 0,\n ...focusIconStyle,\n visible: true,\n pickMode: 'imprecise',\n boundsPadding: parsedPadding\n });\n this._appendDataToShape(focusShape, LEGEND_ELEMENT_NAME.focus, item, itemGroup);\n\n focusSpace = focusSize;\n }\n let labelShape;\n const text = labelAttr.formatMethod ? labelAttr.formatMethod(label, item, index) : label;\n const labelAttributes = {\n x: shapeSize / 2 + shapeSpace,\n y: 0,\n textAlign: 'start',\n textBaseline: 'middle',\n lineHeight: (labelStyle.style as ITextGraphicAttribute)?.fontSize,\n ...labelStyle.style,\n text\n };\n if (isRichText(labelAttributes)) {\n labelShape = graphicCreator.richtext(richTextAttributeTransform(labelAttributes));\n } else {\n labelShape = graphicCreator.text(labelAttributes);\n }\n\n this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state);\n labelShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n innerGroup.add(labelShape);\n const labelSpace = get(labelAttr, 'space', DEFAULT_LABEL_SPACE);\n if (isValid(value)) {\n const valueSpace = get(valueAttr, 'space', focus ? DEFAULT_VALUE_SPACE : 0);\n const valueText = valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value;\n const valueAttributes = {\n x: 0,\n y: 0,\n textAlign: 'start',\n textBaseline: 'middle',\n lineHeight: (valueStyle.style as ITextGraphicAttribute).fontSize,\n ...valueStyle.style,\n text: valueText\n };\n let valueShape;\n if (isRichText(valueAttributes)) {\n valueShape = graphicCreator.richtext(richTextAttributeTransform(valueAttributes));\n } else {\n valueShape = graphicCreator.text(valueAttributes);\n }\n\n this._appendDataToShape(valueShape, LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueStyle.state);\n valueShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n\n if (this._itemWidthByUser) {\n // 计算用来防止文本的宽度\n const layoutWidth =\n this._itemWidthByUser -\n parsedPadding[1] -\n parsedPadding[3] -\n shapeSize -\n shapeSpace -\n labelSpace -\n focusSpace -\n valueSpace;\n const valueBounds = valueShape.AABBBounds;\n const labelBounds = labelShape.AABBBounds;\n const valueWidth = valueBounds.width();\n const labelWidth = labelBounds.width();\n if (labelWidth > layoutWidth) {\n if ((layoutWidth - valueWidth) / labelWidth > 0.4) {\n // 设置一个值,如果剩余的宽度和 label 自身的比例不低于 0.4 的话,优先展示全 label\n labelShape.setAttribute('maxLineWidth', layoutWidth - valueWidth);\n } else {\n valueShape.setAttribute('maxLineWidth', layoutWidth * 0.5);\n labelShape.setAttribute('maxLineWidth', layoutWidth * 0.5);\n }\n } else {\n valueShape.setAttribute('maxLineWidth', layoutWidth - labelWidth);\n }\n\n if (valueAttr.alignRight) {\n valueShape.setAttributes({\n // @ts-ignore\n textAlign: 'right',\n x: this._itemWidthByUser - shapeSize / 2 - parsedPadding[1] - parsedPadding[3] - focusSpace - valueSpace\n });\n } else {\n valueShape.setAttribute('x', labelShape.AABBBounds.x2 + valueSpace);\n }\n } else {\n valueShape.setAttribute('x', labelShape.AABBBounds.x2 + valueSpace);\n }\n focusStartX = valueShape.AABBBounds.x2 + valueSpace;\n\n innerGroup.add(valueShape);\n } else if (this._itemWidthByUser) {\n labelShape.setAttribute(\n 'maxLineWidth',\n this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - focusSpace\n );\n\n focusStartX = labelShape.AABBBounds.x2 + labelSpace;\n } else {\n focusStartX = labelShape.AABBBounds.x2 + labelSpace;\n }\n\n if (focusShape) {\n focusShape.setAttribute('x', focusStartX);\n innerGroup.add(focusShape);\n }\n\n const innerGroupBounds = innerGroup.AABBBounds;\n const innerGroupWidth = innerGroupBounds.width();\n\n if (align === 'right') {\n const x2 = innerGroupBounds.x2;\n const x1 = innerGroupBounds.x1;\n innerGroup.forEachChildren((child: IGraphic, index: number) => {\n if (\n (child.type !== 'symbol' && (child as IText).attribute.textAlign !== 'right') ||\n child === (focusShape as unknown as IGraphic)\n ) {\n child.setAttribute('x', x1 + x2 - child.attribute.x - child.AABBBounds.width());\n } else if (child.type !== 'symbol') {\n (child as IText).setAttributes({ x: x1 + x2 - child.attribute.x, textAlign: 'left' });\n } else {\n child.setAttribute('x', x1 + x2 - child.attribute.x);\n }\n });\n }\n\n const innerGroupHeight = innerGroupBounds.height();\n const itemGroupWidth = isValid(this.attribute.item.width)\n ? this.attribute.item.width\n : innerGroupWidth + parsedPadding[1] + parsedPadding[3];\n const itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];\n itemGroup.attribute.width = itemGroupWidth;\n itemGroup.attribute.height = itemGroupHeight;\n\n focusShape && focusShape.setAttribute('visible', false);\n\n innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]);\n return itemGroup;\n }\n\n private _createPager(\n isScrollbar: boolean,\n isHorizontal: boolean,\n compStyle: LegendPagerAttributes | LegendScrollbarAttributes,\n compSize: number\n ) {\n const { disableTriggerEvent, maxRow } = this.attribute;\n if (isScrollbar) {\n return isHorizontal\n ? new ScrollBar({\n direction: 'vertical',\n width: 12,\n range: [0, 0.5],\n ...(compStyle as LegendScrollbarAttributes),\n height: compSize,\n disableTriggerEvent\n })\n : new ScrollBar({\n direction: 'horizontal',\n disableTriggerEvent,\n range: [0, 0.5],\n height: 12,\n ...(compStyle as LegendScrollbarAttributes),\n width: compSize\n });\n }\n\n return isHorizontal\n ? new Pager({\n layout: maxRow === 1 ? 'horizontal' : 'vertical',\n total: 99,\n ...merge(\n {\n handler: {\n preShape: 'triangleUp',\n nextShape: 'triangleDown'\n }\n },\n compStyle as LegendPagerAttributes\n ),\n defaultCurrent: this.attribute.pager?.defaultCurrent,\n disableTriggerEvent\n })\n : new Pager({\n layout: 'horizontal',\n total: 99, // 用于估算,\n disableTriggerEvent,\n defaultCurrent: this.attribute.pager?.defaultCurrent,\n ...(compStyle as LegendPagerAttributes)\n });\n }\n\n private _updatePositionOfPager(\n isScrollbar: boolean,\n isHorizontal: boolean,\n contentSize: number,\n renderStartY: number,\n compSize: number\n ) {\n const { maxHeight, pager } = this.attribute;\n const { currentPage, totalPage } = this._itemContext;\n\n if (isScrollbar) {\n (this._pagerComponent as ScrollBar).setScrollRange([(currentPage - 1) / totalPage, currentPage / totalPage]);\n if (isHorizontal) {\n (this._pagerComponent as ScrollBar).setAttributes({\n x: contentSize,\n y: renderStartY\n });\n } else {\n (this._pagerComponent as ScrollBar).setAttributes({\n x: 0,\n y: (maxHeight as number) - this._pagerComponent.AABBBounds.height()\n });\n }\n } else {\n const position = (pager && (pager as LegendPagerAttributes).position) || 'middle';\n (this._pagerComponent as Pager).setTotal(totalPage);\n\n if (isHorizontal) {\n let y;\n if (position === 'start') {\n y = renderStartY;\n } else if (position === 'end') {\n y = renderStartY + compSize - this._pagerComponent.AABBBounds.height() / 2;\n } else {\n y = renderStartY + compSize / 2 - this._pagerComponent.AABBBounds.height() / 2;\n }\n this._pagerComponent.setAttributes({\n x: contentSize,\n y\n });\n } else {\n let x;\n if (position === 'start') {\n x = 0;\n } else if (position === 'end') {\n x = compSize - this._pagerComponent.AABBBounds.width();\n } else {\n x = (compSize - this._pagerComponent.AABBBounds.width()) / 2;\n }\n this._pagerComponent.setAttributes({\n x,\n y: (maxHeight as number) - this._pagerComponent.AABBBounds.height()\n });\n }\n }\n }\n\n private _bindEventsOfPager(isScrollbar: boolean, isHorizontal: boolean, compSize: number, spaceSize: number) {\n const pager = this.attribute.pager || {};\n const { animation = true, animationDuration = 450, animationEasing = 'quadIn' } = pager;\n const pageParser = isScrollbar\n ? (e: CustomEvent) => {\n const { value } = e.detail;\n let newPage = value[0] * this._itemContext.totalPage;\n\n if ((pager as LegendScrollbarAttributes).scrollByPosition) {\n newPage = newPage + 1;\n } else {\n newPage = Math.floor(newPage) + 1;\n }\n\n return newPage;\n }\n : (e: CustomEvent) => {\n return e.detail.current;\n };\n\n const onPaging = (e: CustomEvent) => {\n const newPage = pageParser(e);\n\n if (newPage === this._itemContext.currentPage) {\n return;\n }\n\n this._itemContext.currentPage = newPage;\n\n if (this._itemContext && this._itemContext.startIndex < this._itemContext.items.length) {\n this._renderItems();\n\n const newTotalPage = Math.ceil(this._itemContext.pages / this._itemContext.maxPages);\n // 更新总页数\n this._itemContext.totalPage = newTotalPage;\n (this._pagerComponent as ScrollBar).setScrollRange([(newPage - 1) / newTotalPage, newPage / newTotalPage]);\n }\n\n if (animation) {\n (this._itemsContainer as IGroup)\n .animate()\n .to(\n isHorizontal\n ? { y: -(newPage - 1) * (compSize + spaceSize) }\n : { x: -(newPage - 1) * (compSize + spaceSize) },\n animationDuration,\n animationEasing\n );\n } else {\n if (isHorizontal) {\n (this._itemsContainer as IGroup).setAttribute('y', -(newPage - 1) * (compSize + spaceSize));\n } else {\n (this._itemsContainer as IGroup).setAttribute('x', -(newPage - 1) * (compSize + spaceSize));\n }\n }\n };\n if (isScrollbar) {\n this._pagerComponent.addEventListener('scrollDrag', onPaging);\n this._pagerComponent.addEventListener('scrollUp', onPaging);\n } else {\n this._pagerComponent.addEventListener('toPrev', onPaging);\n this._pagerComponent.addEventListener('toNext', onPaging);\n }\n }\n\n private _renderPagerComponent(isHorizontal: boolean) {\n const renderStartY = this._title ? this._title.AABBBounds.height() + get(this.attribute, 'title.space', 8) : 0;\n const { maxWidth, maxHeight, maxCol = 1, maxRow = 2, item = {}, pager = {} } = this.attribute;\n const { spaceCol = DEFAULT_ITEM_SPACE_COL, spaceRow = DEFAULT_ITEM_SPACE_ROW } = item;\n const itemsContainer = this._itemsContainer as IGroup;\n const { space: pagerSpace = DEFAULT_PAGER_SPACE, defaultCurrent = 1, ...compStyle } = pager;\n const isScrollbar = (pager as LegendScrollbarAttributes).type === 'scrollbar';\n\n let comp: ScrollBar | Pager;\n let compSize = 0; // 组件的大小\n let contentSize = 0; // 内容的大小\n let startX = 0; // 临时变量,用来存储布局的起始点\n let startY = 0; // 临时变量,用来存储布局的起始点\n let pages = 1; // 页数\n\n if (isHorizontal) {\n compSize = (maxRow - 1) * spaceRow + this._itemHeight * maxRow;\n // 水平布局,支持上下翻页\n comp = this._createPager(isScrollbar, isHorizontal, compStyle, compSize);\n this._pagerComponent = comp;\n this._innerView.add(comp as unknown as INode);\n contentSize = (maxWidth as number) - comp.AABBBounds.width() - pagerSpace;\n\n if (contentSize <= 0) {\n // 布局空间不够则不进行分页器渲染\n this._innerView.removeChild(comp as unknown as INode);\n return false;\n }\n\n // 重新进行布局\n (itemsContainer.getChildren() as unknown as IGroup[]).forEach((item, index) => {\n const { width, height } = item.attribute;\n\n if (contentSize < startX + (width as number)) {\n // 超出了,则换行\n startX = 0;\n startY += (height as number) + spaceRow;\n pages += 1;\n }\n if (index > 0) {\n item.setAttributes({\n x: startX,\n y: startY\n });\n }\n startX += spaceCol + (width as number);\n });\n\n this._itemContext.startX = startX;\n this._itemContext.startY = startY;\n this._itemContext.pages = pages;\n const total = Math.ceil(pages / maxRow);\n\n this._itemContext.totalPage = total;\n\n this._updatePositionOfPager(isScrollbar, isHorizontal, contentSize, renderStartY, compSize);\n } else {\n compSize = this._itemMaxWidth * maxCol + (maxCol - 1) * spaceCol;\n // 垂直布局,支持左右翻页\n comp = this._createPager(isScrollbar, isHorizontal, compStyle, compSize);\n this._pagerComponent = comp;\n this._innerView.add(comp as unknown as INode);\n\n contentSize = (maxHeight as number) - comp.AABBBounds.height() - pagerSpace - renderStartY;\n\n if (contentSize <= 0) {\n // 布局空间不够则不进行分页器渲染\n this._innerView.removeChild(comp as unknown as INode);\n return false;\n }\n\n // 重新进行布局\n (itemsContainer.getChildren() as unknown as IGroup[]).forEach((item, index) => {\n const { height } = item.attribute;\n if (contentSize < startY + (height as number)) {\n startY = 0;\n startX += this._itemMaxWidth + spaceCol;\n pages += 1;\n }\n if (index > 0) {\n item.setAttributes({\n x: startX,\n y: startY\n });\n }\n startY += spaceRow + (height as number);\n });\n\n // todo\n const total = Math.ceil(pages / maxCol);\n\n this._itemContext.totalPage = total;\n this._updatePositionOfPager(isScrollbar, isHorizontal, contentSize, renderStartY, compSize);\n }\n\n // 初始化 defaultCurrent\n if (defaultCurrent > 1) {\n if (isHorizontal) {\n itemsContainer.setAttribute('y', -(defaultCurrent - 1) * (compSize + spaceRow));\n } else {\n itemsContainer.setAttribute('x', -(defaultCurrent - 1) * (compSize + spaceCol));\n }\n }\n\n const clipGroup = graphicCreator.group({\n x: 0,\n y: renderStartY,\n width: isHorizontal ? contentSize : compSize,\n height: isHorizontal ? compSize : contentSize,\n clip: true,\n pickable: false\n });\n clipGroup.add(itemsContainer);\n this._innerView.add(clipGroup);\n\n this._bindEventsOfPager(isScrollbar, isHorizontal, compSize, isHorizontal ? spaceRow : spaceCol);\n\n return true;\n }\n\n private _onHover = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGroup;\n if (target && target.name && target.name.startsWith(LEGEND_ELEMENT_NAME.item)) {\n // @ts-ignore\n const legendItem = target.delegate;\n\n // 如果上个激活元素存在,则判断当前元素是否和上个激活元素相同,相同则不做处理,不相同则触发 unhover\n if (this._lastActiveItem) {\n if (this._lastActiveItem.id === legendItem.id) {\n return;\n }\n this._unHover(this._lastActiveItem, e);\n }\n this._hover(legendItem, e);\n } else if (this._lastActiveItem) {\n this._unHover(this._lastActiveItem, e);\n this._lastActiveItem = null;\n }\n };\n\n private _onUnHover = (e: FederatedPointerEvent) => {\n if (this._lastActiveItem) {\n this._unHover(this._lastActiveItem, e);\n this._lastActiveItem = null;\n }\n };\n\n private _onClick = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGroup;\n if (target && target.name && target.name.startsWith(LEGEND_ELEMENT_NAME.item)) {\n // @ts-ignore\n const legendItem = target.delegate;\n\n // 图例聚焦功能\n if (target.name === LEGEND_ELEMENT_NAME.focus) {\n const isFocusSelected = legendItem.hasState(LegendStateValue.focus);\n legendItem.toggleState(LegendStateValue.focus);\n\n if (isFocusSelected) {\n // 当前为选中态,则再次点击变成全选\n this._itemsContainer?.getChildren().forEach(item => {\n this._removeLegendItemState(\n item as unknown as IGroup,\n [LegendStateValue.unSelected, LegendStateValue.unSelectedHover, LegendStateValue.focus],\n e\n );\n this._setLegendItemState(item as unknown as IGroup, LegendStateValue.selected, e);\n });\n } else {\n this._setLegendItemState(legendItem, LegendStateValue.selected, e);\n this._removeLegendItemState(legendItem, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover], e);\n // 单选逻辑,当前被点击的图例项设置为选中态,其他全部设置为非选中态\n this._itemsContainer?.getChildren().forEach(item => {\n if (legendItem !== item) {\n this._removeLegendItemState(\n item as unknown as IGroup,\n [LegendStateValue.selected, LegendStateValue.selectedHover, LegendStateValue.focus],\n e\n );\n this._setLegendItemState(item as unknown as IGroup, LegendStateValue.unSelected, e);\n }\n });\n }\n } else {\n // 清除 focus 状态\n this._itemsContainer?.getChildren().forEach(item => {\n (item as unknown as IGroup).removeState(LegendStateValue.focus);\n });\n const { selectMode = 'multiple', allowAllCanceled = true } = this.attribute;\n const isSelected = legendItem.hasState(LegendStateValue.selected);\n const currentSelectedItems = this._getSelectedLegends();\n if (selectMode === 'multiple') {\n if (allowAllCanceled === false && isSelected && currentSelectedItems.length === 1) {\n this._dispatchLegendEvent(LegendEvent.legendItemClick, legendItem, e);\n return;\n }\n // 多选逻辑\n if (isSelected) {\n // 如果当前为选中状态,则取消选中\n this._removeLegendItemState(legendItem, [LegendStateValue.selected, LegendStateValue.selectedHover], e);\n this._setLegendItemState(legendItem, LegendStateValue.unSelected, e);\n } else {\n // 如果当前为非选中态,则设置为选中状态\n this._setLegendItemState(legendItem, LegendStateValue.selected, e);\n this._removeLegendItemState(legendItem, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover], e);\n }\n } else {\n this._setLegendItemState(legendItem, LegendStateValue.selected, e);\n this._removeLegendItemState(legendItem, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover], e);\n\n // 单选逻辑,当前被点击的图例项设置为选中态,其他全部设置为非选中态\n this._itemsContainer?.getChildren().forEach(item => {\n if (legendItem !== item) {\n this._removeLegendItemState(\n item as unknown as IGroup,\n [LegendStateValue.selected, LegendStateValue.selectedHover],\n e\n );\n this._setLegendItemState(item as unknown as IGroup, LegendStateValue.unSelected, e);\n }\n });\n }\n }\n\n this._dispatchLegendEvent(LegendEvent.legendItemClick, legendItem, e);\n }\n };\n\n private _hover(legendItem: IGroup, e: FederatedPointerEvent) {\n this._lastActiveItem = legendItem;\n const selected = legendItem.hasState(LegendStateValue.selected);\n\n if (selected) {\n // use selectedHover state\n this._setLegendItemState(legendItem, LegendStateValue.selectedHover, e);\n } else {\n // use unSelectedHover state\n this._setLegendItemState(legendItem, LegendStateValue.unSelectedHover, e);\n }\n\n const focusButton = (legendItem.getChildren()[0] as unknown as IGroup).find(\n node => node.name === LEGEND_ELEMENT_NAME.focus,\n false\n ) as IGraphic;\n if (focusButton) {\n focusButton.setAttribute('visible', true);\n }\n\n this._dispatchLegendEvent(LegendEvent.legendItemHover, legendItem, e);\n }\n\n private _unHover(legendItem: IGroup, e: FederatedPointerEvent) {\n let attributeUpdate = false;\n if (legendItem.hasState(LegendStateValue.unSelectedHover) || legendItem.hasState(LegendStateValue.selectedHover)) {\n attributeUpdate = true;\n }\n legendItem.removeState(LegendStateValue.unSelectedHover);\n legendItem.removeState(LegendStateValue.selectedHover);\n legendItem\n .getChildren()[0]\n .getChildren()\n .forEach((child: any) => {\n if (\n !attributeUpdate &&\n (child.hasState(LegendStateValue.unSelectedHover) || child.hasState(LegendStateValue.selectedHover))\n ) {\n attributeUpdate = true;\n }\n (child as unknown as IGraphic).removeState(LegendStateValue.unSelectedHover);\n (child as unknown as IGraphic).removeState(LegendStateValue.selectedHover);\n });\n\n const focusButton = (legendItem.getChildren()[0] as unknown as IGroup).find(\n node => node.name === LEGEND_ELEMENT_NAME.focus,\n false\n ) as IGraphic;\n if (focusButton) {\n focusButton.setAttribute('visible', false);\n }\n\n if (attributeUpdate) {\n this._dispatchLegendEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e);\n }\n this._dispatchLegendEvent(LegendEvent.legendItemUnHover, legendItem, e);\n }\n\n private _setLegendItemState(legendItem: IGroup, stateName: string, e?: FederatedPointerEvent) {\n const keepCurrentStates = true;\n let attributeUpdate = false;\n if (!legendItem.hasState(stateName)) {\n attributeUpdate = true;\n }\n legendItem.addState(stateName, keepCurrentStates);\n // TODO: 这个比较 hack\n legendItem\n .getChildren()[0]\n .getChildren()\n .forEach((child: IGraphic) => {\n if (child.name !== LEGEND_ELEMENT_NAME.focus) {\n if (!attributeUpdate && !child.hasState(stateName)) {\n attributeUpdate = true;\n }\n (child as unknown as IGraphic).addState(stateName, keepCurrentStates);\n }\n });\n if (attributeUpdate) {\n this._dispatchLegendEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e);\n }\n }\n\n private _removeLegendItemState(legendItem: IGroup, stateNames: string[], e?: FederatedPointerEvent) {\n let attributeUpdate = false;\n stateNames.forEach(name => {\n if (!attributeUpdate && legendItem.hasState(name)) {\n attributeUpdate = true;\n }\n legendItem.removeState(name);\n });\n // TODO: 这个比较 hack\n legendItem\n .getChildren()[0]\n .getChildren()\n .forEach(child => {\n if (child.name !== LEGEND_ELEMENT_NAME.focus) {\n stateNames.forEach(name => {\n if (!attributeUpdate && (child as unknown as IGraphic).hasState(name)) {\n attributeUpdate = true;\n }\n (child as unknown as IGraphic).removeState(name);\n });\n }\n });\n if (attributeUpdate) {\n this._dispatchLegendEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e);\n }\n }\n\n // 获取当前选中的图例项\n private _getSelectedLegends() {\n const selectedData: LegendItemDatum[] = [];\n this._itemsContainer?.getChildren().forEach(item => {\n if ((item as unknown as IGroup).hasState(LegendStateValue.selected)) {\n // @ts-ignore\n selectedData.push(item.data);\n }\n });\n\n return selectedData;\n }\n\n private _appendDataToShape(shape: any, name: string, data: any, delegateShape: any, states: any = {}) {\n shape.name = name;\n shape.data = data;\n shape.delegate = delegateShape;\n shape.states = merge({}, DEFAULT_STATES, states);\n }\n\n private _dispatchLegendEvent(eventName: string, legendItem: any, event: FederatedPointerEvent) {\n const currentSelectedItems = this._getSelectedLegends();\n // 需要保持显示顺序\n currentSelectedItems.sort((pre: LegendItemDatum, next: LegendItemDatum) => pre.index - next.index);\n\n const currentSelected = currentSelectedItems.map((obj: LegendItemDatum) => obj.label);\n\n this._dispatchEvent(eventName, {\n item: legendItem, // 当前被选中的图例项整体\n data: legendItem.data, // 当前图例项的数据\n selected: legendItem.hasState(LegendStateValue.selected), // 当前图例项是否被选中\n currentSelectedItems,\n currentSelected,\n event\n });\n }\n\n // 处理回调函数\n private _handleStyle(\n config: any,\n item: LegendItemDatum,\n isSelected: boolean,\n index: number,\n items: LegendItemDatum[]\n ) {\n const newConfig: any = {};\n // 处理下样式\n if (config.style) {\n if (isFunction(config.style)) {\n newConfig.style = config.style(item, isSelected, index, items);\n } else {\n newConfig.style = config.style;\n }\n }\n\n if (config.state) {\n newConfig.state = {};\n\n Object.keys(config.state).forEach(key => {\n if (config.state[key]) {\n if (isFunction(config.state[key])) {\n newConfig.state[key] = config.state[key](item, isSelected, index, items);\n } else {\n newConfig.state[key] = config.state[key];\n }\n }\n });\n }\n\n return newConfig;\n }\n}\n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IACX,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,UAAU;IACtB,gBAAgB,EAAE,IAAI;CACvB,CAAC","file":"discrete.js","sourcesContent":["/**\n * @description 离散图例\n * @author 章伟星\n */\nimport { merge, isEmpty, normalizePadding, get, isValid, isNil, isFunction, isArray } from '@visactor/vutils';\nimport type {\n FederatedPointerEvent,\n IGroup,\n IGraphic,\n INode,\n IGroupGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute,\n CustomEvent,\n IText\n} from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport { LegendBase } from '../base';\nimport { Pager } from '../../pager';\nimport {\n DEFAULT_TITLE_SPACE,\n DEFAULT_ITEM_SPACE_COL,\n DEFAULT_ITEM_SPACE_ROW,\n DEFAULT_SHAPE_SPACE,\n DEFAULT_SHAPE_SIZE,\n DEFAULT_LABEL_SPACE,\n DEFAULT_PAGER_SPACE,\n LegendStateValue,\n DEFAULT_VALUE_SPACE,\n LegendEvent,\n LEGEND_ELEMENT_NAME\n} from '../constant';\nimport type {\n DiscreteLegendAttrs,\n LegendItem,\n LegendItemDatum,\n LegendPagerAttributes,\n LegendScrollbarAttributes\n} from './type';\nimport type { ComponentOptions } from '../../interface';\nimport { loadDiscreteLegendComponent } from '../register';\nimport { isRichText, richTextAttributeTransform } from '../../util';\nimport { ScrollBar } from '../../scrollbar';\n\nconst DEFAULT_STATES = {\n [LegendStateValue.focus]: {},\n [LegendStateValue.selected]: {},\n [LegendStateValue.selectedHover]: {},\n [LegendStateValue.unSelected]: {},\n [LegendStateValue.unSelectedHover]: {}\n};\n\nloadDiscreteLegendComponent();\nexport class DiscreteLegend extends LegendBase<DiscreteLegendAttrs> {\n name = 'discreteLegend';\n\n private _itemsContainer: IGroup | null = null;\n private _itemWidthByUser: number | undefined;\n private _itemHeightByUser: number | undefined = undefined;\n private _itemHeight = 0; // 存储每一个图例项的高度\n private _itemMaxWidth = 0; // 存储图例项的最大的宽度\n private _pagerComponent: Pager | ScrollBar;\n private _lastActiveItem: IGroup;\n private _itemContext: {\n // 水平布局换行标识\n doWrap: boolean;\n // 存储每一列最大的宽度,用于垂直布局的换列\n maxWidthInCol: number;\n startX: number;\n startY: number;\n maxPages: number;\n pages: number;\n // 开始渲染的序号\n startIndex: number;\n items: LegendItemDatum[];\n isHorizontal: boolean;\n currentPage: number;\n totalPage: number;\n };\n\n static defaultAttributes: Partial<DiscreteLegendAttrs> = {\n layout: 'horizontal',\n title: {\n align: 'start',\n space: DEFAULT_TITLE_SPACE,\n textStyle: {\n fontSize: 12,\n fontWeight: 'bold',\n fill: '#2C3542'\n }\n },\n item: {\n spaceCol: DEFAULT_ITEM_SPACE_COL,\n spaceRow: DEFAULT_ITEM_SPACE_ROW,\n shape: {\n space: DEFAULT_SHAPE_SPACE,\n style: {\n size: DEFAULT_SHAPE_SIZE,\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n opacity: 0.5\n }\n }\n },\n label: {\n space: DEFAULT_LABEL_SPACE,\n style: {\n fontSize: 12,\n fill: '#2C3542',\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8'\n }\n }\n },\n value: {\n alignRight: false,\n style: {\n fontSize: 12,\n fill: '#ccc',\n cursor: 'pointer'\n },\n state: {\n selectedHover: {\n opacity: 0.85\n },\n unSelected: {\n fill: '#D8D8D8'\n }\n }\n },\n background: {\n style: {\n cursor: 'pointer'\n }\n },\n focus: false,\n focusIconStyle: {\n size: DEFAULT_SHAPE_SIZE,\n symbolType:\n 'M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z',\n fill: '#333',\n cursor: 'pointer'\n }\n },\n autoPage: true,\n pager: {\n space: DEFAULT_PAGER_SPACE,\n handler: {\n style: { size: 10 },\n space: 4\n }\n },\n hover: true,\n select: true,\n selectMode: 'multiple',\n allowAllCanceled: true\n };\n\n constructor(attributes: DiscreteLegendAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, DiscreteLegend.defaultAttributes, attributes));\n }\n\n /**\n * 更新选中数据\n * @param value 选中数据范围\n * @returns\n */\n setSelected(selectedData: (string | number)[]) {\n (this._itemsContainer?.getChildren() as IGroup[]).forEach(item => {\n // @ts-ignore\n const itemData = item.data as LegendItemDatum;\n if (selectedData.includes(itemData.label)) {\n this._setLegendItemState(item, LegendStateValue.selected);\n this._removeLegendItemState(item, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover]);\n } else {\n // 如果当前为选中状态,则取消选中\n this._removeLegendItemState(item, [LegendStateValue.selected, LegendStateValue.selectedHover]);\n this._setLegendItemState(item, LegendStateValue.unSelected);\n }\n });\n }\n\n protected _renderItems() {\n const {\n item: itemAttrs = {},\n maxCol = 1,\n maxRow = 2,\n maxWidth,\n maxHeight,\n defaultSelected = [],\n lazyload\n } = this.attribute as DiscreteLegendAttrs;\n const { spaceCol = DEFAULT_ITEM_SPACE_COL, spaceRow = DEFAULT_ITEM_SPACE_ROW } = itemAttrs;\n\n const itemsContainer = this._itemsContainer;\n const { items: legendItems, isHorizontal, startIndex } = this._itemContext;\n const maxPages = isHorizontal ? maxRow : maxCol;\n\n let { doWrap, maxWidthInCol, startX, startY, pages } = this._itemContext;\n let item: LegendItemDatum;\n\n for (let index = startIndex, len = legendItems.length; index < len; index++) {\n if (lazyload && pages > this._itemContext.currentPage * maxPages) {\n this._itemContext.startIndex = index;\n break;\n }\n item = legendItems[index];\n\n if (!item.id) {\n item.id = item.label; // 如果没有设置 id,默认使用 label\n }\n item.index = index; // 用于维护图例的顺序\n\n const itemGroup = this._renderEachItem(\n item,\n isEmpty(defaultSelected) ? true : defaultSelected?.includes(item.label),\n index,\n legendItems\n );\n const itemWidth = itemGroup.attribute.width;\n const itemHeight = itemGroup.attribute.height;\n this._itemHeight = Math.max(this._itemHeight, itemHeight);\n maxWidthInCol = Math.max(itemWidth, maxWidthInCol);\n\n this._itemMaxWidth = Math.max(itemWidth, this._itemMaxWidth);\n\n if (isHorizontal) {\n // 水平布局\n if (isValid(maxWidth)) {\n if (itemWidth >= maxWidth) {\n // 如果图例项本身就大于 maxWidth\n doWrap = true;\n if (index > 0) {\n startX = 0;\n startY += itemHeight + spaceRow;\n pages += 1;\n }\n } else if (maxWidth < startX + itemWidth) {\n // 检测是否需要换行:如果用户声明了 maxWidth 并且超出了,则进行换行\n doWrap = true;\n startX = 0;\n startY += itemHeight + spaceRow;\n pages += 1;\n }\n }\n if (index > 0) {\n itemGroup.setAttributes({\n x: startX,\n y: startY\n });\n }\n startX += spaceCol + itemWidth;\n } else {\n // 垂直布局\n if (isValid(maxHeight) && maxHeight < startY + itemHeight) {\n // 检测是否换列:如果用户声明了 maxHeight 并且超出了,则进行换列\n doWrap = true;\n startY = 0;\n startX += maxWidthInCol + spaceCol;\n maxWidthInCol = 0;\n pages += 1;\n }\n if (index > 0) {\n itemGroup.setAttributes({\n x: startX,\n y: startY\n });\n }\n startY += spaceRow + itemHeight;\n }\n\n itemsContainer.add(itemGroup);\n }\n\n this._itemContext.doWrap = doWrap;\n this._itemContext.startX = startX;\n this._itemContext.startY = startY;\n this._itemContext.maxWidthInCol = maxWidthInCol;\n this._itemContext.pages = pages;\n this._itemContext.maxPages = maxPages;\n\n if (!lazyload) {\n this._itemContext.startIndex = legendItems.length;\n }\n\n return this._itemContext;\n }\n\n protected _renderContent() {\n const { item = {}, items, reversed } = this.attribute as DiscreteLegendAttrs;\n if (item.visible === false || isEmpty(items)) {\n return;\n }\n\n let legendItems = items;\n if (reversed) {\n legendItems = items?.reverse();\n }\n\n const itemsContainer = graphicCreator.group({\n x: 0,\n y: 0\n });\n this._itemsContainer = itemsContainer;\n\n const { layout, autoPage } = this.attribute;\n const isHorizontal = layout === 'horizontal';\n\n const { maxWidth: maxItemWidth, width: itemWidth, height: itemHeight } = item;\n\n // 根据用户声明的 maxItemWidth 和 itemWidth 获取图例项宽度\n if (isValid(maxItemWidth)) {\n if (isValid(itemWidth)) {\n this._itemWidthByUser = Math.min(maxItemWidth, itemWidth);\n } else {\n this._itemWidthByUser = maxItemWidth;\n }\n } else if (isValid(itemWidth)) {\n this._itemWidthByUser = itemWidth;\n }\n\n // 存储用户指定图例项高度\n if (isValid(itemHeight)) {\n this._itemHeightByUser = itemHeight;\n }\n\n this._itemContext = {\n currentPage: this.attribute.pager ? this.attribute.pager.defaultCurrent || 1 : 1,\n doWrap: false,\n maxWidthInCol: 0,\n maxPages: 1,\n pages: 1,\n startX: 0,\n startY: 0,\n startIndex: 0,\n items: legendItems,\n isHorizontal,\n totalPage: Infinity\n };\n\n this._itemContext = this._renderItems();\n\n // TODO: 添加测试用例\n let pagerRendered = false;\n if (this._itemContext.doWrap && autoPage && this._itemContext.pages > this._itemContext.maxPages) {\n // 进行分页处理\n pagerRendered = this._renderPagerComponent(isHorizontal);\n }\n\n if (!pagerRendered) {\n itemsContainer.setAttribute(\n 'y',\n this._title ? this._title.AABBBounds.height() + get(this.attribute, 'title.space', 8) : 0\n );\n this._innerView.add(itemsContainer);\n }\n }\n\n protected _bindEvents() {\n if (this.attribute.disableTriggerEvent) {\n return;\n }\n if (!this._itemsContainer) {\n return;\n }\n\n const { hover = true, select = true } = this.attribute;\n if (hover) {\n this._itemsContainer.addEventListener('pointermove', this._onHover as EventListenerOrEventListenerObject);\n this._itemsContainer.addEventListener('pointerleave', this._onUnHover as EventListenerOrEventListenerObject);\n }\n\n if (select) {\n this._itemsContainer.addEventListener('pointerdown', this._onClick as EventListenerOrEventListenerObject);\n }\n }\n\n private _renderEachItem(item: LegendItemDatum, isSelected: boolean, index: number, items: LegendItemDatum[]) {\n const { id, label, value, shape } = item;\n const { padding = 0, focus, focusIconStyle, align } = this.attribute.item as LegendItem;\n\n const { shape: shapeAttr, label: labelAttr, value: valueAttr, background } = this.attribute.item as LegendItem;\n\n const shapeStyle = this._handleStyle(shapeAttr, item, isSelected, index, items);\n const labelStyle = this._handleStyle(labelAttr, item, isSelected, index, items);\n const valueStyle = this._handleStyle(valueAttr, item, isSelected, index, items);\n const backgroundStyle = this._handleStyle(background, item, isSelected, index, items);\n\n const parsedPadding = normalizePadding(padding);\n\n let itemGroup;\n if (background.visible === false) {\n itemGroup = graphicCreator.group({\n x: 0,\n y: 0,\n cursor: (backgroundStyle.style as IGroupGraphicAttribute)?.cursor\n });\n this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup);\n } else {\n itemGroup = graphicCreator.group({\n x: 0,\n y: 0,\n ...backgroundStyle.style\n });\n this._appendDataToShape(itemGroup, LEGEND_ELEMENT_NAME.item, item, itemGroup, backgroundStyle.state);\n }\n itemGroup.id = `${id ?? label}-${index}`;\n\n itemGroup.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n\n const innerGroup = graphicCreator.group({\n x: 0,\n y: 0,\n pickable: false\n });\n itemGroup.add(innerGroup);\n\n let focusStartX = 0;\n let shapeSize = 0;\n let shapeSpace = 0;\n if (shapeAttr && shapeAttr.visible !== false) {\n const s = get(shapeStyle, 'style.size', DEFAULT_SHAPE_SIZE);\n if (isArray(s)) {\n shapeSize = s[0] || 0;\n } else {\n shapeSize = s;\n }\n shapeSpace = get(shapeAttr, 'space', DEFAULT_SHAPE_SPACE);\n const itemShape = graphicCreator.symbol({\n x: 0,\n y: 0,\n symbolType: 'circle',\n strokeBoundsBuffer: 0,\n ...shape,\n ...shapeStyle.style\n });\n // 处理下 shape 的 fill stroke\n Object.keys(shapeStyle.state || {}).forEach(key => {\n const color =\n (shapeStyle.state[key] as ISymbolGraphicAttribute).fill ||\n (shapeStyle.state[key] as ISymbolGraphicAttribute).stroke;\n if (shape.fill && isNil((shapeStyle.state[key] as ISymbolGraphicAttribute).fill) && color) {\n (shapeStyle.state[key] as ISymbolGraphicAttribute).fill = color as string;\n }\n\n if (shape.stroke && isNil((shapeStyle.state[key] as ISymbolGraphicAttribute).stroke) && color) {\n (shapeStyle.state[key] as ISymbolGraphicAttribute).stroke = color as string;\n }\n });\n this._appendDataToShape(itemShape, LEGEND_ELEMENT_NAME.itemShape, item, itemGroup, shapeStyle.state);\n\n itemShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n innerGroup.add(itemShape);\n }\n\n let focusShape: IGraphic;\n let focusSpace = 0;\n if (focus) {\n const focusSize = get(focusIconStyle, 'size', DEFAULT_SHAPE_SIZE);\n // 绘制聚焦按钮\n focusShape = graphicCreator.symbol({\n x: 0,\n y: -focusSize / 2 - 1,\n strokeBoundsBuffer: 0,\n ...focusIconStyle,\n visible: true,\n pickMode: 'imprecise',\n boundsPadding: parsedPadding\n });\n this._appendDataToShape(focusShape, LEGEND_ELEMENT_NAME.focus, item, itemGroup);\n\n focusSpace = focusSize;\n }\n let labelShape;\n const text = labelAttr.formatMethod ? labelAttr.formatMethod(label, item, index) : label;\n const labelAttributes = {\n x: shapeSize / 2 + shapeSpace,\n y: 0,\n textAlign: 'start',\n textBaseline: 'middle',\n lineHeight: (labelStyle.style as ITextGraphicAttribute)?.fontSize,\n ...labelStyle.style,\n text\n };\n if (isRichText(labelAttributes)) {\n labelShape = graphicCreator.richtext(richTextAttributeTransform(labelAttributes));\n } else {\n labelShape = graphicCreator.text(labelAttributes);\n }\n\n this._appendDataToShape(labelShape, LEGEND_ELEMENT_NAME.itemLabel, item, itemGroup, labelStyle.state);\n labelShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n innerGroup.add(labelShape);\n const labelSpace = get(labelAttr, 'space', DEFAULT_LABEL_SPACE);\n if (isValid(value)) {\n const valueSpace = get(valueAttr, 'space', focus ? DEFAULT_VALUE_SPACE : 0);\n const valueText = valueAttr.formatMethod ? valueAttr.formatMethod(value, item, index) : value;\n const valueAttributes = {\n x: 0,\n y: 0,\n textAlign: 'start',\n textBaseline: 'middle',\n lineHeight: (valueStyle.style as ITextGraphicAttribute).fontSize,\n ...valueStyle.style,\n text: valueText\n };\n let valueShape;\n if (isRichText(valueAttributes)) {\n valueShape = graphicCreator.richtext(richTextAttributeTransform(valueAttributes));\n } else {\n valueShape = graphicCreator.text(valueAttributes);\n }\n\n this._appendDataToShape(valueShape, LEGEND_ELEMENT_NAME.itemValue, item, itemGroup, valueStyle.state);\n valueShape.addState(isSelected ? LegendStateValue.selected : LegendStateValue.unSelected);\n\n if (this._itemWidthByUser) {\n // 计算用来防止文本的宽度\n const layoutWidth =\n this._itemWidthByUser -\n parsedPadding[1] -\n parsedPadding[3] -\n shapeSize -\n shapeSpace -\n labelSpace -\n focusSpace -\n valueSpace;\n const valueBounds = valueShape.AABBBounds;\n const labelBounds = labelShape.AABBBounds;\n const valueWidth = valueBounds.width();\n const labelWidth = labelBounds.width();\n if (labelWidth > layoutWidth) {\n if ((layoutWidth - valueWidth) / labelWidth > 0.4) {\n // 设置一个值,如果剩余的宽度和 label 自身的比例不低于 0.4 的话,优先展示全 label\n labelShape.setAttribute('maxLineWidth', layoutWidth - valueWidth);\n } else {\n valueShape.setAttribute('maxLineWidth', layoutWidth * 0.5);\n labelShape.setAttribute('maxLineWidth', layoutWidth * 0.5);\n }\n } else {\n valueShape.setAttribute('maxLineWidth', layoutWidth - labelWidth);\n }\n\n if (valueAttr.alignRight) {\n valueShape.setAttributes({\n // @ts-ignore\n textAlign: 'right',\n x: this._itemWidthByUser - shapeSize / 2 - parsedPadding[1] - parsedPadding[3] - focusSpace - valueSpace\n });\n } else {\n valueShape.setAttribute('x', valueSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2));\n }\n } else {\n valueShape.setAttribute('x', valueSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2));\n }\n focusStartX = valueSpace + (valueShape.AABBBounds.empty() ? 0 : valueShape.AABBBounds.x2);\n\n innerGroup.add(valueShape);\n } else if (this._itemWidthByUser) {\n labelShape.setAttribute(\n 'maxLineWidth',\n this._itemWidthByUser - parsedPadding[1] - parsedPadding[3] - shapeSize - shapeSpace - focusSpace\n );\n\n focusStartX = labelSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2);\n } else {\n focusStartX = labelSpace + (labelShape.AABBBounds.empty() ? 0 : labelShape.AABBBounds.x2);\n }\n\n if (focusShape) {\n focusShape.setAttribute('x', focusStartX);\n innerGroup.add(focusShape);\n }\n\n const innerGroupBounds = innerGroup.AABBBounds;\n const innerGroupWidth = innerGroupBounds.width();\n\n if (align === 'right') {\n const x2 = innerGroupBounds.x2;\n const x1 = innerGroupBounds.x1;\n innerGroup.forEachChildren((child: IGraphic, index: number) => {\n if (\n (child.type !== 'symbol' && (child as IText).attribute.textAlign !== 'right') ||\n child === (focusShape as unknown as IGraphic)\n ) {\n child.setAttribute('x', x1 + x2 - child.attribute.x - child.AABBBounds.width());\n } else if (child.type !== 'symbol') {\n (child as IText).setAttributes({ x: x1 + x2 - child.attribute.x, textAlign: 'left' });\n } else {\n child.setAttribute('x', x1 + x2 - child.attribute.x);\n }\n });\n }\n\n const innerGroupHeight = innerGroupBounds.height();\n const itemGroupWidth = isValid(this.attribute.item.width)\n ? this.attribute.item.width\n : innerGroupWidth + parsedPadding[1] + parsedPadding[3];\n const itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];\n itemGroup.attribute.width = itemGroupWidth;\n itemGroup.attribute.height = itemGroupHeight;\n focusShape && focusShape.setAttribute('visible', false);\n\n innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]);\n return itemGroup;\n }\n\n private _createPager(\n isScrollbar: boolean,\n isHorizontal: boolean,\n compStyle: LegendPagerAttributes | LegendScrollbarAttributes,\n compSize: number\n ) {\n const { disableTriggerEvent, maxRow } = this.attribute;\n if (isScrollbar) {\n return isHorizontal\n ? new ScrollBar({\n direction: 'vertical',\n width: 12,\n range: [0, 0.5],\n ...(compStyle as LegendScrollbarAttributes),\n height: compSize,\n disableTriggerEvent\n })\n : new ScrollBar({\n direction: 'horizontal',\n disableTriggerEvent,\n range: [0, 0.5],\n height: 12,\n ...(compStyle as LegendScrollbarAttributes),\n width: compSize\n });\n }\n\n return isHorizontal\n ? new Pager({\n layout: maxRow === 1 ? 'horizontal' : 'vertical',\n total: 99,\n ...merge(\n {\n handler: {\n preShape: 'triangleUp',\n nextShape: 'triangleDown'\n }\n },\n compStyle as LegendPagerAttributes\n ),\n defaultCurrent: this.attribute.pager?.defaultCurrent,\n disableTriggerEvent\n })\n : new Pager({\n layout: 'horizontal',\n total: 99, // 用于估算,\n disableTriggerEvent,\n defaultCurrent: this.attribute.pager?.defaultCurrent,\n ...(compStyle as LegendPagerAttributes)\n });\n }\n\n private _updatePositionOfPager(\n isScrollbar: boolean,\n isHorizontal: boolean,\n contentSize: number,\n renderStartY: number,\n compSize: number\n ) {\n const { maxHeight, pager } = this.attribute;\n const { currentPage, totalPage } = this._itemContext;\n\n if (isScrollbar) {\n (this._pagerComponent as ScrollBar).setScrollRange([(currentPage - 1) / totalPage, currentPage / totalPage]);\n if (isHorizontal) {\n (this._pagerComponent as ScrollBar).setAttributes({\n x: contentSize,\n y: renderStartY\n });\n } else {\n (this._pagerComponent as ScrollBar).setAttributes({\n x: 0,\n y: (maxHeight as number) - this._pagerComponent.AABBBounds.height()\n });\n }\n } else {\n const position = (pager && (pager as LegendPagerAttributes).position) || 'middle';\n (this._pagerComponent as Pager).setTotal(totalPage);\n\n if (isHorizontal) {\n let y;\n if (position === 'start') {\n y = renderStartY;\n } else if (position === 'end') {\n y = renderStartY + compSize - this._pagerComponent.AABBBounds.height() / 2;\n } else {\n y = renderStartY + compSize / 2 - this._pagerComponent.AABBBounds.height() / 2;\n }\n this._pagerComponent.setAttributes({\n x: contentSize,\n y\n });\n } else {\n let x;\n if (position === 'start') {\n x = 0;\n } else if (position === 'end') {\n x = compSize - this._pagerComponent.AABBBounds.width();\n } else {\n x = (compSize - this._pagerComponent.AABBBounds.width()) / 2;\n }\n this._pagerComponent.setAttributes({\n x,\n y: (maxHeight as number) - this._pagerComponent.AABBBounds.height()\n });\n }\n }\n }\n\n private _bindEventsOfPager(isScrollbar: boolean, isHorizontal: boolean, compSize: number, spaceSize: number) {\n const pager = this.attribute.pager || {};\n const { animation = true, animationDuration = 450, animationEasing = 'quadIn' } = pager;\n const pageParser = isScrollbar\n ? (e: CustomEvent) => {\n const { value } = e.detail;\n let newPage = value[0] * this._itemContext.totalPage;\n\n if ((pager as LegendScrollbarAttributes).scrollByPosition) {\n newPage = newPage + 1;\n } else {\n newPage = Math.floor(newPage) + 1;\n }\n\n return newPage;\n }\n : (e: CustomEvent) => {\n return e.detail.current;\n };\n\n const onPaging = (e: CustomEvent) => {\n const newPage = pageParser(e);\n\n if (newPage === this._itemContext.currentPage) {\n return;\n }\n\n this._itemContext.currentPage = newPage;\n\n if (this._itemContext && this._itemContext.startIndex < this._itemContext.items.length) {\n this._renderItems();\n\n const newTotalPage = Math.ceil(this._itemContext.pages / this._itemContext.maxPages);\n // 更新总页数\n this._itemContext.totalPage = newTotalPage;\n (this._pagerComponent as ScrollBar).setScrollRange([(newPage - 1) / newTotalPage, newPage / newTotalPage]);\n }\n\n if (animation) {\n (this._itemsContainer as IGroup)\n .animate()\n .to(\n isHorizontal\n ? { y: -(newPage - 1) * (compSize + spaceSize) }\n : { x: -(newPage - 1) * (compSize + spaceSize) },\n animationDuration,\n animationEasing\n );\n } else {\n if (isHorizontal) {\n (this._itemsContainer as IGroup).setAttribute('y', -(newPage - 1) * (compSize + spaceSize));\n } else {\n (this._itemsContainer as IGroup).setAttribute('x', -(newPage - 1) * (compSize + spaceSize));\n }\n }\n };\n if (isScrollbar) {\n this._pagerComponent.addEventListener('scrollDrag', onPaging);\n this._pagerComponent.addEventListener('scrollUp', onPaging);\n } else {\n this._pagerComponent.addEventListener('toPrev', onPaging);\n this._pagerComponent.addEventListener('toNext', onPaging);\n }\n }\n\n private _renderPagerComponent(isHorizontal: boolean) {\n const renderStartY = this._title ? this._title.AABBBounds.height() + get(this.attribute, 'title.space', 8) : 0;\n const { maxWidth, maxHeight, maxCol = 1, maxRow = 2, item = {}, pager = {} } = this.attribute;\n const { spaceCol = DEFAULT_ITEM_SPACE_COL, spaceRow = DEFAULT_ITEM_SPACE_ROW } = item;\n const itemsContainer = this._itemsContainer as IGroup;\n const { space: pagerSpace = DEFAULT_PAGER_SPACE, defaultCurrent = 1, ...compStyle } = pager;\n const isScrollbar = (pager as LegendScrollbarAttributes).type === 'scrollbar';\n\n let comp: ScrollBar | Pager;\n let compSize = 0; // 组件的大小\n let contentSize = 0; // 内容的大小\n let startX = 0; // 临时变量,用来存储布局的起始点\n let startY = 0; // 临时变量,用来存储布局的起始点\n let pages = 1; // 页数\n\n if (isHorizontal) {\n compSize = (maxRow - 1) * spaceRow + this._itemHeight * maxRow;\n // 水平布局,支持上下翻页\n comp = this._createPager(isScrollbar, isHorizontal, compStyle, compSize);\n this._pagerComponent = comp;\n this._innerView.add(comp as unknown as INode);\n contentSize = (maxWidth as number) - comp.AABBBounds.width() - pagerSpace;\n\n if (contentSize <= 0) {\n // 布局空间不够则不进行分页器渲染\n this._innerView.removeChild(comp as unknown as INode);\n return false;\n }\n\n // 重新进行布局\n (itemsContainer.getChildren() as unknown as IGroup[]).forEach((item, index) => {\n const { width, height } = item.attribute;\n\n if (contentSize < startX + (width as number)) {\n // 超出了,则换行\n startX = 0;\n startY += (height as number) + spaceRow;\n pages += 1;\n }\n if (index > 0) {\n item.setAttributes({\n x: startX,\n y: startY\n });\n }\n startX += spaceCol + (width as number);\n });\n\n this._itemContext.startX = startX;\n this._itemContext.startY = startY;\n this._itemContext.pages = pages;\n const total = Math.ceil(pages / maxRow);\n\n this._itemContext.totalPage = total;\n\n this._updatePositionOfPager(isScrollbar, isHorizontal, contentSize, renderStartY, compSize);\n } else {\n compSize = this._itemMaxWidth * maxCol + (maxCol - 1) * spaceCol;\n // 垂直布局,支持左右翻页\n comp = this._createPager(isScrollbar, isHorizontal, compStyle, compSize);\n this._pagerComponent = comp;\n this._innerView.add(comp as unknown as INode);\n\n contentSize = (maxHeight as number) - comp.AABBBounds.height() - pagerSpace - renderStartY;\n\n if (contentSize <= 0) {\n // 布局空间不够则不进行分页器渲染\n this._innerView.removeChild(comp as unknown as INode);\n return false;\n }\n\n // 重新进行布局\n (itemsContainer.getChildren() as unknown as IGroup[]).forEach((item, index) => {\n const { height } = item.attribute;\n if (contentSize < startY + (height as number)) {\n startY = 0;\n startX += this._itemMaxWidth + spaceCol;\n pages += 1;\n }\n if (index > 0) {\n item.setAttributes({\n x: startX,\n y: startY\n });\n }\n startY += spaceRow + (height as number);\n });\n\n // todo\n const total = Math.ceil(pages / maxCol);\n\n this._itemContext.totalPage = total;\n this._updatePositionOfPager(isScrollbar, isHorizontal, contentSize, renderStartY, compSize);\n }\n\n // 初始化 defaultCurrent\n if (defaultCurrent > 1) {\n if (isHorizontal) {\n itemsContainer.setAttribute('y', -(defaultCurrent - 1) * (compSize + spaceRow));\n } else {\n itemsContainer.setAttribute('x', -(defaultCurrent - 1) * (compSize + spaceCol));\n }\n }\n\n const clipGroup = graphicCreator.group({\n x: 0,\n y: renderStartY,\n width: isHorizontal ? contentSize : compSize,\n height: isHorizontal ? compSize : contentSize,\n clip: true,\n pickable: false\n });\n clipGroup.add(itemsContainer);\n this._innerView.add(clipGroup);\n\n this._bindEventsOfPager(isScrollbar, isHorizontal, compSize, isHorizontal ? spaceRow : spaceCol);\n\n return true;\n }\n\n private _onHover = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGroup;\n if (target && target.name && target.name.startsWith(LEGEND_ELEMENT_NAME.item)) {\n // @ts-ignore\n const legendItem = target.delegate;\n\n // 如果上个激活元素存在,则判断当前元素是否和上个激活元素相同,相同则不做处理,不相同则触发 unhover\n if (this._lastActiveItem) {\n if (this._lastActiveItem.id === legendItem.id) {\n return;\n }\n this._unHover(this._lastActiveItem, e);\n }\n this._hover(legendItem, e);\n } else if (this._lastActiveItem) {\n this._unHover(this._lastActiveItem, e);\n this._lastActiveItem = null;\n }\n };\n\n private _onUnHover = (e: FederatedPointerEvent) => {\n if (this._lastActiveItem) {\n this._unHover(this._lastActiveItem, e);\n this._lastActiveItem = null;\n }\n };\n\n private _onClick = (e: FederatedPointerEvent) => {\n const target = e.target as unknown as IGroup;\n if (target && target.name && target.name.startsWith(LEGEND_ELEMENT_NAME.item)) {\n // @ts-ignore\n const legendItem = target.delegate;\n\n // 图例聚焦功能\n if (target.name === LEGEND_ELEMENT_NAME.focus) {\n const isFocusSelected = legendItem.hasState(LegendStateValue.focus);\n legendItem.toggleState(LegendStateValue.focus);\n\n if (isFocusSelected) {\n // 当前为选中态,则再次点击变成全选\n this._itemsContainer?.getChildren().forEach(item => {\n this._removeLegendItemState(\n item as unknown as IGroup,\n [LegendStateValue.unSelected, LegendStateValue.unSelectedHover, LegendStateValue.focus],\n e\n );\n this._setLegendItemState(item as unknown as IGroup, LegendStateValue.selected, e);\n });\n } else {\n this._setLegendItemState(legendItem, LegendStateValue.selected, e);\n this._removeLegendItemState(legendItem, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover], e);\n // 单选逻辑,当前被点击的图例项设置为选中态,其他全部设置为非选中态\n this._itemsContainer?.getChildren().forEach(item => {\n if (legendItem !== item) {\n this._removeLegendItemState(\n item as unknown as IGroup,\n [LegendStateValue.selected, LegendStateValue.selectedHover, LegendStateValue.focus],\n e\n );\n this._setLegendItemState(item as unknown as IGroup, LegendStateValue.unSelected, e);\n }\n });\n }\n } else {\n // 清除 focus 状态\n this._itemsContainer?.getChildren().forEach(item => {\n (item as unknown as IGroup).removeState(LegendStateValue.focus);\n });\n const { selectMode = 'multiple', allowAllCanceled = true } = this.attribute;\n const isSelected = legendItem.hasState(LegendStateValue.selected);\n const currentSelectedItems = this._getSelectedLegends();\n if (selectMode === 'multiple') {\n if (allowAllCanceled === false && isSelected && currentSelectedItems.length === 1) {\n this._dispatchLegendEvent(LegendEvent.legendItemClick, legendItem, e);\n return;\n }\n // 多选逻辑\n if (isSelected) {\n // 如果当前为选中状态,则取消选中\n this._removeLegendItemState(legendItem, [LegendStateValue.selected, LegendStateValue.selectedHover], e);\n this._setLegendItemState(legendItem, LegendStateValue.unSelected, e);\n } else {\n // 如果当前为非选中态,则设置为选中状态\n this._setLegendItemState(legendItem, LegendStateValue.selected, e);\n this._removeLegendItemState(legendItem, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover], e);\n }\n } else {\n this._setLegendItemState(legendItem, LegendStateValue.selected, e);\n this._removeLegendItemState(legendItem, [LegendStateValue.unSelected, LegendStateValue.unSelectedHover], e);\n\n // 单选逻辑,当前被点击的图例项设置为选中态,其他全部设置为非选中态\n this._itemsContainer?.getChildren().forEach(item => {\n if (legendItem !== item) {\n this._removeLegendItemState(\n item as unknown as IGroup,\n [LegendStateValue.selected, LegendStateValue.selectedHover],\n e\n );\n this._setLegendItemState(item as unknown as IGroup, LegendStateValue.unSelected, e);\n }\n });\n }\n }\n\n this._dispatchLegendEvent(LegendEvent.legendItemClick, legendItem, e);\n }\n };\n\n private _hover(legendItem: IGroup, e: FederatedPointerEvent) {\n this._lastActiveItem = legendItem;\n const selected = legendItem.hasState(LegendStateValue.selected);\n\n if (selected) {\n // use selectedHover state\n this._setLegendItemState(legendItem, LegendStateValue.selectedHover, e);\n } else {\n // use unSelectedHover state\n this._setLegendItemState(legendItem, LegendStateValue.unSelectedHover, e);\n }\n\n const focusButton = (legendItem.getChildren()[0] as unknown as IGroup).find(\n node => node.name === LEGEND_ELEMENT_NAME.focus,\n false\n ) as IGraphic;\n if (focusButton) {\n focusButton.setAttribute('visible', true);\n }\n\n this._dispatchLegendEvent(LegendEvent.legendItemHover, legendItem, e);\n }\n\n private _unHover(legendItem: IGroup, e: FederatedPointerEvent) {\n let attributeUpdate = false;\n if (legendItem.hasState(LegendStateValue.unSelectedHover) || legendItem.hasState(LegendStateValue.selectedHover)) {\n attributeUpdate = true;\n }\n legendItem.removeState(LegendStateValue.unSelectedHover);\n legendItem.removeState(LegendStateValue.selectedHover);\n legendItem\n .getChildren()[0]\n .getChildren()\n .forEach((child: any) => {\n if (\n !attributeUpdate &&\n (child.hasState(LegendStateValue.unSelectedHover) || child.hasState(LegendStateValue.selectedHover))\n ) {\n attributeUpdate = true;\n }\n (child as unknown as IGraphic).removeState(LegendStateValue.unSelectedHover);\n (child as unknown as IGraphic).removeState(LegendStateValue.selectedHover);\n });\n\n const focusButton = (legendItem.getChildren()[0] as unknown as IGroup).find(\n node => node.name === LEGEND_ELEMENT_NAME.focus,\n false\n ) as IGraphic;\n if (focusButton) {\n focusButton.setAttribute('visible', false);\n }\n\n if (attributeUpdate) {\n this._dispatchLegendEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e);\n }\n this._dispatchLegendEvent(LegendEvent.legendItemUnHover, legendItem, e);\n }\n\n private _setLegendItemState(legendItem: IGroup, stateName: string, e?: FederatedPointerEvent) {\n const keepCurrentStates = true;\n let attributeUpdate = false;\n if (!legendItem.hasState(stateName)) {\n attributeUpdate = true;\n }\n legendItem.addState(stateName, keepCurrentStates);\n // TODO: 这个比较 hack\n legendItem\n .getChildren()[0]\n .getChildren()\n .forEach((child: IGraphic) => {\n if (child.name !== LEGEND_ELEMENT_NAME.focus) {\n if (!attributeUpdate && !child.hasState(stateName)) {\n attributeUpdate = true;\n }\n (child as unknown as IGraphic).addState(stateName, keepCurrentStates);\n }\n });\n if (attributeUpdate) {\n this._dispatchLegendEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e);\n }\n }\n\n private _removeLegendItemState(legendItem: IGroup, stateNames: string[], e?: FederatedPointerEvent) {\n let attributeUpdate = false;\n stateNames.forEach(name => {\n if (!attributeUpdate && legendItem.hasState(name)) {\n attributeUpdate = true;\n }\n legendItem.removeState(name);\n });\n // TODO: 这个比较 hack\n legendItem\n .getChildren()[0]\n .getChildren()\n .forEach(child => {\n if (child.name !== LEGEND_ELEMENT_NAME.focus) {\n stateNames.forEach(name => {\n if (!attributeUpdate && (child as unknown as IGraphic).hasState(name)) {\n attributeUpdate = true;\n }\n (child as unknown as IGraphic).removeState(name);\n });\n }\n });\n if (attributeUpdate) {\n this._dispatchLegendEvent(LegendEvent.legendItemAttributeUpdate, legendItem, e);\n }\n }\n\n // 获取当前选中的图例项\n private _getSelectedLegends() {\n const selectedData: LegendItemDatum[] = [];\n this._itemsContainer?.getChildren().forEach(item => {\n if ((item as unknown as IGroup).hasState(LegendStateValue.selected)) {\n // @ts-ignore\n selectedData.push(item.data);\n }\n });\n\n return selectedData;\n }\n\n private _appendDataToShape(shape: any, name: string, data: any, delegateShape: any, states: any = {}) {\n shape.name = name;\n shape.data = data;\n shape.delegate = delegateShape;\n shape.states = merge({}, DEFAULT_STATES, states);\n }\n\n private _dispatchLegendEvent(eventName: string, legendItem: any, event: FederatedPointerEvent) {\n const currentSelectedItems = this._getSelectedLegends();\n // 需要保持显示顺序\n currentSelectedItems.sort((pre: LegendItemDatum, next: LegendItemDatum) => pre.index - next.index);\n\n const currentSelected = currentSelectedItems.map((obj: LegendItemDatum) => obj.label);\n\n this._dispatchEvent(eventName, {\n item: legendItem, // 当前被选中的图例项整体\n data: legendItem.data, // 当前图例项的数据\n selected: legendItem.hasState(LegendStateValue.selected), // 当前图例项是否被选中\n currentSelectedItems,\n currentSelected,\n event\n });\n }\n\n // 处理回调函数\n private _handleStyle(\n config: any,\n item: LegendItemDatum,\n isSelected: boolean,\n index: number,\n items: LegendItemDatum[]\n ) {\n const newConfig: any = {};\n // 处理下样式\n if (config.style) {\n if (isFunction(config.style)) {\n newConfig.style = config.style(item, isSelected, index, items);\n } else {\n newConfig.style = config.style;\n }\n }\n\n if (config.state) {\n newConfig.state = {};\n\n Object.keys(config.state).forEach(key => {\n if (config.state[key]) {\n if (isFunction(config.state[key])) {\n newConfig.state[key] = config.state[key](item, isSelected, index, items);\n } else {\n newConfig.state[key] = config.state[key];\n }\n }\n });\n }\n\n return newConfig;\n }\n}\n"]}
|
package/cjs/marker/base.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare abstract class Marker<T extends MarkerAttrs> extends AbstractComp
|
|
|
11
11
|
protected abstract initMarker(container: IGroup): any;
|
|
12
12
|
protected abstract updateMarker(): any;
|
|
13
13
|
protected abstract isValidPoints(): any;
|
|
14
|
-
setAttribute(key:
|
|
14
|
+
setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined): void;
|
|
15
15
|
private _initContainer;
|
|
16
16
|
private _updateContainer;
|
|
17
17
|
protected render(): void;
|
package/cjs/marker/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/base.ts"],"names":[],"mappings":";;;AACA,yDAAwD;AACxD,uCAAiD;AAIjD,MAAsB,MAA8B,SAAQ,wBAA8B;IAA1F;;QACE,SAAI,GAAG,QAAQ,CAAC;IAoFlB,CAAC;IAzEC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"sources":["../src/marker/base.ts"],"names":[],"mappings":";;;AACA,yDAAwD;AACxD,uCAAiD;AAIjD,MAAsB,MAA8B,SAAQ,wBAA8B;IAA1F;;QACE,SAAI,GAAG,QAAQ,CAAC;IAoFlB,CAAC;IAzEC,YAAY,CAAC,GAAW,E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AI,IAAI,CAAC,cAAc,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,aAAa,mBAC5B,SAAS,EACZ,CAAC;SACJ;QAED,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;YAC5B,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,MAAA,SAAS,CAAC,CAAC,mCAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,MAAA,SAAS,CAAC,CAAC,mCAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACzC,CAAC,CAAC;IACL,CAAC;IAES,MAAM;;QAEd,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAErC,MAAM,aAAa,GAAG,MAAA,IAAI,CAAC,SAAS,CAAC,OAAO,mCAAI,IAAI,CAAC;QACrD,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,KAAK,KAAK,EAAE;YACxC,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;SAC9C;QAED,IAAI,aAAa,IAAI,IAAI,CAAC,aAAa,EAAE,EAAE;YACzC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;gBACpB,IAAI,CAAC,cAAc,EAAE,CAAC;gBACtB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;aAClC;iBAAM;gBACL,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACxB,IAAI,CAAC,YAAY,EAAE,CAAC;aACrB;SACF;aAAM;YACL,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;YACvB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;SAC3B;IACH,CAAC;CACF;AArFD,wBAqFC","file":"base.js","sourcesContent":["import type { IGroup } from '@visactor/vrender-core';\nimport { graphicCreator } from '@visactor/vrender-core';\nimport { AbstractComponent } from '../core/base';\nimport type { Tag } from '../tag';\nimport type { MarkerAttrs } from './type';\n\nexport abstract class Marker<T extends MarkerAttrs> extends AbstractComponent<Required<T>> {\n name = 'marker';\n private _containerClip!: IGroup;\n private _container!: IGroup;\n\n protected _label!: Tag;\n\n protected abstract setLabelPos(): any;\n protected abstract initMarker(container: IGroup): any;\n protected abstract updateMarker(): any;\n protected abstract isValidPoints(): any;\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean | undefined): void {\n super.setAttribute(key, value, forceUpdateTag);\n if (key === 'visible') {\n this.render();\n }\n }\n\n private _initContainer() {\n const { limitRect = {} as T['limitRect'], clipInRange } = this.attribute;\n let group;\n if (clipInRange) {\n // 如果用户配置了剪切\n const groupClip = graphicCreator.group({\n ...limitRect,\n clip: true,\n pickable: false\n });\n group = graphicCreator.group({\n x: -(limitRect.x ?? 0),\n y: -(limitRect.y ?? 0),\n pickable: false\n });\n groupClip.add(group);\n this._containerClip = groupClip;\n this.add(groupClip);\n } else {\n group = graphicCreator.group({\n x: 0,\n y: 0,\n pickable: false\n });\n this.add(group);\n }\n group.name = 'marker-container';\n this._container = group;\n }\n\n private _updateContainer() {\n const { limitRect = {} as T['limitRect'], clipInRange } = this.attribute;\n if (this._containerClip) {\n this._containerClip.setAttributes({\n ...limitRect\n });\n }\n\n this._container.setAttributes({\n x: clipInRange ? -(limitRect.x ?? 0) : 0,\n y: clipInRange ? -(limitRect.y ?? 0) : 0\n });\n }\n\n protected render() {\n // 因为标注本身不规则,所以默认将组件的 group 设置为不可拾取\n this.setAttribute('pickable', false);\n\n const markerVisible = this.attribute.visible ?? true;\n if (this.attribute.interactive === false) {\n this.setAttribute('childrenPickable', false);\n }\n\n if (markerVisible && this.isValidPoints()) {\n if (!this._container) {\n this._initContainer();\n this.initMarker(this._container);\n } else {\n this._updateContainer();\n this.updateMarker();\n }\n } else {\n this._container = null;\n this.removeAllChild(true);\n }\n }\n}\n"]}
|