@inweb/viewer-visualize 25.7.2 → 25.7.4
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/viewer-visualize.js +7358 -7450
- package/dist/viewer-visualize.js.map +1 -1
- package/dist/viewer-visualize.min.js +1 -1
- package/dist/viewer-visualize.module.js +3755 -3755
- package/dist/viewer-visualize.module.js.map +1 -1
- package/lib/Viewer/Markup/MarkupFactory.d.ts +1 -1
- package/lib/Viewer/Markup/{Impl/Visualize → Visualize}/VisualizeMarkup.d.ts +1 -3
- package/lib/Viewer/Viewer.d.ts +1 -2
- package/lib/index.d.ts +1 -11
- package/package.json +5 -12
- package/src/Viewer/Markup/MarkupFactory.ts +2 -3
- package/src/Viewer/Markup/{Impl/Visualize → Visualize}/VisualizeMarkup.ts +4 -6
- package/src/Viewer/Viewer.ts +1 -2
- package/src/index.ts +1 -11
- package/lib/Viewer/Markup/Api/IMarkupArrow.d.ts +0 -52
- package/lib/Viewer/Markup/Api/IMarkupCloud.d.ts +0 -50
- package/lib/Viewer/Markup/Api/IMarkupColorable.d.ts +0 -15
- package/lib/Viewer/Markup/Api/IMarkupEllipse.d.ts +0 -50
- package/lib/Viewer/Markup/Api/IMarkupImage.d.ts +0 -50
- package/lib/Viewer/Markup/Api/IMarkupLine.d.ts +0 -43
- package/lib/Viewer/Markup/Api/IMarkupObject.d.ts +0 -47
- package/lib/Viewer/Markup/Api/IMarkupRectangle.d.ts +0 -50
- package/lib/Viewer/Markup/Api/IMarkupText.d.ts +0 -40
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaArrow.d.ts +0 -46
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaCloud.d.ts +0 -35
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.d.ts +0 -40
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaImage.d.ts +0 -36
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaLine.d.ts +0 -35
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.d.ts +0 -38
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaText.d.ts +0 -37
- package/lib/Viewer/Markup/IMarkup.d.ts +0 -130
- package/lib/Viewer/Markup/IWorldTransform.d.ts +0 -39
- package/lib/Viewer/Markup/Impl/Konva/KonvaMarkup.d.ts +0 -82
- package/lib/Viewer/Markup/Impl/Konva/MarkupColor.d.ts +0 -38
- package/src/Viewer/Markup/Api/IMarkupArrow.ts +0 -69
- package/src/Viewer/Markup/Api/IMarkupCloud.ts +0 -78
- package/src/Viewer/Markup/Api/IMarkupColorable.ts +0 -39
- package/src/Viewer/Markup/Api/IMarkupEllipse.ts +0 -78
- package/src/Viewer/Markup/Api/IMarkupImage.ts +0 -78
- package/src/Viewer/Markup/Api/IMarkupLine.ts +0 -70
- package/src/Viewer/Markup/Api/IMarkupObject.ts +0 -78
- package/src/Viewer/Markup/Api/IMarkupRectangle.ts +0 -78
- package/src/Viewer/Markup/Api/IMarkupText.ts +0 -66
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaArrow.ts +0 -147
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaCloud.ts +0 -213
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.ts +0 -150
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaImage.ts +0 -149
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaLine.ts +0 -136
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.ts +0 -149
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaText.ts +0 -141
- package/src/Viewer/Markup/IMarkup.ts +0 -173
- package/src/Viewer/Markup/IWorldTransform.ts +0 -46
- package/src/Viewer/Markup/Impl/Konva/KonvaMarkup.ts +0 -1264
- package/src/Viewer/Markup/Impl/Konva/MarkupColor.ts +0 -82
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
-
// All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This software and its documentation and related materials are owned by
|
|
6
|
-
// the Alliance. The software may only be incorporated into application
|
|
7
|
-
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
-
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
-
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
-
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
-
// protected by copyright law and international treaty provisions. Application
|
|
12
|
-
// programs incorporating this software must include the following statement
|
|
13
|
-
// with their copyright notices:
|
|
14
|
-
//
|
|
15
|
-
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
-
// license agreement with Open Design Alliance.
|
|
17
|
-
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
-
// All rights reserved.
|
|
19
|
-
//
|
|
20
|
-
// By use of this software, its documentation or related materials, you
|
|
21
|
-
// acknowledge and accept the above terms.
|
|
22
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
-
|
|
24
|
-
import { IMarkupObject } from "./IMarkupObject";
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Ellipse Markup object
|
|
28
|
-
*/
|
|
29
|
-
export interface IMarkupEllipse extends IMarkupObject {
|
|
30
|
-
/**
|
|
31
|
-
* Get position of the Ellipse
|
|
32
|
-
*/
|
|
33
|
-
getPosition(): { x: number; y: number };
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Set position of the Ellipse
|
|
37
|
-
*
|
|
38
|
-
* @param x - value of X coordinate
|
|
39
|
-
* @param y - value of Y coordinate
|
|
40
|
-
*/
|
|
41
|
-
setPosition(x: number, y: number);
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Get X radius of the Ellipse
|
|
45
|
-
*/
|
|
46
|
-
getRadiusX(): number;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Set X radius of the Ellipse
|
|
50
|
-
*
|
|
51
|
-
* @param r - value of X radius of the Ellipse
|
|
52
|
-
*/
|
|
53
|
-
setRadiusX(r: number);
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get Y radius of the Ellipse
|
|
57
|
-
*/
|
|
58
|
-
getRadiusY(): number;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Set Y radius of the Ellipse
|
|
62
|
-
*
|
|
63
|
-
* @param r - value of Y radius of the Ellipse
|
|
64
|
-
*/
|
|
65
|
-
setRadiusY(r: number);
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Get line width of the Ellipse. Defailt is 4
|
|
69
|
-
*/
|
|
70
|
-
getLineWidth(): number;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Set line width of the Ellipse. Default is 4
|
|
74
|
-
*
|
|
75
|
-
* @param size - value of width
|
|
76
|
-
*/
|
|
77
|
-
setLineWidth(size: number);
|
|
78
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
-
// All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This software and its documentation and related materials are owned by
|
|
6
|
-
// the Alliance. The software may only be incorporated into application
|
|
7
|
-
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
-
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
-
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
-
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
-
// protected by copyright law and international treaty provisions. Application
|
|
12
|
-
// programs incorporating this software must include the following statement
|
|
13
|
-
// with their copyright notices:
|
|
14
|
-
//
|
|
15
|
-
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
-
// license agreement with Open Design Alliance.
|
|
17
|
-
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
-
// All rights reserved.
|
|
19
|
-
//
|
|
20
|
-
// By use of this software, its documentation or related materials, you
|
|
21
|
-
// acknowledge and accept the above terms.
|
|
22
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
-
|
|
24
|
-
import { IMarkupObject } from "./IMarkupObject";
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Image Markup object
|
|
28
|
-
*/
|
|
29
|
-
export interface IMarkupImage extends IMarkupObject {
|
|
30
|
-
/**
|
|
31
|
-
* Get position of the Image
|
|
32
|
-
*/
|
|
33
|
-
getPosition(): { x: number; y: number };
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Set position of the Image
|
|
37
|
-
*
|
|
38
|
-
* @param x - value of X coordinate
|
|
39
|
-
* @param y - value of Y coordinate
|
|
40
|
-
*/
|
|
41
|
-
setPosition(x: number, y: number);
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Get source of the Image. Provides base64 string
|
|
45
|
-
*/
|
|
46
|
-
getSrc(): string;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Set source of the Image
|
|
50
|
-
*
|
|
51
|
-
* @param src - string in base64 format
|
|
52
|
-
*/
|
|
53
|
-
setSrc(src: string);
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get width of the Image
|
|
57
|
-
*/
|
|
58
|
-
getWidth(): number;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Set width of the Image
|
|
62
|
-
*
|
|
63
|
-
* @param w - value of width. Height will be automatically updated according to ratio of the Image
|
|
64
|
-
*/
|
|
65
|
-
setWidth(w: number);
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Get height of the Image
|
|
69
|
-
*/
|
|
70
|
-
getHeight(): number;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Set height of the Image
|
|
74
|
-
*
|
|
75
|
-
* @param h - value of height. Width will be automatically updated according to ratio of the Image
|
|
76
|
-
*/
|
|
77
|
-
setHeight(h: number);
|
|
78
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
-
// All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This software and its documentation and related materials are owned by
|
|
6
|
-
// the Alliance. The software may only be incorporated into application
|
|
7
|
-
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
-
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
-
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
-
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
-
// protected by copyright law and international treaty provisions. Application
|
|
12
|
-
// programs incorporating this software must include the following statement
|
|
13
|
-
// with their copyright notices:
|
|
14
|
-
//
|
|
15
|
-
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
-
// license agreement with Open Design Alliance.
|
|
17
|
-
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
-
// All rights reserved.
|
|
19
|
-
//
|
|
20
|
-
// By use of this software, its documentation or related materials, you
|
|
21
|
-
// acknowledge and accept the above terms.
|
|
22
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
-
|
|
24
|
-
import { IMarkupObject } from "./IMarkupObject";
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Type of the markup line.
|
|
28
|
-
*/
|
|
29
|
-
export type MarkupLineType = "solid" | "dot" | "dash";
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Line Markup object
|
|
33
|
-
*/
|
|
34
|
-
export interface IMarkupLine extends IMarkupObject {
|
|
35
|
-
/**
|
|
36
|
-
* Get points of the Line
|
|
37
|
-
*/
|
|
38
|
-
getPoints(): number[];
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Get Line width. Default value is 4
|
|
42
|
-
*/
|
|
43
|
-
getLineWidth(): number;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Set Line width. Default value is 4
|
|
47
|
-
*
|
|
48
|
-
* @param size - value of width
|
|
49
|
-
*/
|
|
50
|
-
setLineWidth(size: number);
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Get Type of the Line. Available values: `solid`, `dot`, `dash`. Default is `solid`
|
|
54
|
-
*/
|
|
55
|
-
getLineType(): string;
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Set Type of the Line. Available values: `solid`, `dot`, `dash`. Default is `solid`
|
|
59
|
-
*
|
|
60
|
-
* @param type
|
|
61
|
-
*/
|
|
62
|
-
setLineType(type: string);
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Add points to the Line
|
|
66
|
-
*
|
|
67
|
-
* @param {{ x: number; y: number }} points array of points
|
|
68
|
-
*/
|
|
69
|
-
addPoints(points: [{ x: number; y: number }]);
|
|
70
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
-
// All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This software and its documentation and related materials are owned by
|
|
6
|
-
// the Alliance. The software may only be incorporated into application
|
|
7
|
-
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
-
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
-
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
-
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
-
// protected by copyright law and international treaty provisions. Application
|
|
12
|
-
// programs incorporating this software must include the following statement
|
|
13
|
-
// with their copyright notices:
|
|
14
|
-
//
|
|
15
|
-
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
-
// license agreement with Open Design Alliance.
|
|
17
|
-
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
-
// All rights reserved.
|
|
19
|
-
//
|
|
20
|
-
// By use of this software, its documentation or related materials, you
|
|
21
|
-
// acknowledge and accept the above terms.
|
|
22
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Markup object
|
|
26
|
-
*/
|
|
27
|
-
export interface IMarkupObject {
|
|
28
|
-
/**
|
|
29
|
-
* Link to Library object (Konva, VisualizeJS)
|
|
30
|
-
*/
|
|
31
|
-
ref(): any;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Get an internal identificator of the object. Not unique
|
|
35
|
-
*/
|
|
36
|
-
id(): string;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Set Mouse editing feature
|
|
40
|
-
*
|
|
41
|
-
* @param value true / false
|
|
42
|
-
*/
|
|
43
|
-
enableMouseEditing(value: boolean);
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Get type of the Markup object
|
|
47
|
-
*/
|
|
48
|
-
type(): string;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Get rotation of the Markup object
|
|
52
|
-
*/
|
|
53
|
-
getRotation(): number;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Set rotation of the Markup object
|
|
57
|
-
*
|
|
58
|
-
* @param degrees number of degress to rotate
|
|
59
|
-
*/
|
|
60
|
-
setRotation(degrees: number): void;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Get Z-Index of the Markup object
|
|
64
|
-
*/
|
|
65
|
-
getZIndex(): number;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Set Z-Index of the Markup object
|
|
69
|
-
*
|
|
70
|
-
* @param zIndex integer value of Z-Index
|
|
71
|
-
*/
|
|
72
|
-
setZIndex(zIndex: number): void;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Delete current Markup object
|
|
76
|
-
*/
|
|
77
|
-
delete(): void;
|
|
78
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
-
// All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This software and its documentation and related materials are owned by
|
|
6
|
-
// the Alliance. The software may only be incorporated into application
|
|
7
|
-
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
-
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
-
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
-
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
-
// protected by copyright law and international treaty provisions. Application
|
|
12
|
-
// programs incorporating this software must include the following statement
|
|
13
|
-
// with their copyright notices:
|
|
14
|
-
//
|
|
15
|
-
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
-
// license agreement with Open Design Alliance.
|
|
17
|
-
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
-
// All rights reserved.
|
|
19
|
-
//
|
|
20
|
-
// By use of this software, its documentation or related materials, you
|
|
21
|
-
// acknowledge and accept the above terms.
|
|
22
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
-
|
|
24
|
-
import { IMarkupObject } from "./IMarkupObject";
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Rectangle Markup object
|
|
28
|
-
*/
|
|
29
|
-
export interface IMarkupRectangle extends IMarkupObject {
|
|
30
|
-
/**
|
|
31
|
-
* Get position of the Rectangle
|
|
32
|
-
*/
|
|
33
|
-
getPosition(): { x: number; y: number };
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Set position of the Rectangle
|
|
37
|
-
*
|
|
38
|
-
* @param x - value of X coordinate
|
|
39
|
-
* @param y - value of Y coordinate
|
|
40
|
-
*/
|
|
41
|
-
setPosition(x: number, y: number);
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Get width of the Rectangle. Default value is 200
|
|
45
|
-
*/
|
|
46
|
-
getWidth(): number;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Set width of the Rectangle
|
|
50
|
-
*
|
|
51
|
-
* @param w - value of width. Default value is 200
|
|
52
|
-
*/
|
|
53
|
-
setWidth(w: number);
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get height of the Rectangle. Default value is 200
|
|
57
|
-
*/
|
|
58
|
-
getHeigth(): number;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Set height of the Rectangle
|
|
62
|
-
*
|
|
63
|
-
* @param h - value of height. Default value is 200
|
|
64
|
-
*/
|
|
65
|
-
setHeight(h: number);
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Get line width of the Rectangle. Defailt value is 4
|
|
69
|
-
*/
|
|
70
|
-
getLineWidth(): number;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Set line width of the Rectangle
|
|
74
|
-
*
|
|
75
|
-
* @param size - value of width. Defailt value is 4
|
|
76
|
-
*/
|
|
77
|
-
setLineWidth(size: number);
|
|
78
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
-
// All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This software and its documentation and related materials are owned by
|
|
6
|
-
// the Alliance. The software may only be incorporated into application
|
|
7
|
-
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
-
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
-
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
-
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
-
// protected by copyright law and international treaty provisions. Application
|
|
12
|
-
// programs incorporating this software must include the following statement
|
|
13
|
-
// with their copyright notices:
|
|
14
|
-
//
|
|
15
|
-
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
-
// license agreement with Open Design Alliance.
|
|
17
|
-
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
-
// All rights reserved.
|
|
19
|
-
//
|
|
20
|
-
// By use of this software, its documentation or related materials, you
|
|
21
|
-
// acknowledge and accept the above terms.
|
|
22
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
-
|
|
24
|
-
import { IMarkupObject } from "./IMarkupObject";
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Text Markup object
|
|
28
|
-
*/
|
|
29
|
-
export interface IMarkupText extends IMarkupObject {
|
|
30
|
-
/**
|
|
31
|
-
* Get Text value
|
|
32
|
-
*/
|
|
33
|
-
getText(): string;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Set Text value
|
|
37
|
-
*
|
|
38
|
-
* @param text - string value
|
|
39
|
-
*/
|
|
40
|
-
setText(text: string): void;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Get position of the Text
|
|
44
|
-
*/
|
|
45
|
-
getPosition(): { x: number; y: number };
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Set position of the Text
|
|
49
|
-
*
|
|
50
|
-
* @param x - value of X coordinate
|
|
51
|
-
* @param y - value of Y coordinate
|
|
52
|
-
*/
|
|
53
|
-
setPosition(x: number, y: number);
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get font size. Default value is 34
|
|
57
|
-
*/
|
|
58
|
-
getFontSize();
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Set font size. Default value is 34
|
|
62
|
-
*
|
|
63
|
-
* @param size
|
|
64
|
-
*/
|
|
65
|
-
setFontSize(size: number);
|
|
66
|
-
}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
|
|
3
|
-
// All rights reserved.
|
|
4
|
-
//
|
|
5
|
-
// This software and its documentation and related materials are owned by
|
|
6
|
-
// the Alliance. The software may only be incorporated into application
|
|
7
|
-
// programs owned by members of the Alliance, subject to a signed
|
|
8
|
-
// Membership Agreement and Supplemental Software License Agreement with the
|
|
9
|
-
// Alliance. The structure and organization of this software are the valuable
|
|
10
|
-
// trade secrets of the Alliance and its suppliers. The software is also
|
|
11
|
-
// protected by copyright law and international treaty provisions. Application
|
|
12
|
-
// programs incorporating this software must include the following statement
|
|
13
|
-
// with their copyright notices:
|
|
14
|
-
//
|
|
15
|
-
// This application incorporates Open Design Alliance software pursuant to a
|
|
16
|
-
// license agreement with Open Design Alliance.
|
|
17
|
-
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
|
|
18
|
-
// All rights reserved.
|
|
19
|
-
//
|
|
20
|
-
// By use of this software, its documentation or related materials, you
|
|
21
|
-
// acknowledge and accept the above terms.
|
|
22
|
-
///////////////////////////////////////////////////////////////////////////////
|
|
23
|
-
|
|
24
|
-
import Konva from "konva";
|
|
25
|
-
import { IMarkupArrow } from "../../IMarkupArrow";
|
|
26
|
-
import { IMarkupColorable } from "../../IMarkupColorable";
|
|
27
|
-
|
|
28
|
-
export class KonvaArrow implements IMarkupArrow, IMarkupColorable {
|
|
29
|
-
private _ref: Konva.Arrow;
|
|
30
|
-
|
|
31
|
-
constructor(
|
|
32
|
-
params: {
|
|
33
|
-
start: { x: number; y: number };
|
|
34
|
-
end: { x: number; y: number };
|
|
35
|
-
color?: string;
|
|
36
|
-
id?: string;
|
|
37
|
-
},
|
|
38
|
-
ref = null
|
|
39
|
-
) {
|
|
40
|
-
if (ref) {
|
|
41
|
-
this._ref = ref;
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (!params.start || !params.end) return;
|
|
46
|
-
|
|
47
|
-
this._ref = new Konva.Arrow({
|
|
48
|
-
stroke: params.color ?? "#ff0000",
|
|
49
|
-
fill: params.color ?? "#ff0000",
|
|
50
|
-
strokeWidth: 4,
|
|
51
|
-
globalCompositeOperation: "source-over",
|
|
52
|
-
lineCap: "round",
|
|
53
|
-
lineJoin: "round",
|
|
54
|
-
points: [params.start.x, params.start.y, params.end.x, params.end.y],
|
|
55
|
-
draggable: true,
|
|
56
|
-
strokeScaleEnabled: false,
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
this._ref.on("transform", (e) => {
|
|
60
|
-
const attrs = e.target.attrs;
|
|
61
|
-
|
|
62
|
-
if (attrs.rotation !== this._ref.rotation()) this._ref.rotation(attrs.rotation);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
this._ref.id(this._ref._id.toString());
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
ref() {
|
|
69
|
-
return this._ref;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
id(): string {
|
|
73
|
-
return this._ref.id();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
enableMouseEditing(value: boolean) {
|
|
77
|
-
this._ref.draggable(value);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
type(): string {
|
|
81
|
-
return "arrow";
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
getColor(): string {
|
|
85
|
-
return this._ref.stroke() as string;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
setColor(hex: string) {
|
|
89
|
-
this._ref.stroke(hex);
|
|
90
|
-
this._ref.fill(hex);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
getRotation(): number {
|
|
94
|
-
return this._ref.rotation();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
setRotation(degrees: number): void {
|
|
98
|
-
this._ref.rotation(degrees);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
getZIndex(): number {
|
|
102
|
-
return this._ref.zIndex();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
setZIndex(zIndex: number): void {
|
|
106
|
-
this._ref.zIndex(zIndex);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
delete() {
|
|
110
|
-
this._ref.destroy();
|
|
111
|
-
this._ref = null;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
getPoints(): { x: number; y: number }[] {
|
|
115
|
-
const points = this._ref.points();
|
|
116
|
-
return [
|
|
117
|
-
{ x: points[0], y: points[1] },
|
|
118
|
-
{ x: points[2], y: points[3] },
|
|
119
|
-
];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
setPoints(points: { x: number; y: number }[]) {
|
|
123
|
-
if (points.length === 2) {
|
|
124
|
-
this._ref.points([points[0].x, points[0].y, points[1].x, points[1].y]);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
getStartPoint(): { x: number; y: number } {
|
|
129
|
-
const points = this._ref.points();
|
|
130
|
-
return { x: points[0], y: points[1] };
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
setStartPoint(x: number, y: number) {
|
|
134
|
-
const points = this._ref.points();
|
|
135
|
-
this._ref.points([x, y, points[2], points[3]]);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
getEndPoint(): { x: number; y: number } {
|
|
139
|
-
const points = this._ref.points();
|
|
140
|
-
return { x: points[2], y: points[3] };
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
setEndPoint(x: number, y: number) {
|
|
144
|
-
const points = this._ref.points();
|
|
145
|
-
this._ref.points([points[0], points[1], x, y]);
|
|
146
|
-
}
|
|
147
|
-
}
|