diff --git a/lib/bounding-box.ts b/lib/bounding-box.ts
index 1195edb..5553e26 100644
--- a/lib/bounding-box.ts
+++ b/lib/bounding-box.ts
@@ -28,7 +28,7 @@ export function getBoundingBoxCenter(bbox: Bbox): Point {
};
}
-function dilateBoundingBox(bbox: Bbox, amount: number): Bbox {
+export function dilateBoundingBox(bbox: Bbox, amount: number): Bbox {
return {
minX: bbox.minX - amount,
maxX: bbox.maxX + amount,
diff --git a/lib/browser-main.tsx b/lib/browser-main.tsx
index f641925..9cdf388 100644
--- a/lib/browser-main.tsx
+++ b/lib/browser-main.tsx
@@ -1,7 +1,10 @@
import React, { useState } from "react";
import ReactDOM from "react-dom";
-import { getBoundingBoxSize } from "./bounding-box";
+import { Point } from "../vendor/bezier-js";
+import { Bbox, dilateBoundingBox, getBoundingBoxSize } from "./bounding-box";
import { FILL_REPLACEMENT_COLOR, STROKE_REPLACEMENT_COLOR } from "./colors";
+import * as colors from "./colors";
+import { Specs } from "./specs";
import _SvgVocabulary from "./svg-vocabulary.json";
import type { SvgSymbolData, SvgSymbolElement } from "./vocabulary";
@@ -19,6 +22,7 @@ if (!appEl) {
type SvgSymbolContext = {
stroke: string;
fill: string;
+ showSpecs: boolean;
};
type SvgSymbolProps = {
@@ -56,19 +60,101 @@ function reactifySvgSymbolElement(
);
}
+const ATTACHMENT_POINT_RADIUS = 20;
+
+const AttachmentPoints: React.FC<{ color: string; points: Point[] }> = (
+ props
+) => (
+ <>
+ {props.points.map((p, i) => (
+