@visactor/vrender-components 0.22.7-alpha.8 → 0.22.7
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/util.js +5 -5
- package/cjs/axis/util.js.map +1 -1
- package/cjs/brush/brush.d.ts +4 -7
- package/cjs/brush/brush.js +67 -53
- package/cjs/brush/brush.js.map +1 -1
- package/cjs/brush/config.d.ts +1 -1
- package/cjs/brush/config.js +1 -1
- package/cjs/brush/config.js.map +1 -1
- package/cjs/brush/type.js.map +1 -1
- package/cjs/data-zoom/data-zoom.d.ts +3 -0
- package/cjs/data-zoom/data-zoom.js +39 -24
- package/cjs/data-zoom/data-zoom.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/marker/animate/animate.d.ts +3 -3
- package/cjs/marker/animate/animate.js.map +1 -1
- package/cjs/marker/animate/clip-in.d.ts +1 -1
- package/cjs/marker/animate/clip-in.js +6 -3
- package/cjs/marker/animate/clip-in.js.map +1 -1
- package/cjs/marker/animate/fade-in.d.ts +3 -3
- package/cjs/marker/animate/fade-in.js +10 -4
- package/cjs/marker/animate/fade-in.js.map +1 -1
- package/cjs/marker/animate/fade-out.d.ts +3 -3
- package/cjs/marker/animate/fade-out.js +10 -4
- package/cjs/marker/animate/fade-out.js.map +1 -1
- package/cjs/marker/arc-area.d.ts +8 -5
- package/cjs/marker/arc-area.js +18 -39
- package/cjs/marker/arc-area.js.map +1 -1
- package/cjs/marker/arc-line.d.ts +6 -4
- package/cjs/marker/arc-line.js +12 -9
- package/cjs/marker/arc-line.js.map +1 -1
- package/cjs/marker/area.d.ts +6 -4
- package/cjs/marker/area.js +14 -32
- package/cjs/marker/area.js.map +1 -1
- package/cjs/marker/base.d.ts +2 -3
- package/cjs/marker/base.js.map +1 -1
- package/cjs/marker/common-line.d.ts +11 -7
- package/cjs/marker/common-line.js +11 -31
- package/cjs/marker/common-line.js.map +1 -1
- package/cjs/marker/config.d.ts +2 -0
- package/cjs/marker/config.js +2 -0
- package/cjs/marker/config.js.map +1 -1
- package/cjs/marker/line.d.ts +6 -4
- package/cjs/marker/line.js +10 -4
- package/cjs/marker/line.js.map +1 -1
- package/cjs/marker/mixin/label.d.ts +16 -0
- package/cjs/marker/mixin/label.js +57 -0
- package/cjs/marker/mixin/label.js.map +1 -0
- package/cjs/marker/type.d.ts +19 -16
- package/cjs/marker/type.js.map +1 -1
- package/cjs/poptip/contribution.js +4 -2
- package/cjs/poptip/contribution.js.map +1 -1
- package/cjs/poptip/poptip.d.ts +5 -0
- package/cjs/poptip/poptip.js +87 -18
- package/cjs/poptip/poptip.js.map +1 -1
- package/cjs/poptip/type.d.ts +4 -1
- package/cjs/poptip/type.js.map +1 -1
- package/cjs/scrollbar/scrollbar.d.ts +1 -0
- package/cjs/scrollbar/scrollbar.js +21 -12
- package/cjs/scrollbar/scrollbar.js.map +1 -1
- package/cjs/slider/slider.d.ts +3 -0
- package/cjs/slider/slider.js +48 -27
- package/cjs/slider/slider.js.map +1 -1
- package/cjs/switch/switch.js +2 -2
- package/cjs/switch/switch.js.map +1 -1
- package/cjs/util/event.d.ts +1 -0
- package/cjs/util/event.js +14 -0
- package/cjs/util/event.js.map +1 -0
- package/dist/index.es.js +473 -351
- package/es/axis/util.js +5 -6
- package/es/axis/util.js.map +1 -1
- package/es/brush/brush.d.ts +4 -7
- package/es/brush/brush.js +70 -55
- package/es/brush/brush.js.map +1 -1
- package/es/brush/config.d.ts +1 -1
- package/es/brush/config.js +1 -1
- package/es/brush/config.js.map +1 -1
- package/es/brush/type.js.map +1 -1
- package/es/data-zoom/data-zoom.d.ts +3 -0
- package/es/data-zoom/data-zoom.js +38 -21
- package/es/data-zoom/data-zoom.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/marker/animate/animate.d.ts +3 -3
- package/es/marker/animate/animate.js.map +1 -1
- package/es/marker/animate/clip-in.d.ts +1 -1
- package/es/marker/animate/clip-in.js +6 -2
- package/es/marker/animate/clip-in.js.map +1 -1
- package/es/marker/animate/fade-in.d.ts +3 -3
- package/es/marker/animate/fade-in.js +11 -3
- package/es/marker/animate/fade-in.js.map +1 -1
- package/es/marker/animate/fade-out.d.ts +3 -3
- package/es/marker/animate/fade-out.js +11 -3
- package/es/marker/animate/fade-out.js.map +1 -1
- package/es/marker/arc-area.d.ts +8 -5
- package/es/marker/arc-area.js +19 -41
- package/es/marker/arc-area.js.map +1 -1
- package/es/marker/arc-line.d.ts +6 -4
- package/es/marker/arc-line.js +12 -9
- package/es/marker/arc-line.js.map +1 -1
- package/es/marker/area.d.ts +6 -4
- package/es/marker/area.js +15 -34
- package/es/marker/area.js.map +1 -1
- package/es/marker/base.d.ts +2 -3
- package/es/marker/base.js.map +1 -1
- package/es/marker/common-line.d.ts +11 -7
- package/es/marker/common-line.js +14 -34
- package/es/marker/common-line.js.map +1 -1
- package/es/marker/config.d.ts +2 -0
- package/es/marker/config.js +2 -0
- package/es/marker/config.js.map +1 -1
- package/es/marker/line.d.ts +6 -4
- package/es/marker/line.js +10 -4
- package/es/marker/line.js.map +1 -1
- package/es/marker/mixin/label.d.ts +16 -0
- package/es/marker/mixin/label.js +45 -0
- package/es/marker/mixin/label.js.map +1 -0
- package/es/marker/type.d.ts +19 -16
- package/es/marker/type.js.map +1 -1
- package/es/poptip/contribution.js +4 -2
- package/es/poptip/contribution.js.map +1 -1
- package/es/poptip/poptip.d.ts +5 -0
- package/es/poptip/poptip.js +85 -19
- package/es/poptip/poptip.js.map +1 -1
- package/es/poptip/type.d.ts +4 -1
- package/es/poptip/type.js.map +1 -1
- package/es/scrollbar/scrollbar.d.ts +1 -0
- package/es/scrollbar/scrollbar.js +22 -11
- package/es/scrollbar/scrollbar.js.map +1 -1
- package/es/slider/slider.d.ts +3 -0
- package/es/slider/slider.js +49 -26
- package/es/slider/slider.js.map +1 -1
- package/es/switch/switch.js +2 -2
- package/es/switch/switch.js.map +1 -1
- package/es/util/event.d.ts +1 -0
- package/es/util/event.js +6 -0
- package/es/util/event.js.map +1 -0
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/animate/animate.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,UAAU,qBAAqB,CACnC,IAA0B,EAC1B,
|
|
1
|
+
{"version":3,"sources":["../src/marker/animate/animate.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,UAAU,qBAAqB,CACnC,IAA0B,EAC1B,KAAkB,EAClB,eAAoB,EACpB,KAA2B;IAE3B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;IAChD,IAAI,KAAK,KAAK,OAAO,EAAE;QACrB,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;QAChD,IAAI,IAAI,KAAK,QAAQ,EAAE;YACrB,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;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,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;KACvE;AACH,CAAC;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAuD;IAChG,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACF,CAAC;AAET,MAAM,CAAC,MAAM,8BAA8B,GAAuD;IAChG,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACF,CAAC;AAET,MAAM,CAAC,MAAM,+BAA+B,GAAkD;IAC5F,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACF,CAAC;AAET,MAAM,CAAC,MAAM,0BAA0B,GAAwB;IAC7D,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,CAAC;CACT,CAAC","file":"animate.js","sourcesContent":["import type { IRichText, ISymbol, IImage, IArc } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport type { ILine, IPolygon } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport type {\n CommonMarkAreaAnimationType,\n MarkCommonLineAnimationType,\n MarkPointAnimationType,\n MarkerAnimationState,\n MarkerExitAnimation,\n MarkerUpdateAnimation\n} from '../type';\nimport { commonLineClipIn } from './clip-in';\nimport { areaFadeIn, commonLineFadeIn, arcAreaFadeIn, pointFadeIn } from './fade-in';\nimport { areaFadeOut, commonLineFadeOut, arcAreaFadeOut, pointFadeOut } from './fade-out';\nimport { pointCallIn } from './call-in';\n\nexport function markCommonLineAnimate(\n line: Segment | ArcSegment,\n label: Tag | Tag[],\n animationconfig: any,\n state: MarkerAnimationState\n) {\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'clipIn') {\n commonLineClipIn(line, label, duration, delay, easing);\n } else if (type === 'fadeIn') {\n commonLineFadeIn(line, label, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'clipIn') {\n commonLineClipIn(line, label, duration, delay, easing);\n } else if (type === 'fadeIn') {\n commonLineFadeIn(line, label, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n commonLineFadeOut(line, label, duration, delay, easing);\n }\n}\n\nexport function markAreaAnimate(area: IPolygon, label: Tag | Tag[], animationconfig: any, state: MarkerAnimationState) {\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'fadeIn') {\n areaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'fadeIn') {\n areaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n areaFadeOut(area, label, duration, delay, easing);\n }\n}\n\nexport function markArcAreaAnimate(area: IArc, label: Tag | Tag[], animationconfig: any, state: MarkerAnimationState) {\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'fadeIn') {\n arcAreaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'fadeIn') {\n arcAreaFadeIn(area, label, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n arcAreaFadeOut(area, label, duration, delay, easing);\n }\n}\n\nexport function markPointAnimate(\n lines: [Segment, ILine],\n item: Tag | IRichText | ISymbol | IImage,\n animationconfig: any,\n state: MarkerAnimationState\n) {\n const [itemLine, decorativeLine] = lines;\n const { enter, update, exit } = animationconfig;\n if (state === 'enter') {\n const { type, duration, delay, easing } = enter;\n if (type === 'fadeIn') {\n pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing);\n } else if (type === 'callIn') {\n pointCallIn(itemLine, decorativeLine, item, duration, delay, easing);\n }\n } else if (state === 'update') {\n const { type, duration, delay, easing } = update;\n if (type === 'fadeIn') {\n pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing);\n } else if (type === 'callIn') {\n pointCallIn(itemLine, decorativeLine, item, duration, delay, easing);\n }\n } else if (state === 'exit') {\n const { duration, delay, easing } = exit;\n pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing);\n }\n}\n\nexport const DefaultUpdateMarkLineAnimation: MarkerUpdateAnimation<MarkCommonLineAnimationType> = {\n type: 'clipIn',\n duration: 500,\n easing: 'linear',\n delay: 0\n} as any;\n\nexport const DefaultUpdateMarkAreaAnimation: MarkerUpdateAnimation<CommonMarkAreaAnimationType> = {\n type: 'fadeIn',\n duration: 500,\n easing: 'linear',\n delay: 0\n} as any;\n\nexport const DefaultUpdateMarkPointAnimation: MarkerUpdateAnimation<MarkPointAnimationType> = {\n type: 'callIn',\n duration: 500,\n easing: 'linear',\n delay: 0\n} as any;\n\nexport const DefaultExitMarkerAnimation: MarkerExitAnimation = {\n type: 'fadeOut',\n duration: 500,\n easing: 'linear',\n delay: 0\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { EasingType } from '@visactor/vrender-core';
|
|
2
2
|
import type { ArcSegment, Segment } from '../../segment';
|
|
3
3
|
import type { Tag } from '../../tag';
|
|
4
|
-
export declare function commonLineClipIn(line: Segment | ArcSegment, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
4
|
+
export declare function commonLineClipIn(line: Segment | ArcSegment, label: Tag | Tag[], duration: number, delay: number, easing: EasingType): void;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { graphicFadeIn } from "./common";
|
|
2
2
|
|
|
3
|
+
import { array } from "@visactor/vutils";
|
|
4
|
+
|
|
3
5
|
export function commonLineClipIn(line, label, duration, delay, easing) {
|
|
4
6
|
const startSymbolDuration = .1 * duration, lineDuration = .7 * duration, endSymbolDuration = .1 * duration, labelDuration = .1 * duration;
|
|
5
7
|
graphicFadeIn(line.startSymbol, delay, startSymbolDuration, easing), line.lines.forEach((line => line.setAttribute("clipRange", 0))),
|
|
@@ -9,7 +11,9 @@ export function commonLineClipIn(line, label, duration, delay, easing) {
|
|
|
9
11
|
clipRange: 1
|
|
10
12
|
}, stepDuration, easing);
|
|
11
13
|
})), graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
array(label).forEach((labelNode => {
|
|
15
|
+
const delayTime = delay + startSymbolDuration + lineDuration + endSymbolDuration;
|
|
16
|
+
graphicFadeIn(labelNode.getTextShape(), delayTime, labelDuration, easing), graphicFadeIn(labelNode.getBgRect(), delayTime, labelDuration, easing);
|
|
17
|
+
}));
|
|
14
18
|
}
|
|
15
19
|
//# sourceMappingURL=clip-in.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/animate/clip-in.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,gBAAgB,CAC9B,IAA0B,EAC1B,
|
|
1
|
+
{"version":3,"sources":["../src/marker/animate/clip-in.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,UAAU,gBAAgB,CAC9B,IAA0B,EAC1B,KAAkB,EAClB,QAAgB,EAChB,KAAa,EACb,MAAkB;IAElB,MAAM,mBAAmB,GAAG,GAAG,GAAG,QAAQ,CAAC;IAC3C,MAAM,YAAY,GAAG,GAAG,GAAG,QAAQ,CAAC;IACpC,MAAM,iBAAiB,GAAG,GAAG,GAAG,QAAQ,CAAC;IACzC,MAAM,aAAa,GAAG,GAAG,GAAG,QAAQ,CAAC;IAGrC,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC;IAGpE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QAC9B,MAAM,YAAY,GAAG,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;QACtD,CAAC,CAAC,OAAO,EAAE;aACR,IAAI,CAAC,KAAK,GAAG,mBAAmB,GAAG,KAAK,GAAG,YAAY,CAAC;aACxD,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAGH,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,mBAAmB,GAAG,YAAY,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAGrG,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAC/B,MAAM,SAAS,GAAG,KAAK,GAAG,mBAAmB,GAAG,YAAY,GAAG,iBAAiB,CAAC;QAEjF,aAAa,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;QAG1E,aAAa,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;AACL,CAAC","file":"clip-in.js","sourcesContent":["import type { EasingType } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport { graphicFadeIn } from './common';\nimport { array } from '@visactor/vutils';\n\nexport function commonLineClipIn(\n line: Segment | ArcSegment,\n label: Tag | Tag[],\n duration: number,\n delay: number,\n easing: EasingType\n) {\n const startSymbolDuration = 0.1 * duration;\n const lineDuration = 0.7 * duration;\n const endSymbolDuration = 0.1 * duration;\n const labelDuration = 0.1 * duration;\n\n // start symbol\n graphicFadeIn(line.startSymbol, delay, startSymbolDuration, easing);\n\n // line\n line.lines.forEach(line => line.setAttribute('clipRange', 0));\n line.lines.forEach((l, index) => {\n const stepDuration = lineDuration / line.lines.length;\n l.animate()\n .wait(delay + startSymbolDuration + index * stepDuration)\n .to({ clipRange: 1 }, stepDuration, easing);\n });\n\n // end symbol\n graphicFadeIn(line.endSymbol, delay + startSymbolDuration + lineDuration, endSymbolDuration, easing);\n\n // label\n array(label).forEach(labelNode => {\n const delayTime = delay + startSymbolDuration + lineDuration + endSymbolDuration;\n // text\n graphicFadeIn(labelNode.getTextShape(), delayTime, labelDuration, easing);\n\n // text background\n graphicFadeIn(labelNode.getBgRect(), delayTime, labelDuration, easing);\n });\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';
|
|
2
2
|
import type { ArcSegment, Segment } from '../../segment';
|
|
3
3
|
import type { Tag } from '../../tag';
|
|
4
|
-
export declare function commonLineFadeIn(line: Segment | ArcSegment, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
5
|
-
export declare function areaFadeIn(area: IPolygon, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
6
|
-
export declare function arcAreaFadeIn(area: IArc, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
4
|
+
export declare function commonLineFadeIn(line: Segment | ArcSegment, label: Tag | Tag[], duration: number, delay: number, easing: EasingType): void;
|
|
5
|
+
export declare function areaFadeIn(area: IPolygon, label: Tag | Tag[], duration: number, delay: number, easing: EasingType): void;
|
|
6
|
+
export declare function arcAreaFadeIn(area: IArc, label: Tag | Tag[], duration: number, delay: number, easing: EasingType): void;
|
|
7
7
|
export declare function pointFadeIn(itemLine: Segment, decorativeLine: ILine, item: Tag | IRichText | ISymbol | IImage, duration: number, delay: number, easing: EasingType): void;
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { graphicFadeIn, segmentFadeIn, tagFadeIn } from "./common";
|
|
2
2
|
|
|
3
|
+
import { array } from "@visactor/vutils";
|
|
4
|
+
|
|
3
5
|
export function commonLineFadeIn(line, label, duration, delay, easing) {
|
|
4
|
-
segmentFadeIn(line, delay, duration, easing),
|
|
6
|
+
segmentFadeIn(line, delay, duration, easing), array(label).forEach((labelNode => {
|
|
7
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
8
|
+
}));
|
|
5
9
|
}
|
|
6
10
|
|
|
7
11
|
export function areaFadeIn(area, label, duration, delay, easing) {
|
|
8
|
-
graphicFadeIn(area, delay, duration, easing),
|
|
12
|
+
graphicFadeIn(area, delay, duration, easing), array(label).forEach((labelNode => {
|
|
13
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
14
|
+
}));
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
export function arcAreaFadeIn(area, label, duration, delay, easing) {
|
|
12
|
-
graphicFadeIn(area, delay, duration, easing),
|
|
18
|
+
graphicFadeIn(area, delay, duration, easing), array(label).forEach((labelNode => {
|
|
19
|
+
tagFadeIn(labelNode, delay, duration, easing);
|
|
20
|
+
}));
|
|
13
21
|
}
|
|
14
22
|
|
|
15
23
|
export function pointFadeIn(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/animate/fade-in.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"sources":["../src/marker/animate/fade-in.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACn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AC,CAAC;IACjD,aAAa,CAAC,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACvD,IAAI,MAAA,IAAI,CAAC,YAAY,oDAAI,EAAE;QAEzB,SAAS,CAAC,IAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KACjD;SAAM;QAEL,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAC9C;AACH,CAAC","file":"fade-in.js","sourcesContent":["import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport { graphicFadeIn, segmentFadeIn, tagFadeIn } from './common';\nimport { array } from '@visactor/vutils';\n\nexport function commonLineFadeIn(\n line: Segment | ArcSegment,\n label: Tag | Tag[],\n duration: number,\n delay: number,\n easing: EasingType\n) {\n segmentFadeIn(line, delay, duration, easing);\n\n // label\n array(label).forEach(labelNode => {\n tagFadeIn(labelNode, delay, duration, easing);\n });\n}\n\nexport function areaFadeIn(area: IPolygon, label: Tag | Tag[], duration: number, delay: number, easing: EasingType) {\n graphicFadeIn(area, delay, duration, easing);\n array(label).forEach(labelNode => {\n tagFadeIn(labelNode, delay, duration, easing);\n });\n}\n\nexport function arcAreaFadeIn(area: IArc, label: Tag | Tag[], duration: number, delay: number, easing: EasingType) {\n graphicFadeIn(area, delay, duration, easing);\n array(label).forEach(labelNode => {\n tagFadeIn(labelNode, delay, duration, easing);\n });\n}\n\nexport function pointFadeIn(\n itemLine: Segment,\n decorativeLine: ILine,\n item: Tag | IRichText | ISymbol | IImage,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n segmentFadeIn(itemLine, delay, duration, easing);\n graphicFadeIn(decorativeLine, delay, duration, easing);\n if (item.getTextShape?.()) {\n // tag\n tagFadeIn(item as Tag, delay, duration, easing);\n } else {\n // symbol / richText / image\n graphicFadeIn(item, delay, duration, easing);\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';
|
|
2
2
|
import type { ArcSegment, Segment } from '../../segment';
|
|
3
3
|
import type { Tag } from '../../tag';
|
|
4
|
-
export declare function commonLineFadeOut(line: Segment | ArcSegment, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
5
|
-
export declare function areaFadeOut(area: IPolygon, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
6
|
-
export declare function arcAreaFadeOut(area: IArc, label: Tag, duration: number, delay: number, easing: EasingType): void;
|
|
4
|
+
export declare function commonLineFadeOut(line: Segment | ArcSegment, label: Tag | Tag[], duration: number, delay: number, easing: EasingType): void;
|
|
5
|
+
export declare function areaFadeOut(area: IPolygon, label: Tag | Tag[], duration: number, delay: number, easing: EasingType): void;
|
|
6
|
+
export declare function arcAreaFadeOut(area: IArc, label: Tag | Tag[], duration: number, delay: number, easing: EasingType): void;
|
|
7
7
|
export declare function pointFadeOut(itemLine: Segment, decorativeLine: ILine, item: Tag | IRichText | ISymbol | IImage, duration: number, delay: number, easing: EasingType): void;
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { graphicFadeOut, segmentFadeOut, tagFadeOut } from "./common";
|
|
2
2
|
|
|
3
|
+
import { array } from "@visactor/vutils";
|
|
4
|
+
|
|
3
5
|
export function commonLineFadeOut(line, label, duration, delay, easing) {
|
|
4
|
-
segmentFadeOut(line, delay, duration, easing),
|
|
6
|
+
segmentFadeOut(line, delay, duration, easing), array(label).forEach((labelNode => {
|
|
7
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
8
|
+
}));
|
|
5
9
|
}
|
|
6
10
|
|
|
7
11
|
export function areaFadeOut(area, label, duration, delay, easing) {
|
|
8
|
-
graphicFadeOut(area, delay, duration, easing),
|
|
12
|
+
graphicFadeOut(area, delay, duration, easing), array(label).forEach((labelNode => {
|
|
13
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
14
|
+
}));
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
export function arcAreaFadeOut(area, label, duration, delay, easing) {
|
|
12
|
-
graphicFadeOut(area, delay, duration, easing),
|
|
18
|
+
graphicFadeOut(area, delay, duration, easing), array(label).forEach((labelNode => {
|
|
19
|
+
tagFadeOut(labelNode, delay, duration, easing);
|
|
20
|
+
}));
|
|
13
21
|
}
|
|
14
22
|
|
|
15
23
|
export function pointFadeOut(itemLine, decorativeLine, item, duration, delay, easing) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/animate/fade-out.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"sources":["../src/marker/animate/fade-out.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,UAAU,iBAAiB,CAC/B,IAA0B,EAC1B,KAAkB,EAClB,QAAgB,EAChB,KAAa,EACb,MAAkB;IAElB,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAG9C,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAC/B,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAc,EAAE,KAAkB,EAAE,QAAgB,EAAE,KAAa,EAAE,MAAkB;IACjH,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAC/B,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAU,EAAE,KAAkB,EAAE,QAAgB,EAAE,KAAa,EAAE,MAAkB;IAChH,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QAC/B,UAAU,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,QAAiB,EACjB,cAAqB,EACrB,IAAwC,EACxC,QAAgB,EAChB,KAAa,EACb,MAAkB;;IAElB,cAAc,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClD,cAAc,CAAC,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACxD,IAAI,MAAA,IAAI,CAAC,YAAY,oDAAI,EAAE;QAEzB,UAAU,CAAC,IAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAClD;SAAM;QAEL,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;KAC/C;AACH,CAAC","file":"fade-out.js","sourcesContent":["import type { EasingType, IArc, IImage, ILine, IPolygon, IRichText, ISymbol } from '@visactor/vrender-core';\nimport type { ArcSegment, Segment } from '../../segment';\nimport type { Tag } from '../../tag';\nimport { graphicFadeOut, segmentFadeOut, tagFadeOut } from './common';\nimport { array } from '@visactor/vutils';\n\nexport function commonLineFadeOut(\n line: Segment | ArcSegment,\n label: Tag | Tag[],\n duration: number,\n delay: number,\n easing: EasingType\n) {\n segmentFadeOut(line, delay, duration, easing);\n\n // label\n array(label).forEach(labelNode => {\n tagFadeOut(labelNode, delay, duration, easing);\n });\n}\n\nexport function areaFadeOut(area: IPolygon, label: Tag | Tag[], duration: number, delay: number, easing: EasingType) {\n graphicFadeOut(area, delay, duration, easing);\n array(label).forEach(labelNode => {\n tagFadeOut(labelNode, delay, duration, easing);\n });\n}\n\nexport function arcAreaFadeOut(area: IArc, label: Tag | Tag[], duration: number, delay: number, easing: EasingType) {\n graphicFadeOut(area, delay, duration, easing);\n array(label).forEach(labelNode => {\n tagFadeOut(labelNode, delay, duration, easing);\n });\n}\n\nexport function pointFadeOut(\n itemLine: Segment,\n decorativeLine: ILine,\n item: Tag | IRichText | ISymbol | IImage,\n duration: number,\n delay: number,\n easing: EasingType\n) {\n segmentFadeOut(itemLine, delay, duration, easing);\n graphicFadeOut(decorativeLine, delay, duration, easing);\n if (item.getTextShape?.()) {\n // tag\n tagFadeOut(item as Tag, delay, duration, easing);\n } else {\n // symbol / richText / image\n graphicFadeOut(item, delay, duration, easing);\n }\n}\n"]}
|
package/es/marker/arc-area.d.ts
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import type { IArc, IGroup } from '@visactor/vrender-core';
|
|
2
|
-
import { Tag } from '../tag';
|
|
2
|
+
import type { Tag } from '../tag';
|
|
3
3
|
import { Marker } from './base';
|
|
4
|
-
import type { CommonMarkAreaAnimationType, MarkerAnimationState } from './type';
|
|
4
|
+
import type { CommonMarkAreaAnimationType, MarkerAnimationState, MarkerArcAreaLabelAttrs } from './type';
|
|
5
5
|
import { IMarkCommonArcLabelPosition, type MarkArcAreaAttrs } from './type';
|
|
6
6
|
import type { ComponentOptions } from '../interface';
|
|
7
|
+
import { MarkLabelMixin } from './mixin/label';
|
|
7
8
|
export declare function registerMarkArcAreaAnimate(): void;
|
|
9
|
+
export interface MarkArcArea extends Pick<MarkLabelMixin<MarkArcAreaAttrs>, '_addMarkLabels' | '_updateMarkLabels' | 'getLabel' | '_label'>, Marker<MarkArcAreaAttrs, CommonMarkAreaAnimationType> {
|
|
10
|
+
}
|
|
8
11
|
export declare class MarkArcArea extends Marker<MarkArcAreaAttrs, CommonMarkAreaAnimationType> {
|
|
9
12
|
name: string;
|
|
10
13
|
static defaultAttributes: {
|
|
11
14
|
interactive: boolean;
|
|
12
15
|
label: {
|
|
16
|
+
autoRotate: boolean;
|
|
13
17
|
position: IMarkCommonArcLabelPosition;
|
|
14
18
|
textStyle: {
|
|
15
19
|
fill: string;
|
|
@@ -37,16 +41,15 @@ export declare class MarkArcArea extends Marker<MarkArcAreaAttrs, CommonMarkArea
|
|
|
37
41
|
defaultExitAnimation: import("./type").MarkerExitAnimation;
|
|
38
42
|
protected markerAnimate(state: MarkerAnimationState): void;
|
|
39
43
|
getArea(): IArc;
|
|
40
|
-
getLabel(): Tag;
|
|
41
44
|
constructor(attributes: MarkArcAreaAttrs, options?: ComponentOptions);
|
|
42
|
-
protected getPointAttrByPosition(position: IMarkCommonArcLabelPosition): {
|
|
45
|
+
protected getPointAttrByPosition(position: IMarkCommonArcLabelPosition, labelAttrs: MarkerArcAreaLabelAttrs): {
|
|
43
46
|
position: {
|
|
44
47
|
x: number;
|
|
45
48
|
y: number;
|
|
46
49
|
};
|
|
47
50
|
angle: number;
|
|
48
51
|
};
|
|
49
|
-
protected setLabelPos(): void;
|
|
52
|
+
protected setLabelPos(labelNode: Tag, labelAttrs: MarkerArcAreaLabelAttrs): void;
|
|
50
53
|
protected initMarker(container: IGroup): void;
|
|
51
54
|
protected updateMarker(): void;
|
|
52
55
|
protected isValidPoints(): boolean;
|
package/es/marker/arc-area.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { graphicCreator } from "@visactor/vrender-core";
|
|
2
2
|
|
|
3
|
-
import { merge } from "@visactor/vutils";
|
|
4
|
-
|
|
5
|
-
import { Tag } from "../tag";
|
|
3
|
+
import { merge, mixin } from "@visactor/vutils";
|
|
6
4
|
|
|
7
5
|
import { Marker } from "./base";
|
|
8
6
|
|
|
@@ -18,6 +16,8 @@ import { DEFAULT_STATES } from "../constant";
|
|
|
18
16
|
|
|
19
17
|
import { DefaultExitMarkerAnimation, DefaultUpdateMarkAreaAnimation, markArcAreaAnimate } from "./animate/animate";
|
|
20
18
|
|
|
19
|
+
import { MarkLabelMixin } from "./mixin/label";
|
|
20
|
+
|
|
21
21
|
loadMarkArcAreaComponent();
|
|
22
22
|
|
|
23
23
|
export function registerMarkArcAreaAnimate() {
|
|
@@ -31,19 +31,13 @@ export class MarkArcArea extends Marker {
|
|
|
31
31
|
getArea() {
|
|
32
32
|
return this._area;
|
|
33
33
|
}
|
|
34
|
-
getLabel() {
|
|
35
|
-
return this._label;
|
|
36
|
-
}
|
|
37
34
|
constructor(attributes, options) {
|
|
38
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArcArea.defaultAttributes, attributes,
|
|
39
|
-
|
|
40
|
-
autoRotate: !0
|
|
41
|
-
}
|
|
42
|
-
})), this.name = "markArcArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation,
|
|
35
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArcArea.defaultAttributes, attributes)),
|
|
36
|
+
this.name = "markArcArea", this.defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation,
|
|
43
37
|
this.defaultExitAnimation = DefaultExitMarkerAnimation;
|
|
44
38
|
}
|
|
45
|
-
getPointAttrByPosition(position) {
|
|
46
|
-
const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle
|
|
39
|
+
getPointAttrByPosition(position, labelAttrs) {
|
|
40
|
+
const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle} = this.attribute, {refX: refX = 0, refY: refY = 0} = labelAttrs;
|
|
47
41
|
let radius, angle;
|
|
48
42
|
switch (position) {
|
|
49
43
|
case IMarkCommonArcLabelPosition.center:
|
|
@@ -85,16 +79,16 @@ export class MarkArcArea extends Marker {
|
|
|
85
79
|
angle: angle
|
|
86
80
|
};
|
|
87
81
|
}
|
|
88
|
-
setLabelPos() {
|
|
82
|
+
setLabelPos(labelNode, labelAttrs) {
|
|
89
83
|
var _a;
|
|
90
|
-
if (this.
|
|
91
|
-
const {
|
|
92
|
-
if (
|
|
93
|
-
angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a =
|
|
94
|
-
textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]),
|
|
95
|
-
})), this.attribute.limitRect &&
|
|
84
|
+
if (this._area) {
|
|
85
|
+
const {position: labelPosition = "arcInnerMiddle", autoRotate: autoRotate} = labelAttrs, labelAttr = this.getPointAttrByPosition(labelPosition, labelAttrs);
|
|
86
|
+
if (labelNode.setAttributes(Object.assign(Object.assign({}, labelAttr.position), {
|
|
87
|
+
angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0) : 0,
|
|
88
|
+
textStyle: Object.assign(Object.assign({}, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition]), labelAttrs.textStyle)
|
|
89
|
+
})), this.attribute.limitRect && labelAttrs.confine) {
|
|
96
90
|
const {x: x, y: y, width: width, height: height} = this.attribute.limitRect;
|
|
97
|
-
limitShapeInBounds(
|
|
91
|
+
limitShapeInBounds(labelNode, {
|
|
98
92
|
x1: x,
|
|
99
93
|
y1: y,
|
|
100
94
|
x2: x + width,
|
|
@@ -104,7 +98,7 @@ export class MarkArcArea extends Marker {
|
|
|
104
98
|
}
|
|
105
99
|
}
|
|
106
100
|
initMarker(container) {
|
|
107
|
-
const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle, areaStyle: areaStyle,
|
|
101
|
+
const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle, areaStyle: areaStyle, state: state} = this.attribute, area = graphicCreator.arc(Object.assign({
|
|
108
102
|
x: center.x,
|
|
109
103
|
y: center.y,
|
|
110
104
|
innerRadius: innerRadius,
|
|
@@ -113,15 +107,7 @@ export class MarkArcArea extends Marker {
|
|
|
113
107
|
endAngle: endAngle
|
|
114
108
|
}, areaStyle));
|
|
115
109
|
area.states = merge({}, DEFAULT_STATES, null == state ? void 0 : state.area), area.name = "polar-mark-area-area",
|
|
116
|
-
this._area = area, container.add(area);
|
|
117
|
-
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
118
|
-
state: {
|
|
119
|
-
panel: merge({}, DEFAULT_STATES, null == state ? void 0 : state.labelBackground),
|
|
120
|
-
text: merge({}, DEFAULT_STATES, null == state ? void 0 : state.label)
|
|
121
|
-
}
|
|
122
|
-
}));
|
|
123
|
-
markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel),
|
|
124
|
-
this.setLabelPos();
|
|
110
|
+
this._area = area, container.add(area), this._addMarkLabels(container, "mark-area-label", MarkArcArea.defaultAttributes.label);
|
|
125
111
|
}
|
|
126
112
|
updateMarker() {
|
|
127
113
|
const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle, areaStyle: areaStyle, label: label, state: state} = this.attribute;
|
|
@@ -133,20 +119,12 @@ export class MarkArcArea extends Marker {
|
|
|
133
119
|
startAngle: startAngle,
|
|
134
120
|
endAngle: endAngle
|
|
135
121
|
}, areaStyle)), this._area.states = merge({}, DEFAULT_STATES, null == state ? void 0 : state.area)),
|
|
136
|
-
this.
|
|
137
|
-
dx: 0,
|
|
138
|
-
dy: 0
|
|
139
|
-
}, label), {
|
|
140
|
-
state: {
|
|
141
|
-
panel: merge({}, DEFAULT_STATES, null == state ? void 0 : state.labelBackground),
|
|
142
|
-
text: merge({}, DEFAULT_STATES, null == state ? void 0 : state.label)
|
|
143
|
-
}
|
|
144
|
-
})), this.setLabelPos());
|
|
122
|
+
this._updateMarkLabels(MarkArcArea.defaultAttributes.label);
|
|
145
123
|
}
|
|
146
124
|
isValidPoints() {
|
|
147
125
|
return !0;
|
|
148
126
|
}
|
|
149
127
|
}
|
|
150
128
|
|
|
151
|
-
MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;
|
|
129
|
+
MarkArcArea.defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME, mixin(MarkArcArea, MarkLabelMixin);
|
|
152
130
|
//# sourceMappingURL=arc-area.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/arc-area.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAC;AAG5F,OAAO,EAAE,2BAA2B,EAAyB,MAAM,QAAQ,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEnH,wBAAwB,EAAE,CAAC;AAE3B,MAAM,UAAU,0BAA0B;IACxC,WAAW,CAAC,QAAQ,GAAG,kBAAkB,CAAC;AAC5C,CAAC;AAED,MAAM,OAAO,WAAY,SAAQ,MAAqD;IAQ1E,aAAa,CAAC,KAA2B;QACjD,IAAI,WAAW,CAAC,QAAQ,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACjD,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI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,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC,CAAC;SAC5D;QACD,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,aAAa,+BACvB,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,IACD,KAAuB,KAC3B,KAAK,EAAE;oBACL,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,CAAC;oBACxD,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CAAC;iBAC9C,IACD,CAAC;YACH,IAAI,CAAC,WAAW,EAAE,CAAC;SACpB;IACH,CAAC;IAES,aAAa;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;;AAvKM,6BAAiB,GAAG,2BAA2B,CAAC","file":"arc-area.js","sourcesContent":["import type { IArc, IGroup, INode } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport { merge } from '@visactor/vutils';\nimport type { TagAttributes } from '../tag';\n// eslint-disable-next-line no-duplicate-imports\nimport { Tag } from '../tag';\nimport { Marker } from './base';\nimport { DEFAULT_MARK_ARC_AREA_THEME, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP } from './config';\nimport type { CommonMarkAreaAnimationType, MarkerAnimationState } from './type';\n// eslint-disable-next-line no-duplicate-imports\nimport { IMarkCommonArcLabelPosition, type MarkArcAreaAttrs } from './type';\nimport { limitShapeInBounds } from '../util/limit-shape';\nimport type { ComponentOptions } from '../interface';\nimport { loadMarkArcAreaComponent } from './register';\nimport { DEFAULT_STATES } from '../constant';\nimport { DefaultExitMarkerAnimation, DefaultUpdateMarkAreaAnimation, markArcAreaAnimate } from './animate/animate';\n\nloadMarkArcAreaComponent();\n\nexport function registerMarkArcAreaAnimate() {\n MarkArcArea._animate = markArcAreaAnimate;\n}\n\nexport class MarkArcArea extends Marker<MarkArcAreaAttrs, CommonMarkAreaAnimationType> {\n name = 'markArcArea';\n static defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;\n private _area!: IArc;\n\n /** animate */\n defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation;\n defaultExitAnimation = DefaultExitMarkerAnimation;\n protected markerAnimate(state: MarkerAnimationState) {\n if (MarkArcArea._animate && this._animationConfig) {\n MarkArcArea._animate(this._area, this._label, this._animationConfig, state);\n }\n }\n\n getArea() {\n return this._area;\n }\n\n getLabel() {\n return this._label;\n }\n\n constructor(attributes: MarkArcAreaAttrs, options?: ComponentOptions) {\n // eslint-disable-next-line max-len\n super(\n options?.skipDefault\n ? attributes\n : merge({}, MarkArcArea.defaultAttributes, attributes, { label: { autoRotate: true } })\n );\n }\n\n protected getPointAttrByPosition(position: IMarkCommonArcLabelPosition) {\n const { center, innerRadius, outerRadius, startAngle, endAngle, label } = this.attribute as MarkArcAreaAttrs;\n const { refX = 0, refY = 0 } = label;\n\n let radius;\n let angle;\n\n switch (position) {\n case IMarkCommonArcLabelPosition.center:\n radius = (innerRadius + outerRadius) / 2;\n angle = (startAngle + endAngle) / 2;\n break;\n case IMarkCommonArcLabelPosition.arcInnerStart:\n radius = innerRadius;\n angle = startAngle;\n break;\n case IMarkCommonArcLabelPosition.arcOuterStart:\n radius = outerRadius;\n angle = startAngle;\n break;\n case IMarkCommonArcLabelPosition.arcInnerEnd:\n radius = innerRadius;\n angle = endAngle;\n break;\n case IMarkCommonArcLabelPosition.arcOuterEnd:\n radius = outerRadius;\n angle = endAngle;\n break;\n case IMarkCommonArcLabelPosition.arcInnerMiddle:\n radius = innerRadius;\n angle = (startAngle + endAngle) / 2;\n break;\n case IMarkCommonArcLabelPosition.arcOuterMiddle:\n radius = outerRadius;\n angle = (startAngle + endAngle) / 2;\n break;\n default: // default arcInnerMiddle\n radius = innerRadius;\n angle = (startAngle + endAngle) / 2;\n }\n\n return {\n position: {\n x: center.x + (radius + refY) * Math.cos(angle) + refX * Math.cos(angle - Math.PI / 2),\n y: center.y + (radius + refY) * Math.sin(angle) + refX * Math.sin(angle - Math.PI / 2)\n },\n angle\n };\n }\n\n protected setLabelPos() {\n if (this._label && this._area) {\n const { label = {} } = this.attribute as MarkArcAreaAttrs;\n const { position: labelPosition = 'arcInnerMiddle', autoRotate } = label;\n const labelAttr = this.getPointAttrByPosition(labelPosition as IMarkCommonArcLabelPosition);\n\n this._label.setAttributes({\n ...labelAttr.position,\n angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (label.refAngle ?? 0) : 0,\n textStyle: {\n ...DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition],\n ...label.textStyle\n }\n });\n\n if (this.attribute.limitRect && label.confine) {\n const { x, y, width, height } = this.attribute.limitRect;\n limitShapeInBounds(this._label, {\n x1: x,\n y1: y,\n x2: x + width,\n y2: y + height\n });\n }\n }\n }\n\n protected initMarker(container: IGroup) {\n const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, label, state } = this\n .attribute as MarkArcAreaAttrs;\n const area = graphicCreator.arc({\n x: center.x,\n y: center.y,\n innerRadius,\n outerRadius,\n startAngle,\n endAngle,\n ...areaStyle\n });\n area.states = merge({}, DEFAULT_STATES, state?.area);\n area.name = 'polar-mark-area-area';\n this._area = area;\n container.add(area);\n\n const markLabel = new Tag({\n ...(label as TagAttributes),\n state: {\n panel: merge({}, DEFAULT_STATES, state?.labelBackground),\n text: merge({}, DEFAULT_STATES, state?.label)\n }\n });\n markLabel.name = 'mark-area-label';\n this._label = markLabel;\n container.add(markLabel as unknown as INode);\n this.setLabelPos();\n }\n\n protected updateMarker() {\n const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, label, state } = this\n .attribute as MarkArcAreaAttrs;\n if (this._area) {\n this._area.setAttributes({\n x: center.x,\n y: center.y,\n innerRadius,\n outerRadius,\n startAngle,\n endAngle,\n ...areaStyle\n });\n this._area.states = merge({}, DEFAULT_STATES, state?.area);\n }\n if (this._label) {\n this._label.setAttributes({\n dx: 0,\n dy: 0, // 需要进行复位\n ...(label as TagAttributes),\n state: {\n panel: merge({}, DEFAULT_STATES, state?.labelBackground),\n text: merge({}, DEFAULT_STATES, state?.label)\n }\n });\n this.setLabelPos();\n }\n }\n\n protected isValidPoints() {\n return true;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/marker/arc-area.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,2BAA2B,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAC;AAG5F,OAAO,EAAE,2BAA2B,EAAyB,MAAM,QAAQ,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,wBAAwB,EAAE,CAAC;AAE3B,MAAM,UAAU,0BAA0B;IACxC,WAAW,CAAC,QAAQ,GAAG,kBAAkB,CAAC;AAC5C,CAAC;AAMD,MAAM,OAAO,WAAY,SAAQ,MAAqD;IAQ1E,aAAa,CAAC,KAA2B;QACjD,IAAI,WAAW,CAAC,QAAQ,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACjD,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE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AG,IAAI,CAAC;QAClB,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAGpB,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,iBAAiB,EAAE,WAAW,CAAC,iBAAiB,CAAC,KAAsB,CAAC,CAAC;IAC1G,CAAC;IAES,YAAY;QACpB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI;aAC7F,SAA6B,CAAC;QACjC,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,KAAK,CAAC,aAAa,iBACtB,CAAC,EAAE,MAAM,CAAC,CAAC,EACX,CAAC,EAAE,MAAM,CAAC,CAAC,EACX,WAAW;gBACX,WAAW;gBACX,UAAU;gBACV,QAAQ,IACL,SAAS,EACZ,CAAC;YACH,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC,CAAC;SAC5D;QAGD,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAsB,CAAC,CAAC;IAC/E,CAAC;IAES,aAAa;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;;AA5IM,6BAAiB,GAAG,2BAA2B,CAAC;AA+IzD,KAAK,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC","file":"arc-area.js","sourcesContent":["import type { IArc, IGroup } from '@visactor/vrender-core';\n// eslint-disable-next-line no-duplicate-imports\nimport { graphicCreator } from '@visactor/vrender-core';\nimport { merge, mixin } from '@visactor/vutils';\nimport type { TagAttributes } from '../tag';\n// eslint-disable-next-line no-duplicate-imports\nimport type { Tag } from '../tag';\nimport { Marker } from './base';\nimport { DEFAULT_MARK_ARC_AREA_THEME, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP } from './config';\nimport type { CommonMarkAreaAnimationType, MarkerAnimationState, MarkerArcAreaLabelAttrs } from './type';\n// eslint-disable-next-line no-duplicate-imports\nimport { IMarkCommonArcLabelPosition, type MarkArcAreaAttrs } from './type';\nimport { limitShapeInBounds } from '../util/limit-shape';\nimport type { ComponentOptions } from '../interface';\nimport { loadMarkArcAreaComponent } from './register';\nimport { DEFAULT_STATES } from '../constant';\nimport { DefaultExitMarkerAnimation, DefaultUpdateMarkAreaAnimation, markArcAreaAnimate } from './animate/animate';\nimport { MarkLabelMixin } from './mixin/label';\n\nloadMarkArcAreaComponent();\n\nexport function registerMarkArcAreaAnimate() {\n MarkArcArea._animate = markArcAreaAnimate;\n}\n\nexport interface MarkArcArea\n extends Pick<MarkLabelMixin<MarkArcAreaAttrs>, '_addMarkLabels' | '_updateMarkLabels' | 'getLabel' | '_label'>,\n Marker<MarkArcAreaAttrs, CommonMarkAreaAnimationType> {}\n\nexport class MarkArcArea extends Marker<MarkArcAreaAttrs, CommonMarkAreaAnimationType> {\n name = 'markArcArea';\n static defaultAttributes = DEFAULT_MARK_ARC_AREA_THEME;\n private _area!: IArc;\n\n /** animate */\n defaultUpdateAnimation = DefaultUpdateMarkAreaAnimation;\n defaultExitAnimation = DefaultExitMarkerAnimation;\n protected markerAnimate(state: MarkerAnimationState) {\n if (MarkArcArea._animate && this._animationConfig) {\n MarkArcArea._animate(this._area, this._label, this._animationConfig, state);\n }\n }\n\n getArea() {\n return this._area;\n }\n\n constructor(attributes: MarkArcAreaAttrs, options?: ComponentOptions) {\n // eslint-disable-next-line max-len\n super(options?.skipDefault ? attributes : merge({}, MarkArcArea.defaultAttributes, attributes));\n }\n\n protected getPointAttrByPosition(position: IMarkCommonArcLabelPosition, labelAttrs: MarkerArcAreaLabelAttrs) {\n const { center, innerRadius, outerRadius, startAngle, endAngle } = this.attribute as MarkArcAreaAttrs;\n const { refX = 0, refY = 0 } = labelAttrs;\n\n let radius;\n let angle;\n\n switch (position) {\n case IMarkCommonArcLabelPosition.center:\n radius = (innerRadius + outerRadius) / 2;\n angle = (startAngle + endAngle) / 2;\n break;\n case IMarkCommonArcLabelPosition.arcInnerStart:\n radius = innerRadius;\n angle = startAngle;\n break;\n case IMarkCommonArcLabelPosition.arcOuterStart:\n radius = outerRadius;\n angle = startAngle;\n break;\n case IMarkCommonArcLabelPosition.arcInnerEnd:\n radius = innerRadius;\n angle = endAngle;\n break;\n case IMarkCommonArcLabelPosition.arcOuterEnd:\n radius = outerRadius;\n angle = endAngle;\n break;\n case IMarkCommonArcLabelPosition.arcInnerMiddle:\n radius = innerRadius;\n angle = (startAngle + endAngle) / 2;\n break;\n case IMarkCommonArcLabelPosition.arcOuterMiddle:\n radius = outerRadius;\n angle = (startAngle + endAngle) / 2;\n break;\n default: // default arcInnerMiddle\n radius = innerRadius;\n angle = (startAngle + endAngle) / 2;\n }\n\n return {\n position: {\n x: center.x + (radius + refY) * Math.cos(angle) + refX * Math.cos(angle - Math.PI / 2),\n y: center.y + (radius + refY) * Math.sin(angle) + refX * Math.sin(angle - Math.PI / 2)\n },\n angle\n };\n }\n\n protected setLabelPos(labelNode: Tag, labelAttrs: MarkerArcAreaLabelAttrs) {\n if (this._area) {\n const { position: labelPosition = 'arcInnerMiddle', autoRotate } = labelAttrs;\n const labelAttr = this.getPointAttrByPosition(labelPosition as IMarkCommonArcLabelPosition, labelAttrs);\n\n labelNode.setAttributes({\n ...labelAttr.position,\n angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (labelAttrs.refAngle ?? 0) : 0,\n textStyle: {\n ...DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[labelPosition],\n ...labelAttrs.textStyle\n }\n });\n\n if (this.attribute.limitRect && labelAttrs.confine) {\n const { x, y, width, height } = this.attribute.limitRect;\n limitShapeInBounds(labelNode, {\n x1: x,\n y1: y,\n x2: x + width,\n y2: y + height\n });\n }\n }\n }\n\n protected initMarker(container: IGroup) {\n const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, state } = this\n .attribute as MarkArcAreaAttrs;\n const area = graphicCreator.arc({\n x: center.x,\n y: center.y,\n innerRadius,\n outerRadius,\n startAngle,\n endAngle,\n ...areaStyle\n });\n area.states = merge({}, DEFAULT_STATES, state?.area);\n area.name = 'polar-mark-area-area';\n this._area = area;\n container.add(area);\n\n // add label\n this._addMarkLabels(container, 'mark-area-label', MarkArcArea.defaultAttributes.label as TagAttributes);\n }\n\n protected updateMarker() {\n const { center, innerRadius, outerRadius, startAngle, endAngle, areaStyle, label, state } = this\n .attribute as MarkArcAreaAttrs;\n if (this._area) {\n this._area.setAttributes({\n x: center.x,\n y: center.y,\n innerRadius,\n outerRadius,\n startAngle,\n endAngle,\n ...areaStyle\n });\n this._area.states = merge({}, DEFAULT_STATES, state?.area);\n }\n\n // update label\n this._updateMarkLabels(MarkArcArea.defaultAttributes.label as TagAttributes);\n }\n\n protected isValidPoints() {\n return true;\n }\n}\n\nmixin(MarkArcArea, MarkLabelMixin);\n"]}
|
package/es/marker/arc-line.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ArcSegment } from '../segment';
|
|
2
2
|
import { MarkCommonLine } from './common-line';
|
|
3
3
|
import type { ComponentOptions } from '../interface';
|
|
4
|
-
import type { IArcGraphicAttribute } from '@visactor/vrender-core';
|
|
4
|
+
import type { IArcGraphicAttribute, IGroup } from '@visactor/vrender-core';
|
|
5
5
|
import { IMarkCommonArcLabelPosition } from './type';
|
|
6
|
-
import type { MarkArcLineAttrs, MarkerAnimationState } from './type';
|
|
6
|
+
import type { MarkArcLineAttrs, MarkerAnimationState, MarkerLineLabelAttrs } from './type';
|
|
7
7
|
export declare function registerMarkArcLineAnimate(): void;
|
|
8
8
|
export declare class MarkArcLine extends MarkCommonLine<IArcGraphicAttribute, IMarkCommonArcLabelPosition> {
|
|
9
9
|
name: string;
|
|
@@ -11,7 +11,7 @@ export declare class MarkArcLine extends MarkCommonLine<IArcGraphicAttribute, IM
|
|
|
11
11
|
protected _line: ArcSegment;
|
|
12
12
|
protected markerAnimate(state: MarkerAnimationState): void;
|
|
13
13
|
constructor(attributes: MarkArcLineAttrs, options?: ComponentOptions);
|
|
14
|
-
protected getPointAttrByPosition(direction: IMarkCommonArcLabelPosition): {
|
|
14
|
+
protected getPointAttrByPosition(direction: IMarkCommonArcLabelPosition, labelAttrs: MarkerLineLabelAttrs<IMarkCommonArcLabelPosition>): {
|
|
15
15
|
position: {
|
|
16
16
|
x: number;
|
|
17
17
|
y: number;
|
|
@@ -22,8 +22,10 @@ export declare class MarkArcLine extends MarkCommonLine<IArcGraphicAttribute, IM
|
|
|
22
22
|
textAlign: import("@visactor/vrender-core").TextAlignType;
|
|
23
23
|
textBaseline: import("@visactor/vrender-core").TextBaselineType;
|
|
24
24
|
};
|
|
25
|
-
protected getRotateByAngle(angle: number): number;
|
|
25
|
+
protected getRotateByAngle(angle: number, labelAttrs: MarkerLineLabelAttrs<IMarkCommonArcLabelPosition>): number;
|
|
26
26
|
protected createSegment(): ArcSegment;
|
|
27
27
|
protected setLineAttributes(): void;
|
|
28
28
|
protected isValidPoints(): boolean;
|
|
29
|
+
protected addMarkLineLabels(container: IGroup): void;
|
|
30
|
+
protected updateMarkLineLabels(): void;
|
|
29
31
|
}
|
package/es/marker/arc-line.js
CHANGED
|
@@ -25,14 +25,11 @@ export class MarkArcLine extends MarkCommonLine {
|
|
|
25
25
|
MarkArcLine._animate && this._animationConfig && MarkArcLine._animate(this._line, this._label, this._animationConfig, state);
|
|
26
26
|
}
|
|
27
27
|
constructor(attributes, options) {
|
|
28
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArcLine.defaultAttributes, attributes,
|
|
29
|
-
|
|
30
|
-
autoRotate: !0
|
|
31
|
-
}
|
|
32
|
-
})), this.name = "markArcLine";
|
|
28
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, MarkArcLine.defaultAttributes, attributes)),
|
|
29
|
+
this.name = "markArcLine";
|
|
33
30
|
}
|
|
34
|
-
getPointAttrByPosition(direction) {
|
|
35
|
-
const {center: center, radius: radius, startAngle: startAngle, endAngle: endAngle
|
|
31
|
+
getPointAttrByPosition(direction, labelAttrs) {
|
|
32
|
+
const {center: center, radius: radius, startAngle: startAngle, endAngle: endAngle} = this.attribute, {refX: refX = 0, refY: refY = 0} = labelAttrs;
|
|
36
33
|
let angle;
|
|
37
34
|
switch (direction) {
|
|
38
35
|
case IMarkCommonArcLabelPosition.arcInnerStart:
|
|
@@ -66,9 +63,9 @@ export class MarkArcLine extends MarkCommonLine {
|
|
|
66
63
|
getTextStyle(position) {
|
|
67
64
|
return DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[position];
|
|
68
65
|
}
|
|
69
|
-
getRotateByAngle(angle) {
|
|
66
|
+
getRotateByAngle(angle, labelAttrs) {
|
|
70
67
|
var _a;
|
|
71
|
-
return angle - Math.PI / 2 + (null !== (_a =
|
|
68
|
+
return angle - Math.PI / 2 + (null !== (_a = labelAttrs.refAngle) && void 0 !== _a ? _a : 0);
|
|
72
69
|
}
|
|
73
70
|
createSegment() {
|
|
74
71
|
const {center: center, radius: radius, startAngle: startAngle, endAngle: endAngle, startSymbol: startSymbol, endSymbol: endSymbol, lineStyle: lineStyle, state: state} = this.attribute;
|
|
@@ -107,6 +104,12 @@ export class MarkArcLine extends MarkCommonLine {
|
|
|
107
104
|
isValidPoints() {
|
|
108
105
|
return !0;
|
|
109
106
|
}
|
|
107
|
+
addMarkLineLabels(container) {
|
|
108
|
+
this._addMarkLabels(container, "mark-common-line-label", MarkArcLine.defaultAttributes.label);
|
|
109
|
+
}
|
|
110
|
+
updateMarkLineLabels() {
|
|
111
|
+
this._updateMarkLabels(MarkArcLine.defaultAttributes.label);
|
|
112
|
+
}
|
|
110
113
|
}
|
|
111
114
|
|
|
112
115
|
MarkArcLine.defaultAttributes = DEFAULT_MARK_ARC_LINE_THEME;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/arc-line.ts"],"names":[],"mappings":"AAAA,OAA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AE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC;oBAC5C,WAAW,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,CAAC;oBAC9D,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,CAAC;iBAC3D;aACF,CAAC,CAAC;SACJ;IACH,CAAC;IAES,aAAa;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAES,iBAAiB,CAAC,SAAiB;QAC3C,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,wBAAwB,EAAE,WAAW,CAAC,iBAAiB,CAAC,KAAsB,CAAC,CAAC;IACjH,CAAC;IAES,oBAAoB;QAC5B,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAsB,CAAC,CAAC;IAC/E,CAAC;;AA7GM,6BAAiB,GAA8B,2BAA0D,CAAC","file":"arc-line.js","sourcesContent":["import { array, merge } from '@visactor/vutils';\nimport { ArcSegment } from '../segment';\nimport { loadMarkArcLineComponent } from './register';\nimport { DEFAULT_STATES } from '../constant';\nimport { MarkCommonLine } from './common-line';\nimport type { ComponentOptions } from '../interface';\nimport type { IArcGraphicAttribute, IGroup } from '@visactor/vrender-core';\nimport { IMarkCommonArcLabelPosition } from './type';\n// eslint-disable-next-line no-duplicate-imports\nimport type { MarkArcLineAttrs, MarkerAnimationState, MarkerLineLabelAttrs } from './type';\nimport { DEFAULT_MARK_ARC_LINE_THEME, DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP } from './config';\nimport { markCommonLineAnimate } from './animate/animate';\nimport type { TagAttributes } from '../tag';\n\nloadMarkArcLineComponent();\n\nexport function registerMarkArcLineAnimate() {\n MarkArcLine._animate = markCommonLineAnimate;\n}\nexport class MarkArcLine extends MarkCommonLine<IArcGraphicAttribute, IMarkCommonArcLabelPosition> {\n name = 'markArcLine';\n // eslint-disable-next-line max-len\n static defaultAttributes: Partial<MarkArcLineAttrs> = DEFAULT_MARK_ARC_LINE_THEME as unknown as MarkArcLineAttrs;\n protected _line!: ArcSegment;\n\n protected markerAnimate(state: MarkerAnimationState) {\n if (MarkArcLine._animate && this._animationConfig) {\n MarkArcLine._animate(this._line, this._label, this._animationConfig, state);\n }\n }\n\n constructor(attributes: MarkArcLineAttrs, options?: ComponentOptions) {\n // eslint-disable-next-line max-len\n super(options?.skipDefault ? attributes : merge({}, MarkArcLine.defaultAttributes, attributes));\n }\n\n protected getPointAttrByPosition(\n direction: IMarkCommonArcLabelPosition,\n labelAttrs: MarkerLineLabelAttrs<IMarkCommonArcLabelPosition>\n ) {\n const { center, radius, startAngle, endAngle } = this.attribute as MarkArcLineAttrs;\n const { refX = 0, refY = 0 } = labelAttrs;\n let angle;\n\n switch (direction) {\n case IMarkCommonArcLabelPosition.arcInnerStart:\n angle = startAngle;\n case IMarkCommonArcLabelPosition.arcOuterStart:\n angle = startAngle;\n break;\n case IMarkCommonArcLabelPosition.arcInnerEnd:\n angle = endAngle;\n case IMarkCommonArcLabelPosition.arcOuterEnd:\n angle = endAngle;\n break;\n case IMarkCommonArcLabelPosition.center:\n case IMarkCommonArcLabelPosition.arcInnerMiddle:\n case IMarkCommonArcLabelPosition.arcOuterMiddle:\n angle = (startAngle + endAngle) / 2;\n break;\n default: // default arcInnerMiddle\n angle = (startAngle + endAngle) / 2;\n }\n\n return {\n position: {\n x: center.x + (radius + refY) * Math.cos(angle) + refX * Math.cos(angle - Math.PI / 2),\n y: center.y + (radius + refY) * Math.sin(angle) + refX * Math.sin(angle - Math.PI / 2)\n },\n angle\n };\n }\n\n protected getTextStyle(position: IMarkCommonArcLabelPosition) {\n return DEFAULT_POLAR_MARKER_TEXT_STYLE_MAP[position];\n }\n\n protected getRotateByAngle(angle: number, labelAttrs: MarkerLineLabelAttrs<IMarkCommonArcLabelPosition>): number {\n return angle - Math.PI / 2 + (labelAttrs.refAngle ?? 0);\n }\n\n protected createSegment() {\n const { center, radius, startAngle, endAngle, startSymbol, endSymbol, lineStyle, state } = this\n .attribute as MarkArcLineAttrs;\n return new ArcSegment({\n center,\n radius,\n startAngle,\n endAngle,\n startSymbol,\n endSymbol,\n lineStyle,\n state: {\n line: merge({}, DEFAULT_STATES, state?.line),\n startSymbol: merge({}, DEFAULT_STATES, state?.lineStartSymbol),\n endSymbol: merge({}, DEFAULT_STATES, state?.lineEndSymbol)\n }\n });\n }\n\n protected setLineAttributes() {\n const { center, radius, startAngle, endAngle, startSymbol, endSymbol, lineStyle, state } = this\n .attribute as MarkArcLineAttrs;\n if (this._line) {\n (this._line as any).setAttributes({\n center,\n radius,\n startAngle,\n endAngle,\n startSymbol,\n endSymbol,\n lineStyle,\n state: {\n line: merge({}, DEFAULT_STATES, state?.line),\n startSymbol: merge({}, DEFAULT_STATES, state?.lineStartSymbol),\n endSymbol: merge({}, DEFAULT_STATES, state?.lineEndSymbol)\n }\n });\n }\n }\n\n protected isValidPoints() {\n return true;\n }\n\n protected addMarkLineLabels(container: IGroup) {\n this._addMarkLabels(container, 'mark-common-line-label', MarkArcLine.defaultAttributes.label as TagAttributes);\n }\n\n protected updateMarkLineLabels() {\n this._updateMarkLabels(MarkArcLine.defaultAttributes.label as TagAttributes);\n }\n}\n"]}
|
package/es/marker/area.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { IGroup, IPolygon } from '@visactor/vrender-core';
|
|
2
|
-
import { Tag } from '../tag';
|
|
2
|
+
import type { Tag } from '../tag';
|
|
3
3
|
import { Marker } from './base';
|
|
4
|
-
import type { CommonMarkAreaAnimationType, IMarkAreaLabelPosition, MarkAreaAttrs, MarkerAnimationState } from './type';
|
|
4
|
+
import type { CommonMarkAreaAnimationType, IMarkAreaLabelPosition, MarkAreaAttrs, MarkerAnimationState, MarkerAreaLabelAttrs } from './type';
|
|
5
5
|
import type { ComponentOptions } from '../interface';
|
|
6
|
+
import { MarkLabelMixin } from './mixin/label';
|
|
6
7
|
export declare function registerMarkAreaAnimate(): void;
|
|
8
|
+
export interface MarkArea extends Pick<MarkLabelMixin<MarkAreaAttrs>, '_addMarkLabels' | '_updateMarkLabels' | 'getLabel' | '_label'>, Marker<MarkAreaAttrs, CommonMarkAreaAnimationType> {
|
|
9
|
+
}
|
|
7
10
|
export declare class MarkArea extends Marker<MarkAreaAttrs, CommonMarkAreaAnimationType> {
|
|
8
11
|
name: string;
|
|
9
12
|
static defaultAttributes: {
|
|
@@ -36,13 +39,12 @@ export declare class MarkArea extends Marker<MarkAreaAttrs, CommonMarkAreaAnimat
|
|
|
36
39
|
protected markerAnimate(state: MarkerAnimationState): void;
|
|
37
40
|
private _area;
|
|
38
41
|
getArea(): IPolygon;
|
|
39
|
-
getLabel(): Tag;
|
|
40
42
|
constructor(attributes: MarkAreaAttrs, options?: ComponentOptions);
|
|
41
43
|
protected getPointAttrByPosition(position: IMarkAreaLabelPosition): {
|
|
42
44
|
x: number;
|
|
43
45
|
y: number;
|
|
44
46
|
};
|
|
45
|
-
protected setLabelPos(): void;
|
|
47
|
+
protected setLabelPos(labelNode: Tag, labelAttrs: MarkerAreaLabelAttrs): void;
|
|
46
48
|
protected initMarker(container: IGroup): void;
|
|
47
49
|
protected updateMarker(): void;
|
|
48
50
|
protected isValidPoints(): boolean;
|