Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

classes #772

Merged
merged 1 commit into from
Apr 7, 2023
Merged

classes #772

merged 1 commit into from
Apr 7, 2023

Conversation

alixander
Copy link
Collaborator

@alixander alixander commented Feb 6, 2023

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
Copy link
Collaborator Author

alixander commented Apr 4, 2023

@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
Collaborator Author

@nhooyr bump, i wanna release tmr morning

d2compiler/compile.go Outdated Show resolved Hide resolved
d2compiler/compile.go Show resolved Hide resolved
d2compiler/compile.go Show resolved Hide resolved
d2ir/compile.go Show resolved Hide resolved
d2ir/d2ir.go Outdated Show resolved Hide resolved
@alixander alixander requested a review from nhooyr April 7, 2023 15:59
Copy link
Contributor

@nhooyr nhooyr left a comment

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 terrastruct: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