react-image-annotate-master-custom 0.0.24 → 0.0.26
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/HighlightBox/index.js +41 -10
- package/RegionShapes/index.js +6 -4
- package/RegionTags/index.js +1 -1
- package/package.json +1 -1
package/HighlightBox/index.js
CHANGED
|
@@ -3,6 +3,33 @@ import React from "react";
|
|
|
3
3
|
import classnames from "classnames";
|
|
4
4
|
import { makeStyles } from "@mui/styles";
|
|
5
5
|
import { createTheme, ThemeProvider } from "@mui/material/styles";
|
|
6
|
+
import colorAlpha from "color-alpha";
|
|
7
|
+
|
|
8
|
+
var caculateFilterColor = function caculateFilterColor(regionColor) {
|
|
9
|
+
switch (regionColor) {
|
|
10
|
+
case "#adb5bd":
|
|
11
|
+
return "brightness(0) saturate(100%) invert(84%) sepia(2%) saturate(1428%) hue-rotate(171deg) brightness(89%) contrast(84%)";
|
|
12
|
+
|
|
13
|
+
case "#f1ea1e":
|
|
14
|
+
return "brightness(0) saturate(100%) invert(86%) sepia(71%) saturate(891%) hue-rotate(343deg) brightness(105%) contrast(89%)";
|
|
15
|
+
|
|
16
|
+
case "#f90":
|
|
17
|
+
return "brightness(0) saturate(100%) invert(75%) sepia(61%) saturate(4638%) hue-rotate(360deg) brightness(102%) contrast(106%)";
|
|
18
|
+
|
|
19
|
+
case "#4a86e8":
|
|
20
|
+
return "brightness(0) saturate(100%) invert(51%) sepia(28%) saturate(3560%) hue-rotate(198deg) brightness(92%) contrast(97%)";
|
|
21
|
+
|
|
22
|
+
case "#ff0000":
|
|
23
|
+
return "brightness(0) saturate(100%) invert(27%) sepia(97%) saturate(7273%) hue-rotate(357deg) brightness(95%) contrast(114%)";
|
|
24
|
+
|
|
25
|
+
case "#00ff00":
|
|
26
|
+
return "brightness(0) saturate(100%) invert(78%) sepia(71%) saturate(6219%) hue-rotate(85deg) brightness(122%) contrast(121%)";
|
|
27
|
+
|
|
28
|
+
default:
|
|
29
|
+
return "invert(40%) sepia(50%) saturate(1928%) hue-rotate(350deg) brightness(94%) contrast(89%)";
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
6
33
|
var theme = createTheme();
|
|
7
34
|
var useStyles = makeStyles(function (theme) {
|
|
8
35
|
return {
|
|
@@ -15,12 +42,10 @@ var useStyles = makeStyles(function (theme) {
|
|
|
15
42
|
}
|
|
16
43
|
},
|
|
17
44
|
highlightLight: {
|
|
18
|
-
zIndex:
|
|
45
|
+
zIndex: 4,
|
|
19
46
|
transition: "opacity 500ms",
|
|
20
|
-
"&.highlighted": {
|
|
21
|
-
|
|
22
|
-
filter: "invert(40%) sepia(50%) saturate(1928%) hue-rotate(350deg) brightness(94%) contrast(89%)" //customize
|
|
23
|
-
|
|
47
|
+
"&.highlighted": {// zIndex: 2,
|
|
48
|
+
// filter: "invert(40%) sepia(50%) saturate(1928%) hue-rotate(350deg) brightness(94%) contrast(89%)",
|
|
24
49
|
},
|
|
25
50
|
"&:not(.highlighted)": {
|
|
26
51
|
opacity: 0
|
|
@@ -29,9 +54,9 @@ var useStyles = makeStyles(function (theme) {
|
|
|
29
54
|
// opacity: 0.6,
|
|
30
55
|
// },
|
|
31
56
|
"& path": {
|
|
32
|
-
vectorEffect: "non-scaling-stroke",
|
|
57
|
+
// vectorEffect: "non-scaling-stroke",
|
|
33
58
|
strokeWidth: 2,
|
|
34
|
-
stroke: "#FFF",
|
|
59
|
+
// stroke: "#FFF",
|
|
35
60
|
fill: "none",
|
|
36
61
|
strokeDasharray: "none",
|
|
37
62
|
animationName: "$borderDance",
|
|
@@ -105,7 +130,9 @@ export var HighlightBox = function HighlightBox(_ref) {
|
|
|
105
130
|
position: "absolute"
|
|
106
131
|
}, styleCoordsHorizontal)
|
|
107
132
|
}), React.createElement("path", {
|
|
108
|
-
d: pathDHorizontal
|
|
133
|
+
d: pathDHorizontal,
|
|
134
|
+
stroke: colorAlpha((r === null || r === void 0 ? void 0 : r.color) || "#E45B21", 1),
|
|
135
|
+
fill: colorAlpha((r === null || r === void 0 ? void 0 : r.color) || "#E45B21", 1)
|
|
109
136
|
})), React.createElement("svg", Object.assign({
|
|
110
137
|
key: "".concat(r.id, "-vertical"),
|
|
111
138
|
id: "".concat(r.id, "-vertical"),
|
|
@@ -119,7 +146,9 @@ export var HighlightBox = function HighlightBox(_ref) {
|
|
|
119
146
|
position: "absolute"
|
|
120
147
|
}, styleCoordsVertical)
|
|
121
148
|
}), React.createElement("path", {
|
|
122
|
-
d: pathDVertical
|
|
149
|
+
d: pathDVertical,
|
|
150
|
+
stroke: colorAlpha((r === null || r === void 0 ? void 0 : r.color) || "#E45B21", 1),
|
|
151
|
+
fill: colorAlpha((r === null || r === void 0 ? void 0 : r.color) || "#E45B21", 1)
|
|
123
152
|
})), React.createElement("svg", Object.assign({
|
|
124
153
|
key: "".concat(r.id),
|
|
125
154
|
id: "".concat(r.id),
|
|
@@ -153,7 +182,9 @@ export var HighlightBox = function HighlightBox(_ref) {
|
|
|
153
182
|
d: pathD,
|
|
154
183
|
style: {
|
|
155
184
|
strokeDasharray: 5
|
|
156
|
-
}
|
|
185
|
+
},
|
|
186
|
+
stroke: colorAlpha((r === null || r === void 0 ? void 0 : r.color) || "#E45B21", 1),
|
|
187
|
+
fill: colorAlpha((r === null || r === void 0 ? void 0 : r.color) || "#E45B21", 1)
|
|
157
188
|
})));
|
|
158
189
|
};
|
|
159
190
|
export default HighlightBox;
|
package/RegionShapes/index.js
CHANGED
|
@@ -18,11 +18,13 @@ var RegionComponents = {
|
|
|
18
18
|
d: "M 1.866 12.7018 C 4.234 9.7951 9.486 2.7501 9.486 -1.207 C 9.486 -6.0063 5.5922 -9.9 0.793 -9.9 S -7.9 -6.0063 -7.9 -1.207 c 0 3.9571 5.2973 11.0021 7.62 13.9088 c 0.5569 0.6927 1.5892 0.6927 2.1461 0 z M 0.793 -4.1047 A 2.8977 2.8977 90 1 1 0.793 1.6907 a 2.8977 2.8977 90 1 1 0 -5.7953 z",
|
|
19
19
|
style: {
|
|
20
20
|
position: "absolute",
|
|
21
|
-
zIndex:
|
|
21
|
+
zIndex: 1
|
|
22
22
|
},
|
|
23
|
-
strokeWidth: 2
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
strokeWidth: 2 // stroke="#E45B21"
|
|
24
|
+
// fill="#E45B21"
|
|
25
|
+
,
|
|
26
|
+
stroke: colorAlpha((region === null || region === void 0 ? void 0 : region.color) || "#E45B21", 1),
|
|
27
|
+
fill: colorAlpha((region === null || region === void 0 ? void 0 : region.color) || "#E45B21", 1)
|
|
26
28
|
}));
|
|
27
29
|
}),
|
|
28
30
|
line: memo(function (_ref2) {
|
package/RegionTags/index.js
CHANGED
|
@@ -42,7 +42,7 @@ export var RegionTags = function RegionTags(_ref) {
|
|
|
42
42
|
var _layoutParams$current = layoutParams.current,
|
|
43
43
|
iw = _layoutParams$current.iw,
|
|
44
44
|
ih = _layoutParams$current.ih;
|
|
45
|
-
var margin =
|
|
45
|
+
var margin = 0;
|
|
46
46
|
if (region.highlighted && region.type === "box") margin += 6;
|
|
47
47
|
var labelBoxHeight = region.editingLabels && !region.locked ? 300 : region.tags ? 60 : 50; // const displayOnTop = pbox.y > labelBoxHeight
|
|
48
48
|
|