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