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

icon not rendered #354

Closed
sinofseven opened this issue Dec 5, 2022 · 8 comments
Closed

icon not rendered #354

sinofseven opened this issue Dec 5, 2022 · 8 comments

Comments

@sinofseven
Copy link

When I output png and svg samples of the document, the icons were not rendered correctly.
https://d2lang.com/tour/icons

9005529033331653  スクリーンショット 2022-12-05 15 23 06

test.d2

my network: {
    icon: https://icons.terrastruct.com/infra/019-network.svg
}
$ d2 test.d2 test.svg
$ d2 test.d2 test.png
$ d2 --version
0.0.13

test.svg
test

test.png
test

@cyborg-ts cyborg-ts added this to D2 Dec 5, 2022
@alixander
Copy link
Collaborator

does it work in --watch? the current version embeds the URLs, so they are only viewable in a browser environment, but won't for example, in an embedded one. we added a --bundle flag and also fixed png exports to inline the image bytes directly in there. it'll be in the next release (coming tomorrow)!

@alixander alixander moved this to Done in D2 Dec 5, 2022
@alixander
Copy link
Collaborator

actually i'll keep this open until we verify with you that the new version works

@alixander alixander reopened this Dec 5, 2022
@mschirrmeister
Copy link

I have seen the same with 0.0.13 (Mac). Even when running it with -b, I think the image is not included, or at least not rendered. With --watch it works fine, only when creating the png the placeholder is seen.

@mschirrmeister
Copy link

Just build the master branch, version 0.0.13.-HEAD and that seems to work fine for me. Straight to png looks fine and I can see that the image is embedded in the svg file.

@schoenenberg
Copy link

schoenenberg commented Feb 27, 2023

I think there is a regression.. Using version 0.2.1 same placeholder as above. Also on the online playground. Please reopen this issue!

deployment_diagram

@alixander
Copy link
Collaborator

@schoenenberg there was a regression where local images weren't working (#889), which is fixed and will be in the next release (should be today!). but it shouldn't affect icons locally. can you copy paste your script?

@alixander alixander reopened this Feb 27, 2023
@schoenenberg
Copy link

@alixander sure. See below:

ds_a.db_a: DB A
ds_a.db_a.shape: cylinder
ds_b.db_b: DB B
ds_b.db_b.shape: cylinder
ds_a.db_c: DB C
ds_a.db_c.shape: page

ds_a: Datacenter A
ds_b: Datacenter B

ds_a.p_a: Process A
ds_b.p_b: Process B

ds_a.f_a: Public Frontend
ds_a.f_a.shape: hexagon

u_a: Data Owner A
u_a.shape: image
u_a.icon: https://icons.terrastruct.com/essentials%2F359-users.svg
u_b: Data Owner B
u_b.shape: image
u_b.icon: https://icons.terrastruct.com/essentials%2F359-users.svg

ds_a: {
  p_a
  db_a
  db_c
  f_a
}

ds_b: {
  p_b
  db_b
}

ds_a.p_a -> ds_b.p_b
ds_a.p_a -> ds_a.db_a
ds_b.p_b -> ds_b.db_b
ds_b.p_b -> ds_a.db_c

ds_a.f_a -> ds_a.p_a
ds_a.f_a -> ds_b.p_b

u_a -> ds_a.db_a
u_b -> ds_b.db_b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants