Skip to content

classes - #772

Merged
alixander merged 1 commit into
d2lang:masterfrom
alixander:classes
Apr 7, 2023
Merged

classes#772
alixander merged 1 commit into
d2lang:masterfrom
alixander:classes

Conversation

@alixander

@alixander alixander commented Feb 6, 2023

Copy link
Copy Markdown
Collaborator
classes: {
  dragon_ball: {
    label: ""
    shape: circle
    style.fill: orange
    style.stroke-width: 0
    width: 50
  }
}
nostar: { class: dragon_ball }
1star: { label: "*"; class: dragon_ball }
2star: { label: "**"; class: dragon_ball }

Screen Shot 2023-04-03 at 8 47 16 PM

classes: {
  orb: {
    shape: circle
    style.fill: red
    style.stroke-width: 0
    label: ""
  }
}

a.class: orb
b.class: orb
c.class: orb
d.class: orb

steps: {
  1: {
    classes.orb.style.fill: blue
  }
  2: {
    classes.orb.style.fill: green
  }
  3: {
    classes.orb.style.fill: yellow
  }
}
Kapture.2023-04-06.at.22.59.00.mp4

Also writes classes to SVGs, which can be a workflow to tag things in D2 for post processing. closes #566

Followups:

closes #102

@alixander
alixander requested a review from nhooyr April 4, 2023 03:39
@alixander
alixander marked this pull request as ready for review April 4, 2023 03:39
@alixander

alixander commented Apr 4, 2023

Copy link
Copy Markdown
Collaborator Author

@nhooyr this isn't quite ready for merging yet but would like a review of this initial implementation

edit: this is now ready for merging

@alixander alixander changed the title wip: classes classes Apr 4, 2023
@alixander
alixander force-pushed the classes branch 3 times, most recently from 9c63835 to a85c691 Compare April 7, 2023 05:34
@alixander

Copy link
Copy Markdown
Collaborator Author

@nhooyr bump, i wanna release tmr morning

Comment thread d2compiler/compile.go Outdated
Comment thread d2compiler/compile.go
Comment thread d2compiler/compile.go
Comment thread d2ir/compile.go
Comment thread d2ir/d2ir.go Outdated
@alixander
alixander requested a review from nhooyr April 7, 2023 15:59

@nhooyr nhooyr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@alixander
alixander merged commit ccb3860 into d2lang:master Apr 7, 2023
@alixander
alixander deleted the classes branch April 7, 2023 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Add free-form 'tagging' of objects and relationships for plugin interpretation syntax: classes

2 participants