@visactor/vgrammar-core 0.15.4-alpha.0 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/interactions/brush-base.js +1 -2
- package/cjs/interactions/element-active.js +2 -1
- package/cjs/interactions/element-select.js +1 -2
- package/cjs/interactions/filter.js +1 -1
- package/cjs/interactions/fish-eye.js +1 -1
- package/cjs/interactions/index.js +1 -1
- package/cjs/interactions/legend-filter.js +1 -1
- package/cjs/interactions/player-filter.js +1 -1
- package/cjs/interactions/roll-up.js +1 -1
- package/cjs/interactions/scrollbar-filter.js +1 -1
- package/cjs/parse/coordinate.js +1 -1
- package/cjs/parse/event.js +1 -1
- package/cjs/parse/mark.js +1 -1
- package/cjs/parse/option.js +2 -1
- package/cjs/parse/scale.js +1 -1
- package/cjs/parse/transform.js +1 -1
- package/cjs/parse/util.js +1 -1
- package/cjs/parse/view.js +1 -1
- package/cjs/types/animate.js.map +1 -1
- package/cjs/types/interaction.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/interactions/brush-base.js +2 -1
- package/es/interactions/element-active.js +1 -2
- package/es/interactions/element-select.js +2 -1
- package/es/interactions/filter.js +1 -1
- package/es/interactions/fish-eye.js +1 -1
- package/es/interactions/index.js +1 -1
- package/es/interactions/legend-filter.js +1 -1
- package/es/interactions/player-filter.js +1 -1
- package/es/interactions/roll-up.js +1 -1
- package/es/interactions/scrollbar-filter.js +1 -1
- package/es/parse/coordinate.js +1 -1
- package/es/parse/event.js +1 -1
- package/es/parse/mark.js +1 -1
- package/es/parse/option.js +1 -2
- package/es/parse/scale.js +1 -1
- package/es/parse/transform.js +1 -1
- package/es/parse/util.js +1 -1
- package/es/parse/view.js +1 -1
- package/es/types/animate.js.map +1 -1
- package/es/types/interaction.js.map +1 -1
- package/package.json +8 -8
package/cjs/index.d.ts
CHANGED
package/cjs/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", {
|
|
19
19
|
value: !0
|
|
20
20
|
}), exports.registerAnimate = exports.registerGesturePlugin = exports.registerDragPlugin = exports.GlyphMark = exports.registerGlyphMark = exports.defaultDoLayout = exports.registerDefaultLayout = exports.vglobal = exports.ThemeManager = exports.registerViewMorphAPI = exports.registerViewEventsAPI = exports.SIGNAL_VIEW_BOX = exports.SIGNAL_WIDTH = exports.SIGNAL_VIEW_WIDTH = exports.SIGNAL_VIEW_HEIGHT = exports.SIGNAL_PADDING = exports.SIGNAL_HEIGHT = exports.SIGNAL_AUTOFIT = exports.Factory = exports.GrammarBase = exports.invokeFunctionType = exports.parseFunctionType = exports.registerCoordinate = exports.Coordinate = exports.registerScale = exports.Scale = exports.View = exports.version = void 0,
|
|
21
|
-
exports.version = "0.15.4
|
|
21
|
+
exports.version = "0.15.4", __exportStar(require("./graph"), exports), __exportStar(require("./interactions"), exports);
|
|
22
22
|
|
|
23
23
|
var view_1 = require("./view");
|
|
24
24
|
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,QAAQ,CAAC;AAEhC,0CAAwB;AAExB,iDAA+B;AAE/B,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,sCAAoD;AAA3C,8FAAA,KAAK,OAAA;AAAE,sGAAA,aAAa,OAAA;AAC7B,gDAAmE;AAA1D,wGAAA,UAAU,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AACvC,qCAAqE;AAA5D,yGAAA,iBAAiB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAC9C,oDAAkD;AAAzC,2GAAA,WAAW,OAAA;AACpB,8CAA4B;AAC5B,0CAAwB;AACxB,0CAAyC;AAAhC,kGAAA,OAAO,OAAA;AAChB,8CAQ0B;AAPxB,2GAAA,cAAc,OAAA;AACd,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AACjB,yGAAA,YAAY,OAAA;AACZ,4GAAA,eAAe,OAAA;AAEjB,4DAAgE;AAAvD,yHAAA,qBAAqB,OAAA;AAC9B,4DAA+D;AAAtD,wHAAA,oBAAoB,OAAA;AAE7B,uDAAqD;AAA5C,6GAAA,YAAY,OAAA;AAErB,0CAAwB;AACxB,8CAA4B;AAC5B,+CAA6B;AAC7B,8DAA4C;AAE5C,uDAAiD;AAAxC,uGAAA,OAAO,OAAA;AAChB,wCAAsB;AACtB,iDAA+B;AAC/B,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC;AACrC,gDAA+E;AAAtE,+GAAA,qBAAqB,OAAA;AAAE,yGAAA,eAAe,OAAA;AAC/C,sCAA4D;AAAnD,0GAAA,iBAAiB,OAAA;AAAE,kGAAA,SAAS,OAAA;AAErC,yDAA4D;AAC5D,4CAAyC;AAElC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,iBAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,wBAAS,CAAC,CAAC;AACtD,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEK,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,iBAAO,CAAC,wBAAwB,CAAC,SAAS,EAAE,sBAAO,CAAC,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,qBAAqB,yBAEhC;AAEF,kEAAmE;AACnE,kEAAmE;AAE5D,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,IAAA,2CAAsB,GAAE,CAAC;IACzB,IAAA,2CAAsB,GAAE,CAAC;AAC3B,CAAC,CAAC;AAHW,QAAA,eAAe,mBAG1B","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.15.4\";\n\nexport * from './graph';\n\nexport * from './interactions';\n\nexport { View } from './view';\nexport { Scale, registerScale } from './view/scale';\nexport { Coordinate, registerCoordinate } from './view/coordinate';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\nexport { registerViewEventsAPI } from './view/view-event-mixin';\nexport { registerViewMorphAPI } from './view/view-morph-mixin';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n\nexport { vglobal } from '@visactor/vrender-core';\nexport * from './env';\nexport * from './interactions';\nexport * from './semantic-marks/cell';\nexport * from './semantic-marks/interval';\nexport * from './graph/mark/graphic';\nexport { registerDefaultLayout, defaultDoLayout } from './graph/layout/layout';\nexport { registerGlyphMark, GlyphMark } from './view/glyph';\n\nimport { DragNDrop, Gesture } from '@visactor/vrender-kits';\nimport { Factory } from './core/factory';\n\nexport const registerDragPlugin = () => {\n Factory.registerStageEventPlugin('drag', DragNDrop);\n};\n\nexport const registerGesturePlugin = () => {\n Factory.registerStageEventPlugin('gesture', Gesture);\n};\n\nimport { registerViewAnimateAPI } from './view/view-animate-mixin';\nimport { registerMarkAnimateAPI } from './view/mark-animate-mixin';\n\nexport const registerAnimate = () => {\n registerViewAnimateAPI();\n registerMarkAnimateAPI();\n};\n"]}
|
|
@@ -62,5 +62,4 @@ class ElementSelect extends base_1.BaseInteraction {
|
|
|
62
62
|
exports.ElementSelect = ElementSelect, ElementSelect.type = "element-select", ElementSelect.defaultOptions = {
|
|
63
63
|
state: enums_1.InteractionStateEnum.selected,
|
|
64
64
|
trigger: "click"
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=element-select.js.map
|
|
65
|
+
};
|
|
@@ -54,4 +54,4 @@ class ScrollbarFilter extends filter_1.Filter {
|
|
|
54
54
|
|
|
55
55
|
exports.ScrollbarFilter = ScrollbarFilter, ScrollbarFilter.type = "scrollbar-filter",
|
|
56
56
|
ScrollbarFilter.defaultOptions = {};
|
|
57
|
-
//# sourceMappingURL=scrollbar-filter.js.map
|
|
57
|
+
//# sourceMappingURL=scrollbar-filter.js.map
|
package/cjs/parse/coordinate.js
CHANGED
|
@@ -67,4 +67,4 @@ function configureCoordinate(spec, coordinate, parameters) {
|
|
|
67
67
|
|
|
68
68
|
exports.createCoordinate = createCoordinate, exports.parseCoordinate = parseCoordinate,
|
|
69
69
|
exports.configureCoordinate = configureCoordinate;
|
|
70
|
-
//# sourceMappingURL=coordinate.js.map
|
|
70
|
+
//# sourceMappingURL=coordinate.js.map
|
package/cjs/parse/event.js
CHANGED
package/cjs/parse/mark.js
CHANGED
package/cjs/parse/option.js
CHANGED
|
@@ -16,4 +16,5 @@ const parseOptions = (options, params) => options ? (0, vutils_1.isObject)(optio
|
|
|
16
16
|
return res[key] = (0, exports.parseOptionValue)(option, params), res;
|
|
17
17
|
}), {}) : options.map((option => (0, exports.parseOptionValue)(option, params))) : options;
|
|
18
18
|
|
|
19
|
-
exports.parseOptions = parseOptions;
|
|
19
|
+
exports.parseOptions = parseOptions;
|
|
20
|
+
//# sourceMappingURL=option.js.map
|
package/cjs/parse/scale.js
CHANGED
|
@@ -363,4 +363,4 @@ function configureScale(spec, scale, parameters) {
|
|
|
363
363
|
|
|
364
364
|
exports.createScale = createScale, exports.parseScaleDomainRange = parseScaleDomainRange,
|
|
365
365
|
exports.parseScaleConfig = parseScaleConfig, exports.configureScale = configureScale;
|
|
366
|
-
//# sourceMappingURL=scale.js.map
|
|
366
|
+
//# sourceMappingURL=scale.js.map
|
package/cjs/parse/transform.js
CHANGED
package/cjs/parse/util.js
CHANGED
package/cjs/parse/view.js
CHANGED
package/cjs/types/animate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\nimport type { FunctionCallback } from './signal';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number } | FunctionCallback<{ x?: number; y?: number }>;\n excludeChannels?: string[];\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n duration?: number;\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n /** encode 计算图元最终状态时是否忽略循环动画 */\n ignoreLoopFinalAttributes?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState?: 'start' | 'end', invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n getAnimationConfigs: (animationState: string) => IParsedAnimationConfig[];\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\nimport type { FunctionCallback } from './signal';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number } | FunctionCallback<{ x?: number; y?: number }>;\n excludeChannels?: string[];\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n /**\n * 状态动画的动画时长\n */\n duration?: number;\n /**\n * 状态动画的缓动函数类型\n */\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n /** encode 计算图元最终状态时是否忽略循环动画 */\n ignoreLoopFinalAttributes?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState?: 'start' | 'end', invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n getAnimationConfigs: (animationState: string) => IParsedAnimationConfig[];\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/interaction.ts"],"names":[],"mappings":"","file":"interaction.js","sourcesContent":["import type { IView } from './view';\nimport type { EventType, InteractionEvent, ViewEventType } from './event';\nimport type {\n BaseCrosshairAttrs,\n BrushAttributes,\n TooltipAttributes,\n TooltipRowAttrs\n} from '@visactor/vrender-components';\nimport type { IPolygon, ISymbolGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';\nimport type { IElement, IGlyphElement } from './element';\nimport type { IData, IGrammarBase, IMark, IScale } from './grammar';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { IBaseScale } from '@visactor/vscale';\nimport type { IDatazoom, IScrollbar } from './component';\nimport type { FieldEncodeType, MarkFunctionType } from './mark';\n\nexport interface FilterDataTarget {\n data: string | IData;\n filter: string | ((datum: any, filterValues: any[]) => boolean);\n transform?: (data: any[], filterValues: any[]) => any[];\n}\n\nexport interface IBaseInteractionOptions {\n id?: string;\n\n dependency?: string | string[] | IGrammarBase | IGrammarBase[];\n\n shouldStart?: (e: any) => boolean;\n\n shouldUpdate?: (e: any) => boolean;\n\n shouldEnd?: (e: any) => boolean;\n\n shouldReset?: (e: any) => boolean;\n\n onStart?: (e: any) => boolean;\n\n onUpdate?: (e: any) => boolean;\n\n onEnd?: (e: any) => boolean;\n\n onReset?: (e: any) => boolean;\n}\n\nexport interface IInteraction<T = any> {\n readonly options: T;\n readonly type: string;\n depend: (grammar: IGrammarBase[] | IGrammarBase | string[] | string) => void;\n bind: () => void;\n unbind: () => void;\n start: (element: IElement | IGlyphElement | string | any) => void;\n reset: (element?: IElement | IGlyphElement) => void;\n getStartState: () => string;\n}\n\nexport interface IInteractionConstructor<T = any> {\n readonly type: string;\n\n new (view: IView, options?: T): IInteraction<T>;\n}\n\n/**\n * the interaction to set the active state of specified marks\n */\nexport interface ElementActiveOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType | EventType[];\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | EventType[] | 'none';\n /**\n * the active state name\n */\n state?: string;\n}\n\nexport type ElementSelectTriggerOff = EventType | ViewEventType | 'empty' | 'none' | number;\n\n/**\n * the interaction to set the seleted state of specified marks\n */\nexport interface ElementSelectOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType | EventType[];\n /**\n * the selected state name\n */\n state?: string;\n /**\n * the non-selected state name\n */\n reverseState?: string;\n /**\n * the reset trigger event name\n */\n triggerOff?: ElementSelectTriggerOff | ElementSelectTriggerOff[];\n /**\n * whether or not support multiple selected\n */\n isMultiple?: boolean;\n}\n\n/**\n * the interaction to set the highlight state of specified marks\n */\nexport interface ElementHighlightOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface ElementFilterOptions {\n /**\n * the filter type of element\n */\n filterType?: 'key' | 'groupKey';\n /**\n * the field to be filtered\n */\n filterField?: string;\n}\n\n/**\n * the interaction to set the active state of specified marks trigger by legend\n */\nexport interface ElementActiveByLegendOptions extends IBaseInteractionOptions, ElementFilterOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the active state name\n */\n state?: string;\n}\n\n/**\n * the interaction to set the active state of specified marks trigger by legend\n */\nexport interface ElementHighlightByLegendOptions extends IBaseInteractionOptions, ElementFilterOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface ElementHighlightByNameOptions extends ElementHighlightByLegendOptions {\n graphicName?: string | string[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n\n parseData?: (e: InteractionEvent) => any;\n}\n\nexport type ElementHighlightByGraphicNameOptions = ElementHighlightOptions;\n\nexport interface BrushEventParams {\n operateType: string;\n operateMask: IPolygon;\n activeElements?: (IElement | IGlyphElement)[];\n}\n\nexport interface BrushOptions extends IBaseInteractionOptions, BrushAttributes {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n\n onStart?: (params: BrushEventParams) => boolean;\n\n onUpdate?: (params: BrushEventParams) => boolean;\n\n onEnd?: (params: BrushEventParams) => boolean;\n\n onReset?: (params: BrushEventParams) => boolean;\n}\n\nexport interface BrushHighlightOptions extends BrushOptions {\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface BrushActiveOptions extends BrushOptions {\n /**\n * the active state name\n */\n state?: string;\n}\n\nexport interface BrushFilterOptions extends BrushOptions {\n target: {\n data: IData | string;\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface DataFilterOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n source?: string | string[] | IMark | IMark[];\n\n /**\n * data target\n */\n target: {\n data: IData | string;\n filter?: string | ((datum: any, filterValue: any) => boolean);\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface DrillDownOptions extends BrushOptions {\n /**\n * enable brush\n */\n brush?: boolean;\n // trigger attribute is included in brush attributes\n target: {\n data: IData | string;\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface RollUpOptions extends DataFilterOptions {\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | ViewEventType | 'empty';\n}\n\nexport type CustomTooltipCallback = (\n datum: any,\n element: IElement,\n parameters: any\n) => TooltipRowAttrs | TooltipRowAttrs[];\n\nexport interface ITooltipRow {\n visible?: boolean;\n key?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;\n value?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;\n symbol?: MarkFunctionType<string | Partial<ISymbolGraphicAttribute>> | FieldEncodeType;\n}\n\nexport type TooltipType = 'x' | 'y' | 'angle' | 'radius';\n\nexport interface TooltipOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n\n title?: ITooltipRow | string | CustomTooltipCallback;\n content?: ITooltipRow | ITooltipRow[] | CustomTooltipCallback;\n attributes?: MarkFunctionType<TooltipAttributes>;\n}\n\nexport interface DimensionTooltipOptions extends TooltipOptions {\n scale?: IScale | string;\n tooltipType?: TooltipType;\n target?: {\n data: IData | string;\n filter: string | ((datum: any, tooltipValue: any) => boolean);\n };\n avoidMark?: string | string[];\n container?: string | IMark;\n center?: IPointLike;\n}\n\nexport type CrosshairType = 'x' | 'y' | 'angle' | 'radius' | 'radius-polygon';\n\nexport type CrosshairShape = 'line' | 'rect';\n\nexport interface CrosshairOptions extends IBaseInteractionOptions {\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n scale?: IScale | string;\n crosshairType?: CrosshairType;\n crosshairShape?: CrosshairShape;\n container?: string | IMark;\n radius?: number;\n center?: IPointLike;\n attributes?: MarkFunctionType<BaseCrosshairAttrs>;\n}\nexport interface ViewNavigationBaseOptions {\n enableX?: boolean;\n enableY?: boolean;\n scaleX?: string | IScale;\n scaleY?: string | IScale;\n dataTargetX?: FilterDataTarget;\n dataTargetY?: FilterDataTarget;\n throttle?: number;\n linkedComponentX?: string | IDatazoom | IScrollbar;\n linkedComponentY?: string | IDatazoom | IScrollbar;\n rangeX?: [number, number] | (() => [number, number]);\n rangeY?: [number, number] | (() => [number, number]);\n}\n\nexport interface ViewZoomSimpleOptions {\n realtime?: boolean;\n rate?: number;\n focus?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n triggerOff?: EventType | 'none';\n}\n\nexport type ViewZoomOptions = ViewZoomSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewScrollSimpleOptions {\n realtime?: boolean;\n reversed?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n}\nexport type ViewScrollOptions = ViewScrollSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewDragSimpleOptions {\n realtime?: boolean;\n reversed?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n updateTrigger?: EventType;\n}\n\nexport type ViewDragOptions = ViewDragSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewRoamOptions extends IBaseInteractionOptions, ViewNavigationBaseOptions {\n zoom?: ViewZoomSimpleOptions & { enable?: boolean };\n scroll?: ViewScrollSimpleOptions & { enable?: boolean };\n drag?: ViewDragSimpleOptions & { enable?: boolean };\n}\n\n/**\n * the interaction to set the highlight state of specified marks\n */\nexport interface SankeyHighlightOptions extends IBaseInteractionOptions {\n /**\n * the selector of node mark\n */\n nodeSelector?: string | IMark;\n /**\n * the selector of link mark\n */\n linkSelector?: string | IMark;\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n /** set highlight state to different type of nodes */\n effect?: 'adjacency' | 'related';\n}\n\nexport interface FishEyeOptions extends IBaseInteractionOptions {\n selector?: string | string[] | IMark | IMark[];\n /** the radius of x-direction */\n radiusX?: number;\n /** the radius of y-direction */\n radiusY?: number;\n /** the radiusRatio of x-direction */\n radiusRatioX?: number;\n /** the radiusRatio of y-direction */\n radiusRatioY?: number;\n /** x方向的扰动 */\n distortionX?: number;\n /** y方向的扰动 */\n distortionY?: number;\n /** 禁用 x方向的变形 */\n enableX?: boolean;\n /** 禁用y方向的变形 */\n enableY?: boolean;\n /** x方向的scale */\n scaleX?: string | IScale;\n /** y方向的scale */\n scaleY?: string | IScale;\n /** 节流的时长,单位为ms */\n throttle?: number;\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the trigger event of end\n */\n endTrigger?: EventType;\n /**\n * the trigger event of updating\n */\n updateTrigger?: EventType;\n /**\n * the trigger event of reset\n */\n triggerOff?: string | 'none';\n}\n\nexport interface ElementActiveSpec extends ElementActiveOptions {\n type: 'element-active';\n}\nexport interface ElementSelectSpec extends ElementSelectOptions {\n type: 'element-select';\n}\nexport interface ElementHighlightSpec extends ElementHighlightOptions {\n type: 'element-highlight';\n}\nexport interface ElementHighlightByKeySpec extends ElementHighlightOptions {\n type: 'element-highlight-by-key';\n}\nexport interface ElementHighlightByGroupSpec extends ElementHighlightOptions {\n type: 'element-highlight-by-group';\n}\nexport interface ElementActiveByLegendSpec extends ElementActiveByLegendOptions {\n type: 'element-active-by-legend';\n}\n\nexport interface ElementHighlightByLegendSpec extends ElementHighlightByLegendOptions {\n type: 'element-highlight-by-legend';\n}\n\nexport interface ElementHighlightByNameSpec extends ElementHighlightByNameOptions {\n type: 'element-highlight-by-name';\n}\n\nexport interface BrushHighlightSpec extends BrushHighlightOptions {\n type: 'brush-highlight';\n}\n\nexport interface BrushActiveSpec extends BrushActiveOptions {\n type: 'brush-active';\n}\n\nexport interface BrushFilterSpec extends BrushFilterOptions {\n type: 'brush-filter';\n}\n\nexport interface LegendFilterSpec extends DataFilterOptions {\n type: 'legend-filter';\n}\n\nexport interface DatazoomFilterSpec extends DataFilterOptions {\n type: 'datazoom-filter';\n}\n\nexport interface SliderFilterSpec extends DataFilterOptions {\n type: 'slider-filter';\n}\n\nexport interface PlayerFilterSpec extends DataFilterOptions {\n type: 'player-filter';\n}\n\nexport interface ScrollbarFilterSpec extends DataFilterOptions {\n type: 'scrollbar-filter';\n}\n\nexport interface DrillDownSpec extends DrillDownOptions {\n type: 'drill-down';\n}\n\nexport interface RollUpSpec extends RollUpOptions {\n type: 'roll-up';\n}\n\nexport interface TooltipSpec extends TooltipOptions {\n type: 'tooltip';\n}\n\nexport interface DimensionTooltipSpec extends DimensionTooltipOptions {\n type: 'dimension-tooltip';\n}\n\nexport interface CrosshairSpec extends CrosshairOptions {\n type: 'crosshair';\n}\nexport interface ViewRoamSpec extends ViewRoamOptions {\n type: 'view-roam';\n}\n\nexport interface ViewZoomSpec extends ViewZoomOptions {\n type: 'view-zoom';\n}\n\nexport interface ViewScrollSpec extends ViewScrollOptions {\n type: 'view-scroll';\n}\n\nexport interface ViewDragSpec extends ViewDragOptions {\n type: 'view-drag';\n}\n\nexport interface SankeyHighlightSpec extends SankeyHighlightOptions {\n type: 'sankey-highlight';\n}\n\nexport interface FishEyeSpec extends FishEyeOptions {\n type: 'fish-eye';\n}\n\nexport interface CustomizedInteractionSpec extends IBaseInteractionOptions {\n type: string;\n}\n\nexport type InteractionSpec =\n | ElementActiveSpec\n | ElementSelectSpec\n | ElementHighlightSpec\n | ElementHighlightByKeySpec\n | ElementHighlightByGroupSpec\n | ElementActiveByLegendSpec\n | ElementHighlightByLegendSpec\n | ElementHighlightByNameSpec\n | BrushHighlightSpec\n | BrushActiveSpec\n | BrushFilterSpec\n | LegendFilterSpec\n | DatazoomFilterSpec\n | SliderFilterSpec\n | PlayerFilterSpec\n | ScrollbarFilterSpec\n | DrillDownSpec\n | RollUpSpec\n | TooltipSpec\n | DimensionTooltipSpec\n | CrosshairSpec\n | ViewRoamSpec\n | ViewZoomSpec\n | ViewScrollSpec\n | ViewDragSpec\n | SankeyHighlightSpec\n | FishEyeSpec\n | CustomizedInteractionSpec;\n\nexport interface ViewNavigationRange {\n needUpdate?: boolean;\n x?: [number, number];\n y?: [number, number];\n}\n\nexport interface IViewZoomMixin {\n updateZoomRange: (\n rangeFactor: [number, number],\n range: [number, number],\n zoomEvent: { zoomDelta: number; zoomX: number; zoomY: number },\n zoomOptions?: ViewZoomSimpleOptions\n ) => [number, number];\n formatZoomEvent: (e: InteractionEvent) => InteractionEvent & { zoomDelta?: number; zoomX?: number; zoomY?: number };\n handleZoomStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n handleZoomEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n handleZoomReset: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IViewScrollMixin {\n formatScrollEvent: (e: InteractionEvent) => InteractionEvent & { scrollX?: number; scrollY?: number };\n handleScrollStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n scrollOptions?: ViewScrollSimpleOptions\n ) => ViewNavigationRange;\n handleScrollEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n scrollOptions?: ViewScrollSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IViewDragMixin {\n handleDragStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n handleDragUpdate: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n handleDragEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IToggleStateMixin {\n updateStates: (\n newStatedElements: (IElement | IGlyphElement)[],\n prevStatedElements?: (IElement | IGlyphElement)[],\n state?: string,\n reverseState?: string\n ) => (IElement | IGlyphElement)[];\n clearAllStates: (state?: string, reverseState?: string) => void;\n}\n\nexport interface ViewStateByDim {\n scale?: IScale;\n data?: IData;\n linkedComponent?: IDatazoom | IScrollbar;\n filterValue?: any[];\n wholeScale?: IBaseScale;\n initRangeFactor?: [number, number];\n getCurrentRange?: () => [number, number];\n rangeFactor?: [number, number];\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/interaction.ts"],"names":[],"mappings":"","file":"interaction.js","sourcesContent":["import type { IView } from './view';\nimport type { EventType, InteractionEvent, ViewEventType } from './event';\nimport type {\n BaseCrosshairAttrs,\n BrushAttributes,\n TooltipAttributes,\n TooltipRowAttrs\n} from '@visactor/vrender-components';\nimport type { IPolygon, ISymbolGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';\nimport type { IElement, IGlyphElement } from './element';\nimport type { IData, IGrammarBase, IMark, IScale } from './grammar';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { IBaseScale } from '@visactor/vscale';\nimport type { IDatazoom, IScrollbar } from './component';\nimport type { FieldEncodeType, MarkFunctionType } from './mark';\n\nexport interface FilterDataTarget {\n data: string | IData;\n filter: string | ((datum: any, filterValues: any[]) => boolean);\n transform?: (data: any[], filterValues: any[]) => any[];\n}\n\nexport interface IBaseInteractionOptions {\n id?: string;\n\n dependency?: string | string[] | IGrammarBase | IGrammarBase[];\n\n shouldStart?: (e: any) => boolean;\n\n shouldUpdate?: (e: any) => boolean;\n\n shouldEnd?: (e: any) => boolean;\n\n shouldReset?: (e: any) => boolean;\n\n onStart?: (e: any) => boolean;\n\n onUpdate?: (e: any) => boolean;\n\n onEnd?: (e: any) => boolean;\n\n onReset?: (e: any) => boolean;\n}\n\nexport interface IInteraction<T = any> {\n readonly options: T;\n readonly type: string;\n depend: (grammar: IGrammarBase[] | IGrammarBase | string[] | string) => void;\n bind: () => void;\n unbind: () => void;\n start: (element: IElement | IGlyphElement | string | any) => void;\n reset: (element?: IElement | IGlyphElement) => void;\n getStartState: () => string;\n}\n\nexport interface IInteractionConstructor<T = any> {\n readonly type: string;\n\n new (view: IView, options?: T): IInteraction<T>;\n}\n\n/**\n * the interaction to set the active state of specified marks\n */\nexport interface ElementActiveOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType | EventType[];\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | EventType[] | 'none';\n /**\n * the active state name\n */\n state?: string;\n}\n\nexport type ElementSelectTriggerOff = EventType | ViewEventType | 'empty' | 'none' | number;\n\n/**\n * the interaction to set the seleted state of specified marks\n */\nexport interface ElementSelectOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType | EventType[];\n /**\n * the selected state name\n */\n state?: string;\n /**\n * the non-selected state name\n */\n reverseState?: string;\n /**\n * the reset trigger event name\n */\n triggerOff?: ElementSelectTriggerOff | ElementSelectTriggerOff[];\n /**\n * whether or not support multiple selected\n */\n isMultiple?: boolean;\n}\n\n/**\n * the interaction to set the highlight state of specified marks\n */\nexport interface ElementHighlightOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface ElementFilterOptions {\n /**\n * the filter type of element\n */\n filterType?: 'key' | 'groupKey';\n /**\n * the field to be filtered\n */\n filterField?: string;\n}\n\n/**\n * the interaction to set the active state of specified marks trigger by legend\n */\nexport interface ElementActiveByLegendOptions extends IBaseInteractionOptions, ElementFilterOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the active state name\n */\n state?: string;\n}\n\n/**\n * the interaction to set the active state of specified marks trigger by legend\n */\nexport interface ElementHighlightByLegendOptions extends IBaseInteractionOptions, ElementFilterOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface ElementHighlightByNameOptions extends ElementHighlightByLegendOptions {\n graphicName?: string | string[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n\n parseData?: (e: InteractionEvent) => any;\n}\n\nexport type ElementHighlightByGraphicNameOptions = ElementHighlightOptions;\n\nexport interface BrushEventParams {\n operateType: string;\n operateMask: IPolygon;\n activeElements?: (IElement | IGlyphElement)[];\n}\n\nexport interface BrushOptions extends IBaseInteractionOptions, BrushAttributes {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n\n onStart?: (params: BrushEventParams) => boolean;\n\n onUpdate?: (params: BrushEventParams) => boolean;\n\n onEnd?: (params: BrushEventParams) => boolean;\n\n onReset?: (params: BrushEventParams) => boolean;\n}\n\nexport interface BrushHighlightOptions extends BrushOptions {\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface BrushActiveOptions extends BrushOptions {\n /**\n * the active state name\n */\n state?: string;\n}\n\nexport interface BrushFilterOptions extends BrushOptions {\n target: {\n data: IData | string;\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface DataFilterOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n source?: string | string[] | IMark | IMark[];\n\n /**\n * data target\n */\n target: {\n data: IData | string;\n filter?: string | ((datum: any, filterValue: any) => boolean);\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface DrillDownOptions extends BrushOptions {\n /**\n * enable brush\n */\n brush?: boolean;\n // trigger attribute is included in brush attributes\n target: {\n data: IData | string;\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface RollUpOptions extends DataFilterOptions {\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | ViewEventType | 'empty';\n}\n\nexport type CustomTooltipCallback = (\n datum: any,\n element: IElement,\n parameters: any\n) => TooltipRowAttrs | TooltipRowAttrs[];\n\nexport interface ITooltipRow {\n visible?: boolean;\n key?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;\n value?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;\n symbol?: MarkFunctionType<string | Partial<ISymbolGraphicAttribute>> | FieldEncodeType;\n}\n\nexport type TooltipType = 'x' | 'y' | 'angle' | 'radius';\n\nexport interface TooltipOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n\n title?: ITooltipRow | string | CustomTooltipCallback;\n content?: ITooltipRow | ITooltipRow[] | CustomTooltipCallback;\n attributes?: MarkFunctionType<TooltipAttributes>;\n}\n\nexport interface DimensionTooltipOptions extends TooltipOptions {\n scale?: IScale | string;\n tooltipType?: TooltipType;\n target?: {\n data: IData | string;\n filter: string | ((datum: any, tooltipValue: any) => boolean);\n };\n avoidMark?: string | string[];\n container?: string | IMark;\n center?: IPointLike;\n}\n\nexport type CrosshairType = 'x' | 'y' | 'angle' | 'radius' | 'radius-polygon';\n\nexport type CrosshairShape = 'line' | 'rect';\n\nexport interface CrosshairOptions extends IBaseInteractionOptions {\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n scale?: IScale | string;\n crosshairType?: CrosshairType;\n crosshairShape?: CrosshairShape;\n container?: string | IMark;\n radius?: number;\n center?: IPointLike;\n attributes?: MarkFunctionType<BaseCrosshairAttrs>;\n}\nexport interface ViewNavigationBaseOptions {\n enableX?: boolean;\n enableY?: boolean;\n scaleX?: string | IScale;\n scaleY?: string | IScale;\n dataTargetX?: FilterDataTarget;\n dataTargetY?: FilterDataTarget;\n throttle?: number;\n linkedComponentX?: string | IDatazoom | IScrollbar;\n linkedComponentY?: string | IDatazoom | IScrollbar;\n rangeX?: [number, number] | (() => [number, number]);\n rangeY?: [number, number] | (() => [number, number]);\n}\n\nexport interface ViewZoomSimpleOptions {\n realtime?: boolean;\n rate?: number;\n focus?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n triggerOff?: EventType | 'none';\n}\n\nexport type ViewZoomOptions = ViewZoomSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewScrollSimpleOptions {\n realtime?: boolean;\n reversed?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n}\nexport type ViewScrollOptions = ViewScrollSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewDragSimpleOptions {\n realtime?: boolean;\n reversed?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n updateTrigger?: EventType;\n}\n\nexport type ViewDragOptions = ViewDragSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewRoamOptions extends IBaseInteractionOptions, ViewNavigationBaseOptions {\n zoom?: ViewZoomSimpleOptions & { enable?: boolean };\n scroll?: ViewScrollSimpleOptions & { enable?: boolean };\n drag?: ViewDragSimpleOptions & { enable?: boolean };\n}\n\n/**\n * the interaction to set the highlight state of specified marks\n */\nexport interface SankeyHighlightOptions extends IBaseInteractionOptions {\n /**\n * the selector of node mark\n */\n nodeSelector?: string | IMark;\n /**\n * the selector of link mark\n */\n linkSelector?: string | IMark;\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n /** set highlight state to different type of nodes */\n effect?: 'adjacency' | 'related';\n}\n\nexport interface FishEyeOptions extends IBaseInteractionOptions {\n selector?: string | string[] | IMark | IMark[];\n /** the radius of x-direction */\n radiusX?: number;\n /** the radius of y-direction */\n radiusY?: number;\n /** the radiusRatio of x-direction */\n radiusRatioX?: number;\n /** the radiusRatio of y-direction */\n radiusRatioY?: number;\n /** x方向的扰动 */\n distortionX?: number;\n /** y方向的扰动 */\n distortionY?: number;\n /** 禁用 x方向的变形 */\n enableX?: boolean;\n /** 禁用y方向的变形 */\n enableY?: boolean;\n /** x方向的scale */\n scaleX?: string | IScale;\n /** y方向的scale */\n scaleY?: string | IScale;\n /** 节流的时长,单位为ms */\n throttle?: number;\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the trigger event of end\n */\n endTrigger?: EventType;\n /**\n * the trigger event of updating\n */\n updateTrigger?: EventType;\n /**\n * the trigger event of reset\n */\n triggerOff?: string | 'none';\n}\n\nexport interface ElementActiveSpec extends ElementActiveOptions {\n /**\n * 设置交互的类型为 'element-active'\n */\n type: 'element-active';\n}\nexport interface ElementSelectSpec extends ElementSelectOptions {\n /**\n * 设置交互的类型为 'element-select'\n */\n type: 'element-select';\n}\nexport interface ElementHighlightSpec extends ElementHighlightOptions {\n /**\n * 设置交互的类型为 'element-highlight'\n */\n type: 'element-highlight';\n}\nexport interface ElementHighlightByKeySpec extends ElementHighlightOptions {\n /**\n * 设置交互的类型为 'element-highlight-by-key'\n */\n type: 'element-highlight-by-key';\n}\nexport interface ElementHighlightByGroupSpec extends ElementHighlightOptions {\n /**\n * 设置交互的类型为 'element-highlight-by-group'\n */\n type: 'element-highlight-by-group';\n}\nexport interface ElementActiveByLegendSpec extends ElementActiveByLegendOptions {\n /**\n * 设置交互的类型为 'element-active-by-legend'\n */\n type: 'element-active-by-legend';\n}\n\nexport interface ElementHighlightByLegendSpec extends ElementHighlightByLegendOptions {\n /**\n * 设置交互的类型为'element-highlight-by-legend'\n */\n type: 'element-highlight-by-legend';\n}\n\nexport interface ElementHighlightByNameSpec extends ElementHighlightByNameOptions {\n /**\n * 设置交互的类型为'element-highlight-by-name'\n */\n type: 'element-highlight-by-name';\n}\n\nexport interface BrushHighlightSpec extends BrushHighlightOptions {\n /**\n * 设置交互类型为'brush-highlight'\n */\n type: 'brush-highlight';\n}\n\nexport interface BrushActiveSpec extends BrushActiveOptions {\n /**\n * 设置交互类型为 'brush-active'\n */\n type: 'brush-active';\n}\n\nexport interface BrushFilterSpec extends BrushFilterOptions {\n /**\n * 设置交互类型为'brush-filter'\n */\n type: 'brush-filter';\n}\n\nexport interface LegendFilterSpec extends DataFilterOptions {\n type: 'legend-filter';\n}\n\nexport interface DatazoomFilterSpec extends DataFilterOptions {\n type: 'datazoom-filter';\n}\n\nexport interface SliderFilterSpec extends DataFilterOptions {\n type: 'slider-filter';\n}\n\nexport interface PlayerFilterSpec extends DataFilterOptions {\n type: 'player-filter';\n}\n\nexport interface ScrollbarFilterSpec extends DataFilterOptions {\n type: 'scrollbar-filter';\n}\n\nexport interface DrillDownSpec extends DrillDownOptions {\n type: 'drill-down';\n}\n\nexport interface RollUpSpec extends RollUpOptions {\n type: 'roll-up';\n}\n\nexport interface TooltipSpec extends TooltipOptions {\n type: 'tooltip';\n}\n\nexport interface DimensionTooltipSpec extends DimensionTooltipOptions {\n type: 'dimension-tooltip';\n}\n\nexport interface CrosshairSpec extends CrosshairOptions {\n type: 'crosshair';\n}\nexport interface ViewRoamSpec extends ViewRoamOptions {\n type: 'view-roam';\n}\n\nexport interface ViewZoomSpec extends ViewZoomOptions {\n type: 'view-zoom';\n}\n\nexport interface ViewScrollSpec extends ViewScrollOptions {\n type: 'view-scroll';\n}\n\nexport interface ViewDragSpec extends ViewDragOptions {\n type: 'view-drag';\n}\n\nexport interface SankeyHighlightSpec extends SankeyHighlightOptions {\n type: 'sankey-highlight';\n}\n\nexport interface FishEyeSpec extends FishEyeOptions {\n type: 'fish-eye';\n}\n\nexport interface CustomizedInteractionSpec extends IBaseInteractionOptions {\n type: string;\n}\n\nexport type InteractionSpec =\n | ElementActiveSpec\n | ElementSelectSpec\n | ElementHighlightSpec\n | ElementHighlightByKeySpec\n | ElementHighlightByGroupSpec\n | ElementActiveByLegendSpec\n | ElementHighlightByLegendSpec\n | ElementHighlightByNameSpec\n | BrushHighlightSpec\n | BrushActiveSpec\n | BrushFilterSpec\n | LegendFilterSpec\n | DatazoomFilterSpec\n | SliderFilterSpec\n | PlayerFilterSpec\n | ScrollbarFilterSpec\n | DrillDownSpec\n | RollUpSpec\n | TooltipSpec\n | DimensionTooltipSpec\n | CrosshairSpec\n | ViewRoamSpec\n | ViewZoomSpec\n | ViewScrollSpec\n | ViewDragSpec\n | SankeyHighlightSpec\n | FishEyeSpec\n | CustomizedInteractionSpec;\n\nexport interface ViewNavigationRange {\n needUpdate?: boolean;\n x?: [number, number];\n y?: [number, number];\n}\n\nexport interface IViewZoomMixin {\n updateZoomRange: (\n rangeFactor: [number, number],\n range: [number, number],\n zoomEvent: { zoomDelta: number; zoomX: number; zoomY: number },\n zoomOptions?: ViewZoomSimpleOptions\n ) => [number, number];\n formatZoomEvent: (e: InteractionEvent) => InteractionEvent & { zoomDelta?: number; zoomX?: number; zoomY?: number };\n handleZoomStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n handleZoomEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n handleZoomReset: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IViewScrollMixin {\n formatScrollEvent: (e: InteractionEvent) => InteractionEvent & { scrollX?: number; scrollY?: number };\n handleScrollStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n scrollOptions?: ViewScrollSimpleOptions\n ) => ViewNavigationRange;\n handleScrollEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n scrollOptions?: ViewScrollSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IViewDragMixin {\n handleDragStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n handleDragUpdate: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n handleDragEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IToggleStateMixin {\n updateStates: (\n newStatedElements: (IElement | IGlyphElement)[],\n prevStatedElements?: (IElement | IGlyphElement)[],\n state?: string,\n reverseState?: string\n ) => (IElement | IGlyphElement)[];\n clearAllStates: (state?: string, reverseState?: string) => void;\n}\n\nexport interface ViewStateByDim {\n scale?: IScale;\n data?: IData;\n linkedComponent?: IDatazoom | IScrollbar;\n filterValue?: any[];\n wholeScale?: IBaseScale;\n initRangeFactor?: [number, number];\n getCurrentRange?: () => [number, number];\n rangeFactor?: [number, number];\n}\n"]}
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;AAEhC,cAAc,SAAS,CAAC;AAExB,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACtD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,OAAO,CAAC,wBAAwB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,sBAAsB,EAAE,CAAC;IACzB,sBAAsB,EAAE,CAAC;AAC3B,CAAC,CAAC","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.15.4\";\n\nexport * from './graph';\n\nexport * from './interactions';\n\nexport { View } from './view';\nexport { Scale, registerScale } from './view/scale';\nexport { Coordinate, registerCoordinate } from './view/coordinate';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\nexport { registerViewEventsAPI } from './view/view-event-mixin';\nexport { registerViewMorphAPI } from './view/view-morph-mixin';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n\nexport { vglobal } from '@visactor/vrender-core';\nexport * from './env';\nexport * from './interactions';\nexport * from './semantic-marks/cell';\nexport * from './semantic-marks/interval';\nexport * from './graph/mark/graphic';\nexport { registerDefaultLayout, defaultDoLayout } from './graph/layout/layout';\nexport { registerGlyphMark, GlyphMark } from './view/glyph';\n\nimport { DragNDrop, Gesture } from '@visactor/vrender-kits';\nimport { Factory } from './core/factory';\n\nexport const registerDragPlugin = () => {\n Factory.registerStageEventPlugin('drag', DragNDrop);\n};\n\nexport const registerGesturePlugin = () => {\n Factory.registerStageEventPlugin('gesture', Gesture);\n};\n\nimport { registerViewAnimateAPI } from './view/view-animate-mixin';\nimport { registerMarkAnimateAPI } from './view/mark-animate-mixin';\n\nexport const registerAnimate = () => {\n registerViewAnimateAPI();\n registerMarkAnimateAPI();\n};\n"]}
|
|
@@ -101,4 +101,5 @@ export class BrushBase extends BaseInteraction {
|
|
|
101
101
|
};
|
|
102
102
|
event.type === IOperateType.drawStart || event.type === IOperateType.moveStart ? this.dispatchEvent("start", params) : event.type === IOperateType.drawing || event.type === IOperateType.moving ? this.dispatchEvent("update", params) : event.type === IOperateType.drawEnd || event.type === IOperateType.moveEnd ? this.dispatchEvent("end", params) : this.dispatchEvent("reset", params);
|
|
103
103
|
}
|
|
104
|
-
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=brush-base.js.map
|
package/es/interactions/index.js
CHANGED
package/es/parse/coordinate.js
CHANGED
package/es/parse/event.js
CHANGED
package/es/parse/mark.js
CHANGED
|
@@ -16,4 +16,4 @@ export function parseEncodeType(encoder, view) {
|
|
|
16
16
|
return encoder.scale && (dependencies = isGrammar(encoder.scale) ? [ encoder.scale ] : array(view.getScaleById(encoder.scale))),
|
|
17
17
|
dependencies.concat(parseFunctionType(encoder, view));
|
|
18
18
|
}
|
|
19
|
-
//# sourceMappingURL=mark.js.map
|
|
19
|
+
//# sourceMappingURL=mark.js.map
|
package/es/parse/option.js
CHANGED
|
@@ -7,5 +7,4 @@ export const parseOptionValue = (value, params) => isGrammar(value) ? value.outp
|
|
|
7
7
|
export const parseOptions = (options, params) => options ? isObject(options) ? Object.keys(options).reduce(((res, key) => {
|
|
8
8
|
const option = options[key];
|
|
9
9
|
return res[key] = parseOptionValue(option, params), res;
|
|
10
|
-
}), {}) : options.map((option => parseOptionValue(option, params))) : options;
|
|
11
|
-
//# sourceMappingURL=option.js.map
|
|
10
|
+
}), {}) : options.map((option => parseOptionValue(option, params))) : options;
|
package/es/parse/scale.js
CHANGED
package/es/parse/transform.js
CHANGED
package/es/parse/util.js
CHANGED
|
@@ -62,4 +62,4 @@ export const isGrammar = el => el && !isNil(el.grammarType);
|
|
|
62
62
|
export const parseField = field => isFunction(field) ? field : datum => datum[field];
|
|
63
63
|
|
|
64
64
|
export const parseColor = color => isString(color) && Color.parseColorString(color) ? color : null;
|
|
65
|
-
//# sourceMappingURL=util.js.map
|
|
65
|
+
//# sourceMappingURL=util.js.map
|
package/es/parse/view.js
CHANGED
package/es/types/animate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\nimport type { FunctionCallback } from './signal';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number } | FunctionCallback<{ x?: number; y?: number }>;\n excludeChannels?: string[];\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n duration?: number;\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n /** encode 计算图元最终状态时是否忽略循环动画 */\n ignoreLoopFinalAttributes?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState?: 'start' | 'end', invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n getAnimationConfigs: (animationState: string) => IParsedAnimationConfig[];\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { IGraphic, ACustomAnimate, EasingType } from '@visactor/vrender-core';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { MarkFunctionCallback, MarkFunctionType } from './mark';\nimport type { IMark } from './grammar';\nimport type { IElement } from './element';\nimport type { FunctionCallback } from './signal';\n\nexport type TypeAnimation<T extends IElement> = (\n element: T,\n options: any,\n animationParameters: IAnimationParameters\n) => { from?: { [channel: string]: any }; to?: { [channel: string]: any } };\n\nexport interface IClipAnimationOptions {\n clipDimension?: 'x' | 'y' | 'auto' | 'default';\n}\n\nexport interface IGrowCartesianAnimationOptions {\n orient?: 'positive' | 'negative';\n overall?: boolean | number;\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IGrowAngleAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n overall?: boolean | number;\n}\n\nexport interface IGrowRadiusAnimationOptions {\n orient?: 'inside' | 'outside';\n overall?: boolean | number;\n}\n\nexport interface IGrowPointsAnimationOptions {\n orient?: 'positive' | 'negative';\n}\n\nexport interface IGrowPointsOverallAnimationOptions extends IGrowPointsAnimationOptions {\n center?: IPointLike;\n}\n\nexport interface IScaleAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n}\n\nexport interface IMoveAnimationOptions {\n direction?: 'x' | 'y' | 'xy';\n orient?: 'positive' | 'negative';\n offset?: number;\n point?: { x?: number; y?: number } | FunctionCallback<{ x?: number; y?: number }>;\n excludeChannels?: string[];\n}\n\nexport interface IRotateAnimationOptions {\n orient?: 'clockwise' | 'anticlockwise';\n angle?: number;\n}\n\n/** VGrammar 层提供的图元text上的图形属性,现在暂时会和VRender不一致 */\nexport interface TextItemAttributes {\n fontSize?: number;\n lineHeight?: number;\n font?: string;\n fontStyle?: string;\n fontVariant?: string;\n fontWeight?: string | number;\n lineBreak?: string;\n text?: string | string[];\n limit?: number;\n align?: string;\n baseline?: string;\n ellipsis?: string | boolean;\n dir?: string;\n}\n\n/** animation */\nexport type MarkFunctionValueType<T> = MarkFunctionCallback<T> | T;\n\nexport type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig;\n\n/**\n * state动画,暂时只支持简单配置\n */\nexport interface IStateAnimationConfig {\n /**\n * 状态动画的动画时长\n */\n duration?: number;\n /**\n * 状态动画的缓动函数类型\n */\n easing?: EasingType;\n}\n\n/**\n * 动画 config 简化配置\n */\nexport interface IAnimationTypeConfig {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n duration?: MarkFunctionValueType<number>;\n oneByOne?: MarkFunctionValueType<boolean | number>;\n startTime?: MarkFunctionValueType<number>;\n totalTime?: MarkFunctionValueType<number>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: boolean | number;\n /** 动画 effect 配置项 */\n options?: MarkFunctionValueType<any>;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\n/**\n * 动画 timeline 完整配置,一条时间线内的动画单元只能串行\n * 多个timeline是可以并行的\n * 考虑到同一图元不能在多个timeline上,所以timeline不应该提供数组配置的能力\n */\nexport interface IAnimationTimeline {\n /** 为了方便动画编排,用户可以设置 id 用于识别时间线 */\n id?: string;\n /** 时间切片 */\n timeSlices: IAnimationTimeSlice | IAnimationTimeSlice[];\n /** 动画开始的相对时间,可以为负数 */\n startTime?: MarkFunctionValueType<number>;\n /** 动画时长 */\n totalTime?: MarkFunctionValueType<number>;\n /** 动画依次执行的延迟 */\n oneByOne?: MarkFunctionValueType<number | boolean>;\n /** loop: true 无限循环; loop: 正整数,表示循环的次数 */\n loop?: MarkFunctionValueType<number | boolean>;\n /** 对图元元素进行划分,和过滤类似,但是不同时间线不能同时作用在相同的元素上 */\n partitioner?: MarkFunctionCallback<boolean>;\n /** 对同一时间线上的元素进行排序 */\n sort?: (datumA: any, datumB: any, elementA: IElement, elementB: IElement, parameters: any) => number;\n /** 动画执行相关控制配置项 */\n controlOptions?: IAnimationControlOptions;\n}\n\nexport interface IAnimationTimeSlice {\n effects: IAnimationEffect | IAnimationEffect[];\n duration?: MarkFunctionValueType<number>;\n delay?: MarkFunctionValueType<number>;\n delayAfter?: MarkFunctionValueType<number>;\n}\n\nexport type IAnimationChannelFunction = (datum: any, element: IElement, parameters: IAnimationParameters) => any;\nexport type IAnimationChannelAttrs = Record<\n string,\n {\n from?: any | IAnimationChannelFunction;\n to?: any | IAnimationChannelFunction;\n }\n>;\nexport type IAnimationChannelAttributes = string[];\nexport type IAnimationChannelInterpolator = (\n ratio: number,\n from: any,\n to: any,\n nextAttributes: any,\n datum: any,\n element: IElement,\n parameters: IAnimationParameters\n) => boolean | void;\n\n// TODO: fix ACustomAnimate<any>\nexport interface IAnimationCustomConstructor {\n new (from: any, to: any, duration: number, ease: EasingType, parameters?: any): ACustomAnimate<any>;\n}\n\nexport interface IAnimationEffect {\n type?: string;\n channel?: IAnimationChannelAttrs | IAnimationChannelAttributes;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: MarkFunctionValueType<any>;\n easing?: EasingType;\n /** options暂时没有处理 */\n options?: MarkFunctionValueType<any>;\n}\n\nexport interface IAnimationControlOptions {\n /** 当动画状态变更时清空动画 */\n stopWhenStateChange?: boolean;\n /** 是否立即应用动画初始状态 */\n immediatelyApply?: boolean;\n /** encode 计算图元最终状态时是否忽略循环动画 */\n ignoreLoopFinalAttributes?: boolean;\n}\n\n/**\n * Animation timeline should be parsed into animation units,\n * which record all necessary configs for animator to execute animation.\n *\n * animation unit time:\n * |<--initialDelay-->| |<--loopDelay--><--Slices--><--looDelayAfter-->| |<--loopDuration-->|\n * |<-----------------loopDuration--------------->|\n */\nexport interface IAnimationUnit {\n /**\n * initial delay time before any animation loop\n */\n initialDelay: number;\n /**\n * total time for one animation loop\n */\n loopDuration: number;\n /**\n * delay time before time slices\n */\n loopDelay: number;\n /**\n * delay time after time slices\n */\n loopDelayAfter: number;\n /**\n * animating time in one animation loop\n */\n loopAnimateDuration: number;\n loopCount: number;\n totalTime: number;\n timeSlices: IAnimationTimeSlice[];\n}\n\nexport interface IAnimationRecord {\n start: IGraphic;\n end: IGraphic;\n changes: any[];\n}\n\nexport interface IAnimationParameters {\n width: number;\n height: number;\n mark: IMark;\n group: IMark | null;\n elementIndex: number;\n elementCount: number;\n view: any;\n}\n\nexport interface IParsedAnimationConfig {\n state: string;\n timeline: IAnimationTimeline;\n originConfig: IAnimationConfig;\n id: string;\n}\n\nexport interface IParsedAnimationAttrs {\n from?: any;\n to?: any;\n custom?: IAnimationChannelInterpolator | IAnimationCustomConstructor;\n customParameters?: any;\n}\n\n// animate structure\n\nexport interface IAnimatorOptions {\n state: string;\n timeline: IAnimationTimeline;\n id: string;\n}\n\nexport interface IAnimator {\n id: number;\n element: IElement;\n animationOptions: IAnimatorOptions;\n isAnimating: boolean;\n\n /** execute animation */\n animate: (animationParameters: IAnimationParameters, parameters: any) => this;\n /** set animation callback */\n callback: (callbackFunction: (...args: any[]) => void) => this;\n\n // animation control\n stop: (stopState?: 'start' | 'end', invokeCallback?: boolean) => this;\n pause: () => this;\n resume: () => this;\n\n /** set additional initial animation delay */\n startAt: (startTime: number) => this;\n /** get total animation execution time */\n getTotalAnimationTime: () => number;\n\n getEndAttributes: () => Record<string, any>;\n}\n\nexport interface IAnimateArranger {\n // animation control api\n parallel: (arranger: IAnimateArranger) => this;\n after: (arranger: IAnimateArranger) => this;\n\n // internal properties\n afterArranger: IAnimateArranger;\n parallelArrangers: IAnimateArranger[];\n animators: IAnimator[];\n totalTime: number;\n startTime: number;\n endTime: number;\n arrangeTime: () => void;\n}\n\nexport interface IBaseAnimate {\n // animation control\n stop: () => this;\n pause: () => this;\n resume: () => this;\n\n // internal animation process api\n animate: () => this;\n enable: () => this;\n disable: () => this;\n enableAnimationState: (state: string | string[]) => this;\n disableAnimationState: (state: string | string[]) => this;\n isAnimating: () => boolean;\n\n release: () => void;\n}\n\nexport interface IViewAnimate extends IBaseAnimate {\n animateAddition: (mark: IMark) => this;\n}\n\nexport interface IAnimate extends IBaseAnimate {\n mark: IMark;\n\n // additional animation control\n run: (config: IAnimationConfig | IAnimationConfig[]) => IAnimateArranger;\n runAnimationByState: (animationState: string) => IAnimateArranger;\n stopAnimationByState: (animationState: string) => this;\n pauseAnimationByState: (animationState: string) => this;\n resumeAnimationByState: (animationState: string) => this;\n reverse: () => this;\n restart: () => this;\n record: () => this;\n recordEnd: () => this;\n\n // internal animation process api\n getAnimationConfigs: (animationState: string) => IParsedAnimationConfig[];\n updateConfig: (config: Record<string, IAnimationConfig | IAnimationConfig[]>) => void;\n updateState: (state: MarkFunctionType<string> | null) => void;\n isElementAnimating: (element: IElement) => boolean;\n getAnimatorCount: () => number;\n getElementAnimators: (element: IElement | IElement[], animationState?: string) => IAnimator[];\n release: () => void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/interaction.ts"],"names":[],"mappings":"","file":"interaction.js","sourcesContent":["import type { IView } from './view';\nimport type { EventType, InteractionEvent, ViewEventType } from './event';\nimport type {\n BaseCrosshairAttrs,\n BrushAttributes,\n TooltipAttributes,\n TooltipRowAttrs\n} from '@visactor/vrender-components';\nimport type { IPolygon, ISymbolGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';\nimport type { IElement, IGlyphElement } from './element';\nimport type { IData, IGrammarBase, IMark, IScale } from './grammar';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { IBaseScale } from '@visactor/vscale';\nimport type { IDatazoom, IScrollbar } from './component';\nimport type { FieldEncodeType, MarkFunctionType } from './mark';\n\nexport interface FilterDataTarget {\n data: string | IData;\n filter: string | ((datum: any, filterValues: any[]) => boolean);\n transform?: (data: any[], filterValues: any[]) => any[];\n}\n\nexport interface IBaseInteractionOptions {\n id?: string;\n\n dependency?: string | string[] | IGrammarBase | IGrammarBase[];\n\n shouldStart?: (e: any) => boolean;\n\n shouldUpdate?: (e: any) => boolean;\n\n shouldEnd?: (e: any) => boolean;\n\n shouldReset?: (e: any) => boolean;\n\n onStart?: (e: any) => boolean;\n\n onUpdate?: (e: any) => boolean;\n\n onEnd?: (e: any) => boolean;\n\n onReset?: (e: any) => boolean;\n}\n\nexport interface IInteraction<T = any> {\n readonly options: T;\n readonly type: string;\n depend: (grammar: IGrammarBase[] | IGrammarBase | string[] | string) => void;\n bind: () => void;\n unbind: () => void;\n start: (element: IElement | IGlyphElement | string | any) => void;\n reset: (element?: IElement | IGlyphElement) => void;\n getStartState: () => string;\n}\n\nexport interface IInteractionConstructor<T = any> {\n readonly type: string;\n\n new (view: IView, options?: T): IInteraction<T>;\n}\n\n/**\n * the interaction to set the active state of specified marks\n */\nexport interface ElementActiveOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType | EventType[];\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | EventType[] | 'none';\n /**\n * the active state name\n */\n state?: string;\n}\n\nexport type ElementSelectTriggerOff = EventType | ViewEventType | 'empty' | 'none' | number;\n\n/**\n * the interaction to set the seleted state of specified marks\n */\nexport interface ElementSelectOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType | EventType[];\n /**\n * the selected state name\n */\n state?: string;\n /**\n * the non-selected state name\n */\n reverseState?: string;\n /**\n * the reset trigger event name\n */\n triggerOff?: ElementSelectTriggerOff | ElementSelectTriggerOff[];\n /**\n * whether or not support multiple selected\n */\n isMultiple?: boolean;\n}\n\n/**\n * the interaction to set the highlight state of specified marks\n */\nexport interface ElementHighlightOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface ElementFilterOptions {\n /**\n * the filter type of element\n */\n filterType?: 'key' | 'groupKey';\n /**\n * the field to be filtered\n */\n filterField?: string;\n}\n\n/**\n * the interaction to set the active state of specified marks trigger by legend\n */\nexport interface ElementActiveByLegendOptions extends IBaseInteractionOptions, ElementFilterOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the active state name\n */\n state?: string;\n}\n\n/**\n * the interaction to set the active state of specified marks trigger by legend\n */\nexport interface ElementHighlightByLegendOptions extends IBaseInteractionOptions, ElementFilterOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface ElementHighlightByNameOptions extends ElementHighlightByLegendOptions {\n graphicName?: string | string[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n\n parseData?: (e: InteractionEvent) => any;\n}\n\nexport type ElementHighlightByGraphicNameOptions = ElementHighlightOptions;\n\nexport interface BrushEventParams {\n operateType: string;\n operateMask: IPolygon;\n activeElements?: (IElement | IGlyphElement)[];\n}\n\nexport interface BrushOptions extends IBaseInteractionOptions, BrushAttributes {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n\n onStart?: (params: BrushEventParams) => boolean;\n\n onUpdate?: (params: BrushEventParams) => boolean;\n\n onEnd?: (params: BrushEventParams) => boolean;\n\n onReset?: (params: BrushEventParams) => boolean;\n}\n\nexport interface BrushHighlightOptions extends BrushOptions {\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface BrushActiveOptions extends BrushOptions {\n /**\n * the active state name\n */\n state?: string;\n}\n\nexport interface BrushFilterOptions extends BrushOptions {\n target: {\n data: IData | string;\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface DataFilterOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n source?: string | string[] | IMark | IMark[];\n\n /**\n * data target\n */\n target: {\n data: IData | string;\n filter?: string | ((datum: any, filterValue: any) => boolean);\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface DrillDownOptions extends BrushOptions {\n /**\n * enable brush\n */\n brush?: boolean;\n // trigger attribute is included in brush attributes\n target: {\n data: IData | string;\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface RollUpOptions extends DataFilterOptions {\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | ViewEventType | 'empty';\n}\n\nexport type CustomTooltipCallback = (\n datum: any,\n element: IElement,\n parameters: any\n) => TooltipRowAttrs | TooltipRowAttrs[];\n\nexport interface ITooltipRow {\n visible?: boolean;\n key?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;\n value?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;\n symbol?: MarkFunctionType<string | Partial<ISymbolGraphicAttribute>> | FieldEncodeType;\n}\n\nexport type TooltipType = 'x' | 'y' | 'angle' | 'radius';\n\nexport interface TooltipOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n\n title?: ITooltipRow | string | CustomTooltipCallback;\n content?: ITooltipRow | ITooltipRow[] | CustomTooltipCallback;\n attributes?: MarkFunctionType<TooltipAttributes>;\n}\n\nexport interface DimensionTooltipOptions extends TooltipOptions {\n scale?: IScale | string;\n tooltipType?: TooltipType;\n target?: {\n data: IData | string;\n filter: string | ((datum: any, tooltipValue: any) => boolean);\n };\n avoidMark?: string | string[];\n container?: string | IMark;\n center?: IPointLike;\n}\n\nexport type CrosshairType = 'x' | 'y' | 'angle' | 'radius' | 'radius-polygon';\n\nexport type CrosshairShape = 'line' | 'rect';\n\nexport interface CrosshairOptions extends IBaseInteractionOptions {\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n scale?: IScale | string;\n crosshairType?: CrosshairType;\n crosshairShape?: CrosshairShape;\n container?: string | IMark;\n radius?: number;\n center?: IPointLike;\n attributes?: MarkFunctionType<BaseCrosshairAttrs>;\n}\nexport interface ViewNavigationBaseOptions {\n enableX?: boolean;\n enableY?: boolean;\n scaleX?: string | IScale;\n scaleY?: string | IScale;\n dataTargetX?: FilterDataTarget;\n dataTargetY?: FilterDataTarget;\n throttle?: number;\n linkedComponentX?: string | IDatazoom | IScrollbar;\n linkedComponentY?: string | IDatazoom | IScrollbar;\n rangeX?: [number, number] | (() => [number, number]);\n rangeY?: [number, number] | (() => [number, number]);\n}\n\nexport interface ViewZoomSimpleOptions {\n realtime?: boolean;\n rate?: number;\n focus?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n triggerOff?: EventType | 'none';\n}\n\nexport type ViewZoomOptions = ViewZoomSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewScrollSimpleOptions {\n realtime?: boolean;\n reversed?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n}\nexport type ViewScrollOptions = ViewScrollSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewDragSimpleOptions {\n realtime?: boolean;\n reversed?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n updateTrigger?: EventType;\n}\n\nexport type ViewDragOptions = ViewDragSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewRoamOptions extends IBaseInteractionOptions, ViewNavigationBaseOptions {\n zoom?: ViewZoomSimpleOptions & { enable?: boolean };\n scroll?: ViewScrollSimpleOptions & { enable?: boolean };\n drag?: ViewDragSimpleOptions & { enable?: boolean };\n}\n\n/**\n * the interaction to set the highlight state of specified marks\n */\nexport interface SankeyHighlightOptions extends IBaseInteractionOptions {\n /**\n * the selector of node mark\n */\n nodeSelector?: string | IMark;\n /**\n * the selector of link mark\n */\n linkSelector?: string | IMark;\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n /** set highlight state to different type of nodes */\n effect?: 'adjacency' | 'related';\n}\n\nexport interface FishEyeOptions extends IBaseInteractionOptions {\n selector?: string | string[] | IMark | IMark[];\n /** the radius of x-direction */\n radiusX?: number;\n /** the radius of y-direction */\n radiusY?: number;\n /** the radiusRatio of x-direction */\n radiusRatioX?: number;\n /** the radiusRatio of y-direction */\n radiusRatioY?: number;\n /** x方向的扰动 */\n distortionX?: number;\n /** y方向的扰动 */\n distortionY?: number;\n /** 禁用 x方向的变形 */\n enableX?: boolean;\n /** 禁用y方向的变形 */\n enableY?: boolean;\n /** x方向的scale */\n scaleX?: string | IScale;\n /** y方向的scale */\n scaleY?: string | IScale;\n /** 节流的时长,单位为ms */\n throttle?: number;\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the trigger event of end\n */\n endTrigger?: EventType;\n /**\n * the trigger event of updating\n */\n updateTrigger?: EventType;\n /**\n * the trigger event of reset\n */\n triggerOff?: string | 'none';\n}\n\nexport interface ElementActiveSpec extends ElementActiveOptions {\n type: 'element-active';\n}\nexport interface ElementSelectSpec extends ElementSelectOptions {\n type: 'element-select';\n}\nexport interface ElementHighlightSpec extends ElementHighlightOptions {\n type: 'element-highlight';\n}\nexport interface ElementHighlightByKeySpec extends ElementHighlightOptions {\n type: 'element-highlight-by-key';\n}\nexport interface ElementHighlightByGroupSpec extends ElementHighlightOptions {\n type: 'element-highlight-by-group';\n}\nexport interface ElementActiveByLegendSpec extends ElementActiveByLegendOptions {\n type: 'element-active-by-legend';\n}\n\nexport interface ElementHighlightByLegendSpec extends ElementHighlightByLegendOptions {\n type: 'element-highlight-by-legend';\n}\n\nexport interface ElementHighlightByNameSpec extends ElementHighlightByNameOptions {\n type: 'element-highlight-by-name';\n}\n\nexport interface BrushHighlightSpec extends BrushHighlightOptions {\n type: 'brush-highlight';\n}\n\nexport interface BrushActiveSpec extends BrushActiveOptions {\n type: 'brush-active';\n}\n\nexport interface BrushFilterSpec extends BrushFilterOptions {\n type: 'brush-filter';\n}\n\nexport interface LegendFilterSpec extends DataFilterOptions {\n type: 'legend-filter';\n}\n\nexport interface DatazoomFilterSpec extends DataFilterOptions {\n type: 'datazoom-filter';\n}\n\nexport interface SliderFilterSpec extends DataFilterOptions {\n type: 'slider-filter';\n}\n\nexport interface PlayerFilterSpec extends DataFilterOptions {\n type: 'player-filter';\n}\n\nexport interface ScrollbarFilterSpec extends DataFilterOptions {\n type: 'scrollbar-filter';\n}\n\nexport interface DrillDownSpec extends DrillDownOptions {\n type: 'drill-down';\n}\n\nexport interface RollUpSpec extends RollUpOptions {\n type: 'roll-up';\n}\n\nexport interface TooltipSpec extends TooltipOptions {\n type: 'tooltip';\n}\n\nexport interface DimensionTooltipSpec extends DimensionTooltipOptions {\n type: 'dimension-tooltip';\n}\n\nexport interface CrosshairSpec extends CrosshairOptions {\n type: 'crosshair';\n}\nexport interface ViewRoamSpec extends ViewRoamOptions {\n type: 'view-roam';\n}\n\nexport interface ViewZoomSpec extends ViewZoomOptions {\n type: 'view-zoom';\n}\n\nexport interface ViewScrollSpec extends ViewScrollOptions {\n type: 'view-scroll';\n}\n\nexport interface ViewDragSpec extends ViewDragOptions {\n type: 'view-drag';\n}\n\nexport interface SankeyHighlightSpec extends SankeyHighlightOptions {\n type: 'sankey-highlight';\n}\n\nexport interface FishEyeSpec extends FishEyeOptions {\n type: 'fish-eye';\n}\n\nexport interface CustomizedInteractionSpec extends IBaseInteractionOptions {\n type: string;\n}\n\nexport type InteractionSpec =\n | ElementActiveSpec\n | ElementSelectSpec\n | ElementHighlightSpec\n | ElementHighlightByKeySpec\n | ElementHighlightByGroupSpec\n | ElementActiveByLegendSpec\n | ElementHighlightByLegendSpec\n | ElementHighlightByNameSpec\n | BrushHighlightSpec\n | BrushActiveSpec\n | BrushFilterSpec\n | LegendFilterSpec\n | DatazoomFilterSpec\n | SliderFilterSpec\n | PlayerFilterSpec\n | ScrollbarFilterSpec\n | DrillDownSpec\n | RollUpSpec\n | TooltipSpec\n | DimensionTooltipSpec\n | CrosshairSpec\n | ViewRoamSpec\n | ViewZoomSpec\n | ViewScrollSpec\n | ViewDragSpec\n | SankeyHighlightSpec\n | FishEyeSpec\n | CustomizedInteractionSpec;\n\nexport interface ViewNavigationRange {\n needUpdate?: boolean;\n x?: [number, number];\n y?: [number, number];\n}\n\nexport interface IViewZoomMixin {\n updateZoomRange: (\n rangeFactor: [number, number],\n range: [number, number],\n zoomEvent: { zoomDelta: number; zoomX: number; zoomY: number },\n zoomOptions?: ViewZoomSimpleOptions\n ) => [number, number];\n formatZoomEvent: (e: InteractionEvent) => InteractionEvent & { zoomDelta?: number; zoomX?: number; zoomY?: number };\n handleZoomStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n handleZoomEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n handleZoomReset: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IViewScrollMixin {\n formatScrollEvent: (e: InteractionEvent) => InteractionEvent & { scrollX?: number; scrollY?: number };\n handleScrollStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n scrollOptions?: ViewScrollSimpleOptions\n ) => ViewNavigationRange;\n handleScrollEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n scrollOptions?: ViewScrollSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IViewDragMixin {\n handleDragStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n handleDragUpdate: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n handleDragEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IToggleStateMixin {\n updateStates: (\n newStatedElements: (IElement | IGlyphElement)[],\n prevStatedElements?: (IElement | IGlyphElement)[],\n state?: string,\n reverseState?: string\n ) => (IElement | IGlyphElement)[];\n clearAllStates: (state?: string, reverseState?: string) => void;\n}\n\nexport interface ViewStateByDim {\n scale?: IScale;\n data?: IData;\n linkedComponent?: IDatazoom | IScrollbar;\n filterValue?: any[];\n wholeScale?: IBaseScale;\n initRangeFactor?: [number, number];\n getCurrentRange?: () => [number, number];\n rangeFactor?: [number, number];\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/interaction.ts"],"names":[],"mappings":"","file":"interaction.js","sourcesContent":["import type { IView } from './view';\nimport type { EventType, InteractionEvent, ViewEventType } from './event';\nimport type {\n BaseCrosshairAttrs,\n BrushAttributes,\n TooltipAttributes,\n TooltipRowAttrs\n} from '@visactor/vrender-components';\nimport type { IPolygon, ISymbolGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';\nimport type { IElement, IGlyphElement } from './element';\nimport type { IData, IGrammarBase, IMark, IScale } from './grammar';\nimport type { IPointLike } from '@visactor/vutils';\nimport type { IBaseScale } from '@visactor/vscale';\nimport type { IDatazoom, IScrollbar } from './component';\nimport type { FieldEncodeType, MarkFunctionType } from './mark';\n\nexport interface FilterDataTarget {\n data: string | IData;\n filter: string | ((datum: any, filterValues: any[]) => boolean);\n transform?: (data: any[], filterValues: any[]) => any[];\n}\n\nexport interface IBaseInteractionOptions {\n id?: string;\n\n dependency?: string | string[] | IGrammarBase | IGrammarBase[];\n\n shouldStart?: (e: any) => boolean;\n\n shouldUpdate?: (e: any) => boolean;\n\n shouldEnd?: (e: any) => boolean;\n\n shouldReset?: (e: any) => boolean;\n\n onStart?: (e: any) => boolean;\n\n onUpdate?: (e: any) => boolean;\n\n onEnd?: (e: any) => boolean;\n\n onReset?: (e: any) => boolean;\n}\n\nexport interface IInteraction<T = any> {\n readonly options: T;\n readonly type: string;\n depend: (grammar: IGrammarBase[] | IGrammarBase | string[] | string) => void;\n bind: () => void;\n unbind: () => void;\n start: (element: IElement | IGlyphElement | string | any) => void;\n reset: (element?: IElement | IGlyphElement) => void;\n getStartState: () => string;\n}\n\nexport interface IInteractionConstructor<T = any> {\n readonly type: string;\n\n new (view: IView, options?: T): IInteraction<T>;\n}\n\n/**\n * the interaction to set the active state of specified marks\n */\nexport interface ElementActiveOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType | EventType[];\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | EventType[] | 'none';\n /**\n * the active state name\n */\n state?: string;\n}\n\nexport type ElementSelectTriggerOff = EventType | ViewEventType | 'empty' | 'none' | number;\n\n/**\n * the interaction to set the seleted state of specified marks\n */\nexport interface ElementSelectOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType | EventType[];\n /**\n * the selected state name\n */\n state?: string;\n /**\n * the non-selected state name\n */\n reverseState?: string;\n /**\n * the reset trigger event name\n */\n triggerOff?: ElementSelectTriggerOff | ElementSelectTriggerOff[];\n /**\n * whether or not support multiple selected\n */\n isMultiple?: boolean;\n}\n\n/**\n * the interaction to set the highlight state of specified marks\n */\nexport interface ElementHighlightOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface ElementFilterOptions {\n /**\n * the filter type of element\n */\n filterType?: 'key' | 'groupKey';\n /**\n * the field to be filtered\n */\n filterField?: string;\n}\n\n/**\n * the interaction to set the active state of specified marks trigger by legend\n */\nexport interface ElementActiveByLegendOptions extends IBaseInteractionOptions, ElementFilterOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the active state name\n */\n state?: string;\n}\n\n/**\n * the interaction to set the active state of specified marks trigger by legend\n */\nexport interface ElementHighlightByLegendOptions extends IBaseInteractionOptions, ElementFilterOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface ElementHighlightByNameOptions extends ElementHighlightByLegendOptions {\n graphicName?: string | string[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n\n parseData?: (e: InteractionEvent) => any;\n}\n\nexport type ElementHighlightByGraphicNameOptions = ElementHighlightOptions;\n\nexport interface BrushEventParams {\n operateType: string;\n operateMask: IPolygon;\n activeElements?: (IElement | IGlyphElement)[];\n}\n\nexport interface BrushOptions extends IBaseInteractionOptions, BrushAttributes {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n\n onStart?: (params: BrushEventParams) => boolean;\n\n onUpdate?: (params: BrushEventParams) => boolean;\n\n onEnd?: (params: BrushEventParams) => boolean;\n\n onReset?: (params: BrushEventParams) => boolean;\n}\n\nexport interface BrushHighlightOptions extends BrushOptions {\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n}\n\nexport interface BrushActiveOptions extends BrushOptions {\n /**\n * the active state name\n */\n state?: string;\n}\n\nexport interface BrushFilterOptions extends BrushOptions {\n target: {\n data: IData | string;\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface DataFilterOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n source?: string | string[] | IMark | IMark[];\n\n /**\n * data target\n */\n target: {\n data: IData | string;\n filter?: string | ((datum: any, filterValue: any) => boolean);\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface DrillDownOptions extends BrushOptions {\n /**\n * enable brush\n */\n brush?: boolean;\n // trigger attribute is included in brush attributes\n target: {\n data: IData | string;\n transform?: (data: any[], filterValue: any) => any[];\n };\n}\n\nexport interface RollUpOptions extends DataFilterOptions {\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | ViewEventType | 'empty';\n}\n\nexport type CustomTooltipCallback = (\n datum: any,\n element: IElement,\n parameters: any\n) => TooltipRowAttrs | TooltipRowAttrs[];\n\nexport interface ITooltipRow {\n visible?: boolean;\n key?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;\n value?: MarkFunctionType<string | Partial<ITextGraphicAttribute>> | FieldEncodeType;\n symbol?: MarkFunctionType<string | Partial<ISymbolGraphicAttribute>> | FieldEncodeType;\n}\n\nexport type TooltipType = 'x' | 'y' | 'angle' | 'radius';\n\nexport interface TooltipOptions extends IBaseInteractionOptions {\n /**\n * the selector of marks\n */\n selector?: string | string[] | IMark | IMark[];\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n\n title?: ITooltipRow | string | CustomTooltipCallback;\n content?: ITooltipRow | ITooltipRow[] | CustomTooltipCallback;\n attributes?: MarkFunctionType<TooltipAttributes>;\n}\n\nexport interface DimensionTooltipOptions extends TooltipOptions {\n scale?: IScale | string;\n tooltipType?: TooltipType;\n target?: {\n data: IData | string;\n filter: string | ((datum: any, tooltipValue: any) => boolean);\n };\n avoidMark?: string | string[];\n container?: string | IMark;\n center?: IPointLike;\n}\n\nexport type CrosshairType = 'x' | 'y' | 'angle' | 'radius' | 'radius-polygon';\n\nexport type CrosshairShape = 'line' | 'rect';\n\nexport interface CrosshairOptions extends IBaseInteractionOptions {\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n scale?: IScale | string;\n crosshairType?: CrosshairType;\n crosshairShape?: CrosshairShape;\n container?: string | IMark;\n radius?: number;\n center?: IPointLike;\n attributes?: MarkFunctionType<BaseCrosshairAttrs>;\n}\nexport interface ViewNavigationBaseOptions {\n enableX?: boolean;\n enableY?: boolean;\n scaleX?: string | IScale;\n scaleY?: string | IScale;\n dataTargetX?: FilterDataTarget;\n dataTargetY?: FilterDataTarget;\n throttle?: number;\n linkedComponentX?: string | IDatazoom | IScrollbar;\n linkedComponentY?: string | IDatazoom | IScrollbar;\n rangeX?: [number, number] | (() => [number, number]);\n rangeY?: [number, number] | (() => [number, number]);\n}\n\nexport interface ViewZoomSimpleOptions {\n realtime?: boolean;\n rate?: number;\n focus?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n triggerOff?: EventType | 'none';\n}\n\nexport type ViewZoomOptions = ViewZoomSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewScrollSimpleOptions {\n realtime?: boolean;\n reversed?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n}\nexport type ViewScrollOptions = ViewScrollSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewDragSimpleOptions {\n realtime?: boolean;\n reversed?: boolean;\n trigger?: EventType;\n endTrigger?: EventType;\n updateTrigger?: EventType;\n}\n\nexport type ViewDragOptions = ViewDragSimpleOptions & IBaseInteractionOptions & ViewNavigationBaseOptions;\n\nexport interface ViewRoamOptions extends IBaseInteractionOptions, ViewNavigationBaseOptions {\n zoom?: ViewZoomSimpleOptions & { enable?: boolean };\n scroll?: ViewScrollSimpleOptions & { enable?: boolean };\n drag?: ViewDragSimpleOptions & { enable?: boolean };\n}\n\n/**\n * the interaction to set the highlight state of specified marks\n */\nexport interface SankeyHighlightOptions extends IBaseInteractionOptions {\n /**\n * the selector of node mark\n */\n nodeSelector?: string | IMark;\n /**\n * the selector of link mark\n */\n linkSelector?: string | IMark;\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the reset trigger event name\n */\n triggerOff?: EventType | 'none';\n /**\n * the highlight state name\n */\n highlightState?: string;\n /**\n * the blur state name\n */\n blurState?: string;\n /** set highlight state to different type of nodes */\n effect?: 'adjacency' | 'related';\n}\n\nexport interface FishEyeOptions extends IBaseInteractionOptions {\n selector?: string | string[] | IMark | IMark[];\n /** the radius of x-direction */\n radiusX?: number;\n /** the radius of y-direction */\n radiusY?: number;\n /** the radiusRatio of x-direction */\n radiusRatioX?: number;\n /** the radiusRatio of y-direction */\n radiusRatioY?: number;\n /** x方向的扰动 */\n distortionX?: number;\n /** y方向的扰动 */\n distortionY?: number;\n /** 禁用 x方向的变形 */\n enableX?: boolean;\n /** 禁用y方向的变形 */\n enableY?: boolean;\n /** x方向的scale */\n scaleX?: string | IScale;\n /** y方向的scale */\n scaleY?: string | IScale;\n /** 节流的时长,单位为ms */\n throttle?: number;\n /**\n * the trigger event name\n */\n trigger?: EventType;\n /**\n * the trigger event of end\n */\n endTrigger?: EventType;\n /**\n * the trigger event of updating\n */\n updateTrigger?: EventType;\n /**\n * the trigger event of reset\n */\n triggerOff?: string | 'none';\n}\n\nexport interface ElementActiveSpec extends ElementActiveOptions {\n /**\n * 设置交互的类型为 'element-active'\n */\n type: 'element-active';\n}\nexport interface ElementSelectSpec extends ElementSelectOptions {\n /**\n * 设置交互的类型为 'element-select'\n */\n type: 'element-select';\n}\nexport interface ElementHighlightSpec extends ElementHighlightOptions {\n /**\n * 设置交互的类型为 'element-highlight'\n */\n type: 'element-highlight';\n}\nexport interface ElementHighlightByKeySpec extends ElementHighlightOptions {\n /**\n * 设置交互的类型为 'element-highlight-by-key'\n */\n type: 'element-highlight-by-key';\n}\nexport interface ElementHighlightByGroupSpec extends ElementHighlightOptions {\n /**\n * 设置交互的类型为 'element-highlight-by-group'\n */\n type: 'element-highlight-by-group';\n}\nexport interface ElementActiveByLegendSpec extends ElementActiveByLegendOptions {\n /**\n * 设置交互的类型为 'element-active-by-legend'\n */\n type: 'element-active-by-legend';\n}\n\nexport interface ElementHighlightByLegendSpec extends ElementHighlightByLegendOptions {\n /**\n * 设置交互的类型为'element-highlight-by-legend'\n */\n type: 'element-highlight-by-legend';\n}\n\nexport interface ElementHighlightByNameSpec extends ElementHighlightByNameOptions {\n /**\n * 设置交互的类型为'element-highlight-by-name'\n */\n type: 'element-highlight-by-name';\n}\n\nexport interface BrushHighlightSpec extends BrushHighlightOptions {\n /**\n * 设置交互类型为'brush-highlight'\n */\n type: 'brush-highlight';\n}\n\nexport interface BrushActiveSpec extends BrushActiveOptions {\n /**\n * 设置交互类型为 'brush-active'\n */\n type: 'brush-active';\n}\n\nexport interface BrushFilterSpec extends BrushFilterOptions {\n /**\n * 设置交互类型为'brush-filter'\n */\n type: 'brush-filter';\n}\n\nexport interface LegendFilterSpec extends DataFilterOptions {\n type: 'legend-filter';\n}\n\nexport interface DatazoomFilterSpec extends DataFilterOptions {\n type: 'datazoom-filter';\n}\n\nexport interface SliderFilterSpec extends DataFilterOptions {\n type: 'slider-filter';\n}\n\nexport interface PlayerFilterSpec extends DataFilterOptions {\n type: 'player-filter';\n}\n\nexport interface ScrollbarFilterSpec extends DataFilterOptions {\n type: 'scrollbar-filter';\n}\n\nexport interface DrillDownSpec extends DrillDownOptions {\n type: 'drill-down';\n}\n\nexport interface RollUpSpec extends RollUpOptions {\n type: 'roll-up';\n}\n\nexport interface TooltipSpec extends TooltipOptions {\n type: 'tooltip';\n}\n\nexport interface DimensionTooltipSpec extends DimensionTooltipOptions {\n type: 'dimension-tooltip';\n}\n\nexport interface CrosshairSpec extends CrosshairOptions {\n type: 'crosshair';\n}\nexport interface ViewRoamSpec extends ViewRoamOptions {\n type: 'view-roam';\n}\n\nexport interface ViewZoomSpec extends ViewZoomOptions {\n type: 'view-zoom';\n}\n\nexport interface ViewScrollSpec extends ViewScrollOptions {\n type: 'view-scroll';\n}\n\nexport interface ViewDragSpec extends ViewDragOptions {\n type: 'view-drag';\n}\n\nexport interface SankeyHighlightSpec extends SankeyHighlightOptions {\n type: 'sankey-highlight';\n}\n\nexport interface FishEyeSpec extends FishEyeOptions {\n type: 'fish-eye';\n}\n\nexport interface CustomizedInteractionSpec extends IBaseInteractionOptions {\n type: string;\n}\n\nexport type InteractionSpec =\n | ElementActiveSpec\n | ElementSelectSpec\n | ElementHighlightSpec\n | ElementHighlightByKeySpec\n | ElementHighlightByGroupSpec\n | ElementActiveByLegendSpec\n | ElementHighlightByLegendSpec\n | ElementHighlightByNameSpec\n | BrushHighlightSpec\n | BrushActiveSpec\n | BrushFilterSpec\n | LegendFilterSpec\n | DatazoomFilterSpec\n | SliderFilterSpec\n | PlayerFilterSpec\n | ScrollbarFilterSpec\n | DrillDownSpec\n | RollUpSpec\n | TooltipSpec\n | DimensionTooltipSpec\n | CrosshairSpec\n | ViewRoamSpec\n | ViewZoomSpec\n | ViewScrollSpec\n | ViewDragSpec\n | SankeyHighlightSpec\n | FishEyeSpec\n | CustomizedInteractionSpec;\n\nexport interface ViewNavigationRange {\n needUpdate?: boolean;\n x?: [number, number];\n y?: [number, number];\n}\n\nexport interface IViewZoomMixin {\n updateZoomRange: (\n rangeFactor: [number, number],\n range: [number, number],\n zoomEvent: { zoomDelta: number; zoomX: number; zoomY: number },\n zoomOptions?: ViewZoomSimpleOptions\n ) => [number, number];\n formatZoomEvent: (e: InteractionEvent) => InteractionEvent & { zoomDelta?: number; zoomX?: number; zoomY?: number };\n handleZoomStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n handleZoomEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n handleZoomReset: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n zoomOptions?: ViewZoomSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IViewScrollMixin {\n formatScrollEvent: (e: InteractionEvent) => InteractionEvent & { scrollX?: number; scrollY?: number };\n handleScrollStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n scrollOptions?: ViewScrollSimpleOptions\n ) => ViewNavigationRange;\n handleScrollEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n scrollOptions?: ViewScrollSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IViewDragMixin {\n handleDragStart: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n handleDragUpdate: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n handleDragEnd: (\n e: InteractionEvent,\n navState: Partial<Record<'x' | 'y', ViewStateByDim>>,\n dragOptions?: ViewDragSimpleOptions\n ) => ViewNavigationRange;\n}\n\nexport interface IToggleStateMixin {\n updateStates: (\n newStatedElements: (IElement | IGlyphElement)[],\n prevStatedElements?: (IElement | IGlyphElement)[],\n state?: string,\n reverseState?: string\n ) => (IElement | IGlyphElement)[];\n clearAllStates: (state?: string, reverseState?: string) => void;\n}\n\nexport interface ViewStateByDim {\n scale?: IScale;\n data?: IData;\n linkedComponent?: IDatazoom | IScrollbar;\n filterValue?: any[];\n wholeScale?: IBaseScale;\n initRangeFactor?: [number, number];\n getCurrentRange?: () => [number, number];\n rangeFactor?: [number, number];\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vgrammar-core",
|
|
3
|
-
"version": "0.15.4
|
|
3
|
+
"version": "0.15.4",
|
|
4
4
|
"description": "VGrammar is a visual grammar library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"grammar",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@visactor/vutils": "~0.19.3",
|
|
28
28
|
"@visactor/vdataset": "~0.19.3",
|
|
29
|
-
"@visactor/vgrammar-coordinate": "0.15.4
|
|
30
|
-
"@visactor/vgrammar-util": "0.15.4
|
|
29
|
+
"@visactor/vgrammar-coordinate": "0.15.4",
|
|
30
|
+
"@visactor/vgrammar-util": "0.15.4",
|
|
31
31
|
"@visactor/vscale": "~0.19.3",
|
|
32
|
-
"@visactor/vrender-core": "0.21.
|
|
33
|
-
"@visactor/vrender-kits": "0.21.
|
|
34
|
-
"@visactor/vrender-components": "0.21.
|
|
32
|
+
"@visactor/vrender-core": "0.21.10",
|
|
33
|
+
"@visactor/vrender-kits": "0.21.10",
|
|
34
|
+
"@visactor/vrender-components": "0.21.10"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@rushstack/eslint-patch": "~1.1.4",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"@types/jest": "~29.5.0",
|
|
46
46
|
"typescript": "4.9.5",
|
|
47
47
|
"@internal/bundler": "0.0.1",
|
|
48
|
+
"@internal/eslint-config": "0.0.1",
|
|
48
49
|
"@internal/ts-config": "0.0.1",
|
|
49
|
-
"@internal/jest-config": "0.0.1"
|
|
50
|
-
"@internal/eslint-config": "0.0.1"
|
|
50
|
+
"@internal/jest-config": "0.0.1"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public",
|