lost-sia 1.0.0 → 1.0.2

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.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { Component, useEffect, useState, useRef } from 'react';
2
- import { Dropdown, Ref, Popup, Header, Menu, Dimmer, Message, Divider, List, Button, TextArea, Form, Label, Icon, Card, Image, Loader } from 'semantic-ui-react';
2
+ import { Dropdown, Ref, Popup, Header, Menu, Dimmer, Message, Divider, List, Button, TextArea, Form, Label, Icon, Card, Image, Loader, Checkbox } from 'semantic-ui-react';
3
3
  import _ from 'lodash';
4
4
  import reactDom from 'react-dom';
5
5
 
@@ -102,6 +102,18 @@ function toBackend(data, svg, type) {
102
102
  }
103
103
  }
104
104
 
105
+ function getMinMaxPoints(data) {
106
+ var xList = data.map(function (e) {
107
+ return e.x;
108
+ });
109
+ var yList = data.map(function (e) {
110
+ return e.y;
111
+ });
112
+ var minPoint = { x: Math.min.apply(Math, _toConsumableArray(xList)), y: Math.min.apply(Math, _toConsumableArray(yList)) };
113
+ var maxPoint = { x: Math.max.apply(Math, _toConsumableArray(xList)), y: Math.max.apply(Math, _toConsumableArray(yList)) };
114
+ return [minPoint, maxPoint];
115
+ }
116
+
105
117
  /**
106
118
  * Get area relative to the image
107
119
  *
@@ -146,6 +158,51 @@ function move(data, movementX, movementY) {
146
158
  });
147
159
  }
148
160
 
161
+ function getBox(data, type) {
162
+
163
+ switch (type) {
164
+ case 'bBox':
165
+ return data;
166
+ case 'point':
167
+ case 'line':
168
+ case 'polygon':
169
+ var maxX = 0;
170
+ var maxY = 0;
171
+ var minX = Infinity;
172
+ var minY = Infinity;
173
+ data.forEach(function (el) {
174
+ if (el.x > maxX) maxX = el.x;
175
+ if (el.y > maxY) maxY = el.y;
176
+ if (el.x < minX) minX = el.x;
177
+ if (el.y < minY) minY = el.y;
178
+ });
179
+ return [{ x: minX, y: minY }, { x: maxX, y: minY }, { x: minX, y: maxY }, { x: maxX, y: maxY }];
180
+ default:
181
+ break;
182
+
183
+ }
184
+ }
185
+
186
+ function getCenter(data, type) {
187
+ var box = undefined;
188
+ switch (type) {
189
+ case 'point':
190
+ return data[0];
191
+ case 'line':
192
+ case 'polygon':
193
+ case 'bBox':
194
+ box = getBox(data, type);
195
+ var w = box[1].x - box[0].x;
196
+ var h = box[3].y - box[0].y;
197
+ return {
198
+ x: box[0].x + w / 2.0,
199
+ y: box[0].y + h / 2.0
200
+ };
201
+ default:
202
+
203
+ }
204
+ }
205
+
149
206
  /**
150
207
  * Get point that is closest to the left browser side.
151
208
  *
@@ -218,6 +275,55 @@ function correctAnnotation(data, image, imageOffset) {
218
275
  return corrected;
219
276
  }
220
277
 
278
+ /**
279
+ * Rotate annotation around center.
280
+ * @param {*} data list of points {x:int,y:int}
281
+ * @param {*} center Center to rotate point
282
+ * @param {*} angle Rotation angle
283
+ */
284
+ function rotateAnnotation(data, center, angle) {
285
+ angle = angle * (Math.PI / 180); // Convert to radians
286
+ var rotated = data.map(function (point) {
287
+ return {
288
+ x: Math.round(Math.cos(angle) * (point.x - center.x) - Math.sin(angle) * (point.y - center.y) + center.x),
289
+ y: Math.round(Math.sin(angle) * (point.x - center.x) + Math.cos(angle) * (point.y - center.y) + center.y)
290
+ };
291
+ });
292
+ return rotated;
293
+ }
294
+
295
+ /**
296
+ * Resize annotation data in canvas format to new image size
297
+ * @param {*} data Annotation data in canvas format [{x:int, y:int},...]
298
+ * @param {*} sizeOld Size of old image {width:int, height:int}
299
+ * @param {*} sizeNew Size of new image {width:int, height:int}
300
+ */
301
+ function resizeAnnoData(data, sizeOld, sizeNew) {
302
+ var xRatio = sizeNew.width / sizeOld.width;
303
+ var yRatio = sizeNew.height / sizeOld.height;
304
+ return data.map(function (e) {
305
+ return {
306
+ x: parseInt(e.x * xRatio),
307
+ y: parseInt(e.y * yRatio)
308
+ };
309
+ });
310
+ }
311
+
312
+ var transform = /*#__PURE__*/Object.freeze({
313
+ toSia: toSia,
314
+ toBackend: toBackend,
315
+ getMinMaxPoints: getMinMaxPoints,
316
+ getArea: getArea,
317
+ move: move,
318
+ getBox: getBox,
319
+ getCenter: getCenter,
320
+ getMostLeftPoint: getMostLeftPoint,
321
+ getTopPoint: getTopPoint,
322
+ correctAnnotation: correctAnnotation,
323
+ rotateAnnotation: rotateAnnotation,
324
+ resizeAnnoData: resizeAnnoData
325
+ });
326
+
221
327
  var VIEW = 'view';
222
328
  var EDIT = 'edit';
223
329
  var CREATE = 'create';
@@ -889,6 +995,31 @@ var CANVAS_IMGBAR_CLOSE = 'canvasImgbarClose';
889
995
  //Image actions
890
996
  var IMG_LABEL_UPDATE = 'imgLabelUpdate';
891
997
 
998
+ var canvasActions = /*#__PURE__*/Object.freeze({
999
+ ANNO_DELETED: ANNO_DELETED,
1000
+ ANNO_SELECTED: ANNO_SELECTED,
1001
+ ANNO_CREATED: ANNO_CREATED,
1002
+ ANNO_MOVED: ANNO_MOVED,
1003
+ ANNO_ENTER_MOVE_MODE: ANNO_ENTER_MOVE_MODE,
1004
+ ANNO_EDITED: ANNO_EDITED,
1005
+ ANNO_ENTER_EDIT_MODE: ANNO_ENTER_EDIT_MODE,
1006
+ ANNO_ADDED_NODE: ANNO_ADDED_NODE,
1007
+ ANNO_REMOVED_NODE: ANNO_REMOVED_NODE,
1008
+ ANNO_LABEL_UPDATE: ANNO_LABEL_UPDATE,
1009
+ ANNO_CREATED_NODE: ANNO_CREATED_NODE,
1010
+ ANNO_CREATED_FINAL_NODE: ANNO_CREATED_FINAL_NODE,
1011
+ ANNO_START_CREATING: ANNO_START_CREATING,
1012
+ ANNO_COMMENT_UPDATE: ANNO_COMMENT_UPDATE,
1013
+ ANNO_MARK_EXAMPLE: ANNO_MARK_EXAMPLE,
1014
+ CANVAS_SVG_UPDATE: CANVAS_SVG_UPDATE,
1015
+ CANVAS_UI_CONFIG_UPDATE: CANVAS_UI_CONFIG_UPDATE,
1016
+ CANVAS_AUTO_SAVE: CANVAS_AUTO_SAVE,
1017
+ CANVAS_LABEL_INPUT_CLOSE: CANVAS_LABEL_INPUT_CLOSE,
1018
+ CANVAS_IMG_LOADED: CANVAS_IMG_LOADED,
1019
+ CANVAS_IMGBAR_CLOSE: CANVAS_IMGBAR_CLOSE,
1020
+ IMG_LABEL_UPDATE: IMG_LABEL_UPDATE
1021
+ });
1022
+
892
1023
  var _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
893
1024
 
894
1025
  var _createClass$3 = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
@@ -3538,6 +3669,12 @@ function canvasToBackendAnnos(annos, imgSize) {
3538
3669
  return backendFormat;
3539
3670
  }
3540
3671
 
3672
+ var annoConversion = /*#__PURE__*/Object.freeze({
3673
+ fixBackendAnnos: fixBackendAnnos,
3674
+ backendAnnosToCanvas: backendAnnosToCanvas,
3675
+ canvasToBackendAnnos: canvasToBackendAnnos
3676
+ });
3677
+
3541
3678
  var _createClass$e = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
3542
3679
 
