lost-sia 3.1.3 → 3.2.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.
Files changed (42) hide show
  1. package/dist/Canvas/Canvas.js +1 -1
  2. package/dist/SiaViewer.d.ts +19 -0
  3. package/dist/SiaViewer.js +1 -0
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +1 -1
  6. package/dist/stories/Canvas/Canvas.stories.d.ts +3 -3
  7. package/dist/stories/Canvas/CanvasWithOffset.stories.d.ts +6 -6
  8. package/dist/stories/SIA/SiaViewer.stories.d.ts +52 -0
  9. package/dist/utils/index.d.ts +1 -0
  10. package/dist/utils/index.js +1 -1
  11. package/package.json +3 -4
  12. package/src/Canvas/Canvas.tsx +36 -1
  13. package/src/SiaViewer.tsx +125 -0
  14. package/src/Toolbar/ToolbarItems/ImageToolItems/ImageLabelInput.tsx +1 -2
  15. package/src/index.ts +1 -1
  16. package/src/stories/SIA/SiaViewer.stories.tsx +105 -0
  17. package/src/stories/exampleData/exampleExternalAnnotations.ts +22 -22
  18. package/src/utils/index.ts +1 -0
  19. package/dist/assets/brand-icons-Cu_C0hZ4.svg +0 -1008
  20. package/dist/assets/brand-icons-F3SPCeH1.woff +0 -0
  21. package/dist/assets/brand-icons-XL9sxUpA.woff2 +0 -0
  22. package/dist/assets/brand-icons-sqJ2Pg7a.eot +0 -0
  23. package/dist/assets/brand-icons-ubhWoxly.ttf +0 -0
  24. package/dist/assets/flags-DOLqOU7Y.png +0 -0
  25. package/dist/assets/icons-BOCtAERH.woff +0 -0
  26. package/dist/assets/icons-CHzK1VD9.eot +0 -0
  27. package/dist/assets/icons-D29ZQHHw.ttf +0 -0
  28. package/dist/assets/icons-Du6TOHnR.woff2 +0 -0
  29. package/dist/assets/icons-RwhydX30.svg +0 -1518
  30. package/dist/assets/node_modules/semantic-ui-css/semantic.min-09YPtVE6.css +0 -1
  31. package/dist/assets/outline-icons-BfdLr8tr.svg +0 -366
  32. package/dist/assets/outline-icons-DD8jm0uy.ttf +0 -0
  33. package/dist/assets/outline-icons-DInHoiqI.woff2 +0 -0
  34. package/dist/assets/outline-icons-LX8adJ4n.eot +0 -0
  35. package/dist/assets/outline-icons-aQ88nltS.woff +0 -0
  36. package/src/AnnoExampleViewer.jsx +0 -69
  37. package/src/InfoBoxes/AnnoDetails.jsx +0 -165
  38. package/src/InfoBoxes/AnnoStats.jsx +0 -106
  39. package/src/InfoBoxes/InfoBox.jsx +0 -76
  40. package/src/InfoBoxes/InfoBoxArea.jsx +0 -152
  41. package/src/InfoBoxes/LabelInfo.jsx +0 -107
  42. package/src/SIASettingButton.jsx +0 -126
@@ -1,126 +0,0 @@
1
- import React, { Component } from 'react'
2
-
3
- import * as tbe from './types/toolbarEvents'
4
- import { faCog } from '@fortawesome/free-solid-svg-icons'
5
- import { CFormSwitch, CPopover } from '@coreui/react'
6
- import ToolbarItem from './ToolbarItem'
7
- class SIASettingButton extends Component {
8
- constructor(props) {
9
- super(props)
10
- this.state = {}
11
- }
12
-
13
- triggerEvent(e, data) {
14
- if (this.props.onSettingEvent) {
15
- this.props.onSettingEvent(e, data)
16
- }
17
- }
18
- toggleAnnoDetails() {
19
- this.triggerEvent(tbe.SHOW_ANNO_DETAILS)
20
- }
21
-
22
- toggleLabelInfo() {
23
- this.triggerEvent(tbe.SHOW_LABEL_INFO)
24
- }
25
-
26
- toggleAnnoStats() {
27
- this.triggerEvent(tbe.SHOW_ANNO_STATS)
28
- }
29
-
30
- handleStrokeWidthChange(e) {
31
- this.triggerEvent(tbe.EDIT_STROKE_WIDTH, parseInt(e.target.value))
32
- }
33
-
34
- handleNodeRadiusChange(e) {
35
- this.triggerEvent(tbe.EDIT_NODE_RADIUS, parseInt(e.target.value))
36
- }
37
-
38
- renderInfoBoxContent() {
39
- return (
40
- <div>
41
- <h4>Info Boxes</h4>
42
- <CFormSwitch
43
- checked={this.props.uiConfig.annoDetails.visible}
44
- label="Annotation Details"
45
- size="xl"
46
- onClick={() => this.toggleAnnoDetails()}
47
- />
48
- <CFormSwitch
49
- checked={this.props.uiConfig.labelInfo.visible}
50
- label="Label Info"
51
- size="xl"
52
- onClick={() => this.toggleLabelInfo()}
53
- />
54
- <CFormSwitch
55
- checked={this.props.uiConfig.annoStats.visible}
56
- label="Anno Stats"
57
- size="xl"
58
- onClick={() => this.toggleAnnoStats()}
59
- />
60
- </div>
61
- )
62
- }
63
- renderInfoBoxes() {
64
- if (!this.props.enabled) return null
65
- if (this.props.enabled === true) {
66
- return this.renderInfoBoxContent()
67
- } else {
68
- if (this.props.enabled.infoBoxes) {
69
- return this.renderInfoBoxContent()
70
- }
71
- }
72
- }
73
-
74
- renderAnnoStyle() {
75
- if (!this.props.enabled) return null
76
- if (this.props.enabled === true) {
77
- return this.renderAnnoStyleContent()
78
- } else {
79
- if (this.props.enabled.annoStyle) {
80
- return this.renderAnnoStyleContent()
81
- }
82
- }
83
- }
84
- renderAnnoStyleContent() {
85
- return (
86
- <div>
87
- <h4 style={{ marginTop: 25 }}>Anno Appearance</h4>
88
- <div>Stroke width: {this.props.uiConfig.strokeWidth}</div>
89
- <input
90
- type="range"
91
- min={1}
92
- max={10}
93
- value={this.props.uiConfig.strokeWidth}
94
- onChange={(e) => this.handleStrokeWidthChange(e)}
95
- />
96
- <div>Node radius: {this.props.uiConfig.nodeRadius}</div>
97
- <input
98
- type="range"
99
- min={1}
100
- max={10}
101
- value={this.props.uiConfig.nodeRadius}
102
- onChange={(e) => this.handleNodeRadiusChange(e)}
103
- />
104
- </div>
105
- )
106
- }
107
-
108
- render() {
109
- if (!this.props.uiConfig) return null
110
- const popupContent = (
111
- <div>
112
- {this.renderInfoBoxes()}
113
- {this.renderAnnoStyle()}
114
- </div>
115
- )
116
- return (
117
- <CPopover content={popupContent} placement="right">
118
- <span>
119
- <ToolbarItem faIcon={faCog} />
120
- </span>
121
- </CPopover>
122
- )
123
- }
124
- }
125
-
126
- export default SIASettingButton