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

UML Diagrams: Can't specify shape-class-attribute #1785

Closed
kusnezoff-alexander opened this issue Dec 19, 2023 · 1 comment
Closed

UML Diagrams: Can't specify shape-class-attribute #1785

kusnezoff-alexander opened this issue Dec 19, 2023 · 1 comment

Comments

@kusnezoff-alexander
Copy link

I am trying to model a class, which has a property named shape (defined by another library, so unfortunately I can't change its name).

The following workarounds don't work:

myclass: {
	shape: class
	# quote
        "shape": String
}

myclass: {
	shape: class
	# capitalize
        Shape: String
}

I always get the following error:

4:12: unknown shape "String"

It would be nice to somehow escape custom properties named shape 😀

Possible Solution

Add possibility to escape custom properties named shape in UML diagrams.

Steps to Reproduce

Try to compile one of these examples (eg in https://play.d2lang.com/)

myclass: {
	shape: class
	# quote
        "shape": String
}

myclass: {
	shape: class
	# capitalize
        Shape: String
}
@cyborg-ts cyborg-ts added this to D2 Dec 19, 2023
@kusnezoff-alexander
Copy link
Author

Nvm: Adding visibility to the shape field solves the problem.

myclass: {
  shape: class
  +shape: a
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant