From 028f46696135b5977e69d2a3576d6ab119593f25 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Wed, 2 Oct 2024 11:29:15 -0600 Subject: [PATCH 1/2] add faq on svg embeds --- docs/tour/faq.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/docs/tour/faq.md b/docs/tour/faq.md index 60493338..0517fb21 100644 --- a/docs/tour/faq.md +++ b/docs/tour/faq.md @@ -60,3 +60,49 @@ Not currently and not in the near future. See Not currently, but in the near future. See [discussion](https://github.com/terrastruct/d2/discussions/605) for more. + +## Exports + +### No interactivity in SVG export + +SVG exports can have some interactive elements when using links and tooltips. However, +interactivity in SVG can be disabled depending on environment. There are several ways to +include SVGs on a web page. + +tldr; when it's treated as an image, the interactivity is lost. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Embedding MethodLink Clickable
Inline SVG (<svg>)Yes
<img> tagNo
<object> tagYes
<iframe> tagYes
CSS background imageNo
<embed> tagYes
+ From d8773a7647d5872102d05a2c65c7891f7a00d133 Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Wed, 2 Oct 2024 11:35:11 -0600 Subject: [PATCH 2/2] toc --- docs/tour/faq.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/tour/faq.md b/docs/tour/faq.md index 0517fb21..4dc138a0 100644 --- a/docs/tour/faq.md +++ b/docs/tour/faq.md @@ -10,6 +10,8 @@ * [Layouts](#layouts) + [Can an object be part of more than 1 container?](#can-an-object-be-part-of-more-than-1-container) + [Can I specify ports?](#can-i-specify-ports) +* [Exports](#exports) + + [No interactivity in SVG export](#no-interactivity-in-svg-export) ## General