mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
Merge branch 'develop' into knsv-treemap
This commit is contained in:
5
.changeset/curly-coats-tell.md
Normal file
5
.changeset/curly-coats-tell.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'mermaid': patch
|
||||
---
|
||||
|
||||
Fix stroke styles for ER diagram to correctly apply path and row-specific styles
|
@@ -40,7 +40,7 @@ export async function erBox<T extends SVGGraphicsElement>(parent: D3Selection<T>
|
||||
let TEXT_PADDING = config.er?.entityPadding ?? 6;
|
||||
|
||||
const { cssStyles } = node;
|
||||
const { labelStyles } = styles2String(node);
|
||||
const { labelStyles, nodeStyles } = styles2String(node);
|
||||
|
||||
// Draw rect if no attributes are found
|
||||
if (entityNode.attributes.length === 0 && node.label) {
|
||||
@@ -295,6 +295,18 @@ export async function erBox<T extends SVGGraphicsElement>(parent: D3Selection<T>
|
||||
|
||||
updateNodeBounds(node, rect);
|
||||
|
||||
if (nodeStyles && node.look !== 'handDrawn') {
|
||||
const allStyle = nodeStyles.split(';');
|
||||
const strokeStyles = allStyle
|
||||
?.filter((e) => {
|
||||
return e.includes('stroke');
|
||||
})
|
||||
?.map((s) => `${s}`)
|
||||
.join('; ');
|
||||
shapeSvg.selectAll('path').attr('style', strokeStyles ?? '');
|
||||
shapeSvg.selectAll('.row-rect-even path').attr('style', nodeStyles);
|
||||
}
|
||||
|
||||
node.intersect = function (point) {
|
||||
return intersect.rect(node, point);
|
||||
};
|
||||
|
Reference in New Issue
Block a user