Merlive

The library / Requirement diagrams

Requirement diagrams, drawn twice

A requirement is a box that says what kind it is, a sentence of what it asks, and its id, risk and how it is verified. Held to the same measure.

46 samples: 37 drawn as written, 9 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 a requirement diagram.

The six kinds of requirement

Drawn

Mermaid
The six kinds of requirement, as Mermaid draws it
Merlive
The six kinds of requirement, as Merlive draws it
The Mermaid
requirementDiagram
  requirement approval {
    id: 1
  }
  functionalRequirement limit {
    id: 1.1
  }
  interfaceRequirement erp_api {
    id: 1.2
  }
  performanceRequirement speed {
    id: 1.3
  }
  physicalRequirement paper {
    id: 1.4
  }
  designConstraint one_screen {
    id: 1.5
  }
Draw it yourself

Mermaid's own words written with capitals

Drawn

Mermaid
Mermaid's own words written with capitals, as Mermaid draws it
Merlive
Mermaid's own words written with capitals, as Merlive draws it
The Mermaid
requirementDiagram
  Requirement approval {
    ID: 1
    Text: Orders over the limit are approved by a manager.
    Risk: High
    VerifyMethod: Test
  }
  Element approval_flow {
    Type: workflow
    DocRef: docs/approval.md
  }
Draw it yourself

A text written as Markdown

Drawn, less something Bold and italic in a requirement's text are drawn as plain words

Mermaid
A text written as Markdown, as Mermaid draws it
Merlive
A text written as Markdown, as Merlive draws it
The Mermaid
requirementDiagram
  requirement approval {
    id: 1
    text: "*Orders* over the limit are **approved** by a manager."
  }
Draw it yourself

The seven relationships

Drawn

Mermaid
The seven relationships, as Mermaid draws it
Merlive
The seven relationships, as Merlive draws it
The Mermaid
requirementDiagram
  requirement approval {
    id: 1
  }
  requirement limit {
    id: 1.1
  }
  requirement speed {
    id: 1.2
  }
  requirement paper {
    id: 1.3
  }
  requirement one_screen {
    id: 1.4
  }
  requirement audit {
    id: 1.5
  }
  element approval_flow {
    type: workflow
  }
  element test_suite {
    type: tests
  }
  approval - contains -> limit
  speed - derives -> approval
  paper - copies -> approval
  one_screen - refines -> approval
  audit - traces -> approval
  approval_flow - satisfies -> approval
  test_suite - verifies -> limit
Draw it yourself

Relationships written from their other end

Drawn

Mermaid
Relationships written from their other end, as Mermaid draws it
Merlive
Relationships written from their other end, as Merlive draws it
The Mermaid
requirementDiagram
  requirement approval {
    id: 1
  }
  requirement limit {
    id: 1.1
  }
  requirement speed {
    id: 1.2
  }
  element approval_flow {
    type: workflow
  }
  limit <- contains - approval
  approval <- derives - speed
  approval <- satisfies - approval_flow
Draw it yourself

A requirement that contains others

Drawn, less something The crossed ring Mermaid draws at the requirement that contains is drawn as a filled circle

Mermaid
A requirement that contains others, as Mermaid draws it
Merlive
A requirement that contains others, as Merlive draws it
The Mermaid
requirementDiagram
  requirement approval {
    id: 1
  }
  requirement limit {
    id: 1.1
  }
  requirement erp_api {
    id: 1.2
  }
  approval - contains -> limit
  approval - contains -> erp_api
Draw it yourself

Direction: top to bottom

Drawn

Mermaid
Direction: top to bottom, as Mermaid draws it
Merlive
Direction: top to bottom, as Merlive draws it
The Mermaid
requirementDiagram
  direction TB
  requirement approval {
    id: 1
  }
  element approval_flow {
    type: workflow
  }
  approval_flow - satisfies -> approval
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
requirementDiagram
  direction LR
  requirement approval {
    id: 1
  }
  element approval_flow {
    type: workflow
  }
  approval_flow - satisfies -> approval
Draw it yourself

Direction: bottom to top

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

Mermaid
Direction: bottom to top, as Mermaid draws it
Merlive
Direction: bottom to top, as Merlive draws it
The Mermaid
requirementDiagram
  direction BT
  requirement approval {
    id: 1
  }
  requirement limit {
    id: 1.1
  }
  approval - contains -> limit
