Able to run in a browser #234
Replies: 4 comments 8 replies
-
I believe d2 is on the way for it in its own way, pls see #207 |
Beta Was this translation helpful? Give feedback.
-
that's different. that's a playground environment, i believe @ericis is asking about a library callable from client-side browser context. Indeed, we have plans to port D2 to WebAssembly. |
Beta Was this translation helpful? Give feedback.
-
Yes, correct @alixander . The simple use case would be building a diagram via JavaScript in the browser, a more advanced example might be the MermaidJS "Live editor" and the best example I can think of might be an embedded web editor like Eclipse Theia or VS Code complete with a language server for a rich diagram editing experience with live preview. |
Beta Was this translation helpful? Give feedback.
-
Have there been any new developments? d2 is a great project that can do things that MermaidJS can't, but I think it can run directly in a web browser. Since most documents are static pages, there is no Golang environment. |
Beta Was this translation helpful? Give feedback.
-
The very first use cases that came to mind for d2 was working within a browser context. However, it's written in Go.
As a result, there are really two options: rewrite in JavaScript or use WebAssembly.
This issue simply requests browser support (not making a network request to a server) to execute d2.
I might personally suggest WebAssembly, since the project is well underway and would take a significant shift otherwise.
Beta Was this translation helpful? Give feedback.
All reactions