@visactor/vrender-core 0.19.10-beta.1 → 0.19.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/custom-animate.d.ts +1 -0
- package/cjs/animate/custom-animate.js +38 -18
- package/cjs/animate/custom-animate.js.map +1 -1
- package/cjs/color-string/interpolate.d.ts +2 -1
- package/cjs/color-string/interpolate.js +13 -4
- package/cjs/color-string/interpolate.js.map +1 -1
- package/cjs/graphic/graphic.js +2 -4
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/render/contributions/render/draw-interceptor.js +6 -5
- package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
- package/dist/index.es.js +73 -24
- package/es/animate/custom-animate.d.ts +1 -0
- package/es/animate/custom-animate.js +38 -18
- package/es/animate/custom-animate.js.map +1 -1
- package/es/color-string/interpolate.d.ts +2 -1
- package/es/color-string/interpolate.js +8 -1
- package/es/color-string/interpolate.js.map +1 -1
- package/es/graphic/graphic.js +2 -4
- package/es/graphic/graphic.js.map +1 -1
- package/es/render/contributions/render/draw-interceptor.js +6 -5
- package/es/render/contributions/render/draw-interceptor.js.map +1 -1
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -8575,10 +8575,14 @@ class StreamLight extends ACustomAnimate {
|
|
|
8575
8575
|
root.add(line);
|
|
8576
8576
|
}
|
|
8577
8577
|
onStartRect() {
|
|
8578
|
-
var _a;
|
|
8578
|
+
var _a, _b, _c;
|
|
8579
8579
|
const root = this.target.attachShadow();
|
|
8580
|
-
const
|
|
8581
|
-
const
|
|
8580
|
+
const isHorizontal = (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.isHorizontal) !== null && _b !== void 0 ? _b : true;
|
|
8581
|
+
const sizeAttr = isHorizontal ? 'height' : 'width';
|
|
8582
|
+
const otherSizeAttr = isHorizontal ? 'width' : 'height';
|
|
8583
|
+
const size = this.target.AABBBounds[sizeAttr]();
|
|
8584
|
+
const y = isHorizontal ? 0 : this.target.AABBBounds.y1;
|
|
8585
|
+
const rect = application.graphicService.creator.rect(Object.assign(Object.assign({ [sizeAttr]: size, fill: '#bcdeff', shadowBlur: 30, shadowColor: '#bcdeff' }, (_c = this.params) === null || _c === void 0 ? void 0 : _c.attribute), { x: 0, y, [otherSizeAttr]: 0 }));
|
|
8582
8586
|
this.rect = rect;
|
|
8583
8587
|
root.add(rect);
|
|
8584
8588
|
}
|
|
@@ -8597,25 +8601,58 @@ class StreamLight extends ACustomAnimate {
|
|
|
8597
8601
|
}
|
|
8598
8602
|
}
|
|
8599
8603
|
onUpdateRect(end, ratio, out) {
|
|
8600
|
-
var _a, _b, _c, _d, _e, _f;
|
|
8601
|
-
const
|
|
8602
|
-
const
|
|
8603
|
-
|
|
8604
|
-
|
|
8605
|
-
|
|
8606
|
-
|
|
8607
|
-
|
|
8608
|
-
|
|
8609
|
-
|
|
8610
|
-
|
|
8611
|
-
width
|
|
8612
|
-
|
|
8613
|
-
|
|
8614
|
-
|
|
8615
|
-
|
|
8616
|
-
|
|
8604
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
8605
|
+
const isHorizontal = (_b = (_a = this.params) === null || _a === void 0 ? void 0 : _a.isHorizontal) !== null && _b !== void 0 ? _b : true;
|
|
8606
|
+
const parentAttr = this.target.attribute;
|
|
8607
|
+
if (isHorizontal) {
|
|
8608
|
+
const parentWidth = (_d = (_c = parentAttr.width) !== null && _c !== void 0 ? _c : Math.abs(parentAttr.x1 - parentAttr.x)) !== null && _d !== void 0 ? _d : 250;
|
|
8609
|
+
const streamLength = (_f = (_e = this.params) === null || _e === void 0 ? void 0 : _e.streamLength) !== null && _f !== void 0 ? _f : parentWidth;
|
|
8610
|
+
const maxLength = (_j = (_h = (_g = this.params) === null || _g === void 0 ? void 0 : _g.attribute) === null || _h === void 0 ? void 0 : _h.width) !== null && _j !== void 0 ? _j : 60;
|
|
8611
|
+
const startX = -maxLength;
|
|
8612
|
+
const currentX = startX + (streamLength - startX) * ratio;
|
|
8613
|
+
const x = Math.max(currentX, 0);
|
|
8614
|
+
const w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX);
|
|
8615
|
+
const width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
|
|
8616
|
+
this.rect.setAttributes({
|
|
8617
|
+
x,
|
|
8618
|
+
width,
|
|
8619
|
+
dx: Math.min(parentAttr.x1 - parentAttr.x, 0)
|
|
8620
|
+
}, false, {
|
|
8621
|
+
type: AttributeUpdateType.ANIMATE_PLAY,
|
|
8622
|
+
animationState: {
|
|
8623
|
+
ratio,
|
|
8624
|
+
end
|
|
8625
|
+
}
|
|
8626
|
+
});
|
|
8627
|
+
}
|
|
8628
|
+
else {
|
|
8629
|
+
const parentHeight = (_l = (_k = parentAttr.height) !== null && _k !== void 0 ? _k : Math.abs(parentAttr.y1 - parentAttr.y)) !== null && _l !== void 0 ? _l : 250;
|
|
8630
|
+
const streamLength = (_o = (_m = this.params) === null || _m === void 0 ? void 0 : _m.streamLength) !== null && _o !== void 0 ? _o : parentHeight;
|
|
8631
|
+
const maxLength = (_r = (_q = (_p = this.params) === null || _p === void 0 ? void 0 : _p.attribute) === null || _q === void 0 ? void 0 : _q.height) !== null && _r !== void 0 ? _r : 60;
|
|
8632
|
+
const startY = parentHeight;
|
|
8633
|
+
const currentY = startY - (streamLength + maxLength) * ratio;
|
|
8634
|
+
let y = Math.min(currentY, parentHeight);
|
|
8635
|
+
const h = Math.min(parentHeight - currentY, maxLength);
|
|
8636
|
+
let height;
|
|
8637
|
+
if (y <= 0) {
|
|
8638
|
+
height = Math.max(y + h, 0);
|
|
8639
|
+
y = 0;
|
|
8617
8640
|
}
|
|
8618
|
-
|
|
8641
|
+
else {
|
|
8642
|
+
height = h;
|
|
8643
|
+
}
|
|
8644
|
+
this.rect.setAttributes({
|
|
8645
|
+
y,
|
|
8646
|
+
height,
|
|
8647
|
+
dy: Math.min(parentAttr.y1 - parentAttr.y, 0)
|
|
8648
|
+
}, false, {
|
|
8649
|
+
type: AttributeUpdateType.ANIMATE_PLAY,
|
|
8650
|
+
animationState: {
|
|
8651
|
+
ratio,
|
|
8652
|
+
end
|
|
8653
|
+
}
|
|
8654
|
+
});
|
|
8655
|
+
}
|
|
8619
8656
|
}
|
|
8620
8657
|
onUpdateLineOrArea(end, ratio, out) {
|
|
8621
8658
|
const target = this.line || this.area;
|
|
@@ -10140,6 +10177,15 @@ function colorArrayToString(color, alphaChannel = false) {
|
|
|
10140
10177
|
return color;
|
|
10141
10178
|
}
|
|
10142
10179
|
function interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
10180
|
+
if ((Array.isArray(from) && !isNumber(from[0])) || (Array.isArray(to) && !isNumber(to[0]))) {
|
|
10181
|
+
const out = new Array(4).fill(0).map((_, index) => {
|
|
10182
|
+
return _interpolateColor(isArray(from) ? from[index] : from, isArray(to) ? to[index] : to, ratio, alphaChannel);
|
|
10183
|
+
});
|
|
10184
|
+
return out;
|
|
10185
|
+
}
|
|
10186
|
+
return _interpolateColor(from, to, ratio, alphaChannel, cb);
|
|
10187
|
+
}
|
|
10188
|
+
function _interpolateColor(from, to, ratio, alphaChannel, cb) {
|
|
10143
10189
|
if (!(from && to)) {
|
|
10144
10190
|
return (from && colorArrayToString(from)) || (to && colorArrayToString(to)) || false;
|
|
10145
10191
|
}
|
|
@@ -11442,6 +11488,7 @@ class Graphic extends Node {
|
|
|
11442
11488
|
noAnimateAttrs && this.setAttributes(noAnimateAttrs, false, { type: AttributeUpdateType.STATE });
|
|
11443
11489
|
}
|
|
11444
11490
|
else {
|
|
11491
|
+
this.stopStateAnimates();
|
|
11445
11492
|
this.setAttributes(attrs, false, { type: AttributeUpdateType.STATE });
|
|
11446
11493
|
}
|
|
11447
11494
|
}
|
|
@@ -11493,7 +11540,6 @@ class Graphic extends Node {
|
|
|
11493
11540
|
return value;
|
|
11494
11541
|
}
|
|
11495
11542
|
clearStates(hasAnimation) {
|
|
11496
|
-
this.stopStateAnimates();
|
|
11497
11543
|
if (this.hasState() && this.normalAttrs) {
|
|
11498
11544
|
this.currentStates = [];
|
|
11499
11545
|
this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, true);
|
|
@@ -11544,7 +11590,6 @@ class Graphic extends Node {
|
|
|
11544
11590
|
if (!isChange) {
|
|
11545
11591
|
return;
|
|
11546
11592
|
}
|
|
11547
|
-
this.stopStateAnimates();
|
|
11548
11593
|
const stateAttrs = {};
|
|
11549
11594
|
states.forEach(stateName => {
|
|
11550
11595
|
var _a;
|
|
@@ -22768,6 +22813,7 @@ const DrawContribution = Symbol.for('DrawContribution');
|
|
|
22768
22813
|
|
|
22769
22814
|
const DrawItemInterceptor = Symbol.for('DrawItemInterceptor');
|
|
22770
22815
|
const tempDirtyBounds = new AABBBounds();
|
|
22816
|
+
const tempBackupDirtyBounds = new AABBBounds();
|
|
22771
22817
|
class ShadowRootDrawItemInterceptorContribution {
|
|
22772
22818
|
constructor() {
|
|
22773
22819
|
this.order = 1;
|
|
@@ -22793,13 +22839,16 @@ class ShadowRootDrawItemInterceptorContribution {
|
|
|
22793
22839
|
context.transformFromMatrix(graphic.transMatrix, true);
|
|
22794
22840
|
if (drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
22795
22841
|
tempDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
22842
|
+
tempBackupDirtyBounds.copy(drawContribution.backupDirtyBounds);
|
|
22796
22843
|
const m = graphic.globalTransMatrix.getInverse();
|
|
22797
22844
|
drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
|
|
22845
|
+
drawContribution.backupDirtyBounds.copy(drawContribution.dirtyBounds);
|
|
22798
22846
|
}
|
|
22799
22847
|
drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix);
|
|
22800
22848
|
context.highPerformanceRestore();
|
|
22801
22849
|
if (drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
|
|
22802
22850
|
drawContribution.dirtyBounds.copy(tempDirtyBounds);
|
|
22851
|
+
drawContribution.backupDirtyBounds.copy(tempBackupDirtyBounds);
|
|
22803
22852
|
}
|
|
22804
22853
|
return true;
|
|
22805
22854
|
}
|
|
@@ -28520,4 +28569,4 @@ function registerWrapTextGraphic() {
|
|
|
28520
28569
|
graphicCreator.RegisterGraphicCreator('wrapText', createWrapText);
|
|
28521
28570
|
}
|
|
28522
28571
|
|
|
28523
|
-
export { ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, Animate, AnimateGroup, AnimateGroup1, AnimateMode, AnimateStatus, AnimateStepType, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeAnimate, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, CbAnimate, Circle, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipRadiusAnimate, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Container, ContainerModule, Context2dFactory, ContributionProvider, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageBackgroundRenderContribution, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultMorphingAnimateConfig, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStateAnimateConfig, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction$1 as Direction, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, Graphic, GraphicAnimate, GraphicCreator$1 as GraphicCreator, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, ManualTickHandler, ManualTicker, Mat4Allocate, MatrixAllocate, Meteor, MonotoneX, MonotoneY, MorphingPath, MotionPath, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PickItemInterceptor, PickerService, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RAFTickHandler, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, ResourceLoader, RichText, RichTextRender, RotateBySphereAnimate, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StaticLayerHandlerContribution, Step$1 as Step, StreamLight, SubAnimate, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TimeOutTickHandler, TransformUtil, UpdateTag, VGlobal, VWindow, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache$1 as calcLineCache, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawIncrementalAreaSegments, drawIncrementalSegments, drawPathProxy, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepSegments, genStepTypeSegments, getAttributeFromDefaultAttrList, getConicGradientAt, getContextFont, getCurrentEnv, getExtraModelMatrix, getModelMatrix, getRichTextBounds, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, imageModule, incrementalAddTo, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, layerService, lineModule, lookAt, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiply, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$2 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerGlyphGraphic, registerGroupGraphic, registerImageGraphic, registerLineGraphic, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerSymbolGraphic, registerTextGraphic, registerWrapTextGraphic, renderCommandList, rewriteProto, richtextModule, rotateX, rotateY, runFill, runStroke, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformKeys, transformMat4, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
|
|
28572
|
+
export { ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, Animate, AnimateGroup, AnimateGroup1, AnimateMode, AnimateStatus, AnimateStepType, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeAnimate, AttributeUpdateType, AutoEnablePlugins, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, CbAnimate, Circle, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipRadiusAnimate, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Container, ContainerModule, Context2dFactory, ContributionProvider, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageBackgroundRenderContribution, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultMorphingAnimateConfig, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStateAnimateConfig, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction$1 as Direction, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FadeInPlus, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, Graphic, GraphicAnimate, GraphicCreator$1 as GraphicCreator, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, ManualTickHandler, ManualTicker, Mat4Allocate, MatrixAllocate, Meteor, MonotoneX, MonotoneY, MorphingPath, MotionPath, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PickItemInterceptor, PickerService, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RAFTickHandler, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RafBasedSTO, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, ResourceLoader, RichText, RichTextRender, RotateBySphereAnimate, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StaticLayerHandlerContribution, Step$1 as Step, StreamLight, SubAnimate, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TimeOutTickHandler, TransformUtil, UpdateTag, VGlobal, VWindow, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindContributionProvider, bindContributionProviderNoSingletonScope, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache$1 as calcLineCache, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, cloneGraphic, colorEqual, colorStringInterpolationToStr, container, cornerTangents, createArc, createArc3d, createArea, createCircle, createColor, createConicalGradient, createGlyph, createGroup, createImage, createLine, createMat4, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawIncrementalAreaSegments, drawIncrementalSegments, drawPathProxy, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepSegments, genStepTypeSegments, getAttributeFromDefaultAttrList, getConicGradientAt, getContextFont, getCurrentEnv, getExtraModelMatrix, getModelMatrix, getRichTextBounds, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, imageModule, incrementalAddTo, inject, injectable, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, intersect, isBrowserEnv, isNodeEnv, isSvg, isTransformKey, isXML, layerService, lineModule, lookAt, mat3Tomat4, mat4Allocate, matrixAllocate, morphPath, multiInject, multiToOneMorph, multiply, multiplyMat4Mat3, multiplyMat4Mat4, named, newThemeObj, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$2 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerGlyphGraphic, registerGroupGraphic, registerImageGraphic, registerLineGraphic, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerSymbolGraphic, registerTextGraphic, registerWrapTextGraphic, renderCommandList, rewriteProto, richtextModule, rotateX, rotateY, runFill, runStroke, segments, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitGraphic, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformKeys, transformMat4, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
|
|
@@ -65,6 +65,7 @@ export declare class StreamLight extends ACustomAnimate<any> {
|
|
|
65
65
|
constructor(from: any, to: any, duration: number, easing: EasingType, params?: {
|
|
66
66
|
attribute?: Partial<IRectAttribute | ILineAttribute>;
|
|
67
67
|
streamLength?: number;
|
|
68
|
+
isHorizontal?: boolean;
|
|
68
69
|
});
|
|
69
70
|
getEndProps(): Record<string, any>;
|
|
70
71
|
onStart(): void;
|
|
@@ -203,16 +203,16 @@ export class StreamLight extends ACustomAnimate {
|
|
|
203
203
|
this[type] = line, line.pathProxy = new CustomPath2D, root.add(line);
|
|
204
204
|
}
|
|
205
205
|
onStartRect() {
|
|
206
|
-
var _a;
|
|
207
|
-
const root = this.target.attachShadow(), height = this.target.AABBBounds
|
|
208
|
-
|
|
206
|
+
var _a, _b, _c;
|
|
207
|
+
const root = this.target.attachShadow(), isHorizontal = null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.isHorizontal) || void 0 === _b || _b, sizeAttr = isHorizontal ? "height" : "width", otherSizeAttr = isHorizontal ? "width" : "height", size = this.target.AABBBounds[sizeAttr](), y = isHorizontal ? 0 : this.target.AABBBounds.y1, rect = application.graphicService.creator.rect(Object.assign(Object.assign({
|
|
208
|
+
[sizeAttr]: size,
|
|
209
209
|
fill: "#bcdeff",
|
|
210
210
|
shadowBlur: 30,
|
|
211
211
|
shadowColor: "#bcdeff"
|
|
212
|
-
}, null === (
|
|
212
|
+
}, null === (_c = this.params) || void 0 === _c ? void 0 : _c.attribute), {
|
|
213
213
|
x: 0,
|
|
214
|
-
y:
|
|
215
|
-
|
|
214
|
+
y: y,
|
|
215
|
+
[otherSizeAttr]: 0
|
|
216
216
|
}));
|
|
217
217
|
this.rect = rect, root.add(rect);
|
|
218
218
|
}
|
|
@@ -224,18 +224,38 @@ export class StreamLight extends ACustomAnimate {
|
|
|
224
224
|
return this.rect ? this.onUpdateRect(end, ratio, out) : this.line || this.area ? this.onUpdateLineOrArea(end, ratio, out) : void 0;
|
|
225
225
|
}
|
|
226
226
|
onUpdateRect(end, ratio, out) {
|
|
227
|
-
var _a, _b, _c, _d, _e, _f;
|
|
228
|
-
const
|
|
229
|
-
|
|
230
|
-
x: x,
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
227
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
228
|
+
const isHorizontal = null === (_b = null === (_a = this.params) || void 0 === _a ? void 0 : _a.isHorizontal) || void 0 === _b || _b, parentAttr = this.target.attribute;
|
|
229
|
+
if (isHorizontal) {
|
|
230
|
+
const parentWidth = null !== (_d = null !== (_c = parentAttr.width) && void 0 !== _c ? _c : Math.abs(parentAttr.x1 - parentAttr.x)) && void 0 !== _d ? _d : 250, streamLength = null !== (_f = null === (_e = this.params) || void 0 === _e ? void 0 : _e.streamLength) && void 0 !== _f ? _f : parentWidth, maxLength = null !== (_j = null === (_h = null === (_g = this.params) || void 0 === _g ? void 0 : _g.attribute) || void 0 === _h ? void 0 : _h.width) && void 0 !== _j ? _j : 60, startX = -maxLength, currentX = startX + (streamLength - startX) * ratio, x = Math.max(currentX, 0), w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX), width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
|
|
231
|
+
this.rect.setAttributes({
|
|
232
|
+
x: x,
|
|
233
|
+
width: width,
|
|
234
|
+
dx: Math.min(parentAttr.x1 - parentAttr.x, 0)
|
|
235
|
+
}, !1, {
|
|
236
|
+
type: AttributeUpdateType.ANIMATE_PLAY,
|
|
237
|
+
animationState: {
|
|
238
|
+
ratio: ratio,
|
|
239
|
+
end: end
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
} else {
|
|
243
|
+
const parentHeight = null !== (_l = null !== (_k = parentAttr.height) && void 0 !== _k ? _k : Math.abs(parentAttr.y1 - parentAttr.y)) && void 0 !== _l ? _l : 250, streamLength = null !== (_o = null === (_m = this.params) || void 0 === _m ? void 0 : _m.streamLength) && void 0 !== _o ? _o : parentHeight, maxLength = null !== (_r = null === (_q = null === (_p = this.params) || void 0 === _p ? void 0 : _p.attribute) || void 0 === _q ? void 0 : _q.height) && void 0 !== _r ? _r : 60, currentY = parentHeight - (streamLength + maxLength) * ratio;
|
|
244
|
+
let y = Math.min(currentY, parentHeight);
|
|
245
|
+
const h = Math.min(parentHeight - currentY, maxLength);
|
|
246
|
+
let height;
|
|
247
|
+
y <= 0 ? (height = Math.max(y + h, 0), y = 0) : height = h, this.rect.setAttributes({
|
|
248
|
+
y: y,
|
|
249
|
+
height: height,
|
|
250
|
+
dy: Math.min(parentAttr.y1 - parentAttr.y, 0)
|
|
251
|
+
}, !1, {
|
|
252
|
+
type: AttributeUpdateType.ANIMATE_PLAY,
|
|
253
|
+
animationState: {
|
|
254
|
+
ratio: ratio,
|
|
255
|
+
end: end
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
}
|
|
239
259
|
}
|
|
240
260
|
onUpdateLineOrArea(end, ratio, out) {
|
|
241
261
|
const target = this.line || this.area;
|