lost-sia 2.0.0-alpha13 → 2.0.0-alpha14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lost-sia",
3
- "version": "2.0.0-alpha13",
3
+ "version": "2.0.0-alpha14",
4
4
  "description": "Single Image Annotation Tool",
5
5
  "license": "MIT",
6
6
  "repository": "l3p-cv/lost-sia",
package/src/Canvas.jsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { Component } from "react";
2
- const _ = require("lodash");
2
+ import uniqueId from "lodash/uniqueId";
3
3
  import Annotation from "./Annotation/Annotation";
4
4
  import AnnoLabelInput from "./AnnoLabelInput";
5
5
  import ImgBar from "./ImgBar";
@@ -929,7 +929,7 @@ class Canvas extends Component {
929
929
  // const corrected = transform.correctAnnotation(anno.data, this.props.svg, this.props.imageOffset)
930
930
  if (this.clipboard) {
931
931
  // let annos = [...this.state.annos]
932
- const uid = _.uniqueId("new");
932
+ const uid = uniqueId("new");
933
933
  // this.handleAnnoEvent()
934
934
  const newData = this.clipboard.data.map((e) => {
935
935
  return { x: e.x + offset, y: e.y + offset };
@@ -1364,7 +1364,7 @@ class Canvas extends Component {
1364
1364
  const mousePos = this.getMousePosition(e);
1365
1365
  // const selAnno = this.findAnno(this.state.selectedAnnoId)
1366
1366
  let newAnno = {
1367
- id: this.props.nextAnnoId ? this.props.nextAnnoId : _.uniqueId("new"),
1367
+ id: this.props.nextAnnoId ? this.props.nextAnnoId : uniqueId("new"),
1368
1368
  type: this.props.selectedTool,
1369
1369
  data: [
1370
1370
  {
@@ -1,12 +1,13 @@
1
1
  import * as transform from "./transform";
2
2
  import * as annoStatus from "../types/annoStatus";
3
3
  import * as modes from "../types/modes";
4
+ import uniqueId from "lodash/uniqueId";
4
5
  const _ = require("lodash");
5
6
 
6
7
  function _fixBackendAnnoElement(element) {
7
8
  return {
8
9
  ...element,
9
- id: element.id ? element.id : _.uniqueId("new"),
10
+ id: element.id ? element.id : uniqueId("new"),
10
11
  annoTime: element.annoTime ? element.annoTime : 0.0,
11
12
  mode: element.mode ? element.mode : modes.VIEW,
12
13
  status: element.status ? element.status : annoStatus.DATABASE,