@visactor/vgrammar-core 0.16.0-imagecloud.2 → 0.16.1

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 = "0.16.1";
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 = "0.16.1", __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,QAAQ,CAAC;AAEhC,0CAAwB;AAExB,iDAA+B;AAE/B,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,sCAAoD;AAA3C,8FAAA,KAAK,OAAA;AAAE,sGAAA,aAAa,OAAA;AAC7B,gDAAmE;AAA1D,wGAAA,UAAU,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AACvC,qCAAqE;AAA5D,yGAAA,iBAAiB,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAC9C,oDAAkD;AAAzC,2GAAA,WAAW,OAAA;AACpB,8CAA4B;AAC5B,0CAAwB;AACxB,0CAAyC;AAAhC,kGAAA,OAAO,OAAA;AAChB,8CAQ0B;AAPxB,2GAAA,cAAc,OAAA;AACd,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,+GAAA,kBAAkB,OAAA;AAClB,8GAAA,iBAAiB,OAAA;AACjB,yGAAA,YAAY,OAAA;AACZ,4GAAA,eAAe,OAAA;AAEjB,4DAAgE;AAAvD,yHAAA,qBAAqB,OAAA;AAC9B,4DAA+D;AAAtD,wHAAA,oBAAoB,OAAA;AAE7B,uDAAqD;AAA5C,6GAAA,YAAY,OAAA;AAErB,0CAAwB;AACxB,8CAA4B;AAC5B,+CAA6B;AAC7B,8DAA4C;AAE5C,uDAAiD;AAAxC,uGAAA,OAAO,OAAA;AAChB,wCAAsB;AACtB,iDAA+B;AAC/B,wDAAsC;AACtC,4DAA0C;AAC1C,uDAAqC;AACrC,gDAA+E;AAAtE,+GAAA,qBAAqB,OAAA;AAAE,yGAAA,eAAe,OAAA;AAC/C,sCAA4D;AAAnD,0GAAA,iBAAiB,OAAA;AAAE,kGAAA,SAAS,OAAA;AAErC,yDAA4D;AAC5D,4CAAyC;AAElC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,iBAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,wBAAS,CAAC,CAAC;AACtD,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEK,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,iBAAO,CAAC,wBAAwB,CAAC,SAAS,EAAE,sBAAO,CAAC,CAAC;AACvD,CAAC,CAAC;AAFW,QAAA,qBAAqB,yBAEhC;AAEF,kEAAmE;AACnE,kEAAmE;AAE5D,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,IAAA,2CAAsB,GAAE,CAAC;IACzB,IAAA,2CAAsB,GAAE,CAAC;AAC3B,CAAC,CAAC;AAHW,QAAA,eAAe,mBAG1B","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.16.1\";\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"]}
@@ -75,7 +75,6 @@ export type PlotTreemapEncodeSpec = BasicEncoderSpecMap['rect'];
75
75
  export type PlotCirclePackingEncodeSpec = BasicEncoderSpecMap['circle'];
76
76
  export type PlotWordcloudEncodeSpec = BasicEncoderSpecMap['text'];
77
77
  export type PlotWordcloudShapeEncodeSpec = BasicEncoderSpecMap['text'];
78
- export type PlotImagecloudEncodeSpec = BasicEncoderSpecMap['image'];
79
78
  export type CoordinateOption = CartesianCoordinateOption | PolarCoordinateOption;
