@visactor/vgrammar-core 0.7.4-alpha.3 → 0.7.5

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.
Files changed (179) hide show
  1. package/cjs/component/axis.js.map +1 -1
  2. package/cjs/component/crosshair.js.map +1 -1
  3. package/cjs/component/datazoom.js.map +1 -1
  4. package/cjs/component/grid.js.map +1 -1
  5. package/cjs/component/label.js.map +1 -1
  6. package/cjs/component/legend.js.map +1 -1
  7. package/cjs/component/player.js.map +1 -1
  8. package/cjs/component/scrollbar.js.map +1 -1
  9. package/cjs/component/slider.js.map +1 -1
  10. package/cjs/component/title.js.map +1 -1
  11. package/cjs/component/tooltip.js.map +1 -1
  12. package/cjs/core/factory.d.ts +2 -2
  13. package/cjs/core/factory.js.map +1 -1
  14. package/cjs/glyph/boxplot.js +2 -1
  15. package/cjs/glyph/index.js +1 -2
  16. package/cjs/graph/animation/animation/grow-cartesian.js.map +1 -1
  17. package/cjs/graph/animation/animator.js +4 -4
  18. package/cjs/graph/animation/animator.js.map +1 -1
  19. package/cjs/graph/animation/attribute.d.ts +2 -2
  20. package/cjs/graph/animation/attribute.js +6 -6
  21. package/cjs/graph/animation/attribute.js.map +1 -1
  22. package/cjs/graph/animation/morph.js +4 -4
  23. package/cjs/graph/animation/morph.js.map +1 -1
  24. package/cjs/graph/attributes/index.js.map +1 -1
  25. package/cjs/graph/canvas-renderer.d.ts +1 -1
  26. package/cjs/graph/canvas-renderer.js +5 -5
  27. package/cjs/graph/canvas-renderer.js.map +1 -1
  28. package/cjs/graph/element.d.ts +1 -1
  29. package/cjs/graph/element.js +2 -2
  30. package/cjs/graph/element.js.map +1 -1
  31. package/cjs/graph/glyph-element.d.ts +1 -1
  32. package/cjs/graph/glyph-element.js.map +1 -1
  33. package/cjs/graph/mark/large-rects.d.ts +2 -2
  34. package/cjs/graph/mark/large-rects.js +3 -3
  35. package/cjs/graph/mark/large-rects.js.map +1 -1
  36. package/cjs/graph/mark/large-symbols.d.ts +2 -2
  37. package/cjs/graph/mark/large-symbols.js +3 -3
  38. package/cjs/graph/mark/large-symbols.js.map +1 -1
  39. package/cjs/graph/util/env.js +2 -2
  40. package/cjs/graph/util/env.js.map +1 -1
  41. package/cjs/graph/util/events-extend.d.ts +1 -1
  42. package/cjs/graph/util/events-extend.js.map +1 -1
  43. package/cjs/graph/util/graphic.d.ts +3 -3
  44. package/cjs/graph/util/graphic.js +21 -21
  45. package/cjs/graph/util/graphic.js.map +1 -1
  46. package/cjs/index.d.ts +1 -3
  47. package/cjs/index.js +3 -13
  48. package/cjs/index.js.map +1 -1
  49. package/cjs/parse/mark.js +2 -1
  50. package/cjs/parse/option.js +1 -2
  51. package/cjs/parse/scale.js +3 -4
  52. package/cjs/parse/scale.js.map +1 -1
  53. package/cjs/semantic-marks/cell.d.ts +1 -1
  54. package/cjs/semantic-marks/interval.d.ts +1 -1
  55. package/cjs/types/animate.d.ts +1 -1
  56. package/cjs/types/animate.js.map +1 -1
  57. package/cjs/types/component.d.ts +1 -1
  58. package/cjs/types/component.js.map +1 -1
  59. package/cjs/types/coordinate.js +2 -1
  60. package/cjs/types/data.js +1 -2
  61. package/cjs/types/element.d.ts +1 -1
  62. package/cjs/types/element.js.map +1 -1
  63. package/cjs/types/grammar.d.ts +1 -1
  64. package/cjs/types/grammar.js.map +1 -1
  65. package/cjs/types/index.js +1 -1
  66. package/cjs/types/mark.d.ts +1 -1
  67. package/cjs/types/mark.js.map +1 -1
  68. package/cjs/types/morph.d.ts +1 -1
  69. package/cjs/types/morph.js.map +1 -1
  70. package/cjs/types/plot.d.ts +1 -1
  71. package/cjs/types/plot.js.map +1 -1
  72. package/cjs/types/renderer.d.ts +1 -1
  73. package/cjs/types/renderer.js.map +1 -1
  74. package/cjs/types/theme.d.ts +1 -1
  75. package/cjs/types/theme.js.map +1 -1
  76. package/cjs/types/view.d.ts +1 -1
  77. package/cjs/types/view.js.map +1 -1
  78. package/cjs/util/text.d.ts +1 -1
  79. package/cjs/util/text.js +3 -3
  80. package/cjs/util/text.js.map +1 -1
  81. package/cjs/view/View.d.ts +1 -1
  82. package/cjs/view/View.js +7 -7
  83. package/cjs/view/View.js.map +1 -1
  84. package/cjs/view/component.d.ts +1 -1
  85. package/cjs/view/mark.d.ts +2 -2
  86. package/cjs/view/mark.js.map +1 -1
  87. package/es/component/axis.js.map +1 -1
  88. package/es/component/crosshair.js.map +1 -1
  89. package/es/component/datazoom.js.map +1 -1
  90. package/es/component/grid.js.map +1 -1
  91. package/es/component/label.js.map +1 -1
  92. package/es/component/legend.js.map +1 -1
  93. package/es/component/player.js.map +1 -1
  94. package/es/component/scrollbar.js.map +1 -1
  95. package/es/component/slider.js.map +1 -1
  96. package/es/component/title.js.map +1 -1
  97. package/es/component/tooltip.js.map +1 -1
  98. package/es/core/factory.d.ts +2 -2
  99. package/es/core/factory.js.map +1 -1
  100. package/es/glyph/boxplot.js +2 -1
  101. package/es/glyph/index.js +1 -2
  102. package/es/graph/animation/animation/grow-cartesian.js.map +1 -1
  103. package/es/graph/animation/animator.js +1 -1
  104. package/es/graph/animation/animator.js.map +1 -1
  105. package/es/graph/animation/attribute.d.ts +2 -2
  106. package/es/graph/animation/attribute.js +1 -1
  107. package/es/graph/animation/attribute.js.map +1 -1
  108. package/es/graph/animation/morph.js +1 -1
  109. package/es/graph/animation/morph.js.map +1 -1
  110. package/es/graph/attributes/index.js.map +1 -1
  111. package/es/graph/canvas-renderer.d.ts +1 -1
  112. package/es/graph/canvas-renderer.js +1 -3
  113. package/es/graph/canvas-renderer.js.map +1 -1
  114. package/es/graph/element.d.ts +1 -1
  115. package/es/graph/element.js +1 -1
  116. package/es/graph/element.js.map +1 -1
  117. package/es/graph/glyph-element.d.ts +1 -1
  118. package/es/graph/glyph-element.js.map +1 -1
  119. package/es/graph/mark/large-rects.d.ts +2 -2
  120. package/es/graph/mark/large-rects.js +1 -1
  121. package/es/graph/mark/large-rects.js.map +1 -1
  122. package/es/graph/mark/large-symbols.d.ts +2 -2
  123. package/es/graph/mark/large-symbols.js +1 -1
  124. package/es/graph/mark/large-symbols.js.map +1 -1
  125. package/es/graph/util/env.js +1 -1
  126. package/es/graph/util/env.js.map +1 -1
  127. package/es/graph/util/events-extend.d.ts +1 -1
  128. package/es/graph/util/events-extend.js.map +1 -1
  129. package/es/graph/util/graphic.d.ts +3 -3
  130. package/es/graph/util/graphic.js +1 -1
  131. package/es/graph/util/graphic.js.map +1 -1
  132. package/es/index.d.ts +1 -3
  133. package/es/index.js +2 -7
  134. package/es/index.js.map +1 -1
  135. package/es/parse/mark.js +2 -1
  136. package/es/parse/option.js +1 -2
  137. package/es/parse/scale.js +3 -4
  138. package/es/parse/scale.js.map +1 -1
  139. package/es/semantic-marks/cell.d.ts +1 -1
  140. package/es/semantic-marks/interval.d.ts +1 -1
  141. package/es/types/animate.d.ts +1 -1
  142. package/es/types/animate.js.map +1 -1
  143. package/es/types/component.d.ts +1 -1
  144. package/es/types/component.js.map +1 -1
  145. package/es/types/coordinate.js +2 -1
  146. package/es/types/data.js +1 -2
  147. package/es/types/element.d.ts +1 -1
  148. package/es/types/element.js.map +1 -1
  149. package/es/types/grammar.d.ts +1 -1
  150. package/es/types/grammar.js.map +1 -1
  151. package/es/types/index.js +1 -1
  152. package/es/types/mark.d.ts +1 -1
  153. package/es/types/mark.js.map +1 -1
  154. package/es/types/morph.d.ts +1 -1
  155. package/es/types/morph.js.map +1 -1
  156. package/es/types/plot.d.ts +1 -1
  157. package/es/types/plot.js.map +1 -1
  158. package/es/types/renderer.d.ts +1 -1
  159. package/es/types/renderer.js.map +1 -1
  160. package/es/types/theme.d.ts +1 -1
  161. package/es/types/theme.js.map +1 -1
  162. package/es/types/view.d.ts +1 -1
  163. package/es/types/view.js.map +1 -1
  164. package/es/util/text.d.ts +1 -1
  165. package/es/util/text.js +1 -1
  166. package/es/util/text.js.map +1 -1
  167. package/es/view/View.d.ts +1 -1
  168. package/es/view/View.js +1 -1
  169. package/es/view/View.js.map +1 -1
  170. package/es/view/component.d.ts +1 -1
  171. package/es/view/mark.d.ts +2 -2
  172. package/es/view/mark.js.map +1 -1
  173. package/package.json +5 -6
  174. package/cjs/env.d.ts +0 -1
  175. package/cjs/env.js +0 -20
  176. package/cjs/env.js.map +0 -1
  177. package/es/env.d.ts +0 -1
  178. package/es/env.js +0 -1
  179. package/es/env.js.map +0 -1
