@markerjs/markerjs3 3.0.0-rc.4 → 3.0.0
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 +7 -19
- package/markerjs3.d.ts +9 -1
- package/markerjs3.js +1 -1
- package/markerjs3.js.map +1 -1
- package/package.json +1 -1
- package/umd/markerjs3.js +1 -1
- package/umd/markerjs3.js.map +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
# marker.js 3 — Add image annotation to your web apps
|
|
2
2
|
|
|
3
|
-
> **Note**: marker.js 3 is in the pre-release stage of its lifecycle and will have many additions and, potentially, breaking changes before the official 3.0 release.
|
|
4
|
-
>
|
|
5
|
-
> If you need a stable image annotation library, consider using [marker.js 2](https://markerjs.com) for now.
|
|
6
|
-
|
|
7
3
|
marker.js 3 is a JavaScript browser library to enable image annotation in your web applications. Add marker.js 3 to your web app and enable users to annotate and mark up images. You can save, share or otherwise process the results.
|
|
8
4
|
|
|
9
5
|
## Installation
|
|
@@ -12,15 +8,11 @@ marker.js 3 is a JavaScript browser library to enable image annotation in your w
|
|
|
12
8
|
npm install @markerjs/markerjs3
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
yarn add @markerjs/markerjs3
|
|
19
|
-
```
|
|
11
|
+
The library includes TypeScript type definitions out of the box.
|
|
20
12
|
|
|
21
13
|
## Usage
|
|
22
14
|
|
|
23
|
-
|
|
15
|
+
marker.js 3 is a "headless" library. In this case "headless" means that it doesn't come with any toolbars, property editors, and placement preconceptions. This way the library focuses on the core features you need, and you can make it feel totally native in the application you are building without resorting to any tricks or hacks.
|
|
24
16
|
|
|
25
17
|
With that out of the way, here are the simplest usage scenarios...
|
|
26
18
|
|
|
@@ -50,15 +42,15 @@ editorContainerDiv.appendChild(markerArea);
|
|
|
50
42
|
To initiate creation of a marker you just call `createMarker()` and pass it the name (or type) of the marker you want to create. So, if you have a button with id `addFrameButton` you can make it create a new `FrameMarker` with something like this:
|
|
51
43
|
|
|
52
44
|
```js
|
|
53
|
-
document.querySelector(
|
|
54
|
-
markerArea.createMarker(
|
|
45
|
+
document.querySelector('#addButton')?.addEventListener('click', () => {
|
|
46
|
+
markerArea.createMarker('FrameMarker');
|
|
55
47
|
});
|
|
56
48
|
```
|
|
57
49
|
|
|
58
50
|
And whenever you want to save state (current annotation) you just call `getState()`:
|
|
59
51
|
|
|
60
52
|
```js
|
|
61
|
-
document.querySelector(
|
|
53
|
+
document.querySelector('#saveStateButton')?.addEventListener('click', () => {
|
|
62
54
|
const state = markerArea.getState();
|
|
63
55
|
console.log(state);
|
|
64
56
|
});
|
|
@@ -101,15 +93,11 @@ markerView.show(savedState);
|
|
|
101
93
|
|
|
102
94
|
## Demos
|
|
103
95
|
|
|
104
|
-
Check out the
|
|
105
|
-
|
|
106
|
-
While it's made with React it is purposefully light on React-specific stuff and "best practices" to just focus on marker.js 3 related things.
|
|
107
|
-
|
|
108
|
-
_more demos coming soon..._
|
|
96
|
+
Check out the [demos on markerjs.com](https://markerjs.com/demos).
|
|
109
97
|
|
|
110
98
|
## More docs and tutorials
|
|
111
99
|
|
|
112
|
-
|
|
100
|
+
You can find marker.js 3 reference and tutorials [here](https://markerjs.com/docs-v3/).
|
|
113
101
|
|
|
114
102
|
## License
|
|
115
103
|
|
package/markerjs3.d.ts
CHANGED
|
@@ -1706,6 +1706,14 @@ declare class MarkerBaseEditor<TMarkerType extends MarkerBase = MarkerBase> {
|
|
|
1706
1706
|
* Gets marker's opacity.
|
|
1707
1707
|
*/
|
|
1708
1708
|
get opacity(): number;
|
|
1709
|
+
/**
|
|
1710
|
+
* Sets marker's notes.
|
|
1711
|
+
*/
|
|
1712
|
+
set notes(value: string | undefined);
|
|
1713
|
+
/**
|
|
1714
|
+
* Gets marker's notes.
|
|
1715
|
+
*/
|
|
1716
|
+
get notes(): string | undefined;
|
|
1709
1717
|
/**
|
|
1710
1718
|
* Creates a new instance of marker editor.
|
|
1711
1719
|
*
|
|
@@ -3048,4 +3056,4 @@ declare class Renderer {
|
|
|
3048
3056
|
rasterize(state: AnnotationState, targetCanvas?: HTMLCanvasElement): Promise<string>;
|
|
3049
3057
|
}
|
|
3050
3058
|
|
|
3051
|
-
export { Activator, type AnnotationState, ArrowMarker, ArrowMarkerEditor, type ArrowMarkerState, type ArrowType, type BlurHandler, CalloutMarker, CalloutMarkerEditor, type CalloutMarkerState, CaptionFrameMarker, CaptionFrameMarkerEditor, type CaptionFrameMarkerState, CheckImageMarker, CoverMarker, CustomImageMarker, EllipseFrameMarker, EllipseMarker, type FontSize, FrameMarker, FreehandMarker, FreehandMarkerEditor, type FreehandMarkerState, Grip, type GripLocation, HighlightMarker, type IPoint, type ISize, type ITransformMatrix, ImageMarkerBase, type ImageMarkerBaseState, ImageMarkerEditor, type ImageType, LineMarker, LinearMarkerBase, type LinearMarkerBaseState, LinearMarkerEditor, MarkerArea, type MarkerAreaEventData, type MarkerAreaEventMap, type MarkerAreaMode, MarkerBase, MarkerBaseEditor, type MarkerBaseState, type MarkerCreationStyle, type MarkerEditorEventData, type MarkerEditorProperties, type MarkerEditorState, type MarkerStage, MarkerView, type MarkerViewEventData, type MarkerViewEventMap, MeasurementMarker, PolygonMarker, PolygonMarkerEditor, type PolygonMarkerState, RectangularBoxMarkerBase, type RectangularBoxMarkerBaseState, Renderer, ResizeGrip, RotateGrip, ShapeMarkerBase, type ShapeMarkerBaseState, ShapeMarkerEditor, ShapeOutlineMarkerBase, type ShapeOutlineMarkerBaseState, ShapeOutlineMarkerEditor, SvgHelper, TextBlock, TextBlockEditor, type TextChangedHandler, TextMarker, TextMarkerEditor, type TextMarkerState, XImageMarker };
|
|
3059
|
+
export { Activator, type AnnotationState, ArrowMarker, ArrowMarkerEditor, type ArrowMarkerState, type ArrowType, type BlurHandler, CalloutMarker, CalloutMarkerEditor, type CalloutMarkerState, CaptionFrameMarker, CaptionFrameMarkerEditor, type CaptionFrameMarkerState, CheckImageMarker, CoverMarker, CustomImageMarker, EllipseFrameMarker, EllipseMarker, type FontSize, FrameMarker, FreehandMarker, FreehandMarkerEditor, type FreehandMarkerState, Grip, type GripLocation, HighlightMarker, type IPoint, type ISize, type ITransformMatrix, ImageMarkerBase, type ImageMarkerBaseState, ImageMarkerEditor, type ImageType, LineMarker, LinearMarkerBase, type LinearMarkerBaseState, LinearMarkerEditor, MarkerArea, type MarkerAreaEventData, type MarkerAreaEventMap, type MarkerAreaMode, MarkerBase, MarkerBaseEditor, type MarkerBaseState, type MarkerCreationStyle, type MarkerEditorEventData, type MarkerEditorProperties, type MarkerEditorState, type MarkerEventData, type MarkerStage, MarkerView, type MarkerViewEventData, type MarkerViewEventMap, MeasurementMarker, PolygonMarker, PolygonMarkerEditor, type PolygonMarkerState, RectangularBoxMarkerBase, type RectangularBoxMarkerBaseState, Renderer, ResizeGrip, RotateGrip, ShapeMarkerBase, type ShapeMarkerBaseState, ShapeMarkerEditor, ShapeOutlineMarkerBase, type ShapeOutlineMarkerBaseState, ShapeOutlineMarkerEditor, SvgHelper, TextBlock, TextBlockEditor, type TextChangedHandler, TextMarker, TextMarkerEditor, type TextMarkerState, XImageMarker };
|