Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add panelAddon plugin #1604

Merged
merged 4 commits into from
Jan 16, 2025
Merged

feat: add panelAddon plugin #1604

merged 4 commits into from
Jan 16, 2025

Conversation

ZeekoZhu
Copy link
Contributor

@ZeekoZhu ZeekoZhu commented Jan 16, 2025

改动列表:

  • 添加了 PanelAddon 插件,允许用户向 Panel 中插入自定义元素
    • PanelAddon 可以通过 VizInstance 跟 panel 以及其中渲染的 Viz 交互
    • 给 panel-root 容器添加了 id,PanelAddon 生成的 DOM 会被插入到 Panel Root 下
  • cartesian Viz 现在会向 VizInstance 报告 rendered 事件,PanelAddon 通过订阅该事件就可以获得 ECharts 用来渲染的配置对象
  • pluginManager 现在被 exported

使用样例:

pluginManager.install({
  id: 'dev-insight',
  manifest: {
    viz: [],
    color: [],
    panelAddon: [
      {
        name: 'ask-ai',
        addonRender: AskAIAddon,
      },
    ],
  },
  version: '0.1',
});

image

接下来的计划:

  • 为更多使用 ECharts 的 Viz 添加 rendered 事件
  • 允许用户在 PanelAddon 中渲染当前的 Viz

@ZeekoZhu ZeekoZhu requested a review from GerilLeto January 16, 2025 02:23
@GerilLeto
Copy link
Member

可以在website加一个实践例子吗?不用真实的功能,点击一下console.log就行

@GerilLeto GerilLeto merged commit 2e1ec8f into main Jan 16, 2025
2 checks passed
@GerilLeto GerilLeto deleted the panel-addon branch January 16, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants