TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How to quickly animate system sketches and 2D diagrams?

142 pointsby pbowyerabout 3 years ago
I&#x27;m using Mermaid, Excalidraw and PlantUML diagrams to explain and document what I&#x27;m working on and they work great and are a lot better than screens of prose, but I&#x27;ve become aware that something is missing: motion.<p>Animation brings a whole lot more to explanations, making simple explanations of how request coalescing works easy to understand, token simulations [0] through to helping explain concepts like Fresnel lenses [1]. Embedding them into GitHub READMEs, tweets and documentation would be awesome.<p>Google do it to illustrate posts (e.g. <a href="https:&#x2F;&#x2F;blog.chromium.org&#x2F;2021&#x2F;03&#x2F;a-safer-default-for-navigation-https.html" rel="nofollow">https:&#x2F;&#x2F;blog.chromium.org&#x2F;2021&#x2F;03&#x2F;a-safer-default-for-naviga...</a>).<p>I found Excalidraw Claymate [2] but the stop motion approach with no tweening support makes it painful to create animations where circles move from place to place. There&#x27;s also Manim [3] but I think this is more for maths.<p>Adobe Flash used to be the go-to; what do you reach for when you want to illustrate a concept with an animated diagram?<p>0. <a href="https:&#x2F;&#x2F;github.com&#x2F;bpmn-io&#x2F;bpmn-js-token-simulation" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bpmn-io&#x2F;bpmn-js-token-simulation</a><p>1. <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30576688" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=30576688</a><p>2. <a href="https:&#x2F;&#x2F;github.com&#x2F;dai-shi&#x2F;excalidraw-claymate" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dai-shi&#x2F;excalidraw-claymate</a><p>3. <a href="https:&#x2F;&#x2F;github.com&#x2F;ManimCommunity&#x2F;manim" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ManimCommunity&#x2F;manim</a>

29 comments

