AVA
AVA copied to clipboard
refactor(ava/advisor): init new advisor pipeline & built-in modules to plugin-based architecture
advisor pipeline 重构为插件式的结构:
-
Pipeline默认由4个阶段组成(数据处理, 图表类型推荐, 图表视觉通道映射, G2 spec 生成),每个阶段对应一个Component来处理 - 每个 component 的实际能力由
plugins实现,通过自定义注册 plugins,实现自定义的对应环节的数据处理或推荐逻辑。每个 component 中的多个 plugins 并行执行,在afterPluginsExecutehook 中处理多个插件的结果。 - 内部原函数改写为内置插件形式 期望通过这样的处理,可以解耦原 adise 函数,灵活选择性地使用和定制图表推荐的部分环节。该 PR 是第一部分,初始化整体框架,拆分出 encode 和 spec generate 环节见后续 PR: https://github.com/antvis/AVA/pull/785
refactor advisor pipeline:
- split the default
Pipelineinto four stage: data analyze, chart type recommend, encode, spec generate. Each stage is processed by aComponent -
Componentcould have multipleplugins, these plugins are executed in parallel. The outputs of the plugins could be handled inafterPluginsExecutehook. - The original functions that for processing data, getting chart type spec and etc. are converted to preset plugins.