mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-28 03:39:38 +02:00
Draft of third set of shapes [Divided Process, Manual Input,Subprocess, Horizontal Cylinder, Loop Limit]
This commit is contained in:
@@ -12,8 +12,8 @@ export async function dividedRectangle<T extends SVGGraphicsElement>(
|
||||
const { labelStyles, nodeStyles } = styles2String(node);
|
||||
node.labelStyle = labelStyles;
|
||||
|
||||
const paddingX = node.look === 'neo' ? (node.padding ?? 0) * 2 : (node.padding ?? 0);
|
||||
const paddingY = node.look === 'neo' ? (node.padding ?? 0) * 1 : (node.padding ?? 0);
|
||||
const paddingX = node.look === 'neo' ? 16 : (node.padding ?? 0);
|
||||
const paddingY = node.look === 'neo' ? 16 : (node.padding ?? 0);
|
||||
|
||||
// If incoming height & width are present, subtract the padding from them
|
||||
// as labelHelper does not take padding into account
|
||||
|
@@ -9,8 +9,8 @@ export async function slopedRect<T extends SVGGraphicsElement>(parent: D3Selecti
|
||||
const { labelStyles, nodeStyles } = styles2String(node);
|
||||
node.labelStyle = labelStyles;
|
||||
const nodePadding = node.padding ?? 0;
|
||||
const labelPaddingX = node.look === 'neo' ? nodePadding * 2 : nodePadding;
|
||||
const labelPaddingY = node.look === 'neo' ? nodePadding * 1 : nodePadding;
|
||||
const labelPaddingX = node.look === 'neo' ? 16 : nodePadding;
|
||||
const labelPaddingY = node.look === 'neo' ? 12 : nodePadding;
|
||||
|
||||
// If incoming height & width are present, subtract the padding from them
|
||||
// as labelHelper does not take padding into account
|
||||
|
@@ -44,8 +44,8 @@ export async function subroutine<T extends SVGGraphicsElement>(parent: D3Selecti
|
||||
node.labelStyle = labelStyles;
|
||||
|
||||
const nodePadding = node?.padding || 8;
|
||||
const labelPaddingX = node.look === 'neo' ? nodePadding * 3 : nodePadding;
|
||||
const labelPaddingY = node.look === 'neo' ? nodePadding * 1.5 : nodePadding;
|
||||
const labelPaddingX = node.look === 'neo' ? 28 : nodePadding;
|
||||
const labelPaddingY = node.look === 'neo' ? 12 : nodePadding;
|
||||
|
||||
// If incoming height & width are present, subtract the padding from them
|
||||
// as labelHelper does not take padding into account
|
||||
|
@@ -61,7 +61,7 @@ export async function tiltedCylinder<T extends SVGGraphicsElement>(
|
||||
const { labelStyles, nodeStyles } = styles2String(node);
|
||||
node.labelStyle = labelStyles;
|
||||
const nodePadding = node.padding ?? 0;
|
||||
const labelPadding = node.look === 'neo' ? nodePadding : nodePadding / 2;
|
||||
const labelPadding = node.look === 'neo' ? 12 : nodePadding / 2;
|
||||
if (node.width || node.height) {
|
||||
const originalHeight = node.height ?? 0;
|
||||
node.height = (node.height ?? 0) - labelPadding;
|
||||
|
@@ -12,8 +12,8 @@ export async function trapezoidalPentagon<T extends SVGGraphicsElement>(
|
||||
const { labelStyles, nodeStyles } = styles2String(node);
|
||||
node.labelStyle = labelStyles;
|
||||
const nodePadding = node.padding ?? 0;
|
||||
const labelPaddingX = node.look === 'neo' ? nodePadding * 2 : nodePadding;
|
||||
const labelPaddingY = node.look === 'neo' ? nodePadding * 1 : nodePadding;
|
||||
const labelPaddingX = node.look === 'neo' ? 16 : nodePadding;
|
||||
const labelPaddingY = node.look === 'neo' ? 12 : nodePadding;
|
||||
const minWidth = 15,
|
||||
minHeight = 5;
|
||||
if (node.width || node.height) {
|
||||
|
Reference in New Issue
Block a user