Giter Site home page Giter Site logo

terrastruct / d2 Goto Github PK

View Code? Open in Web Editor NEW
15.9K 55.0 392.0 164.63 MB

D2 is a modern diagram scripting language that turns text to diagrams.

Home Page: https://d2lang.com

License: Mozilla Public License 2.0

Go 91.36% JavaScript 3.01% CSS 0.02% HTML 0.07% Makefile 0.04% Shell 5.16% Dockerfile 0.09% Roff 0.25%
diagramming diagrams text-to-diagram software-architecture go golang developer-tools

d2's People

Contributors

alankan886 avatar alexstoick avatar alixander avatar barrynolte avatar berniexie avatar donglixiaoche avatar ejulio-ts avatar exapsy avatar gavin-ts avatar ifndev avatar janydoe avatar jettchent avatar kevin-david avatar landmaj avatar leonardsoncc avatar martinjirku avatar maxbrunet avatar mrblenny avatar nekikara avatar nhooyr avatar onerain233 avatar paracelsus-rose avatar poivey avatar satoqz avatar segelt avatar sinyo-matu avatar tmc avatar vaelatern avatar vfosnar avatar wycats 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  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  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

d2's Issues

cli: Add issue link upon crash

If something does panic within D2, the CLI should include a link to Github issues in the terminal display in case users want to report it.

syntax: classes

classes should aggregate styles so you don't have to apply the same set of styles in a bunch of places

should fonts be embedded into SVG?

Currently we base64 encode fonts (to WOFF mimetype) and include directly in the SVG. This is to ensure the SVG has reproducible appearance everywhere and regardless of network connections.

However, this can make the SVG file unwieldy:

  1. Larger file sizes. Fonts can add 1MB or so.
  2. Opening up the SVG has this unreadable blob.

The alternatives are:

  1. Drop the "regardless of network connections" part. Fetch hosted fonts online.
  2. Use a ~universal font, e.g. Times New Roman where the vast majority of machines will have installed. Downside is that it's Times New Roman.
  3. ???

layout: fix dagre container-child connections

dagre doesn't handle container connections so the solution is to connect to a container's child, then cut the edge at the container's border. This works well if something outside is connecting to the container, but if it is from a child/descendant, then it will show up as an edge between descendants. Perhaps we can add a dummy node outside the container, and use that for connections going to a container from a descendant.

example:

container.first -> container.second: 1->2
container -> container.second: container->2

dagre layout (incorrect edge)

Screen Shot 2022-11-11 at 3 29 24 PM

tala layout

Screen Shot 2022-11-11 at 3 29 36 PM

lsp: kickoff

autocomplete list of shapes, choosing objects accessible from scope, etc

dagre container label overflows

aws_s3: AWS S3 California {
    Monitoring -> California
}
aws_s3: "AWS S3 San Francisco, California" {
    California.San Francisco
}

197423135-141668fd-6f3f-47a4-a680-dffc83872e21

layout, syntax: Sequence diagrams

i can't find an open-source standalone renderer for sequence diagrams. There's some that are integrated into other tools, but they're coupled with their tool. Might have to build one from scratch, which shouldn't be too hard.

Will probably also have to modify syntax

markdown code blocks

Standalone code snippets are implemented, but markdown can also have code blocks that need to be brought under the fold of consistent measurements, font, syntax highlighting

syntax: globs

e.g. parent.*.shape: oval.

Just have to watch out for ambiguous syntax

And the & symbol as a followup.

Change every circle red:

*: {
  &shape: circle
  style.fill: red
}

whitespace padding should be configurable

Currently the renderer adds a bit of padding around the bounding box, but it should be configurable

Binary include/exclude, or number? E.g. xPadding=40 yPadding=0. Probably just binary

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.