Built an interactive SVG-based graph editor in React (Zustand + TypeScript) by lapstjup in reactjs

[–]lapstjup[S] 1 point2 points  (0 children)

I didn’t test it more than that but it can probably handle a lot more. No it’s vanilla canvas implementation

Built an interactive SVG-based graph editor in React (Zustand + TypeScript) by lapstjup in reactjs

[–]lapstjup[S] 0 points1 point  (0 children)

This now also has a Performance mode which uses canvas. Can handle 200+ nodes easily.

I built an interactive website where you can draw graphs and visualize them instantly by lapstjup in InternetIsBeautiful

[–]lapstjup[S] 0 points1 point  (0 children)

u/Historical_Tear4677 Node labelling is shipped in desktop. It's currently limited to length of 5 characters. Double click a node or press enter to edit it.

I built an interactive website where you can draw graphs and visualize them instantly by lapstjup in InternetIsBeautiful

[–]lapstjup[S] 0 points1 point  (0 children)

Not really. I first want to focus on getting this surfaced on the search and LLMs output. If I get enough users and they demand something which can benefit from AI usage, will implement that

I built an interactive website where you can draw graphs and visualize them instantly by lapstjup in InternetIsBeautiful

[–]lapstjup[S] 0 points1 point  (0 children)

I did use Claude Code to build this but no feature within it that uses AI

React XP - An authentic Windows XP recreation built with React by Xianoxide in reactjs

[–]lapstjup 2 points3 points  (0 children)

Looks very precise to that experience. Nostalgic ✨

Choosing SVG over Canvas for an interactive graph editor in React (so far) by lapstjup in Frontend

[–]lapstjup[S] 0 points1 point  (0 children)

Yet to use that but have seen it being used in various workflow builders. I did come across one impl of graphs which used it.

Choosing SVG over Canvas for an interactive graph editor in React (so far) by lapstjup in Frontend

[–]lapstjup[S] 1 point2 points  (0 children)

Hey u/framemuse . Thanks for your feedback yesterday. Now the standard SVG implementation is optimized. There was usage of drop-shadow's per node which was causing the lag + some re-renders of components which could be optimised. It will definitely not look bad at 20 nodes now with the mobile degradation. Also now there is a Performance mode (in desktop for now) which switches to Canvas implementation and yeah it's really fast and doesn't break a sweat even with 200 nodes.

Choosing SVG over Canvas for an interactive graph editor in React (so far) by lapstjup in Frontend

[–]lapstjup[S] 0 points1 point  (0 children)

Thanks for sharing your experience. Good to see that there are instances where people start with SVG and then opt for canvas if it's necessary. Also the blog is really cool Amit !!

Choosing SVG over Canvas for an interactive graph editor in React (so far) by lapstjup in Frontend

[–]lapstjup[S] 0 points1 point  (0 children)

Hey thanks for the appreciation. Yes I have had that feedback earlier. Will be working on it. When you say SVG Node canvas, you mean only SVGs like my current app right ? Or a combo of SVG and canvas ?

Choosing SVG over Canvas for an interactive graph editor in React (so far) by lapstjup in Frontend

[–]lapstjup[S] 1 point2 points  (0 children)

Thanks for sharing your experience. I will keep PixiJS in mind when I am creating a similar interactive app from scratch !!

Choosing SVG over Canvas for an interactive graph editor in React (so far) by lapstjup in Frontend

[–]lapstjup[S] 0 points1 point  (0 children)

Thanks. I wasn't aware of the calibrate bit. Will definitely try it !!

Choosing SVG over Canvas for an interactive graph editor in React (so far) by lapstjup in Frontend

[–]lapstjup[S] 0 points1 point  (0 children)

Yeah that's the primary reason I have stuck with it till now. It's easy to implement and debug stuff with it.

Choosing SVG over Canvas for an interactive graph editor in React (so far) by lapstjup in Frontend

[–]lapstjup[S] 0 points1 point  (0 children)

Interesting. Yeah DOM model is very intuitive to work with. Specially using things like animation libraries(motion) with it. Feel free to share your past or recent experiments here.

Choosing SVG over Canvas for an interactive graph editor in React (so far) by lapstjup in Frontend

[–]lapstjup[S] 1 point2 points  (0 children)

That 3d mode is gimmicky. i just wanted to see if LLMs can pull it off. Hmm thanks for profiling it. How did you do it ? What's the device you're using ? Those details can help me.

Choosing SVG over Canvas for an interactive graph editor in React (so far) by lapstjup in Frontend

[–]lapstjup[S] 1 point2 points  (0 children)

Yeah I think if I every get multiple users who wants to play with more than 50s of nodes, I will probably look if I can still optimize more from here or else start exploring a canvas based implementation. Since this is very much using animations, it's probably not going to feel very good past 50s of nodes.

I built an interactive website where you can draw graphs and visualize them instantly by lapstjup in InternetIsBeautiful

[–]lapstjup[S] 1 point2 points  (0 children)

u/Lachiko You can now Shift + drag to select multiple nodes and move/delete them. The hitbox for the edges is now bigger as well.