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
比如 Echart G2 这样的 canvas 并调用其内部的接口 好像不能,只能把它们当作图片嵌入进去
The text was updated successfully, but these errors were encountered:
我在之前的项目里试过支持嵌入 HTML,这样更方便与其他组件库、图表库结合,基本无侵入性。如果只是从 canvas 导出图片再添加到画布的话,就丧失组件/图表本身的交互性了。
画布需要提供一个 DOM 容器,控制它的变换来做一些基础的联动,比如跟随相机缩放,组件库图表库就管自己的渲染逻辑。类似:
const container = new HTML(); canvas.appendChild(container); const $g2 = new G2.Chart({ container });
在 DOM 结构上看可能会长这样:
<infinite-canvas> <canvas></canvas> <!-- our webgl / webgpu renderer --> <div class="g2" style="transform='matrix()'"></div> </infinite-canvas>
Sorry, something went wrong.
这也是一种解决方案。
需要把画布的缩放比例,以及分辨率传给 组件。
拖拽的显示由 画布控制就可以啦。
我想的对吗?
这个demo是这样做的: https://github.com/ceddlyburge/react-figma-miro-canvas-part-3
No branches or pull requests
比如 Echart G2 这样的 canvas 并调用其内部的接口
好像不能,只能把它们当作图片嵌入进去
The text was updated successfully, but these errors were encountered: