@linkurious/ogma-annotations 1.1.14 → 1.1.16
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/index.js +9 -9
- package/dist/index.mjs +316 -289
- package/dist/types/Control.d.ts +1 -0
- package/dist/types/Editor/base.d.ts +1 -0
- package/dist/types/types.d.ts +1 -1
- package/dist/types/utils.d.ts +2 -1
- package/package.json +1 -1
package/dist/types/Control.d.ts
CHANGED
|
@@ -93,6 +93,7 @@ export declare class Control extends EventEmitter<FeatureEvents> {
|
|
|
93
93
|
* @param style The new style
|
|
94
94
|
*/
|
|
95
95
|
updateStyle<A extends Annotation>(id: Id, style: A["properties"]["style"]): this;
|
|
96
|
+
setScale(id: Id, scale: number, ox: number, oy: number): this;
|
|
96
97
|
/**
|
|
97
98
|
*
|
|
98
99
|
* @returns the annotations in the controller
|
|
@@ -29,6 +29,7 @@ export declare abstract class Editor<T extends Annotation> extends eventEmmitter
|
|
|
29
29
|
add(options: T): T;
|
|
30
30
|
updateStyle(annotation: T, style: Partial<T["properties"]["style"]>): void;
|
|
31
31
|
updateGeometry(annotation: T, geometry: Partial<T["geometry"]>): void;
|
|
32
|
+
scale(annotation: T, scale: number, ox: number, oy: number): void;
|
|
32
33
|
/**
|
|
33
34
|
* @method update
|
|
34
35
|
* Updates an annotation (position, color etc)
|
package/dist/types/types.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export interface TextStyle extends StrokeOptions {
|
|
|
44
44
|
/** Helvetica, sans-serif... */
|
|
45
45
|
font?: string;
|
|
46
46
|
/** Font size, in pixels */
|
|
47
|
-
fontSize?: number;
|
|
47
|
+
fontSize?: number | string;
|
|
48
48
|
/** text color: #f00, yellow...*/
|
|
49
49
|
color?: string;
|
|
50
50
|
/** background color: empty for transparent #f00, yellow...*/
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Point } from "@linkurious/ogma";
|
|
2
|
-
import type { BBox } from "geojson";
|
|
2
|
+
import type { BBox, LineString, Polygon } from "geojson";
|
|
3
3
|
import { AnnotationCollection, Arrow, Text } from "./types";
|
|
4
4
|
export declare function createSVGElement<T extends SVGElement>(tag: string): T;
|
|
5
5
|
export declare function getTextBbox(t: Text): BBox;
|
|
@@ -41,6 +41,7 @@ export declare function setArrowEndPoint(a: Arrow, side: "start" | "end", x: num
|
|
|
41
41
|
export declare const getHandleId: (handle: HTMLDivElement) => number;
|
|
42
42
|
type Bounds = [number, number, number, number];
|
|
43
43
|
export declare function getAnnotationsBounds(annotations: AnnotationCollection): Bounds;
|
|
44
|
+
export declare function scaleGeometry(geometry: LineString | Polygon, scale: number, ox: number, oy: number): LineString | Polygon;
|
|
44
45
|
export declare function getAttachmentPointOnNode(start: Point, nodeCenter: Point, nodeRadius: number): {
|
|
45
46
|
x: number;
|
|
46
47
|
y: number;
|