causal-loop-diagram.fbl
fbl0.10.1causal-loop-diagram.fbl
Example document causal-loop-diagram.fbl
Views generated from the file
This view is drawn by this site from causal-loop-diagram.fbl itself. It shows the data in the document, not the notation the diagram draws.
causal-loop-diagram.fbl at 4590c56Diagram as text (Mermaid)
flowchart LR
accTitle: Bindings of causal-loop-diagram.fbl
accDescr: Flowchart of the bindings in causal-loop-diagram.fbl: 1 binding(s) (cld) as boxes with the files they claim and their body's format family, and 2 element rule(s) and 1 relation rule(s) as rounded boxes with the type each produces.
b_cld["Causal loop diagram<br/>cld<br/>.cld, lines family"]
e_cld_variable("variable<br/>Variable")
b_cld -->|element| e_cld_variable
e_cld_loop("loop<br/>Loop")
b_cld -->|element| e_cld_loop
r_cld_link(["link<br/>CausalLink"])
b_cld -->|relation| r_cld_linkThe file
Download causal-loop-diagram.fbl (3,243 bytes, unchanged from the source).
{
"$schema": "https://etalii.net/adp/fbl/schema/0.1/fbl.schema.json#/$defs/Document",
"fbl": "0.1",
"doc": "The causal loop diagram's .cld body (definitions/diagrams/causal-loop-diagram.dis, causal-loop-diagram.md): the lines family. One statement per line; the words after a link's arrow come in any order, so they are bound as words of one group; a renamed variable is rewritten in every link and loop that names it.",
"bindings": {
"cld": {
"title": "Causal loop diagram",
"claims": { "extensions": [".cld"], "origins": ["systems/causal-loop-diagram"] },
"body": { "kind": "file", "family": "lines" },
"reader": "declared",
"text": { "newline": "crlf", "finalNewline": true },
"header": { "line": "^causal-loop(\\s|$)" },
"comment": "^\\s*#",
"unmatched": "report",
"elements": [
{
"name": "variable",
"type": "Variable",
"line": "^variable\\s+(?<name>[^\\s\"]+)(?:\\s+\"(?<label>[^\"]*)\")?\\s*$",
"id": { "from": { "group": "name" } },
"attributes": {
"name": { "group": "name", "empty": "refuse", "reference": { "to": ["variable"], "by": "name" } },
"label": { "group": "label", "empty": "remove" }
},
"insert": { "place": "after-last", "emit": "variable {name}[ \"{label}\"]" },
"remove": { "cascade": ["link"] }
},
{
"name": "loop",
"type": "Loop",
"line": "^loop\\s+(?<identifier>[^\\s\"]+)\\s+\"(?<title>[^\"]*)\"(?<members>(?:\\s+[^\\s\"]+)+)\\s*$",
"attributes": {
"identifier": { "group": "identifier", "empty": "refuse" },
"title": { "group": "title", "empty": "keep" },
"members": { "group": "members", "reference": { "to": ["variable"], "by": "name" } }
},
"insert": { "place": "after-last", "emit": "loop {identifier} \"{title}\" {members}" },
"remove": {}
}
],
"relations": [
{
"name": "link",
"type": "CausalLink",
"line": "^link\\s+(?<from>[^\\s\"]+)\\s+->\\s+(?<to>[^\\s\"]+)(?<tail>(?:\\s+(?:\"[^\"]*\"|[^\\s\"]+))*)\\s*$",
"source": { "group": "from" },
"target": { "group": "to" },
"attributes": {
"polarity": { "group": "tail", "word": "^[+\\-so]$", "map": { "+": "positive", "s": "positive", "-": "negative", "o": "negative" } },
"delayed": { "group": "tail", "word": "^delayed$", "flag": true },
"flipped": { "group": "tail", "word": "^flipped$", "flag": true },
"weight": { "group": "tail", "word": "^weight=(?<value>.+)$", "number": "shortest", "empty": "remove" },
"note": { "group": "tail", "word": "^\".*\"$", "empty": "remove" }
},
"insert": {
"place": "after-last",
"emit": "link {source} -> {target}[ {polarity}][ {delayed}][ {flipped}][ weight={weight}][ \"{note}\"]"
},
"remove": {}
}
],
"template": {
"text": "causal-loop 1\r\n\r\n# One statement per line: variable, link, loop.\r\nvariable a \"A\"\r\nvariable b \"B\"\r\n\r\nlink a -> b +\r\n"
}
}
}
}In an IDE
No IDE host runs this example yet.