is0topeabout 3 years ago
I actually made a small tool for making systems diagrams as a side project. However, it was extremely basic. Fun project though: <a href="https:&#x2F;&#x2F;msgviz.com" rel="nofollow">https:&#x2F;&#x2F;msgviz.com</a>
评论 #30650115 未加载
评论 #30651337 未加载
评论 #30652784 未加载
评论 #30661358 未加载
评论 #30650945 未加载
评论 #30652040 未加载
评论 #30650650 未加载
rg111about 3 years ago
The easiest way to do this is to create the animation in PowerPoint which is trivially easy.<p>Then export the transitions to a video [0].<p>[0]: <a href="https:&#x2F;&#x2F;support.microsoft.com&#x2F;en-us&#x2F;office&#x2F;save-a-presentation-as-a-video%E2%80%8B-in-powerpoint-ba919059-523d-40a8-b99c-08d18996c09d" rel="nofollow">https:&#x2F;&#x2F;support.microsoft.com&#x2F;en-us&#x2F;office&#x2F;save-a-presentati...</a>
durazabuabout 3 years ago
Draw.io (now diagrams.net) has some support for interactive diagrams.<p><a href="https:&#x2F;&#x2F;www.diagrams.net&#x2F;blog&#x2F;interactive-diagram-layers" rel="nofollow">https:&#x2F;&#x2F;www.diagrams.net&#x2F;blog&#x2F;interactive-diagram-layers</a><p><a href="https:&#x2F;&#x2F;drawio-app.com&#x2F;interactive-diagrams-with-custom-links-and-actions&#x2F;" rel="nofollow">https:&#x2F;&#x2F;drawio-app.com&#x2F;interactive-diagrams-with-custom-link...</a><p>Edit: remove links about the obscure undocumented features p=ex and p=anim
Blahahabout 3 years ago
I have been revisiting that same question for many years!<p>In the last year I have been using x6 from AntV for animated&#x2F;interactive graph visualisaton. It is outstandingly powerful and well designed (like all their libraries) - but unless you can read Mandarin you&#x27;ll eventually be using a translator to read the docs&#x2F;issues, and reading the code to figure out APIs. That said, I&#x27;ve been able to quickly build out things that I didn&#x27;t think possible before with x6 and their other libs.<p>Recently I&#x27;ve also had a good experience with react-flow from webkid - who also make excellent stuff. I&#x27;m using this in MDX components for modular documentation. It&#x27;s quick and simple to create an animated graph visualisation from a JSON representing the graph.<p>I have on my to-do list to make a mermaid -&gt; react-flow component
AriaMinaeiabout 3 years ago
Theatre.js can definitely drive this type of animation. It’s an animation library that you can hook up to your diagramming library. And it gives you a visual interface for keyframing and tweeting, etc.<p>Examples here: <a href="https:&#x2F;&#x2F;twitter.com&#x2F;ariaminaei&#x2F;status&#x2F;1439918117807853575?s=12" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;ariaminaei&#x2F;status&#x2F;1439918117807853575?s=...</a>
评论 #30653450 未加载
评论 #30652637 未加载
hutzlibuabout 3 years ago
&quot;Adobe Flash used to be the go-to; what do you reach for when you want to illustrate a concept with an animated diagram?&quot;<p>Adobes flash suite is now called Adobe animate and still works mostly the same and you can export to the html canvas.<p>Scripting is a bit limited&#x2F;complicated, compared to doing it with actionscript - but if you worked with flash before, this is probably the most easy solution, as it is still very powerful and straight forward.
melvinroestabout 3 years ago
Well, if you can program, you could try Pharo (a Smalltalk descendant). I&#x27;ve recently been getting into it and have been able to create sin&#x2F;cos animations [1] relatively quickly (not sure if this is what you&#x27;re looking for). For math animations it seems great, because I still don&#x27;t know much about the library I used (Roassal), all I know was that it showed the mathematical relationships I wanted to showcase.<p>The video itself shows a debugging issue that I asked the Pharo community, which is the ability to single step through your debugger and see the animation updated. As far as I understood there was a prototype out within a day for that.<p>[1] <a href="https:&#x2F;&#x2F;drive.google.com&#x2F;file&#x2F;d&#x2F;1Z3UwTAj4A2CRo_TXk6JNG-mN9yMamYMj&#x2F;view?usp=sharing" rel="nofollow">https:&#x2F;&#x2F;drive.google.com&#x2F;file&#x2F;d&#x2F;1Z3UwTAj4A2CRo_TXk6JNG-mN9yM...</a>
Minor49erabout 3 years ago
This might be more primitive than what you&#x27;re looking for: When I&#x27;m explaining something in a video or a presentation, I&#x27;ll sometimes use Google Slides to put together a diagram, then duplicate the frames to make adjustments to each. Then I cycle through each quickly to give a very basic sense of animation.<p>Recently, I had a presentation with a diagram showing several components. One slide would have an arrow pointing from Component A to Component B. The next slide had an arrow pointing in the opposite direction. I just pressed back and forward quickly while I was explaining that these two components talk to each other. It got the message across well enough.<p>On the other hand, if you are explaining known concepts, there might be footage out there already for you to appropriate into your own work
评论 #30633688 未加载
评论 #30649660 未加载
fortran77about 3 years ago
I like to use the same software that &quot;Stuff Made Here&quot;[0] uses, on a Microsoft Surface laptop:<p>&quot;Concepts&quot; <a href="https:&#x2F;&#x2F;concepts.app&#x2F;en&#x2F;" rel="nofollow">https:&#x2F;&#x2F;concepts.app&#x2F;en&#x2F;</a><p>[0] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;c&#x2F;StuffMadeHere" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;c&#x2F;StuffMadeHere</a>
mbforbesabout 3 years ago
I use Sketch to export SVGs, and animate them with anime.js. Here&#x27;s an example of some illustrations where I did this [1]. It&#x27;s not without issues though; using external (i.e., not inlined) SVGs is surprisingly tricky, and you quickly run into edge cases with groups and transforms---some notes here [2].<p>I like this approach because it decouples drawing and animating, and with SVG it is resolution and bandwidth-friendly. I was already used to making figures for research papers with Sketch, so I just suck with that, and added anime.js on top. However, for more complex motion like you might be hinting with your post, I could imagine a GUI tool with a proper timeline and tweening to be more ergonomic.<p>[1] <a href="https:&#x2F;&#x2F;maxwellforbes.com&#x2F;posts&#x2F;every-phd-is-different&#x2F;" rel="nofollow">https:&#x2F;&#x2F;maxwellforbes.com&#x2F;posts&#x2F;every-phd-is-different&#x2F;</a> [2] <a href="https:&#x2F;&#x2F;maxwellforbes.com&#x2F;garage&#x2F;animating-svgs-from-sketch-with-anime.js&#x2F;" rel="nofollow">https:&#x2F;&#x2F;maxwellforbes.com&#x2F;garage&#x2F;animating-svgs-from-sketch-...</a>
dmjeabout 3 years ago
What about SVG animation, using something like <a href="https:&#x2F;&#x2F;www.svgator.com" rel="nofollow">https:&#x2F;&#x2F;www.svgator.com</a> ?
评论 #30651485 未加载
评论 #30655582 未加载
jopsenabout 3 years ago
Just wondering, is motion really a good idea?<p>It distracts, eats cpu&#x2F;drains battery, can&#x27;t be printed, has bad UX.<p>User have to wait for the animation to cycle, and you can&#x27;t pause it to read something if it&#x27;s moving too fast.
评论 #30652403 未加载
评论 #30650167 未加载
jdlshoreabout 3 years ago
There’s probably better tools, but I use Keynote and Figma. With a bit of creativity, simple animation effects like “wipe” and “magic move” can go a long way.<p>Figma only does the equivalent of “magic move,” but it’s better than Keynote’s. I’ve used it to make sophisticated animations. See my Yow! presentation “Evolutionary Design Animated” for an example.<p>Prior to making that presentation, I looked at a variety of 2D animation tools, but they were meant for artistic animation and had so much power and flexibility that Figma was easier and faster.
评论 #30650627 未加载
评论 #30650509 未加载
评论 #30637490 未加载
tmshabout 3 years ago
Nodes seems pretty cool <a href="https:&#x2F;&#x2F;nodes.io&#x2F;docs&#x2F;tutorial&#x2F;" rel="nofollow">https:&#x2F;&#x2F;nodes.io&#x2F;docs&#x2F;tutorial&#x2F;</a> via <a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;quartzcomposer&#x2F;comments&#x2F;lh5ixw&#x2F;alternative_for_mac&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;quartzcomposer&#x2F;comments&#x2F;lh5ixw&#x2F;alte...</a>
disqardabout 3 years ago
If you&#x27;re willing to put in some time learning a slightly different approach to programming, you could check out BlockStudio [1]<p>It&#x27;s an authoring environment that allows text-free coding (using Programming By Demonstration) of interactive graphical software, like animations and games.<p>[1] <a href="https:&#x2F;&#x2F;www.blockstud.io" rel="nofollow">https:&#x2F;&#x2F;www.blockstud.io</a>
karaterobotabout 3 years ago
This is an example of &quot;when you have a hammer, every problem looks like a nail&quot;, but as a designer I would use Figma for this. Smart Animate could do all of the stuff I saw in that Google illustration. It&#x27;s not a timeline-based animation tool, so it would be cumbersome and kind of a hack, but it is free.
mathgladiatorabout 3 years ago
I wish I was ready for customers, but I&#x27;m making an IDE for board games and have making animations as a medium priority task.<p>I do however have the 2D tool pulled out which is only lacking the guts since I&#x27;m rethinking the suite of things to put in boxes: <a href="http:&#x2F;&#x2F;ide.adama-platform.com&#x2F;solo&#x2F;" rel="nofollow">http:&#x2F;&#x2F;ide.adama-platform.com&#x2F;solo&#x2F;</a><p>I&#x27;m thinking about how to mix a stateful backend (Adama) with animation data driven by &quot;volatile data&quot;: <a href="https:&#x2F;&#x2F;www.adama-platform.com&#x2F;2022&#x2F;03&#x2F;11&#x2F;introducing-volatile-data.html" rel="nofollow">https:&#x2F;&#x2F;www.adama-platform.com&#x2F;2022&#x2F;03&#x2F;11&#x2F;introducing-volati...</a>
technobabblerabout 3 years ago
IMHO for general purpose business use and internal sharing, Google Slides allows very basic animations (fades, transitions, slide-ins, etc., kinda like powerpoint) but is free and viewable to all on the web. It creates low-barrier explanatory slide decks for documentation, and I frequently use it to share complex topics with stakeholders. It works well... (but you do need to keep in mind a lot of presentation best practices though, which don&#x27;t come naturally).<p>You can also export to a video there.
pabeabout 3 years ago
I&#x27;m using slides.com for presentations. It can automatically create animations between pages: <a href="https:&#x2F;&#x2F;slides.com&#x2F;news&#x2F;auto-animate" rel="nofollow">https:&#x2F;&#x2F;slides.com&#x2F;news&#x2F;auto-animate</a><p>However, it doesn&#x27;t support you in creating animations where objects follow paths. But you&#x27;re free to code that on your own!<p>Slides.com is the commercial offer from the creators of the open source web presentation lib RevealJs.
Multicompabout 3 years ago
I used to use DebugMode Wink whenever I was making interactive slideshows that users could use to step through a systems diagram one request at a time, or hit play and just watch the slides loop, but that program is showing it&#x27;s age in limited resolution and I believe has relatively limited web or cross platform options compared to what we are used to these days.
dmjeabout 3 years ago
So interesting that this is still a question after many years: I remember looking into this a long time ago and there were no clear answers then.<p>I&#x27;d have thought (knowing nothing) that AI should be really good at tweeting between a start and end point of anything, diagrams included, but is there a good CS reason why this isn&#x27;t the case?
评论 #30650699 未加载
dccoolgaiabout 3 years ago
Blendshift cycling ( <a href="http:&#x2F;&#x2F;www.effectgames.com&#x2F;effect&#x2F;article-Old_School_Color_Cycling_with_HTML5.html" rel="nofollow">http:&#x2F;&#x2F;www.effectgames.com&#x2F;effect&#x2F;article-Old_School_Color_C...</a> ) would be so neat to see in this context.
rchaudabout 3 years ago
PowerPoint and Keynote both export to MP4 or GIF, as far as I remember. Keynote&#x27;s &quot;Magic Move&quot; transition does a nice job of tweening the keyframes between starting and ending positions of the animated object.
cahoot_birdabout 3 years ago
Wick Editor is free and the most similar to flash for javascript. It is much less known and probably has fewer features, but the setup is very similar to flash with a stage, scripts, vector animation, and motion tweens.
simonsarrisabout 3 years ago
GoJS might work for you: <a href="https:&#x2F;&#x2F;gojs.net" rel="nofollow">https:&#x2F;&#x2F;gojs.net</a><p>Although the focus of the library is interactivity and not setting up sequences of animation, but that is possible too.
mm_aaabout 3 years ago
My friends work on such a tool for many years: <a href="https:&#x2F;&#x2F;www.animatron.com&#x2F;studio" rel="nofollow">https:&#x2F;&#x2F;www.animatron.com&#x2F;studio</a><p>It is an online HTML5 animation editor.
vladsanchezabout 3 years ago
Couldn&#x27;t help to share IloGraph (<a href="https:&#x2F;&#x2F;www.ilograph.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.ilograph.com&#x2F;</a>) which features an ExportAPI (<a href="https:&#x2F;&#x2F;www.ilograph.com&#x2F;export-api&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.ilograph.com&#x2F;export-api&#x2F;</a>) but it&#x27;s rather expensive.<p>Earlier today I also stumbled with Manim (<a href="https:&#x2F;&#x2F;www.manim.community&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.manim.community&#x2F;</a>) which I think can be adapted to your needs.<p>I hope you find them useful.
bazzarghabout 3 years ago
I had this problem too, so I wrote some code. It&#x27;s not open sourced yet and who knows if I&#x27;ll get round to it, but here&#x27;s a detailed description of how it works, it is <i>not a lot of code</i> so you could probably reproduce this easily..<p>The problem I wanted to solve is more whiteboarding and presentation: I often am in calls describing something that only needs fairly simple drawings - boxes, lines, labels - but whiteboard where you scribble or even lay out rectangles makes me sweat the small stuff, resizing and moving everything all the time when the diagram changes. Also, I wanted animation: to show transition between states. I&#x27;d tried using mingrammer to do diagrams as code, but I find graphviz layouts unpredictable. Most often what I want is: just boxes, lines, labels, size things to fit, keep everything &#x27;evenly spaced&#x27;.<p>So, I wrote some JS (it&#x27;s ~700 lines of code, no external libraries). I divide a web page into two areas: one textarea where I type commands line-by-line, and the drawing, which is svg. On selectionchange events for the textarea, I debounce for 500ms, so if I&#x27;ve paused the layout&amp;animation kick in. The drawing state has a map of nodes (boxes), which contain a title, an icon, map of connections to other boxes, and a list of children (ids of other nodes), as well as recording the node we are currently zoomed in to, the node we are currently editing, and a few other details. There is a node called &#x27;top&#x27; which is the starting point.<p>The commands are pretty simple and were added as I needed things, eg:<p><pre><code> add internet # add a child to the currently edited node with id &#x27;internet&#x27; # its title and icon are also set to &#x27;internet&#x27; edit internet add host1 icon host # this has id host1, title host1, icon host add host2 icon host title &quot;banana stand&quot; # other attrs are layout and stroke edit top edit aws # editing a non-existent node adds it add ec2 arrow host1 ec2 zoom aws # this node expands to fill the screen top # same as &#x27;zoom top&#x27;, zooms to the top level </code></pre> It&#x27;s interpreted line-by-line so that each line represents one state of the diagram. There are commands to delete nodes: when I delete a node I just remove it from its parent but leave it in the top-level state. That has the neat effect that if I re-add it, I get the node with all its descendents and connections restored in one step, which I can use to pre-diagram things I talk about often.<p>After calculating the drawing state by applying all the commands from the start to the current selection, the next step is to limit this to the visible pieces. I make a copy of the drawing state, starting from the currently zoomed node and following all children. Then I add all connections, if all the &#x27;to&#x27; ends of the connections are visible.<p>Next, I do layout. Starting with the visible tree, annotate all nodes with positions of the box (if any), the icon, and the label. The diagrams I&#x27;m drawing are similar to those produced by AWS Perspective: <a href="https:&#x2F;&#x2F;aws.amazon.com&#x2F;solutions&#x2F;implementations&#x2F;aws-perspective&#x2F;" rel="nofollow">https:&#x2F;&#x2F;aws.amazon.com&#x2F;solutions&#x2F;implementations&#x2F;aws-perspec...</a> , so if a node has no children I draw it as a large icon with a label below, if it has children, it is a box with a small icon to the top left, a centred label at the top. Each node can choose one of a small number of layouts that I can do automatically with just a list of children: &#x27;ring&#x27; (a circle of nodes), &#x27;row&#x27;, &#x27;column&#x27;, or &#x27;snake&#x27; (the default: alternate rtl-ltr rows to evenly fill the space; this will be a grid if that fits or could end up like 4-3-4-3 if it doesn&#x27;t). In ring &amp; snake, boxes are always 4:3; in row and column they are stretched to fit.<p>Next, I do animation. I keep around the previous layed-out state, and use window.requestAnimationFrame to calculate the position of boxes between the start and end state. A box that is in both start and end states is moved, if it is only in start or end I fade it in or out as need be. This lets me animate between _any_ two states of the drawing, so I can talk about one bit of the diagram, then jump back and forth by clicking in the command window, and it smoothly animates between them. I found animating for just 0.5s worked best for interactivity; it&#x27;s nice to see a slower move but it feels laggy when typing.<p>I calculate arrow positions after calculating the final position of boxes and icons. I chose to use circular arcs, because you will never get an awkward situation where an arc lies directly along the edge of a box; straight things are always boxes, curvy things are always arrows. SVG wants two endpoints and a centre to draw these. So, I start with an arc between the centres of the two boxes, choose a radius twice as long as the distance between these points; then I calculate the intersection of the arc with the boxes, and use those two intersection points as the start&#x2F;end of the arc. (this isn&#x27;t that difficult, the formula for the arc is in the svg spec, and it&#x27;s checking 4 straight lines, choose the intersection point closest to the other box). Like the boxes, the arrows fade in and out if they are not needed in one of the start or end states.<p>All of this then just replaces the content of the svg. It&#x27;s surprisingly smooth.<p>One last detail is icons. I&#x27;m using the icons from mingrammer (<a href="https:&#x2F;&#x2F;github.com&#x2F;mingrammer&#x2F;diagrams&#x2F;tree&#x2F;master&#x2F;resources" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mingrammer&#x2F;diagrams&#x2F;tree&#x2F;master&#x2F;resources</a>), which gives me about 1600(!). Finding an icon _while you type_ is awkward and initially I had to drop to the shell to find the file I was going to refer to. I tried giving the drawing tool a mode that would let me visually pick the icon, but 1600 is too many. So I changed it to use a fuzzy search to find an appropriate icon: it looks for the icon where the sequence of characters appear in the shortest substring of the icon path: eg for &#x27;ec2&#x27; it constructs the regex `.*(e.*?c.*?2)`, scoring the matching substring &#x27;ec2&#x27; better than &#x27;elastic2&#x27;, and the shorter containing string &#x27;aws&#x2F;compute&#x2F;ec2&#x27; better than eg &#x27;aws&#x2F;compute&#x2F;ec2-rounded&#x27;. (I have a further round of preferences so that the top level aws iconset is preferred to eg the ibm one, which has terrible icons). This gives you an icon for almost anything you type, and encourages a more playful approach to picking the icon than the exact-match approach.<p>There&#x27;s a bit more to it, I also accept some markdown which fades from the diagram to slides with bullet points, then back to the diagram if the current command is a diagramming command. But the description above is most of it. I could probably have done this better with eg d3 to do the drawing but I am not a front end developer at all and the whole thing was more of a hack over a couple of weekends. I should clean it up a bit, but it works.<p>I serve up pre-prepared pages with this js attached from github pages, I can walk through eg the flow of data clicking the down arrow to change the selection which causes it to animate to the next state which has the next arrow... and so on.
throwaway6734about 3 years ago
Svelte has some pretty neat animation tools built in