@vitavision/stage2d 0.12.0 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -6
- package/dist/index.d.ts +669 -57
- package/dist/index.js +5455 -3621
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/api/mapValues.ts +1 -4
- package/src/components/AreaSet.tsx +32 -9
- package/src/components/ContourEditor.tsx +325 -40
- package/src/components/DatumEditor.tsx +261 -0
- package/src/components/DraftShape.tsx +37 -5
- package/src/components/EllipseSet.tsx +3 -3
- package/src/components/GridLayer.tsx +8 -3
- package/src/components/HeatmapLayer.tsx +1 -1
- package/src/components/MaskEditor.tsx +57 -9
- package/src/components/MeasureOverlay.tsx +353 -92
- package/src/components/PointSet.tsx +23 -12
- package/src/components/PolylineSet.tsx +83 -27
- package/src/components/RectRoiEditor.tsx +189 -93
- package/src/components/ShapeEditor.tsx +25 -10
- package/src/components/areaBatching.ts +23 -3
- package/src/components/areaIndex.ts +2 -1
- package/src/components/contourArc.ts +268 -0
- package/src/components/datumEdit.ts +149 -0
- package/src/components/labelLod.ts +3 -7
- package/src/components/markerShapes.ts +2 -5
- package/src/components/measureGeometry.ts +46 -28
- package/src/components/measureHit.ts +383 -0
- package/src/components/overlayRole.ts +1 -1
- package/src/components/pointIndex.ts +14 -5
- package/src/components/polylineIndex.ts +3 -3
- package/src/components/shapeEdit.ts +38 -5
- package/src/components/stage/CompareLayer.tsx +231 -0
- package/src/components/stage/ImageLayer.tsx +56 -24
- package/src/components/stage/ImageStage.tsx +33 -38
- package/src/components/stage/StageSurface.tsx +34 -34
- package/src/components/stage/StageToolbar.tsx +35 -37
- package/src/components/stage/compareStyle.ts +155 -0
- package/src/components/stage/gesture.ts +5 -0
- package/src/components/stage/hitTest.ts +19 -0
- package/src/components/stage/useStageHitTest.ts +17 -12
- package/src/components/stage/view.ts +3 -15
- package/src/components/useShapeDrag.ts +2 -4
- package/src/index.ts +34 -65
package/README.md
CHANGED
|
@@ -50,8 +50,7 @@ batched paths and picks through a spatial index, not the DOM.
|
|
|
50
50
|
- **Selecting:** click selects, ⌘/Ctrl-click toggles, and Shift-drag or `marquee` draws a
|
|
51
51
|
rubber band.
|
|
52
52
|
- **Pure functions:** `buildPolylineIndex`, `nearestPolyline`, `polylinesInRect` and
|
|
53
|
-
`polylinePath` are pure; hit-testing is microseconds at 100k segments
|
|
54
|
-
(`docs/measurements/u4-polyline-set.md`).
|
|
53
|
+
`polylinePath` are pure; hit-testing is microseconds at 100k segments.
|
|
55
54
|
|
|
56
55
|
**Points**: `PointSet` draws many points (corners, ring centres, keypoints, labelled landmarks) as
|
|
57
56
|
a few batched paths, with a marker per kind (`dot`, `plus`, `cross`, `square`, `hollow`,
|
|
@@ -59,16 +58,14 @@ a few batched paths, with a marker per kind (`dot`, `plus`, `cross`, `square`, `
|
|
|
59
58
|
selected. Labels appear where points are 24 screen px apart.
|
|
60
59
|
- **Pointer:** `onHoverChange` and `onItemPress` come from the stage's pointer handling and the
|
|
61
60
|
layer's index, not from per-point elements.
|
|
62
|
-
- **Pure functions:** `buildPointIndex`, `nearestPoint`, `pointsInRect` and `thinPoints
|
|
63
|
-
(`docs/measurements/l6-2a-points-hit-test.md`).
|
|
61
|
+
- **Pure functions:** `buildPointIndex`, `nearestPoint`, `pointsInRect` and `thinPoints`.
|
|
64
62
|
|
|
65
63
|
**Areas**: `AreaSet` draws many closed regions (marker quads, drawn polygons, region annotations) as a
|
|
66
64
|
few batched paths, each an outline with its 12 % fill, in a role (`feature`, `model`, `structure`).
|
|
67
65
|
- **Pointer:** a press near an outline picks that region, else the smallest region containing it;
|
|
68
66
|
`onHoverChange` and `onItemPress` as `PointSet`.
|
|
69
67
|
- **Quads:** `firstVertexTick` ticks corner 0; labels sit at the centre, where regions are 24 screen px apart.
|
|
70
|
-
- **Pure functions:** `buildAreaIndex`, `nearestArea`, `areasInRect`, `pointInPolygon`, `areaPath
|
|
71
|
-
(`docs/measurements/l6-2b-areas-grid-heatmap.md`).
|
|
68
|
+
- **Pure functions:** `buildAreaIndex`, `nearestArea`, `areasInRect`, `pointInPolygon`, `areaPath`.
|
|
72
69
|
|
|
73
70
|
**Grids**: `GridLayer` draws a detected lattice: nodes `{ id, i, j, x, y }` as a `PointSet` (`plus` by default)
|
|
74
71
|
and the edges between lattice neighbours as two batched paths, each axis restyled through `edges`.
|