如何通过线角相互连接元素

发布于 2025-01-28 13:02:03 字数 199 浏览 1 评论 0原文

如何将元素与图片中的行连接起来?当您单击一个圆,然后单击另一个圆时,应绘制一条线。也许有一个用于此任务的库,我搜索了,但没有发现任何有用的东西。 Angular。在此处输入图像描述“>

更新

屏幕的大小也应更改行。我还考虑应用诸如D3和Cytoscape之类的库,因为它们似乎允许绘制此类行。也许有人有一些例子?

How to connect the elements with a line like in the picture? When you click on one circle and then another, a line should be drawn. Maybe there is a library for this task, I've searched but haven't found anything useful. Angular.enter image description here

Update

The size of the screen should also change the line. I was also thinking of applying libraries such as d3 and cytoscape, as they seem to allow for drawing such lines. Maybe someone has some examples?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

肥爪爪 2025-02-04 13:02:03

我为我找到了解决方案: LeadingLine

I found solution for me: LeaderLine

Oo萌小芽oO 2025-02-04 13:02:03

您可以使用 gojs

GOJS与角兼容。 ( document

此样本与您的需求相似:样品一个样品两个

You can use GoJs.

The GoJs is Compatible with angular. (Document)

This sample is similar to your needs: sample one, sample two

岛歌少女 2025-02-04 13:02:03

您可以用SVG制作这些东西。因为只有几行和圆圈。我在这里拼成一个小例子: https://stackblitz.com/editz.com/edit/edit/edit/angular-ivy-ivy--ivy--- OVHBWW
它基本上使用SVG绘制东西。 SVG是创建原因,您可以添加事件和动画。使用相当简单的代码。我在链接中提出的更多是您如何做到这一点。不是最伟大的代码:)

You can make this stuff with svg. since its only a few lines and circles. I stitch a small example together here : https://stackblitz.com/edit/angular-ivy-ovhbww
Its basically use svg to draw things. Svg is create cause you can add events and also animation if you feel like it. With fairly simple code. What i put in the link is more of inspiration of how you could do it. Not so much that its the greatest piece of code :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文