Draw it yourself

A class given with ::: where a thing is declared

Drawn

Mermaid
A class given with ::: where a thing is declared, as Mermaid draws it
Merlive
A class given with ::: where a thing is declared, as Merlive draws it
The Mermaid
requirementDiagram
  requirement approval:::urgent {
    id: 1
  }
  element approval_flow:::built {
    type: workflow
  }
  classDef urgent fill:#ffcdd2,stroke:#c62828
  classDef built fill:#c8e6c9,stroke:#2e7d32
  approval_flow - satisfies -> approval
Draw it yourself

A class given with ::: to a name alone

Drawn

Mermaid
A class given with ::: to a name alone, as Mermaid draws it
Merlive
A class given with ::: to a name alone, as Merlive draws it
The Mermaid
requirementDiagram
  requirement approval {
    id: 1
  }
  element "Approval flow" {
    type: workflow
  }
  approval:::urgent
  "Approval flow":::built
  classDef urgent fill:#ffcdd2,stroke:#c62828
  classDef built fill:#c8e6c9,stroke:#2e7d32
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
requirementDiagram
  requirement approval:::urgent,late {
    id: 1
  }
  requirement limit {
    id: 1.1
  }
  classDef urgent fill:#ffcdd2,stroke:#c62828
  classDef late stroke-width:4px
  class limit urgent,late
Draw it yourself

A default class for every requirement

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

Mermaid
A default class for every requirement, as Mermaid draws it
Merlive
A default class for every requirement, as Merlive draws it
The Mermaid
requirementDiagram
  requirement approval {
    id: 1
  }
  requirement limit {
    id: 1.1
  }
  classDef default fill:#e3f2fd,stroke:#1565c0
  classDef urgent fill:#ffcdd2,stroke:#c62828
  class limit urgent
Draw it yourself

A requirement styled on its own

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

Mermaid
A requirement styled on its own, as Mermaid draws it
Merlive
A requirement styled on its own, as Merlive draws it
The Mermaid
requirementDiagram
  requirement approval {
    id: 1
  }
  requirement limit {
    id: 1.1
  }
  style approval fill:#ffcdd2,stroke:#c62828,stroke-width:4px
Draw it yourself

Several styled in one line, one named in quotes

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

Mermaid
Several styled in one line, one named in quotes, as Mermaid draws it
Merlive
Several styled in one line, one named in quotes, as Merlive draws it
The Mermaid
requirementDiagram
  requirement approval {
    id: 1
  }
  requirement "Buyer limit" {
    id: 1.1
  }
  element approval_flow {
    type: workflow
  }
  style approval,"Buyer limit" stroke:#c62828,stroke-dasharray: 5 5
Draw it yourself

A title in front matter

Drawn

Mermaid
A title in front matter, as Mermaid draws it
Merlive
A title in front matter, as Merlive draws it
The Mermaid
---
title: What an order needs
---
requirementDiagram
  requirement approval {
    id: 1
    text: Orders over the limit are approved by a manager.
  }
  element approval_flow {
    type: workflow
  }
  approval_flow - satisfies -> approval
Draw it yourself

A whole diagram: requirements of three kinds, two elements, and how they bear on each other

Drawn

Mermaid
A whole diagram: requirements of three kinds, two elements, and how they bear on each other, as Mermaid draws it
Merlive
A whole diagram: requirements of three kinds, two elements, and how they bear on each other, as Merlive draws it
The Mermaid
requirementDiagram
  requirement approval {
    id: 1
    text: Orders over the limit are approved by a manager.
    risk: high
    verifymethod: test
  }
  functionalRequirement limit {
    id: 1.1
    text: The limit is set per buyer.
    risk: medium
    verifymethod: inspection
  }
  performanceRequirement speed {
    id: 1.2
    text: An approval is asked for within a minute.
    risk: low
    verifymethod: analysis
  }
  element approval_flow {
    type: workflow
    docref: docs/approval.md
  }
  element test_suite {
    type: tests
    docref: tests/approval
  }
  approval - contains -> limit
  speed - derives -> approval
  approval_flow - satisfies -> approval
  test_suite - verifies -> limit
Draw it yourself