Skip to content

Commit 10d723b

Browse files
committed
fix(html): resolve visual issues in Immediate Food Delivery II
- Fix Step 3/4 SVG: increase viewBox height and reposition summary text below table rows to prevent overlap - Fix copy button CSS: add !important overrides and broader selectors to ensure Prism.js copy-to-clipboard buttons are visible with Tailwind CSS preflight reset - Fix flowchart SVG arrows: reduce marker refX (9->5) so arrowheads are not hidden behind nodes, increase viewBox (950->1000), reposition merge point and lower nodes for proper spacing - Add SVG flowchart guidelines workflow for future reference
1 parent f0ddc02 commit 10d723b

2 files changed

Lines changed: 104 additions & 42 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
description: SVG flowchart and data visualization best practices to avoid common rendering issues
3+
---
4+
5+
# SVG Flowchart & Data Visualization Guidelines
6+
7+
## Arrow Marker Best Practices
8+
9+
1. **`refX` should be less than the arrowhead length.** If your arrowhead path is `M0,0 L0,6 L9,3 z` (length=9), set `refX` to `5` (not `9`). A `refX` equal to the arrowhead length causes the tip to land exactly at the path endpoint, which gets hidden behind destination nodes.
10+
11+
2. **End arrow paths 5-10px before the target node boundary.** This leaves room for the arrowhead to be visible and not obscured by the node's fill.
12+
13+
3. **Use `markerUnits="strokeWidth"`** for consistent arrowhead sizing regardless of stroke width changes.
14+
15+
## SVG viewBox Sizing
16+
17+
1. **Always add 30-50px padding** below the last element in your viewBox height. If the last element ends at y=940 with ry=35, set viewBox height to at least `1000`.
18+
19+
2. **For dynamic data tables**, calculate viewBox height based on number of rows:
20+
```
21+
viewBox height = header_height + (row_count × row_height) + summary_text_spacing + padding
22+
```
23+
24+
## Text Overlap Prevention
25+
26+
1. **Summary text below data tables**: Position summary text at least `30px` below the last row's bottom edge (y + height), not at a fixed y coordinate.
27+
28+
2. **For N data rows at spacing S starting at Y0**: Last row bottom = `Y0 + (N-1) × S + row_height`. Summary text y should be `last_row_bottom + 30`.
29+
30+
## Prism.js Copy Button with Tailwind CSS
31+
32+
Tailwind's preflight CSS resets button styles. Override with `!important`:
33+
34+
```css
35+
.code-toolbar > .toolbar {
36+
opacity: 1 !important;
37+
}
38+
.code-toolbar > .toolbar .toolbar-item {
39+
display: inline-block !important;
40+
}
41+
.code-toolbar > .toolbar button,
42+
.code-toolbar > .toolbar a,
43+
.code-toolbar > .toolbar span {
44+
background: #10b981 !important;
45+
color: white !important;
46+
border: none !important;
47+
display: inline-block !important;
48+
opacity: 1 !important;
49+
visibility: visible !important;
50+
}
51+
```

0 commit comments

Comments
 (0)