@visactor/vrender-core 0.22.7-alpha.7 → 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/canvas/util.js +1 -2
- package/cjs/color-string/index.js +1 -1
- package/cjs/color-string/interpolate.js +1 -1
- package/cjs/color-string/store.js +1 -1
- package/cjs/common/bounds-context.js +2 -1
- package/cjs/common/canvas-utils.js +5 -2
- package/cjs/common/canvas-utils.js.map +1 -1
- package/cjs/common/render-area.js +0 -1
- package/cjs/common/seg-context.js +2 -1
- package/cjs/common/store.js +1 -1
- package/cjs/common/text.js +1 -1
- package/cjs/common/utils.js +1 -1
- package/cjs/event/federated-event/base-event.js +1 -1
- package/cjs/event/federated-event/base-event.js.map +1 -1
- package/cjs/graphic/arc.js +1 -1
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/area.js +1 -1
- package/cjs/graphic/area.js.map +1 -1
- package/cjs/graphic/circle.js +2 -1
- package/cjs/graphic/circle.js.map +1 -1
- package/cjs/graphic/config.d.ts +2 -1
- package/cjs/graphic/config.js +8 -2
- package/cjs/graphic/config.js.map +1 -1
- package/cjs/graphic/constants.d.ts +1 -0
- package/cjs/graphic/constants.js +4 -3
- package/cjs/graphic/constants.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +3 -0
- package/cjs/graphic/graphic.js +9 -6
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/image.js +2 -1
- package/cjs/graphic/image.js.map +1 -1
- package/cjs/graphic/index.d.ts +1 -0
- package/cjs/graphic/index.js +8 -8
- package/cjs/graphic/index.js.map +1 -1
- package/cjs/graphic/line.js +2 -1
- package/cjs/graphic/line.js.map +1 -1
- package/cjs/graphic/path.js +2 -1
- package/cjs/graphic/path.js.map +1 -1
- package/cjs/graphic/polygon.js +2 -1
- package/cjs/graphic/polygon.js.map +1 -1
- package/cjs/graphic/rect.js +2 -1
- package/cjs/graphic/rect.js.map +1 -1
- package/cjs/graphic/richtext/paragraph.d.ts +3 -0
- package/cjs/graphic/richtext/paragraph.js +14 -10
- package/cjs/graphic/richtext/paragraph.js.map +1 -1
- package/cjs/graphic/richtext/utils.js +12 -2
- package/cjs/graphic/richtext/utils.js.map +1 -1
- package/cjs/graphic/richtext.d.ts +3 -0
- package/cjs/graphic/richtext.js +3 -2
- package/cjs/graphic/richtext.js.map +1 -1
- package/cjs/graphic/star.d.ts +53 -0
- package/cjs/graphic/star.js +76 -0
- package/cjs/graphic/star.js.map +1 -0
- package/cjs/graphic/symbol.js +2 -1
- package/cjs/graphic/symbol.js.map +1 -1
- package/cjs/graphic/text.js +1 -0
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/graphic/theme.js +2 -0
- package/cjs/graphic/theme.js.map +1 -1
- package/cjs/index.d.ts +2 -0
- package/cjs/index.js +7 -6
- package/cjs/index.js.map +1 -1
- package/cjs/interface/contribution.d.ts +2 -0
- package/cjs/interface/contribution.js.map +1 -1
- package/cjs/interface/graphic/index.d.ts +1 -0
- package/cjs/interface/graphic/index.js +3 -2
- package/cjs/interface/graphic/index.js.map +1 -1
- package/cjs/interface/graphic/richText.d.ts +3 -0
- package/cjs/interface/graphic/richText.js.map +1 -1
- package/cjs/interface/graphic/star.d.ts +12 -0
- package/cjs/interface/graphic/star.js +6 -0
- package/cjs/interface/graphic/star.js.map +1 -0
- package/cjs/interface/graphic/theme.d.ts +3 -0
- package/cjs/interface/graphic/theme.js.map +1 -1
- package/cjs/interface/graphic.d.ts +5 -0
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/plugins/builtin-plugin/edit-module.js +11 -8
- package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +1 -1
- package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
- package/cjs/register/register-star.d.ts +1 -0
- package/cjs/register/register-star.js +14 -0
- package/cjs/register/register-star.js.map +1 -0
- package/cjs/render/contributions/render/contributions/constants.d.ts +1 -0
- package/cjs/render/contributions/render/contributions/constants.js +3 -2
- package/cjs/render/contributions/render/contributions/constants.js.map +1 -1
- package/cjs/render/contributions/render/contributions/index.d.ts +1 -0
- package/cjs/render/contributions/render/contributions/index.js +2 -2
- package/cjs/render/contributions/render/contributions/index.js.map +1 -1
- package/cjs/render/contributions/render/contributions/star-contribution-render.d.ts +2 -0
- package/cjs/render/contributions/render/contributions/star-contribution-render.js +11 -0
- package/cjs/render/contributions/render/contributions/star-contribution-render.js.map +1 -0
- package/cjs/render/contributions/render/star-module.d.ts +2 -0
- package/cjs/render/contributions/render/star-module.js +15 -0
- package/cjs/render/contributions/render/star-module.js.map +1 -0
- package/cjs/render/contributions/render/star-render.d.ts +10 -0
- package/cjs/render/contributions/render/star-render.js +54 -0
- package/cjs/render/contributions/render/star-render.js.map +1 -0
- package/cjs/render/contributions/render/symbol.d.ts +1 -0
- package/cjs/render/contributions/render/symbol.js +2 -2
- package/cjs/render/contributions/render/symbol.js.map +1 -1
- package/dist/index.es.js +282 -21
- package/es/canvas/util.js +1 -2
- package/es/color-string/index.js +1 -1
- package/es/color-string/interpolate.js +1 -1
- package/es/color-string/store.js +1 -1
- package/es/common/bounds-context.js +2 -1
- package/es/common/canvas-utils.js +5 -2
- package/es/common/canvas-utils.js.map +1 -1
- package/es/common/render-area.js +1 -2
- package/es/common/seg-context.js +2 -1
- package/es/common/store.js +1 -1
- package/es/common/text.js +1 -1
- package/es/common/utils.js +1 -1
- package/es/event/federated-event/base-event.js +1 -1
- package/es/event/federated-event/base-event.js.map +1 -1
- package/es/graphic/arc.js +1 -1
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/area.js +1 -1
- package/es/graphic/area.js.map +1 -1
- package/es/graphic/circle.js +2 -1
- package/es/graphic/circle.js.map +1 -1
- package/es/graphic/config.d.ts +2 -1
- package/es/graphic/config.js +9 -1
- package/es/graphic/config.js.map +1 -1
- package/es/graphic/constants.d.ts +1 -0
- package/es/graphic/constants.js +2 -0
- package/es/graphic/constants.js.map +1 -1
- package/es/graphic/graphic.d.ts +3 -0
- package/es/graphic/graphic.js +9 -6
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/image.js +2 -1
- package/es/graphic/image.js.map +1 -1
- package/es/graphic/index.d.ts +1 -0
- package/es/graphic/index.js +2 -0
- package/es/graphic/index.js.map +1 -1
- package/es/graphic/line.js +2 -1
- package/es/graphic/line.js.map +1 -1
- package/es/graphic/path.js +2 -1
- package/es/graphic/path.js.map +1 -1
- package/es/graphic/polygon.js +2 -1
- package/es/graphic/polygon.js.map +1 -1
- package/es/graphic/rect.js +2 -1
- package/es/graphic/rect.js.map +1 -1
- package/es/graphic/richtext/paragraph.d.ts +3 -0
- package/es/graphic/richtext/paragraph.js +14 -10
- package/es/graphic/richtext/paragraph.js.map +1 -1
- package/es/graphic/richtext/utils.js +12 -2
- package/es/graphic/richtext/utils.js.map +1 -1
- package/es/graphic/richtext.d.ts +3 -0
- package/es/graphic/richtext.js +3 -2
- package/es/graphic/richtext.js.map +1 -1
- package/es/graphic/star.d.ts +53 -0
- package/es/graphic/star.js +80 -0
- package/es/graphic/star.js.map +1 -0
- package/es/graphic/symbol.js +2 -1
- package/es/graphic/symbol.js.map +1 -1
- package/es/graphic/text.js +1 -0
- package/es/graphic/text.js.map +1 -1
- package/es/graphic/theme.js +3 -1
- package/es/graphic/theme.js.map +1 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +4 -0
- package/es/index.js.map +1 -1
- package/es/interface/contribution.d.ts +2 -0
- package/es/interface/contribution.js.map +1 -1
- package/es/interface/graphic/index.d.ts +1 -0
- package/es/interface/graphic/index.js +2 -0
- package/es/interface/graphic/index.js.map +1 -1
- package/es/interface/graphic/richText.d.ts +3 -0
- package/es/interface/graphic/richText.js.map +1 -1
- package/es/interface/graphic/star.d.ts +12 -0
- package/es/interface/graphic/star.js +2 -0
- package/es/interface/graphic/star.js.map +1 -0
- package/es/interface/graphic/theme.d.ts +3 -0
- package/es/interface/graphic/theme.js.map +1 -1
- package/es/interface/graphic.d.ts +5 -0
- package/es/interface/graphic.js.map +1 -1
- package/es/plugins/builtin-plugin/edit-module.js +11 -8
- package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js +1 -1
- package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
- package/es/register/register-star.d.ts +1 -0
- package/es/register/register-star.js +8 -0
- package/es/register/register-star.js.map +1 -0
- package/es/render/contributions/render/contributions/constants.d.ts +1 -0
- package/es/render/contributions/render/contributions/constants.js +2 -0
- package/es/render/contributions/render/contributions/constants.js.map +1 -1
- package/es/render/contributions/render/contributions/index.d.ts +1 -0
- package/es/render/contributions/render/contributions/index.js +2 -0
- package/es/render/contributions/render/contributions/index.js.map +1 -1
- package/es/render/contributions/render/contributions/star-contribution-render.d.ts +2 -0
- package/es/render/contributions/render/contributions/star-contribution-render.js +8 -0
- package/es/render/contributions/render/contributions/star-contribution-render.js.map +1 -0
- package/es/render/contributions/render/star-module.d.ts +2 -0
- package/es/render/contributions/render/star-module.js +13 -0
- package/es/render/contributions/render/star-module.js.map +1 -0
- package/es/render/contributions/render/star-render.d.ts +10 -0
- package/es/render/contributions/render/star-render.js +59 -0
- package/es/render/contributions/render/star-render.js.map +1 -0
- package/es/render/contributions/render/symbol.d.ts +1 -0
- package/es/render/contributions/render/symbol.js +2 -0
- package/es/render/contributions/render/symbol.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
|
|
2
|
+
var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
3
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
4
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
5
|
+
}, __metadata = this && this.__metadata || function(k, v) {
|
|
6
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
7
|
+
}, __param = this && this.__param || function(paramIndex, decorator) {
|
|
8
|
+
return function(target, key) {
|
|
9
|
+
decorator(target, key, paramIndex);
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
import { inject, injectable, named } from "../../../common/inversify-lite";
|
|
14
|
+
|
|
15
|
+
import { getTheme } from "../../../graphic/theme";
|
|
16
|
+
|
|
17
|
+
import { STAR_NUMBER_TYPE } from "../../../graphic/constants";
|
|
18
|
+
|
|
19
|
+
import { StarRenderContribution } from "./contributions/constants";
|
|
20
|
+
|
|
21
|
+
import { ContributionProvider } from "../../../common/contribution-provider";
|
|
22
|
+
|
|
23
|
+
import { BaseRender } from "./base-render";
|
|
24
|
+
|
|
25
|
+
import { defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution } from "./contributions";
|
|
26
|
+
|
|
27
|
+
let DefaultCanvasStarRender = class extends BaseRender {
|
|
28
|
+
constructor(starRenderContribitions) {
|
|
29
|
+
super(), this.starRenderContribitions = starRenderContribitions, this.numberType = STAR_NUMBER_TYPE,
|
|
30
|
+
this.builtinContributions = [ defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution ],
|
|
31
|
+
this.init(starRenderContribitions);
|
|
32
|
+
}
|
|
33
|
+
drawShape(star, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
34
|
+
const starAttribute = getTheme(star, null == params ? void 0 : params.theme).star, {x: originX = starAttribute.x, y: originY = starAttribute.y, fillStrokeOrder: fillStrokeOrder = starAttribute.fillStrokeOrder} = star.attribute, data = this.valid(star, starAttribute, fillCb, strokeCb);
|
|
35
|
+
if (!data) return;
|
|
36
|
+
const {fVisible: fVisible, sVisible: sVisible, doFill: doFill, doStroke: doStroke} = data, points = star.getCachedPoints();
|
|
37
|
+
context.beginPath(), points && points.length && points.forEach(((point, index) => {
|
|
38
|
+
0 === index ? context.moveTo(x + point.x, y + point.y) : context.lineTo(x + point.x, y + point.y);
|
|
39
|
+
})), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(star, star.attribute, starAttribute),
|
|
40
|
+
this.beforeRenderStep(star, context, x, y, doFill, doStroke, fVisible, sVisible, starAttribute, drawContext, fillCb, strokeCb);
|
|
41
|
+
const _runFill = () => {
|
|
42
|
+
doFill && (fillCb ? fillCb(context, star.attribute, starAttribute) : fVisible && (context.setCommonStyle(star, star.attribute, originX - x, originY - y, starAttribute),
|
|
43
|
+
context.fill()));
|
|
44
|
+
}, _runStroke = () => {
|
|
45
|
+
doStroke && (strokeCb ? strokeCb(context, star.attribute, starAttribute) : sVisible && (context.setStrokeStyle(star, star.attribute, originX - x, originY - y, starAttribute),
|
|
46
|
+
context.stroke()));
|
|
47
|
+
};
|
|
48
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(star, context, x, y, doFill, doStroke, fVisible, sVisible, starAttribute, drawContext, fillCb, strokeCb);
|
|
49
|
+
}
|
|
50
|
+
draw(star, renderService, drawContext, params) {
|
|
51
|
+
const starAttribute = getTheme(star, null == params ? void 0 : params.theme).star;
|
|
52
|
+
this._draw(star, starAttribute, !1, drawContext, params);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
DefaultCanvasStarRender = __decorate([ injectable(), __param(0, inject(ContributionProvider)), __param(0, named(StarRenderContribution)), __metadata("design:paramtypes", [ Object ]) ], DefaultCanvasStarRender);
|
|
57
|
+
|
|
58
|
+
export { DefaultCanvasStarRender };
|
|
59
|
+
//# sourceMappingURL=star-render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/render/contributions/render/star-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,E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CAAC,sBAAsB,CAAC,CAAA;;GANrB,uBAAuB,CAsInC;SAtIY,uBAAuB","file":"star-render.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\nimport { getTheme } from '../../../graphic/theme';\nimport { STAR_NUMBER_TYPE } from '../../../graphic/constants';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IStar,\n IThemeAttribute,\n IGraphicRender,\n IContributionProvider,\n IDrawContext,\n IGraphicRenderDrawParams,\n IRenderService,\n IStarRenderContribution\n} from '../../../interface';\nimport { StarRenderContribution } from './contributions/constants';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { BaseRender } from './base-render';\nimport { defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution } from './contributions';\n\n@injectable()\nexport class DefaultCanvasStarRender extends BaseRender<IStar> implements IGraphicRender {\n type: 'star';\n numberType: number = STAR_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(StarRenderContribution)\n protected readonly starRenderContribitions: IContributionProvider<IStarRenderContribution>\n ) {\n super();\n this.builtinContributions = [defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution];\n this.init(starRenderContribitions);\n }\n\n drawShape(\n star: IStar,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n // Get theme attributes\n const starAttribute = getTheme(star, params?.theme).star;\n const {\n x: originX = starAttribute.x,\n y: originY = starAttribute.y,\n fillStrokeOrder = starAttribute.fillStrokeOrder\n } = star.attribute;\n\n const data = this.valid(star, starAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n // Get cached points for better performance\n const points = star.getCachedPoints();\n\n context.beginPath();\n\n // Draw the star using cached points\n if (points && points.length) {\n points.forEach((point, index) => {\n if (index === 0) {\n context.moveTo(x + point.x, y + point.y);\n } else {\n context.lineTo(x + point.x, y + point.y);\n }\n });\n }\n\n // Close the path\n context.closePath();\n\n // Shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(star, star.attribute, starAttribute);\n\n this.beforeRenderStep(\n star,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n starAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n const _runFill = () => {\n if (doFill) {\n if (fillCb) {\n fillCb(context, star.attribute, starAttribute);\n } else if (fVisible) {\n // Apply fill\n context.setCommonStyle(star, star.attribute, originX - x, originY - y, starAttribute);\n context.fill();\n }\n }\n };\n const _runStroke = () => {\n if (doStroke) {\n if (strokeCb) {\n strokeCb(context, star.attribute, starAttribute);\n } else if (sVisible) {\n // Apply stroke\n context.setStrokeStyle(star, star.attribute, originX - x, originY - y, starAttribute);\n context.stroke();\n }\n }\n };\n\n if (!fillStrokeOrder) {\n _runFill();\n _runStroke();\n } else {\n _runStroke();\n _runFill();\n }\n\n this.afterRenderStep(\n star,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n starAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(star: IStar, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const starAttribute = getTheme(star, params?.theme).star;\n this._draw(star, starAttribute, false, drawContext, params);\n }\n}\n"]}
|
|
@@ -37,4 +37,6 @@ export const ImageRender = Symbol.for("ImageRender");
|
|
|
37
37
|
export const RenderSelector = Symbol.for("RenderSelector");
|
|
38
38
|
|
|
39
39
|
export const DrawContribution = Symbol.for("DrawContribution");
|
|
40
|
+
|
|
41
|
+
export const StarRender = Symbol.for("Star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M,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;AAC7D,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC","file":"symbol.js","sourcesContent":["export const IncrementalDrawContribution = Symbol.for('IncrementalDrawContribution');\nexport const ArcRender = Symbol.for('ArcRender');\nexport const Arc3dRender = Symbol.for('Arc3dRender');\nexport const AreaRender = Symbol.for('AreaRender');\nexport const CircleRender = Symbol.for('CircleRender');\nexport const GraphicRender = Symbol.for('GraphicRender');\nexport const GroupRender = Symbol.for('GroupRender');\nexport const LineRender = Symbol.for('LineRender');\nexport const PathRender = Symbol.for('PathRender');\nexport const PolygonRender = Symbol.for('PolygonRender');\nexport const RectRender = Symbol.for('RectRender');\nexport const Rect3DRender = Symbol.for('Rect3DRender');\nexport const SymbolRender = Symbol.for('SymbolRender');\nexport const TextRender = Symbol.for('TextRender');\nexport const RichTextRender = Symbol.for('RichTextRender');\nexport const Pyramid3dRender = Symbol.for('Pyramid3dRender');\nexport const GlyphRender = Symbol.for('GlyphRender');\nexport const ImageRender = Symbol.for('ImageRender');\nexport const RenderSelector = Symbol.for('RenderSelector');\nexport const DrawContribution = Symbol.for('DrawContribution');\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/render/contributions/render/symbol.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC,GA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M,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACrD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AAC/D,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC","file":"symbol.js","sourcesContent":["export const IncrementalDrawContribution = Symbol.for('IncrementalDrawContribution');\nexport const ArcRender = Symbol.for('ArcRender');\nexport const Arc3dRender = Symbol.for('Arc3dRender');\nexport const AreaRender = Symbol.for('AreaRender');\nexport const CircleRender = Symbol.for('CircleRender');\nexport const GraphicRender = Symbol.for('GraphicRender');\nexport const GroupRender = Symbol.for('GroupRender');\nexport const LineRender = Symbol.for('LineRender');\nexport const PathRender = Symbol.for('PathRender');\nexport const PolygonRender = Symbol.for('PolygonRender');\nexport const RectRender = Symbol.for('RectRender');\nexport const Rect3DRender = Symbol.for('Rect3DRender');\nexport const SymbolRender = Symbol.for('SymbolRender');\nexport const TextRender = Symbol.for('TextRender');\nexport const RichTextRender = Symbol.for('RichTextRender');\nexport const Pyramid3dRender = Symbol.for('Pyramid3dRender');\nexport const GlyphRender = Symbol.for('GlyphRender');\nexport const ImageRender = Symbol.for('ImageRender');\nexport const RenderSelector = Symbol.for('RenderSelector');\nexport const DrawContribution = Symbol.for('DrawContribution');\nexport const StarRender = Symbol.for('StarRender');\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vrender-core",
|
|
3
|
-
"version": "0.22.7
|
|
3
|
+
"version": "0.22.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"./src/modules.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"color-convert": "2.0.1",
|
|
20
|
-
"@visactor/vutils": "~0.19.
|
|
20
|
+
"@visactor/vutils": "~0.19.5"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@rushstack/eslint-patch": "~1.1.4",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"vite": "3.2.6",
|
|
36
36
|
"typescript": "4.9.5",
|
|
37
37
|
"cross-env": "^7.0.3",
|
|
38
|
+
"@internal/bundler": "0.0.1",
|
|
38
39
|
"@internal/eslint-config": "0.0.1",
|
|
39
|
-
"@internal/ts-config": "0.0.1"
|
|
40
|
-
"@internal/bundler": "0.0.1"
|
|
40
|
+
"@internal/ts-config": "0.0.1"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
43
43
|
"VisActor",
|