mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Parsing of block arrows with directions, creating a dedicated new node for this.
This commit is contained in:
parent
7198fe55a9
commit
03c59adaed
@ -22,8 +22,7 @@ const populateBlockDatabase = (blockList: Block[], parent: Block): void => {
|
||||
const children = [];
|
||||
for (const block of blockList) {
|
||||
if (block.type === 'column-setting') {
|
||||
const columns = block.columns || -1;
|
||||
parent.columns = columns;
|
||||
parent.columns = block.columns || -1;
|
||||
} else {
|
||||
if (!block.label) {
|
||||
if (block.type === 'composite') {
|
||||
@ -39,7 +38,8 @@ const populateBlockDatabase = (blockList: Block[], parent: Block): void => {
|
||||
}
|
||||
|
||||
if (block.type === 'space') {
|
||||
for (let j = 0; j < block.width; j++) {
|
||||
const w = block.width || 1;
|
||||
for (let j = 0; j < w; j++) {
|
||||
const newBlock = clone(block);
|
||||
newBlock.id = newBlock.id + '-' + j;
|
||||
blockDatabase[newBlock.id] = newBlock;
|
||||
|
@ -17,6 +17,7 @@ export type BlockType =
|
||||
| 'lean_left'
|
||||
| 'trapezoid'
|
||||
| 'inv_trapezoid'
|
||||
| 'rect_left_inv_arrow'
|
||||
| 'odd_right'
|
||||
| 'circle'
|
||||
| 'ellipse'
|
||||
@ -28,6 +29,7 @@ export type BlockType =
|
||||
| 'composite';
|
||||
|
||||
export interface Block {
|
||||
width?: number;
|
||||
id: string;
|
||||
label?: string;
|
||||
parent?: Block;
|
||||
|
Loading…
x
Reference in New Issue
Block a user