@visactor/vgrammar-core 0.16.0-imagecloud.2 → 1.0.0-alpha.0

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 CHANGED
@@ -1,4 +1,4 @@
1
- export declare const version = "0.16.0-imagecloud.2";
1
+ export declare const version = "1.0.0-alpha.0";
2
2
  export * from './graph';
3
3
  export * from './interactions';
4
4
  export { View } from './view';
package/cjs/index.js CHANGED
@@ -18,8 +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.16.0-imagecloud.2", __exportStar(require("./graph"), exports),
22
- __exportStar(require("./interactions"), exports);
21
+ exports.version = "1.0.0-alpha.0", __exportStar(require("./graph"), exports), __exportStar(require("./interactions"), exports);
23
22
 
24
23
  var view_1 = require("./view");
25
24
 
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,qBAAqB,CAAC;AAE7C,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.16.0-imagecloud.2\";\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"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,eAAe,CAAC;AAEvC,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 = \"1.0.0-alpha.0\";\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"]}
@@ -8,6 +8,7 @@ import type { IPointLike } from '@visactor/vutils';
8
8
  import type { IBaseScale } from '@visactor/vscale';
9
9
  import type { IDatazoom, IScrollbar } from './component';
10
10
  import type { FieldEncodeType, MarkFunctionType } from './mark';
11
+ import type { GraphicEventType } from '@visactor/vrender-core';
11
12
  export interface FilterDataTarget {
12
13
  data: string | IData;
13
14
  filter: string | ((datum: any, filterValues: any[]) => boolean);
@@ -114,7 +115,8 @@ export interface DataFilterOptions extends IBaseInteractionOptions {
114
115
  transform?: (data: any[], filterValue: any) => any[];
115
116
  };
116
117
  }
117
- export interface DrillDownOptions extends BrushOptions {
118
+ export interface DrillDownOptions extends Omit<BrushOptions, 'trigger'> {
119
+ trigger?: GraphicEventType;
118
120
  brush?: boolean;
119
121
  target: {
120
122
  data: IData | string;
@@ -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 /**\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"]}
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';\nimport type { GraphicEventType } from '@visactor/vrender-core';\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 Omit<BrushOptions, 'trigger'> {\n /**\n * the trigger event name\n */\n trigger?: GraphicEventType;\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
@@ -1,4 +1,4 @@
1
- export declare const version = "0.16.0-imagecloud.2";
1
+ export declare const version = "1.0.0-alpha.0";
2
2
  export * from './graph';
3
3
  export * from './interactions';
4
4
  export { View } from './view';
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const version = "0.16.0-imagecloud.2";
1
+ export const version = "1.0.0-alpha.0";
2
2
 
3
3
  export * from "./graph";
4
4
 
package/es/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAE7C,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.16.0-imagecloud.2\";\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"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC;AAEvC,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 = \"1.0.0-alpha.0\";\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"]}
@@ -96,5 +96,4 @@ export class DimensionTooltip extends BaseTooltip {
96
96
  DimensionTooltip.type = "dimension-tooltip", DimensionTooltip.defaultOptions = {
97
97
  trigger: "pointermove",
98
98
  triggerOff: "pointerleave"
99
- };
100
- //# sourceMappingURL=dimension-tooltip.js.map
99
+ };
@@ -36,4 +36,5 @@ ElementActive.type = "element-active", ElementActive.defaultOptions = {
36
36
  state: InteractionStateEnum.active,
37
37
  trigger: "pointerover",
38
38
  triggerOff: "pointerout"
39
- };
39
+ };
40
+ //# sourceMappingURL=element-active.js.map
@@ -73,4 +73,4 @@ ElementHighlightByName.type = "element-highlight-by-name", ElementHighlightByNam
73
73
  blurState: InteractionStateEnum.blur,
74
74
  filterType: "groupKey"
75
75
  };
76
- //# sourceMappingURL=element-highlight-by-name.js.map
76
+ //# sourceMappingURL=element-highlight-by-name.js.map
@@ -64,4 +64,4 @@ ElementHighlight.type = "element-highlight", ElementHighlight.defaultOptions = {
64
64
  trigger: "pointerover",
65
65
  triggerOff: "pointerout"
66
66
  };
67
- //# sourceMappingURL=element-highlight.js.map
67
+ //# sourceMappingURL=element-highlight.js.map
@@ -17,4 +17,4 @@ export class ElementSelectByGraphicName extends ElementSelect {
17
17
  }
