Commit c216f41
Add SVG export for cells and libraries (#192)
## Summary
- Add `cell_to_svg` and `library_to_svg` public functions to the `gdsr`
crate
- Render polygons, paths, boxes, text, and nodes as SVG elements with
layer-based coloring (same 16-color palette as viewer)
- Flatten cell references recursively so nested hierarchies render
correctly
- Auto-size viewport to bounding box with 5% margin
- Flip Y axis (GDS Y-up → SVG Y-down) via SVG transform group
- Escape text content for XML safety
Closes #134
## Test plan
- 11 new snapshot tests covering each element type, reference
flattening, multi-layer colors, XML escaping, empty cells, and Y-flip
transform
- Full test suite passes (691 tests)
- All pre-commit checks pass
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 06194c0 commit c216f41
4 files changed
+542
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
158 | 165 | | |
159 | 166 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
0 commit comments