@visactor/vgrammar-core 0.11.0-alpha.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/component/label.js.map +1 -1
- package/cjs/graph/attributes/line.d.ts +2 -0
- package/cjs/graph/attributes/line.js +38 -5
- package/cjs/graph/attributes/line.js.map +1 -1
- package/cjs/graph/element.js +15 -6
- package/cjs/graph/element.js.map +1 -1
- package/cjs/graph/enums.d.ts +2 -1
- package/cjs/graph/enums.js +1 -1
- package/cjs/graph/enums.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/interactions/element-highlight.d.ts +5 -2
- package/cjs/interactions/element-highlight.js +8 -23
- package/cjs/interactions/element-highlight.js.map +1 -1
- package/cjs/interactions/element-select.d.ts +6 -3
- package/cjs/interactions/element-select.js +20 -28
- package/cjs/interactions/element-select.js.map +1 -1
- package/cjs/interactions/filter.js +1 -1
- package/cjs/interactions/filter.js.map +1 -1
- package/cjs/interactions/fish-eye.js +1 -1
- package/cjs/interactions/fish-eye.js.map +1 -1
- package/cjs/interactions/index.js +4 -0
- package/cjs/interactions/index.js.map +1 -1
- package/cjs/interactions/toggle-state-mixin.d.ts +8 -0
- package/cjs/interactions/toggle-state-mixin.js +30 -0
- package/cjs/interactions/toggle-state-mixin.js.map +1 -0
- package/cjs/interactions/utils.d.ts +2 -1
- package/cjs/interactions/utils.js +15 -2
- package/cjs/interactions/utils.js.map +1 -1
- package/cjs/interactions/view-navigation-base.js +1 -1
- package/cjs/interactions/view-navigation-base.js.map +1 -1
- package/cjs/transforms/data/sampling.js.map +1 -1
- package/cjs/types/dataflow.d.ts +1 -2
- package/cjs/types/dataflow.js.map +1 -1
- package/cjs/types/grammar.d.ts +0 -1
- package/cjs/types/grammar.js.map +1 -1
- package/cjs/types/interaction.d.ts +4 -0
- package/cjs/types/interaction.js.map +1 -1
- package/cjs/types/mark.d.ts +1 -1
- package/cjs/types/mark.js.map +1 -1
- package/cjs/types/plot.d.ts +0 -1
- package/cjs/types/plot.js.map +1 -1
- package/cjs/types/transform.d.ts +1 -1
- package/cjs/types/transform.js.map +1 -1
- package/cjs/types/view.d.ts +2 -5
- package/cjs/types/view.js.map +1 -1
- package/cjs/util/data.d.ts +0 -1
- package/cjs/util/data.js +1 -37
- package/cjs/util/data.js.map +1 -1
- package/cjs/view/View.d.ts +2 -10
- package/cjs/view/View.js +20 -103
- package/cjs/view/View.js.map +1 -1
- package/cjs/view/data.d.ts +1 -2
- package/cjs/view/data.js +7 -49
- package/cjs/view/data.js.map +1 -1
- package/cjs/view/dataflow.d.ts +1 -6
- package/cjs/view/dataflow.js +7 -72
- package/cjs/view/dataflow.js.map +1 -1
- package/cjs/view/grammar-base.d.ts +3 -6
- package/cjs/view/grammar-base.js +0 -46
- package/cjs/view/grammar-base.js.map +1 -1
- package/cjs/view/mark.d.ts +1 -2
- package/cjs/view/mark.js +9 -38
- package/cjs/view/mark.js.map +1 -1
- package/es/component/label.js.map +1 -1
- package/es/graph/attributes/line.d.ts +2 -0
- package/es/graph/attributes/line.js +34 -5
- package/es/graph/attributes/line.js.map +1 -1
- package/es/graph/element.js +17 -8
- package/es/graph/element.js.map +1 -1
- package/es/graph/enums.d.ts +2 -1
- package/es/graph/enums.js +1 -1
- package/es/graph/enums.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/interactions/brush-filter.js +1 -2
- package/es/interactions/element-highlight-by-group.js +2 -1
- package/es/interactions/element-highlight.d.ts +5 -2
- package/es/interactions/element-highlight.js +9 -22
- package/es/interactions/element-highlight.js.map +1 -1
- package/es/interactions/element-select.d.ts +6 -3
- package/es/interactions/element-select.js +21 -27
- package/es/interactions/element-select.js.map +1 -1
- package/es/interactions/filter.js +1 -1
- package/es/interactions/filter.js.map +1 -1
- package/es/interactions/fish-eye.js +1 -1
- package/es/interactions/fish-eye.js.map +1 -1
- package/es/interactions/index.js +5 -4
- package/es/interactions/index.js.map +1 -1
- package/es/interactions/legend-filter.js +1 -1
- package/es/interactions/player-filter.js +1 -1
- package/es/interactions/roll-up.js +1 -1
- package/es/interactions/scrollbar-filter.js +1 -1
- package/es/interactions/slider-filter.js +1 -1
- package/es/interactions/toggle-state-mixin.d.ts +8 -0
- package/es/interactions/toggle-state-mixin.js +22 -0
- package/es/interactions/toggle-state-mixin.js.map +1 -0
- package/es/interactions/tooltip.js +1 -1
- package/es/interactions/utils.d.ts +2 -1
- package/es/interactions/utils.js +11 -0
- package/es/interactions/utils.js.map +1 -1
- package/es/interactions/view-navigation-base.js +1 -1
- package/es/interactions/view-navigation-base.js.map +1 -1
- package/es/parse/coordinate.js +1 -1
- package/es/parse/event.js +1 -1
- package/es/parse/mark.js +1 -1
- package/es/parse/option.js +1 -1
- package/es/parse/scale.js +2 -1
- package/es/parse/transform.js +1 -1
- package/es/parse/util.js +1 -1
- package/es/parse/view.js +1 -1
- package/es/transforms/data/sampling.js.map +1 -1
- package/es/types/dataflow.d.ts +1 -2
- package/es/types/dataflow.js.map +1 -1
- package/es/types/grammar.d.ts +0 -1
- package/es/types/grammar.js.map +1 -1
- package/es/types/interaction.d.ts +4 -0
- package/es/types/interaction.js.map +1 -1
- package/es/types/mark.d.ts +1 -1
- package/es/types/mark.js.map +1 -1
- package/es/types/plot.d.ts +0 -1
- package/es/types/plot.js.map +1 -1
- package/es/types/transform.d.ts +1 -1
- package/es/types/transform.js.map +1 -1
- package/es/types/view.d.ts +2 -5
- package/es/types/view.js.map +1 -1
- package/es/util/data.d.ts +0 -1
- package/es/util/data.js +0 -34
- package/es/util/data.js.map +1 -1
- package/es/view/View.d.ts +2 -10
- package/es/view/View.js +19 -103
- package/es/view/View.js.map +1 -1
- package/es/view/data.d.ts +1 -2
- package/es/view/data.js +8 -49
- package/es/view/data.js.map +1 -1
- package/es/view/dataflow.d.ts +1 -6
- package/es/view/dataflow.js +7 -72
- package/es/view/dataflow.js.map +1 -1
- package/es/view/grammar-base.d.ts +3 -6
- package/es/view/grammar-base.js +0 -45
- package/es/view/grammar-base.js.map +1 -1
- package/es/view/mark.d.ts +1 -2
- package/es/view/mark.js +8 -39
- package/es/view/mark.js.map +1 -1
- package/package.json +7 -7
package/cjs/types/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/view.ts"],"names":[],"mappings":"","file":"view.js","sourcesContent":["import type { EventEmitter, IBounds, ILogger } from '@visactor/vutils';\nimport type { EnvType, IStage, IColor, IOption3D, ILayer, IStageParams } from '@visactor/vrender-core';\nimport type { CoordinateType } from '@visactor/vgrammar-coordinate';\nimport type { DataSpec } from './data';\nimport type { SignalFunctionType, SignalSpec } from './signal';\nimport type {\n IData,\n ISignal,\n IScale,\n IMark,\n IGrammarBase,\n ICoordinate,\n IGlyphMark,\n IGroupMark,\n IComponent\n} from './grammar';\nimport type { ScaleSpec, GrammarScaleType } from './scale';\nimport type { MarkSpec, MarkType } from './mark';\nimport type { Hooks } from './hooks';\nimport type { ProjectionSpec } from './projection';\nimport type { BaseEventHandler, EventSpec } from './event';\nimport type { CommonPaddingSpec } from './base';\nimport type { IMorphAnimationConfig } from './morph';\nimport type { IBaseAnimate } from './animate';\nimport type { IRenderer } from './renderer';\nimport type { IAxis, IDatazoom, IGrid, ILabel, ILegend, IPlayer, IScrollbar, ISlider, ITitle } from './component';\nimport type { CoordinateSpec } from './coordinate';\nimport type { ITheme } from './theme';\nimport type { IInteraction, InteractionSpec } from './interaction';\n\nexport interface IViewThemeConfig {\n labelMonospace?: boolean;\n}\n\n/**\n * 获取state相关配置\n */\nexport interface IViewStateOptions {\n signals?: (name?: string, operator?: any) => boolean;\n data?: (name?: string, object?: any) => boolean;\n recurse?: boolean;\n}\n\nexport interface IEnvironmentOptions {\n /** 环境参数 */\n mode?: EnvType;\n /**\n * 环境带的配置\n */\n modeParams?: any;\n}\n\nexport interface IRendererOptions extends Partial<IStageParams> {\n /** 非浏览器环境下,如小程序,需要传入经过包装的伪 canvas 实例 */\n renderCanvas?: string | HTMLCanvasElement;\n /** vRender stage */\n stage?: IStage;\n rendererTitle?: string;\n /** vRender layer */\n layer?: ILayer;\n}\n\nexport interface ILayoutOptions {\n parseMarkBounds?: (bounds: IBounds, mark: IMark) => IBounds;\n doLayout?: (marks: IMark[], options: ILayoutOptions, view: IView) => void;\n}\n\n/** 事件配置 */\nexport interface IViewEventConfig {\n /**\n * preventDefaults相关配置\n */\n defaults?: {\n prevent?: boolean | Record<string, boolean>;\n allow?: boolean | Record<string, boolean>;\n };\n /**\n * whether permit events of view\n */\n view?: boolean | Record<string, boolean>;\n /** disable all the events */\n disable?: boolean;\n /** use gesture events or not */\n gesture?: boolean;\n /** use drag events or not */\n drag?: boolean;\n}\n\nexport interface srIOption3DType extends IOption3D {\n enable?: boolean;\n /* 是否支持3d视角变换 */\n enableView3dTranform?: boolean;\n}\nexport interface IViewOptions extends IEnvironmentOptions, IRendererOptions, ILayoutOptions {\n width?: number;\n height?: number;\n padding?: CommonPaddingSpec;\n autoFit?: boolean;\n\n options3d?: srIOption3DType;\n /** 外部传入的logger方法 */\n logger?: ILogger;\n /**\n * 0 - None\n * 1 - Error\n * 2 - Warn\n * 3 - Info\n * 4 - Debug\n */\n logLevel?: number;\n\n /** 生命周期等事件钩子 */\n hooks?: Hooks;\n\n /**\n * 事件相关配置\n * {\n * defaults: {\n * prevent: ['mousemove', 'mouseenter']\n * }\n * }\n */\n eventConfig?: IViewEventConfig;\n background?: IColor;\n disableTheme?: boolean;\n}\n\nexport interface IRunningConfig {\n /** whether enable reusing of grammar */\n reuse?: boolean;\n /** whether enable morph */\n morph?: boolean;\n /** force all marks to participate in morphing */\n morphAll?: boolean;\n /** morphing animation config */\n animation?: IMorphAnimationConfig;\n /** whether apply exit animations for released marks */\n enableExitAnimation?: boolean;\n}\n\nexport interface IView {\n readonly renderer: IRenderer;\n readonly rootMark: IGroupMark;\n readonly animate: IBaseAnimate;\n readonly grammars: IRecordedGrammars;\n readonly logger: ILogger;\n\n // --- Grammar API ---\n signal: <T>(value?: T, update?: SignalFunctionType<T>) => ISignal<T>;\n data: (values?: any[]) => IData;\n scale: (type: GrammarScaleType) => IScale;\n coordinate: (type: CoordinateType) => ICoordinate;\n mark: (\n type: MarkType,\n group: IGroupMark | string,\n markOptions?: { glyphType?: string; componentType?: string; mode?: '2d' | '3d' }\n ) => IMark;\n group: (group: IGroupMark | string) => IGroupMark;\n glyph: (glyphType: string, group: IGroupMark | string) => IGlyphMark;\n component: (componentType: string, group: IGroupMark | string, mode?: '2d' | '3d') => IComponent;\n axis: (group: IGroupMark | string, mode?: '2d' | '3d') => IAxis;\n grid: (group: IGroupMark | string, mode?: '2d' | '3d') => IGrid;\n legend: (group: IGroupMark | string) => ILegend;\n slider: (group: IGroupMark | string) => ISlider;\n label: (group: IGroupMark | string) => ILabel;\n datazoom: (group: IGroupMark | string) => IDatazoom;\n player: (group: IGroupMark | string) => IPlayer;\n title: (group: IGroupMark | string) => ITitle;\n scrollbar: (group: IGroupMark | string) => IScrollbar;\n\n interaction: (type: string, spec: Partial<InteractionSpec>) => IInteraction;\n removeInteraction: (type: string) => this;\n removeAllInteractions: () => this;\n\n addGrammar: (grammar: IGrammarBase) => this;\n removeGrammar: (grammar: string | IGrammarBase) => this;\n removeAllGrammars: () => this;\n removeAllGraphicItems: () => this;\n\n getGrammarById: (id: string) => IGrammarBase | null;\n getCustomizedById: (id: string) => IGrammarBase | null;\n getSignalById: <T>(id: string) => ISignal<T> | null;\n getDataById: (id: string) => IData | null;\n getScaleById: (id: string) => IScale | null;\n getCoordinateById: (id: string) => ICoordinate | null;\n getMarkById: (id: string) => IMark | null;\n getGrammarsByName: (name: string) => IGrammarBase[];\n getGrammarsByType: (grammarType: string) => IGrammarBase[];\n getMarksByType: (markType: string) => IMark[];\n getMarksByName: (name: string) => IMark[] | null;\n getMarksBySelector: (selector: string | string[] | IMark | IMark[]) => IMark[] | null;\n\n commit: (grammar: IGrammarBase) => this;\n\n // --- Spec API ---\n parseSpec: (spec: ViewSpec) => this;\n updateSpec: (spec: ViewSpec) => this;\n\n // --- Evaluate API ---\n run: (runningConfig?: IRunningConfig) => this;\n runNextTick: (runningConfig?: IRunningConfig) => Promise<this>;\n runAsync: (runningConfig?: IRunningConfig) => Promise<this>;\n runSync: (runningConfig?: IRunningConfig) => this;\n runBefore: (callback: (view: IView) => void) => this;\n runAfter: (callback: (view: IView) => void) => this;\n\n // --- Theme API ---\n theme: (theme: ITheme | string) => this;\n getCurrentTheme: () => ITheme;\n setCurrentTheme: (theme: ITheme | string, render?: boolean) => Promise<this>;\n\n // --- Global Config API ---\n background: (value?: IColor) => IColor;\n width: (value?: number) => number;\n height: (value?: number) => number;\n viewWidth: (value?: number) => number;\n viewHeight: (value?: number) => number;\n padding: (p?: number | { left?: number; right?: number; top?: number; bottom?: number }) => {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n getViewBox: () => IBounds;\n\n // --- Event API ---\n addEventListener: (type: string, handler: BaseEventHandler, options?: any) => this;\n removeEventListener: (type: string, handler: BaseEventHandler) => this;\n\n // --- Other API ---\n emit: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n\n resize: (width: number, height: number, render?: boolean) => Promise<this>;\n traverseMarkTree: (apply: (mark: IMark) => any, filter?: (mark: IMark) => boolean, leafFirst?: boolean) => this;\n\n getLayoutState: () => string;\n updateLayoutTag: () => this;\n\n pauseProgressive: () => boolean;\n resumeProgressive: () => boolean;\n restartProgressive: () => boolean;\n\n release: () => void;\n getImageBuffer: () => Buffer;\n}\n\nexport interface IViewConstructor {\n new (options?: IViewOptions, config?: IViewThemeConfig): IView;\n}\n\nexport interface ViewSpec {\n /** 梳理详细配置 */\n theme?: string;\n background?: IColor;\n width?: number;\n height?: number;\n padding?: number | { left?: number; right?: number; top?: number; bottom?: number };\n signals?: SignalSpec<any>[];\n projections?: ProjectionSpec[];\n data?: DataSpec[];\n scales?: ScaleSpec[];\n coordinates?: CoordinateSpec[];\n marks?: MarkSpec[];\n events?: EventSpec[];\n interactions?: InteractionSpec[];\n animation?: boolean;\n}\n\nexport interface IRecordedGrammars {\n record: (grammar: IGrammarBase) => this;\n unrecord: (grammar: IGrammarBase) => this;\n\n size: () => number;\n\n getSignal: <T>(key: string) => ISignal<T> | null;\n getData: (key: string) => IData | null;\n getScale: (key: string) => IScale | null;\n getCoordinate: (key: string) => ICoordinate | null;\n getMark: (key: string) => IMark | null;\n getCustomized: (key: string) => IGrammarBase | null;\n getGrammar: (key: string) => IGrammarBase | null;\n\n getAllSignals: () => ISignal<any>[];\n getAllData: () => IData[];\n getAllScales: () => IScale[];\n getAllCoordinates: () => ICoordinate[];\n getAllMarks: () => IMark[];\n getAllCustomized: () => IGrammarBase[];\n\n clear: () => void;\n\n traverse: (func: (grammar: IGrammarBase) => boolean | void) => void;\n find: (func: (grammar: IGrammarBase) => boolean) => IGrammarBase | null;\n filter: (func: (grammar: IGrammarBase) => boolean) => IGrammarBase[];\n\n release: () => void;\n}\n\nexport interface IMarkTreeNode {\n mark: IMark;\n parent: IMarkTreeNode;\n children: IMarkTreeNode[];\n}\n\nexport interface IRecordedTreeGrammars extends IRecordedGrammars {\n getAllMarkNodes: () => IMarkTreeNode[];\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/types/view.ts"],"names":[],"mappings":"","file":"view.js","sourcesContent":["import type { EventEmitter, IBounds, ILogger } from '@visactor/vutils';\nimport type { EnvType, IStage, IColor, IOption3D, ILayer, IStageParams } from '@visactor/vrender-core';\nimport type { CoordinateType } from '@visactor/vgrammar-coordinate';\nimport type { DataSpec } from './data';\nimport type { SignalFunctionType, SignalSpec } from './signal';\nimport type {\n IData,\n ISignal,\n IScale,\n IMark,\n IGrammarBase,\n ICoordinate,\n IGlyphMark,\n IGroupMark,\n IComponent\n} from './grammar';\nimport type { ScaleSpec, GrammarScaleType } from './scale';\nimport type { MarkSpec, MarkType } from './mark';\nimport type { Hooks } from './hooks';\nimport type { ProjectionSpec } from './projection';\nimport type { BaseEventHandler, EventSpec } from './event';\nimport type { CommonPaddingSpec } from './base';\nimport type { IMorphAnimationConfig } from './morph';\nimport type { IBaseAnimate } from './animate';\nimport type { IRenderer } from './renderer';\nimport type { IAxis, IDatazoom, IGrid, ILabel, ILegend, IPlayer, IScrollbar, ISlider, ITitle } from './component';\nimport type { CoordinateSpec } from './coordinate';\nimport type { ITheme } from './theme';\nimport type { IInteraction, InteractionSpec } from './interaction';\n\nexport interface IViewThemeConfig {\n labelMonospace?: boolean;\n}\n\n/**\n * 获取state相关配置\n */\nexport interface IViewStateOptions {\n signals?: (name?: string, operator?: any) => boolean;\n data?: (name?: string, object?: any) => boolean;\n recurse?: boolean;\n}\n\nexport interface IEnvironmentOptions {\n /** 环境参数 */\n mode?: EnvType;\n /**\n * 环境带的配置\n */\n modeParams?: any;\n}\n\nexport interface IRendererOptions extends Partial<IStageParams> {\n /** 非浏览器环境下,如小程序,需要传入经过包装的伪 canvas 实例 */\n renderCanvas?: string | HTMLCanvasElement;\n /** vRender stage */\n stage?: IStage;\n rendererTitle?: string;\n /** vRender layer */\n layer?: ILayer;\n}\n\nexport interface ILayoutOptions {\n parseMarkBounds?: (bounds: IBounds, mark: IMark) => IBounds;\n doLayout?: (marks: IMark[], options: ILayoutOptions, view: IView) => void;\n}\n\n/** 事件配置 */\nexport interface IViewEventConfig {\n /**\n * preventDefaults相关配置\n */\n defaults?: {\n prevent?: boolean | Record<string, boolean>;\n allow?: boolean | Record<string, boolean>;\n };\n /**\n * whether permit events of view\n */\n view?: boolean | Record<string, boolean>;\n /** disable all the events */\n disable?: boolean;\n /** use gesture events or not */\n gesture?: boolean;\n /** use drag events or not */\n drag?: boolean;\n}\n\nexport interface srIOption3DType extends IOption3D {\n enable?: boolean;\n /* 是否支持3d视角变换 */\n enableView3dTranform?: boolean;\n}\nexport interface IViewOptions extends IEnvironmentOptions, IRendererOptions, ILayoutOptions {\n width?: number;\n height?: number;\n padding?: CommonPaddingSpec;\n autoFit?: boolean;\n\n options3d?: srIOption3DType;\n /** 外部传入的logger方法 */\n logger?: ILogger;\n /**\n * 0 - None\n * 1 - Error\n * 2 - Warn\n * 3 - Info\n * 4 - Debug\n */\n logLevel?: number;\n\n /** 生命周期等事件钩子 */\n hooks?: Hooks;\n\n /**\n * 事件相关配置\n * {\n * defaults: {\n * prevent: ['mousemove', 'mouseenter']\n * }\n * }\n */\n eventConfig?: IViewEventConfig;\n background?: IColor;\n disableTheme?: boolean;\n}\n\nexport interface IRunningConfig {\n /** whether enable reusing of grammar */\n reuse?: boolean;\n /** whether enable morph */\n morph?: boolean;\n /** force all marks to participate in morphing */\n morphAll?: boolean;\n /** morphing animation config */\n animation?: IMorphAnimationConfig;\n /** whether apply exit animations for released marks */\n enableExitAnimation?: boolean;\n}\n\nexport interface IView {\n readonly renderer: IRenderer;\n readonly rootMark: IGroupMark;\n readonly animate: IBaseAnimate;\n readonly grammars: IRecordedGrammars;\n readonly logger: ILogger;\n\n // --- Grammar API ---\n signal: <T>(value?: T, update?: SignalFunctionType<T>) => ISignal<T>;\n data: (values?: any[]) => IData;\n scale: (type: GrammarScaleType) => IScale;\n coordinate: (type: CoordinateType) => ICoordinate;\n mark: (\n type: MarkType,\n group: IGroupMark | string,\n markOptions?: { glyphType?: string; componentType?: string; mode?: '2d' | '3d' }\n ) => IMark;\n group: (group: IGroupMark | string) => IGroupMark;\n glyph: (glyphType: string, group: IGroupMark | string) => IGlyphMark;\n component: (componentType: string, group: IGroupMark | string, mode?: '2d' | '3d') => IComponent;\n axis: (group: IGroupMark | string, mode?: '2d' | '3d') => IAxis;\n grid: (group: IGroupMark | string, mode?: '2d' | '3d') => IGrid;\n legend: (group: IGroupMark | string) => ILegend;\n slider: (group: IGroupMark | string) => ISlider;\n label: (group: IGroupMark | string) => ILabel;\n datazoom: (group: IGroupMark | string) => IDatazoom;\n player: (group: IGroupMark | string) => IPlayer;\n title: (group: IGroupMark | string) => ITitle;\n scrollbar: (group: IGroupMark | string) => IScrollbar;\n\n interaction: (type: string, spec: Partial<InteractionSpec>) => IInteraction;\n removeInteraction: (type: string) => this;\n removeAllInteractions: () => this;\n\n addGrammar: (grammar: IGrammarBase) => this;\n removeGrammar: (grammar: string | IGrammarBase) => this;\n removeAllGrammars: () => this;\n removeAllGraphicItems: () => this;\n\n getGrammarById: (id: string) => IGrammarBase | null;\n getCustomizedById: (id: string) => IGrammarBase | null;\n getSignalById: <T>(id: string) => ISignal<T> | null;\n getDataById: (id: string) => IData | null;\n getScaleById: (id: string) => IScale | null;\n getCoordinateById: (id: string) => ICoordinate | null;\n getMarkById: (id: string) => IMark | null;\n getGrammarsByName: (name: string) => IGrammarBase[];\n getGrammarsByType: (grammarType: string) => IGrammarBase[];\n getMarksByType: (markType: string) => IMark[];\n getMarksByName: (name: string) => IMark[] | null;\n getMarksBySelector: (selector: string | string[] | IMark | IMark[]) => IMark[] | null;\n\n commit: (grammar: IGrammarBase) => this;\n\n // --- Spec API ---\n parseSpec: (spec: ViewSpec) => this;\n updateSpec: (spec: ViewSpec) => this;\n\n // --- Evaluate API ---\n run: (runningConfig?: IRunningConfig) => this;\n runBefore: (callback: (view: IView) => void) => this;\n runAfter: (callback: (view: IView) => void) => this;\n\n // --- Theme API ---\n theme: (theme: ITheme | string) => this;\n getCurrentTheme: () => ITheme;\n setCurrentTheme: (theme: ITheme | string, render?: boolean) => this;\n\n // --- Global Config API ---\n background: (value?: IColor) => IColor;\n width: (value?: number) => number;\n height: (value?: number) => number;\n viewWidth: (value?: number) => number;\n viewHeight: (value?: number) => number;\n padding: (p?: number | { left?: number; right?: number; top?: number; bottom?: number }) => {\n left: number;\n right: number;\n top: number;\n bottom: number;\n };\n getViewBox: () => IBounds;\n\n // --- Event API ---\n addEventListener: (type: string, handler: BaseEventHandler, options?: any) => this;\n removeEventListener: (type: string, handler: BaseEventHandler) => this;\n\n // --- Other API ---\n emit: <T extends EventEmitter.EventNames<string | symbol>>(\n event: T,\n ...args: EventEmitter.EventArgs<string | symbol, T>\n ) => boolean;\n\n resize: (width: number, height: number, render?: boolean) => this;\n traverseMarkTree: (apply: (mark: IMark) => any, filter?: (mark: IMark) => boolean, leafFirst?: boolean) => this;\n\n getLayoutState: () => string;\n updateLayoutTag: () => this;\n\n pauseProgressive: () => boolean;\n resumeProgressive: () => boolean;\n restartProgressive: () => boolean;\n\n release: () => void;\n getImageBuffer: () => Buffer;\n}\n\nexport interface IViewConstructor {\n new (options?: IViewOptions, config?: IViewThemeConfig): IView;\n}\n\nexport interface ViewSpec {\n /** 梳理详细配置 */\n theme?: string;\n background?: IColor;\n width?: number;\n height?: number;\n padding?: number | { left?: number; right?: number; top?: number; bottom?: number };\n signals?: SignalSpec<any>[];\n projections?: ProjectionSpec[];\n data?: DataSpec[];\n scales?: ScaleSpec[];\n coordinates?: CoordinateSpec[];\n marks?: MarkSpec[];\n events?: EventSpec[];\n interactions?: InteractionSpec[];\n animation?: boolean;\n}\n\nexport interface IRecordedGrammars {\n record: (grammar: IGrammarBase) => this;\n unrecord: (grammar: IGrammarBase) => this;\n\n size: () => number;\n\n getSignal: <T>(key: string) => ISignal<T> | null;\n getData: (key: string) => IData | null;\n getScale: (key: string) => IScale | null;\n getCoordinate: (key: string) => ICoordinate | null;\n getMark: (key: string) => IMark | null;\n getCustomized: (key: string) => IGrammarBase | null;\n getGrammar: (key: string) => IGrammarBase | null;\n\n getAllSignals: () => ISignal<any>[];\n getAllData: () => IData[];\n getAllScales: () => IScale[];\n getAllCoordinates: () => ICoordinate[];\n getAllMarks: () => IMark[];\n getAllCustomized: () => IGrammarBase[];\n\n clear: () => void;\n\n traverse: (func: (grammar: IGrammarBase) => boolean | void) => void;\n find: (func: (grammar: IGrammarBase) => boolean) => IGrammarBase | null;\n filter: (func: (grammar: IGrammarBase) => boolean) => IGrammarBase[];\n\n release: () => void;\n}\n\nexport interface IMarkTreeNode {\n mark: IMark;\n parent: IMarkTreeNode;\n children: IMarkTreeNode[];\n}\n\nexport interface IRecordedTreeGrammars extends IRecordedGrammars {\n getAllMarkNodes: () => IMarkTreeNode[];\n}\n"]}
|
package/cjs/util/data.d.ts
CHANGED
package/cjs/util/data.js
CHANGED
|
@@ -1,34 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var __awaiter = this && this.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
4
|
-
return new (P || (P = Promise))((function(resolve, reject) {
|
|
5
|
-
function fulfilled(value) {
|
|
6
|
-
try {
|
|
7
|
-
step(generator.next(value));
|
|
8
|
-
} catch (e) {
|
|
9
|
-
reject(e);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function rejected(value) {
|
|
13
|
-
try {
|
|
14
|
-
step(generator.throw(value));
|
|
15
|
-
} catch (e) {
|
|
16
|
-
reject(e);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function step(result) {
|
|
20
|
-
var value;
|
|
21
|
-
result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P((function(resolve) {
|
|
22
|
-
resolve(value);
|
|
23
|
-
}))).then(fulfilled, rejected);
|
|
24
|
-
}
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
}));
|
|
27
|
-
};
|
|
28
|
-
|
|
29
3
|
Object.defineProperty(exports, "__esModule", {
|
|
30
4
|
value: !0
|
|
31
|
-
}), exports.
|
|
5
|
+
}), exports.parseFormat = void 0;
|
|
32
6
|
|
|
33
7
|
const vdataset_1 = require("@visactor/vdataset"), vutils_1 = require("@visactor/vutils"), jsonParser = (data, options = {}, dataView) => {
|
|
34
8
|
if (!(0, vutils_1.isString)(data)) return (0, vutils_1.array)(data);
|
|
@@ -51,14 +25,4 @@ const vdataset_1 = require("@visactor/vdataset"), vutils_1 = require("@visactor/
|
|
|
51
25
|
};
|
|
52
26
|
|
|
53
27
|
exports.parseFormat = parseFormat;
|
|
54
|
-
|
|
55
|
-
const load = url => __awaiter(void 0, void 0, void 0, (function*() {
|
|
56
|
-
try {
|
|
57
|
-
return (yield fetch(url)).text();
|
|
58
|
-
} catch (error) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
}));
|
|
62
|
-
|
|
63
|
-
exports.load = load;
|
|
64
28
|
//# sourceMappingURL=data.js.map
|
package/cjs/util/data.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/util/data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/util/data.ts"],"names":[],"mappings":";;;AAEA,iDAAwF;AAExF,6CAAmD;AAEnD,MAAM,UAAU,GAAW,CAAC,IAAY,EAAE,UAAe,EAAE,EAAE,QAAkB,EAAE,EAAE;IACjF,IAAI,CAAC,IAAA,iBAAQ,EAAC,IAAI,CAAC,EAAE;QACnB,OAAO,IAAA,cAAK,EAAC,IAAI,CAAC,CAAC;KACpB;IACD,IAAI;QACF,OAAO,IAAA,cAAK,EAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;KAChC;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,EAAE,CAAC;KACX;AACH,CAAC,CAAC;AAEF,MAAM,OAAO,GAA2B;IACtC,GAAG,EAAE,oBAAS;IACd,GAAG,EAAE,oBAAS;IACd,GAAG,EAAE,oBAAS;IACd,IAAI,EAAE,UAAU;CACjB,CAAC;AAEK,MAAM,WAAW,GAAG,CAAC,IAAS,EAAE,MAAuB,EAAW,EAAE;IACzE,IAAI,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACpC,OAAO,IAAA,cAAK,EAAC,IAAI,CAAC,CAAC;KACpB;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7E,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,mBAAQ,CAAC,IAAI,kBAAO,EAAE,CAAC,CAAC,CAAC;AAC1E,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB","file":"data.js","sourcesContent":["import type { Parser } from '@visactor/vdataset';\n// eslint-disable-next-line no-duplicate-imports\nimport { DataSet, DataView, csvParser, dsvParser, tsvParser } from '@visactor/vdataset';\nimport type { DataFormatSpec, Datum } from '../types';\nimport { array, isString } from '@visactor/vutils';\n\nconst jsonParser: Parser = (data: string, options: any = {}, dataView: DataView) => {\n if (!isString(data)) {\n return array(data);\n }\n try {\n return array(JSON.parse(data));\n } catch (e) {\n return [];\n }\n};\n\nconst parsers: Record<string, Parser> = {\n csv: csvParser,\n dsv: dsvParser,\n tsv: tsvParser,\n json: jsonParser\n};\n\nexport const parseFormat = (data: any, format?: DataFormatSpec): Datum[] => {\n if (!format || !parsers[format.type]) {\n return array(data);\n }\n const options = format.type === 'dsv' ? { delimiter: format.delimiter } : {};\n return parsers[format.type](data, options, new DataView(new DataSet()));\n};\n"]}
|
package/cjs/view/View.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export default class View extends EventEmitter implements IView {
|
|
|
14
14
|
hooks: Hooks;
|
|
15
15
|
logger: ILogger;
|
|
16
16
|
grammars: IRecordedGrammars;
|
|
17
|
-
private _isReleased;
|
|
18
17
|
private _spec;
|
|
19
18
|
private _config;
|
|
20
19
|
private _options;
|
|
@@ -25,8 +24,6 @@ export default class View extends EventEmitter implements IView {
|
|
|
25
24
|
private _eventListeners;
|
|
26
25
|
private _theme;
|
|
27
26
|
private _dataflow;
|
|
28
|
-
private _currentDataflow?;
|
|
29
|
-
private _running?;
|
|
30
27
|
private _needBuildLayoutTree?;
|
|
31
28
|
private _layoutState?;
|
|
32
29
|
private _layoutMarks?;
|
|
@@ -83,7 +80,7 @@ export default class View extends EventEmitter implements IView {
|
|
|
83
80
|
private parseMarkSpec;
|
|
84
81
|
theme(theme: ITheme | string): this;
|
|
85
82
|
getCurrentTheme(): ITheme;
|
|
86
|
-
setCurrentTheme(theme: ITheme | string, render?: boolean):
|
|
83
|
+
setCurrentTheme(theme: ITheme | string, render?: boolean): this;
|
|
87
84
|
background(value?: IColor): IColor;
|
|
88
85
|
width(value?: number): number;
|
|
89
86
|
height(value?: number): number;
|
|
@@ -110,13 +107,8 @@ export default class View extends EventEmitter implements IView {
|
|
|
110
107
|
private handleRenderEnd;
|
|
111
108
|
commit(grammar: IGrammarBase): this;
|
|
112
109
|
run(runningConfig?: IRunningConfig): this;
|
|
113
|
-
runSync(runningConfig?: IRunningConfig): this;
|
|
114
|
-
isRunning(): Promise<this>;
|
|
115
|
-
runAsync(runningConfig?: IRunningConfig): Promise<this>;
|
|
116
|
-
runNextTick(runningConfig?: IRunningConfig): Promise<this>;
|
|
117
110
|
private doRender;
|
|
118
111
|
private evaluate;
|
|
119
|
-
private evaluateSync;
|
|
120
112
|
private reuseCachedGrammars;
|
|
121
113
|
private detachCachedGrammar;
|
|
122
114
|
private releaseCachedGrammars;
|
|
@@ -128,7 +120,7 @@ export default class View extends EventEmitter implements IView {
|
|
|
128
120
|
private _unBindResizeEvent;
|
|
129
121
|
private _getContainerSize;
|
|
130
122
|
private _onResize;
|
|
131
|
-
resize(width: number, height: number, render?: boolean):
|
|
123
|
+
resize(width: number, height: number, render?: boolean): this;
|
|
132
124
|
private _resizeRenderer;
|
|
133
125
|
private bindEvents;
|
|
134
126
|
event(eventSpec: EventSpec): void;
|
package/cjs/view/View.js
CHANGED
|
@@ -1,30 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
return new (P || (P = Promise))((function(resolve, reject) {
|
|
5
|
-
function fulfilled(value) {
|
|
6
|
-
try {
|
|
7
|
-
step(generator.next(value));
|
|
8
|
-
} catch (e) {
|
|
9
|
-
reject(e);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function rejected(value) {
|
|
13
|
-
try {
|
|
14
|
-
step(generator.throw(value));
|
|
15
|
-
} catch (e) {
|
|
16
|
-
reject(e);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function step(result) {
|
|
20
|
-
var value;
|
|
21
|
-
result.done ? resolve(result.value) : (value = result.value, value instanceof P ? value : new P((function(resolve) {
|
|
22
|
-
resolve(value);
|
|
23
|
-
}))).then(fulfilled, rejected);
|
|
24
|
-
}
|
|
25
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
-
}));
|
|
27
|
-
}, __importDefault = this && this.__importDefault || function(mod) {
|
|
3
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
28
4
|
return mod && mod.__esModule ? mod : {
|
|
29
5
|
default: mod
|
|
30
6
|
};
|
|
@@ -326,17 +302,10 @@ class View extends vutils_1.EventEmitter {
|
|
|
326
302
|
return this._theme;
|
|
327
303
|
}
|
|
328
304
|
setCurrentTheme(theme, render = !0) {
|
|
329
|
-
return
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
})), render) {
|
|
334
|
-
if (yield this.evaluate(), this._isReleased) return;
|
|
335
|
-
this.renderer.render(!0);
|
|
336
|
-
} else yield this._dataflow.evaluate();
|
|
337
|
-
return this;
|
|
338
|
-
}
|
|
339
|
-
}));
|
|
305
|
+
return this.theme(theme), this.grammars.getAllMarks().forEach((mark => {
|
|
306
|
+
mark.commit();
|
|
307
|
+
})), render ? (this.evaluate(), this.renderer.render(!0)) : this._dataflow.evaluate(),
|
|
308
|
+
this;
|
|
340
309
|
}
|
|
341
310
|
background(value) {
|
|
342
311
|
return arguments.length ? (this._background = value, this.renderer.background(value),
|
|
@@ -421,71 +390,23 @@ class View extends vutils_1.EventEmitter {
|
|
|
421
390
|
run(runningConfig) {
|
|
422
391
|
return this.evaluate(runningConfig), this;
|
|
423
392
|
}
|
|
424
|
-
runSync(runningConfig) {
|
|
425
|
-
return this.evaluateSync(runningConfig), this;
|
|
426
|
-
}
|
|
427
|
-
isRunning() {
|
|
428
|
-
return this._running;
|
|
429
|
-
}
|
|
430
|
-
runAsync(runningConfig) {
|
|
431
|
-
return __awaiter(this, void 0, void 0, (function*() {
|
|
432
|
-
if (this._isReleased) return;
|
|
433
|
-
for (;this._running && (yield this._running, !this._isReleased); ) ;
|
|
434
|
-
const clear = () => {
|
|
435
|
-
this._running = null;
|
|
436
|
-
};
|
|
437
|
-
return (this._running = this.evaluate(runningConfig)).then(clear, clear), this._running;
|
|
438
|
-
}));
|
|
439
|
-
}
|
|
440
|
-
runNextTick(runningConfig) {
|
|
441
|
-
return __awaiter(this, void 0, void 0, (function*() {
|
|
442
|
-
return this._currentDataflow || (this._currentDataflow = Promise.resolve().then((() => this.runAsync(runningConfig).then((() => {
|
|
443
|
-
this._currentDataflow = null;
|
|
444
|
-
})).catch((e => {
|
|
445
|
-
this._currentDataflow = null, this.logger.error(e);
|
|
446
|
-
}))))), yield this._currentDataflow, this;
|
|
447
|
-
}));
|
|
448
|
-
}
|
|
449
393
|
doRender(immediately) {
|
|
450
394
|
this.emit(enums_1.HOOK_EVENT.BEFORE_DO_RENDER), this.renderer && (this._progressiveMarks || this.animate.animate(),
|
|
451
395
|
this.renderer.render(immediately), this.handleRenderEnd()), this.emit(enums_1.HOOK_EVENT.AFTER_DO_RENDER);
|
|
452
396
|
}
|
|
453
397
|
evaluate(runningConfig) {
|
|
454
398
|
var _a, _b, _c, _d;
|
|
455
|
-
return __awaiter(this, void 0, void 0, (function*() {
|
|
456
|
-
if (this._isReleased) return;
|
|
457
|
-
const normalizedRunningConfig = (0, view_1.normalizeRunningConfig)(runningConfig), grammarWillDetach = this._cachedGrammars.size() > 0;
|
|
458
|
-
grammarWillDetach && (this.reuseCachedGrammars(normalizedRunningConfig), this.detachCachedGrammar());
|
|
459
|
-
const hasResize = this._resizeRenderer(), hasUpdate = this._dataflow.hasCommitted();
|
|
460
|
-
if (!(grammarWillDetach || hasUpdate || this._layoutState || hasResize)) return this;
|
|
461
|
-
if (this.clearProgressive(), null === (_a = this.renderer) || void 0 === _a || _a.preventRender(!0),
|
|
462
|
-
yield this._dataflow.evaluate(), !this._isReleased) {
|
|
463
|
-
if (this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1),
|
|
464
|
-
this._layoutState) {
|
|
465
|
-
if (this._layoutState = enums_1.LayoutState.layouting, this.doLayout(), this._dataflow.hasCommitted() && (this._layoutState = enums_1.LayoutState.reevaluate,
|
|
466
|
-
yield this._dataflow.evaluate(), this._isReleased)) return;
|
|
467
|
-
this._layoutState = enums_1.LayoutState.after, (null === (_b = this._layoutMarks) || void 0 === _b ? void 0 : _b.length) && this.handleLayoutEnd();
|
|
468
|
-
}
|
|
469
|
-
return null === (_c = this.renderer) || void 0 === _c || _c.preventRender(!1), this._layoutState = null,
|
|
470
|
-
this.findProgressiveMarks(), this._resizeRenderer(), this.doRender(!1), null === (_d = this._willMorphMarks) || void 0 === _d || _d.forEach((morphMarks => {
|
|
471
|
-
this._morph.morph(morphMarks.prev, morphMarks.next, normalizedRunningConfig);
|
|
472
|
-
})), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig),
|
|
473
|
-
this.doPreProgressive(), this;
|
|
474
|
-
}
|
|
475
|
-
}));
|
|
476
|
-
}
|
|
477
|
-
evaluateSync(runningConfig) {
|
|
478
|
-
var _a, _b;
|
|
479
399
|
const normalizedRunningConfig = (0, view_1.normalizeRunningConfig)(runningConfig), grammarWillDetach = this._cachedGrammars.size() > 0;
|
|
480
400
|
grammarWillDetach && (this.reuseCachedGrammars(normalizedRunningConfig), this.detachCachedGrammar());
|
|
481
401
|
const hasResize = this._resizeRenderer(), hasUpdate = this._dataflow.hasCommitted();
|
|
482
402
|
return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(),
|
|
483
|
-
this.
|
|
484
|
-
this._needBuildLayoutTree
|
|
485
|
-
this.
|
|
486
|
-
this._dataflow.
|
|
487
|
-
this._layoutState =
|
|
488
|
-
null === (
|
|
403
|
+
null === (_a = this.renderer) || void 0 === _a || _a.preventRender(!0), this._dataflow.evaluate(),
|
|
404
|
+
this._needBuildLayoutTree && (this.buildLayoutTree(), this._needBuildLayoutTree = !1),
|
|
405
|
+
this._layoutState && (this._layoutState = enums_1.LayoutState.layouting, this.doLayout(),
|
|
406
|
+
this._dataflow.hasCommitted() && (this._layoutState = enums_1.LayoutState.reevaluate,
|
|
407
|
+
this._dataflow.evaluate()), this._layoutState = enums_1.LayoutState.after, (null === (_b = this._layoutMarks) || void 0 === _b ? void 0 : _b.length) && this.handleLayoutEnd()),
|
|
408
|
+
null === (_c = this.renderer) || void 0 === _c || _c.preventRender(!1), this._layoutState = null,
|
|
409
|
+
this.findProgressiveMarks(), this._resizeRenderer(), this.doRender(!1), null === (_d = this._willMorphMarks) || void 0 === _d || _d.forEach((morphMarks => {
|
|
489
410
|
this._morph.morph(morphMarks.prev, morphMarks.next, normalizedRunningConfig);
|
|
490
411
|
})), this._willMorphMarks = null, this.releaseCachedGrammars(normalizedRunningConfig),
|
|
491
412
|
this.doPreProgressive(), this) : this;
|
|
@@ -593,13 +514,10 @@ class View extends vutils_1.EventEmitter {
|
|
|
593
514
|
return null;
|
|
594
515
|
}
|
|
595
516
|
resize(width, height, render = !0) {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
needDataflow && (render ? yield this.evaluate() : yield this._dataflow.evaluate()),
|
|
601
|
-
this;
|
|
602
|
-
}));
|
|
517
|
+
let needDataflow = !1;
|
|
518
|
+
return width !== this.width() && (needDataflow = !0, this.updateSignal(constants_2.SIGNAL_WIDTH, width)),
|
|
519
|
+
height !== this.height() && (needDataflow = !0, this.updateSignal(constants_2.SIGNAL_HEIGHT, height)),
|
|
520
|
+
needDataflow && (render ? this.evaluate() : this._dataflow.evaluate()), this;
|
|
603
521
|
}
|
|
604
522
|
_resizeRenderer() {
|
|
605
523
|
const width = this.width(), height = this.height();
|
|
@@ -634,7 +552,7 @@ class View extends vutils_1.EventEmitter {
|
|
|
634
552
|
hasCommitted = !0);
|
|
635
553
|
}));
|
|
636
554
|
}
|
|
637
|
-
needPreventDefault && evt.preventDefault(), consume && evt.stopPropagation(), hasCommitted && this.
|
|
555
|
+
needPreventDefault && evt.preventDefault(), consume && evt.stopPropagation(), hasCommitted && this.run();
|
|
638
556
|
}), {
|
|
639
557
|
throttle: throttle,
|
|
640
558
|
debounce: debounce
|
|
@@ -729,9 +647,8 @@ class View extends vutils_1.EventEmitter {
|
|
|
729
647
|
this._eventListeners = [], this._eventConfig = (0, events_1.initializeEventConfig)(this._options.eventConfig),
|
|
730
648
|
this._theme = this._options.disableTheme ? null : theme_manager_1.ThemeManager.getDefaultTheme(),
|
|
731
649
|
this.parseBuiltIn(), (0, env_1.configureEnvironment)(this._options), this.initializeRenderer(),
|
|
732
|
-
this._eventConfig.disable || this.initEvent(), this._bindResizeEvent(), this.
|
|
733
|
-
this.
|
|
734
|
-
this.theme(this._theme);
|
|
650
|
+
this._eventConfig.disable || this.initEvent(), this._bindResizeEvent(), this._needBuildLayoutTree = !0,
|
|
651
|
+
this._layoutState = enums_1.LayoutState.before, this.theme(this._theme);
|
|
735
652
|
}
|
|
736
653
|
pauseProgressive() {
|
|
737
654
|
return !1;
|
|
@@ -766,7 +683,7 @@ class View extends vutils_1.EventEmitter {
|
|
|
766
683
|
}
|
|
767
684
|
release() {
|
|
768
685
|
var _a, _b, _c;
|
|
769
|
-
this.
|
|
686
|
+
this._unBindResizeEvent(), this.clearProgressive(), factory_1.Factory.unregisterRuntimeTransforms(),
|
|
770
687
|
this.animate.stop(), this.grammars.release(), this._cachedGrammars.release(), this._dataflow.release(),
|
|
771
688
|
this._dataflow = null, null === (_b = null === (_a = this.renderer) || void 0 === _a ? void 0 : _a.release) || void 0 === _b || _b.call(_a),
|
|
772
689
|
this.renderer = null, this._boundInteractions = null, this.removeAllListeners(),
|