d2 icon indicating copy to clipboard operation
d2 copied to clipboard

gif work with `animated` keyword

Open alixander opened this issue 2 years ago • 5 comments

Currently the animated keyword works on connections to make them appear animated in SVGs, but it doesn't work in GIF. GIF only works for multi-board diagrams.

Reasonable for GIF to work with just one board that has an animated connection.

alixander avatar Oct 16 '23 00:10 alixander

"d2.exe --animate-interval" and "style.animated: true" what are you going to do about the coexistence?

bo-ku-ra avatar Oct 18 '23 22:10 bo-ku-ra

There's no conflict.

--animate-interval dictates how long the GIF lingers on each board. style.animated makes the line animated at a constant rate.

alixander avatar Oct 18 '23 23:10 alixander

i could not imagine that each one is animated in its own time interval in the gif file. but you said there was no problem. thank you.

bo-ku-ra avatar Oct 19 '23 07:10 bo-ku-ra

I tried this-

A -> B : "Animated" {
    style: {
        "animated": true
    }
}

Then export like this-

d2 test.d2 test.gif --animate-interval=1200

It the preview it works, as well as in the svg export. But for gif export, it doesn't animate.

I am on Mac by the way.

milon avatar Feb 17 '24 00:02 milon

+1, a lot of apps (eg Slack) don't support SVGs. I'm working around it with an SVG->GIF service, but it loses tooltips

pl4nty avatar Sep 04 '24 01:09 pl4nty