Giter VIP home page Giter VIP logo

Comments (9)

ningxzx avatar ningxzx commented on July 21, 2024

怎么没法加标签?
必须要是contributor吗?

from frontend-interview.

kevinwulong avatar kevinwulong commented on July 21, 2024

1没做过
2拖拽:鼠标在工具上mousedown的时候让新工具的坐标=鼠标的坐标-(鼠标的坐标-新工具的坐标)。
鼠标mouseup的时候取消拖动。
连线:这个不知道是什么。。
3把每个工具都写成对象。
4 比如快捷键?收集数据最经常用到的工具图标来设置快键键。
比如模板?如上 为了懒才用工具的嘛。

from frontend-interview.

giscafer avatar giscafer commented on July 21, 2024

@kevinwulong 第二点2,拖拽包括鼠标三个事件mousedown——mousemove——mouseup,另外你说的坐标计算也不对。mousedown时记下当前坐标,假设设置标志位flag=truemousemove时,如果flag===true,则获取鼠标位置,计算并动态更改工具坐标,这样工具位置就动态改变了,mouseup标记flag=false,此时工具位置是最终位置。

有类似开源项目代码,可以参考源码

https://github.com/fex-team/kityminder

https://github.com/jgraph/draw.io

from frontend-interview.

kevinwulong avatar kevinwulong commented on July 21, 2024

@giscafer 谢谢回复!我去刷刷看你提供的源码。

from frontend-interview.

FrankFang avatar FrankFang commented on July 21, 2024

@ningxzx 你需要加什么标签,我帮你加吧

from frontend-interview.

ningxzx avatar ningxzx commented on July 21, 2024

@FrankFang 确实简洁了不少!我觉得“组件”相关的标签都行

from frontend-interview.

ShootToThrill avatar ShootToThrill commented on July 21, 2024

用canvas画吧

from frontend-interview.

ibufu avatar ibufu commented on July 21, 2024

https://www.processon.com/

from frontend-interview.

ZHAISHENKING avatar ZHAISHENKING commented on July 21, 2024

1.没做过。思路:按JSON格式存储,自标题往下嵌套,备注描述均为json中的字段。

from frontend-interview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.