@visactor/vrender-components 0.18.10-alpha.0 → 0.18.10-alpha.2
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/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/label/arc.d.ts +2 -2
- package/cjs/label/base.d.ts +2 -2
- package/cjs/marker/base-line.d.ts +17 -0
- package/cjs/marker/base-line.js +53 -0
- package/cjs/marker/base-line.js.map +1 -0
- package/cjs/marker/{area.d.ts → cartesian/area.d.ts} +13 -8
- package/cjs/marker/{area.js → cartesian/area.js} +18 -19
- package/cjs/marker/cartesian/area.js.map +1 -0
- package/cjs/marker/cartesian/line.d.ts +27 -0
- package/cjs/marker/cartesian/line.js +153 -0
- package/cjs/marker/cartesian/line.js.map +1 -0
- package/cjs/marker/config.d.ts +80 -10
- package/cjs/marker/config.js +77 -40
- package/cjs/marker/config.js.map +1 -1
- package/cjs/marker/index.d.ts +4 -2
- package/cjs/marker/index.js +3 -2
- package/cjs/marker/index.js.map +1 -1
- package/cjs/marker/point.d.ts +1 -1
- package/cjs/marker/polar/arc-line.d.ts +22 -0
- package/cjs/marker/polar/arc-line.js +103 -0
- package/cjs/marker/polar/arc-line.js.map +1 -0
- package/cjs/marker/polar/area.d.ts +50 -0
- package/cjs/marker/polar/area.js +123 -0
- package/cjs/marker/polar/area.js.map +1 -0
- package/cjs/marker/polar/line.d.ts +1 -0
- package/cjs/marker/polar/line.js +3 -0
- package/cjs/marker/polar/line.js.map +1 -0
- package/cjs/marker/register.d.ts +5 -2
- package/cjs/marker/register.js +18 -5
- package/cjs/marker/register.js.map +1 -1
- package/cjs/marker/type.d.ts +73 -21
- package/cjs/marker/type.js +22 -15
- package/cjs/marker/type.js.map +1 -1
- package/cjs/segment/arc-segment.d.ts +13 -0
- package/cjs/segment/arc-segment.js +51 -0
- package/cjs/segment/arc-segment.js.map +1 -0
- package/cjs/segment/index.d.ts +1 -0
- package/cjs/segment/index.js +2 -1
- package/cjs/segment/index.js.map +1 -1
- package/cjs/segment/register.d.ts +1 -0
- package/cjs/segment/register.js +7 -2
- package/cjs/segment/register.js.map +1 -1
- package/cjs/segment/segment.d.ts +7 -6
- package/cjs/segment/segment.js +7 -5
- package/cjs/segment/segment.js.map +1 -1
- package/cjs/segment/type.d.ts +22 -4
- package/cjs/segment/type.js.map +1 -1
- package/cjs/tag/tag.d.ts +5 -0
- package/cjs/tag/tag.js +11 -2
- package/cjs/tag/tag.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/label/arc.d.ts +2 -2
- package/es/label/base.d.ts +2 -2
- package/es/marker/base-line.d.ts +17 -0
- package/es/marker/base-line.js +53 -0
- package/es/marker/base-line.js.map +1 -0
- package/es/marker/{area.d.ts → cartesian/area.d.ts} +13 -8
- package/es/marker/{area.js → cartesian/area.js} +22 -23
- package/es/marker/cartesian/area.js.map +1 -0
- package/es/marker/cartesian/line.d.ts +27 -0
- package/es/marker/cartesian/line.js +159 -0
- package/es/marker/cartesian/line.js.map +1 -0
- package/es/marker/config.d.ts +80 -10
- package/es/marker/config.js +79 -40
- package/es/marker/config.js.map +1 -1
- package/es/marker/index.d.ts +4 -2
- package/es/marker/index.js +6 -2
- package/es/marker/index.js.map +1 -1
- package/es/marker/point.d.ts +1 -1
- package/es/marker/polar/arc-line.d.ts +22 -0
- package/es/marker/polar/arc-line.js +109 -0
- package/es/marker/polar/arc-line.js.map +1 -0
- package/es/marker/polar/area.d.ts +50 -0
- package/es/marker/polar/area.js +133 -0
- package/es/marker/polar/area.js.map +1 -0
- package/es/marker/polar/line.d.ts +1 -0
- package/es/marker/polar/line.js +3 -0
- package/es/marker/polar/line.js.map +1 -0
- package/es/marker/register.d.ts +5 -2
- package/es/marker/register.js +16 -4
- package/es/marker/register.js.map +1 -1
- package/es/marker/type.d.ts +73 -21
- package/es/marker/type.js +25 -15
- package/es/marker/type.js.map +1 -1
- package/es/segment/arc-segment.d.ts +13 -0
- package/es/segment/arc-segment.js +49 -0
- package/es/segment/arc-segment.js.map +1 -0
- package/es/segment/index.d.ts +1 -0
- package/es/segment/index.js +2 -0
- package/es/segment/index.js.map +1 -1
- package/es/segment/register.d.ts +1 -0
- package/es/segment/register.js +5 -1
- package/es/segment/register.js.map +1 -1
- package/es/segment/segment.d.ts +7 -6
- package/es/segment/segment.js +7 -5
- package/es/segment/segment.js.map +1 -1
- package/es/segment/type.d.ts +22 -4
- package/es/segment/type.js.map +1 -1
- package/es/tag/tag.d.ts +5 -0
- package/es/tag/tag.js +11 -2
- package/es/tag/tag.js.map +1 -1
- package/package.json +5 -5
- package/cjs/marker/area.js.map +0 -1
- package/cjs/marker/line.d.ts +0 -18
- package/cjs/marker/line.js +0 -100
- package/cjs/marker/line.js.map +0 -1
- package/es/marker/area.js.map +0 -1
- package/es/marker/line.d.ts +0 -18
- package/es/marker/line.js +0 -108
- package/es/marker/line.js.map +0 -1
package/es/marker/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAExE,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE;QACX,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;KACb;IACD,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;KACb;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,sBAAsB,CAAC,GAAG;QACpC,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;QACP,Q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EAAE;QACN,SAAS,EAAE,MAAM;QACjB,YAAY,EAAE,QAAQ;KACvB;IACD,SAAS,EAAE;QACT,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,QAAQ;KACvB;IACD,YAAY,EAAE;QACZ,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,KAAK;KACpB;IACD,YAAY,EAAE;QACZ,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,QAAQ;KACvB;CACF,CAAC","file":"config.js","sourcesContent":["import type { TextAlignType, TextBaselineType } from '@visactor/vrender-core';\nimport { IMarkAreaLabelPosition, IMarkLineLabelPosition } from './type';\n\nexport const DEFAULT_MARK_LINE_THEME = {\n interactive: true,\n startSymbol: {\n visible: false,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n endSymbol: {\n visible: true,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n label: {\n position: IMarkLineLabelPosition.end,\n refX: 0,\n refY: 0,\n refAngle: 0,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n lineStyle: {\n stroke: '#b2bacf',\n lineWidth: 1,\n lineDash: [2]\n }\n};\n\nexport const DEFAULT_MARK_LINE_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n start: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n insideStartTop: {\n textAlign: 'left',\n textBaseline: 'bottom'\n },\n insideStartBottom: {\n textAlign: 'left',\n textBaseline: 'top'\n },\n\n middle: {\n textAlign: 'center',\n textBaseline: 'middle'\n },\n insideMiddleTop: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n insideMiddleBottom: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n\n end: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideEndTop: {\n textAlign: 'right',\n textBaseline: 'bottom'\n },\n insideEndBottom: {\n textAlign: 'right',\n textBaseline: 'top'\n }\n};\n\nexport const DEFAULT_MARK_AREA_THEME = {\n interactive: true,\n label: {\n position: IMarkAreaLabelPosition.right,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n areaStyle: {\n fill: '#b2bacf',\n visible: true\n }\n};\n\nexport const DEFAULT_MARK_AREA_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n left: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n insideLeft: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n\n right: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideRight: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n\n top: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n insideTop: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n\n bottom: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n insideBottom: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n\n middle: {\n textAlign: 'center',\n textBaseline: 'middle'\n }\n};\n\nexport const DEFAULT_MARK_POINT_THEME = {\n interactive: true,\n itemLine: {\n visible: true,\n decorativeLine: {\n visible: false,\n length: 30\n },\n startSymbol: {\n visible: true,\n clip: true,\n symbolType: 'circle',\n size: 20,\n style: {\n fill: false,\n stroke: 'rgba(46, 47, 50)'\n }\n },\n endSymbol: {\n visible: false,\n clip: true,\n symbolType: 'triangle',\n size: 12,\n style: {\n fill: false,\n stroke: 'rgba(46, 47, 50)'\n }\n },\n lineStyle: {\n stroke: '#000',\n lineWidth: 1\n }\n },\n itemContent: {\n type: 'text',\n position: 'middle',\n refX: 10,\n symbolStyle: {\n symbolType: 'star',\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8,\n size: 20\n },\n textStyle: {\n dx: 0,\n dy: 0\n },\n imageStyle: {\n width: 80,\n height: 80\n },\n richTextStyle: {\n width: 100,\n height: 100\n }\n }\n};\n\nexport const DEFAULT_MARK_POINT_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n top: {\n textAlign: 'left',\n textBaseline: 'bottom'\n },\n bottom: {\n textAlign: 'left',\n textBaseline: 'top'\n },\n middle: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideTop: {\n textAlign: 'right',\n textBaseline: 'bottom'\n },\n insideBottom: {\n textAlign: 'right',\n textBaseline: 'top'\n },\n insideMiddle: {\n textAlign: 'right',\n textBaseline: 'middle'\n }\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/marker/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAC;AAEnH,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE;QACX,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;KACb;IACD,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,UAAU;QACtB,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,kBAAkB;QACxB,SAAS,EAAE,CAAC;KACb;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,+BAA+B,CAAC,GAAG;QAC7C,IAAI,EAAE,CAAC;QACP,IAAI,EAAE,CAAC;QACP,QAAQ,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AE;QACZ,SAAS,EAAE,OAAO;QAClB,YAAY,EAAE,QAAQ;KACvB;CACF,CAAC","file":"config.js","sourcesContent":["import type { TextAlignType, TextBaselineType } from '@visactor/vrender-core';\nimport { ICartesianMarkAreaLabelPosition, ICartesianMarkLineLabelPosition, IPolarMarkLabelPosition } from './type';\n\nexport const DEFAULT_CARTESIAN_MARK_LINE_THEME = {\n interactive: true,\n startSymbol: {\n visible: false,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n endSymbol: {\n visible: true,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n label: {\n position: ICartesianMarkLineLabelPosition.end,\n refX: 0,\n refY: 0,\n refAngle: 0,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseline: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n lineStyle: {\n stroke: '#b2bacf',\n lineWidth: 1,\n lineDash: [2]\n }\n};\n\nexport const DEFAULT_POLAR_MARK_LINE_THEME = {\n interactive: true,\n startSymbol: {\n visible: false,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n endSymbol: {\n visible: true,\n symbolType: 'triangle',\n size: 12,\n fill: 'rgba(46, 47, 50)',\n lineWidth: 0\n },\n label: {\n position: IPolarMarkLabelPosition.arcOuterMiddle,\n refX: 0,\n refY: 0,\n refAngle: 0,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseline: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n lineStyle: {\n stroke: '#b2bacf',\n lineWidth: 1,\n lineDash: [2]\n }\n};\n\nexport const DEFAULT_CARTESIAN_MARK_AREA_THEME = {\n interactive: true,\n label: {\n position: ICartesianMarkAreaLabelPosition.right,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseline: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n areaStyle: {\n fill: '#b2bacf',\n visible: true\n }\n};\n\nexport const DEFAULT_POLAR_MARK_AREA_THEME = {\n interactive: true,\n label: {\n position: IPolarMarkLabelPosition.arcOuterMiddle,\n textStyle: {\n fill: '#fff',\n stroke: '#fff',\n lineWidth: 0,\n fontSize: 10,\n fontWeight: 'normal',\n fontStyle: 'normal',\n textAlign: 'center',\n textBaseline: 'middle'\n },\n padding: [2, 2, 4, 4],\n panel: {\n visible: true,\n cornerRadius: 0,\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8\n }\n },\n areaStyle: {\n fill: '#b2bacf',\n visible: true\n }\n};\n\nexport const DEFAULT_CARTESIAN_MARK_AREA_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n left: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n insideLeft: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n\n right: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideRight: {\n textAlign: 'right',\n textBaseline: 'middle'\n },\n\n top: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n insideTop: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n\n bottom: {\n textAlign: 'center',\n textBaseline: 'top'\n },\n insideBottom: {\n textAlign: 'center',\n textBaseline: 'bottom'\n },\n\n middle: {\n textAlign: 'center',\n textBaseline: 'middle'\n }\n};\n\nexport const DEFAULT_MARK_POINT_THEME = {\n interactive: true,\n itemLine: {\n visible: true,\n decorativeLine: {\n visible: false,\n length: 30\n },\n startSymbol: {\n visible: true,\n clip: true,\n symbolType: 'circle',\n size: 20,\n style: {\n fill: false,\n stroke: 'rgba(46, 47, 50)'\n }\n },\n endSymbol: {\n visible: false,\n clip: true,\n symbolType: 'triangle',\n size: 12,\n style: {\n fill: false,\n stroke: 'rgba(46, 47, 50)'\n }\n },\n lineStyle: {\n stroke: '#000',\n lineWidth: 1\n }\n },\n itemContent: {\n type: 'text',\n position: 'middle',\n refX: 10,\n symbolStyle: {\n symbolType: 'star',\n fill: 'rgb(48, 115, 242)',\n fillOpacity: 0.8,\n size: 20\n },\n textStyle: {\n dx: 0,\n dy: 0\n },\n imageStyle: {\n width: 80,\n height: 80\n },\n richTextStyle: {\n width: 100,\n height: 100\n }\n }\n};\n\nexport const DEFAULT_MARK_POINT_TEXT_STYLE_MAP: {\n [K: string]: {\n textAlign: TextAlignType;\n textBaseline: TextBaselineType;\n };\n} = {\n top: {\n textAlign: 'left',\n textBaseline: 'bottom'\n },\n bottom: {\n textAlign: 'left',\n textBaseline: 'top'\n },\n middle: {\n textAlign: 'left',\n textBaseline: 'middle'\n },\n insideTop: {\n textAlign: 'right',\n textBaseline: 'bottom'\n },\n insideBottom: {\n textAlign: 'right',\n textBaseline: 'top'\n },\n insideMiddle: {\n textAlign: 'right',\n textBaseline: 'middle'\n }\n};\n"]}
|
package/es/marker/index.d.ts
CHANGED
package/es/marker/index.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
export * from "./type";
|
|
2
2
|
|
|
3
|
-
export * from "./line";
|
|
3
|
+
export * from "./cartesian/line";
|
|
4
4
|
|
|
5
|
-
export * from "./area";
|
|
5
|
+
export * from "./cartesian/area";
|
|
6
|
+
|
|
7
|
+
export * from "./polar/arc-line";
|
|
8
|
+
|
|
9
|
+
export * from "./polar/area";
|
|
6
10
|
|
|
7
11
|
export * from "./point";
|
|
8
12
|
//# sourceMappingURL=index.js.map
|
package/es/marker/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,
|
|
1
|
+
{"version":3,"sources":["../src/marker/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC","file":"index.js","sourcesContent":["export * from './type';\nexport * from './cartesian/line';\nexport * from './cartesian/area';\nexport * from './polar/arc-line';\n// export * from './polar/line';\nexport * from './polar/area';\nexport * from './point';\n"]}
|
package/es/marker/point.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare class MarkPoint extends Marker<MarkPointAttrs> {
|
|
|
72
72
|
protected setItemAttributes(item: ISymbol | Tag | IImage | IRichText, itemContent: IItemContent, itemPosition: Point, itemType: 'symbol' | 'text' | 'image' | 'richText' | 'custom'): void;
|
|
73
73
|
protected getItemDx(item: ISymbol | Tag | IImage | IRichText, position: keyof typeof IMarkPointItemPosition, style?: IImageGraphicAttribute | IRichTextGraphicAttribute): number;
|
|
74
74
|
protected getItemDy(item: ISymbol | Tag | IImage | IRichText, position: keyof typeof IMarkPointItemPosition, style?: IImageGraphicAttribute | IRichTextGraphicAttribute): number;
|
|
75
|
-
protected initItem(itemContent: IItemContent, itemPosition: Point): IGroup | Tag |
|
|
75
|
+
protected initItem(itemContent: IItemContent, itemPosition: Point): IGroup | Tag | IRichText | ISymbol | IImage;
|
|
76
76
|
protected getItemLineAttr(itemLine: IItemLine, position: Point, itemPosition: Point): Point[];
|
|
77
77
|
protected setItemLineAttr(itemLine: IItemLine, position: Point, itemPosition: Point, visible: boolean): void;
|
|
78
78
|
protected getDecorativeLineAttr(itemLine: IItemLine, itemPosition: Point): {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ArcSegment } from '../../segment';
|
|
2
|
+
import { BaseMarkLine } from '../base-line';
|
|
3
|
+
import { IPolarMarkLabelPosition } from '../type';
|
|
4
|
+
import type { PolarMarkArcLineAttrs } from '../type';
|
|
5
|
+
import type { ComponentOptions } from '../../interface';
|
|
6
|
+
export declare class PolarMarkArcLine extends BaseMarkLine<IPolarMarkLabelPosition> {
|
|
7
|
+
name: string;
|
|
8
|
+
static defaultAttributes: Partial<PolarMarkArcLineAttrs>;
|
|
9
|
+
protected _line: ArcSegment;
|
|
10
|
+
constructor(attributes: PolarMarkArcLineAttrs, options?: ComponentOptions);
|
|
11
|
+
protected isValidPoints(): boolean;
|
|
12
|
+
protected getPositionByDirection(direction: IPolarMarkLabelPosition): {
|
|
13
|
+
position: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
angle: number;
|
|
18
|
+
};
|
|
19
|
+
protected setLabelPos(): void;
|
|
20
|
+
protected createSegment(): ArcSegment;
|
|
21
|
+
protected setLineAttributes(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { merge } from "@visactor/vutils";
|
|
2
|
+
|
|
3
|
+
import { ArcSegment } from "../../segment";
|
|
4
|
+
|
|
5
|
+
import { loadPolarMarkArcLineComponent } from "../register";
|
|
6
|
+
|
|
7
|
+
import { DEFAULT_STATES } from "../../constant";
|
|
8
|
+
|
|
9
|
+
import { BaseMarkLine } from "../base-line";
|
|
10
|
+
|
|
11
|
+
import { IPolarMarkLabelPosition } from "../type";
|
|
12
|
+
|
|
13
|
+
import { DEFAULT_POLAR_MARK_LINE_THEME } from "../config";
|
|
14
|
+
|
|
15
|
+
loadPolarMarkArcLineComponent();
|
|
16
|
+
|
|
17
|
+
export class PolarMarkArcLine extends BaseMarkLine {
|
|
18
|
+
constructor(attributes, options) {
|
|
19
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, PolarMarkArcLine.defaultAttributes, attributes)),
|
|
20
|
+
this.name = "polarMarkArcLine";
|
|
21
|
+
}
|
|
22
|
+
isValidPoints() {
|
|
23
|
+
return !0;
|
|
24
|
+
}
|
|
25
|
+
getPositionByDirection(direction) {
|
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
27
|
+
const {center: center, radius: radius, startAngle: startAngle, endAngle: endAngle, label: label} = this.attribute, {refX: refX = 0, refY: refY = 0} = label, labelRectHeight = Math.abs((null !== (_b = null === (_a = this._label.getTextShape().AABBBounds) || void 0 === _a ? void 0 : _a.y2) && void 0 !== _b ? _b : 0) - (null !== (_d = null === (_c = this._label.getTextShape()) || void 0 === _c ? void 0 : _c.AABBBounds.y1) && void 0 !== _d ? _d : 0)), labelTextHeight = Math.abs((null !== (_f = null === (_e = this._label.getBgRect().AABBBounds) || void 0 === _e ? void 0 : _e.y2) && void 0 !== _f ? _f : 0) - (null !== (_h = null === (_g = this._label.getBgRect()) || void 0 === _g ? void 0 : _g.AABBBounds.y1) && void 0 !== _h ? _h : 0)), labelHeight = Math.max(labelRectHeight, labelTextHeight);
|
|
28
|
+
let angle, orthogonalOffsetDirection;
|
|
29
|
+
switch (direction) {
|
|
30
|
+
case IPolarMarkLabelPosition.center:
|
|
31
|
+
angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = 0;
|
|
32
|
+
break;
|
|
33
|
+
|
|
34
|
+
case IPolarMarkLabelPosition.arcInnerStart:
|
|
35
|
+
angle = startAngle, orthogonalOffsetDirection = -1;
|
|
36
|
+
break;
|
|
37
|
+
|
|
38
|
+
case IPolarMarkLabelPosition.arcOuterStart:
|
|
39
|
+
angle = startAngle, orthogonalOffsetDirection = 1;
|
|
40
|
+
break;
|
|
41
|
+
|
|
42
|
+
case IPolarMarkLabelPosition.arcInnerEnd:
|
|
43
|
+
angle = endAngle, orthogonalOffsetDirection = -1;
|
|
44
|
+
break;
|
|
45
|
+
|
|
46
|
+
case IPolarMarkLabelPosition.arcOuterEnd:
|
|
47
|
+
angle = endAngle, orthogonalOffsetDirection = 1;
|
|
48
|
+
break;
|
|
49
|
+
|
|
50
|
+
case IPolarMarkLabelPosition.arcInnerMiddle:
|
|
51
|
+
angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = -1;
|
|
52
|
+
break;
|
|
53
|
+
|
|
54
|
+
case IPolarMarkLabelPosition.arcOuterMiddle:
|
|
55
|
+
angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = 1;
|
|
56
|
+
break;
|
|
57
|
+
|
|
58
|
+
default:
|
|
59
|
+
angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = -1;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
position: {
|
|
63
|
+
x: center.x + (radius + orthogonalOffsetDirection * labelHeight / 2 + refY) * Math.cos(angle) + refX * Math.cos(angle - Math.PI / 2),
|
|
64
|
+
y: center.y + (radius + orthogonalOffsetDirection * labelHeight / 2 + refY) * Math.sin(angle) + refX * Math.sin(angle - Math.PI / 2)
|
|
65
|
+
},
|
|
66
|
+
angle: angle
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
setLabelPos() {
|
|
70
|
+
var _a;
|
|
71
|
+
super.setLabelPos();
|
|
72
|
+
const {label: label = {}} = this.attribute, {position: position = "arcInnerMiddle", autoRotate: autoRotate = !0} = label, labelAttr = this.getPositionByDirection(position);
|
|
73
|
+
this._label.setAttributes(Object.assign(Object.assign({}, labelAttr.position), {
|
|
74
|
+
angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a = label.refAngle) && void 0 !== _a ? _a : 0) : 0
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
createSegment() {
|
|
78
|
+
const {center: center, radius: radius, startAngle: startAngle, endAngle: endAngle, startSymbol: startSymbol, endSymbol: endSymbol, lineStyle: lineStyle, state: state} = this.attribute;
|
|
79
|
+
return new ArcSegment({
|
|
80
|
+
center: center,
|
|
81
|
+
radius: radius,
|
|
82
|
+
startAngle: startAngle,
|
|
83
|
+
endAngle: endAngle,
|
|
84
|
+
startSymbol: startSymbol,
|
|
85
|
+
endSymbol: endSymbol,
|
|
86
|
+
lineStyle: lineStyle,
|
|
87
|
+
state: {
|
|
88
|
+
line: merge({}, DEFAULT_STATES, null == state ? void 0 : state.line),
|
|
89
|
+
startSymbol: merge({}, DEFAULT_STATES, null == state ? void 0 : state.lineStartSymbol),
|
|
90
|
+
endSymbol: merge({}, DEFAULT_STATES, null == state ? void 0 : state.lineEndSymbol)
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
setLineAttributes() {
|
|
95
|
+
const {center: center, radius: radius, startAngle: startAngle, endAngle: endAngle, startSymbol: startSymbol, endSymbol: endSymbol, lineStyle: lineStyle} = this.attribute;
|
|
96
|
+
this._line && this._line.setAttributes({
|
|
97
|
+
center: center,
|
|
98
|
+
radius: radius,
|
|
99
|
+
startAngle: startAngle,
|
|
100
|
+
endAngle: endAngle,
|
|
101
|
+
startSymbol: startSymbol,
|
|
102
|
+
endSymbol: endSymbol,
|
|
103
|
+
lineStyle: lineStyle
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
PolarMarkArcLine.defaultAttributes = DEFAULT_POLAR_MARK_LINE_THEME;
|
|
109
|
+
//# sourceMappingURL=arc-line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marker/polar/arc-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE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IAAI;aAC5F,SAAkC,CAAC;QACtC,OAAO,IAAI,UAAU,CAAC;YACpB,MAAM;YACN,MAAM;YACN,UAAU;YACV,QAAQ;YACR,WAAW;YACX,SAAS;YACT,SAAS;YACT,KAAK,EAAE;gBACL,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC;gBAC5C,WAAW,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,CAAC;gBAC9D,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,CAAC;aAC3D;SACF,CAAC,CAAC;IACL,CAAC;IAES,iBAAiB;QACzB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI;aACrF,SAAkC,CAAC;QACtC,IAAI,IAAI,CAAC,KAAK,EAAE;YACb,IAAI,CAAC,KAAa,CAAC,aAAa,CAAC;gBAChC,MAAM;gBACN,MAAM;gBACN,UAAU;gBACV,QAAQ;gBACR,WAAW;gBACX,SAAS;gBACT,SAAS;aACV,CAAC,CAAC;SACJ;IACH,CAAC;;AA3HM,kCAAiB,GACtB,6BAAiE,CAAC","file":"arc-line.js","sourcesContent":["import { merge } from '@visactor/vutils';\nimport { ArcSegment } from '../../segment';\nimport { loadPolarMarkArcLineComponent } from '../register';\nimport { DEFAULT_STATES } from '../../constant';\nimport { BaseMarkLine } from '../base-line';\nimport { IPolarMarkLabelPosition } from '../type';\n// eslint-disable-next-line no-duplicate-imports\nimport type { PolarMarkArcLineAttrs } from '../type';\nimport { DEFAULT_POLAR_MARK_LINE_THEME } from '../config';\nimport type { ComponentOptions } from '../../interface';\n\nloadPolarMarkArcLineComponent();\nexport class PolarMarkArcLine extends BaseMarkLine<IPolarMarkLabelPosition> {\n name = 'polarMarkArcLine';\n // eslint-disable-next-line max-len\n static defaultAttributes: Partial<PolarMarkArcLineAttrs> =\n DEFAULT_POLAR_MARK_LINE_THEME as unknown as PolarMarkArcLineAttrs;\n protected _line!: ArcSegment;\n\n constructor(attributes: PolarMarkArcLineAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, PolarMarkArcLine.defaultAttributes, attributes));\n }\n\n protected isValidPoints() {\n return true;\n }\n\n protected getPositionByDirection(direction: IPolarMarkLabelPosition) {\n const { center, radius, startAngle, endAngle, label } = this.attribute as PolarMarkArcLineAttrs;\n const { refX = 0, refY = 0 } = label;\n // eslint-disable-next-line max-len\n const labelRectHeight = Math.abs(\n (this._label.getTextShape().AABBBounds?.y2 ?? 0) - (this._label.getTextShape()?.AABBBounds.y1 ?? 0)\n );\n // eslint-disable-next-line max-len\n const labelTextHeight = Math.abs(\n (this._label.getBgRect().AABBBounds?.y2 ?? 0) - (this._label.getBgRect()?.AABBBounds.y1 ?? 0)\n );\n const labelHeight = Math.max(labelRectHeight, labelTextHeight);\n\n let angle;\n // tag在正交方向是向内偏移,还是向外偏移\n // 不偏移: 0, 内: -1, 外: 1\n let orthogonalOffsetDirection;\n\n switch (direction) {\n case IPolarMarkLabelPosition.center:\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = 0;\n break;\n case IPolarMarkLabelPosition.arcInnerStart:\n angle = startAngle;\n orthogonalOffsetDirection = -1;\n break;\n case IPolarMarkLabelPosition.arcOuterStart:\n angle = startAngle;\n orthogonalOffsetDirection = 1;\n break;\n case IPolarMarkLabelPosition.arcInnerEnd:\n angle = endAngle;\n orthogonalOffsetDirection = -1;\n break;\n case IPolarMarkLabelPosition.arcOuterEnd:\n angle = endAngle;\n orthogonalOffsetDirection = 1;\n break;\n case IPolarMarkLabelPosition.arcInnerMiddle:\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = -1;\n break;\n case IPolarMarkLabelPosition.arcOuterMiddle:\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = 1;\n break;\n default: // default arcInnerMiddle\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = -1;\n }\n\n return {\n position: {\n x:\n center.x +\n (radius + (orthogonalOffsetDirection * labelHeight) / 2 + refY) * Math.cos(angle) +\n refX * Math.cos(angle - Math.PI / 2),\n y:\n center.y +\n (radius + (orthogonalOffsetDirection * labelHeight) / 2 + refY) * Math.sin(angle) +\n refX * Math.sin(angle - Math.PI / 2)\n },\n angle\n };\n }\n\n protected setLabelPos(): void {\n super.setLabelPos();\n const { label = {} } = this.attribute as PolarMarkArcLineAttrs;\n const { position = 'arcInnerMiddle', autoRotate = true } = label;\n const labelAttr = this.getPositionByDirection(position as any);\n this._label.setAttributes({\n ...labelAttr.position,\n angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (label.refAngle ?? 0) : 0\n });\n }\n\n protected createSegment() {\n const { center, radius, startAngle, endAngle, startSymbol, endSymbol, lineStyle, state } = this\n .attribute as PolarMarkArcLineAttrs;\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 } = this\n .attribute as PolarMarkArcLineAttrs;\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 });\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { IArc, IGroup } from '@visactor/vrender-core';
|
|
2
|
+
import { Tag } from '../../tag';
|
|
3
|
+
import { Marker } from '../base';
|
|
4
|
+
import { IPolarMarkLabelPosition, type PolarMarkAreaAttrs } from '../type';
|
|
5
|
+
import type { ComponentOptions } from '../../interface';
|
|
6
|
+
export declare class PolarMarkArea extends Marker<PolarMarkAreaAttrs> {
|
|
7
|
+
name: string;
|
|
8
|
+
static defaultAttributes: {
|
|
9
|
+
interactive: boolean;
|
|
10
|
+
label: {
|
|
11
|
+
position: IPolarMarkLabelPosition;
|
|
12
|
+
textStyle: {
|
|
13
|
+
fill: string;
|
|
14
|
+
stroke: string;
|
|
15
|
+
lineWidth: number;
|
|
16
|
+
fontSize: number;
|
|
17
|
+
fontWeight: string;
|
|
18
|
+
fontStyle: string;
|
|
19
|
+
textAlign: string;
|
|
20
|
+
textBaseline: string;
|
|
21
|
+
};
|
|
22
|
+
padding: number[];
|
|
23
|
+
panel: {
|
|
24
|
+
visible: boolean;
|
|
25
|
+
cornerRadius: number;
|
|
26
|
+
fill: string;
|
|
27
|
+
fillOpacity: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
areaStyle: {
|
|
31
|
+
fill: string;
|
|
32
|
+
visible: boolean;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
private _area;
|
|
36
|
+
getArea(): IArc;
|
|
37
|
+
getLabel(): Tag;
|
|
38
|
+
constructor(attributes: PolarMarkAreaAttrs, options?: ComponentOptions);
|
|
39
|
+
protected getPositionByDirection(direction: string): {
|
|
40
|
+
position: {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
};
|
|
44
|
+
angle: number;
|
|
45
|
+
};
|
|
46
|
+
protected setLabelPos(): void;
|
|
47
|
+
protected initMarker(container: IGroup): void;
|
|
48
|
+
protected updateMarker(): void;
|
|
49
|
+
protected isValidPoints(): boolean;
|
|
50
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { graphicCreator } from "@visactor/vrender-core";
|
|
2
|
+
|
|
3
|
+
import { merge } from "@visactor/vutils";
|
|
4
|
+
|
|
5
|
+
import { Tag } from "../../tag";
|
|
6
|
+
|
|
7
|
+
import { Marker } from "../base";
|
|
8
|
+
|
|
9
|
+
import { DEFAULT_POLAR_MARK_AREA_THEME } from "../config";
|
|
10
|
+
|
|
11
|
+
import { IPolarMarkLabelPosition } from "../type";
|
|
12
|
+
|
|
13
|
+
import { limitShapeInBounds } from "../../util/limit-shape";
|
|
14
|
+
|
|
15
|
+
import { loadPolarMarkAreaComponent } from "../register";
|
|
16
|
+
|
|
17
|
+
import { DEFAULT_STATES } from "../../constant";
|
|
18
|
+
|
|
19
|
+
loadPolarMarkAreaComponent();
|
|
20
|
+
|
|
21
|
+
export class PolarMarkArea extends Marker {
|
|
22
|
+
getArea() {
|
|
23
|
+
return this._area;
|
|
24
|
+
}
|
|
25
|
+
getLabel() {
|
|
26
|
+
return this._label;
|
|
27
|
+
}
|
|
28
|
+
constructor(attributes, options) {
|
|
29
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, PolarMarkArea.defaultAttributes, attributes)),
|
|
30
|
+
this.name = "polarMarkArea";
|
|
31
|
+
}
|
|
32
|
+
getPositionByDirection(direction) {
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
34
|
+
const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle, label: label} = this.attribute, {refX: refX = 0, refY: refY = 0} = label, labelRectHeight = Math.abs((null !== (_b = null === (_a = this._label.getTextShape().AABBBounds) || void 0 === _a ? void 0 : _a.y2) && void 0 !== _b ? _b : 0) - (null !== (_d = null === (_c = this._label.getTextShape()) || void 0 === _c ? void 0 : _c.AABBBounds.y1) && void 0 !== _d ? _d : 0)), labelTextHeight = Math.abs((null !== (_f = null === (_e = this._label.getBgRect().AABBBounds) || void 0 === _e ? void 0 : _e.y2) && void 0 !== _f ? _f : 0) - (null !== (_h = null === (_g = this._label.getBgRect()) || void 0 === _g ? void 0 : _g.AABBBounds.y1) && void 0 !== _h ? _h : 0)), labelHeight = Math.max(labelRectHeight, labelTextHeight);
|
|
35
|
+
let radius, angle, orthogonalOffsetDirection;
|
|
36
|
+
switch (direction) {
|
|
37
|
+
case IPolarMarkLabelPosition.center:
|
|
38
|
+
radius = (innerRadius + outerRadius) / 2, angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = 0;
|
|
39
|
+
break;
|
|
40
|
+
|
|
41
|
+
case IPolarMarkLabelPosition.arcInnerStart:
|
|
42
|
+
radius = innerRadius, angle = startAngle, orthogonalOffsetDirection = -1;
|
|
43
|
+
break;
|
|
44
|
+
|
|
45
|
+
case IPolarMarkLabelPosition.arcOuterStart:
|
|
46
|
+
radius = outerRadius, angle = startAngle, orthogonalOffsetDirection = 1;
|
|
47
|
+
break;
|
|
48
|
+
|
|
49
|
+
case IPolarMarkLabelPosition.arcInnerEnd:
|
|
50
|
+
radius = innerRadius, angle = endAngle, orthogonalOffsetDirection = -1;
|
|
51
|
+
break;
|
|
52
|
+
|
|
53
|
+
case IPolarMarkLabelPosition.arcOuterEnd:
|
|
54
|
+
radius = outerRadius, angle = endAngle, orthogonalOffsetDirection = 1;
|
|
55
|
+
break;
|
|
56
|
+
|
|
57
|
+
case IPolarMarkLabelPosition.arcInnerMiddle:
|
|
58
|
+
radius = innerRadius, angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = -1;
|
|
59
|
+
break;
|
|
60
|
+
|
|
61
|
+
case IPolarMarkLabelPosition.arcOuterMiddle:
|
|
62
|
+
radius = outerRadius, angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = 1;
|
|
63
|
+
break;
|
|
64
|
+
|
|
65
|
+
default:
|
|
66
|
+
radius = innerRadius, angle = (startAngle + endAngle) / 2, orthogonalOffsetDirection = -1;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
position: {
|
|
70
|
+
x: center.x + (radius + orthogonalOffsetDirection * labelHeight / 2 + refY) * Math.cos(angle) + refX * Math.cos(angle - Math.PI / 2),
|
|
71
|
+
y: center.y + (radius + orthogonalOffsetDirection * labelHeight / 2 + refY) * Math.sin(angle) + refX * Math.sin(angle - Math.PI / 2)
|
|
72
|
+
},
|
|
73
|
+
angle: angle
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
setLabelPos() {
|
|
77
|
+
var _a;
|
|
78
|
+
if (this._label && this._area) {
|
|
79
|
+
const {label: label = {}} = this.attribute, {position: labelPosition = "arcInnerMiddle", autoRotate: autoRotate = !0} = label, labelAttr = this.getPositionByDirection(labelPosition);
|
|
80
|
+
if (this._label.setAttributes(Object.assign(Object.assign({}, labelAttr.position), {
|
|
81
|
+
angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (null !== (_a = label.refAngle) && void 0 !== _a ? _a : 0) : 0
|
|
82
|
+
})), this.attribute.limitRect && label.confine) {
|
|
83
|
+
const {x: x, y: y, width: width, height: height} = this.attribute.limitRect;
|
|
84
|
+
limitShapeInBounds(this._label, {
|
|
85
|
+
x1: x,
|
|
86
|
+
y1: y,
|
|
87
|
+
x2: x + width,
|
|
88
|
+
y2: y + height
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
initMarker(container) {
|
|
94
|
+
const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle, areaStyle: areaStyle, label: label, state: state} = this.attribute, area = graphicCreator.arc(Object.assign({
|
|
95
|
+
x: center.x,
|
|
96
|
+
y: center.y,
|
|
97
|
+
innerRadius: innerRadius,
|
|
98
|
+
outerRadius: outerRadius,
|
|
99
|
+
startAngle: startAngle,
|
|
100
|
+
endAngle: endAngle
|
|
101
|
+
}, areaStyle));
|
|
102
|
+
area.states = merge({}, DEFAULT_STATES, null == state ? void 0 : state.area), area.name = "polar-mark-area-area",
|
|
103
|
+
this._area = area, container.add(area);
|
|
104
|
+
const markLabel = new Tag(Object.assign(Object.assign({}, label), {
|
|
105
|
+
state: {
|
|
106
|
+
panel: merge({}, DEFAULT_STATES, null == state ? void 0 : state.labelBackground),
|
|
107
|
+
text: merge({}, DEFAULT_STATES, null == state ? void 0 : state.label)
|
|
108
|
+
}
|
|
109
|
+
}));
|
|
110
|
+
markLabel.name = "mark-area-label", this._label = markLabel, container.add(markLabel),
|
|
111
|
+
this.setLabelPos();
|
|
112
|
+
}
|
|
113
|
+
updateMarker() {
|
|
114
|
+
const {center: center, innerRadius: innerRadius, outerRadius: outerRadius, startAngle: startAngle, endAngle: endAngle, areaStyle: areaStyle, label: label} = this.attribute;
|
|
115
|
+
this._area && this._area.setAttributes(Object.assign({
|
|
116
|
+
x: center.x,
|
|
117
|
+
y: center.y,
|
|
118
|
+
innerRadius: innerRadius,
|
|
119
|
+
outerRadius: outerRadius,
|
|
120
|
+
startAngle: startAngle,
|
|
121
|
+
endAngle: endAngle
|
|
122
|
+
}, areaStyle)), this._area && this._label.setAttributes(Object.assign({
|
|
123
|
+
dx: 0,
|
|
124
|
+
dy: 0
|
|
125
|
+
}, label)), this.setLabelPos();
|
|
126
|
+
}
|
|
127
|
+
isValidPoints() {
|
|
128
|
+
return !0;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
PolarMarkArea.defaultAttributes = DEFAULT_POLAR_MARK_AREA_THEME;
|
|
133
|
+
//# sourceMappingURL=area.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marker/polar/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,WAAW,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAA2B,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,0BAA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AAC;QAEpB,MAAM,SAAS,GAAG,IAAI,GAAG,iCACnB,KAAuB,KAC3B,KAAK,EAAE;gBACL,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,CAAC;gBACxD,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,CAAC;aAC9C,IACD,CAAC;QACH,SAAS,CAAC,IAAI,GAAG,iBAAiB,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,SAAS,CAAC,GAAG,CAAC,SAA6B,CAAC,CAAC;QAC7C,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAES,YAAY;QACpB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,IAAI;aACtF,SAA+B,CAAC;QACnC,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;SACJ;QACD,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,MAAM,CAAC,aAAa,iBACvB,EAAE,EAAE,CAAC,EACL,EAAE,EAAE,CAAC,IACD,KAAuB,EAC3B,CAAC;SACJ;QACD,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAES,aAAa;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;;AA1KM,+BAAiB,GAAG,6BAA6B,CAAC","file":"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_POLAR_MARK_AREA_THEME } from '../config';\nimport { IPolarMarkLabelPosition, type PolarMarkAreaAttrs } from '../type';\nimport { limitShapeInBounds } from '../../util/limit-shape';\nimport type { ComponentOptions } from '../../interface';\nimport { loadPolarMarkAreaComponent } from '../register';\nimport { DEFAULT_STATES } from '../../constant';\n\nloadPolarMarkAreaComponent();\nexport class PolarMarkArea extends Marker<PolarMarkAreaAttrs> {\n name = 'polarMarkArea';\n static defaultAttributes = DEFAULT_POLAR_MARK_AREA_THEME;\n private _area!: IArc;\n\n getArea() {\n return this._area;\n }\n\n getLabel() {\n return this._label;\n }\n\n constructor(attributes: PolarMarkAreaAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, PolarMarkArea.defaultAttributes, attributes));\n }\n\n protected getPositionByDirection(direction: string) {\n const { center, innerRadius, outerRadius, startAngle, endAngle, label } = this.attribute as PolarMarkAreaAttrs;\n const { refX = 0, refY = 0 } = label;\n // eslint-disable-next-line max-len\n const labelRectHeight = Math.abs(\n (this._label.getTextShape().AABBBounds?.y2 ?? 0) - (this._label.getTextShape()?.AABBBounds.y1 ?? 0)\n );\n // eslint-disable-next-line max-len\n const labelTextHeight = Math.abs(\n (this._label.getBgRect().AABBBounds?.y2 ?? 0) - (this._label.getBgRect()?.AABBBounds.y1 ?? 0)\n );\n const labelHeight = Math.max(labelRectHeight, labelTextHeight);\n\n let radius;\n let angle;\n // tag在正交方向是向内偏移,还是向外偏移\n // 不偏移: 0, 内: -1, 外: 1\n let orthogonalOffsetDirection;\n\n switch (direction) {\n case IPolarMarkLabelPosition.center:\n radius = (innerRadius + outerRadius) / 2;\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = 0;\n break;\n case IPolarMarkLabelPosition.arcInnerStart:\n radius = innerRadius;\n angle = startAngle;\n orthogonalOffsetDirection = -1;\n break;\n case IPolarMarkLabelPosition.arcOuterStart:\n radius = outerRadius;\n angle = startAngle;\n orthogonalOffsetDirection = 1;\n break;\n case IPolarMarkLabelPosition.arcInnerEnd:\n radius = innerRadius;\n angle = endAngle;\n orthogonalOffsetDirection = -1;\n break;\n case IPolarMarkLabelPosition.arcOuterEnd:\n radius = outerRadius;\n angle = endAngle;\n orthogonalOffsetDirection = 1;\n break;\n case IPolarMarkLabelPosition.arcInnerMiddle:\n radius = innerRadius;\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = -1;\n break;\n case IPolarMarkLabelPosition.arcOuterMiddle:\n radius = outerRadius;\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = 1;\n break;\n default: // default arcInnerMiddle\n radius = innerRadius;\n angle = (startAngle + endAngle) / 2;\n orthogonalOffsetDirection = -1;\n }\n\n return {\n position: {\n x:\n center.x +\n (radius + (orthogonalOffsetDirection * labelHeight) / 2 + refY) * Math.cos(angle) +\n refX * Math.cos(angle - Math.PI / 2),\n y:\n center.y +\n (radius + (orthogonalOffsetDirection * labelHeight) / 2 + refY) * Math.sin(angle) +\n 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 PolarMarkAreaAttrs;\n const { position: labelPosition = 'arcInnerMiddle', autoRotate = true } = label;\n const labelAttr = this.getPositionByDirection(labelPosition);\n\n this._label.setAttributes({\n ...labelAttr.position,\n angle: autoRotate ? labelAttr.angle - Math.PI / 2 + (label.refAngle ?? 0) : 0\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 PolarMarkAreaAttrs;\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 } = this\n .attribute as PolarMarkAreaAttrs;\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 }\n if (this._area) {\n this._label.setAttributes({\n dx: 0,\n dy: 0, // 需要进行复位\n ...(label as TagAttributes)\n });\n }\n this.setLabelPos();\n }\n\n protected isValidPoints() {\n return true;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/marker/polar/line.ts"],"names":[],"mappings":"","file":"line.js","sourcesContent":["// import { merge } from '@visactor/vutils';\n// import { DEFAULT_COMMON_MARK_LINE_THEME } from '../config';\n// import type { PolarMarkLineAttrs } from '../type';\n// import { DEFAULT_STATES } from '../../constant';\n// import { BaseMarkLine } from '../base-line';\n// import { loadPolarMarkLineComponent } from '../register';\n\n// loadPolarMarkLineComponent();\n// export class PolarMarkLine extends BaseMarkLine {\n// name = 'polarMarkLine';\n// static defaultAttributes: Partial<PolarMarkLineAttrs> = DEFAULT_COMMON_MARK_LINE_THEME;\n// protected isValidPoints() {\n// return true\n// }\n\n// protected createSegment() {\n// const {\n// center,\n// radius,\n// startAngle,\n// endAngle,\n// startSymbol,\n// endSymbol,\n// lineStyle,\n// state\n// } = this.attribute as PolarMarkLineAttrs;\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 {\n// center,\n// radius,\n// startAngle,\n// endAngle,\n// startSymbol,\n// endSymbol,\n// lineStyle,\n// } = this.attribute as PolarMarkArcLineAttrs;\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// });\n// }\n// }\n// }\n"]}
|
package/es/marker/register.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
export declare function
|
|
1
|
+
export declare function loadCartesianMarkLineComponent(): void;
|
|
2
|
+
export declare function loadPolarMarkLineComponent(): void;
|
|
3
|
+
export declare function loadPolarMarkArcLineComponent(): void;
|
|
4
|
+
export declare function loadCartesianMarkAreaComponent(): void;
|
|
5
|
+
export declare function loadPolarMarkAreaComponent(): void;
|
|
3
6
|
export declare function loadMarkPointComponent(): void;
|
package/es/marker/register.js
CHANGED
|
@@ -1,21 +1,33 @@
|
|
|
1
|
-
import { registerGroup, registerImage, registerLine, registerPolygon, registerSymbol } from "@visactor/vrender-kits";
|
|
1
|
+
import { registerArc, registerGroup, registerImage, registerLine, registerPolygon, registerSymbol } from "@visactor/vrender-kits";
|
|
2
2
|
|
|
3
3
|
import { loadTagComponent } from "../tag/register";
|
|
4
4
|
|
|
5
|
-
import { loadSegmentComponent } from "../segment/register";
|
|
5
|
+
import { loadArcSegmentComponent, loadSegmentComponent } from "../segment/register";
|
|
6
6
|
|
|
7
7
|
function loadBaseMarker() {
|
|
8
8
|
registerGroup(), loadTagComponent();
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export function
|
|
11
|
+
export function loadCartesianMarkLineComponent() {
|
|
12
12
|
loadBaseMarker(), loadSegmentComponent();
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export function
|
|
15
|
+
export function loadPolarMarkLineComponent() {
|
|
16
|
+
loadBaseMarker(), loadSegmentComponent();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function loadPolarMarkArcLineComponent() {
|
|
20
|
+
loadBaseMarker(), loadArcSegmentComponent();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function loadCartesianMarkAreaComponent() {
|
|
16
24
|
loadBaseMarker(), registerPolygon();
|
|
17
25
|
}
|
|
18
26
|
|
|
27
|
+
export function loadPolarMarkAreaComponent() {
|
|
28
|
+
loadBaseMarker(), registerArc();
|
|
29
|
+
}
|
|
30
|
+
|
|
19
31
|
export function loadMarkPointComponent() {
|
|
20
32
|
loadBaseMarker(), loadSegmentComponent(), registerSymbol(), registerImage(), registerLine();
|
|
21
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marker/register.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"sources":["../src/marker/register.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,eAAe,EACf,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACpF,SAAS,cAAc;IACrB,aAAa,EAAE,CAAC;IAChB,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,8BAA8B;IAC5C,cAAc,EAAE,CAAC;IACjB,oBAAoB,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,cAAc,EAAE,CAAC;IACjB,oBAAoB,EAAE,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,cAAc,EAAE,CAAC;IACjB,uBAAuB,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,8BAA8B;IAC5C,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,0BAA0B;IACxC,cAAc,EAAE,CAAC;IACjB,WAAW,EAAE,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,cAAc,EAAE,CAAC;IACjB,oBAAoB,EAAE,CAAC;IACvB,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC;AACjB,CAAC","file":"register.js","sourcesContent":["import {\n registerArc,\n registerGroup,\n registerImage,\n registerLine,\n registerPolygon,\n registerSymbol\n} from '@visactor/vrender-kits';\nimport { loadTagComponent } from '../tag/register';\nimport { loadArcSegmentComponent, loadSegmentComponent } from '../segment/register';\nfunction loadBaseMarker() {\n registerGroup();\n loadTagComponent();\n}\n\nexport function loadCartesianMarkLineComponent() {\n loadBaseMarker();\n loadSegmentComponent();\n}\n\nexport function loadPolarMarkLineComponent() {\n loadBaseMarker();\n loadSegmentComponent();\n}\n\nexport function loadPolarMarkArcLineComponent() {\n loadBaseMarker();\n loadArcSegmentComponent();\n}\n\nexport function loadCartesianMarkAreaComponent() {\n loadBaseMarker();\n registerPolygon();\n}\n\nexport function loadPolarMarkAreaComponent() {\n loadBaseMarker();\n registerArc();\n}\n\nexport function loadMarkPointComponent() {\n loadBaseMarker();\n loadSegmentComponent();\n registerSymbol();\n registerImage();\n registerLine();\n}\n"]}
|