Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add faq on svg embeds #236

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions docs/tour/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -60,3 +62,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>

Loading