@@ -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'];\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 runAsync: (runningConfig?: IRunningConfig) => Promise<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"]}
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';\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 runAsync: (runningConfig?: IRunningConfig) => Promise<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"]}
@@ -1,5 +1,5 @@
1
1
  import type { IBoundsLike } from '@visactor/vutils';
2
- import type { IColor, Stage } from '@visactor/vrender-core';
2
+ import type { IColor, Stage } from '@visactor/vrender';
3
3
  import type { IViewEventConfig, IViewOptions } from './view';
4
4
  export interface IRenderer {
5
5
  initialize: (width: number, height: number, options: IViewOptions, eventConfig: IViewEventConfig) => this;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/renderer.ts"],"names":[],"mappings":"","file":"renderer.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { IColor, Stage } from '@visactor/vrender-core';\nimport type { IViewEventConfig, IViewOptions } from './view';\n\nexport interface IRenderer {\n initialize: (width: number, height: number, options: IViewOptions, eventConfig: IViewEventConfig) => this;\n\n render: (immediately?: boolean) => this;\n renderNextFrame: () => this;\n resize: (width: number, height: number) => this;\n shouldResize: (width: number, height: number) => boolean;\n combineIncrementalLayers: () => this;\n\n setDpr: (resolution: number, redraw: boolean) => this;\n background: (color: IColor) => this;\n setViewBox: (viewBox: IBoundsLike, rerender: boolean) => this;\n\n stage: () => Stage;\n canvas: () => HTMLCanvasElement;\n context: () => CanvasRenderingContext2D;\n\n toCanvas: () => HTMLCanvasElement;\n // toImageData: () => Promise<ImageData | undefined>;\n\n release: () => void;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/renderer.ts"],"names":[],"mappings":"","file":"renderer.js","sourcesContent":["import type { IBoundsLike } from '@visactor/vutils';\nimport type { IColor, Stage } from '@visactor/vrender';\nimport type { IViewEventConfig, IViewOptions } from './view';\n\nexport interface IRenderer {\n initialize: (width: number, height: number, options: IViewOptions, eventConfig: IViewEventConfig) => this;\n\n render: (immediately?: boolean) => this;\n renderNextFrame: () => this;\n resize: (width: number, height: number) => this;\n shouldResize: (width: number, height: number) => boolean;\n combineIncrementalLayers: () => this;\n\n setDpr: (resolution: number, redraw: boolean) => this;\n background: (color: IColor) => this;\n setViewBox: (viewBox: IBoundsLike, rerender: boolean) => this;\n\n stage: () => Stage;\n canvas: () => HTMLCanvasElement;\n context: () => CanvasRenderingContext2D;\n\n toCanvas: () => HTMLCanvasElement;\n // toImageData: () => Promise<ImageData | undefined>;\n\n release: () => void;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { IColor } from '@visactor/vrender-core';
1
+ import type { IColor } from '@visactor/vrender';
2
2
  import type { ArcLabelAttrs, BaseLabelAttrs, CircleAxisAttributes, CircleAxisGridAttributes, CircleCrosshairAttrs, ColorLegendAttributes, ContinuousPlayerAttributes, DataLabelAttrs, DataZoomAttributes, DiscreteLegendAttrs, DiscretePlayerAttributes, LineAxisAttributes, LineAxisGridAttributes, LineCrosshairAttrs, LineLabelAttrs, PolygonCrosshairAttrs, RectCrosshairAttrs, RectLabelAttrs, ScrollBarAttributes, SectorCrosshairAttrs, SizeLegendAttributes, SliderAttributes, SymbolLabelAttrs, TitleAttrs, TooltipAttributes } from '@visactor/vrender-components';
3
3
  import type { IPadding } from '@visactor/vutils';
4
4
  import type { RecursivePartial } from './base';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["import type { IColor } from '@visactor/vrender-core';\nimport type {\n ArcLabelAttrs,\n BaseLabelAttrs,\n CircleAxisAttributes,\n CircleAxisGridAttributes,\n CircleCrosshairAttrs,\n ColorLegendAttributes,\n ContinuousPlayerAttributes,\n DataLabelAttrs,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n DiscretePlayerAttributes,\n LineAxisAttributes,\n LineAxisGridAttributes,\n LineCrosshairAttrs,\n LineLabelAttrs,\n PolygonCrosshairAttrs,\n RectCrosshairAttrs,\n RectLabelAttrs,\n ScrollBarAttributes,\n SectorCrosshairAttrs,\n SizeLegendAttributes,\n SliderAttributes,\n SymbolLabelAttrs,\n TitleAttrs,\n TooltipAttributes\n} from '@visactor/vrender-components';\nimport type { IPadding } from '@visactor/vutils';\nimport type { RecursivePartial } from './base';\nimport type { BasicEncoderSpecMap } from './mark';\n\n// glyph mark includes multiple types, not support theme for glyph for now\nexport type IMarkTheme = Partial<Omit<BasicEncoderSpecMap, 'glyph'>>;\n\nexport interface IComponentTheme {\n axis?: RecursivePartial<LineAxisAttributes>;\n circleAxis?: RecursivePartial<CircleAxisAttributes>;\n\n grid?: RecursivePartial<LineAxisGridAttributes>;\n circleGrid?: RecursivePartial<CircleAxisGridAttributes>;\n\n discreteLegend?: RecursivePartial<DiscreteLegendAttrs>;\n colorLegend?: RecursivePartial<ColorLegendAttributes>;\n sizeLegend?: RecursivePartial<SizeLegendAttributes>;\n\n lineCrosshair?: RecursivePartial<LineCrosshairAttrs>;\n rectCrosshair?: RecursivePartial<RectCrosshairAttrs>;\n sectorCrosshair?: RecursivePartial<SectorCrosshairAttrs>;\n circleCrosshair?: RecursivePartial<CircleCrosshairAttrs>;\n polygonCrosshair?: RecursivePartial<PolygonCrosshairAttrs>;\n\n slider?: RecursivePartial<SliderAttributes>;\n\n dataLabel?: RecursivePartial<DataLabelAttrs>;\n lineLabel?: RecursivePartial<LineLabelAttrs>;\n rectLabel?: RecursivePartial<RectLabelAttrs>;\n arcLabel?: RecursivePartial<ArcLabelAttrs>;\n symbolLabel?: RecursivePartial<SymbolLabelAttrs>;\n pointLabel?: RecursivePartial<BaseLabelAttrs>;\n\n datazoom?: RecursivePartial<DataZoomAttributes>;\n\n continuousPlayer?: RecursivePartial<ContinuousPlayerAttributes>;\n discretePlayer?: RecursivePartial<DiscretePlayerAttributes>;\n\n tooltip?: RecursivePartial<TooltipAttributes>;\n\n title?: RecursivePartial<TitleAttrs>;\n\n scrollbar?: RecursivePartial<ScrollBarAttributes>;\n}\n\nexport interface ITheme {\n name?: string;\n background?: IColor;\n padding?: IPadding | number;\n palette?: Record<string, IColor[]>;\n marks?: IMarkTheme;\n components?: IComponentTheme;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/theme.ts"],"names":[],"mappings":"","file":"theme.js","sourcesContent":["import type { IColor } from '@visactor/vrender';\nimport type {\n ArcLabelAttrs,\n BaseLabelAttrs,\n CircleAxisAttributes,\n CircleAxisGridAttributes,\n CircleCrosshairAttrs,\n ColorLegendAttributes,\n ContinuousPlayerAttributes,\n DataLabelAttrs,\n DataZoomAttributes,\n DiscreteLegendAttrs,\n DiscretePlayerAttributes,\n LineAxisAttributes,\n LineAxisGridAttributes,\n LineCrosshairAttrs,\n LineLabelAttrs,\n PolygonCrosshairAttrs,\n RectCrosshairAttrs,\n RectLabelAttrs,\n ScrollBarAttributes,\n SectorCrosshairAttrs,\n SizeLegendAttributes,\n SliderAttributes,\n SymbolLabelAttrs,\n TitleAttrs,\n TooltipAttributes\n} from '@visactor/vrender-components';\nimport type { IPadding } from '@visactor/vutils';\nimport type { RecursivePartial } from './base';\nimport type { BasicEncoderSpecMap } from './mark';\n\n// glyph mark includes multiple types, not support theme for glyph for now\nexport type IMarkTheme = Partial<Omit<BasicEncoderSpecMap, 'glyph'>>;\n\nexport interface IComponentTheme {\n axis?: RecursivePartial<LineAxisAttributes>;\n circleAxis?: RecursivePartial<CircleAxisAttributes>;\n\n grid?: RecursivePartial<LineAxisGridAttributes>;\n circleGrid?: RecursivePartial<CircleAxisGridAttributes>;\n\n discreteLegend?: RecursivePartial<DiscreteLegendAttrs>;\n colorLegend?: RecursivePartial<ColorLegendAttributes>;\n sizeLegend?: RecursivePartial<SizeLegendAttributes>;\n\n lineCrosshair?: RecursivePartial<LineCrosshairAttrs>;\n rectCrosshair?: RecursivePartial<RectCrosshairAttrs>;\n sectorCrosshair?: RecursivePartial<SectorCrosshairAttrs>;\n circleCrosshair?: RecursivePartial<CircleCrosshairAttrs>;\n polygonCrosshair?: RecursivePartial<PolygonCrosshairAttrs>;\n\n slider?: RecursivePartial<SliderAttributes>;\n\n dataLabel?: RecursivePartial<DataLabelAttrs>;\n lineLabel?: RecursivePartial<LineLabelAttrs>;\n rectLabel?: RecursivePartial<RectLabelAttrs>;\n arcLabel?: RecursivePartial<ArcLabelAttrs>;\n symbolLabel?: RecursivePartial<SymbolLabelAttrs>;\n pointLabel?: RecursivePartial<BaseLabelAttrs>;\n\n datazoom?: RecursivePartial<DataZoomAttributes>;\n\n continuousPlayer?: RecursivePartial<ContinuousPlayerAttributes>;\n discretePlayer?: RecursivePartial<DiscretePlayerAttributes>;\n\n tooltip?: RecursivePartial<TooltipAttributes>;\n\n title?: RecursivePartial<TitleAttrs>;\n\n scrollbar?: RecursivePartial<ScrollBarAttributes>;\n}\n\nexport interface ITheme {\n name?: string;\n background?: IColor;\n padding?: IPadding | number;\n palette?: Record<string, IColor[]>;\n marks?: IMarkTheme;\n components?: IComponentTheme;\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import type { EventEmitter, IBounds, ILogger } from '@visactor/vutils';
3
- import type { EnvType, IStage, IColor, IOption3D, ILayer, IStageParams } from '@visactor/vrender-core';
3
+ import type { EnvType, IStage, IColor, IOption3D, ILayer, IStageParams } from '@visactor/vrender';
4
4
  import type { CoordinateType } from '@visactor/vgrammar-coordinate';
5
5
  import type { DataSpec } from './data';
6
6
  import type { SignalFunctionType, SignalSpec } from './signal';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/view.ts"],"names":[],"mappings":"","file":"view.js","sourcesContent":["import type { EventEmitter, IBounds, IBoundsLike, 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 {\n IAxis,\n ICrosshair,\n IDatazoom,\n IDimensionTooltip,\n IGrid,\n ILabel,\n ILegend,\n IPlayer,\n IScrollbar,\n ISlider,\n ITitle,\n ITooltip\n} from './component';\nimport type { CoordinateSpec } from './coordinate';\nimport type { ITheme } from './theme';\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> | string[];\n allow?: boolean | Record<string, boolean> | string[];\n };\n view?: boolean | Record<string, boolean> | string[];\n window?: boolean | Record<string, boolean> | string[];\n disable?: boolean;\n gesture?: boolean;\n drag?: boolean;\n globalCursor?: 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\n /** 是否默认配置hover交互 */\n hover?: boolean;\n /** 是否开启选中交互 */\n select?: boolean;\n\n /** 是否启用 cursor 设置 */\n cursor?: boolean;\n\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 /** worker 专用 */\n domBridge?: any;\n\n /** 生命周期等事件钩子 */\n hooks?: Hooks;\n\n /**\n * 事件相关配置\n * {\n * defaults: {\n * prevent: ['mousemove', 'mouseenter']\n * }\n * }\n */\n eventConfig?: IViewEventConfig;\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 crosshair: (group: IGroupMark | string) => ICrosshair;\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 tooltip: (group: IGroupMark | string) => ITooltip;\n dimensionTooltip: (group: IGroupMark | string) => IDimensionTooltip;\n title: (group: IGroupMark | string) => ITitle;\n scrollbar: (group: IGroupMark | string) => IScrollbar;\n\n addGrammar: (grammar: IGrammarBase) => this;\n removeGrammar: (grammar: string | IGrammarBase) => this;\n removeAllGrammars: () => 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\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}\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, IBoundsLike, ILogger } from '@visactor/vutils';\nimport type { EnvType, IStage, IColor, IOption3D, ILayer, IStageParams } from '@visactor/vrender';\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 {\n IAxis,\n ICrosshair,\n IDatazoom,\n IDimensionTooltip,\n IGrid,\n ILabel,\n ILegend,\n IPlayer,\n IScrollbar,\n ISlider,\n ITitle,\n ITooltip\n} from './component';\nimport type { CoordinateSpec } from './coordinate';\nimport type { ITheme } from './theme';\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> | string[];\n allow?: boolean | Record<string, boolean> | string[];\n };\n view?: boolean | Record<string, boolean> | string[];\n window?: boolean | Record<string, boolean> | string[];\n disable?: boolean;\n gesture?: boolean;\n drag?: boolean;\n globalCursor?: 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\n /** 是否默认配置hover交互 */\n hover?: boolean;\n /** 是否开启选中交互 */\n select?: boolean;\n\n /** 是否启用 cursor 设置 */\n cursor?: boolean;\n\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 /** worker 专用 */\n domBridge?: any;\n\n /** 生命周期等事件钩子 */\n hooks?: Hooks;\n\n /**\n * 事件相关配置\n * {\n * defaults: {\n * prevent: ['mousemove', 'mouseenter']\n * }\n * }\n */\n eventConfig?: IViewEventConfig;\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 crosshair: (group: IGroupMark | string) => ICrosshair;\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 tooltip: (group: IGroupMark | string) => ITooltip;\n dimensionTooltip: (group: IGroupMark | string) => IDimensionTooltip;\n title: (group: IGroupMark | string) => ITitle;\n scrollbar: (group: IGroupMark | string) => IScrollbar;\n\n addGrammar: (grammar: IGrammarBase) => this;\n removeGrammar: (grammar: string | IGrammarBase) => this;\n removeAllGrammars: () => 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\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}\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,4 +1,4 @@
