Skip to main content

Block

The following classes can be useful when creating requirement diagrams:

  • siren
  • block

Introduction

siren.block [
block.columns(1)
block.blockCircle("db", "DB")
block.arrowDown "blockArrowId6"
block.cIdBlock("ID", [
block.block("A")
block.block("B", "A wide one in the middle")
block.block("C")
])
block.space
block.block("D")
block.link ("ID", "D")
block.link ("C", "D")
block.style ("B", ["fill", "#939"; "stroke", "#333"; "stroke-width", "4px"])
]
|> siren.write

Services

let Frontend, Backend, Database = "Frontend", "Backend", "Database"
let actual =
siren.block [
block.columns(3)
block.line [
block.block(Frontend)
block.arrowRight("blockArrowId6",1)
block.block(Backend)
]
block.line [
block.spacew 2
block.arrowDown("down",1)
]
block.line [
block.block "Disk"
block.arrowLeft("left",1)
block.blockCylindrical(Database)
]
block.classDef("front", ["fill", "#696"; "stroke", "#333"])
block.classDef("back", ["fill", "#969"; "stroke", "#333"])
block.``class``([Frontend], "front")
block.``class``([Backend; Database], "back")
]
|> siren.write

Decision Making

siren.block [
block.columns(3)
block.line [
block.blockCircle("Start")
block.spacew(2)
]
block.line [
block.arrowDownLabeled("down", " ")
block.spacew(2)
]
block.line [
block.blockHexagon("Decision","Make Decision")
block.arrowRightLabeled("right", "Yes")
block.block("Process1", "Process A")
]
block.line [
block.arrowDownLabeled("downAgain", "No")
block.space
block.arrowDownLabeled("r3", "Done")
]
block.line [
block.block("Process2", "Process B")
block.arrowRightLabeled ("r2", "Done")
block.blockCircle("End")
]
block.style("Start", ["fill", "#969"])
block.style("End", ["fill", "#696"])
]
|> siren.write