mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-17 22:39:56 +02:00
Fix odd (asymmetrical) shape & hexagon shape neo look for flowchart
This commit is contained in:
@@ -80,7 +80,10 @@ flowchart
|
|||||||
node
|
node
|
||||||
id1([This is the text in the box])
|
id1([This is the text in the box])
|
||||||
id2((circle))
|
id2((circle))
|
||||||
id1(((double circle)))
|
id3(((double circle)))
|
||||||
|
id4>Asymetrical]
|
||||||
|
id5{This is the text in the box}
|
||||||
|
id6{{This is the text in the box}}
|
||||||
|
|
||||||
|
|
||||||
</pre
|
</pre
|
||||||
@@ -95,7 +98,10 @@ flowchart
|
|||||||
node
|
node
|
||||||
id1([This is the text in the box])
|
id1([This is the text in the box])
|
||||||
id2((circle))
|
id2((circle))
|
||||||
id1(((double circle)))
|
id3(((double circle)))
|
||||||
|
id4>Asymetrical]
|
||||||
|
id5{This is the text in the box}
|
||||||
|
id6{{This is the text in the box}}
|
||||||
|
|
||||||
|
|
||||||
</pre
|
</pre
|
||||||
|
@@ -28,7 +28,8 @@ export const hexagon = async (parent: SVGAElement, node: Node): Promise<SVGAElem
|
|||||||
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
||||||
|
|
||||||
const f = 4;
|
const f = 4;
|
||||||
const h = bbox.height + node.padding;
|
const labelPaddingX = node.look === 'neo' ? node.padding * 2 : node.padding;
|
||||||
|
const h = bbox.height + labelPaddingX;
|
||||||
const m = h / f;
|
const m = h / f;
|
||||||
const w = bbox.width + 2 * m + node.padding;
|
const w = bbox.width + 2 * m + node.padding;
|
||||||
const points = [
|
const points = [
|
||||||
|
@@ -21,9 +21,9 @@ export const rect_left_inv_arrow = async (
|
|||||||
node: Node
|
node: Node
|
||||||
): Promise<SVGAElement> => {
|
): Promise<SVGAElement> => {
|
||||||
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));
|
||||||
|
const labelPadding = node.look === 'neo' ? node.padding * 2 : node.padding;
|
||||||
const w = bbox.width + node.padding;
|
const w = bbox.width + labelPadding;
|
||||||
const h = bbox.height + node.padding;
|
const h = bbox.height + labelPadding;
|
||||||
const points = [
|
const points = [
|
||||||
{ x: -h / 2, y: 0 },
|
{ x: -h / 2, y: 0 },
|
||||||
{ x: w, y: 0 },
|
{ x: w, y: 0 },
|
||||||
|
Reference in New Issue
Block a user