mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-22 17:56:43 +02:00
Draft of fifth set of shapes [Lined Process, Delay, Multiprocess, Stored Data, Internal storage]
This commit is contained in:
@@ -89,8 +89,8 @@ export async function bowTieRect<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;
|
||||
|
||||
const calcTotalHeight = (labelHeight: number) => labelHeight + labelPaddingY * 2;
|
||||
const calcEllipseRadius = (totalHeight: number) => {
|
||||
|
@@ -21,8 +21,8 @@ export async function halfRoundedRectangle<T extends SVGGraphicsElement>(
|
||||
const minWidth = 15,
|
||||
minHeight = 10;
|
||||
|
||||
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' ? 12 : (node.padding ?? 0);
|
||||
|
||||
if (node.width || node.height) {
|
||||
node.height = (node?.height ?? 0) - paddingY * 2;
|
||||
|
@@ -9,8 +9,8 @@ export async function multiRect<T extends SVGGraphicsElement>(parent: D3Selectio
|
||||
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 rectOffset = node.look === 'neo' ? 10 : 5;
|
||||
|
||||
// If incoming height & width are present, subtract the padding from them
|
||||
|
@@ -16,8 +16,8 @@ export async function shadedProcess<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' ? 13 : (node.padding ?? 0);
|
||||
|
||||
// If incoming height & width are present, subtract the padding from them
|
||||
// as labelHelper does not take padding into account
|
||||
|
@@ -6,14 +6,14 @@ import intersect from '../intersect/index.js';
|
||||
import type { D3Selection } from '../../../types.js';
|
||||
|
||||
/// Width of the frame on the top and left of the shape
|
||||
const rectOffset = 5;
|
||||
const rectOffset = 10;
|
||||
|
||||
export async function windowPane<T extends SVGGraphicsElement>(parent: D3Selection<T>, node: Node) {
|
||||
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) * 2 : (node.padding ?? 0);
|
||||
const paddingX = node.look === 'neo' ? 16 : (node.padding ?? 0);
|
||||
const paddingY = node.look === 'neo' ? 12 : (node.padding ?? 0);
|
||||
|
||||
// If incoming height & width are present, subtract the padding from them
|
||||
// as labelHelper does not take padding into account
|
||||
|
Reference in New Issue
Block a user