| 146 | .join(" "); |
| 147 | |
| 148 | const polygon = (corners: Pt[], fill: string, fillOpacity: number, stroke: string) => |
| 149 | `<polygon ${attrs({ |
| 150 | points: corners.map((p) => `${round(p.x)},${round(p.y)}`).join(" "), |
| 151 | fill, |
| 152 | "fill-opacity": fillOpacity.toFixed(2), |
| 153 | stroke, |
| 154 | "stroke-width": 2.5, |
| 155 | "stroke-linejoin": "round", |
| 156 | })}/>`; |
| 157 | |
| 158 | const line = (a: Pt, b: Pt, stroke: string, w: number, o: number) => |
| 159 | `<line ${attrs({ x1: round(a.x), y1: round(a.y), x2: round(b.x), y2: round(b.y), stroke, "stroke-width": w, opacity: o, "stroke-linecap": "round" })}/>`; |