3543
3680
  function _classCallCheck$e(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -3660,6 +3797,8 @@ var KeyMapper = function () {
3660
3797
 
3661
3798
  var POINT = 'point';
3662
3799
  var BBOX = 'bBox';
3800
+ var LINE = 'line';
3801
+ var POLYGON = 'polygon';
3663
3802
 
3664
3803
  var _createClass$f = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
3665
3804
 
@@ -6854,6 +6993,11 @@ function _inherits$g(subClass, superClass) { if (typeof superClass !== "function
6854
6993
  * action -> CANVAS_IMG_LOADED
6855
6994
  * action -> CANVAS_IMGBAR_CLOSE
6856
6995
  * @event onImgBarClose - Fires when close button on ImgBar was hit.
6996
+ * @event onGetFunction - Get special canvas functions for manipulation from outside canvas
6997
+ * deleteAllAnnos()
6998
+ * unloadImage()
6999
+ * resetZoom()
7000
+ * getAnnos(annos,removeFrontendIds)
6857
7001
  */
6858
7002
 
6859
7003
  var Canvas = function (_Component) {
@@ -8530,5 +8674,1387 @@ var Canvas = function (_Component) {
8530
8674
  return Canvas;
8531
8675
  }(Component);
8532
8676
 
8533
- export default Canvas;
8677
+ var TOOL_SELECTED = 'toolSelected';
8678
+ var GET_NEXT_IMAGE = 'getNextImage';
8679
+ var GET_PREV_IMAGE = 'getPrevImage';
8680
+ var TASK_FINISHED = 'taskFinished';
8681
+ var SHOW_IMAGE_LABEL_INPUT = 'showImageLabelInput';
8682
+ var IMG_IS_JUNK = 'imageIsJunk';
8683
+ var DELETE_ALL_ANNOS = 'deleteAllAnnos';
8684
+ var SET_FULLSCREEN = 'setFullscreen';
8685
+ var SHOW_ANNO_DETAILS = 'showAnnoDetails';
8686
+ var SHOW_LABEL_INFO = 'showLabelInfo';
8687
+ var SHOW_ANNO_STATS = 'showAnnoStats';
8688
+ var EDIT_STROKE_WIDTH = 'editStrokeWidth';
8689
+ var EDIT_NODE_RADIUS = 'editNodeRadius';
8690
+ var APPLY_FILTER = 'applyFilter';
8691
+ var SAVE = 'save';
8692
+
8693
+ var _createClass$j = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8694
+
8695
+ function _classCallCheck$j(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8696
+
8697
+ function _possibleConstructorReturn$h(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
8698
+
8699
+ function _inherits$h(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8700
+
8701
+ var SIASettingButton = function (_Component) {
8702
+ _inherits$h(SIASettingButton, _Component);
8703
+
8704
+ function SIASettingButton(props) {
8705
+ _classCallCheck$j(this, SIASettingButton);
8706
+
8707
+ var _this = _possibleConstructorReturn$h(this, (SIASettingButton.__proto__ || Object.getPrototypeOf(SIASettingButton)).call(this, props));
8708
+
8709
+ _this.state = {};
8710
+ return _this;
8711
+ }
8712
+
8713
+ _createClass$j(SIASettingButton, [{
8714
+ key: 'triggerEvent',
8715
+ value: function triggerEvent(e, data) {
8716
+ if (this.props.onSettingEvent) {
8717
+ this.props.onSettingEvent(e, data);
8718
+ }
8719
+ }
8720
+ }, {
8721
+ key: 'toggleAnnoDetails',
8722
+ value: function toggleAnnoDetails() {
8723
+ this.triggerEvent(SHOW_ANNO_DETAILS);
8724
+ }
8725
+ }, {
8726
+ key: 'toggleLabelInfo',
8727
+ value: function toggleLabelInfo() {
8728
+ this.triggerEvent(SHOW_LABEL_INFO);
8729
+ }
8730
+ }, {
8731
+ key: 'toggleAnnoStats',
8732
+ value: function toggleAnnoStats() {
8733
+ this.triggerEvent(SHOW_ANNO_STATS);
8734
+ }
8735
+ }, {
8736
+ key: 'handleStrokeWidthChange',
8737
+ value: function handleStrokeWidthChange(e) {
8738
+ this.triggerEvent(EDIT_STROKE_WIDTH, parseInt(e.target.value));
8739
+ }
8740
+ }, {
8741
+ key: 'handleNodeRadiusChange',
8742
+ value: function handleNodeRadiusChange(e) {
8743
+ this.triggerEvent(EDIT_NODE_RADIUS, parseInt(e.target.value));
8744
+ }
8745
+ }, {
8746
+ key: 'render',
8747
+ value: function render() {
8748
+ var _this2 = this;
8749
+
8750
+ if (!this.props.uiConfig) return null;
8751
+ var popupContent = React.createElement(
8752
+ 'div',
8753
+ null,
8754
+ React.createElement(
8755
+ Divider,
8756
+ { horizontal: true },
8757
+ 'Info Boxes'
8758
+ ),
8759
+ React.createElement(Checkbox, {
8760
+ checked: this.props.uiConfig.annoDetails.visible,
8761
+ label: 'Annotation Details', toggle: true,
8762
+ onClick: function onClick() {
8763
+ return _this2.toggleAnnoDetails();
8764
+ }
8765
+ }),
8766
+ React.createElement(Checkbox, {
8767
+ checked: this.props.uiConfig.labelInfo.visible,
8768
+ label: 'Label Info', toggle: true,
8769
+ onClick: function onClick() {
8770
+ return _this2.toggleLabelInfo();
8771
+ }
8772
+ }),
8773
+ React.createElement(Checkbox, {
8774
+ checked: this.props.uiConfig.annoStats.visible,
8775
+ label: 'Anno Stats', toggle: true,
8776
+ onClick: function onClick() {
8777
+ return _this2.toggleAnnoStats();
8778
+ }
8779
+ }),
8780
+ React.createElement(
8781
+ Divider,
8782
+ { horizontal: true },
8783
+ 'Anno Appearance'
8784
+ ),
8785
+ React.createElement(
8786
+ 'div',
8787
+ null,
8788
+ 'Stroke width: ',
8789
+ this.props.uiConfig.strokeWidth
8790
+ ),
8791
+ React.createElement('input', {
8792
+ type: 'range',
8793
+ min: 1,
8794
+ max: 10,
8795
+ value: this.props.uiConfig.strokeWidth,
8796
+ onChange: function onChange(e) {
8797
+ return _this2.handleStrokeWidthChange(e);
8798
+ }
8799
+ }),
8800
+ React.createElement(
8801
+ 'div',
8802
+ null,
8803
+ 'Node radius: ',
8804
+ this.props.uiConfig.nodeRadius
8805
+ ),
8806
+ React.createElement('input', {
8807
+ type: 'range',
8808
+ min: 1,
8809
+ max: 10,
8810
+ value: this.props.uiConfig.nodeRadius,
8811
+ onChange: function onChange(e) {
8812
+ return _this2.handleNodeRadiusChange(e);
8813
+ }
8814
+ })
8815
+ );
8816
+ return React.createElement(Popup, { trigger: React.createElement(
8817
+ Menu.Item,
8818
+ { name: 'setting' },
8819
+ React.createElement(Icon, { name: 'setting' })
8820
+ ),
8821
+ content: popupContent,
8822
+ position: "right center",
8823
+ pinned: true,
8824
+ on: 'click',
8825
+ style: { zIndex: 7000 }
8826
+ });
8827
+ }
8828
+ }]);
8829
+
8830
+ return SIASettingButton;
8831
+ }(Component);
8832
+
8833
+ function active(filter) {
8834
+ return filter.clahe.active || filter.rotate.active;
8835
+ }
8836
+
8837
+ var _extends$c = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
8838
+
8839
+ var _createClass$k = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
8840
+
8841
+ function _classCallCheck$k(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8842
+
8843
+ function _possibleConstructorReturn$i(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
8844
+
8845
+ function _inherits$i(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8846
+
8847
+ var SIAFilterButton = function (_Component) {
8848
+ _inherits$i(SIAFilterButton, _Component);
8849
+
8850
+ function SIAFilterButton(props) {
8851
+ _classCallCheck$k(this, SIAFilterButton);
8852
+
8853
+ var _this = _possibleConstructorReturn$i(this, (SIAFilterButton.__proto__ || Object.getPrototypeOf(SIAFilterButton)).call(this, props));
8854
+
8855
+ _this.state = {
8856
+ clipLimit: 3,
8857
+ active: false,
8858
+ color: undefined
8859
+ };
8860
+ return _this;
8861
+ }
8862
+
8863
+ _createClass$k(SIAFilterButton, [{
8864
+ key: 'componentDidUpdate',
8865
+ value: function componentDidUpdate(prevProps) {
8866
+ if (prevProps.filter.clahe.clipLimit !== this.props.filter.clahe.clipLimit) {
8867
+ this.setState({ clipLimit: this.props.filter.clahe.clipLimit });
8868
+ }
8869
+ if (this.props.filter !== prevProps.filter) {
8870
+ if (active(this.props.filter)) {
8871
+ this.setState({ color: 'red', active: true });
8872
+ } else {
8873
+ this.setState({ color: 'white', active: false });
8874
+ }
8875
+ }
8876
+ }
8877
+ }, {
8878
+ key: 'triggerEvent',
8879
+ value: function triggerEvent(e, data) {
8880
+ if (this.props.onFilterEvent) {
8881
+ this.props.onFilterEvent(e, data);
8882
+ }
8883
+ }
8884
+ }, {
8885
+ key: 'handleClipLimitChange',
8886
+ value: function handleClipLimitChange(e) {
8887
+ var cl = parseInt(e.target.value);
8888
+ this.setState({ clipLimit: cl });
8889
+ // this.claheFilter(cl)
8890
+ }
8891
+ }, {
8892
+ key: 'rotateImg',
8893
+ value: function rotateImg(angle) {
8894
+ var active$$1 = !(this.props.filter.rotate.active && this.props.filter.rotate.angle === angle);
8895
+ var myAngle = active$$1 ? angle : 0;
8896
+ this.triggerEvent(APPLY_FILTER, _extends$c({}, this.props.filter, {
8897
+ rotate: { angle: myAngle, active: active$$1 }
8898
+ }));
8899
+
8900
+ // this.props.siaApplyFilter({
8901
+ // ...this.props.filter,
8902
+ // rotate: {angle:myAngle, active:active}
8903
+ // })
8904
+ }
8905
+ }, {
8906
+ key: 'claheFilter',
8907
+ value: function claheFilter(clipLimit) {
8908
+ var filter = {
8909
+ 'clahe': {
8910
+ 'clipLimit': clipLimit,
8911
+ active: !this.props.filter.clahe.active
8912
+ }
8913
+ };
8914
+ this.triggerEvent(APPLY_FILTER, _extends$c({}, this.props.filter, {
8915
+ clahe: filter.clahe
8916
+ }));
8917
+ // this.props.siaApplyFilter({
8918
+ // ...this.props.filter,
8919
+ // clahe: filter.clahe
8920
+ // })
8921
+ }
8922
+ }, {
8923
+ key: 'releaseCLAHESlider',
8924
+ value: function releaseCLAHESlider(e) {
8925
+ var filter = {
8926
+ 'clahe': {
8927
+ 'clipLimit': parseInt(e.target.value),
8928
+ active: true
8929
+ }
8930
+ };
8931
+ this.triggerEvent(APPLY_FILTER, _extends$c({}, this.props.filter, {
8932
+ clahe: filter.clahe
8933
+ }));
8934
+ // this.props.siaApplyFilter({
8935
+ // ...this.props.filter,
8936
+ // clahe: filter.clahe
8937
+ // })
8938
+ }
8939
+ }, {
8940
+ key: 'render',
8941
+ value: function render() {
8942
+ var _this2 = this;
8943
+
8944
+ var filter = this.props.filter;
8945
+ if (!this.props.imageMeta) return null;
8946
+ var popupContent = React.createElement(
8947
+ 'div',
8948
+ null,
8949
+ React.createElement(
8950
+ Divider,
8951
+ { horizontal: true },
8952
+ 'Rotate'
8953
+ ),
8954
+ React.createElement(Checkbox, {
8955
+ checked: filter.rotate.active && filter.rotate.angle === 90,
8956
+ label: 'Rotate 90', toggle: true,
8957
+ onClick: function onClick() {
8958
+ return _this2.rotateImg(90);
8959
+ }
8960
+ }),
8961
+ React.createElement(Checkbox, {
8962
+ checked: filter.rotate.active && filter.rotate.angle === -90,
8963
+ label: 'Rotate -90', toggle: true,
8964
+ onClick: function onClick() {
8965
+ return _this2.rotateImg(-90);
8966
+ }
8967
+ }),
8968
+ React.createElement(Checkbox, {
8969
+ checked: filter.rotate.active && filter.rotate.angle === 180,
8970
+ label: 'Rotate 180', toggle: true,
8971
+ onClick: function onClick() {
8972
+ return _this2.rotateImg(180);
8973
+ }
8974
+ }),
8975
+ React.createElement(
8976
+ Divider,
8977
+ { horizontal: true },
8978
+ 'Histogram equalization'
8979
+ ),
8980
+ React.createElement(Checkbox, {
8981
+ checked: filter.clahe.active,
8982
+ label: 'Histogram equalization', toggle: true,
8983
+ onClick: function onClick() {
8984
+ return _this2.claheFilter(_this2.state.clipLimit);
8985
+ }
8986
+ }),
8987
+ React.createElement(
8988
+ 'div',
8989
+ null,
8990
+ 'Cliplimit: ',
8991
+ this.state.clipLimit
8992
+ ),
8993
+ React.createElement('input', {
8994
+ type: 'range',
8995
+ min: 0,
8996
+ max: 40,
8997
+ value: this.state.clipLimit,
8998
+ onChange: function onChange(e) {
8999
+ return _this2.handleClipLimitChange(e);
9000
+ },
9001
+ onMouseUp: function onMouseUp(e) {
9002
+ return _this2.releaseCLAHESlider(e);
9003
+ }
9004
+ })
9005
+ );
9006
+ return React.createElement(Popup, { trigger: React.createElement(
9007
+ Menu.Item,
9008
+ { name: 'filter', active: this.state.active },
9009
+ React.createElement(Icon, { name: 'filter', color: this.state.color })
9010
+ ),
9011
+ content: popupContent,
9012
+ position: "right center",
9013
+ pinned: true,
9014
+ on: 'click',
9015
+ style: { zIndex: 7000 }
9016
+ });
9017
+ }
9018
+ }]);
9019
+
9020
+ return SIAFilterButton;
9021
+ }(Component);
9022
+
9023
+ function textIcon() {
9024
+ return React.createElement(
9025
+ "svg",
9026
+ { version: "1.1", xmlns: "http://www.w3.org/2000/svg"
9027
+ // x="0px" y="0px"
9028
+ // width="1190.549px" height="841.891px"
9029
+ , viewBox: "0 0 1190.549 841.891",
9030
+ width: "17px"
9031
+ // onClick={e => this.handleClick(e)}
9032
+ },
9033
+ React.createElement("path", { id: "T", fillRule: "evenodd", clipRule: "evenodd", fill: "currentColor", d: "M925.876,172.939c-0.172-13.004,0.161-26.013,0.116-39.019 c-0.021-4.017-5.046-9.053-9.037-9.087c-7.948-0.068-15.897-0.051-23.848-0.051c-73.526,0.006-147.051,0.02-220.578,0.032 c-8.095,0.001-11.969,3.776-11.969,11.742c-0.009,154.998-0.009,309.997-0.009,464.998c0,44.257-0.002,88.519,0.009,132.778 c0,7.553,4.173,11.736,11.651,11.747c21.677,0.018,30.288-0.227,65.032,0.018c34.743,0.239,46.295,27.955,46.295,46.43 c-0.005,18.477-13.856,42.722-46.792,43.747c-42.993,0.197-85.989-0.057-128.979-0.05c-47.697,0.014-95.387,0.009-143.078,0.074 c-13.712-0.278-44.888-9.133-44.888-44.159c0-35.025,20.399-44.646,42.975-46.192c16.293,0.115,45.164,0.179,67.743,0.16 c5.553-0.006,10.175-5.03,10.178-11.005c0.008-45.524-0.016-91.049-0.018-136.569c0-99.001,0-197.997,0.008-296.994 c0.001-55.278,0.018-110.559,0.007-165.837c0-6.513-4.521-10.917-11.118-10.917c-81.116-0.005-162.229-0.005-243.34-0.001 c-6.977,0-11.061,3.995-11.069,10.825c-0.016,12.286-0.033,24.569,0.019,36.855c-0.076,20.742-10.042,43.007-40.763,43.007 c-30.724,0-46.917-15.208-48.805-43.296c-0.419-14.084,0.01-28.181,0.01-42.272c0-27.46,0-54.917,0-82.379 c0-1.048,0.747-16.871,13.391-30.357c12.642-13.485,26.225-12.505,27.633-12.505c84.544,0.015,169.091,0.009,253.635,0.009 c153.191,0.001,459.578,0.004,459.578,0.004s20.149-0.287,35.766-0.17c0.983-0.023,18.696,1.188,30.027,13.07 c11.333,11.885,9.972,27.513,9.972,28.256c-0.024,42.091,0.255,84.183-0.007,126.274c-0.247,26.341-22.705,41.944-44.85,42.037 C948.049,214.236,926.687,199.643,925.876,172.939z" })
9034
+ );
9035
+ }
9036
+
9037
+ function lineIcon() {
9038
+ return React.createElement(
9039
+ "svg",
9040
+ { version: "1.1", id: "Linie", xmlns: "http://www.w3.org/2000/svg"
9041
+ // xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
9042
+ // width="1190.549px" height="841.891px"
9043
+ , viewBox: "0 0 1190.549 841.891",
9044
+ width: "17px"
9045
+ // enable-background="new 0 0 1190.549 841.891"
9046
+ // xml:space="preserve"
9047
+ },
9048
+ React.createElement("path", { fill: "currentColor", d: "M986.331,109.582c7.141-10.669,28.926-51.179-2.968-85.299S891.011,8.972,891.011,8.972L539.125,133.474 L63.239,302.022c-21.503,7.998-53.586,30.072-60.956,61.716s-2.116,58.538,22.414,96.79S211.33,752.213,228.564,777.28 c26.453,36.868,62.16,58.042,105.507,57.154s365.665-7.485,365.665-7.485l331.7-8.325l89.453-2.293c0,0,70.998-7.179,69.861-60.287 c-1.135-53.108-74.618-62.721-74.618-62.721s-733.215,15.553-749.148,15.576c-22.688,0.201-45.355-15.278-54.146-28.928 s-175.79-272.956-175.79-272.956l600.587-212.338c0,0-73.179,67.087-99.315,100.041s-30.56,74.565-5.053,95.237 c31.188,24.081,91.974-3.708,123.127-39.312C782.35,323.912,979.191,120.251,986.331,109.582z" })
9049
+ );
9050
+ }
9051
+
9052
+ function bBoxIcon() {
9053
+ return React.createElement(
9054
+ "svg",
9055
+ { version: "1.1", id: "Linie", xmlns: "http://www.w3.org/2000/svg"
9056
+ // xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
9057
+ // width="1190.549px" height="841.891px"
9058
+ , viewBox: "0 0 1190.549 841.891",
9059
+ width: "17px"
9060
+ // enable-background="new 0 0 1190.549 841.891"
9061
+ // xml:space="preserve"
9062
+ },
9063
+ React.createElement("path", { fill: "none", stroke: "currentColor", strokeWidth: "120", strokeMiterlimit: "10", d: "M929.775,710.655 c0,23.386-19.134,42.52-42.52,42.52H278.991c-23.386,0-42.52-19.134-42.52-42.52V102.392c0-23.386,19.134-42.52,42.52-42.52 h608.264c23.386,0,42.52,19.134,42.52,42.52V710.655z" })
9064
+ );
9065
+ }
9066
+
9067
+ function polygonIcon() {
9068
+ return React.createElement(
9069
+ "svg",
9070
+ { version: "1.1", id: "Linie", xmlns: "http://www.w3.org/2000/svg"
9071
+ // xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
9072
+ // width="1190.549px" height="841.891px"
9073
+ , viewBox: "0 0 1190.549 841.891",
9074
+ width: "17px"
9075
+ // enable-background="new 0 0 1190.549 841.891"
9076
+ // xml:space="preserve"
9077
+ },
9078
+ React.createElement("path", { fill: "none", stroke: "currentColor", strokeWidth: "120", strokeMiterlimit: "10", d: "M342.327,769.938 c-23.379,0.548-52.922-15.056-65.65-34.674L65.479,409.738c-12.729-19.619-5.085-41.998,16.984-49.732L917.331,67.421 c22.07-7.734,26.86-0.275,10.645,16.576L691.761,329.475c-16.216,16.852-14.503,42.542,3.807,57.092l425.212,337.901 c18.31,14.549,14.16,26.901-9.219,27.449L342.327,769.938z" })
9079
+ );
9080
+ }
9081
+
9082
+ function pointIcon() {
9083
+ return React.createElement(
9084
+ "svg",
9085
+ { version: "1.1", xmlns: "http://www.w3.org/2000/svg"
9086
+ // x="0px" y="0px"
9087
+ // width="1190.549px" height="841.891px"
9088
+ , viewBox: "0 0 1190.549 841.891",
9089
+ width: "17px"
9090
+ },
9091
+ React.createElement("path", { fill: "currentColor", d: "M748.197,408.286c0,151.355-122.699,274.058-274.059,274.058c-151.357,0-274.057-122.703-274.057-274.058 c0-151.356,122.7-274.057,274.057-274.057C625.497,134.229,748.197,256.929,748.197,408.286z" })
9092
+ );
9093
+ }
9094
+
9095
+ var _extends$d = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
9096
+
9097
+ var _createClass$l = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
9098
+
9099
+ function _classCallCheck$l(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9100
+
9101
+ function _possibleConstructorReturn$j(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
9102
+
9103
+ function _inherits$j(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
9104
+
9105
+ var ToolBar = function (_Component) {
9106
+ _inherits$j(ToolBar, _Component);
9107
+
9108
+ function ToolBar(props) {
9109
+ _classCallCheck$l(this, ToolBar);
9110
+
9111
+ var _this = _possibleConstructorReturn$j(this, (ToolBar.__proto__ || Object.getPrototypeOf(ToolBar)).call(this, props));
9112
+
9113
+ _this.state = {
9114
+ // fullscreenMode: false,
9115
+ position: {
9116
+ left: 0,
9117
+ top: 5,
9118
+ width: 40
9119
+ },
9120
+ showFinishPrompt: false,
9121
+ showHelp: false
9122
+ };
9123
+ _this.toolBarGroup = React.createRef();
9124
+ return _this;
9125
+ }
9126
+
9127
+ _createClass$l(ToolBar, [{
9128
+ key: 'componentDidMount',
9129
+ value: function componentDidMount() {}
9130
+ }, {
9131
+ key: 'componentDidUpdate',
9132
+ value: function componentDidUpdate(prevProps, prevState) {
9133
+ // if (prevState.fullscreenMode !== this.state.fullscreenMode){
9134
+ // this.props.siaSetFullscreen(this.state.fullscreenMode)
9135
+ // }
9136
+
9137
+ if (this.props.layoutUpdate !== prevProps.layoutUpdate) {
9138
+ this.calcPosition();
9139
+ }
9140
+ if (this.props.svg !== prevProps.svg) {
9141
+ this.calcPosition();
9142
+ }
9143
+ }
9144
+ }, {
9145
+ key: 'onClick',
9146
+ value: function onClick(e, tool) {
9147
+ this.triggerToolBarEvent(TOOL_SELECTED, tool);
9148
+ }
9149
+ }, {
9150
+ key: 'calcPosition',
9151
+ value: function calcPosition() {
9152
+ if (!this.props.enabled) return;
9153
+ var tb = this.toolBarGroup.current.getBoundingClientRect();
9154
+ if (tb) {
9155
+ if (this.props.svg) {
9156
+ var toolBarTop = undefined;
9157
+ toolBarTop = this.props.svg.top + this.props.svg.height / 6;
9158
+ this.setState({
9159
+ position: _extends$d({}, this.state.position, {
9160
+ left: this.props.svg.left - 55,
9161
+ top: toolBarTop
9162
+ })
9163
+ });
9164
+ }
9165
+ }
9166
+ }
9167
+ }, {
9168
+ key: 'getNextImg',
9169
+ value: function getNextImg() {
9170
+ // this.props.siaGetNextImage(this.props.imageMeta.id)
9171
+ this.triggerToolBarEvent(GET_NEXT_IMAGE);
9172
+ }
9173
+ }, {
9174
+ key: 'getPrevImg',
9175
+ value: function getPrevImg() {
9176
+ // this.props.siaGetPrevImage(this.props.imageMeta.id)
9177
+ this.triggerToolBarEvent(GET_PREV_IMAGE);
9178
+ }
9179
+ }, {
9180
+ key: 'setFinished',
9181
+ value: function setFinished() {
9182
+ // this.props.siaSetTaskFinished()
9183
+ this.triggerToolBarEvent(TASK_FINISHED);
9184
+ }
9185
+ }, {
9186
+ key: 'toggleFinishPrompt',
9187
+ value: function toggleFinishPrompt() {
9188
+ this.setState({
9189
+ showFinishPrompt: !this.state.showFinishPrompt
9190
+ });
9191
+ }
9192
+ }, {
9193
+ key: 'toggleFullscreen',
9194
+ value: function toggleFullscreen() {
9195
+ // this.setState({
9196
+ // fullscreenMode: !this.state.fullscreenMode
9197
+ // })
9198
+ this.triggerToolBarEvent(SET_FULLSCREEN);
9199
+ }
9200
+ }, {
9201
+ key: 'toggleImgLabelInput',
9202
+ value: function toggleImgLabelInput() {
9203
+ // this.props.siaShowImgLabelInput(!this.props.imgLabelInput.show)
9204
+ this.triggerToolBarEvent(SHOW_IMAGE_LABEL_INPUT);
9205
+ }
9206
+ }, {
9207
+ key: 'toggleJunk',
9208
+ value: function toggleJunk() {
9209
+ // this.props.siaImgIsJunk(!this.props.isJunk)
9210
+ this.triggerToolBarEvent(IMG_IS_JUNK);
9211
+ }
9212
+ }, {
9213
+ key: 'toggleHelp',
9214
+ value: function toggleHelp() {
9215
+ this.setState({ showHelp: !this.state.showHelp });
9216
+ }
9217
+ }, {
9218
+ key: 'handleOnDeleteAllAnnos',
9219
+ value: function handleOnDeleteAllAnnos() {
9220
+ this.triggerToolBarEvent(DELETE_ALL_ANNOS);
9221
+ }
9222
+ }, {
9223
+ key: 'handleSave',
9224
+ value: function handleSave() {
9225
+ this.triggerToolBarEvent(SAVE);
9226
+ }
9227
+ }, {
9228
+ key: 'triggerToolBarEvent',
9229
+ value: function triggerToolBarEvent(event, data) {
9230
+ if (this.props.onToolBarEvent) {
9231
+ this.props.onToolBarEvent(event, data);
9232
+ }
9233
+ }
9234
+ }, {
9235
+ key: 'renderToolButtons',
9236
+ value: function renderToolButtons() {
9237
+ var _this2 = this;
9238
+
9239
+ if (!this.props.canvasConfig) return null;
9240
+ if (!this.props.enabled.toolSelection) return null;
9241
+ if (!this.props.canvasConfig.annos.actions.draw) return null;
9242
+ var btns = [];
9243
+ if (this.props.canvasConfig.tools.point) {
9244
+ btns.push(React.createElement(
9245
+ Menu.Item,
9246
+ { name: 'dot circle', key: POINT,
9247
+ active: this.props.active.selectedTool === POINT,
9248
+ onClick: function onClick(e) {
9249
+ return _this2.onClick(e, POINT);
9250
+ }
9251
+ },
9252
+ pointIcon()
9253
+ ));
9254
+ }
9255
+ if (this.props.canvasConfig.tools.line) {
9256
+ btns.push(React.createElement(
9257
+ Menu.Item,
9258
+ { name: 'paint brush', key: LINE,
9259
+ active: this.props.active.selectedTool === LINE,
9260
+ onClick: function onClick(e) {
9261
+ return _this2.onClick(e, LINE);
9262
+ }
9263
+ },
9264
+ lineIcon()
9265
+ ));
9266
+ }
9267
+ if (this.props.canvasConfig.tools.bbox) {
9268
+ btns.push(React.createElement(
9269
+ Menu.Item,
9270
+ { name: 'square outline', key: BBOX,
9271
+ active: this.props.active.selectedTool === BBOX,
9272
+ onClick: function onClick(e) {
9273
+ return _this2.onClick(e, BBOX);
9274
+ }
9275
+ },
9276
+ bBoxIcon()
9277
+ ));
9278
+ }
9279
+ if (this.props.canvasConfig.tools.polygon) {
9280
+ btns.push(React.createElement(
9281
+ Menu.Item,
9282
+ { name: 'pencil alternate', key: POLYGON,
9283
+ active: this.props.active.selectedTool === POLYGON,
9284
+ onClick: function onClick(e) {
9285
+ return _this2.onClick(e, POLYGON);
9286
+ }
9287
+ },
9288
+ polygonIcon()
9289
+ ));
9290
+ }
9291
+ return btns;
9292
+ }
9293
+ }, {
9294
+ key: 'renderFinishPrompt',
9295
+ value: function renderFinishPrompt() {
9296
+ var _this3 = this;
9297
+
9298
+ return React.createElement(Prompt, { active: this.state.showFinishPrompt,
9299
+ header: React.createElement(
9300
+ 'div',
9301
+ null,
9302
+ React.createElement(Icon, { name: 'paper plane outline' }),
9303
+ 'Do you wish to FINISH this SIA Task?'
9304
+ ),
9305
+ content: React.createElement(
9306
+ 'div',
9307
+ null,
9308
+ React.createElement(
9309
+ Button,
9310
+ { basic: true, color: 'green', inverted: true,
9311
+ onClick: function onClick() {
9312
+ return _this3.setFinished();
9313
+ }
9314
+ },
9315
+ React.createElement(Icon, { name: 'check' }),
9316
+ 'Yes'
9317
+ ),
9318
+ React.createElement(
9319
+ Button,
9320
+ { basic: true, color: 'red', inverted: true,
9321
+ onClick: function onClick() {
9322
+ return _this3.toggleFinishPrompt();
9323
+ }
9324
+ },
9325
+ React.createElement(Icon, { name: 'ban' }),
9326
+ ' No'
9327
+ )
9328
+ )
9329
+ });
9330
+ }
9331
+ /**
9332
+ * Render next and prev image buttons
9333
+ *
9334
+ */
9335
+
9336
+ }, {
9337
+ key: 'renderNavigation',
9338
+ value: function renderNavigation() {
9339
+ var _this4 = this;
9340
+
9341
+ var btns = [];
9342
+ if (!this.props.enabled.nextPrev) return null;
9343
+ if (this.props.imageMeta) {
9344
+ if (this.props.imageMeta.isLast) {
9345
+ btns.push(React.createElement(
9346
+ Menu.Item,
9347
+ { name: 'paper plane outline', key: 'finish',
9348
+ active: false,
9349
+ onClick: function onClick() {
9350
+ return _this4.toggleFinishPrompt();
9351
+ }
9352
+ },
9353
+ React.createElement(Icon, { name: 'paper plane outline' }),
9354
+ this.renderFinishPrompt()
9355
+ ));
9356
+ } else {
9357
+ btns.push(React.createElement(
9358
+ Menu.Item,
9359
+ { name: 'arrow right', key: 'next',
9360
+ active: false,
9361
+ onClick: function onClick() {
9362
+ return _this4.getNextImg();
9363
+ }
9364
+ },
9365
+ React.createElement(Icon, { name: 'arrow right' })
9366
+ ));
9367
+ }
9368
+ btns.push(React.createElement(
9369
+ Menu.Item,
9370
+ { name: 'arrow left', key: 'prev',
9371
+ active: false,
9372
+ onClick: function onClick() {
9373
+ return _this4.getPrevImg();
9374
+ },
9375
+ disabled: this.props.imageMeta.isFirst
9376
+ },
9377
+ React.createElement(Icon, { name: 'arrow left' })
9378
+ ));
9379
+ }
9380
+ return btns;
9381
+ }
9382
+ }, {
9383
+ key: 'renderJunkButton',
9384
+ value: function renderJunkButton() {
9385
+ var _this5 = this;
9386
+
9387
+ if (!this.props.enabled.junk) return null;
9388
+ return React.createElement(
9389
+ Menu.Item,
9390
+ { name: 'ban', key: 'junk',
9391
+ active: this.props.active.isJunk,
9392
+ onClick: function onClick() {
9393
+ return _this5.toggleJunk();
9394
+ }
9395
+ },
9396
+ React.createElement(Icon, { name: 'ban' })
9397
+ );
9398
+ }
9399
+ }, {
9400
+ key: 'renderDeleteAllAnnosButton',
9401
+ value: function renderDeleteAllAnnosButton() {
9402
+ var _this6 = this;
9403
+
9404
+ if (!this.props.enabled.deleteAll) return null;
9405
+ return React.createElement(
9406
+ Menu.Item,
9407
+ { name: 'trash alternate outline', key: 'deleteAllAnnos',
9408
+ onClick: function onClick() {
9409
+ return _this6.handleOnDeleteAllAnnos();
9410
+ }
9411
+ },
9412
+ React.createElement(Icon, { name: 'trash alternate outline' })
9413
+ );
9414
+ }
9415
+ }, {
9416
+ key: 'renderSaveButton',
9417
+ value: function renderSaveButton() {
9418
+ var _this7 = this;
9419
+
9420
+ if (!this.props.enabled.save) return null;
9421
+ return React.createElement(
9422
+ Menu.Item,
9423
+ { name: 'save', key: 'save',
9424
+ onClick: function onClick() {
9425
+ return _this7.handleSave();
9426
+ }
9427
+ },
9428
+ React.createElement(Icon, { name: 'save' })
9429
+ );
9430
+ }
9431
+ }, {
9432
+ key: 'renderHelpButton',
9433
+ value: function renderHelpButton() {
9434
+ var _this8 = this;
9435
+
9436
+ if (!this.props.enabled.help) return null;
9437
+ return React.createElement(
9438
+ Menu.Item,
9439
+ { name: 'help', key: 'help',
9440
+ active: false,
9441
+ onClick: function onClick() {
9442
+ return _this8.toggleHelp();
9443
+ }
9444
+ },
9445
+ React.createElement(Icon, { name: 'help' }),
9446
+ React.createElement(Prompt, { active: this.state.showHelp,
9447
+ content: React.createElement(
9448
+ 'div',
9449
+ null,
9450
+ React.createElement(
9451
+ Card.Group,
9452
+ null,
9453
+ React.createElement(
9454
+ Card,
9455
+ null,
9456
+ React.createElement(Card.Content, { header: 'How to draw?' }),
9457
+ React.createElement(Card.Content, { description: '1.) Select a Tool in the toolbar 2.) Draw with RIGHT CLICK on Canvas' })
9458
+ ),
9459
+ React.createElement(
9460
+ Card,
9461
+ null,
9462
+ React.createElement(Card.Content, { header: 'How to delete an annotation?' }),
9463
+ React.createElement(Card.Content, { description: '1.) Select an annotation with LEFT CLICK 2.) Press DELETE or BACKSPACE' })
9464
+ ),
9465
+ React.createElement(
9466
+ Card,
9467
+ null,
9468
+ React.createElement(Card.Content, { header: 'How to assign a label?' }),
9469
+ React.createElement(Card.Content, { description: '1.) Select an annotation with LEFT CLICK 2.) Hit ENTER 3.) Type into the input field 4.) Hit ENTER to confirm 5.) Hit ESCAPE to close the input field' })
9470
+ ),
9471
+ React.createElement(
9472
+ Card,
9473
+ null,
9474
+ React.createElement(Card.Content, { header: 'Undo/ Redo' }),
9475
+ React.createElement(Card.Content, { description: 'Undo: Hit STRG + Z' }),
9476
+ React.createElement(Card.Content, { description: 'Redo: Hit STRG + R' })
9477
+ ),
9478
+ React.createElement(
9479
+ Card,
9480
+ null,
9481
+ React.createElement(Card.Content, { header: 'Add a node to Line/Polygon' }),
9482
+ React.createElement(Card.Content, { description: 'Hit STRG + Click left on the line' })
9483
+ ),
9484
+ React.createElement(
9485
+ Card,
9486
+ null,
9487
+ React.createElement(Card.Content, { header: 'Remove a node from Line/Polygon in create mode' }),
9488
+ React.createElement(Card.Content, { description: 'Press DELETE or BACKSPACE' })
9489
+ ),
9490
+ React.createElement(
9491
+ Card,
9492
+ null,
9493
+ React.createElement(Card.Content, { header: 'Edit Line/Polygon' }),
9494
+ React.createElement(Card.Content, { description: '1.) Click on the Annotation you want to edit.' }),
9495
+ React.createElement(Card.Content, { description: '2.) Press "e". New nodes can now be added using right click' })
9496
+ ),
9497
+ React.createElement(
9498
+ Card,
9499
+ null,
9500
+ React.createElement(Card.Content, { header: 'Zoom/ Move Canvas' }),
9501
+ React.createElement(Card.Content, { description: 'Zoom: Use MOUSE WHEEL to zoom in/out' }),
9502
+ React.createElement(Card.Content, { description: 'Move: Hold MOUSE WHEEL and move mouse. Or Use W/A/S/D keys to move camera up/left/down/right' })
9503
+ ),
9504
+ React.createElement(
9505
+ Card,
9506
+ null,
9507
+ React.createElement(Card.Content, { header: 'TAB navigation' }),
9508
+ React.createElement(Card.Content, { description: 'You can traverse all visible annotation by hitting TAB.' })
9509
+ ),
9510
+ React.createElement(
9511
+ Card,
9512
+ null,
9513
+ React.createElement(Card.Content, { header: 'Next/Prev image navigation' }),
9514
+ React.createElement(Card.Content, { description: 'Get next image by hitting ARROW_RIGHT key. Get previous image by hitting ARROW_LEFT key.' })
9515
+ ),
9516
+ React.createElement(
9517
+ Card,
9518
+ null,
9519
+ React.createElement(Card.Content, { header: 'Copy and Paste annotations' }),
9520
+ React.createElement(Card.Content, { description: 'Copy: 1.) Select annotation 2.) Hit STRG + C' }),
9521
+ React.createElement(Card.Content, { description: 'Paste: STRG + V' })
9522
+ ),
9523
+ React.createElement(
9524
+ Card,
9525
+ null,
9526
+ React.createElement(Card.Content, { header: 'Mark image as junk' }),
9527
+ React.createElement(Card.Content, { description: '1.) Press J key' })
9528
+ ),
9529
+ React.createElement(
9530
+ Card,
9531
+ null,
9532
+ React.createElement(Card.Content, { header: 'Assign a comment to a 2D annoation' }),
9533
+ React.createElement(Card.Content, { description: '1.) Select annotation 2.) Hit C key' })
9534
+ )
9535
+ )
9536
+ )
9537
+ })
9538
+ );
9539
+ }
9540
+ }, {
9541
+ key: 'renderImgLabelInput',
9542
+ value: function renderImgLabelInput() {
9543
+ var _this9 = this;
9544
+
9545
+ if (!this.props.enabled.imgLabel) return null;
9546
+ if (this.props.canvasConfig.img.actions.label) {
9547
+ return React.createElement(
9548
+ Menu.Item,
9549
+ { name: 'img label input'
9550
+ // active={this.props.imgLabelInput.show}
9551
+ , onClick: function onClick() {
9552
+ return _this9.toggleImgLabelInput();
9553
+ }
9554
+ },
9555
+ textIcon()
9556
+ );
9557
+ }
9558
+ }
9559
+ }, {
9560
+ key: 'renderFullscreenBtn',
9561
+ value: function renderFullscreenBtn() {
9562
+ var _this10 = this;
9563
+
9564
+ if (!this.props.enabled.fullscreen) return null;
9565
+ return React.createElement(
9566
+ Menu.Item,
9567
+ { name: 'expand arrows alternate',
9568
+ active: this.props.active.fullscreen,
9569
+ onClick: function onClick() {
9570
+ return _this10.toggleFullscreen();
9571
+ }
9572
+ },
9573
+ React.createElement(Icon, { name: 'expand arrows alternate' })
9574
+ );
9575
+ }
9576
+ }, {
9577
+ key: 'renderSettingBtn',
9578
+ value: function renderSettingBtn() {
9579
+ var _this11 = this;
9580
+
9581
+ if (!this.props.enabled.settings) return null;
9582
+ return React.createElement(SIASettingButton, {
9583
+ uiConfig: this.props.uiConfig,
9584
+ onSettingEvent: function onSettingEvent(e, data) {
9585
+ return _this11.triggerToolBarEvent(e, data);
9586
+ } });
9587
+ }
9588
+ }, {
9589
+ key: 'renderFilterBtn',
9590
+ value: function renderFilterBtn() {
9591
+ var _this12 = this;
9592
+
9593
+ if (!this.props.enabled.filter) return null;
9594
+ return React.createElement(SIAFilterButton, {
9595
+ onFilterEvent: function onFilterEvent(e, data) {
9596
+ return _this12.triggerToolBarEvent(e, data);
9597
+ },
9598
+ filter: this.props.filter,
9599
+ imageMeta: this.props.imageMeta
9600
+ });
9601
+ }
9602
+ }, {
9603
+ key: 'render',
9604
+ value: function render() {
9605
+ if (!this.props.enabled) return null;
9606
+ return React.createElement(
9607
+ 'div',
9608
+ {
9609
+ ref: this.toolBarGroup,
9610
+ style: { position: 'fixed', top: this.state.position.top, left: this.state.position.left } },
9611
+ React.createElement(
9612
+ Menu,
9613
+ { icon: true, inverted: true, vertical: true },
9614
+ this.renderSaveButton(),
9615
+ this.renderImgLabelInput(),
9616
+ this.renderNavigation(),
9617
+ this.renderToolButtons(),
9618
+ this.renderFullscreenBtn(),
9619
+ this.renderJunkButton(),
9620
+ this.renderDeleteAllAnnosButton(),
9621
+ this.renderHelpButton(),
9622
+ this.renderSettingBtn(),
9623
+ this.renderFilterBtn()
9624
+ )
9625
+ );
9626
+ }
9627
+ }]);
9628
+
9629
+ return ToolBar;
9630
+ }(Component);
9631
+
9632
+ var _extends$e = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
9633
+
9634
+ var _slicedToArray$3 = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
9635
+
9636
+ /**
9637
+ * SIA element that handles annotations within an image
9638
+ *
9639
+ * @param {object} annos - A json object containing all annotation
9640
+ * information for an image
9641
+ * {
9642
+ * image : {
9643
+ * id: int,
9644
+ * number: int,
9645
+ * amount: int,
9646
+ * isFirst: bool,
9647
+ * isLast: bool,
9648
+ * description: string, // -> optional
9649
+ * },
9650
+ * annotations: {
9651
+ * bBoxes: [{
9652
+ * id: int, // -> Not required if status === annoStatus.NEW
9653
+ * data: {},
9654
+ * labelIds: list of int, // -> optional
9655
+ * status: see annoStatus, // -> optional
9656
+ * annoTime: float, // -> optional
9657
+ * },...],
9658
+ * points: []
9659
+ * lines: []
9660
+ * polygons: []
9661
+ * }
9662
+ * }
9663
+ * @param {object} possibleLabels - Possible labels that can be assigned to
9664
+ * an annotation.
9665
+ * [{
9666
+ * id: int,
9667
+ * description: str,
9668
+ * label: str, (name of the label)
9669
+ * color: str (color is optional)
9670
+ * }, ...]
9671
+ * @param {blob} imageBlob - The actual image blob that will be displayed
9672
+ * @param {object} imageMeta - Meta information for the current image
9673
+ * {
9674
+ * "id": int,
9675
+ * "number": int, // -> number of image in current annotask
9676
+ * "amount": int, // -> total number of images in current annotask
9677
+ * "isFirst": bool, // -> True if this image is the first image
9678
+ * "isLast": bool, // -> True if current image is the last image in annotask
9679
+ * "labelIds": list of int, // -> List of label for the current image
9680
+ * "isJunk": bool, // -> Indicates wether current image is a junk image
9681
+ * "annoTime": float, // -> Total annotation time for the current image
9682
+ * "description": str or null // -> Description or comment for the current image
9683
+ * }
9684
+ * @param {object} exampleImg - Example for a selected label
9685
+ * {
9686
+ * "anno": {
9687
+ * "id": int, // -> ID of the example annotation
9688
+ * "comment": null or str // -> Comment that has been assigned to this example
9689
+ * },
9690
+ * "img": image blob
9691
+ * }
9692
+ * @param {bool} isJunk - Indicates wether the current image is junk or not
9693
+ * @param {object} uiConfig - User interface configs
9694
+ * {
9695
+ * nodesRadius: int, strokeWidth: int,
9696
+ * layoutOffset: {left:int, top:int, right:int, bottom:int}, -> Offset of the canvas inside the container
9697
+ * imgBarVisible: bool,
9698
+ * imgLabelInputVisible: bool,
9699
+ * centerCanvasInContainer: bool, -> Center the canvas in the middle of the container.
9700
+ * maxCanvas: bool -> Maximize Canvas Size. Do not fit canvas to image size.
9701
+ * }
9702
+ * @param {int} layoutUpdate - A counter that triggers a layout update
9703
+ * everytime it is incremented.
9704
+ * @param {string} selectedTool - The tool that is selected to draw an
9705
+ * annotation. Possible choices are: 'bBox', 'point', 'line', 'polygon'
9706
+ * @param {object} canvasConfig - Configuration for this canvas
9707
+ * {
9708
+ * annos:{
9709
+ * tools: {
9710
+ * point: bool,
9711
+ * line: bool,
9712
+ * polygon: bool,
9713
+ * bbox: bool
9714
+ * },
9715
+ * multilabels: bool,
9716
+ * actions: {
9717
+ * draw: bool,
9718
+ * label: bool,
9719
+ * edit: bool,
9720
+ * },
9721
+ * maxAnnos: null or int,
9722
+ * minArea: int
9723
+ * },
9724
+ * img: {
9725
+ * multilabels: bool,
9726
+ * actions: {
9727
+ * label: bool,
9728
+ * }
9729
+ * },
9730
+ * allowedToMarkExample: bool, -> Indicates wether the current user is allowed to mark an annotation as example.
9731
+ * autoSaveInterval: int -> Interval in seconds when an autosave will be requested by canvas
9732
+ * }
9733
+ * @param {str or int} defaultLabel (optional) - Name or ID of the default label that is used
9734
+ * when no label was selected by the annotator. If not set "no label" will be used.
9735
+ * If ID is used, it needs to be one of the possible label ids.
9736
+ * @param {bool} blocked Block canvas view with loading dimmer.
9737
+ * @param {int} nextAnnoId Id that will be used for the next annotation that
9738
+ * will be created. If undefined, the canvas will create its own ids.
9739
+ * @param {bool} lockedAnnos A list of AnnoIds of annos that should only be displayed.
9740
+ * Such annos can not be edited in any way.
9741
+ * @param {object} filter Information for the filter Popup
9742
+ * {
9743
+ * "clahe": {
9744
+ * "clipLimit": int,
9745
+ * "active": bool
9746
+ * },
9747
+ * "rotate": {
9748
+ * "angle": 90 | -90 | 180,
9749
+ * "active": bool
9750
+ * }
9751
+ * }
9752
+ * @param {bool | object} toolbarEnabled Defines which toolbar buttons are
9753
+ * displayed or if toolbar is shown at all.
9754
+ * false | {
9755
+ * imgLabel: true,
9756
+ * nextPrev: true,
9757
+ * toolSelection: true,
9758
+ * fullscreen: true,
9759
+ * junk: true,
9760
+ * deleteAll: true,
9761
+ * settings: true,
9762
+ * filter: true,
9763
+ * help: true
9764
+ * }
9765
+ * @event onNotification - Callback for Notification messages
9766
+ * args: {title: str, message: str, type: str}
9767
+ * @event onCanvasKeyDown - Fires for keyDown on canvas
9768
+ * @event onAnnoEvent - Fires when an anno performed an action
9769
+ * args: {anno: annoObject, newAnnos: list of annoObjects, pAction: str}
9770
+ * @event onGetAnnoExample - Fires when anno example is requested by canvas
9771
+ * {
9772
+ * id: int, // -> ID of the annotation that will be requested as example
9773
+ * comment: null or str
9774
+ * }
9775
+ * @event onCanvasEvent - Fires on canvas event
9776
+ * args: {action: action, data: dataObject}
9777
+ * action -> CANVAS_SVG_UPDATE
9778
+ * data: {width: int, height: int, scale: float, translateX: float,
9779
+ * translateY:float}
9780
+ * action -> CANVAS_UI_CONFIG_UPDATE
9781
+ * action -> CANVAS_LABEL_INPUT_CLOSE
9782
+ * action -> CANVAS_IMG_LOADED
9783
+ * action -> CANVAS_IMGBAR_CLOSE
9784
+ * @event onToolBarEvent - Fires on Toolbar event
9785
+ * args: {e: event, data: data object}
9786
+ *
9787
+ * e -> DELETE_ALL_ANNOS
9788
+ * e -> TOOL_SELECTED
9789
+ * data: 'bbox', 'point', 'line', 'polygon'
9790
+ * e -> GET_NEXT_IMAGE
9791
+ * data: int // -> Image ID
9792
+ * e -> GET_PREV_IMAGE
9793
+ * data: int // -> Image ID
9794
+ * e -> TASK_FINISHED
9795
+ * data: null
9796
+ * e -> SHOW_IMAGE_LABEL_INPUT
9797
+ * data: null
9798
+ * e -> IMG_IS_JUNK
9799
+ * data: null
9800
+ * e -> APPLY_FILTER
9801
+ * data: {
9802
+ * "clahe": {
9803
+ * "clipLimit": int,
9804
+ * "active": bool
9805
+ * },
9806
+ * "rotate": {
9807
+ * "angle": 90 | -90 | 180,
9808
+ * "active": bool
9809
+ * }
9810
+ * }
9811
+ * e -> SHOW_ANNO_DETAILS
9812
+ * data: null
9813
+ * e -> SHOW_LABEL_INFO
9814
+ * data: null
9815
+ * e -> SHOW_ANNO_STATS
9816
+ * data: null
9817
+ * e -> EDIT_STROKE_WIDTH
9818
+ * data: int // -> Stroke width
9819
+ * e -> EDIT_NODE_RADIUS
9820
+ * data: int // -> Radius
9821
+ * @event onGetFunction - Get special canvas functions for manipulation from outside canvas
9822
+ * deleteAllAnnos()
9823
+ * unloadImage()
9824
+ * resetZoom()
9825
+ * getAnnos(annos,removeFrontendIds)
9826
+ */
9827
+ var Sia = function Sia(props) {
9828
+ var _useState = useState(''),
9829
+ _useState2 = _slicedToArray$3(_useState, 2),
9830
+ fullscreenCSS = _useState2[0],
9831
+ setFullscreenCSS = _useState2[1];
9832
+
9833
+ var _useState3 = useState(0),
9834
+ _useState4 = _slicedToArray$3(_useState3, 2),
9835
+ layoutUpdate = _useState4[0],
9836
+ setLayoutUpdate = _useState4[1];
9837
+
9838
+ var _useState5 = useState(),
9839
+ _useState6 = _slicedToArray$3(_useState5, 2),
9840
+ svg = _useState6[0],
9841
+ setSvg = _useState6[1];
9842
+
9843
+ var _useState7 = useState(false),
9844
+ _useState8 = _slicedToArray$3(_useState7, 2),
9845
+ externalConfigUpdate = _useState8[0],
9846
+ setExternalConfigUpdate = _useState8[1];
9847
+
9848
+ var _useState9 = useState({
9849
+ "nodeRadius": 4,
9850
+ "strokeWidth": 4,
9851
+ "annoDetails": {
9852
+ "visible": false
9853
+ },
9854
+ "labelInfo": {
9855
+ "visible": false
9856
+ },
9857
+ "annoStats": {
9858
+ "visible": false
9859
+ },
9860
+ "layoutOffset": {
9861
+ "left": 20,
9862
+ "top": 0,
9863
+ "bottom": 5,
9864
+ "right": 5
9865
+ },
9866
+ "imgBarVisible": true,
9867
+ "imgLabelInputVisible": false,
9868
+ "centerCanvasInContainer": true,
9869
+ "maxCanvas": true
9870
+ }),
9871
+ _useState10 = _slicedToArray$3(_useState9, 2),
9872
+ uiConfig = _useState10[0],
9873
+ setUiConfig = _useState10[1];
9874
+
9875
+ var containerRef = useRef();
9876
+
9877
+ useEffect(function () {
9878
+ doLayoutUpdate();
9879
+ }, [props.layoutUpdate]);
9880
+
9881
+ useEffect(function () {
9882
+ setExternalConfigUpdate(true);
9883
+ setUiConfig(_extends$e({}, uiConfig, props.uiConfig));
9884
+ }, [props.uiConfig]);
9885
+
9886
+ useEffect(function () {
9887
+ if (externalConfigUpdate) {
9888
+ setExternalConfigUpdate(false);
9889
+ } else {
9890
+ if (props.onCanvasEvent) {
9891
+ props.onCanvasEvent(CANVAS_UI_CONFIG_UPDATE, uiConfig);
9892
+ }
9893
+ }
9894
+ }, [uiConfig]);
9895
+
9896
+ var doLayoutUpdate = function doLayoutUpdate() {
9897
+ setLayoutUpdate(layoutUpdate + 1);
9898
+ };
9899
+
9900
+ var handleAnnoEvent = function handleAnnoEvent(anno, annos, action) {
9901
+ if (props.onAnnoEvent) {
9902
+ props.onAnnoEvent(anno, annos, action);
9903
+ }
9904
+ };
9905
+
9906
+ var handleNotification = function handleNotification(msg) {
9907
+ if (props.onNotification) {
9908
+ props.onNotification(msg);
9909
+ }
9910
+ };
9911
+
9912
+ var handleCanvasKeyDown = function handleCanvasKeyDown(e) {
9913
+ if (props.onCanvasKeyDown) {
9914
+ props.onCanvasKeyDown(e);
9915
+ }
9916
+ };
9917
+
9918
+ var handleCanvasEvent = function handleCanvasEvent(e, data) {
9919
+ switch (e) {
9920
+ case CANVAS_SVG_UPDATE:
9921
+ setSvg(data);
9922
+ break;
9923
+ case CANVAS_UI_CONFIG_UPDATE:
9924
+ setUiConfig(_extends$e({}, uiConfig, data));
9925
+ break;
9926
+ default:
9927
+ break;
9928
+ }
9929
+ if (props.onCanvasEvent) {
9930
+ props.onCanvasEvent(e, data);
9931
+ }
9932
+ };
9933
+
9934
+ var handleGetFunction = function handleGetFunction(deleteAll) {
9935
+ if (props.onGetFunction) {
9936
+ props.onGetFunction(deleteAll);
9937
+ }
9938
+ };
9939
+
9940
+ var handleToolBarEvent = function handleToolBarEvent(e, data) {
9941
+ switch (e) {
9942
+ case SET_FULLSCREEN:
9943
+ if (fullscreenCSS === '') {
9944
+ setFullscreenCSS('sia-fullscreen');
9945
+ setUiConfig(_extends$e({}, uiConfig, {
9946
+ layoutOffset: _extends$e({}, uiConfig.layoutOffset, {
9947
+ left: 50,
9948
+ top: 5
9949
+ })
9950
+ }));
9951
+ doLayoutUpdate();
9952
+ } else {
9953
+ setFullscreenCSS('');
9954
+ setUiConfig(_extends$e({}, uiConfig, {
9955
+ layoutOffset: _extends$e({}, uiConfig.layoutOffset, {
9956
+ left: 20,
9957
+ top: 0
9958
+ })
9959
+ }));
9960
+ doLayoutUpdate();
9961
+ }
9962
+ break;
9963
+ case SHOW_ANNO_DETAILS:
9964
+ setUiConfig(_extends$e({}, uiConfig, {
9965
+ annoDetails: _extends$e({}, uiConfig.annoDetails, {
9966
+ visible: !uiConfig.annoDetails.visible
9967
+ })
9968
+ }));
9969
+ break;
9970
+ case SHOW_LABEL_INFO:
9971
+ setUiConfig(_extends$e({}, uiConfig, {
9972
+ labelInfo: _extends$e({}, uiConfig.labelInfo, {
9973
+ visible: !uiConfig.labelInfo.visible
9974
+ })
9975
+ }));
9976
+ break;
9977
+ case SHOW_ANNO_STATS:
9978
+ setUiConfig(_extends$e({}, uiConfig, {
9979
+ annoStats: _extends$e({}, uiConfig.annoStats, {
9980
+ visible: !uiConfig.annoStats.visible
9981
+ })
9982
+ }));
9983
+ break;
9984
+ case EDIT_STROKE_WIDTH:
9985
+ setUiConfig(_extends$e({}, uiConfig, { strokeWidth: data }));
9986
+ break;
9987
+ case EDIT_NODE_RADIUS:
9988
+ setUiConfig(_extends$e({}, uiConfig, { nodeRadius: data }));
9989
+ break;
9990
+ default:
9991
+ break;
9992
+ }
9993
+ if (props.onToolBarEvent) {
9994
+ props.onToolBarEvent(e, data);
9995
+ }
9996
+ };
9997
+
9998
+ return React.createElement(
9999
+ 'div',
10000
+ { className: fullscreenCSS, ref: containerRef },
10001
+ React.createElement(Canvas, {
10002
+ container: containerRef,
10003
+
10004
+ onAnnoEvent: function onAnnoEvent(anno, annos, action) {
10005
+ return handleAnnoEvent(anno, annos, action);
10006
+ },
10007
+ onNotification: function onNotification(messageObj) {
10008
+ return handleNotification(messageObj);
10009
+ },
10010
+ onKeyDown: function onKeyDown(e) {
10011
+ return handleCanvasKeyDown(e);
10012
+ },
10013
+ onCanvasEvent: function onCanvasEvent(action, data) {
10014
+ return handleCanvasEvent(action, data);
10015
+ },
10016
+ onGetAnnoExample: function onGetAnnoExample(exampleArgs) {
10017
+ return props.onGetAnnoExample ? props.onGetAnnoExample(exampleArgs) : {};
10018
+ },
10019
+ onGetFunction: function onGetFunction(canvasFunc) {
10020
+ return handleGetFunction(canvasFunc);
10021
+ },
10022
+
10023
+ canvasConfig: props.canvasConfig,
10024
+ uiConfig: uiConfig,
10025
+
10026
+ nextAnnoId: props.nextAnnoId,
10027
+ annos: props.annos,
10028
+ imageMeta: props.imageMeta,
10029
+ imageBlob: props.imageBlob,
10030
+ possibleLabels: props.possibleLabels,
10031
+ exampleImg: props.exampleImg,
10032
+ lockedAnnos: props.lockedAnnos,
10033
+ layoutUpdate: layoutUpdate,
10034
+ selectedTool: props.selectedTool,
10035
+ isJunk: props.isJunk,
10036
+ blocked: props.blockCanvas,
10037
+ defaultLabel: props.defaultLabel
10038
+ }),
10039
+ React.createElement(ToolBar, {
10040
+ onToolBarEvent: function onToolBarEvent(e, data) {
10041
+ return handleToolBarEvent(e, data);
10042
+ },
10043
+ imageMeta: props.imageMeta,
10044
+ layoutUpdate: layoutUpdate,
10045
+ svg: svg,
10046
+ active: {
10047
+ isJunk: props.isJunk,
10048
+ selectedTool: props.selectedTool,
10049
+ fullscreen: props.fullscreenMode
10050
+ },
10051
+ enabled: props.toolbarEnabled,
10052
+ canvasConfig: props.canvasConfig,
10053
+ uiConfig: uiConfig,
10054
+ filter: props.filter
10055
+ })
10056
+ );
10057
+ };
10058
+
10059
+ export { transform, annoConversion, canvasActions, Canvas, Sia, ToolBar as Toolbar };
8534
10060
  //# sourceMappingURL=index.es.js.map