lost-sia 2.0.0-alpha0 → 2.0.0-alpha1

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-alpha0",
3
+ "version": "2.0.0-alpha1",
4
4
  "description": "Single Image Annotation Tool",
5
5
  "license": "MIT",
6
6
  "repository": "l3p-cv/lost-sia",
package/src/Canvas.jsx CHANGED
@@ -1627,8 +1627,7 @@ class Canvas extends Component {
1627
1627
  imageOffset: imgOffset
1628
1628
  })
1629
1629
  this.svgUpdate(svg)
1630
- return { imgWidth, imgHeight, imgOffset }
1631
- }
1630
+ return { imgWidth: this.props.fixedImageSize ? this.props.fixedImageSize : imgWidth, imgHeight: this.props.fixedImageSize ? this.props.fixedImageSize : imgHeight, imgOffset } }
1632
1631
 
1633
1632
  svgUpdate(svg) {
1634
1633
  this.triggerCanvasEvent(canvasActions.CANVAS_SVG_UPDATE, svg)
@@ -1750,9 +1749,9 @@ class Canvas extends Component {
1750
1749
  render() {
1751
1750
  const selectedAnno = this.findAnno(this.state.selectedAnnoId)
1752
1751
  return (
1753
- <div ref={this.container} >
1754
- <div height={this.state.svg.height}
1755
- style={{ position: 'fixed', top: this.state.svg.top, left: this.state.svg.left }}
1752
+ <div ref={this.container} >
1753
+ <div height={this.state.svg.height}
1754
+ style={{position: this.props.isStaticPosition ? 'static': 'fixed', top: this.state.svg.top, left: this.state.svg.left }}
1756
1755
  >
1757
1756
  {/* {this.renderAnnoCommentInput(selectedAnno)} */}
1758
1757
  {this.renderImgLabelInput()}
@@ -1771,13 +1770,18 @@ class Canvas extends Component {
1771
1770
  // allowedActions={this.props.canvasConfig.img.actions}
1772
1771
  onMouseEnter={e => this.handleImgBarMouseEnter(e)}
1773
1772
  />
1774
- <Dimmer active={!this.state.imageLoaded || this.props.blocked}><Loader>Loading</Loader></Dimmer>
1773
+
1774
+ <Dimmer active={!this.state.imageLoaded || this.props.blocked}>
1775
+ { (!this.state.imageLoaded || this.props.blocked) && <Loader>Loading</Loader>}
1776
+ </Dimmer>
1775
1777
  <Dimmer active={this.state.isJunk}>
1776
- <Header as='h2' icon inverted style={{ background: 'rgba(0,0,0,0)' }}>
1778
+ { this.state.isJunk && <Header as='h2' icon inverted style={{ background: 'rgba(0,0,0,0)' }}>
1777
1779
  <Icon name='ban' />
1778
1780
  Marked as Junk
1779
1781
  </Header>
1782
+ }
1780
1783
  </Dimmer>
1784
+
1781
1785
  {this.renderAnnoToolBar(selectedAnno)}
1782
1786
  {/* <div style={{position: 'fixed', top: this.props.container.top, left: this.props.container.left}}> */}
1783
1787
  {this.renderAnnoLabelInpput(selectedAnno)}
@@ -1797,8 +1801,8 @@ class Canvas extends Component {
1797
1801
  onGetAnnoExample={(exampleArgs) => this.props.onGetAnnoExample ? this.props.onGetAnnoExample(exampleArgs) : {}}
1798
1802
  exampleImg={this.props.exampleImg}
1799
1803
  />
1800
- <svg ref={this.svg} width={this.state.svg.width}
1801
- height={this.state.svg.height}
1804
+ <svg ref={this.svg} width={this.props.fixedImageSize ? this.props.fixedImageSize : this.state.svg.width}
1805
+ height={ this.props.fixedImageSize ? this.props.fixedImageSize : this.state.svg.height}
1802
1806
  onKeyDown={e => this.onKeyDown(e)}
1803
1807
  onKeyUp={e => this.onKeyUp(e)}
1804
1808
  onClick={e => this.handleCanvasClick(e)}
@@ -1818,8 +1822,8 @@ class Canvas extends Component {
1818
1822
  onContextMenu={(e) => this.onRightClick(e)}
1819
1823
  onMouseDown={(e) => this.onMouseDown(e)}
1820
1824
  href={this.props.imageBlob}
1821
- width={this.state.svg.width}
1822
- height={this.state.svg.height}
1825
+ width={ this.props.fixedImageSize ? this.props.fixedImageSize : this.state.svg.width}
1826
+ height={ this.props.fixedImageSize ? this.props.fixedImageSize : this.state.svg.height}
1823
1827
  />
1824
1828
  {this.renderAnnotations()}
1825
1829
  </g>
package/src/Sia.jsx CHANGED
@@ -9,6 +9,10 @@ import { noAnnos } from './siaDummyData'
9
9
  /**
10
10
  * SIA element that handles annotations within an image
11
11
  *
12
+ * @param {boolean} isStaticPosition - Use static positioning instead of "fixed"
13
+ *
14
+ * @param {integer} fixedImageSize - Use fixed image size if specified
15
+ *
12
16
  * @param {object} annos - A json object containing all annotation
13
17
  * information for an image
14
18
  * {
@@ -417,7 +421,7 @@ const Sia = (props) => {
417
421
  }
418
422
 
419
423
  return (
420
- <div className={fullscreenCSS} ref={containerRef}>
424
+ <div className={`sia-app ${fullscreenCSS}`} ref={containerRef}>
421
425
  <Canvas
422
426
  container={containerRef}
423
427
 
@@ -456,6 +460,8 @@ const Sia = (props) => {
456
460
  defaultLabel={props.defaultLabel}
457
461
  preventScrolling={props.preventScrolling}
458
462
  isImageChanging={props.isImageChanging}
463
+ isStaticPosition={props.isStaticPosition}
464
+ fixedImageSize={props.fixedImageSize}
459
465
  />
460
466
  <ToolBar
461
467
  onToolBarEvent={
package/src/index.js CHANGED
@@ -1,5 +1,4 @@
1
-
2
- import 'semantic-ui-css/semantic.min.css'
1
+ import './style.scss'
3
2
  // import { default as Canvas } from './Canvas'
4
3
  // import { default as Toolbar } from './ToolBar'
5
4
  export { default as Canvas } from './Canvas'
package/src/style.scss ADDED
@@ -0,0 +1,3 @@
1
+ .sia-app {
2
+ @import 'semantic-ui-css/semantic.min.css';
3
+ }