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

D2JS - theme/center/pad has no effect on an svg #2307

Open
artkhod opened this issue Jan 27, 2025 · 3 comments · May be fixed by #2343
Open

D2JS - theme/center/pad has no effect on an svg #2307

artkhod opened this issue Jan 27, 2025 · 3 comments · May be fixed by #2343

Comments

@artkhod
Copy link

artkhod commented Jan 27, 2025

https://d2lang.com/tour/vars/#configuration-variables

Works on cli but doesn't work with wasm build/d2js.

Image

Image

@cyborg-ts cyborg-ts added this to D2 Jan 27, 2025
@MichaelCropper
Copy link

Any ideas where to look in the codebase to fix this? Feels like a small colouring in thing should be a relatively quick fix people knew where to look?

@alixander
Copy link
Collaborator

@MichaelCropper If you're inclined:

Probably somewhere here: https://github.com/terrastruct/d2/blob/master/d2js/d2wasm/functions.go

Which is the interface to go the Go functions from d2js: https://github.com/terrastruct/d2/tree/master/d2js/js

@MichaelCropper
Copy link

@alixander Looks to be missing a few imports at the very top of the functions.go file, specifically;

  1. oss.terrastruct.com/d2/d2renderers/d2sketch
  2. oss.terrastruct.com/d2/d2themes
  3. oss.terrastruct.com/d2/d2themescatalog

I'm making this assumption based on what I can see in that file VS what I can see in the console log on the CONTRIBUTING.md guidelines with the packages listed there.

I've not used Go before so bit of a learning curve to try and get a local dev environment spun up and attempt to take a stab at actually fixing this.

Unlikely to be as simple as just adding in the missing imports, although I can see code references to Sketch and Theme in that same file, so perhaps it is just this which is missing?

@x-delfino x-delfino linked a pull request Feb 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants