订单领域类图. Copy the source, paste into the official playground, done. No coordinates — every position is stated relative to something else.
node customer "Customer"
node order "Order" below customer
node item "OrderItem" below order left
node product "Product" below item
edge customer -> order "places 1:N"
edge order -> item "contains 1:N"
edge item -> product "refs N:1"npx reladraw class-diagram.reladraw -o out.svgA domain-model class diagram for the same e-commerce shape as the ER template: customers place orders, orders contain items, items reference products. Use it in OOP design discussions and code review docs — the 1:N / N:1 labels double as relationship multiplicity.
node vip "VipCustomer" below customer and edge vip -> customer "extends".node order "Order\n+ id\n+ total" — \n breaks the label across lines.node payable "Payable" above order with edge order -> payable "implements".Yes for the common case: classes as nodes, relationships as labeled edges (extends, implements, 1:N). Full UML notation — compartments, visibility markers on every member — works better in dedicated UML tools, but attribute lists fit fine as line-broken labels.
In the edge label: contains for composition, has for aggregation. If your audience expects the diamond notation, keep a legend line or export and annotate — the topology stays identical.
Same domain, different lens: the ER diagram models stored data and cardinality; the class diagram models behavior-bearing types and inheritance. Architects usually keep both.