@visactor/vgrammar-core 0.8.0 → 0.8.2

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 (272) hide show
  1. package/cjs/component/axis.js +9 -9
  2. package/cjs/component/axis.js.map +1 -1
  3. package/cjs/component/datazoom.js +9 -9
  4. package/cjs/component/datazoom.js.map +1 -1
  5. package/cjs/component/grid.js +18 -18
  6. package/cjs/component/grid.js.map +1 -1
  7. package/cjs/component/label.js +27 -22
  8. package/cjs/component/label.js.map +1 -1
  9. package/cjs/component/legend.js +13 -13
  10. package/cjs/component/legend.js.map +1 -1
  11. package/cjs/component/scrollbar.js +7 -7
  12. package/cjs/component/scrollbar.js.map +1 -1
  13. package/cjs/component/slider.js +5 -5
  14. package/cjs/component/slider.js.map +1 -1
  15. package/cjs/component/title.js +5 -5
  16. package/cjs/component/title.js.map +1 -1
  17. package/cjs/core/factory.d.ts +5 -1
  18. package/cjs/core/factory.js +13 -3
  19. package/cjs/core/factory.js.map +1 -1
  20. package/cjs/graph/animation/animate.d.ts +1 -0
  21. package/cjs/graph/animation/animate.js +4 -0
  22. package/cjs/graph/animation/animate.js.map +1 -1
  23. package/cjs/graph/animation/animation/move.js +10 -8
  24. package/cjs/graph/animation/animation/move.js.map +1 -1
  25. package/cjs/graph/attributes/common.js +2 -10
  26. package/cjs/graph/attributes/common.js.map +1 -1
  27. package/cjs/graph/attributes/helpers.d.ts +2 -2
  28. package/cjs/graph/attributes/helpers.js +50 -17
  29. package/cjs/graph/attributes/helpers.js.map +1 -1
  30. package/cjs/graph/attributes/index.d.ts +4 -10
  31. package/cjs/graph/attributes/index.js +16 -251
  32. package/cjs/graph/attributes/index.js.map +1 -1
  33. package/cjs/graph/attributes/line.d.ts +3 -0
  34. package/cjs/graph/attributes/line.js +46 -0
  35. package/cjs/graph/attributes/line.js.map +1 -0
  36. package/cjs/graph/attributes/transform.d.ts +5 -0
  37. package/cjs/graph/attributes/transform.js +167 -0
  38. package/cjs/graph/attributes/transform.js.map +1 -0
  39. package/cjs/graph/canvas-renderer.js +1 -1
  40. package/cjs/graph/canvas-renderer.js.map +1 -1
  41. package/cjs/graph/constants.d.ts +0 -1
  42. package/cjs/graph/constants.js +2 -3
  43. package/cjs/graph/constants.js.map +1 -1
  44. package/cjs/graph/element.js +12 -14
  45. package/cjs/graph/element.js.map +1 -1
  46. package/cjs/graph/glyph-element.js +6 -7
  47. package/cjs/graph/glyph-element.js.map +1 -1
  48. package/cjs/graph/layout/relative.js.map +1 -1
  49. package/cjs/graph/mark/encode.js +4 -4
  50. package/cjs/graph/mark/encode.js.map +1 -1
  51. package/cjs/index.d.ts +3 -1
  52. package/cjs/index.js +3 -2
  53. package/cjs/index.js.map +1 -1
  54. package/cjs/interactions/base.js.map +1 -1
  55. package/cjs/interactions/brush-base.js +2 -2
  56. package/cjs/interactions/brush-base.js.map +1 -1
  57. package/cjs/interactions/brush-filter.js +2 -2
  58. package/cjs/interactions/brush-filter.js.map +1 -1
  59. package/cjs/interactions/crosshair.d.ts +1 -1
  60. package/cjs/interactions/crosshair.js +15 -15
  61. package/cjs/interactions/crosshair.js.map +1 -1
  62. package/cjs/interactions/datazoom-filter.js +3 -3
  63. package/cjs/interactions/datazoom-filter.js.map +1 -1
  64. package/cjs/interactions/drill-down.js +2 -2
  65. package/cjs/interactions/drill-down.js.map +1 -1
  66. package/cjs/interactions/legend-filter.js +3 -3
  67. package/cjs/interactions/legend-filter.js.map +1 -1
  68. package/cjs/interactions/player-filter.js +3 -3
  69. package/cjs/interactions/player-filter.js.map +1 -1
  70. package/cjs/interactions/roll-up.js +2 -2
  71. package/cjs/interactions/roll-up.js.map +1 -1
  72. package/cjs/interactions/scrollbar-filter.js +3 -3
  73. package/cjs/interactions/scrollbar-filter.js.map +1 -1
  74. package/cjs/interactions/slider-filter.js +3 -3
  75. package/cjs/interactions/slider-filter.js.map +1 -1
  76. package/cjs/parse/view.js +1 -1
  77. package/cjs/parse/view.js.map +1 -1
  78. package/cjs/semantic-marks/cell.d.ts +3 -1
  79. package/cjs/semantic-marks/cell.js +10 -4
  80. package/cjs/semantic-marks/cell.js.map +1 -1
  81. package/cjs/semantic-marks/interval.d.ts +2 -0
  82. package/cjs/semantic-marks/interval.js +10 -4
  83. package/cjs/semantic-marks/interval.js.map +1 -1
  84. package/cjs/semantic-marks/text.d.ts +1 -0
  85. package/cjs/semantic-marks/text.js +3 -3
  86. package/cjs/semantic-marks/text.js.map +1 -1
  87. package/cjs/theme/common/component.d.ts +2 -1
  88. package/cjs/theme/common/component.js +13 -1
  89. package/cjs/theme/common/component.js.map +1 -1
  90. package/cjs/theme/dark.js.map +1 -1
  91. package/cjs/transforms/data/sampling.d.ts +2 -0
  92. package/cjs/transforms/data/sampling.js +111 -0
  93. package/cjs/transforms/data/sampling.js.map +1 -0
  94. package/cjs/transforms/index.d.ts +1 -1
  95. package/cjs/transforms/index.js +6 -6
  96. package/cjs/transforms/index.js.map +1 -1
  97. package/cjs/transforms/util/util.d.ts +4 -0
  98. package/cjs/transforms/util/util.js +20 -2
  99. package/cjs/transforms/util/util.js.map +1 -1
  100. package/cjs/types/animate.d.ts +6 -1
  101. package/cjs/types/animate.js.map +1 -1
  102. package/cjs/types/grammar.d.ts +1 -1
  103. package/cjs/types/grammar.js.map +1 -1
  104. package/cjs/types/mark.d.ts +5 -1
  105. package/cjs/types/mark.js.map +1 -1
  106. package/cjs/types/theme.d.ts +2 -1
  107. package/cjs/types/theme.js.map +1 -1
  108. package/cjs/types/transform.d.ts +5 -5
  109. package/cjs/types/transform.js.map +1 -1
  110. package/cjs/types/view.d.ts +2 -0
  111. package/cjs/types/view.js.map +1 -1
  112. package/cjs/view/View.d.ts +0 -1
  113. package/cjs/view/View.js +18 -27
  114. package/cjs/view/View.js.map +1 -1
  115. package/cjs/view/animate.d.ts +1 -0
  116. package/cjs/view/animate.js +12 -12
  117. package/cjs/view/animate.js.map +1 -1
  118. package/cjs/view/constants.d.ts +0 -3
  119. package/cjs/view/constants.js +2 -3
  120. package/cjs/view/constants.js.map +1 -1
  121. package/cjs/view/dataflow.d.ts +1 -0
  122. package/cjs/view/dataflow.js +9 -4
  123. package/cjs/view/dataflow.js.map +1 -1
  124. package/cjs/view/grammar-record.js +5 -5
  125. package/cjs/view/grammar-record.js.map +1 -1
  126. package/cjs/view/mark.js +1 -1
  127. package/cjs/view/mark.js.map +1 -1
  128. package/es/component/axis.js +1 -1
  129. package/es/component/axis.js.map +1 -1
  130. package/es/component/datazoom.js +5 -5
  131. package/es/component/datazoom.js.map +1 -1
  132. package/es/component/grid.js +1 -1
  133. package/es/component/grid.js.map +1 -1
  134. package/es/component/label.js +13 -8
  135. package/es/component/label.js.map +1 -1
  136. package/es/component/legend.js +1 -1
  137. package/es/component/legend.js.map +1 -1
  138. package/es/component/scrollbar.js +1 -1
  139. package/es/component/scrollbar.js.map +1 -1
  140. package/es/component/slider.js +1 -1
  141. package/es/component/slider.js.map +1 -1
  142. package/es/component/title.js +1 -1
  143. package/es/component/title.js.map +1 -1
  144. package/es/core/factory.d.ts +5 -1
  145. package/es/core/factory.js +11 -1
  146. package/es/core/factory.js.map +1 -1
  147. package/es/graph/animation/animate.d.ts +1 -0
  148. package/es/graph/animation/animate.js +4 -0
  149. package/es/graph/animation/animate.js.map +1 -1
  150. package/es/graph/animation/animation/move.js +5 -5
  151. package/es/graph/animation/animation/move.js.map +1 -1
  152. package/es/graph/attributes/common.js +2 -7
  153. package/es/graph/attributes/common.js.map +1 -1
  154. package/es/graph/attributes/helpers.d.ts +2 -2
  155. package/es/graph/attributes/helpers.js +46 -12
  156. package/es/graph/attributes/helpers.js.map +1 -1
  157. package/es/graph/attributes/index.d.ts +4 -10
  158. package/es/graph/attributes/index.js +4 -227
  159. package/es/graph/attributes/index.js.map +1 -1
  160. package/es/graph/attributes/line.d.ts +3 -0
  161. package/es/graph/attributes/line.js +42 -0
  162. package/es/graph/attributes/line.js.map +1 -0
  163. package/es/graph/attributes/transform.d.ts +5 -0
  164. package/es/graph/attributes/transform.js +153 -0
  165. package/es/graph/attributes/transform.js.map +1 -0
  166. package/es/graph/canvas-renderer.js +1 -1
  167. package/es/graph/canvas-renderer.js.map +1 -1
  168. package/es/graph/constants.d.ts +0 -1
  169. package/es/graph/constants.js +0 -2
  170. package/es/graph/constants.js.map +1 -1
  171. package/es/graph/element.js +11 -11
  172. package/es/graph/element.js.map +1 -1
  173. package/es/graph/glyph-element.js +3 -4
  174. package/es/graph/glyph-element.js.map +1 -1
  175. package/es/graph/layout/relative.js.map +1 -1
  176. package/es/graph/mark/encode.js +1 -1
  177. package/es/graph/mark/encode.js.map +1 -1
  178. package/es/index.d.ts +3 -1
  179. package/es/index.js +5 -1
  180. package/es/index.js.map +1 -1
  181. package/es/interactions/base.js.map +1 -1
  182. package/es/interactions/brush-base.js +1 -1
  183. package/es/interactions/brush-base.js.map +1 -1
  184. package/es/interactions/brush-filter.js +2 -3
  185. package/es/interactions/brush-filter.js.map +1 -1
  186. package/es/interactions/crosshair.d.ts +1 -1
  187. package/es/interactions/crosshair.js +1 -1
  188. package/es/interactions/crosshair.js.map +1 -1
  189. package/es/interactions/datazoom-filter.js +1 -1
  190. package/es/interactions/datazoom-filter.js.map +1 -1
  191. package/es/interactions/drill-down.js +1 -1
  192. package/es/interactions/drill-down.js.map +1 -1
  193. package/es/interactions/element-highlight-by-group.js +2 -1
  194. package/es/interactions/index.js +1 -2
  195. package/es/interactions/legend-filter.js +2 -2
  196. package/es/interactions/legend-filter.js.map +1 -1
  197. package/es/interactions/player-filter.js +2 -2
  198. package/es/interactions/player-filter.js.map +1 -1
  199. package/es/interactions/roll-up.js +2 -2
  200. package/es/interactions/roll-up.js.map +1 -1
  201. package/es/interactions/scrollbar-filter.js +2 -2
  202. package/es/interactions/scrollbar-filter.js.map +1 -1
  203. package/es/interactions/slider-filter.js +2 -2
  204. package/es/interactions/slider-filter.js.map +1 -1
  205. package/es/interactions/tooltip.js +1 -1
  206. package/es/interactions/view-drag-mixin.js +1 -1
  207. package/es/parse/coordinate.js +1 -1
  208. package/es/parse/event.js +1 -1
  209. package/es/parse/mark.js +1 -1
  210. package/es/parse/option.js +1 -1
  211. package/es/parse/scale.js +2 -1
  212. package/es/parse/transform.js +1 -1
  213. package/es/parse/util.js +1 -1
  214. package/es/parse/view.js +2 -2
  215. package/es/parse/view.js.map +1 -1
  216. package/es/semantic-marks/cell.d.ts +3 -1
  217. package/es/semantic-marks/cell.js +11 -1
  218. package/es/semantic-marks/cell.js.map +1 -1
  219. package/es/semantic-marks/interval.d.ts +2 -0
  220. package/es/semantic-marks/interval.js +9 -1
  221. package/es/semantic-marks/interval.js.map +1 -1
  222. package/es/semantic-marks/text.d.ts +1 -0
  223. package/es/semantic-marks/text.js +3 -1
  224. package/es/semantic-marks/text.js.map +1 -1
  225. package/es/theme/common/component.d.ts +2 -1
  226. package/es/theme/common/component.js +14 -0
  227. package/es/theme/common/component.js.map +1 -1
  228. package/es/theme/dark.js.map +1 -1
  229. package/es/transforms/data/sampling.d.ts +2 -0
  230. package/es/transforms/data/sampling.js +105 -0
  231. package/es/transforms/data/sampling.js.map +1 -0
  232. package/es/transforms/index.d.ts +1 -1
  233. package/es/transforms/index.js +4 -4
  234. package/es/transforms/index.js.map +1 -1
  235. package/es/transforms/util/util.d.ts +4 -0
  236. package/es/transforms/util/util.js +17 -0
  237. package/es/transforms/util/util.js.map +1 -1
  238. package/es/types/animate.d.ts +6 -1
  239. package/es/types/animate.js.map +1 -1
  240. package/es/types/grammar.d.ts +1 -1
  241. package/es/types/grammar.js.map +1 -1
  242. package/es/types/mark.d.ts +5 -1
  243. package/es/types/mark.js.map +1 -1
  244. package/es/types/theme.d.ts +2 -1
  245. package/es/types/theme.js.map +1 -1
  246. package/es/types/transform.d.ts +5 -5
  247. package/es/types/transform.js.map +1 -1
  248. package/es/types/view.d.ts +2 -0
  249. package/es/types/view.js.map +1 -1
  250. package/es/view/View.d.ts +0 -1
  251. package/es/view/View.js +15 -29
  252. package/es/view/View.js.map +1 -1
  253. package/es/view/animate.d.ts +1 -0
  254. package/es/view/animate.js +6 -6
  255. package/es/view/animate.js.map +1 -1
  256. package/es/view/constants.d.ts +0 -3
  257. package/es/view/constants.js +0 -6
  258. package/es/view/constants.js.map +1 -1
  259. package/es/view/dataflow.d.ts +1 -0
  260. package/es/view/dataflow.js +9 -4
  261. package/es/view/dataflow.js.map +1 -1
  262. package/es/view/grammar-record.js +1 -1
  263. package/es/view/grammar-record.js.map +1 -1
  264. package/es/view/mark.js +1 -1
  265. package/es/view/mark.js.map +1 -1
  266. package/package.json +9 -9
  267. package/cjs/transforms/mark/lttb-sample.d.ts +0 -2
  268. package/cjs/transforms/mark/lttb-sample.js +0 -68
  269. package/cjs/transforms/mark/lttb-sample.js.map +0 -1
  270. package/es/transforms/mark/lttb-sample.d.ts +0 -2
  271. package/es/transforms/mark/lttb-sample.js +0 -60
  272. package/es/transforms/mark/lttb-sample.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/mark.ts"],"names":[],"mappings":"","file":"mark.js","sourcesContent":["import type {\n ICustomPath2D,\n IPyramid3dGraphicAttribute,\n IArc3dGraphicAttribute,\n IRect3dGraphicAttribute,\n ISymbolAttribute,\n IRectGraphicAttribute,\n ILineGraphicAttribute,\n ICircleGraphicAttribute,\n IArcGraphicAttribute,\n IPolygonGraphicAttribute,\n IAreaGraphicAttribute,\n IGlyphGraphicAttribute,\n IImageGraphicAttribute,\n IPathGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute,\n IGraphicAttribute,\n IGroupGraphicAttribute,\n IRichTextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { Bounds, IPointLike } from '@visactor/vutils';\nimport type { IAnimationConfig, IStateAnimationConfig } from './animate';\nimport type { IElement } from './element';\nimport type { IMark, IScale, IGroupMark, ICoordinate, GrammarSpec, IData } from './grammar';\nimport type { GenericFunctionType } from './signal';\nimport type { TransformSpec } from './transform';\nimport type { CommonPaddingSpec } from './base';\nimport type { ILayoutOptions } from './view';\nimport type {\n AxisSpec,\n BuiltInComponentSpec,\n DatazoomSpec,\n LabelSpec,\n LegendSpec,\n PlayerSpec,\n SliderSpec\n} from './component';\nimport type { GrammarMarkType } from '../graph/enums';\n\nexport type MarkFunctionCallback<T> = (datum: any, element: IElement, parameters: any) => T;\n\nexport type MarkFunctionType<T> = GenericFunctionType<MarkFunctionCallback<T>, T>;\n\nexport type MarkType = keyof typeof GrammarMarkType | string;\n\nexport interface MarkFromSpec {\n data: string | IData;\n transform?: {\n name: string;\n transform?: TransformSpec[];\n };\n}\n\nexport type MarkStateSpec = MarkFunctionType<string | string[]>;\n\nexport type ScaleEncodeType = {\n scale: IScale | string;\n field?: string | ((datum: any) => any) | string[] | ((datum: any) => any)[];\n value?: any;\n band?: number;\n offset?: number;\n};\n\nexport type FieldEncodeType = {\n field: string | ((datum: any) => any) | string[] | ((datum: any) => any)[];\n};\n\nexport type ChannelEncodeType<T = any> = MarkFunctionType<T> | ScaleEncodeType | FieldEncodeType;\n\nexport type GenerateEncoderSpec<T> = {\n [Key in keyof T]?: ChannelEncodeType<T[Key]>;\n};\n\n/**\n * the common channel supported by graphic marks\n */\nexport type GenerateBasicEncoderSpec<T> = Partial<\n Omit<\n T,\n | 'strokeSeg'\n | 'boundsPadding'\n | 'pickMode'\n | 'boundsMode'\n | 'customPickShape'\n | 'pickable'\n | 'childrenPickable'\n | 'visible'\n | 'zIndex'\n | 'layout'\n | 'keepDirIn3d'\n | 'postMatrix'\n | 'anchor'\n | 'anchor3d'\n >\n>;\n\nexport type BasicEncoderSpecMap = {\n rect: GenerateBasicEncoderSpec<IRectGraphicAttribute & { y1?: number; x1?: number }>;\n line: Omit<GenerateBasicEncoderSpec<ILineGraphicAttribute>, 'points' | 'segments'>;\n circle: GenerateBasicEncoderSpec<ICircleGraphicAttribute>;\n arc: GenerateBasicEncoderSpec<IArcGraphicAttribute>;\n polygon: GenerateBasicEncoderSpec<IPolygonGraphicAttribute>;\n arc3d: GenerateBasicEncoderSpec<IArc3dGraphicAttribute>;\n pyramid3d: GenerateBasicEncoderSpec<IPyramid3dGraphicAttribute>;\n area: Omit<GenerateBasicEncoderSpec<IAreaGraphicAttribute>, 'points' | 'segments'>;\n group: GenerateBasicEncoderSpec<IGroupGraphicAttribute>;\n glyph: GenerateBasicEncoderSpec<IGlyphGraphicAttribute & any>;\n image: GenerateBasicEncoderSpec<IImageGraphicAttribute>;\n rect3d: GenerateBasicEncoderSpec<IRect3dGraphicAttribute>;\n path: GenerateBasicEncoderSpec<IPathGraphicAttribute>;\n rule: Omit<GenerateBasicEncoderSpec<ILineGraphicAttribute>, 'points' | 'segments'> & { x1?: number; y1?: number };\n shape: GenerateBasicEncoderSpec<IPathGraphicAttribute>;\n symbol: GenerateBasicEncoderSpec<ISymbolGraphicAttribute> & {\n shape?: ISymbolGraphicAttribute['symbolType'];\n image?: ISymbolGraphicAttribute['background'];\n };\n text: GenerateBasicEncoderSpec<ITextGraphicAttribute> & {\n limit?: number;\n autoLimit?: number;\n };\n richtext: GenerateBasicEncoderSpec<IRichTextGraphicAttribute>;\n interval: Omit<GenerateBasicEncoderSpec<IRectGraphicAttribute>, 'width' | 'height'> & {\n /**\n * the gap for two graphic elements\n */\n innerGap?: number | string;\n /**\n * only used for rect / interval mark\n */\n maxWidth?: number;\n minWidth?: number;\n /** the gap between two category */\n categoryGap?: number | string;\n };\n cell: GenerateBasicEncoderSpec<ISymbolGraphicAttribute> & {\n padding?: number | [number, number];\n shape?: ISymbolAttribute['symbolType'];\n };\n};\nexport type GenerateBaseEncodeSpec<BasicSpec = GenerateBasicEncoderSpec<IGraphicAttribute>> =\n | GenerateEncoderSpec<BasicSpec>\n | MarkFunctionCallback<BasicSpec>;\n\nexport type StateProxyEncodeSpec<T = any> = (datum: any, element: IElement, state: string, nextStates: string[]) => T;\n\nexport type StateEncodeSpec<BasicSpec = GenerateBasicEncoderSpec<IGraphicAttribute>> =\n | {\n enter?: GenerateBaseEncodeSpec<BasicSpec>;\n update?: GenerateBaseEncodeSpec<BasicSpec>;\n exit?: GenerateBaseEncodeSpec<BasicSpec>;\n }\n | {\n [state: string]: GenerateEncoderSpec<BasicSpec> | StateProxyEncodeSpec<BasicSpec>;\n };\n\nexport type MarkAnimationSpec = Record<string, IAnimationConfig | IAnimationConfig[]> & {\n state?: IStateAnimationConfig;\n};\n\n// TODO: support string[]\nexport type MarkKeySpec = string | ((datum: any) => string);\n\nexport type MarkSortSpec = (datumA: any, datumB: any) => number;\n\nexport type MarkStateSortSpec = (stateA: string, stateB: string) => number;\n\nexport interface MarkGridContainerSpec extends MarkBaseLayoutSpec {\n display: 'grid';\n gridTemplateRows?: (number | string | 'auto')[];\n gridTemplateColumns?: (number | string | 'auto')[];\n gridRowGap?: number;\n gridColumnGap?: number;\n}\n\nexport interface MarkGridItemSpec extends MarkBaseLayoutSpec {\n gridRowStart?: number;\n gridRowEnd?: number;\n gridColumnStart?: number;\n gridColumnEnd?: number;\n}\n\nexport interface MarkBaseLayoutSpec {\n callback?: MarkLayoutCallback;\n skipBeforeLayouted?: boolean;\n updateViewSignals?: boolean;\n}\n\nexport interface MarkRelativeItemSpec extends MarkBaseLayoutSpec {\n position?: 'top' | 'bottom' | 'left' | 'right' | 'content' | 'auto' | string;\n padding?: CommonPaddingSpec;\n align?: 'left' | 'right' | 'center' | 'top' | 'bottom' | 'middle';\n order?: number;\n}\n\nexport interface MarkRelativeContainerSpec extends MarkBaseLayoutSpec {\n display: 'relative';\n maxChildWidth?: string | number;\n maxChildHeight?: string | number;\n}\n\nexport type MarkLayoutSpec =\n | MarkGridContainerSpec\n | MarkGridItemSpec\n | MarkRelativeContainerSpec\n | MarkRelativeItemSpec;\n\nexport type MarkLayoutCallback = (\n group: IGroupMark,\n children: IMark[],\n parentLayoutBounds: Bounds,\n options?: ILayoutOptions\n) => void;\n\nexport interface IMarkConfig {\n clip?: boolean;\n zIndex?: number;\n interactive?: boolean;\n context?: any;\n /**\n * set customized shape\n */\n setCustomizedShape?: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D;\n /** 是否开启大数据渲染模式 */\n large?: boolean;\n /** 开启大数据渲染优化的阀值,对应的是data的长度 */\n largeThreshold?: number;\n /** 分片长度 */\n progressiveStep?: number;\n /** 开启分片渲染的阀值,对应的是单系列data的长度 */\n progressiveThreshold?: number;\n /**\n * use 'sequential' for symbol chart\n * use 'mod' for bar/line chart\n */\n // largeChunkMode?: 'sequential' | 'mod';\n support3d?: boolean;\n /**\n * enable global morphing animation of the mark\n */\n morph?: boolean;\n /**\n * this key will be used to match the mark to morph\n */\n morphKey?: string;\n /**\n * this key will be used to match the element of two marks to morph\n * If not specified, we'll use the \"key\" of the mark by default\n */\n morphElementKey?: string;\n /** transforms of attributes */\n attributeTransforms?: AttributeTransform[];\n}\n\n/**\n * Base mark specification type\n */\nexport interface GenerateMarkSpec<T extends MarkType = string, P = any> extends IMarkConfig, GrammarSpec {\n type: T;\n name?: string;\n group?: string | IGroupMark;\n // data attributes\n from?: MarkFromSpec;\n key?: MarkKeySpec;\n /**\n * sort all the elements in the mark\n */\n sort?: MarkSortSpec;\n /**\n * set the group key of the mark\n */\n groupBy?: MarkKeySpec;\n /**\n * sort the data of each group\n */\n groupSort?: MarkSortSpec;\n context?: any;\n // coordinate attributes\n coordinate?: string | ICoordinate;\n // encode attributes\n state?: MarkStateSpec;\n stateSort?: MarkStateSortSpec;\n encode?: GetEncoderSpecByType<T, P>;\n // animation attributes\n animationState?: MarkFunctionType<string>;\n animation?: MarkAnimationSpec;\n transform?: TransformSpec[];\n layout?: MarkLayoutSpec | MarkLayoutCallback;\n}\n\nexport type CircleMarkSpec = GenerateMarkSpec<'circle'>;\nexport type ArcMarkSpec = GenerateMarkSpec<'arc'>;\nexport type AreaMarkSpec = GenerateMarkSpec<'area'>;\nexport type LineMarkSpec = GenerateMarkSpec<'line'>;\nexport type RectMarkSpec = GenerateMarkSpec<'rect'>;\nexport type ImageMarkSpec = GenerateMarkSpec<'image'>;\nexport type PathMarkSpec = GenerateMarkSpec<'path'>;\nexport type RuleMarkSpec = GenerateMarkSpec<'rule'>;\nexport type ShapeMarkSpec = GenerateMarkSpec<'shape'>;\nexport type SymbolMarkSpec = GenerateMarkSpec<'symbol'>;\nexport type TextMarkSpec = GenerateMarkSpec<'text'>;\nexport type RichTextMarkSpec = GenerateMarkSpec<'richtext'>;\nexport type PolygonMarkSpec = GenerateMarkSpec<'polygon'>;\nexport type CellMarkSpec = GenerateMarkSpec<'cell'>;\nexport type IntervalMarkSpec = GenerateMarkSpec<'interval'>;\nexport type Arc3dMarkSpec = GenerateMarkSpec<'arc3d'>;\nexport type Pyramid3dMarkSpec = GenerateMarkSpec<'pyramid3d'>;\nexport type Rect3dMarkSpec = GenerateMarkSpec<'rect3d'>;\n\nexport type BasicGlyphEncoderSpec = BasicEncoderSpecMap['glyph'];\nexport type BasicGroupEncoderSpec = BasicEncoderSpecMap['group'];\nexport interface GroupMarkSpec extends GenerateMarkSpec<'group'> {\n marks?: MarkSpec[];\n}\n\nexport interface GlyphMarkSpec<CustomizedEncoderSpec = any> extends GenerateMarkSpec<'glyph', CustomizedEncoderSpec> {\n glyphType: string;\n glyphConfig?: any;\n}\n\nexport interface BoxPlotEncoderSpec extends BasicGlyphEncoderSpec {\n boxWidth?: number;\n boxHeight?: number;\n ruleWidth?: number;\n ruleHeight?: number;\n q1?: number;\n q3?: number;\n min?: number;\n max?: number;\n median?: number;\n angle?: number;\n anchor?: [number, number];\n}\n\nexport interface BarBoxPlotEncoderSpec extends BasicGlyphEncoderSpec {\n minMaxWidth?: number;\n q1q3Width?: number;\n minMaxHeight?: number;\n q1q3Height?: number;\n q1?: number;\n q3?: number;\n min?: number;\n max?: number;\n median?: number;\n angle?: number;\n lineWidth?: number;\n minMaxFillOpacity?: number;\n anchor?: [number, number];\n}\n\nexport interface LinkPathEncoderSpec extends BasicGlyphEncoderSpec {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n thickness: number;\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n ratio?: number;\n align?: 'start' | 'end' | 'center';\n pathType?: 'line' | 'smooth' | 'polyline';\n endArrow?: boolean;\n startArrow?: boolean;\n backgroundStyle?: any;\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\nexport interface TreePathEncoderSpec extends BasicGlyphEncoderSpec {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n align?: 'start' | 'end' | 'center';\n pathType?: 'line' | 'smooth' | 'polyline';\n startArrowStyle?: Partial<IGraphicAttribute>;\n endArrowStyle?: Partial<IGraphicAttribute>;\n endArrow?: boolean;\n startArrow?: boolean;\n arrowSize?: number;\n backgroundStyle?: any;\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\n\nexport interface RipplePointEncoderSpec extends BasicGlyphEncoderSpec {\n ripple?: number;\n size?: number;\n}\n\nexport interface ViolinEncoderSpec extends BasicGlyphEncoderSpec {\n violinFill: string;\n violinStroke: string;\n medianFill?: string;\n density?: IPointLike[];\n boxWidth?: number;\n q1?: number;\n q3?: number;\n min?: number;\n max?: number;\n median?: number;\n angle?: number;\n anchor?: [number, number];\n}\n\nexport interface WaveEncoderSpec extends BasicGlyphEncoderSpec {\n wave?: number;\n}\nexport interface BoxPlotGlyphSpec extends GlyphMarkSpec<BoxPlotEncoderSpec> {\n glyphType: 'boxplot';\n}\nexport interface BarBoxPlotGlyphSpec extends GlyphMarkSpec<BarBoxPlotEncoderSpec> {\n glyphType: 'barBoxplot';\n}\nexport interface LinkPathGlyphSpec extends GlyphMarkSpec<LinkPathEncoderSpec> {\n glyphType: 'linkPath';\n}\nexport interface TreePathGlyphSpec extends GlyphMarkSpec<TreePathEncoderSpec> {\n glyphType: 'treePath';\n}\nexport interface RipplePointGlyphSpec extends GlyphMarkSpec<RipplePointEncoderSpec> {\n glyphType: 'ripplePoint';\n}\nexport interface ViolinGlyphSpec extends GlyphMarkSpec<ViolinEncoderSpec> {\n glyphType: 'violin';\n}\nexport interface WaveGlyphSpec extends GlyphMarkSpec<WaveEncoderSpec> {\n glyphType: 'wave';\n}\n\nexport interface ComponentSpec<\n BasicEncoderSpec extends GenerateBasicEncoderSpec<IGraphicAttribute> = GenerateBasicEncoderSpec<IGraphicAttribute>\n> extends GenerateMarkSpec<'component', BasicEncoderSpec> {\n componentType: string;\n componentConfig?: any;\n mode?: '2d' | '3d';\n}\n\nexport type BaseMarkSpec = GenerateMarkSpec<MarkType>;\nexport type MarkSpecMap = {\n circle: CircleMarkSpec;\n arc: ArcMarkSpec;\n area: AreaMarkSpec;\n image: ImageMarkSpec;\n line: LineMarkSpec;\n path: PathMarkSpec;\n rule: RuleMarkSpec;\n shape: ShapeMarkSpec;\n symbol: SymbolMarkSpec;\n text: TextMarkSpec;\n richtext: RichTextMarkSpec;\n polygon: PolygonMarkSpec;\n cell: CellMarkSpec;\n interval: IntervalMarkSpec;\n rect: RectMarkSpec;\n rect3d: Rect3dMarkSpec;\n arc3d: Arc3dMarkSpec;\n pyramid3d: Pyramid3dMarkSpec;\n group: GroupMarkSpec;\n glyph: GlyphMarkSpec;\n linkPath: LinkPathGlyphSpec;\n treePath: TreePathGlyphSpec;\n wave: WaveEncoderSpec;\n ripplePoint: RipplePointGlyphSpec;\n barBoxplot: BarBoxPlotGlyphSpec;\n boxPlot: BoxPlotGlyphSpec;\n component: ComponentSpec;\n axis: AxisSpec;\n legend: LegendSpec;\n slider: SliderSpec;\n datazoom: DatazoomSpec;\n label: LabelSpec;\n player: PlayerSpec;\n};\n\nexport type GetMarkSpecByType<T, P = any> = T extends keyof MarkSpecMap ? MarkSpecMap[T] : GenerateMarkSpec<string, P>;\nexport type GetBasicEncoderSpecByType<T, P = any> = T extends keyof BasicEncoderSpecMap\n ? BasicEncoderSpecMap[T]\n : GenerateBasicEncoderSpec<IGraphicAttribute & P>;\nexport type GetEncoderSpecByType<T, P = any> = T extends keyof BasicEncoderSpecMap\n ? StateEncodeSpec<BasicEncoderSpecMap[T]>\n : StateEncodeSpec<GenerateBasicEncoderSpec<IGraphicAttribute> & P>;\n\nexport type BaseEncodeSpec<P = any> = StateEncodeSpec<GenerateBasicEncoderSpec<IGraphicAttribute & P>>;\nexport type BaseSignleEncodeSpec<P = any> =\n | GenerateEncoderSpec<GenerateBasicEncoderSpec<IGraphicAttribute & P>>\n | StateProxyEncodeSpec<GenerateBasicEncoderSpec<IGraphicAttribute & P>>;\n\nexport type GetSignleEncodeSpecByType<T, P = any> = T extends keyof BasicEncoderSpecMap\n ? GenerateEncoderSpec<BasicEncoderSpecMap[T]> | StateProxyEncodeSpec<BasicEncoderSpecMap[T]>\n : BaseSignleEncodeSpec<P>;\n\nexport type MarkSpec =\n | GenerateMarkSpec<string, any>\n | CircleMarkSpec\n | ArcMarkSpec\n | AreaMarkSpec\n | ImageMarkSpec\n | LineMarkSpec\n | PathMarkSpec\n | RuleMarkSpec\n | ShapeMarkSpec\n | SymbolMarkSpec\n | TextMarkSpec\n | RichTextMarkSpec\n | PolygonMarkSpec\n | CellMarkSpec\n | IntervalMarkSpec\n | RectMarkSpec\n | Rect3dMarkSpec\n | Arc3dMarkSpec\n | Pyramid3dMarkSpec\n | GroupMarkSpec\n | GlyphMarkSpec\n | LinkPathGlyphSpec\n | TreePathGlyphSpec\n | WaveGlyphSpec\n | RipplePointGlyphSpec\n | BarBoxPlotGlyphSpec\n | BoxPlotGlyphSpec\n | ViolinGlyphSpec\n | ComponentSpec\n | BuiltInComponentSpec;\n\nexport interface AttributeTransform {\n channels: string[];\n transform: (graphicAttributes: any, nextAttrs: any, storedAttrs: any) => void;\n storedAttrs?: string;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/mark.ts"],"names":[],"mappings":"","file":"mark.js","sourcesContent":["import type {\n ICustomPath2D,\n IPyramid3dGraphicAttribute,\n IArc3dGraphicAttribute,\n IRect3dGraphicAttribute,\n ISymbolAttribute,\n IRectGraphicAttribute,\n ILineGraphicAttribute,\n ICircleGraphicAttribute,\n IArcGraphicAttribute,\n IPolygonGraphicAttribute,\n IAreaGraphicAttribute,\n IGlyphGraphicAttribute,\n IImageGraphicAttribute,\n IPathGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute,\n IGraphicAttribute,\n IGroupGraphicAttribute,\n IRichTextGraphicAttribute\n} from '@visactor/vrender-core';\nimport type { Bounds, IPointLike } from '@visactor/vutils';\nimport type { IAnimationConfig, IStateAnimationConfig } from './animate';\nimport type { IElement } from './element';\nimport type { IMark, IScale, IGroupMark, ICoordinate, GrammarSpec, IData } from './grammar';\nimport type { GenericFunctionType } from './signal';\nimport type { TransformSpec } from './transform';\nimport type { CommonPaddingSpec } from './base';\nimport type { ILayoutOptions, IView } from './view';\nimport type {\n AxisSpec,\n BuiltInComponentSpec,\n DatazoomSpec,\n LabelSpec,\n LegendSpec,\n PlayerSpec,\n SliderSpec\n} from './component';\nimport type { GrammarMarkType } from '../graph/enums';\n\nexport type MarkFunctionCallback<T> = (datum: any, element: IElement, parameters: any) => T;\n\nexport type MarkFunctionType<T> = GenericFunctionType<MarkFunctionCallback<T>, T>;\n\nexport type MarkType = keyof typeof GrammarMarkType | string;\n\nexport interface MarkFromSpec {\n data: string | IData;\n transform?: {\n name: string;\n transform?: TransformSpec[];\n };\n}\n\nexport type MarkStateSpec = MarkFunctionType<string | string[]>;\n\nexport type ScaleEncodeType = {\n scale: IScale | string;\n field?: string | ((datum: any) => any) | string[] | ((datum: any) => any)[];\n value?: any;\n band?: number;\n offset?: number;\n};\n\nexport type FieldEncodeType = {\n field: string | ((datum: any) => any) | string[] | ((datum: any) => any)[];\n};\n\nexport type ChannelEncodeType<T = any> = MarkFunctionType<T> | ScaleEncodeType | FieldEncodeType;\n\nexport type GenerateEncoderSpec<T> = {\n [Key in keyof T]?: ChannelEncodeType<T[Key]>;\n};\n\n/**\n * the common channel supported by graphic marks\n */\nexport type GenerateBasicEncoderSpec<T> = Partial<\n Omit<\n T,\n | 'strokeSeg'\n | 'boundsPadding'\n | 'pickMode'\n | 'boundsMode'\n | 'customPickShape'\n | 'pickable'\n | 'childrenPickable'\n | 'visible'\n | 'zIndex'\n | 'layout'\n | 'keepDirIn3d'\n | 'postMatrix'\n | 'anchor'\n | 'anchor3d'\n >\n>;\n\nexport type BasicEncoderSpecMap = {\n rect: GenerateBasicEncoderSpec<IRectGraphicAttribute & { y1?: number; x1?: number }>;\n line: Omit<GenerateBasicEncoderSpec<ILineGraphicAttribute>, 'points' | 'segments'>;\n circle: GenerateBasicEncoderSpec<ICircleGraphicAttribute>;\n arc: GenerateBasicEncoderSpec<IArcGraphicAttribute>;\n polygon: GenerateBasicEncoderSpec<IPolygonGraphicAttribute>;\n arc3d: GenerateBasicEncoderSpec<IArc3dGraphicAttribute>;\n pyramid3d: GenerateBasicEncoderSpec<IPyramid3dGraphicAttribute>;\n area: Omit<GenerateBasicEncoderSpec<IAreaGraphicAttribute>, 'points' | 'segments'>;\n group: GenerateBasicEncoderSpec<IGroupGraphicAttribute>;\n glyph: GenerateBasicEncoderSpec<IGlyphGraphicAttribute & any>;\n image: GenerateBasicEncoderSpec<IImageGraphicAttribute>;\n rect3d: GenerateBasicEncoderSpec<IRect3dGraphicAttribute>;\n path: GenerateBasicEncoderSpec<IPathGraphicAttribute>;\n rule: Omit<GenerateBasicEncoderSpec<ILineGraphicAttribute>, 'points' | 'segments'> & { x1?: number; y1?: number };\n shape: GenerateBasicEncoderSpec<IPathGraphicAttribute>;\n symbol: GenerateBasicEncoderSpec<ISymbolGraphicAttribute> & {\n shape?: ISymbolGraphicAttribute['symbolType'];\n image?: ISymbolGraphicAttribute['background'];\n };\n text: GenerateBasicEncoderSpec<ITextGraphicAttribute> & {\n limit?: number;\n autoLimit?: number;\n };\n richtext: GenerateBasicEncoderSpec<IRichTextGraphicAttribute>;\n interval: Omit<GenerateBasicEncoderSpec<IRectGraphicAttribute>, 'width' | 'height'> & {\n /**\n * the gap for two graphic elements\n */\n innerGap?: number | string;\n /**\n * only used for rect / interval mark\n */\n maxWidth?: number;\n minWidth?: number;\n /** the gap between two category */\n categoryGap?: number | string;\n };\n cell: GenerateBasicEncoderSpec<ISymbolGraphicAttribute> & {\n padding?: number | [number, number];\n shape?: ISymbolAttribute['symbolType'];\n };\n};\nexport type GenerateBaseEncodeSpec<BasicSpec = GenerateBasicEncoderSpec<IGraphicAttribute>> =\n | GenerateEncoderSpec<BasicSpec>\n | MarkFunctionCallback<BasicSpec>;\n\nexport type StateProxyEncodeSpec<T = any> = (datum: any, element: IElement, state: string, nextStates: string[]) => T;\n\nexport type StateEncodeSpec<BasicSpec = GenerateBasicEncoderSpec<IGraphicAttribute>> =\n | {\n enter?: GenerateBaseEncodeSpec<BasicSpec>;\n update?: GenerateBaseEncodeSpec<BasicSpec>;\n exit?: GenerateBaseEncodeSpec<BasicSpec>;\n }\n | {\n [state: string]: GenerateEncoderSpec<BasicSpec> | StateProxyEncodeSpec<BasicSpec>;\n };\n\nexport type MarkAnimationSpec = Record<string, IAnimationConfig | IAnimationConfig[]> & {\n state?: IStateAnimationConfig;\n};\n\n// TODO: support string[]\nexport type MarkKeySpec = string | ((datum: any) => string);\n\nexport type MarkSortSpec = (datumA: any, datumB: any) => number;\n\nexport type MarkStateSortSpec = (stateA: string, stateB: string) => number;\n\nexport interface MarkGridContainerSpec extends MarkBaseLayoutSpec {\n display: 'grid';\n gridTemplateRows?: (number | string | 'auto')[];\n gridTemplateColumns?: (number | string | 'auto')[];\n gridRowGap?: number;\n gridColumnGap?: number;\n}\n\nexport interface MarkGridItemSpec extends MarkBaseLayoutSpec {\n gridRowStart?: number;\n gridRowEnd?: number;\n gridColumnStart?: number;\n gridColumnEnd?: number;\n}\n\nexport interface MarkBaseLayoutSpec {\n callback?: MarkLayoutCallback;\n skipBeforeLayouted?: boolean;\n updateViewSignals?: boolean;\n}\n\nexport interface MarkRelativeItemSpec extends MarkBaseLayoutSpec {\n position?: 'top' | 'bottom' | 'left' | 'right' | 'content' | 'auto' | string;\n padding?: CommonPaddingSpec;\n align?: 'left' | 'right' | 'center' | 'top' | 'bottom' | 'middle';\n order?: number;\n}\n\nexport interface MarkRelativeContainerSpec extends MarkBaseLayoutSpec {\n display: 'relative';\n maxChildWidth?: string | number;\n maxChildHeight?: string | number;\n}\n\nexport type MarkLayoutSpec =\n | MarkGridContainerSpec\n | MarkGridItemSpec\n | MarkRelativeContainerSpec\n | MarkRelativeItemSpec;\n\nexport type MarkLayoutCallback = (\n group: IGroupMark,\n children: IMark[],\n parentLayoutBounds: Bounds,\n options?: ILayoutOptions\n) => void;\n\nexport interface IMarkConfig {\n clip?: boolean;\n zIndex?: number;\n interactive?: boolean;\n context?: any;\n /**\n * set customized shape\n */\n setCustomizedShape?: (datum: any[], attrs: any, path: ICustomPath2D) => ICustomPath2D;\n /** 是否开启大数据渲染模式 */\n large?: boolean;\n /** 开启大数据渲染优化的阀值,对应的是data的长度 */\n largeThreshold?: number;\n /** 分片长度 */\n progressiveStep?: number;\n /** 开启分片渲染的阀值,对应的是单系列data的长度 */\n progressiveThreshold?: number;\n /**\n * use 'sequential' for symbol chart\n * use 'mod' for bar/line chart\n */\n // largeChunkMode?: 'sequential' | 'mod';\n support3d?: boolean;\n /**\n * enable global morphing animation of the mark\n */\n morph?: boolean;\n /**\n * this key will be used to match the mark to morph\n */\n morphKey?: string;\n /**\n * this key will be used to match the element of two marks to morph\n * If not specified, we'll use the \"key\" of the mark by default\n */\n morphElementKey?: string;\n /** transforms of attributes */\n attributeTransforms?: AttributeTransform[];\n}\n\n/**\n * Base mark specification type\n */\nexport interface GenerateMarkSpec<T extends MarkType = string, P = any> extends IMarkConfig, GrammarSpec {\n type: T;\n name?: string;\n group?: string | IGroupMark;\n // data attributes\n from?: MarkFromSpec;\n key?: MarkKeySpec;\n /**\n * sort all the elements in the mark\n */\n sort?: MarkSortSpec;\n /**\n * set the group key of the mark\n */\n groupBy?: MarkKeySpec;\n /**\n * sort the data of each group\n */\n groupSort?: MarkSortSpec;\n context?: any;\n // coordinate attributes\n coordinate?: string | ICoordinate;\n // encode attributes\n state?: MarkStateSpec;\n stateSort?: MarkStateSortSpec;\n encode?: GetEncoderSpecByType<T, P>;\n // animation attributes\n animationState?: MarkFunctionType<string>;\n animation?: MarkAnimationSpec;\n transform?: TransformSpec[];\n layout?: MarkLayoutSpec | MarkLayoutCallback;\n}\n\nexport type CircleMarkSpec = GenerateMarkSpec<'circle'>;\nexport type ArcMarkSpec = GenerateMarkSpec<'arc'>;\nexport type AreaMarkSpec = GenerateMarkSpec<'area'>;\nexport type LineMarkSpec = GenerateMarkSpec<'line'>;\nexport type RectMarkSpec = GenerateMarkSpec<'rect'>;\nexport type ImageMarkSpec = GenerateMarkSpec<'image'>;\nexport type PathMarkSpec = GenerateMarkSpec<'path'>;\nexport type RuleMarkSpec = GenerateMarkSpec<'rule'>;\nexport type ShapeMarkSpec = GenerateMarkSpec<'shape'>;\nexport type SymbolMarkSpec = GenerateMarkSpec<'symbol'>;\nexport type TextMarkSpec = GenerateMarkSpec<'text'>;\nexport type RichTextMarkSpec = GenerateMarkSpec<'richtext'>;\nexport type PolygonMarkSpec = GenerateMarkSpec<'polygon'>;\nexport type CellMarkSpec = GenerateMarkSpec<'cell'>;\nexport type IntervalMarkSpec = GenerateMarkSpec<'interval'>;\nexport type Arc3dMarkSpec = GenerateMarkSpec<'arc3d'>;\nexport type Pyramid3dMarkSpec = GenerateMarkSpec<'pyramid3d'>;\nexport type Rect3dMarkSpec = GenerateMarkSpec<'rect3d'>;\n\nexport type BasicGlyphEncoderSpec = BasicEncoderSpecMap['glyph'];\nexport type BasicGroupEncoderSpec = BasicEncoderSpecMap['group'];\nexport interface GroupMarkSpec extends GenerateMarkSpec<'group'> {\n marks?: MarkSpec[];\n}\n\nexport interface GlyphMarkSpec<CustomizedEncoderSpec = any> extends GenerateMarkSpec<'glyph', CustomizedEncoderSpec> {\n glyphType: string;\n glyphConfig?: any;\n}\n\nexport interface BoxPlotEncoderSpec extends BasicGlyphEncoderSpec {\n boxWidth?: number;\n boxHeight?: number;\n ruleWidth?: number;\n ruleHeight?: number;\n q1?: number;\n q3?: number;\n min?: number;\n max?: number;\n median?: number;\n angle?: number;\n anchor?: [number, number];\n}\n\nexport interface BarBoxPlotEncoderSpec extends BasicGlyphEncoderSpec {\n minMaxWidth?: number;\n q1q3Width?: number;\n minMaxHeight?: number;\n q1q3Height?: number;\n q1?: number;\n q3?: number;\n min?: number;\n max?: number;\n median?: number;\n angle?: number;\n lineWidth?: number;\n minMaxFillOpacity?: number;\n anchor?: [number, number];\n}\n\nexport interface LinkPathEncoderSpec extends BasicGlyphEncoderSpec {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n thickness: number;\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n ratio?: number;\n align?: 'start' | 'end' | 'center';\n pathType?: 'line' | 'smooth' | 'polyline';\n endArrow?: boolean;\n startArrow?: boolean;\n backgroundStyle?: any;\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\nexport interface TreePathEncoderSpec extends BasicGlyphEncoderSpec {\n x0: number;\n y0: number;\n x1: number;\n y1: number;\n curvature?: number;\n /** round all the coordinates */\n round?: boolean;\n /** the ratio of normal style path */\n align?: 'start' | 'end' | 'center';\n pathType?: 'line' | 'smooth' | 'polyline';\n startArrowStyle?: Partial<IGraphicAttribute>;\n endArrowStyle?: Partial<IGraphicAttribute>;\n endArrow?: boolean;\n startArrow?: boolean;\n arrowSize?: number;\n backgroundStyle?: any;\n direction?: 'horizontal' | 'vertical' | 'LR' | 'RL' | 'TB' | 'BL' | 'radial';\n}\n\nexport interface RipplePointEncoderSpec extends BasicGlyphEncoderSpec {\n ripple?: number;\n size?: number;\n}\n\nexport interface ViolinEncoderSpec extends BasicGlyphEncoderSpec {\n violinFill: string;\n violinStroke: string;\n medianFill?: string;\n density?: IPointLike[];\n boxWidth?: number;\n q1?: number;\n q3?: number;\n min?: number;\n max?: number;\n median?: number;\n angle?: number;\n anchor?: [number, number];\n}\n\nexport interface WaveEncoderSpec extends BasicGlyphEncoderSpec {\n wave?: number;\n}\nexport interface BoxPlotGlyphSpec extends GlyphMarkSpec<BoxPlotEncoderSpec> {\n glyphType: 'boxplot';\n}\nexport interface BarBoxPlotGlyphSpec extends GlyphMarkSpec<BarBoxPlotEncoderSpec> {\n glyphType: 'barBoxplot';\n}\nexport interface LinkPathGlyphSpec extends GlyphMarkSpec<LinkPathEncoderSpec> {\n glyphType: 'linkPath';\n}\nexport interface TreePathGlyphSpec extends GlyphMarkSpec<TreePathEncoderSpec> {\n glyphType: 'treePath';\n}\nexport interface RipplePointGlyphSpec extends GlyphMarkSpec<RipplePointEncoderSpec> {\n glyphType: 'ripplePoint';\n}\nexport interface ViolinGlyphSpec extends GlyphMarkSpec<ViolinEncoderSpec> {\n glyphType: 'violin';\n}\nexport interface WaveGlyphSpec extends GlyphMarkSpec<WaveEncoderSpec> {\n glyphType: 'wave';\n}\n\nexport interface ComponentSpec<\n BasicEncoderSpec extends GenerateBasicEncoderSpec<IGraphicAttribute> = GenerateBasicEncoderSpec<IGraphicAttribute>\n> extends GenerateMarkSpec<'component', BasicEncoderSpec> {\n componentType: string;\n componentConfig?: any;\n mode?: '2d' | '3d';\n}\n\nexport type BaseMarkSpec = GenerateMarkSpec<MarkType>;\nexport type MarkSpecMap = {\n circle: CircleMarkSpec;\n arc: ArcMarkSpec;\n area: AreaMarkSpec;\n image: ImageMarkSpec;\n line: LineMarkSpec;\n path: PathMarkSpec;\n rule: RuleMarkSpec;\n shape: ShapeMarkSpec;\n symbol: SymbolMarkSpec;\n text: TextMarkSpec;\n richtext: RichTextMarkSpec;\n polygon: PolygonMarkSpec;\n cell: CellMarkSpec;\n interval: IntervalMarkSpec;\n rect: RectMarkSpec;\n rect3d: Rect3dMarkSpec;\n arc3d: Arc3dMarkSpec;\n pyramid3d: Pyramid3dMarkSpec;\n group: GroupMarkSpec;\n glyph: GlyphMarkSpec;\n linkPath: LinkPathGlyphSpec;\n treePath: TreePathGlyphSpec;\n wave: WaveEncoderSpec;\n ripplePoint: RipplePointGlyphSpec;\n barBoxplot: BarBoxPlotGlyphSpec;\n boxPlot: BoxPlotGlyphSpec;\n component: ComponentSpec;\n axis: AxisSpec;\n legend: LegendSpec;\n slider: SliderSpec;\n datazoom: DatazoomSpec;\n label: LabelSpec;\n player: PlayerSpec;\n};\n\nexport type GetMarkSpecByType<T, P = any> = T extends keyof MarkSpecMap ? MarkSpecMap[T] : GenerateMarkSpec<string, P>;\nexport type GetBasicEncoderSpecByType<T, P = any> = T extends keyof BasicEncoderSpecMap\n ? BasicEncoderSpecMap[T]\n : GenerateBasicEncoderSpec<IGraphicAttribute & P>;\nexport type GetEncoderSpecByType<T, P = any> = T extends keyof BasicEncoderSpecMap\n ? StateEncodeSpec<BasicEncoderSpecMap[T]>\n : StateEncodeSpec<GenerateBasicEncoderSpec<IGraphicAttribute> & P>;\n\nexport type BaseEncodeSpec<P = any> = StateEncodeSpec<GenerateBasicEncoderSpec<IGraphicAttribute & P>>;\nexport type BaseSignleEncodeSpec<P = any> =\n | GenerateEncoderSpec<GenerateBasicEncoderSpec<IGraphicAttribute & P>>\n | StateProxyEncodeSpec<GenerateBasicEncoderSpec<IGraphicAttribute & P>>;\n\nexport type GetSignleEncodeSpecByType<T, P = any> = T extends keyof BasicEncoderSpecMap\n ? GenerateEncoderSpec<BasicEncoderSpecMap[T]> | StateProxyEncodeSpec<BasicEncoderSpecMap[T]>\n : BaseSignleEncodeSpec<P>;\n\nexport type MarkSpec =\n | GenerateMarkSpec<string, any>\n | CircleMarkSpec\n | ArcMarkSpec\n | AreaMarkSpec\n | ImageMarkSpec\n | LineMarkSpec\n | PathMarkSpec\n | RuleMarkSpec\n | ShapeMarkSpec\n | SymbolMarkSpec\n | TextMarkSpec\n | RichTextMarkSpec\n | PolygonMarkSpec\n | CellMarkSpec\n | IntervalMarkSpec\n | RectMarkSpec\n | Rect3dMarkSpec\n | Arc3dMarkSpec\n | Pyramid3dMarkSpec\n | GroupMarkSpec\n | GlyphMarkSpec\n | LinkPathGlyphSpec\n | TreePathGlyphSpec\n | WaveGlyphSpec\n | RipplePointGlyphSpec\n | BarBoxPlotGlyphSpec\n | BoxPlotGlyphSpec\n | ViolinGlyphSpec\n | ComponentSpec\n | BuiltInComponentSpec;\n\nexport interface AttributeTransform {\n channels: string[];\n transform: (graphicAttributes: any, nextAttrs: any, storedAttrs: any) => void;\n storedAttrs?: string;\n}\n\nexport interface IMarkConstructor {\n readonly markType: string;\n\n new (view: IView, markType: MarkType, group?: IGroupMark): IMark;\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { IColor } from '@visactor/vrender-core';
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';
2
+ import type { ArcLabelAttrs, BaseLabelAttrs, CircleAxisAttributes, CircleAxisGridAttributes, CircleCrosshairAttrs, ColorLegendAttributes, ContinuousPlayerAttributes, DataLabelAttrs, DataZoomAttributes, DiscreteLegendAttrs, DiscretePlayerAttributes, LineAxisAttributes, LineAxisGridAttributes, LineCrosshairAttrs, LineDataLabelAttrs, 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';
5
5
  import type { BasicEncoderSpecMap } from './mark';
@@ -24,6 +24,7 @@ export interface IComponentTheme {
24
24
  arcLabel?: RecursivePartial<ArcLabelAttrs>;
25
25
  symbolLabel?: RecursivePartial<SymbolLabelAttrs>;
26
26
  pointLabel?: RecursivePartial<BaseLabelAttrs>;
27
+ lineDataLabel?: RecursivePartial<LineDataLabelAttrs>;
27
28
  datazoom?: RecursivePartial<DataZoomAttributes>;
28
29
  continuousPlayer?: RecursivePartial<ContinuousPlayerAttributes>;
29
30
  discretePlayer?: RecursivePartial<DiscretePlayerAttributes>;
@@ -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-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 LineDataLabelAttrs,\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 lineDataLabel?: RecursivePartial<LineDataLabelAttrs>;\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"]}
@@ -181,13 +181,13 @@ export interface MarkOverlapTransformOptions {
181
181
  forceUpdateStamp?: number;
182
182
  groupBy?: string;
183
183
  }
184
- export interface LttbSampleTransformOptions {
184
+ export interface SampleTransformOptions {
185
185
  size: number;
186
186
  factor?: number;
187
187
  skipfirst?: boolean;
188
- xfield?: string;
189
188
  yfield?: string;
190
189
  groupBy?: string;
190
+ mode?: 'lttb' | 'min' | 'max' | 'average' | 'sum';
191
191
  }
192
192
  export interface SymmetryTransformOptions {
193
193
  channel?: 'x' | 'y';
@@ -242,8 +242,8 @@ export interface IdentifierTransformSpec extends ConvertTransformOptionToSpec<Id
242
242
  export interface MarkOverlapTransformSpec extends ConvertTransformOptionToSpec<MarkOverlapTransformOptions> {
243
243
  type: 'markoverlap';
244
244
  }
245
- export interface LttbSampleTransformSpec extends ConvertTransformOptionToSpec<LttbSampleTransformOptions> {
246
- type: 'lttbsample';
245
+ export interface SampleTransformSpec extends ConvertTransformOptionToSpec<SampleTransformOptions> {
246
+ type: 'sampling';
247
247
  }
248
248
  export interface JitterTransformSpec extends ConvertTransformOptionToSpec<JitterTransformOptions> {
249
249
  type: 'jitter';
@@ -270,7 +270,7 @@ export interface BaseTransformSpec {
270
270
  type: string;
271
271
  [key: string]: TransformSpecValue | TransformSpecValue[];
272
272
  }
273
- export type TransformSpec = FilterTransformSpec | FunnelTransformSpec | PieTransformSpec | JoinTransformSpec | MapTransformSpec | PickTransformSpec | RangeTransformSpec | SortTransformSpec | StackTransformSpec | DodgeTransformSpec | IdentifierTransformSpec | BaseTransformSpec | MarkOverlapTransformSpec | LttbSampleTransformSpec | JitterTransformSpec | JitterXTransformSpec | JitterYTransformSpec | CircularRelationTransformSpec | FoldTransformSpec | UnfoldTransformSpec;
273
+ export type TransformSpec = FilterTransformSpec | FunnelTransformSpec | PieTransformSpec | JoinTransformSpec | MapTransformSpec | PickTransformSpec | RangeTransformSpec | SortTransformSpec | StackTransformSpec | DodgeTransformSpec | IdentifierTransformSpec | BaseTransformSpec | MarkOverlapTransformSpec | SampleTransformSpec | JitterTransformSpec | JitterXTransformSpec | JitterYTransformSpec | CircularRelationTransformSpec | FoldTransformSpec | UnfoldTransformSpec;
274
274
  export interface IProgressiveTransformResult<Output = any> {
275
275
  unfinished: () => boolean;
276
276
  output: () => Output;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types/transform.ts"],"names":[],"mappings":"","file":"transform.js","sourcesContent":["import type { FieldGetterFunction, LayoutViewBox } from '@visactor/vgrammar-util';\nimport type { SignalFunction, SignalReference } from './signal';\nimport type { IView } from './view';\nimport type { IData } from './grammar';\nimport type { SortConfigSpec } from './data';\n\nexport type TransformSpecValue =\n | {\n /** transform will depend a signal grammar instance as params */\n signal?: string;\n /** transform will depend a scale grammar instance as params, this should only be used in the transform of mark */\n scale?: string;\n /** transform will depend a data grammar instance as params, this should only be used in the transform of mark */\n data?: string;\n /** transform will depend a customized grammar instance as params, this should only be used in the transform of mark */\n customized?: string;\n }\n | any;\n\nexport type TransformFunctionCallback<T> = (parameters: any) => T;\n\nexport type TransformFunctionType<T> = T | SignalReference<T> | SignalFunction<TransformFunctionCallback<T>, T>;\n\nexport type ConvertTransformOptionToSpec<TransformOptionType> = {\n [Key in keyof TransformOptionType]?: TransformFunctionType<TransformOptionType[Key]>;\n};\n\nexport interface BinTransformOption {\n field: string;\n extent: [number, number];\n step?: number;\n bins?: number;\n as?: [string, string];\n}\n\nexport interface ContourTransformOption {\n field: string;\n row: number;\n column: number;\n thresholds?: number[];\n levels?: number;\n asThreshold?: string;\n asPoints?: string;\n}\n\nexport interface FilterTransformOption {\n callback: (entry: any, params: any) => boolean;\n}\n\nexport interface FunnelTransformOption {\n /** the field to of measure */\n field: string;\n /** the filed of transform ration(the value of next level/ the value of current level)**/\n asTransformRatio?: string;\n /** the filed of reach ration(the value of current level/ the value of prev level))*/\n asReachRatio?: string;\n /** the field of height ratio **/\n asHeightRatio?: string;\n /** the field of value ration(this value of current level / this value of first level ) */\n asValueRatio?: string;\n /** the field of last value ratio(the value of last level / this value of first level) */\n asLastValueRatio?: string;\n /** the field of next value ratio(the value of next level / this value of first level) */\n asNextValueRatio?: string;\n /** the field of current value */\n asCurrentValue?: string;\n /** the field of last value **/\n asLastValue?: string;\n /** the field of next value **/\n asNextValue?: string;\n /** whether or not the last level of the funnel is a cone */\n isCone?: boolean;\n /** whether or not the height will be encode to value**/\n heightVisual?: boolean;\n\n /** the range of value */\n range?: { min: number; max: number };\n}\n\nexport interface JoinTransformOption {\n from?: any[];\n key: string;\n fields: string[];\n values?: string[];\n as?: string[];\n default?: any;\n}\n\nexport interface KDETransformOption {\n dimension?: '1d' | '2d';\n field: string | string[];\n bandwidth?: number;\n extent?: [number, number] | [{ x: number; y: number }, { x: number; y: number }];\n bins?: number | number[];\n as?: string[];\n}\n\nexport interface MapTransformOption {\n callback: (entry: any, params?: any) => any;\n as?: string;\n all?: boolean;\n}\n\nexport interface PickTransformOption {\n as?: string[];\n fields: string[] | FieldGetterFunction[];\n}\n\nexport interface PieTransformOption {\n field: string;\n startAngle?: number;\n endAngle?: number;\n asStartAngle?: string;\n asEndAngle?: string;\n asMiddleAngle?: string;\n asRadian?: string;\n asRatio?: string;\n asQuadrant?: string;\n asK?: string;\n}\n\nexport interface RangeTransformOptions {\n start: number;\n stop: number;\n step?: number;\n as?: string;\n}\n\nexport interface SortTransformOptions {\n sort: SortConfigSpec | ((a: any, b: any) => number);\n}\n\nexport interface FoldTransformOptions {\n fields: string[];\n asKey?: string;\n asValue?: string;\n retains?: string[];\n}\n\nexport interface UnfoldTransformOptions {\n groupBy?: string[] | string;\n keyField: string;\n valueField: string;\n aggregateType?: 'sum' | 'min' | 'max' | 'count' | 'mean';\n}\n\nexport interface StackTransformOptions {\n // TODO: provide more order option referring to d3-shape\n order?: 'positive' | 'negative';\n offset?: 'none' | 'diverging' | 'silhouette' | 'wiggle';\n stackField: string;\n dimensionField: string;\n asStack?: string;\n asPrevStack?: string;\n asPercent?: string;\n asPercentStack?: string;\n asPrevPercentStack?: string;\n asSum?: string;\n}\n\nexport interface DodgeTransformOptions {\n /**\n * the gap for two graphic elements\n */\n innerGap?: number | string;\n /**\n * only used for rect / interval mark\n */\n maxWidth?: number;\n minWidth?: number;\n /** the gap between two category */\n categoryGap?: number | string;\n /**\n * specify the field to dodge, if this field is not specified, we'll use the `groupKey` of Element to dodge\n */\n dodgeBy?: string | string[];\n /**\n * specify the channel to dodge, if this field is not specified, we'll use the channel which is associated to a band scale\n */\n dodgeChannel?: 'x' | 'y';\n}\n\nexport interface JitterTransformOptions {\n bandWidth?: number;\n bandHeight?: number;\n widthRatio?: number;\n heightRatio?: number;\n random?: (index?: number, total?: number) => number;\n}\n\nexport interface JitterXTransformOptions {\n bandWidth?: number;\n widthRatio?: number;\n random?: (index?: number, total?: number) => number;\n}\nexport interface JitterYTransformOptions {\n bandHeight?: number;\n heightRatio?: number;\n random?: (index?: number, total?: number) => number;\n}\n\nexport type CircularRelationTransformOptions = LayoutViewBox & {\n field: string;\n radiusField?: string;\n radiusRange?: [number, number];\n center?: [string | number, string | number];\n startAngle?: number;\n endAngle?: number;\n innerRadius?: string | number;\n outerRadius?: string | number;\n};\n\nexport interface CircularRelationItem {\n x: number;\n y: number;\n radius: number;\n datum: any;\n}\n\nexport interface IdentifierTransformOptions {\n as: string;\n}\n\nexport interface MarkOverlapTransformOptions {\n direction: number;\n delta?: number;\n deltaMul?: number;\n radius?: boolean;\n hideMode?: number;\n forceUpdate?: boolean;\n forceUpdateStamp?: number;\n groupBy?: string;\n}\n\nexport interface LttbSampleTransformOptions {\n size: number;\n factor?: number;\n skipfirst?: boolean;\n xfield?: string;\n yfield?: string;\n groupBy?: string;\n}\n\nexport interface SymmetryTransformOptions {\n channel?: 'x' | 'y';\n align?: 'min' | 'max';\n}\n\nexport interface BinTransformSpec extends BinTransformOption {\n type: 'bin';\n}\n\nexport interface ContourTransformSpec extends ContourTransformOption {\n type: 'contour';\n}\n\nexport interface FilterTransformSpec extends ConvertTransformOptionToSpec<FilterTransformOption> {\n type: 'filter';\n}\n\nexport interface FunnelTransformSpec extends FunnelTransformOption {\n type: 'funnel';\n}\n\nexport interface PieTransformSpec extends PieTransformOption {\n type: 'pie';\n}\n\nexport interface JoinTransformSpec extends ConvertTransformOptionToSpec<Omit<JoinTransformOption, 'from'>> {\n type: 'join';\n from?: TransformFunctionType<JoinTransformOption['from']> | { data: string | IData };\n}\n\nexport interface KDETransformSpec extends KDETransformOption {\n type: 'kde';\n}\n\nexport interface MapTransformSpec extends ConvertTransformOptionToSpec<Omit<MapTransformOption, 'callback'>> {\n type: 'map';\n callback: MapTransformOption['callback'];\n}\n\nexport interface PickTransformSpec extends ConvertTransformOptionToSpec<PickTransformOption> {\n type: 'pick';\n}\nexport interface RangeTransformSpec extends ConvertTransformOptionToSpec<RangeTransformOptions> {\n type: 'range';\n}\n\nexport interface SortTransformSpec extends ConvertTransformOptionToSpec<SortTransformOptions> {\n type: 'sort';\n}\nexport interface StackTransformSpec extends ConvertTransformOptionToSpec<StackTransformOptions> {\n type: 'stack';\n}\nexport interface DodgeTransformSpec extends ConvertTransformOptionToSpec<DodgeTransformOptions> {\n type: 'dodge';\n}\n\nexport interface IdentifierTransformSpec extends ConvertTransformOptionToSpec<IdentifierTransformOptions> {\n type: 'identifier';\n}\n\nexport interface MarkOverlapTransformSpec extends ConvertTransformOptionToSpec<MarkOverlapTransformOptions> {\n type: 'markoverlap';\n}\nexport interface LttbSampleTransformSpec extends ConvertTransformOptionToSpec<LttbSampleTransformOptions> {\n type: 'lttbsample';\n}\n\nexport interface JitterTransformSpec extends ConvertTransformOptionToSpec<JitterTransformOptions> {\n type: 'jitter';\n}\n\nexport interface JitterXTransformSpec extends ConvertTransformOptionToSpec<JitterXTransformOptions> {\n type: 'jitterX';\n}\n\nexport interface JitterYTransformSpec extends ConvertTransformOptionToSpec<JitterYTransformOptions> {\n type: 'jitterY';\n}\n\nexport type CircularRelationTransformSpec = ConvertTransformOptionToSpec<CircularRelationTransformOptions> & {\n type: 'circularRelation';\n};\n\nexport interface FoldTransformSpec extends ConvertTransformOptionToSpec<FoldTransformOptions> {\n type: 'fold';\n}\n\nexport interface UnfoldTransformSpec extends ConvertTransformOptionToSpec<UnfoldTransformOptions> {\n type: 'unfold';\n}\n\nexport interface SymmetryTransformSpec extends ConvertTransformOptionToSpec<SymmetryTransformOptions> {\n type: 'symmetry';\n}\n\nexport interface BaseTransformSpec {\n /** the type of transform */\n type: string;\n [key: string]: TransformSpecValue | TransformSpecValue[];\n}\n\nexport type TransformSpec =\n | FilterTransformSpec\n | FunnelTransformSpec\n | PieTransformSpec\n | JoinTransformSpec\n | MapTransformSpec\n | PickTransformSpec\n | RangeTransformSpec\n | SortTransformSpec\n | StackTransformSpec\n | DodgeTransformSpec\n | IdentifierTransformSpec\n | BaseTransformSpec\n | MarkOverlapTransformSpec\n | LttbSampleTransformSpec\n | JitterTransformSpec\n | JitterXTransformSpec\n | JitterYTransformSpec\n | CircularRelationTransformSpec\n | FoldTransformSpec\n | UnfoldTransformSpec;\n\nexport interface IProgressiveTransformResult<Output = any> {\n /** is progressive finished */\n unfinished: () => boolean;\n /** return all the result */\n output: () => Output;\n /** the output result of current progressive run */\n progressiveOutput: () => Output;\n /** run in progressive mode */\n progressiveRun: () => void;\n /** release the progressive context */\n release: () => void;\n}\n\nexport interface IProgressiveTransform<Output = any> {\n progressive: IProgressiveTransformResult<Output>;\n}\n\nexport type IFunctionTransform<Options = any, Input = any, Output = any> = (\n options?: Options,\n data?: Input,\n params?: Record<string, any>,\n view?: IView\n) => Output | Promise<Output> | IProgressiveTransformResult<Output>;\nexport interface ITransform<Options = any, Input = any, Output = any> {\n type: string;\n markPhase?: 'beforeJoin' | 'afterEncode' | 'afterEncodeItems';\n /** 是否支持渐进流程 */\n canProgressive?: boolean;\n /** transform function */\n transform: IFunctionTransform<Options, Input, Output>;\n isBuiltIn?: boolean;\n}\n"]}
1
+ {"version":3,"sources":["../src/types/transform.ts"],"names":[],"mappings":"","file":"transform.js","sourcesContent":["import type { FieldGetterFunction, LayoutViewBox } from '@visactor/vgrammar-util';\nimport type { SignalFunction, SignalReference } from './signal';\nimport type { IView } from './view';\nimport type { IData } from './grammar';\nimport type { SortConfigSpec } from './data';\n\nexport type TransformSpecValue =\n | {\n /** transform will depend a signal grammar instance as params */\n signal?: string;\n /** transform will depend a scale grammar instance as params, this should only be used in the transform of mark */\n scale?: string;\n /** transform will depend a data grammar instance as params, this should only be used in the transform of mark */\n data?: string;\n /** transform will depend a customized grammar instance as params, this should only be used in the transform of mark */\n customized?: string;\n }\n | any;\n\nexport type TransformFunctionCallback<T> = (parameters: any) => T;\n\nexport type TransformFunctionType<T> = T | SignalReference<T> | SignalFunction<TransformFunctionCallback<T>, T>;\n\nexport type ConvertTransformOptionToSpec<TransformOptionType> = {\n [Key in keyof TransformOptionType]?: TransformFunctionType<TransformOptionType[Key]>;\n};\n\nexport interface BinTransformOption {\n field: string;\n extent: [number, number];\n step?: number;\n bins?: number;\n as?: [string, string];\n}\n\nexport interface ContourTransformOption {\n field: string;\n row: number;\n column: number;\n thresholds?: number[];\n levels?: number;\n asThreshold?: string;\n asPoints?: string;\n}\n\nexport interface FilterTransformOption {\n callback: (entry: any, params: any) => boolean;\n}\n\nexport interface FunnelTransformOption {\n /** the field to of measure */\n field: string;\n /** the filed of transform ration(the value of next level/ the value of current level)**/\n asTransformRatio?: string;\n /** the filed of reach ration(the value of current level/ the value of prev level))*/\n asReachRatio?: string;\n /** the field of height ratio **/\n asHeightRatio?: string;\n /** the field of value ration(this value of current level / this value of first level ) */\n asValueRatio?: string;\n /** the field of last value ratio(the value of last level / this value of first level) */\n asLastValueRatio?: string;\n /** the field of next value ratio(the value of next level / this value of first level) */\n asNextValueRatio?: string;\n /** the field of current value */\n asCurrentValue?: string;\n /** the field of last value **/\n asLastValue?: string;\n /** the field of next value **/\n asNextValue?: string;\n /** whether or not the last level of the funnel is a cone */\n isCone?: boolean;\n /** whether or not the height will be encode to value**/\n heightVisual?: boolean;\n\n /** the range of value */\n range?: { min: number; max: number };\n}\n\nexport interface JoinTransformOption {\n from?: any[];\n key: string;\n fields: string[];\n values?: string[];\n as?: string[];\n default?: any;\n}\n\nexport interface KDETransformOption {\n dimension?: '1d' | '2d';\n field: string | string[];\n bandwidth?: number;\n extent?: [number, number] | [{ x: number; y: number }, { x: number; y: number }];\n bins?: number | number[];\n as?: string[];\n}\n\nexport interface MapTransformOption {\n callback: (entry: any, params?: any) => any;\n as?: string;\n all?: boolean;\n}\n\nexport interface PickTransformOption {\n as?: string[];\n fields: string[] | FieldGetterFunction[];\n}\n\nexport interface PieTransformOption {\n field: string;\n startAngle?: number;\n endAngle?: number;\n asStartAngle?: string;\n asEndAngle?: string;\n asMiddleAngle?: string;\n asRadian?: string;\n asRatio?: string;\n asQuadrant?: string;\n asK?: string;\n}\n\nexport interface RangeTransformOptions {\n start: number;\n stop: number;\n step?: number;\n as?: string;\n}\n\nexport interface SortTransformOptions {\n sort: SortConfigSpec | ((a: any, b: any) => number);\n}\n\nexport interface FoldTransformOptions {\n fields: string[];\n asKey?: string;\n asValue?: string;\n retains?: string[];\n}\n\nexport interface UnfoldTransformOptions {\n groupBy?: string[] | string;\n keyField: string;\n valueField: string;\n aggregateType?: 'sum' | 'min' | 'max' | 'count' | 'mean';\n}\n\nexport interface StackTransformOptions {\n // TODO: provide more order option referring to d3-shape\n order?: 'positive' | 'negative';\n offset?: 'none' | 'diverging' | 'silhouette' | 'wiggle';\n stackField: string;\n dimensionField: string;\n asStack?: string;\n asPrevStack?: string;\n asPercent?: string;\n asPercentStack?: string;\n asPrevPercentStack?: string;\n asSum?: string;\n}\n\nexport interface DodgeTransformOptions {\n /**\n * the gap for two graphic elements\n */\n innerGap?: number | string;\n /**\n * only used for rect / interval mark\n */\n maxWidth?: number;\n minWidth?: number;\n /** the gap between two category */\n categoryGap?: number | string;\n /**\n * specify the field to dodge, if this field is not specified, we'll use the `groupKey` of Element to dodge\n */\n dodgeBy?: string | string[];\n /**\n * specify the channel to dodge, if this field is not specified, we'll use the channel which is associated to a band scale\n */\n dodgeChannel?: 'x' | 'y';\n}\n\nexport interface JitterTransformOptions {\n bandWidth?: number;\n bandHeight?: number;\n widthRatio?: number;\n heightRatio?: number;\n random?: (index?: number, total?: number) => number;\n}\n\nexport interface JitterXTransformOptions {\n bandWidth?: number;\n widthRatio?: number;\n random?: (index?: number, total?: number) => number;\n}\nexport interface JitterYTransformOptions {\n bandHeight?: number;\n heightRatio?: number;\n random?: (index?: number, total?: number) => number;\n}\n\nexport type CircularRelationTransformOptions = LayoutViewBox & {\n field: string;\n radiusField?: string;\n radiusRange?: [number, number];\n center?: [string | number, string | number];\n startAngle?: number;\n endAngle?: number;\n innerRadius?: string | number;\n outerRadius?: string | number;\n};\n\nexport interface CircularRelationItem {\n x: number;\n y: number;\n radius: number;\n datum: any;\n}\n\nexport interface IdentifierTransformOptions {\n as: string;\n}\n\nexport interface MarkOverlapTransformOptions {\n direction: number;\n delta?: number;\n deltaMul?: number;\n radius?: boolean;\n hideMode?: number;\n forceUpdate?: boolean;\n forceUpdateStamp?: number;\n groupBy?: string;\n}\n\nexport interface SampleTransformOptions {\n size: number;\n factor?: number;\n skipfirst?: boolean;\n yfield?: string;\n groupBy?: string;\n mode?: 'lttb' | 'min' | 'max' | 'average' | 'sum';\n}\n\nexport interface SymmetryTransformOptions {\n channel?: 'x' | 'y';\n align?: 'min' | 'max';\n}\n\nexport interface BinTransformSpec extends BinTransformOption {\n type: 'bin';\n}\n\nexport interface ContourTransformSpec extends ContourTransformOption {\n type: 'contour';\n}\n\nexport interface FilterTransformSpec extends ConvertTransformOptionToSpec<FilterTransformOption> {\n type: 'filter';\n}\n\nexport interface FunnelTransformSpec extends FunnelTransformOption {\n type: 'funnel';\n}\n\nexport interface PieTransformSpec extends PieTransformOption {\n type: 'pie';\n}\n\nexport interface JoinTransformSpec extends ConvertTransformOptionToSpec<Omit<JoinTransformOption, 'from'>> {\n type: 'join';\n from?: TransformFunctionType<JoinTransformOption['from']> | { data: string | IData };\n}\n\nexport interface KDETransformSpec extends KDETransformOption {\n type: 'kde';\n}\n\nexport interface MapTransformSpec extends ConvertTransformOptionToSpec<Omit<MapTransformOption, 'callback'>> {\n type: 'map';\n callback: MapTransformOption['callback'];\n}\n\nexport interface PickTransformSpec extends ConvertTransformOptionToSpec<PickTransformOption> {\n type: 'pick';\n}\nexport interface RangeTransformSpec extends ConvertTransformOptionToSpec<RangeTransformOptions> {\n type: 'range';\n}\n\nexport interface SortTransformSpec extends ConvertTransformOptionToSpec<SortTransformOptions> {\n type: 'sort';\n}\nexport interface StackTransformSpec extends ConvertTransformOptionToSpec<StackTransformOptions> {\n type: 'stack';\n}\nexport interface DodgeTransformSpec extends ConvertTransformOptionToSpec<DodgeTransformOptions> {\n type: 'dodge';\n}\n\nexport interface IdentifierTransformSpec extends ConvertTransformOptionToSpec<IdentifierTransformOptions> {\n type: 'identifier';\n}\n\nexport interface MarkOverlapTransformSpec extends ConvertTransformOptionToSpec<MarkOverlapTransformOptions> {\n type: 'markoverlap';\n}\nexport interface SampleTransformSpec extends ConvertTransformOptionToSpec<SampleTransformOptions> {\n type: 'sampling';\n}\n\nexport interface JitterTransformSpec extends ConvertTransformOptionToSpec<JitterTransformOptions> {\n type: 'jitter';\n}\n\nexport interface JitterXTransformSpec extends ConvertTransformOptionToSpec<JitterXTransformOptions> {\n type: 'jitterX';\n}\n\nexport interface JitterYTransformSpec extends ConvertTransformOptionToSpec<JitterYTransformOptions> {\n type: 'jitterY';\n}\n\nexport type CircularRelationTransformSpec = ConvertTransformOptionToSpec<CircularRelationTransformOptions> & {\n type: 'circularRelation';\n};\n\nexport interface FoldTransformSpec extends ConvertTransformOptionToSpec<FoldTransformOptions> {\n type: 'fold';\n}\n\nexport interface UnfoldTransformSpec extends ConvertTransformOptionToSpec<UnfoldTransformOptions> {\n type: 'unfold';\n}\n\nexport interface SymmetryTransformSpec extends ConvertTransformOptionToSpec<SymmetryTransformOptions> {\n type: 'symmetry';\n}\n\nexport interface BaseTransformSpec {\n /** the type of transform */\n type: string;\n [key: string]: TransformSpecValue | TransformSpecValue[];\n}\n\nexport type TransformSpec =\n | FilterTransformSpec\n | FunnelTransformSpec\n | PieTransformSpec\n | JoinTransformSpec\n | MapTransformSpec\n | PickTransformSpec\n | RangeTransformSpec\n | SortTransformSpec\n | StackTransformSpec\n | DodgeTransformSpec\n | IdentifierTransformSpec\n | BaseTransformSpec\n | MarkOverlapTransformSpec\n | SampleTransformSpec\n | JitterTransformSpec\n | JitterXTransformSpec\n | JitterYTransformSpec\n | CircularRelationTransformSpec\n | FoldTransformSpec\n | UnfoldTransformSpec;\n\nexport interface IProgressiveTransformResult<Output = any> {\n /** is progressive finished */\n unfinished: () => boolean;\n /** return all the result */\n output: () => Output;\n /** the output result of current progressive run */\n progressiveOutput: () => Output;\n /** run in progressive mode */\n progressiveRun: () => void;\n /** release the progressive context */\n release: () => void;\n}\n\nexport interface IProgressiveTransform<Output = any> {\n progressive: IProgressiveTransformResult<Output>;\n}\n\nexport type IFunctionTransform<Options = any, Input = any, Output = any> = (\n options?: Options,\n data?: Input,\n params?: Record<string, any>,\n view?: IView\n) => Output | Promise<Output> | IProgressiveTransformResult<Output>;\nexport interface ITransform<Options = any, Input = any, Output = any> {\n type: string;\n markPhase?: 'beforeJoin' | 'afterEncode' | 'afterEncodeItems';\n /** 是否支持渐进流程 */\n canProgressive?: boolean;\n /** transform function */\n transform: IFunctionTransform<Options, Input, Output>;\n isBuiltIn?: boolean;\n}\n"]}
@@ -65,6 +65,7 @@ export interface IViewOptions extends IEnvironmentOptions, IRendererOptions, ILa
65
65
  hooks?: Hooks;
66
66
  eventConfig?: IViewEventConfig;
67
67
  background?: IColor;
68
+ disableTheme?: boolean;
68
69
  }
69
70
  export interface IRunningConfig {
70
71
  reuse?: boolean;
@@ -182,6 +183,7 @@ export interface ViewSpec {
182
183
  marks?: MarkSpec[];
183
184
  events?: EventSpec[];
184
185
  interactions?: InteractionSpec[];
186
+ animation?: boolean;
185
187
  }
186
188
  export interface IRecordedGrammars {
187
189
  record: (grammar: IGrammarBase) => this;
@@ -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}\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\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}\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\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"]}
package/es/view/View.d.ts CHANGED
@@ -139,7 +139,6 @@ export default class View extends EventEmitter implements IView {
139
139
  removeEventListener(type: string, handler?: BaseEventHandler): this;
140
140
  private initializeRenderer;
141
141
  private initialize;
142
- normalBrowserEnv(): boolean;
143
142
  pauseProgressive(): boolean;
144
143
  resumeProgressive(): boolean;
145
144
  restartProgressive(): boolean;
package/es/view/View.js CHANGED
@@ -74,10 +74,6 @@ import { ViewAnimate } from "./animate";
74
74
 
75
75
  import { ComponentEnum, HOOK_EVENT, LayoutState, GrammarMarkType } from "../graph/enums";
76
76
 
77
- import { Interval } from "../semantic-marks/interval";
78
-
79
- import { Cell } from "../semantic-marks/cell";
80
-
81
77
  import { Text } from "../semantic-marks/text";
82
78
 
83
79
  import { ThemeManager } from "../theme/theme-manager";
@@ -189,20 +185,12 @@ export default class View extends EventEmitter {
189
185
  mark = Factory.hasComponent(null == markOptions ? void 0 : markOptions.componentType) ? Factory.createComponent(null == markOptions ? void 0 : markOptions.componentType, this, groupMark, null == markOptions ? void 0 : markOptions.mode) : new Component(this, null == markOptions ? void 0 : markOptions.componentType, groupMark, null == markOptions ? void 0 : markOptions.mode);
190
186
  break;
191
187
 
192
- case GrammarMarkType.interval:
193
- mark = new Interval(this, type, groupMark);
194
- break;
195
-
196
- case GrammarMarkType.cell:
197
- mark = new Cell(this, type, groupMark);
198
- break;
199
-
200
188
  case GrammarMarkType.text:
201
189
  mark = new Text(this, type, groupMark);
202
190
  break;
203
191
 
204
192
  default:
205
- mark = new Mark(this, type, groupMark);
193
+ mark = Factory.hasMark(type) ? Factory.createMark(type, this, groupMark) : new Mark(this, type, groupMark);
206
194
  }
207
195
  return this.grammars.record(mark), this._dataflow.add(mark), mark;
208
196
  }
@@ -319,14 +307,14 @@ export default class View extends EventEmitter {
319
307
  this.event(eventConfig);
320
308
  })), (null === (_j = spec.interactions) || void 0 === _j ? void 0 : _j.length) && spec.interactions.forEach((interaction => {
321
309
  this.interaction(interaction.type, interaction);
322
- })), this.emit(HOOK_EVENT.AFTER_PARSE_VIEW), this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before,
323
- this;
310
+ })), !1 === spec.animation ? this.animate.disable() : this.animate.enable(), this.emit(HOOK_EVENT.AFTER_PARSE_VIEW),
311
+ this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before, this;
324
312
  }
325
313
  updateSpec(spec) {
326
314
  return this.removeAllInteractions(), this.removeAllGrammars(), this.parseSpec(spec);
327
315
  }
328
316
  parseBuiltIn() {
329
- builtInSignals(this._options, this._config, this.getCurrentTheme()).map((signalSpec => {
317
+ builtInSignals(this._options, this._config, this.getCurrentTheme()).forEach((signalSpec => {
330
318
  const signal = this.signal().parse(signalSpec);
331
319
  signalSpec.value && signal.set(signalSpec.value);
332
320
  }));
@@ -362,11 +350,12 @@ export default class View extends EventEmitter {
362
350
  }));
363
351
  }
364
352
  theme(theme) {
365
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
353
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
366
354
  return isString(theme) ? this._theme = null !== (_a = ThemeManager.getTheme(theme)) && void 0 !== _a ? _a : ThemeManager.getDefaultTheme() : this._theme = theme,
367
- this.background(null !== (_d = null !== (_c = null === (_b = this._spec) || void 0 === _b ? void 0 : _b.background) && void 0 !== _c ? _c : this._options.background) && void 0 !== _d ? _d : this._theme.background),
355
+ this._theme ? (this.background(null !== (_d = null !== (_c = null === (_b = this._spec) || void 0 === _b ? void 0 : _b.background) && void 0 !== _c ? _c : this._options.background) && void 0 !== _d ? _d : this._theme.background),
368
356
  this.padding(null !== (_g = null !== (_f = null === (_e = this._spec) || void 0 === _e ? void 0 : _e.padding) && void 0 !== _f ? _f : this._options.padding) && void 0 !== _g ? _g : this._theme.padding),
369
- null === (_j = null === (_h = this.renderer.stage()) || void 0 === _h ? void 0 : _h.setTheme) || void 0 === _j || _j.call(_h, Object.assign({}, this._theme.marks)),
357
+ null === (_j = null === (_h = this.renderer.stage()) || void 0 === _h ? void 0 : _h.setTheme) || void 0 === _j || _j.call(_h, Object.assign({}, this._theme.marks))) : (this.background(null !== (_l = null === (_k = this._spec) || void 0 === _k ? void 0 : _k.background) && void 0 !== _l ? _l : this._options.background),
358
+ this.padding(null !== (_o = null === (_m = this._spec) || void 0 === _m ? void 0 : _m.padding) && void 0 !== _o ? _o : this._options.padding)),
370
359
  this;
371
360
  }
372
361
  getCurrentTheme() {
@@ -497,7 +486,7 @@ export default class View extends EventEmitter {
497
486
  const normalizedRunningConfig = normalizeRunningConfig(runningConfig);
498
487
  this.reuseCachedGrammars(normalizedRunningConfig);
499
488
  const grammarWillDetach = this._cachedGrammars.size() > 0;
500
- this.detachCachedGrammar();
489
+ grammarWillDetach && this.detachCachedGrammar();
501
490
  const hasResize = this._resizeRenderer(), hasUpdate = this._dataflow.hasCommitted();
502
491
  return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(),
503
492
  yield this._dataflow.evaluate(), this._needBuildLayoutTree && (this.buildLayoutTree(),
@@ -516,7 +505,7 @@ export default class View extends EventEmitter {
516
505
  const normalizedRunningConfig = normalizeRunningConfig(runningConfig);
517
506
  this.reuseCachedGrammars(normalizedRunningConfig);
518
507
  const grammarWillDetach = this._cachedGrammars.size() > 0;
519
- this.detachCachedGrammar();
508
+ grammarWillDetach && this.detachCachedGrammar();
520
509
  const hasResize = this._resizeRenderer(), hasUpdate = this._dataflow.hasCommitted();
521
510
  return grammarWillDetach || hasUpdate || this._layoutState || hasResize ? (this.clearProgressive(),
522
511
  this._dataflow.evaluateSync(), this._needBuildLayoutTree && (this.buildLayoutTree(),
@@ -756,17 +745,14 @@ export default class View extends EventEmitter {
756
745
  this._cachedGrammars = new RecordedTreeGrammars((grammar => grammar.id())), this._options.logger && Logger.setInstance(this._options.logger),
757
746
  this.logger = Logger.getInstance(null !== (_a = this._options.logLevel) && void 0 !== _a ? _a : 0),
758
747
  this._dataflow = new Dataflow, this.animate = new ViewAnimate(this), this._morph = new Morph,
759
- this._theme = ThemeManager.getDefaultTheme(), this._options.hooks && (Object.keys(this._options.hooks).forEach((key => {
748
+ this._options.hooks && (Object.keys(this._options.hooks).forEach((key => {
760
749
  this.on(key, this._options.hooks[key]);
761
750
  })), this.hooks = this._options.hooks), this.container = null, this.renderer = null,
762
751
  this._eventListeners = [], this._eventConfig = initializeEventConfig(this._options.eventConfig),
763
- this._theme = ThemeManager.getDefaultTheme(), this.parseBuiltIn(), configureEnvironment(this._options),
764
- this.initializeRenderer(), this._eventConfig.disable || this.initEvent(), this._bindResizeEvent(),
765
- this._currentDataflow = null, this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before,
766
- this.theme(this._theme);
767
- }
768
- normalBrowserEnv() {
769
- return "browser" === this._options.mode;
752
+ this._theme = this._options.disableTheme ? null : ThemeManager.getDefaultTheme(),
753
+ this.parseBuiltIn(), configureEnvironment(this._options), this.initializeRenderer(),
754
+ this._eventConfig.disable || this.initEvent(), this._bindResizeEvent(), this._currentDataflow = null,
755
+ this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before, this.theme(this._theme);
770
756
  }
771
757
  pauseProgressive() {
772
758
  return !1;