80
79
  export type PlotIntervalSpec = Partial<ISemanticMarkSpec<PlotIntervalEncoderSpec, IntervalEncodeChannels>> & {
81
80
  type: 'interval';
@@ -157,7 +156,6 @@ export interface IPlot {
157
156
  rule: () => IRule;
158
157
  wordcloud: () => IWordcloud;
159
158
  wordcloudShape: () => IWordcloudShape;
160
- imagecloud: () => IImagecloud;
161
159
  circlePacking: () => ICirclePacking;
162
160
  treemap: () => ITreemap;
163
161
  tree: () => ITree;
@@ -298,7 +296,6 @@ export type TreemapEncodeChannels = 'node' | 'value' | 'color' | 'stroke';
298
296
  export type CirclepackingEncodeChannels = 'node' | 'value' | 'color' | 'stroke';
299
297
  export type WordcloudEncodeChannels = 'text' | 'color' | 'stroke';
300
298
  export type WordcloudShapeEncodeChannels = 'text' | 'color' | 'stroke';
301
- export type ImagecloudShapeEncodeChannels = 'image' | 'weight';
302
299
  export type IInterval = ISemanticMark<PlotIntervalEncoderSpec, IntervalEncodeChannels>;
303
300
  export type ILine = ISemanticMark<BasicEncoderSpecMap['line'], LineEncodeChannels>;
304
301
  export type ICell = ISemanticMark<BasicEncoderSpecMap['cell'], CellEncodeChannels>;
@@ -321,7 +318,6 @@ export type IWordcloudShape = ISemanticMark<PlotWordcloudShapeEncodeSpec, Wordcl
321
318
  export type ITree = ISemanticMark<PlotTreeEncodeSpec, TreeEncodeChannels>;
322
319
  export type ITreemap = ISemanticMark<PlotTreemapEncodeSpec, TreemapEncodeChannels>;
323
320
  export type ICirclePacking = ISemanticMark<PlotCirclePackingEncodeSpec, CirclepackingEncodeChannels>;
324
- export type IImagecloud = ISemanticMark<PlotImagecloudEncodeSpec, ImagecloudShapeEncodeChannels>;
325
321
  export type PlotMark = IInterval | IRuleX | IRuleY | ICell | ILine | IArea | ISymbol | IText | IRect | IRectX | IRectY | IPolygon | IRule | IImage | IPath | ISankey | ISunburst | ICirclePacking | ITreemap | ITree | IWordcloud | IWordcloudShape;
326
322
  export interface IPlotMarkConstructor {
327
323
  readonly type: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/plot.ts"],"names":[],"mappings":"","file":"plot.js","sourcesContent":["import type {\n AxisBaseAttributes,\n BaseCrosshairAttrs,\n BaseLabelAttrs,\n ColorLegendAttributes,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n GridBaseAttributes,\n PlayerAttributes,\n SizeLegendAttributes,\n SliderAttributes,\n TitleAttrs\n} from '@visactor/vrender-components';\nimport type { CoordinateType } from '@visactor/vgrammar-coordinate';\nimport type { IColor } from '@visactor/vrender-core';\nimport type { IEnvironmentOptions, IRendererOptions, IRunningConfig, ViewSpec, srIOption3DType, IView } from './view';\nimport type { CommonPaddingSpec, ValueOf } from './base';\nimport type { BasicEncoderSpecMap, LinkPathEncoderSpec, MarkRelativeItemSpec } from './mark';\nimport type { BaseEventHandler } from './event';\nimport type { TransformSpec } from './transform';\nimport type { IAnimationConfig } from './animate';\nimport type { ScaleSpec } from './scale';\nimport type { DataSpec } from './data';\nimport type { GridShape } from './component';\n\nexport interface IPlotOptions extends IEnvironmentOptions, IRendererOptions {\n width?: number;\n height?: number;\n padding?: CommonPaddingSpec;\n autoFit?: boolean;\n options3d?: srIOption3DType;\n theme?: string;\n logLevel?: number;\n}\n\nexport interface CartesianCoordinateOption {\n id?: string;\n type: 'cartesian';\n transpose?: boolean;\n}\n\nexport interface PolarCoordinateOption {\n id?: string;\n type: 'polar';\n origin?: [string | number, string | number];\n transpose?: boolean;\n}\n\nexport type PlotIntervalEncoderSpec = Omit<BasicEncoderSpecMap['interval'], 'y'> & {\n y?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'y' | 'x'> & {\n y?: number | number[];\n x?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectXEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'x'> & {\n x?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectYEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'y'> & {\n y?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotAreaEncoderSpec = Omit<BasicEncoderSpecMap['area'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\n\nexport type PlotRuleEncoderSpec = Omit<BasicEncoderSpecMap['rule'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\n\nexport type PlotImageEncoderSpec = Omit<BasicEncoderSpecMap['image'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\nexport type PlotPolygonEncoderSpec = Omit<BasicEncoderSpecMap['polygon'], 'x' | 'y'> & {\n x?: number[];\n y?: number[];\n};\n\nexport type PlotSankeyEncoderSpec = Partial<LinkPathEncoderSpec>;\nexport type PlotSunburstEncodeSpec = BasicEncoderSpecMap['arc'];\nexport type PlotTreeEncodeSpec = BasicEncoderSpecMap['symbol'];\nexport type PlotTreemapEncodeSpec = BasicEncoderSpecMap['rect'];\nexport type PlotCirclePackingEncodeSpec = BasicEncoderSpecMap['circle'];\nexport type PlotWordcloudEncodeSpec = BasicEncoderSpecMap['text'];\nexport type PlotWordcloudShapeEncodeSpec = BasicEncoderSpecMap['text'];\nexport type PlotImagecloudEncodeSpec = BasicEncoderSpecMap['image'];\n\nexport type CoordinateOption = CartesianCoordinateOption | PolarCoordinateOption;\nexport type PlotIntervalSpec = Partial<ISemanticMarkSpec<PlotIntervalEncoderSpec, IntervalEncodeChannels>> & {\n type: 'interval';\n};\nexport type PlotLineSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['line'], LineEncodeChannels>> & {\n type: 'line';\n};\nexport type PlotCellSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['cell'], CellEncodeChannels>> & {\n type: 'cell';\n};\nexport type PlotRuleXSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>> & {\n type: 'ruleX';\n};\nexport type PlotRuleYSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>> & {\n type: 'ruleY';\n};\nexport type PlotAreaSpec = Partial<ISemanticMarkSpec<PlotAreaEncoderSpec, AreaEncodeChannels>> & {\n type: 'area';\n};\nexport type PlotSymbolSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['symbol'], SymbolEncodeChannels>> & {\n type: 'symbol';\n};\nexport type PlotTextSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['text'], TextEncodeChannels>> & {\n type: 'text';\n};\nexport type PlotRectSpec = Partial<ISemanticMarkSpec<PlotRectEncoderSpec, RectEncodeChannels>> & {\n type: 'rect';\n};\nexport type PlotRectXSpec = Partial<ISemanticMarkSpec<PlotRectXEncoderSpec, RectXEncodeChannels>> & {\n type: 'rectX';\n};\nexport type PlotRectYSpec = Partial<ISemanticMarkSpec<PlotRectYEncoderSpec, RectYEncodeChannels>> & {\n type: 'rectY';\n};\nexport type PlotPolygonSpec = Partial<ISemanticMarkSpec<PlotPolygonEncoderSpec, PolygonEncodeChannels>> & {\n type: 'polygon';\n};\nexport type PlotRuleSpec = Partial<ISemanticMarkSpec<PlotRuleEncoderSpec, RuleEncodeChannels>> & {\n type: 'rule';\n};\nexport type PlotImageSpec = Partial<ISemanticMarkSpec<PlotImageEncoderSpec, ImageEncodeChannels>> & {\n type: 'image';\n};\nexport type PlotPathSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['path'], PathEncodeChannels>> & {\n type: 'path';\n};\n\nexport interface PlotSpec {\n background?: IColor;\n width?: number;\n height?: number;\n padding?: number;\n coordinate?: CoordinateOption;\n marks?: Array<\n | PlotIntervalSpec\n | PlotLineSpec\n | PlotCellSpec\n | PlotRuleXSpec\n | PlotRuleYSpec\n | PlotAreaSpec\n | PlotSymbolSpec\n | PlotTextSpec\n | PlotRectSpec\n | PlotRectXSpec\n | PlotRectYSpec\n | PlotPolygonSpec\n | PlotRuleSpec\n | PlotImageSpec\n | PlotPathSpec\n >;\n}\n\nexport interface IPlot {\n readonly view: IView;\n\n theme: (theme: string) => this;\n /**\n * todo: 直接接text图元还是title组件\n */\n // title: (text: ITextAttribute['text'], style: Omit<ITextAttribute, 'text'>) => this;\n coordinate: (type: CoordinateType, option?: Omit<CoordinateOption, 'type'>) => this;\n // interaction: (type: string, options: boolean | any) => this;\n\n // facet: (type: string, options: any) => this;\n\n ///--------- life cycle ---------///\n\n run: (runningConfig?: IRunningConfig) => this;\n release: () => this;\n parseSpec: (spec: PlotSpec) => this;\n updateSpec: (spec: PlotSpec) => this;\n getImageBuffer: () => Buffer;\n\n ///--------- events api ---------///\n on: (type: string, handler: BaseEventHandler) => this;\n off: (type: string, handler?: BaseEventHandler) => this;\n\n ///--------- marks ---------///\n\n interval: () => IInterval;\n cell: () => ICell;\n area: () => IArea;\n image: () => IImage;\n line: () => ILine;\n ruleX: () => IRuleX;\n ruleY: () => IRectY;\n symbol: () => ISymbol;\n polygon: () => IPolygon;\n text: () => IText;\n rect: () => IRect;\n rectX: () => IRectX;\n rectY: () => IRectY;\n rule: () => IRule;\n\n // wordcloud 包如果没注册,会存在问题\n wordcloud: () => IWordcloud;\n wordcloudShape: () => IWordcloudShape;\n // 需要注册 imagecloud 包\n imagecloud: () => IImagecloud;\n circlePacking: () => ICirclePacking;\n treemap: () => ITreemap;\n tree: () => ITree;\n sunburst: () => ISunburst;\n sankey: () => ISankey;\n\n // P2\n // forceGraph: () => ISemanticMark;\n // geoPath: () => ISemanticMark;\n // vector: () => ISemanticMark;\n // shape: () => ISemanticMark;\n // gauge: () => ISemanticMark;\n // heatmap: () => ISemanticMark;\n // density: () => ISemanticMark;\n // boxplot: () => ISemanticMark;\n // box: () => ISemanticMark;\n // contour: () => ISemanticMark;\n\n // observable auto define type by data\n // auto: () => ISemanticMark;\n}\n\nexport interface IPlotConstructor {\n new (options?: IPlotOptions): IPlot;\n}\n\nexport type WithDefaultEncode<T, K extends string> = {\n [Key in K]?: Key extends keyof T ? ISemanticEncodeValue<T[Key]> : ISemanticEncodeValue<string | number>;\n};\nexport type ISemanticEncodeValue<T> = T extends any[]\n ? string[] | ((datum: any) => any)[]\n : string | ((datum: any) => T);\nexport type ISemanticEncodeSpec<T> = {\n [Key in keyof T]?: ISemanticEncodeValue<T[Key]>;\n};\nexport type ISemanticStyle<T, K extends string> = Omit<T, K>;\n\nexport interface SemanticTooltipContentItem {\n key?: ISemanticEncodeValue<string | number>;\n value?: ISemanticEncodeValue<string | number>;\n symbol?: ISemanticEncodeValue<string>;\n}\nexport type SemanticTooltipOption = {\n disableGraphicTooltip?: boolean;\n disableDimensionTooltip?: boolean;\n staticTitle?: string;\n staticContentKey?: string | string[];\n title?: ISemanticEncodeValue<string | number>;\n dimensionTooltipChannel?: 'x' | 'y';\n content?: SemanticTooltipContentItem[];\n};\n\nexport interface SemanticAxisOption extends Partial<AxisBaseAttributes> {\n tickCount?: number;\n}\n\nexport interface SemanticGridOption extends Partial<GridBaseAttributes> {\n type?: GridShape;\n tickCount?: number;\n inside?: boolean;\n baseValue?: number;\n sides?: number;\n}\nexport type SemanticDataZoomOption = Partial<DataZoomAttributes>;\nexport type SemanticSliderOption = Partial<SliderAttributes>;\nexport type SemanticLegendOption = Partial<ColorLegendAttributes | DiscreteLegendAttrs | SizeLegendAttributes>;\nexport type SemanticCrosshairOption = Partial<BaseCrosshairAttrs>;\nexport type SemanticLabelOption = Partial<BaseLabelAttrs>;\nexport type SemanticPlayerOption = Partial<PlayerAttributes>;\nexport type SemanticTitleOption = Partial<TitleAttrs>;\n\nexport interface ISemanticMark<EncodeSpec, K extends string> {\n readonly uid: number;\n readonly type: string;\n data: (values: any, transform?: TransformSpec[], id?: string) => this;\n style: (style: Partial<EncodeSpec & any>) => this;\n encode: (channel: K, option: ValueOf<WithDefaultEncode<EncodeSpec, K>, K>) => this;\n scale: (channel: K, option: Partial<ScaleSpec>) => this;\n transform: (option: TransformSpec[]) => this;\n animate: (state: string, option: IAnimationConfig | IAnimationConfig[]) => this;\n state: (state: string, option: Partial<EncodeSpec>) => this;\n\n axis: (channel: string, option?: SemanticAxisOption | boolean, layout?: MarkRelativeItemSpec) => this;\n legend: (channel: string, option?: SemanticLegendOption | boolean, layout?: MarkRelativeItemSpec) => this;\n crosshair: (channel: string, option?: SemanticCrosshairOption | boolean) => this;\n tooltip: (option: SemanticTooltipOption | boolean) => this;\n coordinate: (option: CoordinateOption) => this;\n grid: (channel: string, option?: SemanticGridOption | boolean) => this;\n title: (option: SemanticTitleOption, layout?: MarkRelativeItemSpec) => this;\n\n slider: (channel: string, option?: SemanticSliderOption | boolean, layout?: MarkRelativeItemSpec) => this;\n datazoom: (channel: string, option?: SemanticDataZoomOption | boolean, layout?: MarkRelativeItemSpec) => this;\n label: (channel: string, option?: SemanticLabelOption | boolean) => this;\n player: (data?: any[], option?: SemanticPlayerOption | boolean, layout?: MarkRelativeItemSpec) => this;\n\n toViewSpec: () => ViewSpec;\n parseSpec: (spec: Partial<ISemanticMarkSpec<EncodeSpec, K>>) => this;\n}\n\nexport interface ISemanticMarkSpec<EncodeSpec, K extends string> {\n id: string | number;\n data?: DataSpec;\n encode?: WithDefaultEncode<EncodeSpec, K>;\n scale?: Partial<Record<K, ScaleSpec>>;\n style?: Partial<EncodeSpec & any>;\n axis?: Partial<\n Record<K, { option?: SemanticAxisOption | boolean; layout?: MarkRelativeItemSpec } | SemanticAxisOption | boolean>\n >;\n grid?: Partial<Record<K, SemanticGridOption | boolean>>;\n transform?: TransformSpec[];\n state?: Record<string, Partial<EncodeSpec>>;\n animation?: Record<string, IAnimationConfig | IAnimationConfig[]>;\n legend?: Record<\n string,\n { option: SemanticLegendOption | boolean; layout?: MarkRelativeItemSpec } | SemanticLegendOption | boolean\n >;\n crosshair?: Record<string, SemanticCrosshairOption | boolean>;\n tooltip?: SemanticTooltipOption | boolean;\n slider?: Record<\n string,\n { option: SemanticSliderOption | boolean; layout?: MarkRelativeItemSpec } | SemanticSliderOption | boolean\n >;\n datazoom?: Record<\n string,\n { option: SemanticDataZoomOption | boolean; layout?: MarkRelativeItemSpec } | SemanticDataZoomOption | boolean\n >;\n label?: Record<string, SemanticLabelOption | boolean>;\n player?: { data?: any[]; option?: SemanticPlayerOption | boolean; layout?: MarkRelativeItemSpec };\n title?: { option?: SemanticTitleOption; layout?: MarkRelativeItemSpec } | SemanticTitleOption;\n}\n\nexport type ParsedSimpleEncode<T, K extends string> = {\n [Key in K]?: {\n field: Key extends keyof T ? ISemanticEncodeValue<T[Key]> : ISemanticEncodeValue<string>;\n scale: string;\n };\n};\n\nexport type SemanticEncodeChannels = 'x' | 'y' | 'group' | 'color';\nexport type IntervalEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type CellEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type LineEncodeChannels = 'x' | 'y' | 'group' | 'color';\nexport type AreaEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type RuleXEncodeChannels = 'x' | 'x' | 'color' | 'group';\nexport type RuleYEncodeChannels = 'x' | 'y' | 'color' | 'group';\nexport type SymbolEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'size' | 'shape' | 'stroke';\nexport type TextEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'text' | 'stroke';\nexport type RectEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'stroke';\nexport type RectXEncodeChannels = 'x' | 'color' | 'group' | 'stroke';\nexport type RectYEncodeChannels = 'y' | 'color' | 'group' | 'stroke';\nexport type PolygonEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'stroke';\nexport type RuleEncodeChannels = 'x' | 'y' | 'color' | 'group';\nexport type ImageEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'src' | 'stroke';\nexport type PathEncodeChannels = 'color' | 'stroke';\nexport type SankeyEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type SunburstEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type TreeEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type TreemapEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type CirclepackingEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type WordcloudEncodeChannels = 'text' | 'color' | 'stroke';\nexport type WordcloudShapeEncodeChannels = 'text' | 'color' | 'stroke';\nexport type ImagecloudShapeEncodeChannels = 'image' | 'weight';\n\nexport type IInterval = ISemanticMark<PlotIntervalEncoderSpec, IntervalEncodeChannels>;\nexport type ILine = ISemanticMark<BasicEncoderSpecMap['line'], LineEncodeChannels>;\nexport type ICell = ISemanticMark<BasicEncoderSpecMap['cell'], CellEncodeChannels>;\nexport type IRuleX = ISemanticMark<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>;\nexport type IRuleY = ISemanticMark<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>;\nexport type IArea = ISemanticMark<PlotAreaEncoderSpec, AreaEncodeChannels>;\nexport type ISymbol = ISemanticMark<BasicEncoderSpecMap['symbol'], SymbolEncodeChannels>;\nexport type IText = ISemanticMark<BasicEncoderSpecMap['text'], TextEncodeChannels>;\nexport type IRect = ISemanticMark<PlotRectEncoderSpec, RectEncodeChannels>;\nexport type IRectX = ISemanticMark<BasicEncoderSpecMap['rect'], RectXEncodeChannels>;\nexport type IRectY = ISemanticMark<BasicEncoderSpecMap['rect'], RectYEncodeChannels>;\nexport type IPolygon = ISemanticMark<PlotPolygonEncoderSpec, PolygonEncodeChannels>;\nexport type IRule = ISemanticMark<BasicEncoderSpecMap['rule'], RuleEncodeChannels>;\nexport type IImage = ISemanticMark<PlotImageEncoderSpec, ImageEncodeChannels>;\nexport type IPath = ISemanticMark<BasicEncoderSpecMap['path'], PathEncodeChannels>;\nexport type ISankey = ISemanticMark<PlotSankeyEncoderSpec, SankeyEncodeChannels>;\nexport type ISunburst = ISemanticMark<PlotSunburstEncodeSpec, SunburstEncodeChannels>;\nexport type IWordcloud = ISemanticMark<PlotWordcloudEncodeSpec, WordcloudEncodeChannels>;\nexport type IWordcloudShape = ISemanticMark<PlotWordcloudShapeEncodeSpec, WordcloudShapeEncodeChannels>;\nexport type ITree = ISemanticMark<PlotTreeEncodeSpec, TreeEncodeChannels>;\nexport type ITreemap = ISemanticMark<PlotTreemapEncodeSpec, TreemapEncodeChannels>;\nexport type ICirclePacking = ISemanticMark<PlotCirclePackingEncodeSpec, CirclepackingEncodeChannels>;\nexport type IImagecloud = ISemanticMark<PlotImagecloudEncodeSpec, ImagecloudShapeEncodeChannels>;\n\nexport type PlotMark =\n | IInterval\n | IRuleX\n | IRuleY\n | ICell\n | ILine\n | IArea\n | ISymbol\n | IText\n | IRect\n | IRectX\n | IRectY\n | IPolygon\n | IRule\n | IImage\n | IPath\n | ISankey\n | ISunburst\n | ICirclePacking\n | ITreemap\n | ITree\n | IWordcloud\n | IWordcloudShape;\n\nexport interface IPlotMarkConstructor {\n readonly type: string;\n\n new (id?: string): PlotMark;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/plot.ts"],"names":[],"mappings":"","file":"plot.js","sourcesContent":["import type {\n AxisBaseAttributes,\n BaseCrosshairAttrs,\n BaseLabelAttrs,\n ColorLegendAttributes,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n GridBaseAttributes,\n PlayerAttributes,\n SizeLegendAttributes,\n SliderAttributes,\n TitleAttrs\n} from '@visactor/vrender-components';\nimport type { CoordinateType } from '@visactor/vgrammar-coordinate';\nimport type { IColor } from '@visactor/vrender-core';\nimport type { IEnvironmentOptions, IRendererOptions, IRunningConfig, ViewSpec, srIOption3DType, IView } from './view';\nimport type { CommonPaddingSpec, ValueOf } from './base';\nimport type { BasicEncoderSpecMap, LinkPathEncoderSpec, MarkRelativeItemSpec } from './mark';\nimport type { BaseEventHandler } from './event';\nimport type { TransformSpec } from './transform';\nimport type { IAnimationConfig } from './animate';\nimport type { ScaleSpec } from './scale';\nimport type { DataSpec } from './data';\nimport type { GridShape } from './component';\n\nexport interface IPlotOptions extends IEnvironmentOptions, IRendererOptions {\n width?: number;\n height?: number;\n padding?: CommonPaddingSpec;\n autoFit?: boolean;\n options3d?: srIOption3DType;\n theme?: string;\n logLevel?: number;\n}\n\nexport interface CartesianCoordinateOption {\n id?: string;\n type: 'cartesian';\n transpose?: boolean;\n}\n\nexport interface PolarCoordinateOption {\n id?: string;\n type: 'polar';\n origin?: [string | number, string | number];\n transpose?: boolean;\n}\n\nexport type PlotIntervalEncoderSpec = Omit<BasicEncoderSpecMap['interval'], 'y'> & {\n y?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'y' | 'x'> & {\n y?: number | number[];\n x?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectXEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'x'> & {\n x?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectYEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'y'> & {\n y?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotAreaEncoderSpec = Omit<BasicEncoderSpecMap['area'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\n\nexport type PlotRuleEncoderSpec = Omit<BasicEncoderSpecMap['rule'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\n\nexport type PlotImageEncoderSpec = Omit<BasicEncoderSpecMap['image'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\nexport type PlotPolygonEncoderSpec = Omit<BasicEncoderSpecMap['polygon'], 'x' | 'y'> & {\n x?: number[];\n y?: number[];\n};\n\nexport type PlotSankeyEncoderSpec = Partial<LinkPathEncoderSpec>;\nexport type PlotSunburstEncodeSpec = BasicEncoderSpecMap['arc'];\nexport type PlotTreeEncodeSpec = BasicEncoderSpecMap['symbol'];\nexport type PlotTreemapEncodeSpec = BasicEncoderSpecMap['rect'];\nexport type PlotCirclePackingEncodeSpec = BasicEncoderSpecMap['circle'];\nexport type PlotWordcloudEncodeSpec = BasicEncoderSpecMap['text'];\nexport type PlotWordcloudShapeEncodeSpec = BasicEncoderSpecMap['text'];\n\nexport type CoordinateOption = CartesianCoordinateOption | PolarCoordinateOption;\nexport type PlotIntervalSpec = Partial<ISemanticMarkSpec<PlotIntervalEncoderSpec, IntervalEncodeChannels>> & {\n type: 'interval';\n};\nexport type PlotLineSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['line'], LineEncodeChannels>> & {\n type: 'line';\n};\nexport type PlotCellSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['cell'], CellEncodeChannels>> & {\n type: 'cell';\n};\nexport type PlotRuleXSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>> & {\n type: 'ruleX';\n};\nexport type PlotRuleYSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>> & {\n type: 'ruleY';\n};\nexport type PlotAreaSpec = Partial<ISemanticMarkSpec<PlotAreaEncoderSpec, AreaEncodeChannels>> & {\n type: 'area';\n};\nexport type PlotSymbolSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['symbol'], SymbolEncodeChannels>> & {\n type: 'symbol';\n};\nexport type PlotTextSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['text'], TextEncodeChannels>> & {\n type: 'text';\n};\nexport type PlotRectSpec = Partial<ISemanticMarkSpec<PlotRectEncoderSpec, RectEncodeChannels>> & {\n type: 'rect';\n};\nexport type PlotRectXSpec = Partial<ISemanticMarkSpec<PlotRectXEncoderSpec, RectXEncodeChannels>> & {\n type: 'rectX';\n};\nexport type PlotRectYSpec = Partial<ISemanticMarkSpec<PlotRectYEncoderSpec, RectYEncodeChannels>> & {\n type: 'rectY';\n};\nexport type PlotPolygonSpec = Partial<ISemanticMarkSpec<PlotPolygonEncoderSpec, PolygonEncodeChannels>> & {\n type: 'polygon';\n};\nexport type PlotRuleSpec = Partial<ISemanticMarkSpec<PlotRuleEncoderSpec, RuleEncodeChannels>> & {\n type: 'rule';\n};\nexport type PlotImageSpec = Partial<ISemanticMarkSpec<PlotImageEncoderSpec, ImageEncodeChannels>> & {\n type: 'image';\n};\nexport type PlotPathSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['path'], PathEncodeChannels>> & {\n type: 'path';\n};\n\nexport interface PlotSpec {\n background?: IColor;\n width?: number;\n height?: number;\n padding?: number;\n coordinate?: CoordinateOption;\n marks?: Array<\n | PlotIntervalSpec\n | PlotLineSpec\n | PlotCellSpec\n | PlotRuleXSpec\n | PlotRuleYSpec\n | PlotAreaSpec\n | PlotSymbolSpec\n | PlotTextSpec\n | PlotRectSpec\n | PlotRectXSpec\n | PlotRectYSpec\n | PlotPolygonSpec\n | PlotRuleSpec\n | PlotImageSpec\n | PlotPathSpec\n >;\n}\n\nexport interface IPlot {\n readonly view: IView;\n\n theme: (theme: string) => this;\n /**\n * todo: 直接接text图元还是title组件\n */\n // title: (text: ITextAttribute['text'], style: Omit<ITextAttribute, 'text'>) => this;\n coordinate: (type: CoordinateType, option?: Omit<CoordinateOption, 'type'>) => this;\n // interaction: (type: string, options: boolean | any) => this;\n\n // facet: (type: string, options: any) => this;\n\n ///--------- life cycle ---------///\n\n run: (runningConfig?: IRunningConfig) => this;\n release: () => this;\n parseSpec: (spec: PlotSpec) => this;\n updateSpec: (spec: PlotSpec) => this;\n getImageBuffer: () => Buffer;\n\n ///--------- events api ---------///\n on: (type: string, handler: BaseEventHandler) => this;\n off: (type: string, handler?: BaseEventHandler) => this;\n\n ///--------- marks ---------///\n\n interval: () => IInterval;\n cell: () => ICell;\n area: () => IArea;\n image: () => IImage;\n line: () => ILine;\n ruleX: () => IRuleX;\n ruleY: () => IRectY;\n symbol: () => ISymbol;\n polygon: () => IPolygon;\n text: () => IText;\n rect: () => IRect;\n rectX: () => IRectX;\n rectY: () => IRectY;\n rule: () => IRule;\n\n // wordcloud 包如果没注册,会存在问题\n wordcloud: () => IWordcloud;\n wordcloudShape: () => IWordcloudShape;\n circlePacking: () => ICirclePacking;\n treemap: () => ITreemap;\n tree: () => ITree;\n sunburst: () => ISunburst;\n sankey: () => ISankey;\n\n // P2\n // forceGraph: () => ISemanticMark;\n // geoPath: () => ISemanticMark;\n // vector: () => ISemanticMark;\n // shape: () => ISemanticMark;\n // gauge: () => ISemanticMark;\n // heatmap: () => ISemanticMark;\n // density: () => ISemanticMark;\n // boxplot: () => ISemanticMark;\n // box: () => ISemanticMark;\n // contour: () => ISemanticMark;\n\n // observable auto define type by data\n // auto: () => ISemanticMark;\n}\n\nexport interface IPlotConstructor {\n new (options?: IPlotOptions): IPlot;\n}\n\nexport type WithDefaultEncode<T, K extends string> = {\n [Key in K]?: Key extends keyof T ? ISemanticEncodeValue<T[Key]> : ISemanticEncodeValue<string | number>;\n};\nexport type ISemanticEncodeValue<T> = T extends any[]\n ? string[] | ((datum: any) => any)[]\n : string | ((datum: any) => T);\nexport type ISemanticEncodeSpec<T> = {\n [Key in keyof T]?: ISemanticEncodeValue<T[Key]>;\n};\nexport type ISemanticStyle<T, K extends string> = Omit<T, K>;\n\nexport interface SemanticTooltipContentItem {\n key?: ISemanticEncodeValue<string | number>;\n value?: ISemanticEncodeValue<string | number>;\n symbol?: ISemanticEncodeValue<string>;\n}\nexport type SemanticTooltipOption = {\n disableGraphicTooltip?: boolean;\n disableDimensionTooltip?: boolean;\n staticTitle?: string;\n staticContentKey?: string | string[];\n title?: ISemanticEncodeValue<string | number>;\n dimensionTooltipChannel?: 'x' | 'y';\n content?: SemanticTooltipContentItem[];\n};\n\nexport interface SemanticAxisOption extends Partial<AxisBaseAttributes> {\n tickCount?: number;\n}\n\nexport interface SemanticGridOption extends Partial<GridBaseAttributes> {\n type?: GridShape;\n tickCount?: number;\n inside?: boolean;\n baseValue?: number;\n sides?: number;\n}\nexport type SemanticDataZoomOption = Partial<DataZoomAttributes>;\nexport type SemanticSliderOption = Partial<SliderAttributes>;\nexport type SemanticLegendOption = Partial<ColorLegendAttributes | DiscreteLegendAttrs | SizeLegendAttributes>;\nexport type SemanticCrosshairOption = Partial<BaseCrosshairAttrs>;\nexport type SemanticLabelOption = Partial<BaseLabelAttrs>;\nexport type SemanticPlayerOption = Partial<PlayerAttributes>;\nexport type SemanticTitleOption = Partial<TitleAttrs>;\n\nexport interface ISemanticMark<EncodeSpec, K extends string> {\n readonly uid: number;\n readonly type: string;\n data: (values: any, transform?: TransformSpec[], id?: string) => this;\n style: (style: Partial<EncodeSpec & any>) => this;\n encode: (channel: K, option: ValueOf<WithDefaultEncode<EncodeSpec, K>, K>) => this;\n scale: (channel: K, option: Partial<ScaleSpec>) => this;\n transform: (option: TransformSpec[]) => this;\n animate: (state: string, option: IAnimationConfig | IAnimationConfig[]) => this;\n state: (state: string, option: Partial<EncodeSpec>) => this;\n\n axis: (channel: string, option?: SemanticAxisOption | boolean, layout?: MarkRelativeItemSpec) => this;\n legend: (channel: string, option?: SemanticLegendOption | boolean, layout?: MarkRelativeItemSpec) => this;\n crosshair: (channel: string, option?: SemanticCrosshairOption | boolean) => this;\n tooltip: (option: SemanticTooltipOption | boolean) => this;\n coordinate: (option: CoordinateOption) => this;\n grid: (channel: string, option?: SemanticGridOption | boolean) => this;\n title: (option: SemanticTitleOption, layout?: MarkRelativeItemSpec) => this;\n\n slider: (channel: string, option?: SemanticSliderOption | boolean, layout?: MarkRelativeItemSpec) => this;\n datazoom: (channel: string, option?: SemanticDataZoomOption | boolean, layout?: MarkRelativeItemSpec) => this;\n label: (channel: string, option?: SemanticLabelOption | boolean) => this;\n player: (data?: any[], option?: SemanticPlayerOption | boolean, layout?: MarkRelativeItemSpec) => this;\n\n toViewSpec: () => ViewSpec;\n parseSpec: (spec: Partial<ISemanticMarkSpec<EncodeSpec, K>>) => this;\n}\n\nexport interface ISemanticMarkSpec<EncodeSpec, K extends string> {\n id: string | number;\n data?: DataSpec;\n encode?: WithDefaultEncode<EncodeSpec, K>;\n scale?: Partial<Record<K, ScaleSpec>>;\n style?: Partial<EncodeSpec & any>;\n axis?: Partial<\n Record<K, { option?: SemanticAxisOption | boolean; layout?: MarkRelativeItemSpec } | SemanticAxisOption | boolean>\n >;\n grid?: Partial<Record<K, SemanticGridOption | boolean>>;\n transform?: TransformSpec[];\n state?: Record<string, Partial<EncodeSpec>>;\n animation?: Record<string, IAnimationConfig | IAnimationConfig[]>;\n legend?: Record<\n string,\n { option: SemanticLegendOption | boolean; layout?: MarkRelativeItemSpec } | SemanticLegendOption | boolean\n >;\n crosshair?: Record<string, SemanticCrosshairOption | boolean>;\n tooltip?: SemanticTooltipOption | boolean;\n slider?: Record<\n string,\n { option: SemanticSliderOption | boolean; layout?: MarkRelativeItemSpec } | SemanticSliderOption | boolean\n >;\n datazoom?: Record<\n string,\n { option: SemanticDataZoomOption | boolean; layout?: MarkRelativeItemSpec } | SemanticDataZoomOption | boolean\n >;\n label?: Record<string, SemanticLabelOption | boolean>;\n player?: { data?: any[]; option?: SemanticPlayerOption | boolean; layout?: MarkRelativeItemSpec };\n title?: { option?: SemanticTitleOption; layout?: MarkRelativeItemSpec } | SemanticTitleOption;\n}\n\nexport type ParsedSimpleEncode<T, K extends string> = {\n [Key in K]?: {\n field: Key extends keyof T ? ISemanticEncodeValue<T[Key]> : ISemanticEncodeValue<string>;\n scale: string;\n };\n};\n\nexport type SemanticEncodeChannels = 'x' | 'y' | 'group' | 'color';\nexport type IntervalEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type CellEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type LineEncodeChannels = 'x' | 'y' | 'group' | 'color';\nexport type AreaEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type RuleXEncodeChannels = 'x' | 'x' | 'color' | 'group';\nexport type RuleYEncodeChannels = 'x' | 'y' | 'color' | 'group';\nexport type SymbolEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'size' | 'shape' | 'stroke';\nexport type TextEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'text' | 'stroke';\nexport type RectEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'stroke';\nexport type RectXEncodeChannels = 'x' | 'color' | 'group' | 'stroke';\nexport type RectYEncodeChannels = 'y' | 'color' | 'group' | 'stroke';\nexport type PolygonEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'stroke';\nexport type RuleEncodeChannels = 'x' | 'y' | 'color' | 'group';\nexport type ImageEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'src' | 'stroke';\nexport type PathEncodeChannels = 'color' | 'stroke';\nexport type SankeyEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type SunburstEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type TreeEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type TreemapEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type CirclepackingEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type WordcloudEncodeChannels = 'text' | 'color' | 'stroke';\nexport type WordcloudShapeEncodeChannels = 'text' | 'color' | 'stroke';\n\nexport type IInterval = ISemanticMark<PlotIntervalEncoderSpec, IntervalEncodeChannels>;\nexport type ILine = ISemanticMark<BasicEncoderSpecMap['line'], LineEncodeChannels>;\nexport type ICell = ISemanticMark<BasicEncoderSpecMap['cell'], CellEncodeChannels>;\nexport type IRuleX = ISemanticMark<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>;\nexport type IRuleY = ISemanticMark<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>;\nexport type IArea = ISemanticMark<PlotAreaEncoderSpec, AreaEncodeChannels>;\nexport type ISymbol = ISemanticMark<BasicEncoderSpecMap['symbol'], SymbolEncodeChannels>;\nexport type IText = ISemanticMark<BasicEncoderSpecMap['text'], TextEncodeChannels>;\nexport type IRect = ISemanticMark<PlotRectEncoderSpec, RectEncodeChannels>;\nexport type IRectX = ISemanticMark<BasicEncoderSpecMap['rect'], RectXEncodeChannels>;\nexport type IRectY = ISemanticMark<BasicEncoderSpecMap['rect'], RectYEncodeChannels>;\nexport type IPolygon = ISemanticMark<PlotPolygonEncoderSpec, PolygonEncodeChannels>;\nexport type IRule = ISemanticMark<BasicEncoderSpecMap['rule'], RuleEncodeChannels>;\nexport type IImage = ISemanticMark<PlotImageEncoderSpec, ImageEncodeChannels>;\nexport type IPath = ISemanticMark<BasicEncoderSpecMap['path'], PathEncodeChannels>;\nexport type ISankey = ISemanticMark<PlotSankeyEncoderSpec, SankeyEncodeChannels>;\nexport type ISunburst = ISemanticMark<PlotSunburstEncodeSpec, SunburstEncodeChannels>;\nexport type IWordcloud = ISemanticMark<PlotWordcloudEncodeSpec, WordcloudEncodeChannels>;\nexport type IWordcloudShape = ISemanticMark<PlotWordcloudShapeEncodeSpec, WordcloudShapeEncodeChannels>;\nexport type ITree = ISemanticMark<PlotTreeEncodeSpec, TreeEncodeChannels>;\nexport type ITreemap = ISemanticMark<PlotTreemapEncodeSpec, TreemapEncodeChannels>;\nexport type ICirclePacking = ISemanticMark<PlotCirclePackingEncodeSpec, CirclepackingEncodeChannels>;\n\nexport type PlotMark =\n | IInterval\n | IRuleX\n | IRuleY\n | ICell\n | ILine\n | IArea\n | ISymbol\n | IText\n | IRect\n | IRectX\n | IRectY\n | IPolygon\n | IRule\n | IImage\n | IPath\n | ISankey\n | ISunburst\n | ICirclePacking\n | ITreemap\n | ITree\n | IWordcloud\n | IWordcloudShape;\n\nexport interface IPlotMarkConstructor {\n readonly type: string;\n\n new (id?: string): PlotMark;\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 = "0.16.1";
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 = "0.16.1";
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,QAAQ,CAAC;AAEhC,cAAc,SAAS,CAAC;AAExB,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACtD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,OAAO,CAAC,wBAAwB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,sBAAsB,EAAE,CAAC;IACzB,sBAAsB,EAAE,CAAC;AAC3B,CAAC,CAAC","file":"index.js","sourcesContent":["// -- Exports -----\nexport const version = \"0.16.1\";\n\nexport * from './graph';\n\nexport * from './interactions';\n\nexport { View } from './view';\nexport { Scale, registerScale } from './view/scale';\nexport { Coordinate, registerCoordinate } from './view/coordinate';\nexport { parseFunctionType, invokeFunctionType } from './parse/util';\nexport { GrammarBase } from './view/grammar-base';\nexport * from './util/text';\nexport * from './types';\nexport { Factory } from './core/factory';\nexport {\n SIGNAL_AUTOFIT,\n SIGNAL_HEIGHT,\n SIGNAL_PADDING,\n SIGNAL_VIEW_HEIGHT,\n SIGNAL_VIEW_WIDTH,\n SIGNAL_WIDTH,\n SIGNAL_VIEW_BOX\n} from './view/constants';\nexport { registerViewEventsAPI } from './view/view-event-mixin';\nexport { registerViewMorphAPI } from './view/view-morph-mixin';\n\nexport { ThemeManager } from './theme/theme-manager';\n\nexport * from './glyph';\nexport * from './component';\nexport * from './transforms';\nexport * from './graph/animation/animation';\n\nexport { vglobal } from '@visactor/vrender-core';\nexport * from './env';\nexport * from './interactions';\nexport * from './semantic-marks/cell';\nexport * from './semantic-marks/interval';\nexport * from './graph/mark/graphic';\nexport { registerDefaultLayout, defaultDoLayout } from './graph/layout/layout';\nexport { registerGlyphMark, GlyphMark } from './view/glyph';\n\nimport { DragNDrop, Gesture } from '@visactor/vrender-kits';\nimport { Factory } from './core/factory';\n\nexport const registerDragPlugin = () => {\n Factory.registerStageEventPlugin('drag', DragNDrop);\n};\n\nexport const registerGesturePlugin = () => {\n Factory.registerStageEventPlugin('gesture', Gesture);\n};\n\nimport { registerViewAnimateAPI } from './view/view-animate-mixin';\nimport { registerMarkAnimateAPI } from './view/mark-animate-mixin';\n\nexport const registerAnimate = () => {\n registerViewAnimateAPI();\n registerMarkAnimateAPI();\n};\n"]}
@@ -101,5 +101,4 @@ export class BrushBase extends BaseInteraction {
101
101
  };
102
102
  event.type === IOperateType.drawStart || event.type === IOperateType.moveStart ? this.dispatchEvent("start", params) : event.type === IOperateType.drawing || event.type === IOperateType.moving ? this.dispatchEvent("update", params) : event.type === IOperateType.drawEnd || event.type === IOperateType.moveEnd ? this.dispatchEvent("end", params) : this.dispatchEvent("reset", params);
103
103
  }
104
- }
105
- //# sourceMappingURL=brush-base.js.map
104
+ }
@@ -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
@@ -62,5 +62,4 @@ export class ElementSelect extends BaseInteraction {
62
62
  ElementSelect.type = "element-select", ElementSelect.defaultOptions = {
63
63
  state: InteractionStateEnum.selected,
64
64
  trigger: "click"
65
- };
66
- //# sourceMappingURL=element-select.js.map
65
+ };
@@ -28,4 +28,4 @@ export class Filter extends BaseInteraction {
28
28
  }
29
29
 
30
30
  Filter.defaultOptions = {};
31
- //# sourceMappingURL=filter.js.map
31
+ //# sourceMappingURL=filter.js.map
@@ -96,4 +96,4 @@ FishEye.type = "fish-eye", FishEye.defaultOptions = {
96
96
  distortionY: 2,
97
97
  throttle: 100
98
98
  };
99
- //# sourceMappingURL=fish-eye.js.map
99
+ //# sourceMappingURL=fish-eye.js.map
@@ -160,4 +160,4 @@ export const registerViewRoam = () => {
160
160
  export const registerFishEye = () => {
161
161
  Factory.registerInteraction(FishEye.type, FishEye);
162
162
  };
163
- //# sourceMappingURL=index.js.map
163
+ //# sourceMappingURL=index.js.map
@@ -29,4 +29,4 @@ export class LegendFilter extends Filter {
29
29
  }
30
30
 
31
31
  LegendFilter.type = "legend-filter", LegendFilter.defaultOptions = {};
32
- //# sourceMappingURL=legend-filter.js.map
32
+ //# sourceMappingURL=legend-filter.js.map
@@ -29,4 +29,4 @@ export class PlayerFilter extends Filter {
29
29
  }
30
30
 
31
31
  PlayerFilter.type = "player-filter", PlayerFilter.defaultOptions = {};
32
- //# sourceMappingURL=player-filter.js.map
32
+ //# sourceMappingURL=player-filter.js.map
@@ -42,4 +42,4 @@ RollUp.type = "roll-up", RollUp.defaultOptions = {
42
42
  trigger: "click",
43
43
  triggerOff: "empty"
44
44
  };
45
- //# sourceMappingURL=roll-up.js.map
45
+ //# sourceMappingURL=roll-up.js.map
@@ -50,4 +50,4 @@ export class ScrollbarFilter extends Filter {
50
50
  }
51
51
 
52
52
  ScrollbarFilter.type = "scrollbar-filter", ScrollbarFilter.defaultOptions = {};
53
- //# sourceMappingURL=scrollbar-filter.js.map
53
+ //# sourceMappingURL=scrollbar-filter.js.map
@@ -62,4 +62,4 @@ export function configureCoordinate(spec, coordinate, parameters) {
62
62
  }
63
63
  coordinate.applyTransforms(transforms);
64
64
  }
65
- //# sourceMappingURL=coordinate.js.map
65
+ //# sourceMappingURL=coordinate.js.map
package/es/parse/event.js CHANGED
@@ -20,4 +20,4 @@ export const parseEventSelector = (selector, source = EVENT_SOURCE_VIEW) => {
20
20
  } else 1 === splitArr.length && (spec.type = selector, spec.source = source);
21
21
  return spec;
22
22
  };
23
- //# sourceMappingURL=event.js.map
23
+ //# sourceMappingURL=event.js.map
package/es/parse/mark.js CHANGED
@@ -16,4 +16,4 @@ export function parseEncodeType(encoder, view) {
16
16
  return encoder.scale && (dependencies = isGrammar(encoder.scale) ? [ encoder.scale ] : array(view.getScaleById(encoder.scale))),
17
17
  dependencies.concat(parseFunctionType(encoder, view));
18
18
  }
19
- //# sourceMappingURL=mark.js.map
19
+ //# sourceMappingURL=mark.js.map
@@ -7,4 +7,5 @@ export const parseOptionValue = (value, params) => isGrammar(value) ? value.outp
7
7
  export const parseOptions = (options, params) => options ? isObject(options) ? Object.keys(options).reduce(((res, key) => {
8
8
  const option = options[key];
9
9
  return res[key] = parseOptionValue(option, params), res;
10
- }), {}) : options.map((option => parseOptionValue(option, params))) : options;
10
+ }), {}) : options.map((option => parseOptionValue(option, params))) : options;
11
+ //# sourceMappingURL=option.js.map
package/es/parse/scale.js CHANGED
@@ -344,4 +344,4 @@ export function configureScale(spec, scale, parameters) {
344
344
  scale.rescale();
345
345
  }
346
346
  }
347
- //# sourceMappingURL=scale.js.map
347
+ //# sourceMappingURL=scale.js.map
@@ -99,4 +99,4 @@ export const parseTransformSpec = (spec, view) => {
99
99
  }
100
100
  return null;
101
101
  };
102
- //# sourceMappingURL=transform.js.map
102
+ //# sourceMappingURL=transform.js.map
package/es/parse/util.js CHANGED
@@ -62,4 +62,4 @@ export const isGrammar = el => el && !isNil(el.grammarType);
62
62
  export const parseField = field => isFunction(field) ? field : datum => datum[field];
63
63
 
64
64
  export const parseColor = color => isString(color) && Color.parseColorString(color) ? color : null;
65
- //# sourceMappingURL=util.js.map
65
+ //# sourceMappingURL=util.js.map
package/es/parse/view.js CHANGED
@@ -96,4 +96,4 @@ export const normalizeRunningConfig = runningConfig => {
96
96
  enableExitAnimation: enableExitAnimation
97
97
  };
98
98
  };
99
- //# sourceMappingURL=view.js.map
99
+ //# sourceMappingURL=view.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"]}
@@ -75,7 +75,6 @@ export type PlotTreemapEncodeSpec = BasicEncoderSpecMap['rect'];
75
75
  export type PlotCirclePackingEncodeSpec = BasicEncoderSpecMap['circle'];
76
76
  export type PlotWordcloudEncodeSpec = BasicEncoderSpecMap['text'];
77
77
  export type PlotWordcloudShapeEncodeSpec = BasicEncoderSpecMap['text'];
78
- export type PlotImagecloudEncodeSpec = BasicEncoderSpecMap['image'];
79
78
  export type CoordinateOption = CartesianCoordinateOption | PolarCoordinateOption;
80
79
  export type PlotIntervalSpec = Partial<ISemanticMarkSpec<PlotIntervalEncoderSpec, IntervalEncodeChannels>> & {
81
80
  type: 'interval';
@@ -157,7 +156,6 @@ export interface IPlot {
157
156
  rule: () => IRule;
158
157
  wordcloud: () => IWordcloud;
159
158
  wordcloudShape: () => IWordcloudShape;
160
- imagecloud: () => IImagecloud;
161
159
  circlePacking: () => ICirclePacking;
162
160
  treemap: () => ITreemap;
163
161
  tree: () => ITree;
@@ -298,7 +296,6 @@ export type TreemapEncodeChannels = 'node' | 'value' | 'color' | 'stroke';
298
296
  export type CirclepackingEncodeChannels = 'node' | 'value' | 'color' | 'stroke';
299
297
  export type WordcloudEncodeChannels = 'text' | 'color' | 'stroke';
300
298
  export type WordcloudShapeEncodeChannels = 'text' | 'color' | 'stroke';
301
- export type ImagecloudShapeEncodeChannels = 'image' | 'weight';
302
299
  export type IInterval = ISemanticMark<PlotIntervalEncoderSpec, IntervalEncodeChannels>;
303
300
  export type ILine = ISemanticMark<BasicEncoderSpecMap['line'], LineEncodeChannels>;
304
301
  export type ICell = ISemanticMark<BasicEncoderSpecMap['cell'], CellEncodeChannels>;
@@ -321,7 +318,6 @@ export type IWordcloudShape = ISemanticMark<PlotWordcloudShapeEncodeSpec, Wordcl
321
318
  export type ITree = ISemanticMark<PlotTreeEncodeSpec, TreeEncodeChannels>;
322
319
  export type ITreemap = ISemanticMark<PlotTreemapEncodeSpec, TreemapEncodeChannels>;
323
320
  export type ICirclePacking = ISemanticMark<PlotCirclePackingEncodeSpec, CirclepackingEncodeChannels>;
324
- export type IImagecloud = ISemanticMark<PlotImagecloudEncodeSpec, ImagecloudShapeEncodeChannels>;
325
321
  export type PlotMark = IInterval | IRuleX | IRuleY | ICell | ILine | IArea | ISymbol | IText | IRect | IRectX | IRectY | IPolygon | IRule | IImage | IPath | ISankey | ISunburst | ICirclePacking | ITreemap | ITree | IWordcloud | IWordcloudShape;
326
322
  export interface IPlotMarkConstructor {
327
323
  readonly type: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/plot.ts"],"names":[],"mappings":"","file":"plot.js","sourcesContent":["import type {\n AxisBaseAttributes,\n BaseCrosshairAttrs,\n BaseLabelAttrs,\n ColorLegendAttributes,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n GridBaseAttributes,\n PlayerAttributes,\n SizeLegendAttributes,\n SliderAttributes,\n TitleAttrs\n} from '@visactor/vrender-components';\nimport type { CoordinateType } from '@visactor/vgrammar-coordinate';\nimport type { IColor } from '@visactor/vrender-core';\nimport type { IEnvironmentOptions, IRendererOptions, IRunningConfig, ViewSpec, srIOption3DType, IView } from './view';\nimport type { CommonPaddingSpec, ValueOf } from './base';\nimport type { BasicEncoderSpecMap, LinkPathEncoderSpec, MarkRelativeItemSpec } from './mark';\nimport type { BaseEventHandler } from './event';\nimport type { TransformSpec } from './transform';\nimport type { IAnimationConfig } from './animate';\nimport type { ScaleSpec } from './scale';\nimport type { DataSpec } from './data';\nimport type { GridShape } from './component';\n\nexport interface IPlotOptions extends IEnvironmentOptions, IRendererOptions {\n width?: number;\n height?: number;\n padding?: CommonPaddingSpec;\n autoFit?: boolean;\n options3d?: srIOption3DType;\n theme?: string;\n logLevel?: number;\n}\n\nexport interface CartesianCoordinateOption {\n id?: string;\n type: 'cartesian';\n transpose?: boolean;\n}\n\nexport interface PolarCoordinateOption {\n id?: string;\n type: 'polar';\n origin?: [string | number, string | number];\n transpose?: boolean;\n}\n\nexport type PlotIntervalEncoderSpec = Omit<BasicEncoderSpecMap['interval'], 'y'> & {\n y?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'y' | 'x'> & {\n y?: number | number[];\n x?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectXEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'x'> & {\n x?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectYEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'y'> & {\n y?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotAreaEncoderSpec = Omit<BasicEncoderSpecMap['area'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\n\nexport type PlotRuleEncoderSpec = Omit<BasicEncoderSpecMap['rule'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\n\nexport type PlotImageEncoderSpec = Omit<BasicEncoderSpecMap['image'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\nexport type PlotPolygonEncoderSpec = Omit<BasicEncoderSpecMap['polygon'], 'x' | 'y'> & {\n x?: number[];\n y?: number[];\n};\n\nexport type PlotSankeyEncoderSpec = Partial<LinkPathEncoderSpec>;\nexport type PlotSunburstEncodeSpec = BasicEncoderSpecMap['arc'];\nexport type PlotTreeEncodeSpec = BasicEncoderSpecMap['symbol'];\nexport type PlotTreemapEncodeSpec = BasicEncoderSpecMap['rect'];\nexport type PlotCirclePackingEncodeSpec = BasicEncoderSpecMap['circle'];\nexport type PlotWordcloudEncodeSpec = BasicEncoderSpecMap['text'];\nexport type PlotWordcloudShapeEncodeSpec = BasicEncoderSpecMap['text'];\nexport type PlotImagecloudEncodeSpec = BasicEncoderSpecMap['image'];\n\nexport type CoordinateOption = CartesianCoordinateOption | PolarCoordinateOption;\nexport type PlotIntervalSpec = Partial<ISemanticMarkSpec<PlotIntervalEncoderSpec, IntervalEncodeChannels>> & {\n type: 'interval';\n};\nexport type PlotLineSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['line'], LineEncodeChannels>> & {\n type: 'line';\n};\nexport type PlotCellSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['cell'], CellEncodeChannels>> & {\n type: 'cell';\n};\nexport type PlotRuleXSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>> & {\n type: 'ruleX';\n};\nexport type PlotRuleYSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>> & {\n type: 'ruleY';\n};\nexport type PlotAreaSpec = Partial<ISemanticMarkSpec<PlotAreaEncoderSpec, AreaEncodeChannels>> & {\n type: 'area';\n};\nexport type PlotSymbolSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['symbol'], SymbolEncodeChannels>> & {\n type: 'symbol';\n};\nexport type PlotTextSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['text'], TextEncodeChannels>> & {\n type: 'text';\n};\nexport type PlotRectSpec = Partial<ISemanticMarkSpec<PlotRectEncoderSpec, RectEncodeChannels>> & {\n type: 'rect';\n};\nexport type PlotRectXSpec = Partial<ISemanticMarkSpec<PlotRectXEncoderSpec, RectXEncodeChannels>> & {\n type: 'rectX';\n};\nexport type PlotRectYSpec = Partial<ISemanticMarkSpec<PlotRectYEncoderSpec, RectYEncodeChannels>> & {\n type: 'rectY';\n};\nexport type PlotPolygonSpec = Partial<ISemanticMarkSpec<PlotPolygonEncoderSpec, PolygonEncodeChannels>> & {\n type: 'polygon';\n};\nexport type PlotRuleSpec = Partial<ISemanticMarkSpec<PlotRuleEncoderSpec, RuleEncodeChannels>> & {\n type: 'rule';\n};\nexport type PlotImageSpec = Partial<ISemanticMarkSpec<PlotImageEncoderSpec, ImageEncodeChannels>> & {\n type: 'image';\n};\nexport type PlotPathSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['path'], PathEncodeChannels>> & {\n type: 'path';\n};\n\nexport interface PlotSpec {\n background?: IColor;\n width?: number;\n height?: number;\n padding?: number;\n coordinate?: CoordinateOption;\n marks?: Array<\n | PlotIntervalSpec\n | PlotLineSpec\n | PlotCellSpec\n | PlotRuleXSpec\n | PlotRuleYSpec\n | PlotAreaSpec\n | PlotSymbolSpec\n | PlotTextSpec\n | PlotRectSpec\n | PlotRectXSpec\n | PlotRectYSpec\n | PlotPolygonSpec\n | PlotRuleSpec\n | PlotImageSpec\n | PlotPathSpec\n >;\n}\n\nexport interface IPlot {\n readonly view: IView;\n\n theme: (theme: string) => this;\n /**\n * todo: 直接接text图元还是title组件\n */\n // title: (text: ITextAttribute['text'], style: Omit<ITextAttribute, 'text'>) => this;\n coordinate: (type: CoordinateType, option?: Omit<CoordinateOption, 'type'>) => this;\n // interaction: (type: string, options: boolean | any) => this;\n\n // facet: (type: string, options: any) => this;\n\n ///--------- life cycle ---------///\n\n run: (runningConfig?: IRunningConfig) => this;\n release: () => this;\n parseSpec: (spec: PlotSpec) => this;\n updateSpec: (spec: PlotSpec) => this;\n getImageBuffer: () => Buffer;\n\n ///--------- events api ---------///\n on: (type: string, handler: BaseEventHandler) => this;\n off: (type: string, handler?: BaseEventHandler) => this;\n\n ///--------- marks ---------///\n\n interval: () => IInterval;\n cell: () => ICell;\n area: () => IArea;\n image: () => IImage;\n line: () => ILine;\n ruleX: () => IRuleX;\n ruleY: () => IRectY;\n symbol: () => ISymbol;\n polygon: () => IPolygon;\n text: () => IText;\n rect: () => IRect;\n rectX: () => IRectX;\n rectY: () => IRectY;\n rule: () => IRule;\n\n // wordcloud 包如果没注册,会存在问题\n wordcloud: () => IWordcloud;\n wordcloudShape: () => IWordcloudShape;\n // 需要注册 imagecloud 包\n imagecloud: () => IImagecloud;\n circlePacking: () => ICirclePacking;\n treemap: () => ITreemap;\n tree: () => ITree;\n sunburst: () => ISunburst;\n sankey: () => ISankey;\n\n // P2\n // forceGraph: () => ISemanticMark;\n // geoPath: () => ISemanticMark;\n // vector: () => ISemanticMark;\n // shape: () => ISemanticMark;\n // gauge: () => ISemanticMark;\n // heatmap: () => ISemanticMark;\n // density: () => ISemanticMark;\n // boxplot: () => ISemanticMark;\n // box: () => ISemanticMark;\n // contour: () => ISemanticMark;\n\n // observable auto define type by data\n // auto: () => ISemanticMark;\n}\n\nexport interface IPlotConstructor {\n new (options?: IPlotOptions): IPlot;\n}\n\nexport type WithDefaultEncode<T, K extends string> = {\n [Key in K]?: Key extends keyof T ? ISemanticEncodeValue<T[Key]> : ISemanticEncodeValue<string | number>;\n};\nexport type ISemanticEncodeValue<T> = T extends any[]\n ? string[] | ((datum: any) => any)[]\n : string | ((datum: any) => T);\nexport type ISemanticEncodeSpec<T> = {\n [Key in keyof T]?: ISemanticEncodeValue<T[Key]>;\n};\nexport type ISemanticStyle<T, K extends string> = Omit<T, K>;\n\nexport interface SemanticTooltipContentItem {\n key?: ISemanticEncodeValue<string | number>;\n value?: ISemanticEncodeValue<string | number>;\n symbol?: ISemanticEncodeValue<string>;\n}\nexport type SemanticTooltipOption = {\n disableGraphicTooltip?: boolean;\n disableDimensionTooltip?: boolean;\n staticTitle?: string;\n staticContentKey?: string | string[];\n title?: ISemanticEncodeValue<string | number>;\n dimensionTooltipChannel?: 'x' | 'y';\n content?: SemanticTooltipContentItem[];\n};\n\nexport interface SemanticAxisOption extends Partial<AxisBaseAttributes> {\n tickCount?: number;\n}\n\nexport interface SemanticGridOption extends Partial<GridBaseAttributes> {\n type?: GridShape;\n tickCount?: number;\n inside?: boolean;\n baseValue?: number;\n sides?: number;\n}\nexport type SemanticDataZoomOption = Partial<DataZoomAttributes>;\nexport type SemanticSliderOption = Partial<SliderAttributes>;\nexport type SemanticLegendOption = Partial<ColorLegendAttributes | DiscreteLegendAttrs | SizeLegendAttributes>;\nexport type SemanticCrosshairOption = Partial<BaseCrosshairAttrs>;\nexport type SemanticLabelOption = Partial<BaseLabelAttrs>;\nexport type SemanticPlayerOption = Partial<PlayerAttributes>;\nexport type SemanticTitleOption = Partial<TitleAttrs>;\n\nexport interface ISemanticMark<EncodeSpec, K extends string> {\n readonly uid: number;\n readonly type: string;\n data: (values: any, transform?: TransformSpec[], id?: string) => this;\n style: (style: Partial<EncodeSpec & any>) => this;\n encode: (channel: K, option: ValueOf<WithDefaultEncode<EncodeSpec, K>, K>) => this;\n scale: (channel: K, option: Partial<ScaleSpec>) => this;\n transform: (option: TransformSpec[]) => this;\n animate: (state: string, option: IAnimationConfig | IAnimationConfig[]) => this;\n state: (state: string, option: Partial<EncodeSpec>) => this;\n\n axis: (channel: string, option?: SemanticAxisOption | boolean, layout?: MarkRelativeItemSpec) => this;\n legend: (channel: string, option?: SemanticLegendOption | boolean, layout?: MarkRelativeItemSpec) => this;\n crosshair: (channel: string, option?: SemanticCrosshairOption | boolean) => this;\n tooltip: (option: SemanticTooltipOption | boolean) => this;\n coordinate: (option: CoordinateOption) => this;\n grid: (channel: string, option?: SemanticGridOption | boolean) => this;\n title: (option: SemanticTitleOption, layout?: MarkRelativeItemSpec) => this;\n\n slider: (channel: string, option?: SemanticSliderOption | boolean, layout?: MarkRelativeItemSpec) => this;\n datazoom: (channel: string, option?: SemanticDataZoomOption | boolean, layout?: MarkRelativeItemSpec) => this;\n label: (channel: string, option?: SemanticLabelOption | boolean) => this;\n player: (data?: any[], option?: SemanticPlayerOption | boolean, layout?: MarkRelativeItemSpec) => this;\n\n toViewSpec: () => ViewSpec;\n parseSpec: (spec: Partial<ISemanticMarkSpec<EncodeSpec, K>>) => this;\n}\n\nexport interface ISemanticMarkSpec<EncodeSpec, K extends string> {\n id: string | number;\n data?: DataSpec;\n encode?: WithDefaultEncode<EncodeSpec, K>;\n scale?: Partial<Record<K, ScaleSpec>>;\n style?: Partial<EncodeSpec & any>;\n axis?: Partial<\n Record<K, { option?: SemanticAxisOption | boolean; layout?: MarkRelativeItemSpec } | SemanticAxisOption | boolean>\n >;\n grid?: Partial<Record<K, SemanticGridOption | boolean>>;\n transform?: TransformSpec[];\n state?: Record<string, Partial<EncodeSpec>>;\n animation?: Record<string, IAnimationConfig | IAnimationConfig[]>;\n legend?: Record<\n string,\n { option: SemanticLegendOption | boolean; layout?: MarkRelativeItemSpec } | SemanticLegendOption | boolean\n >;\n crosshair?: Record<string, SemanticCrosshairOption | boolean>;\n tooltip?: SemanticTooltipOption | boolean;\n slider?: Record<\n string,\n { option: SemanticSliderOption | boolean; layout?: MarkRelativeItemSpec } | SemanticSliderOption | boolean\n >;\n datazoom?: Record<\n string,\n { option: SemanticDataZoomOption | boolean; layout?: MarkRelativeItemSpec } | SemanticDataZoomOption | boolean\n >;\n label?: Record<string, SemanticLabelOption | boolean>;\n player?: { data?: any[]; option?: SemanticPlayerOption | boolean; layout?: MarkRelativeItemSpec };\n title?: { option?: SemanticTitleOption; layout?: MarkRelativeItemSpec } | SemanticTitleOption;\n}\n\nexport type ParsedSimpleEncode<T, K extends string> = {\n [Key in K]?: {\n field: Key extends keyof T ? ISemanticEncodeValue<T[Key]> : ISemanticEncodeValue<string>;\n scale: string;\n };\n};\n\nexport type SemanticEncodeChannels = 'x' | 'y' | 'group' | 'color';\nexport type IntervalEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type CellEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type LineEncodeChannels = 'x' | 'y' | 'group' | 'color';\nexport type AreaEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type RuleXEncodeChannels = 'x' | 'x' | 'color' | 'group';\nexport type RuleYEncodeChannels = 'x' | 'y' | 'color' | 'group';\nexport type SymbolEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'size' | 'shape' | 'stroke';\nexport type TextEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'text' | 'stroke';\nexport type RectEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'stroke';\nexport type RectXEncodeChannels = 'x' | 'color' | 'group' | 'stroke';\nexport type RectYEncodeChannels = 'y' | 'color' | 'group' | 'stroke';\nexport type PolygonEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'stroke';\nexport type RuleEncodeChannels = 'x' | 'y' | 'color' | 'group';\nexport type ImageEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'src' | 'stroke';\nexport type PathEncodeChannels = 'color' | 'stroke';\nexport type SankeyEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type SunburstEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type TreeEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type TreemapEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type CirclepackingEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type WordcloudEncodeChannels = 'text' | 'color' | 'stroke';\nexport type WordcloudShapeEncodeChannels = 'text' | 'color' | 'stroke';\nexport type ImagecloudShapeEncodeChannels = 'image' | 'weight';\n\nexport type IInterval = ISemanticMark<PlotIntervalEncoderSpec, IntervalEncodeChannels>;\nexport type ILine = ISemanticMark<BasicEncoderSpecMap['line'], LineEncodeChannels>;\nexport type ICell = ISemanticMark<BasicEncoderSpecMap['cell'], CellEncodeChannels>;\nexport type IRuleX = ISemanticMark<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>;\nexport type IRuleY = ISemanticMark<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>;\nexport type IArea = ISemanticMark<PlotAreaEncoderSpec, AreaEncodeChannels>;\nexport type ISymbol = ISemanticMark<BasicEncoderSpecMap['symbol'], SymbolEncodeChannels>;\nexport type IText = ISemanticMark<BasicEncoderSpecMap['text'], TextEncodeChannels>;\nexport type IRect = ISemanticMark<PlotRectEncoderSpec, RectEncodeChannels>;\nexport type IRectX = ISemanticMark<BasicEncoderSpecMap['rect'], RectXEncodeChannels>;\nexport type IRectY = ISemanticMark<BasicEncoderSpecMap['rect'], RectYEncodeChannels>;\nexport type IPolygon = ISemanticMark<PlotPolygonEncoderSpec, PolygonEncodeChannels>;\nexport type IRule = ISemanticMark<BasicEncoderSpecMap['rule'], RuleEncodeChannels>;\nexport type IImage = ISemanticMark<PlotImageEncoderSpec, ImageEncodeChannels>;\nexport type IPath = ISemanticMark<BasicEncoderSpecMap['path'], PathEncodeChannels>;\nexport type ISankey = ISemanticMark<PlotSankeyEncoderSpec, SankeyEncodeChannels>;\nexport type ISunburst = ISemanticMark<PlotSunburstEncodeSpec, SunburstEncodeChannels>;\nexport type IWordcloud = ISemanticMark<PlotWordcloudEncodeSpec, WordcloudEncodeChannels>;\nexport type IWordcloudShape = ISemanticMark<PlotWordcloudShapeEncodeSpec, WordcloudShapeEncodeChannels>;\nexport type ITree = ISemanticMark<PlotTreeEncodeSpec, TreeEncodeChannels>;\nexport type ITreemap = ISemanticMark<PlotTreemapEncodeSpec, TreemapEncodeChannels>;\nexport type ICirclePacking = ISemanticMark<PlotCirclePackingEncodeSpec, CirclepackingEncodeChannels>;\nexport type IImagecloud = ISemanticMark<PlotImagecloudEncodeSpec, ImagecloudShapeEncodeChannels>;\n\nexport type PlotMark =\n | IInterval\n | IRuleX\n | IRuleY\n | ICell\n | ILine\n | IArea\n | ISymbol\n | IText\n | IRect\n | IRectX\n | IRectY\n | IPolygon\n | IRule\n | IImage\n | IPath\n | ISankey\n | ISunburst\n | ICirclePacking\n | ITreemap\n | ITree\n | IWordcloud\n | IWordcloudShape;\n\nexport interface IPlotMarkConstructor {\n readonly type: string;\n\n new (id?: string): PlotMark;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/plot.ts"],"names":[],"mappings":"","file":"plot.js","sourcesContent":["import type {\n AxisBaseAttributes,\n BaseCrosshairAttrs,\n BaseLabelAttrs,\n ColorLegendAttributes,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n GridBaseAttributes,\n PlayerAttributes,\n SizeLegendAttributes,\n SliderAttributes,\n TitleAttrs\n} from '@visactor/vrender-components';\nimport type { CoordinateType } from '@visactor/vgrammar-coordinate';\nimport type { IColor } from '@visactor/vrender-core';\nimport type { IEnvironmentOptions, IRendererOptions, IRunningConfig, ViewSpec, srIOption3DType, IView } from './view';\nimport type { CommonPaddingSpec, ValueOf } from './base';\nimport type { BasicEncoderSpecMap, LinkPathEncoderSpec, MarkRelativeItemSpec } from './mark';\nimport type { BaseEventHandler } from './event';\nimport type { TransformSpec } from './transform';\nimport type { IAnimationConfig } from './animate';\nimport type { ScaleSpec } from './scale';\nimport type { DataSpec } from './data';\nimport type { GridShape } from './component';\n\nexport interface IPlotOptions extends IEnvironmentOptions, IRendererOptions {\n width?: number;\n height?: number;\n padding?: CommonPaddingSpec;\n autoFit?: boolean;\n options3d?: srIOption3DType;\n theme?: string;\n logLevel?: number;\n}\n\nexport interface CartesianCoordinateOption {\n id?: string;\n type: 'cartesian';\n transpose?: boolean;\n}\n\nexport interface PolarCoordinateOption {\n id?: string;\n type: 'polar';\n origin?: [string | number, string | number];\n transpose?: boolean;\n}\n\nexport type PlotIntervalEncoderSpec = Omit<BasicEncoderSpecMap['interval'], 'y'> & {\n y?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'y' | 'x'> & {\n y?: number | number[];\n x?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectXEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'x'> & {\n x?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotRectYEncoderSpec = Omit<BasicEncoderSpecMap['rect'], 'y'> & {\n y?: number | number[];\n y1?: number;\n x1?: number;\n};\n\nexport type PlotAreaEncoderSpec = Omit<BasicEncoderSpecMap['area'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\n\nexport type PlotRuleEncoderSpec = Omit<BasicEncoderSpecMap['rule'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\n\nexport type PlotImageEncoderSpec = Omit<BasicEncoderSpecMap['image'], 'x' | 'y'> & {\n x?: number | number[];\n y?: number | number[];\n};\nexport type PlotPolygonEncoderSpec = Omit<BasicEncoderSpecMap['polygon'], 'x' | 'y'> & {\n x?: number[];\n y?: number[];\n};\n\nexport type PlotSankeyEncoderSpec = Partial<LinkPathEncoderSpec>;\nexport type PlotSunburstEncodeSpec = BasicEncoderSpecMap['arc'];\nexport type PlotTreeEncodeSpec = BasicEncoderSpecMap['symbol'];\nexport type PlotTreemapEncodeSpec = BasicEncoderSpecMap['rect'];\nexport type PlotCirclePackingEncodeSpec = BasicEncoderSpecMap['circle'];\nexport type PlotWordcloudEncodeSpec = BasicEncoderSpecMap['text'];\nexport type PlotWordcloudShapeEncodeSpec = BasicEncoderSpecMap['text'];\n\nexport type CoordinateOption = CartesianCoordinateOption | PolarCoordinateOption;\nexport type PlotIntervalSpec = Partial<ISemanticMarkSpec<PlotIntervalEncoderSpec, IntervalEncodeChannels>> & {\n type: 'interval';\n};\nexport type PlotLineSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['line'], LineEncodeChannels>> & {\n type: 'line';\n};\nexport type PlotCellSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['cell'], CellEncodeChannels>> & {\n type: 'cell';\n};\nexport type PlotRuleXSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>> & {\n type: 'ruleX';\n};\nexport type PlotRuleYSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>> & {\n type: 'ruleY';\n};\nexport type PlotAreaSpec = Partial<ISemanticMarkSpec<PlotAreaEncoderSpec, AreaEncodeChannels>> & {\n type: 'area';\n};\nexport type PlotSymbolSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['symbol'], SymbolEncodeChannels>> & {\n type: 'symbol';\n};\nexport type PlotTextSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['text'], TextEncodeChannels>> & {\n type: 'text';\n};\nexport type PlotRectSpec = Partial<ISemanticMarkSpec<PlotRectEncoderSpec, RectEncodeChannels>> & {\n type: 'rect';\n};\nexport type PlotRectXSpec = Partial<ISemanticMarkSpec<PlotRectXEncoderSpec, RectXEncodeChannels>> & {\n type: 'rectX';\n};\nexport type PlotRectYSpec = Partial<ISemanticMarkSpec<PlotRectYEncoderSpec, RectYEncodeChannels>> & {\n type: 'rectY';\n};\nexport type PlotPolygonSpec = Partial<ISemanticMarkSpec<PlotPolygonEncoderSpec, PolygonEncodeChannels>> & {\n type: 'polygon';\n};\nexport type PlotRuleSpec = Partial<ISemanticMarkSpec<PlotRuleEncoderSpec, RuleEncodeChannels>> & {\n type: 'rule';\n};\nexport type PlotImageSpec = Partial<ISemanticMarkSpec<PlotImageEncoderSpec, ImageEncodeChannels>> & {\n type: 'image';\n};\nexport type PlotPathSpec = Partial<ISemanticMarkSpec<BasicEncoderSpecMap['path'], PathEncodeChannels>> & {\n type: 'path';\n};\n\nexport interface PlotSpec {\n background?: IColor;\n width?: number;\n height?: number;\n padding?: number;\n coordinate?: CoordinateOption;\n marks?: Array<\n | PlotIntervalSpec\n | PlotLineSpec\n | PlotCellSpec\n | PlotRuleXSpec\n | PlotRuleYSpec\n | PlotAreaSpec\n | PlotSymbolSpec\n | PlotTextSpec\n | PlotRectSpec\n | PlotRectXSpec\n | PlotRectYSpec\n | PlotPolygonSpec\n | PlotRuleSpec\n | PlotImageSpec\n | PlotPathSpec\n >;\n}\n\nexport interface IPlot {\n readonly view: IView;\n\n theme: (theme: string) => this;\n /**\n * todo: 直接接text图元还是title组件\n */\n // title: (text: ITextAttribute['text'], style: Omit<ITextAttribute, 'text'>) => this;\n coordinate: (type: CoordinateType, option?: Omit<CoordinateOption, 'type'>) => this;\n // interaction: (type: string, options: boolean | any) => this;\n\n // facet: (type: string, options: any) => this;\n\n ///--------- life cycle ---------///\n\n run: (runningConfig?: IRunningConfig) => this;\n release: () => this;\n parseSpec: (spec: PlotSpec) => this;\n updateSpec: (spec: PlotSpec) => this;\n getImageBuffer: () => Buffer;\n\n ///--------- events api ---------///\n on: (type: string, handler: BaseEventHandler) => this;\n off: (type: string, handler?: BaseEventHandler) => this;\n\n ///--------- marks ---------///\n\n interval: () => IInterval;\n cell: () => ICell;\n area: () => IArea;\n image: () => IImage;\n line: () => ILine;\n ruleX: () => IRuleX;\n ruleY: () => IRectY;\n symbol: () => ISymbol;\n polygon: () => IPolygon;\n text: () => IText;\n rect: () => IRect;\n rectX: () => IRectX;\n rectY: () => IRectY;\n rule: () => IRule;\n\n // wordcloud 包如果没注册,会存在问题\n wordcloud: () => IWordcloud;\n wordcloudShape: () => IWordcloudShape;\n circlePacking: () => ICirclePacking;\n treemap: () => ITreemap;\n tree: () => ITree;\n sunburst: () => ISunburst;\n sankey: () => ISankey;\n\n // P2\n // forceGraph: () => ISemanticMark;\n // geoPath: () => ISemanticMark;\n // vector: () => ISemanticMark;\n // shape: () => ISemanticMark;\n // gauge: () => ISemanticMark;\n // heatmap: () => ISemanticMark;\n // density: () => ISemanticMark;\n // boxplot: () => ISemanticMark;\n // box: () => ISemanticMark;\n // contour: () => ISemanticMark;\n\n // observable auto define type by data\n // auto: () => ISemanticMark;\n}\n\nexport interface IPlotConstructor {\n new (options?: IPlotOptions): IPlot;\n}\n\nexport type WithDefaultEncode<T, K extends string> = {\n [Key in K]?: Key extends keyof T ? ISemanticEncodeValue<T[Key]> : ISemanticEncodeValue<string | number>;\n};\nexport type ISemanticEncodeValue<T> = T extends any[]\n ? string[] | ((datum: any) => any)[]\n : string | ((datum: any) => T);\nexport type ISemanticEncodeSpec<T> = {\n [Key in keyof T]?: ISemanticEncodeValue<T[Key]>;\n};\nexport type ISemanticStyle<T, K extends string> = Omit<T, K>;\n\nexport interface SemanticTooltipContentItem {\n key?: ISemanticEncodeValue<string | number>;\n value?: ISemanticEncodeValue<string | number>;\n symbol?: ISemanticEncodeValue<string>;\n}\nexport type SemanticTooltipOption = {\n disableGraphicTooltip?: boolean;\n disableDimensionTooltip?: boolean;\n staticTitle?: string;\n staticContentKey?: string | string[];\n title?: ISemanticEncodeValue<string | number>;\n dimensionTooltipChannel?: 'x' | 'y';\n content?: SemanticTooltipContentItem[];\n};\n\nexport interface SemanticAxisOption extends Partial<AxisBaseAttributes> {\n tickCount?: number;\n}\n\nexport interface SemanticGridOption extends Partial<GridBaseAttributes> {\n type?: GridShape;\n tickCount?: number;\n inside?: boolean;\n baseValue?: number;\n sides?: number;\n}\nexport type SemanticDataZoomOption = Partial<DataZoomAttributes>;\nexport type SemanticSliderOption = Partial<SliderAttributes>;\nexport type SemanticLegendOption = Partial<ColorLegendAttributes | DiscreteLegendAttrs | SizeLegendAttributes>;\nexport type SemanticCrosshairOption = Partial<BaseCrosshairAttrs>;\nexport type SemanticLabelOption = Partial<BaseLabelAttrs>;\nexport type SemanticPlayerOption = Partial<PlayerAttributes>;\nexport type SemanticTitleOption = Partial<TitleAttrs>;\n\nexport interface ISemanticMark<EncodeSpec, K extends string> {\n readonly uid: number;\n readonly type: string;\n data: (values: any, transform?: TransformSpec[], id?: string) => this;\n style: (style: Partial<EncodeSpec & any>) => this;\n encode: (channel: K, option: ValueOf<WithDefaultEncode<EncodeSpec, K>, K>) => this;\n scale: (channel: K, option: Partial<ScaleSpec>) => this;\n transform: (option: TransformSpec[]) => this;\n animate: (state: string, option: IAnimationConfig | IAnimationConfig[]) => this;\n state: (state: string, option: Partial<EncodeSpec>) => this;\n\n axis: (channel: string, option?: SemanticAxisOption | boolean, layout?: MarkRelativeItemSpec) => this;\n legend: (channel: string, option?: SemanticLegendOption | boolean, layout?: MarkRelativeItemSpec) => this;\n crosshair: (channel: string, option?: SemanticCrosshairOption | boolean) => this;\n tooltip: (option: SemanticTooltipOption | boolean) => this;\n coordinate: (option: CoordinateOption) => this;\n grid: (channel: string, option?: SemanticGridOption | boolean) => this;\n title: (option: SemanticTitleOption, layout?: MarkRelativeItemSpec) => this;\n\n slider: (channel: string, option?: SemanticSliderOption | boolean, layout?: MarkRelativeItemSpec) => this;\n datazoom: (channel: string, option?: SemanticDataZoomOption | boolean, layout?: MarkRelativeItemSpec) => this;\n label: (channel: string, option?: SemanticLabelOption | boolean) => this;\n player: (data?: any[], option?: SemanticPlayerOption | boolean, layout?: MarkRelativeItemSpec) => this;\n\n toViewSpec: () => ViewSpec;\n parseSpec: (spec: Partial<ISemanticMarkSpec<EncodeSpec, K>>) => this;\n}\n\nexport interface ISemanticMarkSpec<EncodeSpec, K extends string> {\n id: string | number;\n data?: DataSpec;\n encode?: WithDefaultEncode<EncodeSpec, K>;\n scale?: Partial<Record<K, ScaleSpec>>;\n style?: Partial<EncodeSpec & any>;\n axis?: Partial<\n Record<K, { option?: SemanticAxisOption | boolean; layout?: MarkRelativeItemSpec } | SemanticAxisOption | boolean>\n >;\n grid?: Partial<Record<K, SemanticGridOption | boolean>>;\n transform?: TransformSpec[];\n state?: Record<string, Partial<EncodeSpec>>;\n animation?: Record<string, IAnimationConfig | IAnimationConfig[]>;\n legend?: Record<\n string,\n { option: SemanticLegendOption | boolean; layout?: MarkRelativeItemSpec } | SemanticLegendOption | boolean\n >;\n crosshair?: Record<string, SemanticCrosshairOption | boolean>;\n tooltip?: SemanticTooltipOption | boolean;\n slider?: Record<\n string,\n { option: SemanticSliderOption | boolean; layout?: MarkRelativeItemSpec } | SemanticSliderOption | boolean\n >;\n datazoom?: Record<\n string,\n { option: SemanticDataZoomOption | boolean; layout?: MarkRelativeItemSpec } | SemanticDataZoomOption | boolean\n >;\n label?: Record<string, SemanticLabelOption | boolean>;\n player?: { data?: any[]; option?: SemanticPlayerOption | boolean; layout?: MarkRelativeItemSpec };\n title?: { option?: SemanticTitleOption; layout?: MarkRelativeItemSpec } | SemanticTitleOption;\n}\n\nexport type ParsedSimpleEncode<T, K extends string> = {\n [Key in K]?: {\n field: Key extends keyof T ? ISemanticEncodeValue<T[Key]> : ISemanticEncodeValue<string>;\n scale: string;\n };\n};\n\nexport type SemanticEncodeChannels = 'x' | 'y' | 'group' | 'color';\nexport type IntervalEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type CellEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type LineEncodeChannels = 'x' | 'y' | 'group' | 'color';\nexport type AreaEncodeChannels = 'x' | 'y' | 'group' | 'color' | 'stroke';\nexport type RuleXEncodeChannels = 'x' | 'x' | 'color' | 'group';\nexport type RuleYEncodeChannels = 'x' | 'y' | 'color' | 'group';\nexport type SymbolEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'size' | 'shape' | 'stroke';\nexport type TextEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'text' | 'stroke';\nexport type RectEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'stroke';\nexport type RectXEncodeChannels = 'x' | 'color' | 'group' | 'stroke';\nexport type RectYEncodeChannels = 'y' | 'color' | 'group' | 'stroke';\nexport type PolygonEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'stroke';\nexport type RuleEncodeChannels = 'x' | 'y' | 'color' | 'group';\nexport type ImageEncodeChannels = 'x' | 'y' | 'color' | 'group' | 'src' | 'stroke';\nexport type PathEncodeChannels = 'color' | 'stroke';\nexport type SankeyEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type SunburstEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type TreeEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type TreemapEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type CirclepackingEncodeChannels = 'node' | 'value' | 'color' | 'stroke';\nexport type WordcloudEncodeChannels = 'text' | 'color' | 'stroke';\nexport type WordcloudShapeEncodeChannels = 'text' | 'color' | 'stroke';\n\nexport type IInterval = ISemanticMark<PlotIntervalEncoderSpec, IntervalEncodeChannels>;\nexport type ILine = ISemanticMark<BasicEncoderSpecMap['line'], LineEncodeChannels>;\nexport type ICell = ISemanticMark<BasicEncoderSpecMap['cell'], CellEncodeChannels>;\nexport type IRuleX = ISemanticMark<BasicEncoderSpecMap['rule'], RuleXEncodeChannels>;\nexport type IRuleY = ISemanticMark<BasicEncoderSpecMap['rule'], RuleYEncodeChannels>;\nexport type IArea = ISemanticMark<PlotAreaEncoderSpec, AreaEncodeChannels>;\nexport type ISymbol = ISemanticMark<BasicEncoderSpecMap['symbol'], SymbolEncodeChannels>;\nexport type IText = ISemanticMark<BasicEncoderSpecMap['text'], TextEncodeChannels>;\nexport type IRect = ISemanticMark<PlotRectEncoderSpec, RectEncodeChannels>;\nexport type IRectX = ISemanticMark<BasicEncoderSpecMap['rect'], RectXEncodeChannels>;\nexport type IRectY = ISemanticMark<BasicEncoderSpecMap['rect'], RectYEncodeChannels>;\nexport type IPolygon = ISemanticMark<PlotPolygonEncoderSpec, PolygonEncodeChannels>;\nexport type IRule = ISemanticMark<BasicEncoderSpecMap['rule'], RuleEncodeChannels>;\nexport type IImage = ISemanticMark<PlotImageEncoderSpec, ImageEncodeChannels>;\nexport type IPath = ISemanticMark<BasicEncoderSpecMap['path'], PathEncodeChannels>;\nexport type ISankey = ISemanticMark<PlotSankeyEncoderSpec, SankeyEncodeChannels>;\nexport type ISunburst = ISemanticMark<PlotSunburstEncodeSpec, SunburstEncodeChannels>;\nexport type IWordcloud = ISemanticMark<PlotWordcloudEncodeSpec, WordcloudEncodeChannels>;\nexport type IWordcloudShape = ISemanticMark<PlotWordcloudShapeEncodeSpec, WordcloudShapeEncodeChannels>;\nexport type ITree = ISemanticMark<PlotTreeEncodeSpec, TreeEncodeChannels>;\nexport type ITreemap = ISemanticMark<PlotTreemapEncodeSpec, TreemapEncodeChannels>;\nexport type ICirclePacking = ISemanticMark<PlotCirclePackingEncodeSpec, CirclepackingEncodeChannels>;\n\nexport type PlotMark =\n | IInterval\n | IRuleX\n | IRuleY\n | ICell\n | ILine\n | IArea\n | ISymbol\n | IText\n | IRect\n | IRectX\n | IRectY\n | IPolygon\n | IRule\n | IImage\n | IPath\n | ISankey\n | ISunburst\n | ICirclePacking\n | ITreemap\n | ITree\n | IWordcloud\n | IWordcloudShape;\n\nexport interface IPlotMarkConstructor {\n readonly type: string;\n\n new (id?: string): PlotMark;\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": "0.16.1",
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": "0.16.1",
30
+ "@visactor/vgrammar-util": "0.16.1",
31
+ "@visactor/vscale": "~0.19.4",
32
+ "@visactor/vrender-core": "0.22.5",
33
+ "@visactor/vrender-kits": "0.22.5",
34
+ "@visactor/vrender-components": "0.22.5"
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",
48
47
  "@internal/bundler": "0.0.1",
48
+ "@internal/jest-config": "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",