1
- import type { IRichText, IRichTextCharacter } from '@visactor/vrender-core';
1
+ import type { IRichText, IRichTextCharacter } from '@visactor/vrender';
2
2
  export declare function richXul(strings: TemplateStringsArray, ...insertVars: (string | number)[]): {
3
3
  type: string;
4
4
  text: IRichTextCharacter[];
package/cjs/util/text.js CHANGED
@@ -4,19 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.textHtml = exports.richJsx = exports.richXul = void 0;
6
6
 
7
- const vrender_core_1 = require("@visactor/vrender-core"), vutils_1 = require("@visactor/vutils");
7
+ const vrender_1 = require("@visactor/vrender"), vutils_1 = require("@visactor/vutils");
8
8
 
9
9
  function richXul(strings, ...insertVars) {
10
10
  return {
11
11
  type: "rich",
12
- text: (0, vrender_core_1.xul)(strings.reduce(((res, temp, i) => res + temp + (i >= insertVars.length ? "" : insertVars[i])), ""))
12
+ text: (0, vrender_1.xul)(strings.reduce(((res, temp, i) => res + temp + (i >= insertVars.length ? "" : insertVars[i])), ""))
13
13
  };
14
14
  }
15
15
 
16
16
  function richJsx(richText) {
17
17
  return {
18
18
  type: "rich",
19
- text: richText instanceof vrender_core_1.RichText ? richText.attribute.textConfig : (0,
19
+ text: richText instanceof vrender_1.RichText ? richText.attribute.textConfig : (0,
20
20
  vutils_1.isArray)(richText) ? richText.map((entry => entry.type ? entry.attribute : entry)) : []
21
21
  };
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/util/text.ts"],"names":[],"mappings":";;;AACA,yDAAqE;AACrE,6CAA2C;AAE3C,SAAgB,OAAO,CAAC,OAA6B,EAAE,GAAG,UAA+B;IACvF,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAA,kBAAU,EACd,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;YAC9B,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC,EAAE,EAAE,CAAC,CACP;KACF,CAAC;AACJ,CAAC;AATD,0BASC;AAED,SAAgB,OAAO,CACrB,QAA8F;IAE9F,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EACF,QAAQ,YAAY,uBAAQ;YAC1B,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU;YAC/B,CAAC,CAAC,IAAA,gBAAO,EAAC,QAAQ,CAAC;gBACnB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;oBACnB,OAAQ,KAAyD,CAAC,IAAI;wBACpE,CAAC,CAAE,KAAyD,CAAC,SAAS;wBACtE,CAAC,CAAC,KAAK,CAAC;gBACZ,CAAC,CAAC;gBACJ,CAAC,CAAC,EAAE;KACT,CAAC;AACJ,CAAC;AAhBD,0BAgBC;AAED,SAAgB,QAAQ,CAAC,OAA6B,EAAE,GAAG,UAA+B;IACxF,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;YACpC,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC,EAAE,EAAE,CAAC;KACP,CAAC;AACJ,CAAC;AAPD,4BAOC","file":"text.js","sourcesContent":["import type { IRichText, IRichTextCharacter } from '@visactor/vrender-core';\nimport { xul as vRenderXul, RichText } from '@visactor/vrender-core';\nimport { isArray } from '@visactor/vutils';\n\nexport function richXul(strings: TemplateStringsArray, ...insertVars: (string | number)[]) {\n return {\n type: 'rich',\n text: vRenderXul(\n strings.reduce((res, temp, i) => {\n return res + temp + (i >= insertVars.length ? '' : insertVars[i]);\n }, '')\n )\n };\n}\n\nexport function richJsx(\n richText: IRichText | { attribute: IRichTextCharacter; type: string }[] | IRichTextCharacter[]\n) {\n return {\n type: 'rich',\n text:\n richText instanceof RichText\n ? richText.attribute.textConfig\n : isArray(richText)\n ? richText.map(entry => {\n return (entry as { attribute: IRichTextCharacter; type: string }).type\n ? (entry as { attribute: IRichTextCharacter; type: string }).attribute\n : entry;\n })\n : []\n };\n}\n\nexport function textHtml(strings: TemplateStringsArray, ...insertVars: (string | number)[]) {\n return {\n type: 'html',\n text: strings.reduce((res, temp, i) => {\n return res + temp + (i >= insertVars.length ? '' : insertVars[i]);\n }, '')\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/util/text.ts"],"names":[],"mappings":";;;AACA,+CAAgE;AAChE,6CAA2C;AAE3C,SAAgB,OAAO,CAAC,OAA6B,EAAE,GAAG,UAA+B;IACvF,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,IAAA,aAAU,EACd,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;YAC9B,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC,EAAE,EAAE,CAAC,CACP;KACF,CAAC;AACJ,CAAC;AATD,0BASC;AAED,SAAgB,OAAO,CACrB,QAA8F;IAE9F,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EACF,QAAQ,YAAY,kBAAQ;YAC1B,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU;YAC/B,CAAC,CAAC,IAAA,gBAAO,EAAC,QAAQ,CAAC;gBACnB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;oBACnB,OAAQ,KAAyD,CAAC,IAAI;wBACpE,CAAC,CAAE,KAAyD,CAAC,SAAS;wBACtE,CAAC,CAAC,KAAK,CAAC;gBACZ,CAAC,CAAC;gBACJ,CAAC,CAAC,EAAE;KACT,CAAC;AACJ,CAAC;AAhBD,0BAgBC;AAED,SAAgB,QAAQ,CAAC,OAA6B,EAAE,GAAG,UAA+B;IACxF,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE;YACpC,OAAO,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC,EAAE,EAAE,CAAC;KACP,CAAC;AACJ,CAAC;AAPD,4BAOC","file":"text.js","sourcesContent":["import type { IRichText, IRichTextCharacter } from '@visactor/vrender';\nimport { xul as vRenderXul, RichText } from '@visactor/vrender';\nimport { isArray } from '@visactor/vutils';\n\nexport function richXul(strings: TemplateStringsArray, ...insertVars: (string | number)[]) {\n return {\n type: 'rich',\n text: vRenderXul(\n strings.reduce((res, temp, i) => {\n return res + temp + (i >= insertVars.length ? '' : insertVars[i]);\n }, '')\n )\n };\n}\n\nexport function richJsx(\n richText: IRichText | { attribute: IRichTextCharacter; type: string }[] | IRichTextCharacter[]\n) {\n return {\n type: 'rich',\n text:\n richText instanceof RichText\n ? richText.attribute.textConfig\n : isArray(richText)\n ? richText.map(entry => {\n return (entry as { attribute: IRichTextCharacter; type: string }).type\n ? (entry as { attribute: IRichTextCharacter; type: string }).attribute\n : entry;\n })\n : []\n };\n}\n\nexport function textHtml(strings: TemplateStringsArray, ...insertVars: (string | number)[]) {\n return {\n type: 'html',\n text: strings.reduce((res, temp, i) => {\n return res + temp + (i >= insertVars.length ? '' : insertVars[i]);\n }, '')\n };\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import type { IBounds, ILogger } from '@visactor/vutils';
2
2
  import { EventEmitter } from '@visactor/vutils';
3
- import type { IColor } from '@visactor/vrender-core';
3
+ import type { IColor } from '@visactor/vrender';
4
4
  import type { CoordinateType } from '@visactor/vgrammar-coordinate';
5
5
  import type { IData, ISignal, ViewSpec, IView, IViewOptions, IViewThemeConfig, Hooks, IMark, EventSpec, MarkType, GrammarScaleType, SignalFunctionType, IScale, IGrammarBase, IGroupMark, IGlyphMark, ICoordinate, BaseEventHandler, IRecordedGrammars, IComponent, IRunningConfig, IViewAnimate, ITheme } from '../types/';
6
6
  import type { IRenderer } from '../types/renderer';
package/cjs/view/View.js CHANGED
@@ -34,7 +34,7 @@ Object.defineProperty(exports, "__esModule", {
34
34
  value: !0
35
35
  });
36
36
 
37
- const vutils_1 = require("@visactor/vutils"), vrender_core_1 = require("@visactor/vrender-core"), data_1 = require("./data"), events_1 = require("./events"), dataflow_1 = __importDefault(require("./dataflow")), mark_tree_1 = require("../graph/mark-tree"), constants_1 = require("../graph/constants"), canvas_renderer_1 = __importDefault(require("../graph/canvas-renderer")), events_extend_1 = __importDefault(require("../graph/util/events-extend")), constants_2 = require("./constants"), signal_1 = require("./signal"), scale_1 = require("./scale"), view_1 = require("../parse/view"), event_1 = require("../parse/event"), util_1 = require("../parse/util"), env_1 = require("../graph/util/env"), group_1 = require("./group"), mark_1 = require("./mark"), layout_1 = require("../graph/layout/layout"), glyph_1 = require("./glyph"), coordinate_1 = require("./coordinate"), morph_1 = require("../graph/animation/morph"), grammar_record_1 = require("./grammar-record"), animate_1 = require("./animate"), enums_1 = require("../graph/enums"), interval_1 = require("../semantic-marks/interval"), cell_1 = require("../semantic-marks/cell"), text_1 = require("../semantic-marks/text"), theme_manager_1 = require("../theme/theme-manager"), factory_1 = require("../core/factory"), component_1 = require("./component");
37
+ const vutils_1 = require("@visactor/vutils"), vrender_1 = require("@visactor/vrender"), data_1 = require("./data"), events_1 = require("./events"), dataflow_1 = __importDefault(require("./dataflow")), mark_tree_1 = require("../graph/mark-tree"), constants_1 = require("../graph/constants"), canvas_renderer_1 = __importDefault(require("../graph/canvas-renderer")), events_extend_1 = __importDefault(require("../graph/util/events-extend")), constants_2 = require("./constants"), signal_1 = require("./signal"), scale_1 = require("./scale"), view_1 = require("../parse/view"), event_1 = require("../parse/event"), util_1 = require("../parse/util"), env_1 = require("../graph/util/env"), group_1 = require("./group"), mark_1 = require("./mark"), layout_1 = require("../graph/layout/layout"), glyph_1 = require("./glyph"), coordinate_1 = require("./coordinate"), morph_1 = require("../graph/animation/morph"), grammar_record_1 = require("./grammar-record"), animate_1 = require("./animate"), enums_1 = require("../graph/enums"), interval_1 = require("../semantic-marks/interval"), cell_1 = require("../semantic-marks/cell"), text_1 = require("../semantic-marks/text"), theme_manager_1 = require("../theme/theme-manager"), factory_1 = require("../core/factory"), component_1 = require("./component");
38
38
 
39
39
  class View extends vutils_1.EventEmitter {
40
40
  static useRegisters(comps) {
@@ -635,14 +635,14 @@ class View extends vutils_1.EventEmitter {
635
635
  () => {
636
636
  this.removeEventListener(type, send);
637
637
  };
638
- } else if (source === constants_2.EVENT_SOURCE_WINDOW) return vrender_core_1.vglobal.addEventListener(type, send),
638
+ } else if (source === constants_2.EVENT_SOURCE_WINDOW) return vrender_1.vglobal.addEventListener(type, send),
639
639
  this._eventListeners.push({
640
640
  type: type,
641
- source: vrender_core_1.vglobal,
641
+ source: vrender_1.vglobal,
642
642
  handler: send
643
643
  }), () => {
644
- vrender_core_1.vglobal.removeEventListener(type, send);
645
- const index = this._eventListeners.findIndex((entry => entry.type === type && entry.source === vrender_core_1.vglobal && entry.handler === send));
644
+ vrender_1.vglobal.removeEventListener(type, send);
645
+ const index = this._eventListeners.findIndex((entry => entry.type === type && entry.source === vrender_1.vglobal && entry.handler === send));
646
646
  index >= 0 && this._eventListeners.splice(index, 1);
647
647
  };
648
648
  }
@@ -768,13 +768,13 @@ class View extends vutils_1.EventEmitter {
768
768
  }
769
769
  doPreProgressive() {
770
770
  if (this._progressiveMarks && this._progressiveMarks.some((mark => mark.isDoingProgressive()))) {
771
- const raf = vrender_core_1.vglobal.getRequestAnimationFrame();
771
+ const raf = vrender_1.vglobal.getRequestAnimationFrame();
772
772
  this._progressiveRafId = raf(this.handleProgressiveFrame);
773
773
  }
774
774
  }
775
775
  clearProgressive() {
776
776
  if (this._progressiveRafId) {
777
- vrender_core_1.vglobal.getCancelAnimationFrame()(this._progressiveRafId);
777
+ vrender_1.vglobal.getCancelAnimationFrame()(this._progressiveRafId);
778
778
  }
779
779
  this._progressiveMarks && this._progressiveMarks.length && (this._progressiveMarks.forEach((entry => {
780
780
  entry.clearProgressive();