AVA icon indicating copy to clipboard operation
AVA copied to clipboard

refactor(ava/advisor): init new advisor pipeline & built-in modules to plugin-based architecture

Open chenluli opened this issue 1 year ago • 0 comments

advisor pipeline 重构为插件式的结构:

  1. Pipeline默认由4个阶段组成(数据处理, 图表类型推荐, 图表视觉通道映射, G2 spec 生成),每个阶段对应一个 Component 来处理
  2. 每个 component 的实际能力由 plugins 实现,通过自定义注册 plugins,实现自定义的对应环节的数据处理或推荐逻辑。每个 component 中的多个 plugins 并行执行,在 afterPluginsExecute hook 中处理多个插件的结果。
  3. 内部原函数改写为内置插件形式 期望通过这样的处理,可以解耦原 adise 函数,灵活选择性地使用和定制图表推荐的部分环节。该 PR 是第一部分,初始化整体框架,拆分出 encode 和 spec generate 环节见后续 PR: https://github.com/antvis/AVA/pull/785
Screenshot 2024-06-17 at 17 27 35

refactor advisor pipeline:

  1. split the default Pipeline into four stage: data analyze, chart type recommend, encode, spec generate. Each stage is processed by a Component
  2. Component could have multiple plugins, these plugins are executed in parallel. The outputs of the plugins could be handled in afterPluginsExecute hook.
  3. The original functions that for processing data, getting chart type spec and etc. are converted to preset plugins.

chenluli avatar Jun 11 '24 06:06 chenluli