提示使用 core 的用户当前图表需要导入或注册哪些插件
- Dominant language
- JavaScript
- Stars
- 8k
- Forks
- 637
- PR merge metrics
- No merged PRs in 30d
Description
- [x] I have searched the [issues](https://github.com/antvis/f2/issues) of this repository and believe that this is not a duplicate.
### What problem does this feature solve?
F2 的插件机制很赞, 但是对于新用户来说难以搞清插件与 API 之间的对应关系.
能否在用户只导入 core 包时, 使用未知 API 触发 console.warn 提示用户该 API 需要导入或注册 xxx 插件?
### What does the proposed API look like?
使用 `chart.pieLabel({})` 时触发:
```
console.warn(`F2 pie-label plugin not found. Please register first:
F2.Chart.plugins.register(require('@antv/f2/es/plugin/pie-label'))
`)
```
Contributor guide
Research direction
Start by reading the core package's handling of chart.pieLabel({}) and the plugin registration path shown in the issue. Determine how unknown plugin-backed APIs can be detected without affecting registered plugins. Done means a core-only call emits a console.warn naming the missing plugin and registration command, while registered APIs continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100