Wiki CgX

Parce que j'ai un cerveau, mais pas trop.

Outils pour utilisateurs

Outils du site


wiki:syntaxe:diagram

Diagram syntax

Tiles

  • Diagram specification is a multiline expression.
  • Each line consists of control characters, that define links between blocks, and letter sequences, that define blocks.
  • These entities are separated by the special character `|'.

Quelques exemples

Simple

| AAA |-| BBB |
| |:| | | | | |
| |L|~|~| CCC |
AAA BBB
CCC

Avec textes plus longs

| root |-| 1-st branch |
| |:| | | | | |
| |L|~|~| 2-nd branch |
root 1-st branch
2-nd branch

Avec liens & Syntaxe Wiki

On peut représenter les cases par des variables qu'on peut nommer en fin de ligne avec | et = :

| AAA |-| BBB |AAA=root|BBB=1<sup>st</sup> branch (see [[wp>Branch]])
| |:| | | | | |
| |L|~|~| CCC |CCC=2<sup>nd</sup> branch\\ **(very important branch)**
root 1st branch (see Branch)
2nd branch
(very important branch)

Tous les types de connecteurs

| | |v| | | | |V| | |
| |,|!|.| | |F|:|7| | | |y| | |p| |
|)|-|+|-|(|D|~|%|~|C| |}| |{|]| |[| |*| |#|
| |`|!|'| | |L|:|J| | | |h| | |b| |
| | |^| | | | |A| | |

Généalogique

| | | Dad |y| Mom | | |Dad=Daddy|Mom=Mommy
| |,|-|-|-|+|-|-|-|.| |
| Sys | |  Me | | Bro |Sys=Syster|Bro=Brother
Daddy Mommy
Syster Me Brother

Coloré

On peut représenter du code CSS pour les cases, avec {} en fin de ligne :

| AAA | | | | |F|~|~|~|7| |AAA{border-color:blue;background-color:lightgreen}=Border is blue,\\ background is lightgreen
| |!| | | | | CCC | | DDD |CCC{border-color:#a9c}=Border is #a9c,\\ background is transparent|DDD{border-color:silver;background-color:silver;}=Border is silver,\\ background is silver
| BBB | | | | | | | | | | |BBB{border-color:rgb(0%,50%,0%);background-color:#abcdef}=Border is green,\\ background is #abcdef
Border is blue,
background is lightgreen
Border is #a9c,
background is transparent
Border is silver,
background is silver
Border is green,
background is #abcdef

Identations & Alignements

|Left|                 |Left{text-align:left;}=Text is\\ aligned to the left
| |!|
| |`|-|-|Center|       |Center=By default text is aligned\\ to the center
| | | | |  |!|
| | | | |  |`|-|-|Right|Right{text-align:right;padding:1em}=Align text\\ to the right\\ and setup indents
Text is
aligned to the left
By default text is aligned
to the center
Align text
to the right
and setup indents

Etendus (branches plus longues)

| AAA |-|-|-| BBB | | | | | | |
| |:|
| |:| | | | | | | | | | | DDD |
| |:|
| |L|~|~|~|~| CCC |
AAA BBB
DDD
CCC

Avec flèches

|  AAA  |-@2|  BBB  |-@a|  EEE   |
| |:@1| |   | |!@4| |   | |}@72|-|-| GGG |
|  DDD  |~@8|  CCC  |   |  FFF   |
AAA BBB
EEE
GGG
DDD
CCC FFF

To insert an arrow you should put '@' and one or two symbols as direction settings after а control character. The first symbol sets arrows that are pointed out of the center of connection tile. It's a hexadecimal number that has 4 bits for each of 4 directions: Up, Right, Down, Left. Each bit sets the presence of an arrow in the corresponding direction. If you're not familiar with hexadecimal representation then use the following algorithm. Calculate a sum of direction numbers using this table:

Up 	Right 	Down 	Left
1 	2 	4 	8

If you got a number that is greater than nine, then replace it by a letter according to the table:

10 	11 	12 	13 	14 	15
a 	b 	c 	d 	e 	f

The second symbol is not necessary if you need all arrows to look outside. Otherwise, specify the ones that should look inside using the same direction scheme for the second symbol.

wiki/syntaxe/diagram.txt · Dernière modification: 05 Aug 2021 :: 09:09 de CgX