Skip to content

Commit

Permalink
add faq on svg embeds
Browse files Browse the repository at this point in the history
  • Loading branch information
alixander committed Oct 2, 2024
1 parent bf01f11 commit 028f466
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/tour/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<table>
<thead>
<tr>
<th>Embedding Method</th>
<th>Link Clickable</th>
</tr>
</thead>
<tbody>
<tr>
<td>Inline SVG (&lt;svg&gt;)</td>
<td>Yes</td>
</tr>
<tr>
<td>&lt;img&gt; tag</td>
<td>No</td>
</tr>
<tr>
<td>&lt;object&gt; tag</td>
<td>Yes</td>
</tr>
<tr>
<td>&lt;iframe&gt; tag</td>
<td>Yes</td>
</tr>
<tr>
<td>CSS background image</td>
<td>No</td>
</tr>
<tr>
<td>&lt;embed&gt; tag</td>
<td>Yes</td>
</tr>
</tbody>
</table>

0 comments on commit 028f466

Please sign in to comment.