18
18
 
19
19
  ElementSelectByGraphicName.type = "element-select-by-graphic-name";
20
- //# sourceMappingURL=element-select-by-graphic-name.js.map
20
+ //# sourceMappingURL=element-select-by-graphic-name.js.map
@@ -66,4 +66,4 @@ Cell.markType = GrammarMarkType.cell;
66
66
  export const registerCellMark = () => {
67
67
  Factory.registerMark(GrammarMarkType.cell, Cell);
68
68
  };
69
- //# sourceMappingURL=cell.js.map
69
+ //# sourceMappingURL=cell.js.map
@@ -92,4 +92,4 @@ Interval.markType = GrammarMarkType.interval;
92
92
  export const registerIntervalMark = () => {
93
93
  Factory.registerMark(GrammarMarkType.interval, Interval);
94
94
  };
95
- //# sourceMappingURL=interval.js.map
95
+ //# sourceMappingURL=interval.js.map
@@ -15,4 +15,4 @@ export class Text extends Mark {
15
15
  }
16
16
 
17
17
  Text.markType = GrammarMarkType.text;
18
- //# sourceMappingURL=text.js.map
18
+ //# sourceMappingURL=text.js.map
@@ -8,6 +8,7 @@ import type { IPointLike } from '@visactor/vutils';
8
8
  import type { IBaseScale } from '@visactor/vscale';
9
9
  import type { IDatazoom, IScrollbar } from './component';
10
10
  import type { FieldEncodeType, MarkFunctionType } from './mark';
11
+ import type { GraphicEventType } from '@visactor/vrender-core';
11
12
  export interface FilterDataTarget {
12
13
  data: string | IData;
13
14
  filter: string | ((datum: any, filterValues: any[]) => boolean);
@@ -114,7 +115,8 @@ export interface DataFilterOptions extends IBaseInteractionOptions {
114
115
  transform?: (data: any[], filterValue: any) => any[];
115
116
  };
116
117
  }
117
- export interface DrillDownOptions extends BrushOptions {
118
+ export interface DrillDownOptions extends Omit<BrushOptions, 'trigger'> {
119
+ trigger?: GraphicEventType;
118
120
  brush?: boolean;
119
121
  target: {
120
122
  data: IData | string;
@@ -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 /**\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"]}
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';\nimport type { GraphicEventType } from '@visactor/vrender-core';\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 Omit<BrushOptions, 'trigger'> {\n /**\n * the trigger event name\n */\n trigger?: GraphicEventType;\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.16.0-imagecloud.2",
3
+ "version": "1.0.0-alpha.0",
4
4
  "description": "VGrammar is a visual grammar library",
5
5
  "keywords": [
6
6
  "grammar",
@@ -24,14 +24,14 @@
24
24
  "dist"
25
25
  ],
26
26
  "dependencies": {
27
- "@visactor/vutils": "~0.19.3",
28
- "@visactor/vdataset": "~0.19.3",
29
- "@visactor/vgrammar-coordinate": "0.16.0-imagecloud.2",
30
- "@visactor/vgrammar-util": "0.16.0-imagecloud.2",
31
- "@visactor/vscale": "~0.19.3",
32
- "@visactor/vrender-core": "0.21.11",
33
- "@visactor/vrender-kits": "0.21.11",
34
- "@visactor/vrender-components": "0.21.11"
27
+ "@visactor/vutils": "~0.19.4",
28
+ "@visactor/vdataset": "~0.19.4",
29
+ "@visactor/vgrammar-coordinate": "1.0.0-alpha.0",
30
+ "@visactor/vgrammar-util": "1.0.0-alpha.0",
31
+ "@visactor/vscale": "~0.19.4",
32
+ "@visactor/vrender-core": "0.22.4",
33
+ "@visactor/vrender-kits": "0.22.4",
34
+ "@visactor/vrender-components": "0.22.4"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@rushstack/eslint-patch": "~1.1.4",
@@ -44,10 +44,10 @@
44
44
  "ts-jest": "~29.1.0",
45
45
  "@types/jest": "~29.5.0",
46
46
  "typescript": "4.9.5",
47
- "@internal/eslint-config": "0.0.1",
47
+ "@internal/jest-config": "0.0.1",
48
48
  "@internal/bundler": "0.0.1",
49
49
  "@internal/ts-config": "0.0.1",
50
- "@internal/jest-config": "0.0.1"
50
+ "@internal/eslint-config": "0.0.1"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public",