@glodon-aiot/dataset-annotation 3.14.0-alpha.32 → 3.15.0-alpha.1
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/es/DatasetContext/index.mjs +3 -6
- package/dist/es/components/DetectionAnnotation/components/ImageDetail/index.mjs +91 -94
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/Drawable.mjs +28 -37
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/RectLabel.mjs +101 -145
- package/dist/es/components/DetectionAnnotation/components/LabelMaker/index.mjs +195 -256
- package/dist/es/components/DetectionAnnotation/index.mjs +424 -456
- package/dist/es/components/Iconfont/index.mjs +2 -2
- package/dist/es/components/OcrAnnotation/MarkKVOCRModal/KVOCRLabelMaker/index.mjs +1 -1
- package/dist/es/components/OcrAnnotation/MarkOCRBoxModal/OCRBoxMaker/index.mjs +1 -1
- package/dist/es/components/OcrAnnotation/OcrModal/index.mjs +45 -43
- package/dist/es/components/PicZipImportModal/index.mjs +293 -308
- package/dist/es/components/PreLabelOCR/index.mjs +1 -1
- package/dist/es/constant.mjs +3 -3
- package/dist/es/featuresConfig.mjs +9 -13
- package/dist/es/index.mjs +7 -11
- package/dist/lib/index.js +3 -4
- package/dist/src/DatasetContext/index.d.ts +0 -2
- package/dist/src/components/DetectionAnnotation/components/ImageDetail/index.d.ts +0 -1
- package/dist/src/constant.d.ts +1 -1
- package/dist/src/featuresConfig.d.ts +0 -4
- package/dist/src/index.d.ts +0 -3
- package/package.json +2 -2
- package/dist/es/components/DetectionAnnotation/components/ImageModal/index.mjs +0 -129
- package/dist/es/components/DetectionAnnotation/components/ImageModal/style.less.mjs +0 -4
- package/dist/es/components/PicZipImportModal/config.mjs +0 -47
- package/dist/es/components/PicZipImportModal/pic_vlm_json_zip.svg.mjs +0 -4
- package/dist/es/components/PicZipImportModal/pic_vlm_zip.svg.mjs +0 -4
- package/dist/es/components/VLMAnnotation/RegionItem.mjs +0 -170
- package/dist/es/components/VLMAnnotation/TextAnnotationPanel.mjs +0 -94
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasDrag.mjs +0 -116
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasSetup.mjs +0 -115
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasZoom.mjs +0 -42
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useCropRegionImage.mjs +0 -55
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteControl.mjs +0 -51
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteRegion.mjs +0 -62
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.mjs +0 -421
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRControl.mjs +0 -100
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRLoadingIcon.mjs +0 -106
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRRecognition.mjs +0 -101
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionBoundaryCheck.mjs +0 -103
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionHover.mjs +0 -38
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionLoader.mjs +0 -173
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionNameText.mjs +0 -72
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.mjs +0 -116
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionUpdate.mjs +0 -98
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/hooks/useTextLayouts.mjs +0 -156
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/ai.svg.mjs +0 -4
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/del.png.mjs +0 -4
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/error.svg.mjs +0 -4
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/loading.svg.mjs +0 -4
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/icons/star.svg.mjs +0 -4
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/index.mjs +0 -651
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/style.less.mjs +0 -4
- package/dist/es/components/VLMAnnotation/VLMLabelMaker/utils/coordinateUtils.mjs +0 -33
- package/dist/es/components/VLMAnnotation/components/DragButton.mjs +0 -18
- package/dist/es/components/VLMAnnotation/components/FitToScreenButton.mjs +0 -16
- package/dist/es/components/VLMAnnotation/components/RectangleButton.mjs +0 -30
- package/dist/es/components/VLMAnnotation/components/Toolbar.mjs +0 -40
- package/dist/es/components/VLMAnnotation/components/ZoomControls.mjs +0 -44
- package/dist/es/components/VLMAnnotation/constants.mjs +0 -57
- package/dist/es/components/VLMAnnotation/index.mjs +0 -279
- package/dist/es/components/VLMAnnotation/style.less.mjs +0 -4
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.mjs +0 -343
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/style.less.mjs +0 -4
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.mjs +0 -240
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.mjs +0 -201
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/style.less.mjs +0 -4
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/index.mjs +0 -455
- package/dist/es/components/VLMAnnotationDetail/MarkVLMBoxModal/style.less.mjs +0 -4
- package/dist/es/components/VLMAnnotationDetail/VlmModal/index.mjs +0 -149
- package/dist/es/components/VLMAnnotationDetail/VlmModal/style.less.mjs +0 -4
- package/dist/es/components/VLMAnnotationDetail/index.mjs +0 -449
- package/dist/es/components/VLMAnnotationDetail/style.less.mjs +0 -4
- package/dist/es/createVlmtasetAnnotation/index.mjs +0 -131
- package/dist/src/components/DetectionAnnotation/components/ImageModal/index.d.ts +0 -34
- package/dist/src/components/Iconfont/font_4439177_tgvowh6bmlb.d.ts +0 -0
- package/dist/src/components/PicZipImportModal/config.d.ts +0 -23
- package/dist/src/components/VLMAnnotation/ImageAnnotationDebugger.d.ts +0 -4
- package/dist/src/components/VLMAnnotation/RegionItem.d.ts +0 -4
- package/dist/src/components/VLMAnnotation/TextAnnotationPanel.d.ts +0 -4
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasDrag.d.ts +0 -13
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasSetup.d.ts +0 -38
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCanvasZoom.d.ts +0 -18
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useCropRegionImage.d.ts +0 -7
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteControl.d.ts +0 -13
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDeleteRegion.d.ts +0 -22
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useDrawingMode.d.ts +0 -34
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRControl.d.ts +0 -16
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRLoadingIcon.d.ts +0 -11
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useOCRRecognition.d.ts +0 -29
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionBoundaryCheck.d.ts +0 -31
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionHover.d.ts +0 -13
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionLoader.d.ts +0 -41
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionNameText.d.ts +0 -12
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionSelection.d.ts +0 -16
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useRegionUpdate.d.ts +0 -32
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/hooks/useTextLayouts.d.ts +0 -25
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/index.d.ts +0 -4
- package/dist/src/components/VLMAnnotation/VLMLabelMaker/utils/coordinateUtils.d.ts +0 -32
- package/dist/src/components/VLMAnnotation/components/DragButton.d.ts +0 -7
- package/dist/src/components/VLMAnnotation/components/FitToScreenButton.d.ts +0 -6
- package/dist/src/components/VLMAnnotation/components/RectangleButton.d.ts +0 -7
- package/dist/src/components/VLMAnnotation/components/Toolbar.d.ts +0 -4
- package/dist/src/components/VLMAnnotation/components/ZoomControls.d.ts +0 -4
- package/dist/src/components/VLMAnnotation/constants.d.ts +0 -113
- package/dist/src/components/VLMAnnotation/index.d.ts +0 -6
- package/dist/src/components/VLMAnnotation/types.d.ts +0 -187
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/AttributeDetail/index.d.ts +0 -14
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/QAGenerationConfig.d.ts +0 -12
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/QADetail/index.d.ts +0 -12
- package/dist/src/components/VLMAnnotationDetail/MarkVLMBoxModal/index.d.ts +0 -12
- package/dist/src/components/VLMAnnotationDetail/VlmModal/index.d.ts +0 -17
- package/dist/src/components/VLMAnnotationDetail/index.d.ts +0 -6
- package/dist/src/createVlmtasetAnnotation/index.d.ts +0 -16
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
const a =
|
|
1
|
+
import { createContext as t } from "react";
|
|
2
|
+
const a = t({
|
|
3
3
|
datasetId: "",
|
|
4
4
|
versionId: "",
|
|
5
5
|
no: "",
|
|
6
6
|
loading: !1,
|
|
7
|
-
services: {}
|
|
8
|
-
token: "",
|
|
9
|
-
apiUrl: "",
|
|
10
|
-
featuresConfig: {}
|
|
7
|
+
services: {}
|
|
11
8
|
});
|
|
12
9
|
export {
|
|
13
10
|
a as default
|
|
@@ -1,169 +1,166 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var Z = Object.defineProperty, _ = Object.defineProperties;
|
|
2
|
+
var $ = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var E = Object.getOwnPropertySymbols;
|
|
4
|
+
var V = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var F = (n, t, a) => t in n ? Z(n, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[t] = a, m = (n, t) => {
|
|
6
6
|
for (var a in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var a of
|
|
10
|
-
|
|
7
|
+
V.call(t, a) && F(n, a, t[a]);
|
|
8
|
+
if (E)
|
|
9
|
+
for (var a of E(t))
|
|
10
|
+
S.call(t, a) && F(n, a, t[a]);
|
|
11
11
|
return n;
|
|
12
|
-
},
|
|
13
|
-
import { jsxs as
|
|
14
|
-
import { useRef as
|
|
15
|
-
import { Button as
|
|
16
|
-
import { useKeyPress as
|
|
12
|
+
}, N = (n, t) => _(n, $(t));
|
|
13
|
+
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
14
|
+
import { useRef as M, useState as b, useEffect as x } from "react";
|
|
15
|
+
import { Button as A } from "antd";
|
|
16
|
+
import { useKeyPress as B } from "ahooks";
|
|
17
17
|
import "./style.less.mjs";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
const
|
|
22
|
-
var
|
|
18
|
+
import ee from "../Labels/index.mjs";
|
|
19
|
+
import ie from "../LabelMaker/index.mjs";
|
|
20
|
+
import H from "../../../Iconfont/index.mjs";
|
|
21
|
+
const fe = (n) => {
|
|
22
|
+
var P, z, D;
|
|
23
23
|
const {
|
|
24
24
|
datasetId: t,
|
|
25
25
|
isImageDetailVisible: a = !0,
|
|
26
26
|
currentSample: e,
|
|
27
|
-
onNextClick:
|
|
28
|
-
onPrevClick:
|
|
27
|
+
onNextClick: h,
|
|
28
|
+
onPrevClick: g,
|
|
29
29
|
labels: d = [],
|
|
30
|
-
editing:
|
|
31
|
-
onRefresh:
|
|
32
|
-
onChange:
|
|
33
|
-
isPreLabel:
|
|
34
|
-
settingHide:
|
|
35
|
-
imgCount:
|
|
36
|
-
readonly:
|
|
37
|
-
showLabelList:
|
|
38
|
-
renderLabelItem:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}, []), g(() => {
|
|
30
|
+
editing: K,
|
|
31
|
+
onRefresh: v,
|
|
32
|
+
onChange: R,
|
|
33
|
+
isPreLabel: j,
|
|
34
|
+
settingHide: k,
|
|
35
|
+
imgCount: c,
|
|
36
|
+
readonly: O,
|
|
37
|
+
showLabelList: q = !0,
|
|
38
|
+
renderLabelItem: G
|
|
39
|
+
} = n, J = M(null), Q = M({}), [C, T] = b({}), [u, L] = b(), [o, I] = b(), [W, X] = b(!1), [U, w] = b(!1);
|
|
40
|
+
B("rightarrow", () => {
|
|
41
|
+
h && h();
|
|
42
|
+
}), B("leftarrow", () => {
|
|
43
|
+
g && g();
|
|
44
|
+
}), x(() => () => {
|
|
45
|
+
W && v && v();
|
|
46
|
+
}, []), x(() => {
|
|
48
47
|
var l, s;
|
|
49
|
-
if (
|
|
48
|
+
if (L(void 0), I(void 0), !a || !((l = e == null ? void 0 : e.labels) != null && l.length))
|
|
50
49
|
return;
|
|
51
|
-
const i = (s = o || e) == null ? void 0 : s.labels.reduce((f,
|
|
52
|
-
|
|
53
|
-
}, [a, e, o]),
|
|
54
|
-
e != null && e.fileUrl &&
|
|
55
|
-
}, [e == null ? void 0 : e.fileUrl]),
|
|
56
|
-
I && I(x);
|
|
57
|
-
}, [x, I]), g(() => {
|
|
50
|
+
const i = (s = o || e) == null ? void 0 : s.labels.reduce((f, y) => (f[y.id] ? ++f[y.id] : f[y.id] = 1, f), {});
|
|
51
|
+
T(i || {});
|
|
52
|
+
}, [a, e, o]), x(() => {
|
|
53
|
+
e != null && e.fileUrl && w(!0);
|
|
54
|
+
}, [e == null ? void 0 : e.fileUrl]), x(() => {
|
|
58
55
|
if (o != null && o.labels) {
|
|
59
56
|
const i = [];
|
|
60
57
|
o.labels.forEach((l) => {
|
|
61
58
|
const s = d.find((f) => f.id === l.id);
|
|
62
|
-
s && i.push(
|
|
59
|
+
s && i.push(N(m({}, l), {
|
|
63
60
|
label: s.label
|
|
64
61
|
}));
|
|
65
|
-
}), o.labels = i,
|
|
62
|
+
}), o.labels = i, I(m({}, o));
|
|
66
63
|
}
|
|
67
64
|
}, [d]);
|
|
68
|
-
const
|
|
69
|
-
|
|
65
|
+
const Y = () => {
|
|
66
|
+
J.current && w(!1);
|
|
70
67
|
};
|
|
71
|
-
return window.onresize =
|
|
68
|
+
return window.onresize = Y, /* @__PURE__ */ p("div", {
|
|
72
69
|
className: "detection-image-detail",
|
|
73
|
-
children: [/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ p("div", {
|
|
74
71
|
className: "detail-image",
|
|
75
|
-
children: [
|
|
72
|
+
children: [k ? /* @__PURE__ */ p("div", {
|
|
76
73
|
className: "img-detail-info",
|
|
77
|
-
children: ["第 ",
|
|
78
|
-
}) : /* @__PURE__ */
|
|
74
|
+
children: ["第 ", c == null ? void 0 : c.index, " 张 / 共 ", c == null ? void 0 : c.total, " 张"]
|
|
75
|
+
}) : /* @__PURE__ */ r("div", {
|
|
79
76
|
className: "img-detail-info",
|
|
80
|
-
children:
|
|
81
|
-
}), /* @__PURE__ */
|
|
77
|
+
children: c == null ? void 0 : c.index
|
|
78
|
+
}), /* @__PURE__ */ p("div", {
|
|
82
79
|
className: "detail-content",
|
|
83
|
-
children: [
|
|
80
|
+
children: [g && /* @__PURE__ */ r(A, {
|
|
84
81
|
className: "select-prev",
|
|
85
|
-
icon: /* @__PURE__ */
|
|
82
|
+
icon: /* @__PURE__ */ r(H, {
|
|
86
83
|
type: "icon-zuojiantou"
|
|
87
84
|
}),
|
|
88
85
|
type: "text",
|
|
89
|
-
disabled:
|
|
90
|
-
onClick: () =>
|
|
86
|
+
disabled: U,
|
|
87
|
+
onClick: () => g(),
|
|
91
88
|
tabIndex: 0
|
|
92
|
-
}), /* @__PURE__ */
|
|
89
|
+
}), /* @__PURE__ */ r("div", {
|
|
93
90
|
className: "select-main",
|
|
94
|
-
ref:
|
|
95
|
-
children:
|
|
96
|
-
|
|
97
|
-
children: e.sampleFileName.name
|
|
98
|
-
}), /* @__PURE__ */ c(le, {
|
|
99
|
-
disabled: G,
|
|
91
|
+
ref: Q,
|
|
92
|
+
children: /* @__PURE__ */ r(ie, {
|
|
93
|
+
disabled: O,
|
|
100
94
|
imageUrl: (e == null ? void 0 : e.fileUrl) || "",
|
|
101
|
-
pen:
|
|
102
|
-
labels: ((
|
|
95
|
+
pen: u,
|
|
96
|
+
labels: ((P = o ? o.labels : e == null ? void 0 : e.labels) == null ? void 0 : P.map((i) => {
|
|
103
97
|
var l;
|
|
104
|
-
return
|
|
98
|
+
return N(m({}, i), {
|
|
105
99
|
color: ((l = d.find((s) => s.id === i.id)) == null ? void 0 : l.color) || ""
|
|
106
100
|
});
|
|
107
101
|
})) || [],
|
|
108
|
-
onImageLoad: () =>
|
|
102
|
+
onImageLoad: () => w(!1),
|
|
109
103
|
onChange: (i) => {
|
|
110
|
-
if (
|
|
104
|
+
if (L(void 0), !e)
|
|
111
105
|
return;
|
|
112
|
-
const l =
|
|
106
|
+
const l = N(m({}, e), {
|
|
113
107
|
labels: i.map((s) => ({
|
|
114
108
|
id: s.id,
|
|
115
109
|
label: s.label,
|
|
116
110
|
box: s.box
|
|
117
111
|
}))
|
|
118
112
|
});
|
|
119
|
-
|
|
113
|
+
I(l), R && R(l);
|
|
120
114
|
},
|
|
121
|
-
isPreLabel:
|
|
122
|
-
renderLabelItem:
|
|
123
|
-
}
|
|
124
|
-
}),
|
|
115
|
+
isPreLabel: j,
|
|
116
|
+
renderLabelItem: G
|
|
117
|
+
})
|
|
118
|
+
}), h && /* @__PURE__ */ r(A, {
|
|
125
119
|
className: "select-next",
|
|
126
|
-
icon: /* @__PURE__ */
|
|
120
|
+
icon: /* @__PURE__ */ r(H, {
|
|
127
121
|
type: "icon-youjiantou"
|
|
128
122
|
}),
|
|
129
123
|
type: "text",
|
|
130
|
-
disabled:
|
|
131
|
-
onClick: () =>
|
|
124
|
+
disabled: U,
|
|
125
|
+
onClick: () => h()
|
|
132
126
|
})]
|
|
127
|
+
}), ((z = e == null ? void 0 : e.sampleFileName) == null ? void 0 : z.name) && /* @__PURE__ */ r("div", {
|
|
128
|
+
className: "img-detail-info",
|
|
129
|
+
children: e.sampleFileName.name
|
|
133
130
|
})]
|
|
134
|
-
}), (!!(d != null && d.length) ||
|
|
131
|
+
}), (!!(d != null && d.length) || K) && q && /* @__PURE__ */ r("div", {
|
|
135
132
|
className: "detail-slide",
|
|
136
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ r(ee, {
|
|
137
134
|
datasetId: t,
|
|
138
135
|
selectMode: "single",
|
|
139
|
-
data: ((
|
|
136
|
+
data: ((D = Object.keys(C)) == null ? void 0 : D.map((i) => {
|
|
140
137
|
const l = d.find((s) => s.id === i);
|
|
141
138
|
if (l)
|
|
142
|
-
return l.count =
|
|
139
|
+
return l.count = C[i], l;
|
|
143
140
|
}).filter((i) => !!i)) || [],
|
|
144
141
|
shortcut: !0,
|
|
145
|
-
selected:
|
|
142
|
+
selected: u ? [u] : [],
|
|
146
143
|
onSelectedChange: (i) => {
|
|
147
144
|
if (i.length > 2) {
|
|
148
145
|
console.warn("不支持选中多个标签");
|
|
149
146
|
return;
|
|
150
147
|
}
|
|
151
148
|
if (!i.length) {
|
|
152
|
-
|
|
149
|
+
L(void 0);
|
|
153
150
|
return;
|
|
154
151
|
}
|
|
155
152
|
const l = d == null ? void 0 : d.find((s) => i[0].label === s.label);
|
|
156
|
-
|
|
153
|
+
L(l);
|
|
157
154
|
},
|
|
158
155
|
onListChange: () => {
|
|
159
|
-
|
|
156
|
+
X(!0), v && v();
|
|
160
157
|
},
|
|
161
|
-
isPreLabel:
|
|
162
|
-
settingHide:
|
|
158
|
+
isPreLabel: j,
|
|
159
|
+
settingHide: k
|
|
163
160
|
})
|
|
164
161
|
})]
|
|
165
162
|
});
|
|
166
163
|
};
|
|
167
164
|
export {
|
|
168
|
-
|
|
165
|
+
fe as default
|
|
169
166
|
};
|
|
@@ -1,54 +1,45 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
let h = -1, s = -1,
|
|
4
|
-
e.on("mouse:down
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
function I(e, u) {
|
|
2
|
+
y(e);
|
|
3
|
+
let h = -1, s = -1, n = 0, p = 0;
|
|
4
|
+
e.on("mouse:down", (g) => {
|
|
5
|
+
h = -1, s = -1, n = 0, p = 0;
|
|
6
|
+
const i = e.getZoom();
|
|
7
|
+
s = g.e.offsetX / i, h = g.e.offsetY / i;
|
|
8
|
+
}), e.on("mouse:up", (g) => {
|
|
9
|
+
if (s === -1 && h === -1)
|
|
8
10
|
return;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}), e.on("mouse:down", (d) => {
|
|
12
|
-
if (!e.skipTargetFind)
|
|
11
|
+
const i = e.getZoom(), m = g.e.offsetX > e.getWidth() ? e.getWidth() / i : g.e.offsetX / i, w = g.e.offsetY > e.getHeight() ? e.getHeight() / i : g.e.offsetY / i;
|
|
12
|
+
if (n = Math.abs(m - s), p = Math.abs(w - h), n === 0 || p === 0)
|
|
13
13
|
return;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return;
|
|
20
|
-
const f = e.getZoom(), u = d.e.offsetX > e.getWidth() ? e.getWidth() / f : d.e.offsetX / f, b = d.e.offsetY > e.getHeight() ? e.getHeight() / f : d.e.offsetY / f;
|
|
21
|
-
if (p = Math.abs(u - s), m = Math.abs(b - h), p === 0 || m === 0)
|
|
22
|
-
return;
|
|
23
|
-
const y = e.viewportTransform ? e.viewportTransform[4] / f : 0, A = e.viewportTransform ? e.viewportTransform[5] / f : 0;
|
|
24
|
-
let r = h > b ? b : h, i = s > u ? u : s, l = p, g = m;
|
|
25
|
-
r = r - A, i = i - y;
|
|
26
|
-
const F = () => {
|
|
27
|
-
var o, k;
|
|
14
|
+
const T = e.viewportTransform ? e.viewportTransform[4] / i : 0, X = e.viewportTransform ? e.viewportTransform[5] / i : 0;
|
|
15
|
+
let f = h > w ? w : h, r = s > m ? m : s, l = n, d = p;
|
|
16
|
+
f = f - X, r = r - T;
|
|
17
|
+
const Y = () => {
|
|
18
|
+
var o, b;
|
|
28
19
|
const t = e.backgroundImage;
|
|
29
|
-
t && typeof t != "string" && ((o = t.aCoords) != null && o.tl.x, (
|
|
30
|
-
},
|
|
20
|
+
t && typeof t != "string" && ((o = t.aCoords) != null && o.tl.x, (b = t.aCoords) != null && b.tl.y), t && typeof t != "string" && t.top !== void 0 && t.height !== void 0 && t.left !== void 0 && t.width !== void 0 && (f < t.top && (d = d - (t.top - f), f = t.top), f + d > t.top + t.height && (d = t.top + t.height - f + d - d, f = t.height + t.top - d), r < t.left && (l = l - (t.left - r), r = t.left), r + l > t.left + t.width && (l = t.left + t.width - r + l - l, r = t.width + t.left - l));
|
|
21
|
+
}, k = (t) => {
|
|
31
22
|
const o = e.backgroundImage;
|
|
32
23
|
return !(o && typeof o != "string" && o.top !== void 0 && o.height !== void 0 && o.left !== void 0 && o.width !== void 0 && (t[0] < o.left || t[1] < o.top || t[0] > o.left + o.width || t[1] > o.top + o.height));
|
|
33
24
|
};
|
|
34
|
-
|
|
35
|
-
const c = [[
|
|
36
|
-
|
|
25
|
+
Y();
|
|
26
|
+
const c = [[r, f], [r + l, f], [r + l, f + d], [r, f + d]];
|
|
27
|
+
u && c.every((t) => k(t)) && u({
|
|
37
28
|
id: "",
|
|
38
29
|
color: "#cccccc",
|
|
39
30
|
label: "未知",
|
|
40
31
|
box: c
|
|
41
|
-
}),
|
|
32
|
+
}), e.skipTargetFind = !1, y(e);
|
|
42
33
|
});
|
|
43
34
|
}
|
|
44
|
-
const
|
|
45
|
-
e.off("mouse:down"), e.off("mouse:
|
|
35
|
+
const y = (e) => {
|
|
36
|
+
e.off("mouse:down"), e.off("mouse:up");
|
|
46
37
|
};
|
|
47
|
-
function
|
|
38
|
+
function x(e, u, h) {
|
|
48
39
|
if (!h)
|
|
49
|
-
return
|
|
40
|
+
return I(e, u), e;
|
|
50
41
|
}
|
|
51
42
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
43
|
+
x as drawable,
|
|
44
|
+
y as stopDraw
|
|
54
45
|
};
|