Merlive

The library / Entity diagrams

Entity diagrams, drawn twice

An entity is a box that lists its attributes under its name, and a relationship ends in how many. Held to the same measure, and to the rows each box lists and what each link ends in.

48 samples: 38 drawn as written, 10 drawn less something. Mermaid’s side is mermaid-cli 12.2.0 as it comes, on white. Merlive’s is 0.6.1 in its own look. What is read of an entity diagram.

How many, written in words

Drawn

Mermaid
How many, written in words, as Mermaid draws it
Merlive
How many, written in words, as Merlive draws it
The Mermaid
erDiagram
    SUPPLIER only one to zero or more ORDER : receives
    ORDER 1 to one or more ORDER_LINE : contains
    ORDER zero or one to one or zero INVOICE : "is billed by"
    PRODUCT one or many to zero or many SUPPLIER : "is stocked by"
Draw it yourself

A comment on an attribute

Drawn, less something A comment is not in its row: it is in the note on its entity, which a reader sees on picking the box

Mermaid
A comment on an attribute, as Mermaid draws it
Merlive
A comment on an attribute, as Merlive draws it
The Mermaid
erDiagram
    INVOICE {
        string number PK "As printed on the invoice"
        string(40) reference "Only 40 characters are allowed"
        decimal total
    }
Draw it yourself

Direction: left to right

Drawn, less something Drawn top to bottom: boxes of different heights are only placed that way yet

Mermaid
Direction: left to right, as Mermaid draws it
Merlive
Direction: left to right, as Merlive draws it
The Mermaid
erDiagram
    direction LR
    SUPPLIER ||--o{ ORDER : receives
    ORDER ||--|{ ORDER_LINE : contains
Draw it yourself

A group inside a group

Drawn

Mermaid
A group inside a group, as Mermaid draws it
Merlive
A group inside a group, as Merlive draws it
The Mermaid
erDiagram
    subgraph Buying
        SUPPLIER ||--o{ ORDER : receives
        subgraph Lines
            ORDER_LINE {
                int quantity
            }
        end
        ORDER ||--|{ ORDER_LINE : contains
    end
Draw it yourself

A group with a direction of its own

Drawn, less something The group's own direction is read past; it runs the way the rest does

Mermaid
A group with a direction of its own, as Mermaid draws it
Merlive
A group with a direction of its own, as Merlive draws it
The Mermaid
erDiagram
    subgraph Buying
        direction LR
        SUPPLIER ||--o{ ORDER : receives
    end
    ORDER ||--o| INVOICE : "is billed by"
Draw it yourself

An entity styled on its own

Drawn, less something Its outline is broken, heavy and red as written, in the design's own red; its fill is the design's

Mermaid
An entity styled on its own, as Mermaid draws it
Merlive
An entity styled on its own, as Merlive draws it
The Mermaid
erDiagram
    SUPPLIER ||--o{ ORDER : receives
    style ORDER fill:#fde,stroke:#c00,stroke-width:4px,stroke-dasharray: 5 5
Draw it yourself

Several entities styled in one line

Drawn, less something Their outlines are heavy and blue as written, in the design's own blue

Mermaid
Several entities styled in one line, as Mermaid draws it
Merlive
Several entities styled in one line, as Merlive draws it
The Mermaid
erDiagram
    SUPPLIER ||--o{ ORDER : receives
    ORDER ||--|{ ORDER-LINE : contains
    style ORDER,ORDER-LINE stroke:#00c,stroke-width:3px
Draw it yourself

Several classes given at once

Drawn, less something A box is of one kind: of several classes, the first is the one it is

Mermaid
Several classes given at once, as Mermaid draws it
Merlive
Several classes given at once, as Merlive draws it
The Mermaid
erDiagram
    SUPPLIER ||--o{ ORDER : receives
    classDef late,held stroke:#c62828
    class ORDER late,held
Draw it yourself

A class given with :::

Drawn

Mermaid
A class given with :::, as Mermaid draws it
Merlive
A class given with :::, as Merlive draws it
The Mermaid
erDiagram
    ORDER:::late {
        int number
    }
    SUPPLIER:::trusted
    SUPPLIER ||--o{ ORDER : receives
    classDef late stroke:#c62828
    classDef trusted stroke:#2e7d32
Draw it yourself

A default class for every entity

Drawn, less something The default class is read past: the look is the design's

Mermaid
A default class for every entity, as Mermaid draws it
Merlive
A default class for every entity, as Merlive draws it
The Mermaid
erDiagram
    SUPPLIER ||--o{ ORDER : receives
    classDef default fill:#f9f,stroke:#333,stroke-width:4px
Draw it yourself

A title and settings in front matter

Drawn, less something Mermaid's own settings are read past: the look and the placement are Merlive's

Mermaid
A title and settings in front matter, as Mermaid draws it
Merlive
A title and settings in front matter, as Merlive draws it
The Mermaid
---
title: Orders and who fills them
config:
    layout: dagre
    theme: default
    look: classic
---
erDiagram
    SUPPLIER ||--o{ ORDER : receives
Draw it yourself