@visactor/vrender-core 0.23.0-alpha.3 → 1.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/animate/config.d.ts +0 -1
- package/cjs/animate/config.js +1 -5
- package/cjs/animate/config.js.map +1 -1
- package/cjs/application.d.ts +2 -1
- package/cjs/application.js.map +1 -1
- package/cjs/color-string/interpolate.js +5 -2
- package/cjs/color-string/interpolate.js.map +1 -1
- package/cjs/common/canvas-utils.js +6 -3
- package/cjs/common/canvas-utils.js.map +1 -1
- package/cjs/common/custom-path2d.js +2 -2
- package/cjs/common/custom-path2d.js.map +1 -1
- package/cjs/common/diff.d.ts +1 -0
- package/cjs/common/diff.js +19 -0
- package/cjs/common/diff.js.map +1 -0
- package/cjs/common/enums.d.ts +0 -16
- package/cjs/common/enums.js +4 -12
- package/cjs/common/enums.js.map +1 -1
- package/cjs/common/morphing-utils.js +32 -124
- package/cjs/common/morphing-utils.js.map +1 -1
- package/cjs/common/segment/index.d.ts +1 -0
- package/cjs/common/segment/index.js +4 -1
- package/cjs/common/segment/index.js.map +1 -1
- package/cjs/common/segment/step.d.ts +6 -0
- package/cjs/common/segment/step.js +19 -2
- package/cjs/common/segment/step.js.map +1 -1
- package/cjs/common/shape/arc.d.ts +1 -1
- package/cjs/common/shape/arc.js +7 -3
- package/cjs/common/shape/arc.js.map +1 -1
- package/cjs/common/split-path.js +2 -3
- package/cjs/common/split-path.js.map +1 -1
- package/cjs/common/store.js +2 -1
- package/cjs/common/utils.d.ts +0 -2
- package/cjs/common/utils.js +4 -8
- package/cjs/common/utils.js.map +1 -1
- package/cjs/core/global-module.js +2 -0
- package/cjs/core/stage.d.ts +5 -2
- package/cjs/core/stage.js +19 -10
- package/cjs/core/stage.js.map +1 -1
- package/cjs/event/event-system.js +6 -7
- package/cjs/event/event-system.js.map +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.d.ts +1 -2
- package/cjs/graphic/arc.js +4 -3
- package/cjs/graphic/arc.js.map +1 -1
- package/cjs/graphic/area.d.ts +1 -2
- package/cjs/graphic/area.js +5 -2
- package/cjs/graphic/area.js.map +1 -1
- package/cjs/graphic/circle.d.ts +1 -2
- package/cjs/graphic/circle.js +7 -3
- package/cjs/graphic/circle.js.map +1 -1
- package/cjs/graphic/config.d.ts +2 -1
- package/cjs/graphic/config.js +10 -3
- 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-service/graphic-module.js +1 -2
- package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +10 -10
- package/cjs/graphic/graphic.js +42 -98
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.js +14 -7
- package/cjs/graphic/group.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.d.ts +1 -2
- package/cjs/graphic/line.js +7 -2
- 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 +7 -3
- package/cjs/graphic/rect.js.map +1 -1
- package/cjs/graphic/richtext/icon.d.ts +1 -1
- package/cjs/graphic/richtext/icon.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 +52 -0
- package/cjs/graphic/star.js +78 -0
- package/cjs/graphic/star.js.map +1 -0
- package/cjs/graphic/symbol.js +3 -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 +3 -0
- package/cjs/index.js +14 -12
- package/cjs/index.js.map +1 -1
- package/cjs/interface/animate.d.ts +1 -165
- package/cjs/interface/animate.js +1 -4
- package/cjs/interface/animate.js.map +1 -1
- package/cjs/interface/animation/animate.d.ts +117 -0
- package/cjs/interface/animation/animate.js +10 -0
- package/cjs/interface/animation/animate.js.map +1 -0
- package/cjs/interface/animation/easing.d.ts +3 -0
- package/cjs/interface/animation/easing.js +6 -0
- package/cjs/interface/animation/easing.js.map +1 -0
- package/cjs/interface/animation/index.d.ts +5 -0
- package/cjs/interface/animation/index.js +23 -0
- package/cjs/interface/animation/index.js.map +1 -0
- package/cjs/interface/animation/ticker.d.ts +39 -0
- package/cjs/interface/animation/ticker.js +11 -0
- package/cjs/interface/animation/ticker.js.map +1 -0
- package/cjs/interface/animation/timeline.d.ts +17 -0
- package/cjs/interface/animation/timeline.js +6 -0
- package/cjs/interface/animation/timeline.js.map +1 -0
- package/cjs/interface/animation/type.d.ts +13 -0
- package/cjs/interface/animation/type.js +15 -0
- package/cjs/interface/animation/type.js.map +1 -0
- package/cjs/interface/common.d.ts +1 -1
- package/cjs/interface/common.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 +12 -1
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/interface/index.d.ts +1 -1
- package/cjs/interface/index.js +1 -1
- package/cjs/interface/index.js.map +1 -1
- package/cjs/interface/render.d.ts +1 -0
- package/cjs/interface/render.js.map +1 -1
- package/cjs/interface/stage.d.ts +3 -1
- package/cjs/interface/stage.js.map +1 -1
- package/cjs/modules.d.ts +2 -1
- package/cjs/modules.js +4 -3
- package/cjs/modules.js.map +1 -1
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js +9 -8
- package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +14 -11
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.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/flex-layout-plugin.js +13 -10
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
- package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
- package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.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/area-render.js +2 -2
- package/cjs/render/contributions/render/area-render.js.map +1 -1
- 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/draw-contribution.js +1 -1
- package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
- package/cjs/render/contributions/render/line-render.js +1 -1
- package/cjs/render/contributions/render/line-render.js.map +1 -1
- 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/cjs/render/render-service.d.ts +1 -1
- package/cjs/render/render-service.js.map +1 -1
- package/dist/index.es.js +12578 -12435
- package/es/animate/config.d.ts +0 -1
- package/es/animate/config.js +0 -5
- package/es/animate/config.js.map +1 -1
- package/es/application.d.ts +2 -1
- package/es/application.js.map +1 -1
- package/es/color-string/interpolate.js +4 -1
- package/es/color-string/interpolate.js.map +1 -1
- package/es/common/canvas-utils.js +6 -3
- package/es/common/canvas-utils.js.map +1 -1
- package/es/common/custom-path2d.js +2 -2
- package/es/common/custom-path2d.js.map +1 -1
- package/es/common/diff.d.ts +1 -0
- package/es/common/diff.js +11 -0
- package/es/common/diff.js.map +1 -0
- package/es/common/enums.d.ts +0 -16
- package/es/common/enums.js +2 -21
- package/es/common/enums.js.map +1 -1
- package/es/common/morphing-utils.js +29 -124
- package/es/common/morphing-utils.js.map +1 -1
- package/es/common/segment/index.d.ts +1 -0
- package/es/common/segment/index.js +6 -1
- package/es/common/segment/index.js.map +1 -1
- package/es/common/segment/step.d.ts +6 -0
- package/es/common/segment/step.js +13 -0
- package/es/common/segment/step.js.map +1 -1
- package/es/common/shape/arc.d.ts +1 -1
- package/es/common/shape/arc.js +7 -3
- package/es/common/shape/arc.js.map +1 -1
- package/es/common/split-path.js +2 -3
- package/es/common/split-path.js.map +1 -1
- package/es/common/store.js +2 -1
- package/es/common/utils.d.ts +0 -2
- package/es/common/utils.js +0 -4
- package/es/common/utils.js.map +1 -1
- package/es/core/global-module.js +2 -0
- package/es/core/stage.d.ts +5 -2
- package/es/core/stage.js +20 -9
- package/es/core/stage.js.map +1 -1
- package/es/event/event-system.js +6 -7
- package/es/event/event-system.js.map +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.d.ts +1 -2
- package/es/graphic/arc.js +4 -3
- package/es/graphic/arc.js.map +1 -1
- package/es/graphic/area.d.ts +1 -2
- package/es/graphic/area.js +5 -2
- package/es/graphic/area.js.map +1 -1
- package/es/graphic/circle.d.ts +1 -2
- package/es/graphic/circle.js +6 -3
- package/es/graphic/circle.js.map +1 -1
- package/es/graphic/config.d.ts +2 -1
- package/es/graphic/config.js +11 -2
- 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-service/graphic-module.js +1 -1
- package/es/graphic/graphic-service/graphic-module.js.map +1 -1
- package/es/graphic/graphic.d.ts +10 -10
- package/es/graphic/graphic.js +44 -100
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.js +15 -8
- package/es/graphic/group.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.d.ts +1 -2
- package/es/graphic/line.js +7 -2
- 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 +7 -3
- package/es/graphic/rect.js.map +1 -1
- package/es/graphic/richtext/icon.d.ts +1 -1
- package/es/graphic/richtext/icon.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 +52 -0
- package/es/graphic/star.js +82 -0
- package/es/graphic/star.js.map +1 -0
- package/es/graphic/symbol.js +3 -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 +3 -0
- package/es/index.js +6 -0
- package/es/index.js.map +1 -1
- package/es/interface/animate.d.ts +1 -165
- package/es/interface/animate.js +2 -1
- package/es/interface/animate.js.map +1 -1
- package/es/interface/animation/animate.d.ts +117 -0
- package/es/interface/animation/animate.js +6 -0
- package/es/interface/animation/animate.js.map +1 -0
- package/es/interface/animation/easing.d.ts +3 -0
- package/es/interface/animation/easing.js +2 -0
- package/es/interface/animation/easing.js.map +1 -0
- package/es/interface/animation/index.d.ts +5 -0
- package/es/interface/animation/index.js +10 -0
- package/es/interface/animation/index.js.map +1 -0
- package/es/interface/animation/ticker.d.ts +39 -0
- package/es/interface/animation/ticker.js +7 -0
- package/es/interface/animation/ticker.js.map +1 -0
- package/es/interface/animation/timeline.d.ts +17 -0
- package/es/interface/animation/timeline.js +2 -0
- package/es/interface/animation/timeline.js.map +1 -0
- package/es/interface/animation/type.d.ts +13 -0
- package/es/interface/animation/type.js +14 -0
- package/es/interface/animation/type.js.map +1 -0
- package/es/interface/common.d.ts +1 -1
- package/es/interface/common.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 +12 -1
- package/es/interface/graphic.js.map +1 -1
- package/es/interface/index.d.ts +1 -1
- package/es/interface/index.js +1 -1
- package/es/interface/index.js.map +1 -1
- package/es/interface/render.d.ts +1 -0
- package/es/interface/render.js.map +1 -1
- package/es/interface/stage.d.ts +3 -1
- package/es/interface/stage.js.map +1 -1
- package/es/modules.d.ts +2 -1
- package/es/modules.js +6 -0
- package/es/modules.js.map +1 -1
- package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
- package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +13 -12
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.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/flex-layout-plugin.js +12 -11
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
- package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
- package/es/plugins/builtin-plugin/incremental-auto-render-plugin.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/area-render.js +2 -2
- package/es/render/contributions/render/area-render.js.map +1 -1
- 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/draw-contribution.js +1 -1
- package/es/render/contributions/render/draw-contribution.js.map +1 -1
- package/es/render/contributions/render/line-render.js +1 -1
- package/es/render/contributions/render/line-render.js.map +1 -1
- 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/es/render/render-service.d.ts +1 -1
- package/es/render/render-service.js.map +1 -1
- package/package.json +2 -2
package/cjs/graphic/graphic.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Dict, IPointLike, IAABBBounds, IOBBBounds } from '@visactor/vutils
|
|
|
3
3
|
import { Matrix, Point } from '@visactor/vutils';
|
|
4
4
|
import type { GraphicType, IAnimateConfig, IGraphicAttribute, IGraphic, IGraphicJson, ISetAttributeContext, ITransform, GraphicReleaseStatus } from '../interface/graphic';
|
|
5
5
|
import { Node } from './node-tree';
|
|
6
|
-
import type { IAnimate, IAnimateTarget, IGlyphGraphicAttribute, ILayer, IPickerService, IShadowRoot, IStage, IStep,
|
|
6
|
+
import type { IAnimate, IAnimateTarget, IGlyphGraphicAttribute, ILayer, IPickerService, IShadowRoot, IStage, IStep, ISymbolClass } from '../interface';
|
|
7
7
|
import { IContainPointMode } from '../common/enums';
|
|
8
8
|
import { CustomSymbolClass } from './builtin-symbol';
|
|
9
9
|
export declare const PURE_STYLE_KEY: string[];
|
|
@@ -61,6 +61,10 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
61
61
|
glyphHost?: IGraphic<IGlyphGraphicAttribute>;
|
|
62
62
|
_onSetStage?: (g: IGraphic, stage: IStage, layer: ILayer) => void;
|
|
63
63
|
in3dMode?: boolean;
|
|
64
|
+
widthWithoutTransform?: number;
|
|
65
|
+
heightWithoutTransform?: number;
|
|
66
|
+
x1WithoutTransform?: number;
|
|
67
|
+
y1WithoutTransform?: number;
|
|
64
68
|
protected _AABBBounds: IAABBBounds;
|
|
65
69
|
get AABBBounds(): IAABBBounds;
|
|
66
70
|
protected _OBBBounds?: IOBBBounds;
|
|
@@ -83,9 +87,6 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
83
87
|
stateProxy?: (stateName: string, targetStates?: string[]) => T;
|
|
84
88
|
animates: Map<string | number, IAnimate>;
|
|
85
89
|
animate?: () => IAnimate;
|
|
86
|
-
nextAttrs?: T;
|
|
87
|
-
prevAttrs?: T;
|
|
88
|
-
finalAttrs?: T;
|
|
89
90
|
pathProxy?: ICustomPath2D;
|
|
90
91
|
attachedThemeGraphic?: IGraphic;
|
|
91
92
|
protected updateAABBBoundsStamp: number;
|
|
@@ -97,7 +98,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
97
98
|
set3dMode(): void;
|
|
98
99
|
set2dMode(): void;
|
|
99
100
|
getOffsetXY(attr?: ITransform, includeScroll?: boolean): Point;
|
|
100
|
-
onAnimateBind(animate: IAnimate
|
|
101
|
+
onAnimateBind(animate: IAnimate): void;
|
|
101
102
|
protected tryUpdateAABBBounds(): IAABBBounds;
|
|
102
103
|
protected tryUpdateOBBBounds(): IOBBBounds;
|
|
103
104
|
protected combindShadowAABBBounds(bounds: IAABBBounds): void;
|
|
@@ -120,6 +121,8 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
120
121
|
shouldUpdateShape(): boolean;
|
|
121
122
|
clearUpdateShapeTag(): void;
|
|
122
123
|
containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean;
|
|
124
|
+
protected setWidthHeightWithoutTransform(aabbBounds: IAABBBounds): void;
|
|
125
|
+
setAttributesAndPreventAnimate(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
123
126
|
setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
124
127
|
_setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
125
128
|
setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
@@ -163,17 +166,13 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
163
166
|
protected needUpdateLayout(): boolean;
|
|
164
167
|
protected getAnchor(anchor: [string | number, string | number], params: {
|
|
165
168
|
b?: IAABBBounds;
|
|
166
|
-
}): [number, number];
|
|
169
|
+
}, resetScale?: boolean): [number, number];
|
|
167
170
|
protected doUpdateLocalMatrix(): void;
|
|
168
171
|
protected doUpdateGlobalMatrix(): void;
|
|
169
172
|
setStage(stage?: IStage, layer?: ILayer): void;
|
|
170
173
|
setStageToShadowRoot(stage?: IStage, layer?: ILayer): void;
|
|
171
174
|
onAddStep(step: IStep): void;
|
|
172
175
|
onStop(props?: Partial<T>): void;
|
|
173
|
-
onStep(subAnimate: ISubAnimate, animate: IAnimate, step: IStep, ratio: number, end: boolean): void;
|
|
174
|
-
stepInterpolate(subAnimate: ISubAnimate, animate: IAnimate, nextAttributes: Record<string, any>, step: IStep, ratio: number, end: boolean, nextProps: Record<string, any>, lastProps?: Record<string, any>, nextParsedProps?: any, propKeys?: string[]): void;
|
|
175
|
-
defaultInterpolate(nextStepVal: any, lastStepVal: any, key: string, nextAttributes: Record<string, any>, nextParsedProps: any, ratio: number): boolean;
|
|
176
|
-
protected _interpolate(key: string, ratio: number, lastStepVal: any, nextStepVal: any, nextAttributes: any): void;
|
|
177
176
|
getDefaultAttribute(name: string): any;
|
|
178
177
|
getComputedAttribute(name: string): any;
|
|
179
178
|
onSetStage(cb: (g: IGraphic, stage: IStage) => void, immediate?: boolean): void;
|
|
@@ -191,4 +190,5 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
191
190
|
protected _emitCustomEvent(type: string, context?: any): void;
|
|
192
191
|
abstract getNoWorkAnimateAttr(): Record<string, number>;
|
|
193
192
|
abstract clone(): IGraphic<any>;
|
|
193
|
+
toCustomPath(): ICustomPath2D;
|
|
194
194
|
}
|
package/cjs/graphic/graphic.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: !0
|
|
5
5
|
}), exports.Graphic = exports.NOWORK_ANIMATE_ATTR = exports.GRAPHIC_UPDATE_TAG_KEY = exports.PURE_STYLE_KEY = void 0;
|
|
6
6
|
|
|
7
|
-
const vutils_1 = require("@visactor/vutils"), vutils_2 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"),
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), vutils_2 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"), custom_path2d_1 = require("../common/custom-path2d"), loader_1 = require("../resource-loader/loader"), enums_1 = require("../common/enums"), bounds_context_1 = require("../common/bounds-context"), render_command_list_1 = require("../common/render-command-list"), utils_1 = require("../common/utils"), builtin_symbol_1 = require("./builtin-symbol"), xml_1 = require("../common/xml"), constants_1 = require("./constants"), config_2 = require("../animate/config"), canvas_1 = require("../canvas"), _tempBounds = new vutils_2.AABBBounds, tempMatrix = new vutils_2.Matrix, tempBounds = new vutils_2.AABBBounds;
|
|
8
8
|
|
|
9
9
|
exports.PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ],
|
|
10
10
|
exports.GRAPHIC_UPDATE_TAG_KEY = [ "lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible" ];
|
|
@@ -96,12 +96,13 @@ class Graphic extends node_tree_1.Node {
|
|
|
96
96
|
this._emitCustomEvent("animate-bind", animate);
|
|
97
97
|
}
|
|
98
98
|
tryUpdateAABBBounds() {
|
|
99
|
+
var _a, _b;
|
|
99
100
|
const full = "imprecise" === this.attribute.boundsMode;
|
|
100
101
|
if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
|
|
101
102
|
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
102
|
-
|
|
103
|
+
null === (_a = this.stage) || void 0 === _a || _a.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
103
104
|
const bounds = this.doUpdateAABBBounds(full);
|
|
104
|
-
return
|
|
105
|
+
return null === (_b = this.stage) || void 0 === _b || _b.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
|
|
105
106
|
"empty" === this.attribute.boundsMode && bounds.clear(), bounds;
|
|
106
107
|
}
|
|
107
108
|
tryUpdateOBBBounds() {
|
|
@@ -235,6 +236,16 @@ class Graphic extends node_tree_1.Node {
|
|
|
235
236
|
y: y
|
|
236
237
|
});
|
|
237
238
|
}
|
|
239
|
+
setWidthHeightWithoutTransform(aabbBounds) {
|
|
240
|
+
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
241
|
+
}
|
|
242
|
+
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
|
|
243
|
+
this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach((animate => {
|
|
244
|
+
Object.keys(params).forEach((key => {
|
|
245
|
+
animate.preventAttr(key);
|
|
246
|
+
}));
|
|
247
|
+
}));
|
|
248
|
+
}
|
|
238
249
|
setAttributes(params, forceUpdateTag = !1, context) {
|
|
239
250
|
(params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic),
|
|
240
251
|
this._setAttributes(params, forceUpdateTag, context);
|
|
@@ -376,7 +387,8 @@ class Graphic extends node_tree_1.Node {
|
|
|
376
387
|
return this;
|
|
377
388
|
}
|
|
378
389
|
onAttributeUpdate(context) {
|
|
379
|
-
|
|
390
|
+
var _a;
|
|
391
|
+
context && context.skipUpdateCallback || (null === (_a = this.stage) || void 0 === _a || _a.graphicService.onAttributeUpdate(this),
|
|
380
392
|
this._emitCustomEvent("afterAttributeUpdate", context));
|
|
381
393
|
}
|
|
382
394
|
update(d) {
|
|
@@ -398,7 +410,7 @@ class Graphic extends node_tree_1.Node {
|
|
|
398
410
|
keys.forEach((key => {
|
|
399
411
|
noWorkAttrs[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = isClear && void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key];
|
|
400
412
|
}));
|
|
401
|
-
const stateAnimateConfig = null !== (_b = null !== (_a = this.context.stateAnimateConfig) && void 0 !== _a ? _a : this.stateAnimateConfig) && void 0 !== _b ? _b : config_2.DefaultStateAnimateConfig;
|
|
413
|
+
const stateAnimateConfig = null !== (_b = null !== (_a = this.context && this.context.stateAnimateConfig) && void 0 !== _a ? _a : this.stateAnimateConfig) && void 0 !== _b ? _b : config_2.DefaultStateAnimateConfig;
|
|
402
414
|
this.applyAnimationState([ "state" ], [ {
|
|
403
415
|
name: "state",
|
|
404
416
|
animation: {
|
|
@@ -407,10 +419,13 @@ class Graphic extends node_tree_1.Node {
|
|
|
407
419
|
duration: stateAnimateConfig.duration,
|
|
408
420
|
easing: stateAnimateConfig.easing
|
|
409
421
|
}
|
|
410
|
-
} ]), noAnimateAttrs && this.
|
|
422
|
+
} ]), noAnimateAttrs && this.setAttributesAndPreventAnimate(noAnimateAttrs, !1, {
|
|
411
423
|
type: enums_1.AttributeUpdateType.STATE
|
|
412
424
|
});
|
|
413
|
-
} else this.stopStateAnimates(), this.
|
|
425
|
+
} else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
|
|
426
|
+
type: enums_1.AttributeUpdateType.STATE
|
|
427
|
+
});
|
|
428
|
+
this._emitCustomEvent("afterStateUpdate", {
|
|
414
429
|
type: enums_1.AttributeUpdateType.STATE
|
|
415
430
|
});
|
|
416
431
|
}
|
|
@@ -430,13 +445,9 @@ class Graphic extends node_tree_1.Node {
|
|
|
430
445
|
}));
|
|
431
446
|
}
|
|
432
447
|
getNormalAttribute(key) {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
const endProps = animate.getEndProps();
|
|
437
|
-
(0, vutils_2.has)(endProps, key) && (value = endProps[key]);
|
|
438
|
-
}
|
|
439
|
-
})), value;
|
|
448
|
+
var _a, _b;
|
|
449
|
+
const value = this.attribute[key];
|
|
450
|
+
return this.animates ? null === (_a = this.finalAttribute) || void 0 === _a ? void 0 : _a[key] : null != value ? value : null === (_b = this.finalAttribute) || void 0 === _b ? void 0 : _b[key];
|
|
440
451
|
}
|
|
441
452
|
clearStates(hasAnimation) {
|
|
442
453
|
this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [],
|
|
@@ -511,19 +522,12 @@ class Graphic extends node_tree_1.Node {
|
|
|
511
522
|
needUpdateLayout() {
|
|
512
523
|
return !!(this._updateTag & enums_1.UpdateTag.UPDATE_LAYOUT);
|
|
513
524
|
}
|
|
514
|
-
getAnchor(anchor, params) {
|
|
525
|
+
getAnchor(anchor, params, resetScale) {
|
|
515
526
|
const _anchor = [ 0, 0 ], getBounds = () => {
|
|
516
527
|
if (params.b) return params.b;
|
|
517
|
-
const
|
|
518
|
-
return
|
|
519
|
-
|
|
520
|
-
scaleY: 1,
|
|
521
|
-
angle: 0
|
|
522
|
-
}), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
|
|
523
|
-
scaleX: scaleX,
|
|
524
|
-
scaleY: scaleY,
|
|
525
|
-
angle: angle
|
|
526
|
-
}), params.b;
|
|
528
|
+
const graphic = this.clone();
|
|
529
|
+
return graphic.attribute.angle = 0, graphic.attribute.scaleCenter = null, resetScale && (graphic.attribute.scaleX = 1,
|
|
530
|
+
graphic.attribute.scaleY = 1), params.b = graphic.AABBBounds, params.b;
|
|
527
531
|
};
|
|
528
532
|
if ("string" == typeof anchor[0]) {
|
|
529
533
|
const ratio = parseFloat(anchor[0]) / 100, bounds = getBounds();
|
|
@@ -539,11 +543,11 @@ class Graphic extends node_tree_1.Node {
|
|
|
539
543
|
const {x: x = config_1.DefaultTransform.x, y: y = config_1.DefaultTransform.y, scaleX: scaleX = config_1.DefaultTransform.scaleX, scaleY: scaleY = config_1.DefaultTransform.scaleY, angle: angle = config_1.DefaultTransform.angle, scaleCenter: scaleCenter, anchor: anchor, postMatrix: postMatrix} = this.attribute;
|
|
540
544
|
let _anchor = [ 0, 0 ];
|
|
541
545
|
const params = {};
|
|
542
|
-
if (anchor && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) (0,
|
|
546
|
+
if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) (0,
|
|
543
547
|
vutils_2.normalTransform)(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
|
|
544
548
|
const m = this._transMatrix;
|
|
545
549
|
m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]),
|
|
546
|
-
m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application_1.application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
550
|
+
m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application_1.application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
|
|
547
551
|
x: _anchor[0],
|
|
548
552
|
y: _anchor[1]
|
|
549
553
|
});
|
|
@@ -562,6 +566,7 @@ class Graphic extends node_tree_1.Node {
|
|
|
562
566
|
}
|
|
563
567
|
}
|
|
564
568
|
setStage(stage, layer) {
|
|
569
|
+
var _a;
|
|
565
570
|
if (this.stage !== stage) {
|
|
566
571
|
if (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer),
|
|
567
572
|
this.animates && this.animates.size) {
|
|
@@ -570,7 +575,7 @@ class Graphic extends node_tree_1.Node {
|
|
|
570
575
|
a.timeline.isGlobal && (a.setTimeline(timeline), timeline.addAnimate(a));
|
|
571
576
|
}));
|
|
572
577
|
}
|
|
573
|
-
this._onSetStage && this._onSetStage(this, stage, layer),
|
|
578
|
+
this._onSetStage && this._onSetStage(this, stage, layer), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onSetStage(this, stage);
|
|
574
579
|
}
|
|
575
580
|
}
|
|
576
581
|
setStageToShadowRoot(stage, layer) {
|
|
@@ -582,76 +587,6 @@ class Graphic extends node_tree_1.Node {
|
|
|
582
587
|
type: enums_1.AttributeUpdateType.ANIMATE_END
|
|
583
588
|
});
|
|
584
589
|
}
|
|
585
|
-
onStep(subAnimate, animate, step, ratio, end) {
|
|
586
|
-
const nextAttributes = {};
|
|
587
|
-
if (step.customAnimate) step.customAnimate.update(end, ratio, nextAttributes); else {
|
|
588
|
-
const nextProps = step.props, nextParsedProps = step.parsedProps, propKeys = step.propKeys;
|
|
589
|
-
this.stepInterpolate(subAnimate, animate, nextAttributes, step, ratio, end, nextProps, void 0, nextParsedProps, propKeys);
|
|
590
|
-
}
|
|
591
|
-
this.setAttributes(nextAttributes, !1, {
|
|
592
|
-
type: enums_1.AttributeUpdateType.ANIMATE_UPDATE,
|
|
593
|
-
animationState: {
|
|
594
|
-
ratio: ratio,
|
|
595
|
-
end: end,
|
|
596
|
-
step: step,
|
|
597
|
-
isFirstFrameOfStep: subAnimate.getLastStep() !== step
|
|
598
|
-
}
|
|
599
|
-
}), this.stage && this.stage.renderNextFrame();
|
|
600
|
-
}
|
|
601
|
-
stepInterpolate(subAnimate, animate, nextAttributes, step, ratio, end, nextProps, lastProps, nextParsedProps, propKeys) {
|
|
602
|
-
propKeys || (propKeys = Object.keys(nextProps), step.propKeys = propKeys), end ? step.propKeys.forEach((key => {
|
|
603
|
-
animate.validAttr(key) && (nextAttributes[key] = nextProps[key]);
|
|
604
|
-
})) : propKeys.forEach((key => {
|
|
605
|
-
var _a;
|
|
606
|
-
if (!animate.validAttr(key)) return;
|
|
607
|
-
const nextStepVal = nextProps[key], lastStepVal = null !== (_a = lastProps && lastProps[key]) && void 0 !== _a ? _a : subAnimate.getLastPropByName(key, step);
|
|
608
|
-
if (null == nextStepVal || null == lastStepVal || nextStepVal === lastStepVal) return void (nextAttributes[key] = nextStepVal);
|
|
609
|
-
let match;
|
|
610
|
-
match = animate.interpolateFunc && animate.interpolateFunc(key, ratio, lastStepVal, nextStepVal, nextAttributes),
|
|
611
|
-
match || (match = animate.customInterpolate(key, ratio, lastStepVal, nextStepVal, this, nextAttributes),
|
|
612
|
-
match || this.defaultInterpolate(nextStepVal, lastStepVal, key, nextAttributes, nextParsedProps, ratio) || this._interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes));
|
|
613
|
-
})), step.parsedProps = nextParsedProps;
|
|
614
|
-
}
|
|
615
|
-
defaultInterpolate(nextStepVal, lastStepVal, key, nextAttributes, nextParsedProps, ratio) {
|
|
616
|
-
if (Number.isFinite(nextStepVal) && Number.isFinite(lastStepVal)) return nextAttributes[key] = lastStepVal + (nextStepVal - lastStepVal) * ratio,
|
|
617
|
-
!0;
|
|
618
|
-
if ("fill" === key) {
|
|
619
|
-
nextParsedProps || (nextParsedProps = {});
|
|
620
|
-
const fillColorArray = nextParsedProps.fillColorArray, color = (0, interpolate_1.interpolateColor)(lastStepVal, null != fillColorArray ? fillColorArray : nextStepVal, ratio, !1, ((fArray, tArray) => {
|
|
621
|
-
nextParsedProps.fillColorArray = tArray;
|
|
622
|
-
}));
|
|
623
|
-
return color && (nextAttributes[key] = color), !0;
|
|
624
|
-
}
|
|
625
|
-
if ("stroke" === key) {
|
|
626
|
-
nextParsedProps || (nextParsedProps = {});
|
|
627
|
-
const strokeColorArray = nextParsedProps.strokeColorArray, color = (0, interpolate_1.interpolateColor)(lastStepVal, null != strokeColorArray ? strokeColorArray : nextStepVal, ratio, !1, ((fArray, tArray) => {
|
|
628
|
-
nextParsedProps.strokeColorArray = tArray;
|
|
629
|
-
}));
|
|
630
|
-
return color && (nextAttributes[key] = color), !0;
|
|
631
|
-
}
|
|
632
|
-
if ("shadowColor" === key) {
|
|
633
|
-
nextParsedProps || (nextParsedProps = {});
|
|
634
|
-
const shadowColorArray = nextParsedProps.shadowColorArray, color = (0, interpolate_1.interpolateColor)(lastStepVal, null != shadowColorArray ? shadowColorArray : nextStepVal, ratio, !0, ((fArray, tArray) => {
|
|
635
|
-
nextParsedProps.shadowColorArray = tArray;
|
|
636
|
-
}));
|
|
637
|
-
return color && (nextAttributes[key] = color), !0;
|
|
638
|
-
}
|
|
639
|
-
if (Array.isArray(nextStepVal) && nextStepVal.length === lastStepVal.length) {
|
|
640
|
-
const nextList = [];
|
|
641
|
-
let valid = !0;
|
|
642
|
-
for (let i = 0; i < nextStepVal.length; i++) {
|
|
643
|
-
const v = lastStepVal[i], val = v + (nextStepVal[i] - v) * ratio;
|
|
644
|
-
if (!Number.isFinite(val)) {
|
|
645
|
-
valid = !1;
|
|
646
|
-
break;
|
|
647
|
-
}
|
|
648
|
-
nextList.push(val);
|
|
649
|
-
}
|
|
650
|
-
valid && (nextAttributes[key] = nextList);
|
|
651
|
-
}
|
|
652
|
-
return !1;
|
|
653
|
-
}
|
|
654
|
-
_interpolate(key, ratio, lastStepVal, nextStepVal, nextAttributes) {}
|
|
655
590
|
getDefaultAttribute(name) {
|
|
656
591
|
return this.getGraphicTheme()[name];
|
|
657
592
|
}
|
|
@@ -734,6 +669,15 @@ class Graphic extends node_tree_1.Node {
|
|
|
734
669
|
this.dispatchEvent(changeEvent);
|
|
735
670
|
}
|
|
736
671
|
}
|
|
672
|
+
toCustomPath() {
|
|
673
|
+
var _a, _b, _c;
|
|
674
|
+
const renderer = null === (_c = null === (_b = (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.renderService) || application_1.application.renderService) || void 0 === _b ? void 0 : _b.drawContribution) || void 0 === _c ? void 0 : _c.getRenderContribution(this);
|
|
675
|
+
if (renderer) {
|
|
676
|
+
const context = new canvas_1.EmptyContext2d(null, 1);
|
|
677
|
+
return renderer.drawShape(this, context, 0, 0, {}, {}), context.path;
|
|
678
|
+
}
|
|
679
|
+
return null;
|
|
680
|
+
}
|
|
737
681
|
}
|
|
738
682
|
|
|
739
683
|
function backgroundNotImage(image) {
|