如何在JavaScript中高效地绘制多条交互式曲线?
我需要能够在网络应用程序中有效地绘制大量交互式曲线(可能是贝塞尔曲线)。想象一个类似图形的结构,其中包含许多通过平滑曲线连接的可拖动元素。因此,随着单个元素的移动,曲线的形状和长度必须进行调整。
哪种图形方法最能确保大量曲线的效率和交互性?
SVG?帆布?还有别的东西吗?
(一旦我们知道哪种方法最好,是否有一个好的库可以使其更容易实现?)
I need the ability to efficiently draw a large number of interactive curves (possibly Bezier) in a web app. Imagine a graph-like structure with many draggable elements that are connected with smooth curves. Hence, the curves must adjust in shape and length as single elements are moved.
What graphic method will be best to assure efficiency and interactivity for a large number curves?
SVG? Canvas? something else?
(And once we know which method is best, is there a good library that would make it easier to implement?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查看 JSXGraph。我没有亲自使用过它,但知道一些人使用过并取得了不错的效果。看起来它将使用“SVG、VML 或 canvas”。
You might take a look at JSXGraph. I haven't personally used it, but know some who has with nice results. It looks like it will use 'SVG, VML or canvas'.