We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
V5 版本的 G2 底层采用 Selection 相关的 API 来选中节点,例如
selectAll(`.${ELEMENT_CLASS_NAME}`)
包括也实现了 selectG2Elements 方法用于获取所有的 Elements。 但目前在 index.ts 中,没有导出 Selection 或者 utils 里面的方法函数
selectG2Elements
index.ts
Selection
utils
// index.ts import { runtime } from '@antv/g'; runtime.enableCSSParsing = false; export { render, renderToMountedElement, MAIN_LAYER_CLASS_NAME, LABEL_LAYER_CLASS_NAME, ELEMENT_CLASS_NAME, VIEW_CLASS_NAME, PLOT_CLASS_NAME, COMPONENT_CLASS_NAME, LABEL_CLASS_NAME, AREA_CLASS_NAME, } from './runtime'; export type { G2Context } from './runtime'; export { createLibrary } from './stdlib'; export { Chart, MarkNode, CompositionNode, register } from './api'; export { ChartEvent } from './utils/event'; export * from './spec';
所以如何在 G2 上层获取到所有的 Elements 呢 (目前想基于 G2 的 V5 版本做上层封装,但 V5 的很多工具方法没有暴露出来无法使用)
The text was updated successfully, but these errors were encountered:
const { canvas } = chart.getContext(); // 找到图形元素 const elements = canvas.document.getElementsByClassName(ELEMENT_CLASS_NAME);
Sorry, something went wrong.
No branches or pull requests
V5 版本的 G2 底层采用 Selection 相关的 API 来选中节点,例如
包括也实现了
selectG2Elements
方法用于获取所有的 Elements。但目前在
index.ts
中,没有导出Selection
或者utils
里面的方法函数所以如何在 G2 上层获取到所有的 Elements 呢
(目前想基于 G2 的 V5 版本做上层封装,但 V5 的很多工具方法没有暴露出来无法使用)
The text was updated successfully, but these errors were encountered: