UML Class Diagram
Animal / Dog / Cat / Trainer class diagram using the class-box shape.
Rendering…
Make it your own.
{
"nodes": [
{ "id":"a", "type":"class-box", "label":"Animal\n+name: string\n+age: int\n+makeSound(): void", "x":280, "y":40, "fill":"#dbeafe", "w":200, "h":140 },
{ "id":"d", "type":"class-box", "label":"Dog\n+breed: string\n+fetch(): void", "x":40, "y":260, "fill":"#dbeafe", "w":200, "h":110 },
{ "id":"c", "type":"class-box", "label":"Cat\n+indoor: bool\n+purr(): void", "x":260, "y":260, "fill":"#dbeafe", "w":200, "h":110 },
{ "id":"t", "type":"class-box", "label":"Trainer\n+name: string\n+train(a: Animal): bool", "x":520, "y":260, "fill":"#fef3c7", "w":220, "h":110 }
],
"edges": [
{ "id":"e1","source":"d","target":"a","label":"inherits","style":"dashed" },
{ "id":"e2","source":"c","target":"a","label":"inherits","style":"dashed" },
{ "id":"e3","source":"t","target":"a","label":"trains 1..*" }
]
}