open-plant 1.3.0 → 1.3.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/dist/assets/point-hit-index-worker-CNFA6pZm.js +2 -0
- package/dist/assets/point-hit-index-worker-CNFA6pZm.js.map +1 -0
- package/dist/assets/roi-clip-worker-BDVQwN2T.js.map +1 -1
- package/dist/index.cjs +17 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3233 -3037
- package/dist/index.js.map +1 -1
- package/dist/types/core/ortho-camera.d.ts +7 -0
- package/dist/types/core/ortho-camera.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/react/draw-layer-brush.d.ts +9 -0
- package/dist/types/react/draw-layer-brush.d.ts.map +1 -0
- package/dist/types/react/draw-layer-label.d.ts +21 -0
- package/dist/types/react/draw-layer-label.d.ts.map +1 -0
- package/dist/types/react/draw-layer-overlay.d.ts +18 -0
- package/dist/types/react/draw-layer-overlay.d.ts.map +1 -0
- package/dist/types/react/draw-layer-stamp.d.ts +24 -0
- package/dist/types/react/draw-layer-stamp.d.ts.map +1 -0
- package/dist/types/react/draw-layer-types.d.ts +243 -0
- package/dist/types/react/draw-layer-types.d.ts.map +1 -0
- package/dist/types/react/draw-layer-utils.d.ts +30 -0
- package/dist/types/react/draw-layer-utils.d.ts.map +1 -0
- package/dist/types/react/draw-layer.d.ts +4 -187
- package/dist/types/react/draw-layer.d.ts.map +1 -1
- package/dist/types/react/wsi-region-hit-utils.d.ts +21 -0
- package/dist/types/react/wsi-region-hit-utils.d.ts.map +1 -0
- package/dist/types/react/wsi-viewer-canvas.d.ts +2 -1
- package/dist/types/react/wsi-viewer-canvas.d.ts.map +1 -1
- package/dist/types/wsi/brush-stroke.d.ts.map +1 -1
- package/dist/types/wsi/image-info.d.ts +26 -1
- package/dist/types/wsi/image-info.d.ts.map +1 -1
- package/dist/types/wsi/point-clip-hybrid.d.ts.map +1 -1
- package/dist/types/wsi/point-clip-worker-client.d.ts.map +1 -1
- package/dist/types/wsi/point-clip.d.ts +1 -1
- package/dist/types/wsi/point-clip.d.ts.map +1 -1
- package/dist/types/wsi/point-hit-index-shared.d.ts +25 -0
- package/dist/types/wsi/point-hit-index-shared.d.ts.map +1 -0
- package/dist/types/wsi/point-hit-index-worker-client.d.ts.map +1 -1
- package/dist/types/wsi/roi-geometry.d.ts +3 -0
- package/dist/types/wsi/roi-geometry.d.ts.map +1 -1
- package/dist/types/wsi/roi-term-stats.d.ts.map +1 -1
- package/dist/types/wsi/tile-scheduler.d.ts.map +1 -1
- package/dist/types/wsi/utils.d.ts +3 -2
- package/dist/types/wsi/utils.d.ts.map +1 -1
- package/dist/types/wsi/worker-client.d.ts +28 -0
- package/dist/types/wsi/worker-client.d.ts.map +1 -0
- package/dist/types/wsi/wsi-canvas-lifecycle.d.ts +15 -0
- package/dist/types/wsi/wsi-canvas-lifecycle.d.ts.map +1 -0
- package/dist/types/wsi/wsi-input-handlers.d.ts +67 -0
- package/dist/types/wsi/wsi-input-handlers.d.ts.map +1 -0
- package/dist/types/wsi/wsi-interaction.d.ts +50 -0
- package/dist/types/wsi/wsi-interaction.d.ts.map +1 -0
- package/dist/types/wsi/wsi-lifecycle-ops.d.ts +38 -0
- package/dist/types/wsi/wsi-lifecycle-ops.d.ts.map +1 -0
- package/dist/types/wsi/wsi-normalize.d.ts +20 -0
- package/dist/types/wsi/wsi-normalize.d.ts.map +1 -0
- package/dist/types/wsi/wsi-point-data.d.ts +14 -0
- package/dist/types/wsi/wsi-point-data.d.ts.map +1 -0
- package/dist/types/wsi/wsi-render-pass.d.ts +40 -0
- package/dist/types/wsi/wsi-render-pass.d.ts.map +1 -0
- package/dist/types/wsi/wsi-renderer-types.d.ts +132 -0
- package/dist/types/wsi/wsi-renderer-types.d.ts.map +1 -0
- package/dist/types/wsi/wsi-shaders.d.ts +4 -0
- package/dist/types/wsi/wsi-shaders.d.ts.map +1 -0
- package/dist/types/wsi/wsi-tile-cache.d.ts +8 -0
- package/dist/types/wsi/wsi-tile-cache.d.ts.map +1 -0
- package/dist/types/wsi/wsi-tile-renderer.d.ts +11 -70
- package/dist/types/wsi/wsi-tile-renderer.d.ts.map +1 -1
- package/dist/types/wsi/wsi-tile-visibility.d.ts +22 -0
- package/dist/types/wsi/wsi-tile-visibility.d.ts.map +1 -0
- package/dist/types/wsi/wsi-view-animation.d.ts +4 -0
- package/dist/types/wsi/wsi-view-animation.d.ts.map +1 -0
- package/dist/types/wsi/wsi-view-ops.d.ts +17 -0
- package/dist/types/wsi/wsi-view-ops.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/assets/point-hit-index-worker-Bp1uxxyQ.js +0 -2
- package/dist/assets/point-hit-index-worker-Bp1uxxyQ.js.map +0 -1
|
@@ -2,7 +2,9 @@ export interface ViewState {
|
|
|
2
2
|
offsetX: number;
|
|
3
3
|
offsetY: number;
|
|
4
4
|
zoom: number;
|
|
5
|
+
rotationDeg: number;
|
|
5
6
|
}
|
|
7
|
+
export type WorldPoint = [number, number];
|
|
6
8
|
export declare class OrthoCamera {
|
|
7
9
|
private viewportWidth;
|
|
8
10
|
private viewportHeight;
|
|
@@ -14,6 +16,11 @@ export declare class OrthoCamera {
|
|
|
14
16
|
};
|
|
15
17
|
setViewState(next: Partial<ViewState>): void;
|
|
16
18
|
getViewState(): ViewState;
|
|
19
|
+
getCenter(): WorldPoint;
|
|
20
|
+
setCenter(centerX: number, centerY: number): void;
|
|
21
|
+
screenToWorld(screenX: number, screenY: number): WorldPoint;
|
|
22
|
+
worldToScreen(worldX: number, worldY: number): WorldPoint;
|
|
23
|
+
getViewCorners(): [WorldPoint, WorldPoint, WorldPoint, WorldPoint];
|
|
17
24
|
getMatrix(): Float32Array;
|
|
18
25
|
}
|
|
19
26
|
//# sourceMappingURL=ortho-camera.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ortho-camera.d.ts","sourceRoot":"","sources":["../../../src/core/ortho-camera.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ortho-camera.d.ts","sourceRoot":"","sources":["../../../src/core/ortho-camera.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAM1C,qBAAa,WAAW;IACtB,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,cAAc,CAAK;IAE3B,OAAO,CAAC,SAAS,CAKf;IAEF,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAKhD,eAAe,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;IAOpD,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI;IAkB5C,YAAY,IAAI,SAAS;IAIzB,SAAS,IAAI,UAAU;IAQvB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAMjD,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,UAAU;IAY3D,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU;IAiBzD,cAAc,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC;IAWlE,SAAS,IAAI,YAAY;CA0B1B"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9,7 +9,9 @@ export { TileViewerCanvas } from "./react/tile-viewer-canvas";
|
|
|
9
9
|
export type { OverviewMapConfig, PointClickEvent, PointClipStatsEvent, PointHitEvent, PointHoverEvent, PointerWorldMoveEvent, RegionClickEvent, RegionHoverEvent, WsiCustomLayer, WsiCustomLayerContext, WsiViewerCanvasProps, } from "./react/wsi-viewer-canvas";
|
|
10
10
|
export { WsiViewerCanvas } from "./react/wsi-viewer-canvas";
|
|
11
11
|
export { DEFAULT_POINT_COLOR } from "./wsi/constants";
|
|
12
|
+
export type { RawImagePayload, RawImsInfo, RawWsiTerm } from "./wsi/image-info";
|
|
12
13
|
export { normalizeImageInfo, toTileUrl } from "./wsi/image-info";
|
|
14
|
+
export { toRoiGeometry } from "./wsi/roi-geometry";
|
|
13
15
|
export type { RoiCoordinate, RoiPolygon } from "./wsi/point-clip";
|
|
14
16
|
export { filterPointDataByPolygons, filterPointIndicesByPolygons } from "./wsi/point-clip";
|
|
15
17
|
export type { HybridPointClipOptions, HybridPointClipResult, } from "./wsi/point-clip-hybrid";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC3D,YAAY,EACV,YAAY,EACZ,UAAU,EACV,cAAc,EACd,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,4BAA4B,EAC5B,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,UAAU,EACV,UAAU,EACV,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EAClB,aAAa,EACb,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAC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SAAS,EACT,eAAe,EACf,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AACpF,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BrushOptions, DrawProjector, DrawSession, ResolvedBrushOptions } from "./draw-layer-types";
|
|
2
|
+
export type { BrushOptions, ResolvedBrushOptions };
|
|
3
|
+
export declare function sanitizeBrushLineDash(value: number[] | undefined): number[];
|
|
4
|
+
export declare function resolveBrushEdgeDetail(value: number | undefined): number;
|
|
5
|
+
export declare function resolveBrushEdgeSmoothing(value: number | undefined): number;
|
|
6
|
+
export declare function resolveBrushOptions(options: BrushOptions | undefined): ResolvedBrushOptions;
|
|
7
|
+
export declare function drawBrushStrokePreview(ctx: CanvasRenderingContext2D, session: DrawSession, resolvedBrushOptions: ResolvedBrushOptions): void;
|
|
8
|
+
export declare function drawBrushCursor(ctx: CanvasRenderingContext2D, session: DrawSession, projector: DrawProjector | null, resolvedBrushOptions: ResolvedBrushOptions): void;
|
|
9
|
+
//# sourceMappingURL=draw-layer-brush.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draw-layer-brush.d.ts","sourceRoot":"","sources":["../../../src/react/draw-layer-brush.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAkB,aAAa,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAmBzH,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC;AAEnD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAI3E;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGxE;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAG3E;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,SAAS,GAAG,oBAAoB,CAiB3F;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,wBAAwB,EAAE,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,oBAAoB,GAAG,IAAI,CA2B5I;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,wBAAwB,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,GAAG,IAAI,EAAE,oBAAoB,EAAE,oBAAoB,GAAG,IAAI,CAiBtK"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DrawAreaTooltipOptions, DrawAreaTooltipStyle, DrawCoordinate, RegionLabelStyle, ResolvedDrawAreaTooltipOptions } from "./draw-layer-types";
|
|
2
|
+
export declare function measureLabelTextWidth(label: string, labelStyle: {
|
|
3
|
+
fontFamily: string;
|
|
4
|
+
fontSize: number;
|
|
5
|
+
fontWeight: string | number;
|
|
6
|
+
}): number;
|
|
7
|
+
export declare function getTopAnchor(coords: DrawCoordinate[]): DrawCoordinate | null;
|
|
8
|
+
export declare function getTopAnchorFromPolygons<T extends {
|
|
9
|
+
outer: DrawCoordinate[];
|
|
10
|
+
}>(polygons: T[]): DrawCoordinate | null;
|
|
11
|
+
export declare function resolveRegionLabelStyle(style: Partial<RegionLabelStyle> | undefined): RegionLabelStyle;
|
|
12
|
+
export declare function mergeRegionLabelStyle(base: RegionLabelStyle, override: Partial<RegionLabelStyle> | null | undefined): RegionLabelStyle;
|
|
13
|
+
export declare function resolveRegionLabelAutoLiftOffsetPx(enabled: boolean | undefined, zoom: number, zoomRange: {
|
|
14
|
+
minZoom: number;
|
|
15
|
+
maxZoom: number;
|
|
16
|
+
} | null | undefined): number;
|
|
17
|
+
export declare function defaultDrawAreaTooltipFormatter(areaMm2: number): string;
|
|
18
|
+
export declare function resolveDrawAreaTooltipOptions(options: DrawAreaTooltipOptions | undefined): ResolvedDrawAreaTooltipOptions;
|
|
19
|
+
export declare function drawRegionLabel(ctx: CanvasRenderingContext2D, text: string, anchor: DrawCoordinate, canvasWidth: number, canvasHeight: number, labelStyle: RegionLabelStyle): void;
|
|
20
|
+
export declare function drawAreaTooltipBox(ctx: CanvasRenderingContext2D, text: string, cursorScreen: DrawCoordinate, canvasWidth: number, canvasHeight: number, style: DrawAreaTooltipStyle, offsetX: number, offsetY: number): void;
|
|
21
|
+
//# sourceMappingURL=draw-layer-label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draw-layer-label.d.ts","sourceRoot":"","sources":["../../../src/react/draw-layer-label.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AA2BzJ,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,MAAM,CAqB9I;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,GAAG,IAAI,CAmB5E;AAED,wBAAgB,wBAAwB,CAAC,CAAC,SAAS;IAAE,KAAK,EAAE,cAAc,EAAE,CAAA;CAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,cAAc,GAAG,IAAI,CAUpH;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,SAAS,GAAG,gBAAgB,CAoBtG;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,gBAAgB,CAetI;AAED,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAWzK;AAyBD,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGvE;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS,GAAG,8BAA8B,CAUzH;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,wBAAwB,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,IAAI,CA8BlL;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,wBAAwB,EAC7B,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,cAAc,EAC5B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,oBAAoB,EAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,IAAI,CAyBN"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { DrawCoordinate, DrawOverlayShape, RegionStrokeStyle } from "./draw-layer-types";
|
|
2
|
+
export declare function drawInvertedFillMask(ctx: CanvasRenderingContext2D, outerRing: DrawCoordinate[], holeRings: DrawCoordinate[][], fillColor: string): void;
|
|
3
|
+
export interface DrawOverlayShapesParams {
|
|
4
|
+
ctx: CanvasRenderingContext2D;
|
|
5
|
+
overlayShapes: DrawOverlayShape[];
|
|
6
|
+
imageOuterRing: DrawCoordinate[];
|
|
7
|
+
worldToScreenPoints: (points: DrawCoordinate[]) => DrawCoordinate[];
|
|
8
|
+
baseStrokeStyle: RegionStrokeStyle;
|
|
9
|
+
onInvertedFillDebug?: (info: {
|
|
10
|
+
id: string | number;
|
|
11
|
+
outerRingPoints: number;
|
|
12
|
+
sourceRingCount: number;
|
|
13
|
+
holeRingCount: number;
|
|
14
|
+
fillColor: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function drawOverlayShapes(params: DrawOverlayShapesParams): void;
|
|
18
|
+
//# sourceMappingURL=draw-layer-overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draw-layer-overlay.d.ts","sourceRoot":"","sources":["../../../src/react/draw-layer-overlay.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG9F,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,wBAAwB,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAYvJ;AAED,MAAM,WAAW,uBAAuB;IACtC,GAAG,EAAE,wBAAwB,CAAC;IAC9B,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC,mBAAmB,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,CAAC;IACpE,eAAe,EAAE,iBAAiB,CAAC;IACnC,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC3J;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAyCvE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DrawCoordinate, DrawTool, StampDrawTool, StampOptions } from "./draw-layer-types";
|
|
2
|
+
export type { StampDrawTool, StampOptions };
|
|
3
|
+
export declare function isStampTool(tool: DrawTool): tool is StampDrawTool;
|
|
4
|
+
export declare function resolveStampOptions(options: StampOptions | undefined): Required<StampOptions>;
|
|
5
|
+
export declare function mm2ToUm2(areaMm2: number): number;
|
|
6
|
+
export declare function createSquareFromCenter(center: DrawCoordinate | null, halfLength: number, projection?: {
|
|
7
|
+
worldToScreen: (x: number, y: number) => DrawCoordinate | null;
|
|
8
|
+
screenToWorld: (screen: DrawCoordinate) => DrawCoordinate | null;
|
|
9
|
+
}): DrawCoordinate[];
|
|
10
|
+
export declare function createCircleFromCenter(center: DrawCoordinate | null, radius: number, sides?: number): DrawCoordinate[];
|
|
11
|
+
export interface BuildStampCoordsParams {
|
|
12
|
+
stampTool: StampDrawTool;
|
|
13
|
+
center: DrawCoordinate | null;
|
|
14
|
+
resolvedStampOptions: Required<StampOptions>;
|
|
15
|
+
imageWidth: number;
|
|
16
|
+
imageHeight: number;
|
|
17
|
+
micronsToWorldPixels: (lengthUm: number) => number;
|
|
18
|
+
getRectangleProjection: () => {
|
|
19
|
+
worldToScreen: (x: number, y: number) => DrawCoordinate | null;
|
|
20
|
+
screenToWorld: (screen: DrawCoordinate) => DrawCoordinate | null;
|
|
21
|
+
} | undefined;
|
|
22
|
+
}
|
|
23
|
+
export declare function buildStampCoords(params: BuildStampCoordsParams): DrawCoordinate[];
|
|
24
|
+
//# sourceMappingURL=draw-layer-stamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draw-layer-stamp.d.ts","sourceRoot":"","sources":["../../../src/react/draw-layer-stamp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,E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c,KAAK,cAAc,GAAG,IAAI,CAAC;KAClE,GACD,SAAS,CAAC;CACf;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,cAAc,EAAE,CA8BjF"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import type { CSSProperties, MutableRefObject, RefObject } from "react";
|
|
2
|
+
export type StampDrawTool = "stamp-rectangle" | "stamp-circle" | "stamp-rectangle-4096px" | "stamp-rectangle-2mm2" | "stamp-circle-2mm2" | "stamp-circle-hpf-0.2mm2";
|
|
3
|
+
export type DrawTool = "cursor" | "freehand" | "rectangle" | "circular" | "brush" | StampDrawTool;
|
|
4
|
+
export type DrawCoordinate = [number, number];
|
|
5
|
+
export type DrawBounds = [number, number, number, number];
|
|
6
|
+
export type DrawRegionCoordinates = DrawCoordinate[] | DrawCoordinate[][] | DrawCoordinate[][][];
|
|
7
|
+
export type DrawIntent = "roi" | "patch" | "brush";
|
|
8
|
+
export interface DrawResult {
|
|
9
|
+
tool: Exclude<DrawTool, "cursor">;
|
|
10
|
+
intent: DrawIntent;
|
|
11
|
+
coordinates: DrawCoordinate[];
|
|
12
|
+
bbox: DrawBounds;
|
|
13
|
+
areaPx: number;
|
|
14
|
+
}
|
|
15
|
+
export type PatchDrawResult = DrawResult & {
|
|
16
|
+
tool: "stamp-rectangle-4096px";
|
|
17
|
+
intent: "patch";
|
|
18
|
+
};
|
|
19
|
+
export interface DrawRegion {
|
|
20
|
+
id?: string | number;
|
|
21
|
+
coordinates: DrawRegionCoordinates;
|
|
22
|
+
label?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface RegionStyleContext {
|
|
25
|
+
region: DrawRegion;
|
|
26
|
+
regionId: string | number;
|
|
27
|
+
regionIndex: number;
|
|
28
|
+
state: "default" | "hover" | "active";
|
|
29
|
+
}
|
|
30
|
+
export type RegionStrokeStyleResolver = (context: RegionStyleContext) => Partial<RegionStrokeStyle> | null | undefined;
|
|
31
|
+
export interface RegionLabelStyleContext {
|
|
32
|
+
region: DrawRegion;
|
|
33
|
+
regionId: string | number;
|
|
34
|
+
regionIndex: number;
|
|
35
|
+
zoom: number;
|
|
36
|
+
}
|
|
37
|
+
export type RegionLabelStyleResolver = (context: RegionLabelStyleContext) => Partial<RegionLabelStyle> | null | undefined;
|
|
38
|
+
export type DrawOverlayCoordinates = DrawCoordinate[] | DrawCoordinate[][] | DrawCoordinate[][][];
|
|
39
|
+
export interface DrawOverlayShape {
|
|
40
|
+
id?: string | number;
|
|
41
|
+
coordinates: DrawOverlayCoordinates;
|
|
42
|
+
closed?: boolean;
|
|
43
|
+
fill?: boolean;
|
|
44
|
+
stroke?: Partial<RegionStrokeStyle>;
|
|
45
|
+
strokeStyle?: Partial<RegionStrokeStyle>;
|
|
46
|
+
invertedFill?: DrawOverlayInvertedFillStyle;
|
|
47
|
+
visible?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface DrawOverlayInvertedFillStyle {
|
|
50
|
+
fillColor: string;
|
|
51
|
+
}
|
|
52
|
+
export interface RegionStrokeStyle {
|
|
53
|
+
color: string;
|
|
54
|
+
width: number;
|
|
55
|
+
lineDash: number[];
|
|
56
|
+
lineJoin: CanvasLineJoin;
|
|
57
|
+
lineCap: CanvasLineCap;
|
|
58
|
+
shadowColor: string;
|
|
59
|
+
shadowBlur: number;
|
|
60
|
+
shadowOffsetX: number;
|
|
61
|
+
shadowOffsetY: number;
|
|
62
|
+
}
|
|
63
|
+
export interface RegionLabelStyle {
|
|
64
|
+
fontFamily: string;
|
|
65
|
+
fontSize: number;
|
|
66
|
+
fontWeight: string | number;
|
|
67
|
+
textColor: string;
|
|
68
|
+
backgroundColor: string;
|
|
69
|
+
borderColor: string;
|
|
70
|
+
borderWidth: number;
|
|
71
|
+
paddingX: number;
|
|
72
|
+
paddingY: number;
|
|
73
|
+
offsetY: number;
|
|
74
|
+
borderRadius: number;
|
|
75
|
+
}
|
|
76
|
+
export interface DrawAreaTooltipStyle {
|
|
77
|
+
fontFamily: string;
|
|
78
|
+
fontSize: number;
|
|
79
|
+
fontWeight: string | number;
|
|
80
|
+
textColor: string;
|
|
81
|
+
backgroundColor: string;
|
|
82
|
+
borderRadius: number;
|
|
83
|
+
paddingX: number;
|
|
84
|
+
paddingY: number;
|
|
85
|
+
}
|
|
86
|
+
export interface DrawAreaTooltipOptions {
|
|
87
|
+
enabled?: boolean;
|
|
88
|
+
format?: (areaMm2: number) => string;
|
|
89
|
+
style?: Partial<DrawAreaTooltipStyle>;
|
|
90
|
+
cursorOffset?: {
|
|
91
|
+
x: number;
|
|
92
|
+
y: number;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export interface DrawProjector {
|
|
96
|
+
screenToWorld(clientX: number, clientY: number): DrawCoordinate | number[];
|
|
97
|
+
worldToScreen(worldX: number, worldY: number): DrawCoordinate | number[];
|
|
98
|
+
getViewState?: () => {
|
|
99
|
+
zoom: number;
|
|
100
|
+
rotationDeg?: number;
|
|
101
|
+
};
|
|
102
|
+
getZoomRange?: () => {
|
|
103
|
+
minZoom: number;
|
|
104
|
+
maxZoom: number;
|
|
105
|
+
};
|
|
106
|
+
zoomBy?: (factor: number, screenX: number, screenY: number) => void;
|
|
107
|
+
}
|
|
108
|
+
export interface StampOptions {
|
|
109
|
+
rectangleAreaMm2?: number;
|
|
110
|
+
circleAreaMm2?: number;
|
|
111
|
+
rectanglePixelSize?: number;
|
|
112
|
+
}
|
|
113
|
+
export interface BrushOptions {
|
|
114
|
+
radius: number;
|
|
115
|
+
edgeDetail?: number;
|
|
116
|
+
edgeSmoothing?: number;
|
|
117
|
+
clickSelectRoi?: boolean;
|
|
118
|
+
fillColor?: string;
|
|
119
|
+
fillOpacity?: number;
|
|
120
|
+
cursorColor?: string;
|
|
121
|
+
cursorActiveColor?: string;
|
|
122
|
+
cursorLineWidth?: number;
|
|
123
|
+
cursorLineDash?: number[];
|
|
124
|
+
}
|
|
125
|
+
export interface DrawLayerProps {
|
|
126
|
+
tool: DrawTool;
|
|
127
|
+
imageWidth: number;
|
|
128
|
+
imageHeight: number;
|
|
129
|
+
imageMpp?: number;
|
|
130
|
+
imageZoom?: number;
|
|
131
|
+
stampOptions?: StampOptions;
|
|
132
|
+
brushOptions?: BrushOptions;
|
|
133
|
+
projectorRef: RefObject<DrawProjector | null>;
|
|
134
|
+
onBrushTap?: (coordinate: DrawCoordinate) => boolean;
|
|
135
|
+
onDrawComplete?: (result: DrawResult) => void;
|
|
136
|
+
onPatchComplete?: (result: PatchDrawResult) => void;
|
|
137
|
+
enabled?: boolean;
|
|
138
|
+
viewStateSignal?: unknown;
|
|
139
|
+
persistedRegions?: DrawRegion[];
|
|
140
|
+
patchRegions?: DrawRegion[];
|
|
141
|
+
persistedPolygons?: DrawRegionCoordinates[];
|
|
142
|
+
drawFillColor?: string;
|
|
143
|
+
regionStrokeStyle?: Partial<RegionStrokeStyle>;
|
|
144
|
+
regionStrokeHoverStyle?: Partial<RegionStrokeStyle>;
|
|
145
|
+
regionStrokeActiveStyle?: Partial<RegionStrokeStyle>;
|
|
146
|
+
patchStrokeStyle?: Partial<RegionStrokeStyle>;
|
|
147
|
+
resolveRegionStrokeStyle?: RegionStrokeStyleResolver;
|
|
148
|
+
resolveRegionLabelStyle?: RegionLabelStyleResolver;
|
|
149
|
+
overlayShapes?: DrawOverlayShape[];
|
|
150
|
+
hoveredRegionId?: string | number | null;
|
|
151
|
+
activeRegionId?: string | number | null;
|
|
152
|
+
regionLabelStyle?: Partial<RegionLabelStyle>;
|
|
153
|
+
drawAreaTooltip?: DrawAreaTooltipOptions;
|
|
154
|
+
autoLiftRegionLabelAtMaxZoom?: boolean;
|
|
155
|
+
regionLabelAutoLiftOffsetPx?: number;
|
|
156
|
+
invalidateRef?: MutableRefObject<(() => void) | null>;
|
|
157
|
+
className?: string;
|
|
158
|
+
style?: CSSProperties;
|
|
159
|
+
}
|
|
160
|
+
export interface DrawSession {
|
|
161
|
+
isDrawing: boolean;
|
|
162
|
+
pointerId: number | null;
|
|
163
|
+
start: DrawCoordinate | null;
|
|
164
|
+
current: DrawCoordinate | null;
|
|
165
|
+
cursor: DrawCoordinate | null;
|
|
166
|
+
cursorScreen: DrawCoordinate | null;
|
|
167
|
+
points: DrawCoordinate[];
|
|
168
|
+
screenPoints: DrawCoordinate[];
|
|
169
|
+
stampCenter: DrawCoordinate | null;
|
|
170
|
+
}
|
|
171
|
+
export interface NormalizedDrawRegionPolygon {
|
|
172
|
+
outer: DrawCoordinate[];
|
|
173
|
+
holes: DrawCoordinate[][];
|
|
174
|
+
}
|
|
175
|
+
export interface PreparedRenderedRegion {
|
|
176
|
+
region: DrawRegion;
|
|
177
|
+
regionIndex: number;
|
|
178
|
+
regionKey: string | number;
|
|
179
|
+
polygons: NormalizedDrawRegionPolygon[];
|
|
180
|
+
}
|
|
181
|
+
export interface ResolvedBrushOptions {
|
|
182
|
+
radius: number;
|
|
183
|
+
edgeDetail: number;
|
|
184
|
+
edgeSmoothing: number;
|
|
185
|
+
clickSelectRoi: boolean;
|
|
186
|
+
fillColor: string;
|
|
187
|
+
fillOpacity: number;
|
|
188
|
+
cursorColor: string;
|
|
189
|
+
cursorActiveColor: string;
|
|
190
|
+
cursorLineWidth: number;
|
|
191
|
+
cursorLineDash: number[];
|
|
192
|
+
}
|
|
193
|
+
export interface ResolvedDrawAreaTooltipOptions {
|
|
194
|
+
enabled: boolean;
|
|
195
|
+
format: (areaMm2: number) => string;
|
|
196
|
+
style: DrawAreaTooltipStyle;
|
|
197
|
+
cursorOffsetX: number;
|
|
198
|
+
cursorOffsetY: number;
|
|
199
|
+
}
|
|
200
|
+
export declare const EMPTY_DASH: number[];
|
|
201
|
+
export declare const EMPTY_REGIONS: DrawRegion[];
|
|
202
|
+
export declare const DEFAULT_REGION_STROKE_STYLE: RegionStrokeStyle;
|
|
203
|
+
export declare const DEFAULT_PATCH_STROKE_STYLE: RegionStrokeStyle;
|
|
204
|
+
export declare const REGION_INTERACTION_SHADOW_COLOR = "rgba(23, 23, 25, 0.1)";
|
|
205
|
+
export declare const REGION_INTERACTION_SHADOW_WIDTH = 6;
|
|
206
|
+
export declare const DEFAULT_REGION_LABEL_STYLE: RegionLabelStyle;
|
|
207
|
+
export declare const DEFAULT_DRAW_AREA_TOOLTIP_STYLE: DrawAreaTooltipStyle;
|
|
208
|
+
export declare const DEFAULT_DRAW_AREA_TOOLTIP_OFFSET: {
|
|
209
|
+
readonly x: 16;
|
|
210
|
+
readonly y: -24;
|
|
211
|
+
};
|
|
212
|
+
export declare const REGION_LABEL_AUTO_LIFT_MAX_OFFSET_PX = 20;
|
|
213
|
+
export declare const REGION_LABEL_AUTO_LIFT_MAX_EPSILON = 0.000001;
|
|
214
|
+
export declare const DRAW_FILL = "rgba(255, 77, 79, 0.16)";
|
|
215
|
+
export declare const DEFAULT_DRAW_PREVIEW_FILL = "transparent";
|
|
216
|
+
export declare const FREEHAND_MIN_POINTS = 3;
|
|
217
|
+
export declare const FREEHAND_SCREEN_STEP = 2;
|
|
218
|
+
export declare const CIRCLE_SIDES = 96;
|
|
219
|
+
export declare const MIN_AREA_PX = 1;
|
|
220
|
+
export declare const MICRONS_PER_MM = 1000;
|
|
221
|
+
export declare const DEFAULT_STAMP_RECTANGLE_AREA_MM2 = 2;
|
|
222
|
+
export declare const DEFAULT_STAMP_CIRCLE_AREA_MM2 = 2;
|
|
223
|
+
export declare const DEFAULT_STAMP_RECTANGLE_PIXEL_SIZE = 4096;
|
|
224
|
+
export declare const LEGACY_HPF_CIRCLE_AREA_MM2 = 0.2;
|
|
225
|
+
export declare const WHEEL_ZOOM_IN_FACTOR = 1.12;
|
|
226
|
+
export declare const WHEEL_ZOOM_OUT_FACTOR = 0.89;
|
|
227
|
+
export declare const DEFAULT_BRUSH_RADIUS = 32;
|
|
228
|
+
export declare const DEFAULT_BRUSH_FILL_COLOR = "#000000";
|
|
229
|
+
export declare const DEFAULT_BRUSH_FILL_OPACITY = 0.1;
|
|
230
|
+
export declare const DEFAULT_BRUSH_CURSOR_COLOR = "#FFCF00";
|
|
231
|
+
export declare const DEFAULT_BRUSH_CURSOR_ACTIVE_COLOR = "#FF0000";
|
|
232
|
+
export declare const DEFAULT_BRUSH_CURSOR_LINE_WIDTH = 1.5;
|
|
233
|
+
export declare const DEFAULT_BRUSH_CURSOR_DASH: number[];
|
|
234
|
+
export declare const DEFAULT_BRUSH_EDGE_DETAIL = 1;
|
|
235
|
+
export declare const MIN_BRUSH_EDGE_DETAIL = 0.25;
|
|
236
|
+
export declare const MAX_BRUSH_EDGE_DETAIL = 4;
|
|
237
|
+
export declare const DEFAULT_BRUSH_EDGE_SMOOTHING = 1;
|
|
238
|
+
export declare const MIN_BRUSH_EDGE_SMOOTHING = 0;
|
|
239
|
+
export declare const MAX_BRUSH_EDGE_SMOOTHING = 4;
|
|
240
|
+
export declare const MIN_BRUSH_RASTER_STEP = 0.05;
|
|
241
|
+
export declare const BRUSH_RASTER_DIAMETER_SAMPLES = 256;
|
|
242
|
+
export declare const BRUSH_SCREEN_STEP = 1.5;
|
|
243
|
+
//# sourceMappingURL=draw-layer-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draw-layer-types.d.ts","sourceRoot":"","sources":["../../../src/react/draw-layer-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAExE,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,cAAc,GACd,wBAAwB,GACxB,sBAAsB,GACtB,mBAAmB,GACnB,yBAAyB,CAAC;AAE9B,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,GAAG,aAAa,CAAC;AAElG,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9C,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1D,MAA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amp } from "../wsi/utils";
|
|
2
|
+
import type { DrawCoordinate, DrawOverlayCoordinates, DrawRegionCoordinates, NormalizedDrawRegionPolygon, RegionStrokeStyle } from "./draw-layer-types";
|
|
3
|
+
import { type DrawBounds } from "./draw-layer-types";
|
|
4
|
+
export { clamp };
|
|
5
|
+
export declare function clampWorld(coord: DrawCoordinate, imageWidth: number, imageHeight: number): DrawCoordinate;
|
|
6
|
+
export declare function toDrawCoordinate(value: unknown): DrawCoordinate | null;
|
|
7
|
+
export declare const toCoord: typeof toDrawCoordinate;
|
|
8
|
+
export declare function closeRing(coords: DrawCoordinate[]): DrawCoordinate[];
|
|
9
|
+
export declare function polygonArea(coords: DrawCoordinate[]): number;
|
|
10
|
+
export declare function computeBounds(coords: DrawCoordinate[]): DrawBounds;
|
|
11
|
+
export declare function tracePath(ctx: CanvasRenderingContext2D, points: DrawCoordinate[], close?: boolean): void;
|
|
12
|
+
export declare function drawPath(ctx: CanvasRenderingContext2D, points: DrawCoordinate[], strokeStyle: RegionStrokeStyle, close?: boolean, fill?: boolean, fillColor?: string): void;
|
|
13
|
+
export declare function resolveStrokeStyle(style: Partial<RegionStrokeStyle> | undefined): RegionStrokeStyle;
|
|
14
|
+
export declare function mergeStrokeStyle(base: RegionStrokeStyle, override: Partial<RegionStrokeStyle> | undefined): RegionStrokeStyle;
|
|
15
|
+
export declare function isSameRegionId(a: string | number | null | undefined, b: string | number | null | undefined): boolean;
|
|
16
|
+
export declare function isFiniteNumber(value: unknown): value is number;
|
|
17
|
+
export declare function isCoordinatePair(value: unknown): value is [number, number];
|
|
18
|
+
export declare function isCoordinateRing(value: unknown): value is DrawCoordinate[];
|
|
19
|
+
export declare function normalizeOverlayRings(coordinates: DrawOverlayCoordinates, close: boolean): DrawCoordinate[][];
|
|
20
|
+
export declare function clampPositiveOrFallback(value: number | undefined, fallback: number): number;
|
|
21
|
+
export declare function clampUnitOpacity(value: number | undefined, fallback: number): number;
|
|
22
|
+
export declare function drawRoundedRect(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number): void;
|
|
23
|
+
export declare function isNestedRingCoordinates(coordinates: DrawOverlayCoordinates): boolean;
|
|
24
|
+
export declare function createRectangle(start: DrawCoordinate | null, end: DrawCoordinate | null, projection?: {
|
|
25
|
+
worldToScreen: (x: number, y: number) => DrawCoordinate | null;
|
|
26
|
+
screenToWorld: (screen: DrawCoordinate) => DrawCoordinate | null;
|
|
27
|
+
}): DrawCoordinate[];
|
|
28
|
+
export declare function createCircle(start: DrawCoordinate | null, end: DrawCoordinate | null, sides?: number): DrawCoordinate[];
|
|
29
|
+
export declare function normalizeDrawRegionPolygons(coordinates: DrawRegionCoordinates): NormalizedDrawRegionPolygon[];
|
|
30
|
+
//# sourceMappingURL=draw-layer-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draw-layer-utils.d.ts","sourceRoot":"","sources":["../../../src/react/draw-layer-utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACxJ,OAAO,EAA6C,KAAK,UAAU,EAAc,MAAM,oBAAoB,CAAC;AAE5G,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc,CAEzG;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAMtE;AAED,eAAO,MAAM,OAAO,yBAAmB,CAAC;AAExC,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAEpE;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAE5D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,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGpF;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,wBAAwB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAaxI;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,sBAAsB,GAAG,OAAO,CAGpF;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,cAAc,GAAG,IAAI,EAC5B,GAAG,EAAE,cAAc,GAAG,IAAI,EAC1B,UAAU,CAAC,EAAE;IACX,aAAa,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,cAAc,GAAG,IAAI,CAAC;IAC/D,aAAa,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,cAAc,GAAG,IAAI,CAAC;CAClE,GACA,cAAc,EAAE,CA8BlB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,EAAE,GAAG,EAAE,cAAc,GAAG,IAAI,EAAE,KAAK,SAAe,GAAG,cAAc,EAAE,CAe7H;AAED,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,qBAAqB,GAAG,2BAA2B,EAAE,CAqB7G"}
|
|
@@ -1,189 +1,6 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export
|
|
3
|
-
export type DrawTool
|
|
4
|
-
export
|
|
5
|
-
export type DrawBounds = [number, number, number, number];
|
|
6
|
-
export type DrawRegionCoordinates = DrawCoordinate[] | DrawCoordinate[][] | DrawCoordinate[][][];
|
|
7
|
-
export type DrawIntent = "roi" | "patch" | "brush";
|
|
8
|
-
export interface DrawResult {
|
|
9
|
-
tool: Exclude<DrawTool, "cursor">;
|
|
10
|
-
intent: DrawIntent;
|
|
11
|
-
coordinates: DrawCoordinate[];
|
|
12
|
-
bbox: DrawBounds;
|
|
13
|
-
areaPx: number;
|
|
14
|
-
}
|
|
15
|
-
export type PatchDrawResult = DrawResult & {
|
|
16
|
-
tool: "stamp-rectangle-4096px";
|
|
17
|
-
intent: "patch";
|
|
18
|
-
};
|
|
19
|
-
export interface DrawRegion {
|
|
20
|
-
id?: string | number;
|
|
21
|
-
coordinates: DrawRegionCoordinates;
|
|
22
|
-
label?: string;
|
|
23
|
-
}
|
|
24
|
-
export interface RegionStyleContext {
|
|
25
|
-
region: DrawRegion;
|
|
26
|
-
regionId: string | number;
|
|
27
|
-
regionIndex: number;
|
|
28
|
-
state: "default" | "hover" | "active";
|
|
29
|
-
}
|
|
30
|
-
export type RegionStrokeStyleResolver = (context: RegionStyleContext) => Partial<RegionStrokeStyle> | null | undefined;
|
|
31
|
-
export interface RegionLabelStyleContext {
|
|
32
|
-
region: DrawRegion;
|
|
33
|
-
regionId: string | number;
|
|
34
|
-
regionIndex: number;
|
|
35
|
-
zoom: number;
|
|
36
|
-
}
|
|
37
|
-
export type RegionLabelStyleResolver = (context: RegionLabelStyleContext) => Partial<RegionLabelStyle> | null | undefined;
|
|
38
|
-
export type DrawOverlayCoordinates = DrawCoordinate[] | DrawCoordinate[][] | DrawCoordinate[][][];
|
|
39
|
-
export interface DrawOverlayShape {
|
|
40
|
-
id?: string | number;
|
|
41
|
-
coordinates: DrawOverlayCoordinates;
|
|
42
|
-
closed?: boolean;
|
|
43
|
-
fill?: boolean;
|
|
44
|
-
stroke?: Partial<RegionStrokeStyle>;
|
|
45
|
-
strokeStyle?: Partial<RegionStrokeStyle>;
|
|
46
|
-
invertedFill?: DrawOverlayInvertedFillStyle;
|
|
47
|
-
visible?: boolean;
|
|
48
|
-
}
|
|
49
|
-
export interface DrawOverlayInvertedFillStyle {
|
|
50
|
-
fillColor: string;
|
|
51
|
-
}
|
|
52
|
-
export interface RegionStrokeStyle {
|
|
53
|
-
color: string;
|
|
54
|
-
width: number;
|
|
55
|
-
lineDash: number[];
|
|
56
|
-
lineJoin: CanvasLineJoin;
|
|
57
|
-
lineCap: CanvasLineCap;
|
|
58
|
-
shadowColor: string;
|
|
59
|
-
shadowBlur: number;
|
|
60
|
-
shadowOffsetX: number;
|
|
61
|
-
shadowOffsetY: number;
|
|
62
|
-
}
|
|
63
|
-
export interface RegionLabelStyle {
|
|
64
|
-
fontFamily: string;
|
|
65
|
-
fontSize: number;
|
|
66
|
-
fontWeight: string | number;
|
|
67
|
-
textColor: string;
|
|
68
|
-
backgroundColor: string;
|
|
69
|
-
borderColor: string;
|
|
70
|
-
borderWidth: number;
|
|
71
|
-
paddingX: number;
|
|
72
|
-
paddingY: number;
|
|
73
|
-
offsetY: number;
|
|
74
|
-
borderRadius: number;
|
|
75
|
-
}
|
|
76
|
-
export interface DrawAreaTooltipStyle {
|
|
77
|
-
fontFamily: string;
|
|
78
|
-
fontSize: number;
|
|
79
|
-
fontWeight: string | number;
|
|
80
|
-
textColor: string;
|
|
81
|
-
backgroundColor: string;
|
|
82
|
-
borderRadius: number;
|
|
83
|
-
paddingX: number;
|
|
84
|
-
paddingY: number;
|
|
85
|
-
}
|
|
86
|
-
export interface DrawAreaTooltipOptions {
|
|
87
|
-
enabled?: boolean;
|
|
88
|
-
format?: (areaMm2: number) => string;
|
|
89
|
-
style?: Partial<DrawAreaTooltipStyle>;
|
|
90
|
-
cursorOffset?: {
|
|
91
|
-
x: number;
|
|
92
|
-
y: number;
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
export interface DrawProjector {
|
|
96
|
-
screenToWorld(clientX: number, clientY: number): DrawCoordinate | number[];
|
|
97
|
-
worldToScreen(worldX: number, worldY: number): DrawCoordinate | number[];
|
|
98
|
-
getViewState?: () => {
|
|
99
|
-
zoom: number;
|
|
100
|
-
rotationDeg?: number;
|
|
101
|
-
};
|
|
102
|
-
getZoomRange?: () => {
|
|
103
|
-
minZoom: number;
|
|
104
|
-
maxZoom: number;
|
|
105
|
-
};
|
|
106
|
-
zoomBy?: (factor: number, screenX: number, screenY: number) => void;
|
|
107
|
-
}
|
|
108
|
-
export interface StampOptions {
|
|
109
|
-
rectangleAreaMm2?: number;
|
|
110
|
-
circleAreaMm2?: number;
|
|
111
|
-
rectanglePixelSize?: number;
|
|
112
|
-
}
|
|
113
|
-
export interface BrushOptions {
|
|
114
|
-
/**
|
|
115
|
-
* Brush radius in HTML/CSS pixels (px).
|
|
116
|
-
* This value is zoom-invariant: the on-screen brush size stays fixed.
|
|
117
|
-
*/
|
|
118
|
-
radius: number;
|
|
119
|
-
/**
|
|
120
|
-
* Brush edge detail factor. Higher values create rounder/finer edges.
|
|
121
|
-
* Range: 0.25 ~ 4. Default: 1.
|
|
122
|
-
*/
|
|
123
|
-
edgeDetail?: number;
|
|
124
|
-
/**
|
|
125
|
-
* Post-smoothing passes for brush outline to reduce stair-stepping.
|
|
126
|
-
* Range: 0 ~ 4. Default: 1.
|
|
127
|
-
*/
|
|
128
|
-
edgeSmoothing?: number;
|
|
129
|
-
/**
|
|
130
|
-
* When true, a brush "tap" (click without drag) on ROI selects that ROI
|
|
131
|
-
* instead of creating a brush stroke.
|
|
132
|
-
*/
|
|
133
|
-
clickSelectRoi?: boolean;
|
|
134
|
-
fillColor?: string;
|
|
135
|
-
fillOpacity?: number;
|
|
136
|
-
cursorColor?: string;
|
|
137
|
-
cursorActiveColor?: string;
|
|
138
|
-
cursorLineWidth?: number;
|
|
139
|
-
cursorLineDash?: number[];
|
|
140
|
-
}
|
|
141
|
-
export interface DrawLayerProps {
|
|
142
|
-
tool: DrawTool;
|
|
143
|
-
imageWidth: number;
|
|
144
|
-
imageHeight: number;
|
|
145
|
-
imageMpp?: number;
|
|
146
|
-
imageZoom?: number;
|
|
147
|
-
stampOptions?: StampOptions;
|
|
148
|
-
brushOptions?: BrushOptions;
|
|
149
|
-
projectorRef: RefObject<DrawProjector | null>;
|
|
150
|
-
onBrushTap?: (coordinate: DrawCoordinate) => boolean;
|
|
151
|
-
onDrawComplete?: (result: DrawResult) => void;
|
|
152
|
-
onPatchComplete?: (result: PatchDrawResult) => void;
|
|
153
|
-
enabled?: boolean;
|
|
154
|
-
viewStateSignal?: unknown;
|
|
155
|
-
persistedRegions?: DrawRegion[];
|
|
156
|
-
patchRegions?: DrawRegion[];
|
|
157
|
-
persistedPolygons?: DrawRegionCoordinates[];
|
|
158
|
-
drawFillColor?: string;
|
|
159
|
-
regionStrokeStyle?: Partial<RegionStrokeStyle>;
|
|
160
|
-
regionStrokeHoverStyle?: Partial<RegionStrokeStyle>;
|
|
161
|
-
regionStrokeActiveStyle?: Partial<RegionStrokeStyle>;
|
|
162
|
-
patchStrokeStyle?: Partial<RegionStrokeStyle>;
|
|
163
|
-
resolveRegionStrokeStyle?: RegionStrokeStyleResolver;
|
|
164
|
-
resolveRegionLabelStyle?: RegionLabelStyleResolver;
|
|
165
|
-
overlayShapes?: DrawOverlayShape[];
|
|
166
|
-
hoveredRegionId?: string | number | null;
|
|
167
|
-
activeRegionId?: string | number | null;
|
|
168
|
-
regionLabelStyle?: Partial<RegionLabelStyle>;
|
|
169
|
-
drawAreaTooltip?: DrawAreaTooltipOptions;
|
|
170
|
-
autoLiftRegionLabelAtMaxZoom?: boolean;
|
|
171
|
-
regionLabelAutoLiftOffsetPx?: number;
|
|
172
|
-
invalidateRef?: MutableRefObject<(() => void) | null>;
|
|
173
|
-
className?: string;
|
|
174
|
-
style?: CSSProperties;
|
|
175
|
-
}
|
|
176
|
-
export declare function resolveRegionLabelAutoLiftOffsetPx(enabled: boolean | undefined, zoom: number, zoomRange: {
|
|
177
|
-
minZoom: number;
|
|
178
|
-
maxZoom: number;
|
|
179
|
-
} | null | undefined): number;
|
|
180
|
-
export declare function closeRing(coords: DrawCoordinate[]): DrawCoordinate[];
|
|
181
|
-
export declare function createRectangle(start: DrawCoordinate | null, end: DrawCoordinate | null, projection?: {
|
|
182
|
-
worldToScreen: (x: number, y: number) => DrawCoordinate | null;
|
|
183
|
-
screenToWorld: (screen: DrawCoordinate) => DrawCoordinate | null;
|
|
184
|
-
}): DrawCoordinate[];
|
|
185
|
-
export declare function createCircle(start: DrawCoordinate | null, end: DrawCoordinate | null, sides?: number): DrawCoordinate[];
|
|
186
|
-
export declare function resolveRegionLabelStyle(style: Partial<RegionLabelStyle> | undefined): RegionLabelStyle;
|
|
187
|
-
export declare function mergeRegionLabelStyle(base: RegionLabelStyle, override: Partial<RegionLabelStyle> | null | undefined): RegionLabelStyle;
|
|
1
|
+
import { type DrawLayerProps } from "./draw-layer-types";
|
|
2
|
+
export { mergeRegionLabelStyle, resolveRegionLabelAutoLiftOffsetPx, resolveRegionLabelStyle } from "./draw-layer-label";
|
|
3
|
+
export type { BrushOptions, DrawAreaTooltipOptions, DrawAreaTooltipStyle, DrawBounds, DrawCoordinate, DrawIntent, DrawOverlayCoordinates, DrawOverlayInvertedFillStyle, DrawOverlayShape, DrawProjector, DrawRegion, DrawRegionCoordinates, DrawResult, DrawTool, PatchDrawResult, RegionLabelStyle, RegionLabelStyleContext, RegionLabelStyleResolver, RegionStrokeStyle, RegionStrokeStyleResolver, RegionStyleContext, StampDrawTool, StampOptions, } from "./draw-layer-types";
|
|
4
|
+
export { closeRing, createCircle, createRectangle } from "./draw-layer-utils";
|
|
188
5
|
export declare function DrawLayer({ tool, imageWidth, imageHeight, imageMpp, imageZoom, stampOptions, brushOptions, projectorRef, onBrushTap, onDrawComplete, onPatchComplete, enabled, viewStateSignal, persistedRegions, patchRegions, persistedPolygons, drawFillColor, regionStrokeStyle, regionStrokeHoverStyle, regionStrokeActiveStyle, patchStrokeStyle, resolveRegionStrokeStyle, resolveRegionLabelStyle: resolveRegionLabelStyleProp, overlayShapes, hoveredRegionId, activeRegionId, regionLabelStyle, drawAreaTooltip, autoLiftRegionLabelAtMaxZoom, regionLabelAutoLiftOffsetPx, invalidateRef, className, style, }: DrawLayerProps): React.ReactElement;
|
|
189
6
|
//# sourceMappingURL=draw-layer.d.ts.map
|