Git Product home page Git Product logo

gaecom / d2-playground Goto Github PK

View Code? Open in Web Editor NEW

This project forked from terrastruct/d2-playground

0.0 1.0 0.0 32.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 3.00% JavaScript 34.07% Go 2.04% TypeScript 18.15% CSS 26.00% HTML 16.74%

d2-playground's Introduction

D2 Playground

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

ci daily discord twitter license

Notice: This is not the repository for the D2 language. That can be found here.

Table of Contents

FAQ

What is this written in?

Vanilla HTML, CSS, and Javascript.

How does it work?

Sequence diagram

What's this API?

We are working on a full WASM build of D2 that includes the layout engines, but it requires optimizations to get the build size down to be manageable for the web. Tracking here: https://github.com/terrastruct/d2/pull/436/files.

When this is ready, Playground will offer two options: a fully offline, local version powered by D2 WASM running on your browser, and an API version, for running on low-power machines. Currently, the API just takes an encoded D2 script and runs the layout engine. It saves no data and does nothign else.

Contributing

Contributions are welcome!

  1. Install esbuild: https://esbuild.github.io/getting-started/#install-esbuild
  2. Run git submodule update --init --recursive to pull the submodules (D2's VSCode plugin for syntax highlighting, and our CI library).
  3. Go to src/js and run yarn to get the Node modules.
  4. Run go run main.go and open http://localhost:9090.

Dependencies

External dependencies are kept to a minimum. Currently they are:

  1. Monaco Editor for text editing features.
  2. Panzoom for SVG navigation.

Both are not ideal. Monaco is unnecessarily heavy and Panzoom lacks scrolling. The plan is to replace these one day.

If you're a contributor, please do not add any dependencies without discussing first.

d2-playground's People

Contributors

alixander avatar nhooyr avatar

Watchers

 avatar

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.