Skip to content

Commit

Permalink
changed border thickness
Browse files Browse the repository at this point in the history
  • Loading branch information
megantriplett committed Nov 19, 2024
1 parent d16e46a commit 902f6d5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
9 changes: 9 additions & 0 deletions demos/flowchart.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
<h1>Comparison "graph vs. flowchart"</h1>
<h2>Sample 1</h2>
<h3>graph</h3>
<pre class="mermaid">
flowchart TD
A[Christmas] -->|Get money| B(Go shopping)
A --> |Vroom| F[fa:fa-car Car]
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
</pre>
<pre class="mermaid">
---
title: This is a complicated flow
Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/diagrams/flowchart/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const getStyles = (options: FlowChartStyleOptions) =>
.node path {
fill: ${options.mainBkg};
stroke: ${options.nodeBorder};
stroke-width: 1px;
stroke-width: 10px;
}
.rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {
text-anchor: middle;
Expand Down
8 changes: 4 additions & 4 deletions packages/mermaid/src/rendering-util/createText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ async function addHtmlSpan(element, node, width, classes, addBackground = false)
const fo = element.append('foreignObject');
// This is not the final width but used in order to make sure the foreign
// object in firefox gets a width at all. The final width is fetched from the div
fo.attr('width', `${10 * width}px`);
fo.attr('height', `${10 * width}px`);
fo.attr('width', `${1000 * width}px`);
fo.attr('height', `${1000 * width}px`);

const div = fo.append('xhtml:div');
let label = node.label;
Expand Down Expand Up @@ -143,8 +143,8 @@ function createFormattedText(
bkg
.attr('x', bbox.x - padding)
.attr('y', bbox.y - padding)
.attr('width', bbox.width + 2 * padding)
.attr('height', bbox.height + 2 * padding);
.attr('width', bbox.width + 500 * padding)
.attr('height', bbox.height + 500 * padding);

return labelGroup.node();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ const fixCorners = function (lineData) {
Math.abs(nextPoint.x - prevPoint.x),
Math.abs(nextPoint.y - prevPoint.y)
);
const r = 5;
const r = 50000;
if (cornerPoint.x === newPrevPoint.x) {
newCornerPoint = {
x: xDiff < 0 ? newPrevPoint.x - r + a : newPrevPoint.x + r - a,
Expand Down

0 comments on commit 902f6d5

Please sign in to comment.