Giter Site home page Giter Site logo

terrastruct / d2-playground Goto Github PK

View Code? Open in Web Editor NEW
66.0 66.0 9.0 38.37 MB

An online runner to play, learn, and create with D2, the modern diagram scripting language that turns text to diagrams.

Home Page: https://play.d2lang.com

License: Mozilla Public License 2.0

Shell 2.98% Go 2.03% CSS 25.83% HTML 16.88% JavaScript 34.26% TypeScript 18.03%
diagramming diagrams text-to-diagrams

d2-playground's People

Contributors

alixander avatar nhooyr avatar richnahra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

d2-playground's Issues

surface better error messages

Hope to add `/export/{format}` to render raw svg/png directly

Dark Flagship Terrastruct theme missing

Screen Shot 2023-06-16 at 1 39 22 PM

Available themes:
Light:
- Neutral default: 0
- Neutral Grey: 1
- Flagship Terrastruct: 3
- Cool classics: 4
- Mixed berry blue: 5
- Grape soda: 6
- Aubergine: 7
- Colorblind clear: 8
- Vanilla nitro cola: 100
- Orange creamsicle: 101
- Shirley temple: 102
- Earth tones: 103
- Everglade green: 104
- Buttered toast: 105
- Terminal: 300
- Terminal Grayscale: 301
- Origami: 302
Dark:
- Dark Mauve: 200
- Dark Flagship Terrastruct: 201

and cool classics / mixed berry blue have their order swapped?

D2 encountered an API error: the link to the playground is reported

Here is the link with the error:
https://play.d2lang.com/?script=NMqxCsIwFIXhPU9xwDlQdMvm6ObgC1yTYxtoc-EmLYjk3YWI43fOf4jVgI8D0tlHLa88_wis8ta9eZY5FwY0aTL2Ex4LIU89iCh7ZYXger-BZmr_hLblIivawo2ImjieQZ9TwGWaHNBdd98AAAD__w%3D%3D&layout=tala&

Here is the code that cause the error:

vars: {
  d2-config: {
    layout-engine: tata
    # The above causes a API error
    # Terminal theme code
    theme-id: 300
  }
}

It seems that the offending line of the code is
layout-engine: tata

If I commented out this line, then there is no more API error.

Old play.d2lang.com URLs broke after d2/urlenc changes

Hello, I've been using play.d2lang.com to make diagrams and store them in a wiki page over the last few weeks. Pretty nice, thanks! I noticed this week that the URLs I had stored were broken. When I clicked them my elaborate diagrams started to only show a dreaded:

x -> y

I decided to figure out why and I found that the URL encoded changed in the d2 repository, in a commit from Nov 7: terrastruct/d2@5eead31

This did not take effect on the d2 playground site until d2 was upgraded for the deployed wasm, on Dec 6: ae1e9c3

When the bundled, WASM version of d2 was deployed this created a cutoff date. Any URLs generated before the cutoff would no longer properly decode their embedded d2 "scripts". Only URLs for documents created after the cutoff date would decode properly.

The following is a Go program I used to convert old URLs to the new URLs. I read the above commit and decoded using the old deflate dictionary, then encoding with the same parameters as the new urlenc.Encode. I just wanted to share that with anyone who needs it.

https://gist.github.com/jrcd-HR/92ef3407c9f5061787b7c7a095a031ea

I'm not sure how to fix it, other than first trying the new url.Decode method, and then trying the backup method if that fails. Of course, the problem is that the backup method is no longer implemented in the d2 wasm.

add a loader for editor

in case monaco loads slowly.

or a non-syntax-highlighted read-only syntax placeholder in the editor

memory leak

when i open playground it eats a lot of ram (several gigabytes) and i can't use it, please fix, it shouldn't eat so much memory even temporarily

Add examples of shapes

In the Syntax snippets section of D2 Playground, I'd love to see examples of every shape that exists in the Customize shape type box:

diamond: { shape: diamond }
hexagon: { shape: hexagon}
...

go build and run fails

This is what I consider to be an operational bug. Looks like this has only been designed to run in CI and deployed to whereever you're deploying this to ๐Ÿ˜…

I tried to build this locally and run it and failed.

go build .
./d2-playground`

should "just work"โ„ข (but it does not)

Also it should be possible to install the binary elsewhere and have the assets builtin using the embed package, e.g:

go install .
cd ~
d2-playground

But this also does not work.

Honestly this should also help make it a hell of a lot easier to contribute too as well ๐Ÿคž

Can we please fix this? ๐Ÿ™

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.