Skip to content

Commit 22e6127

Browse files
bsekachevChris Lee-Messer
authored andcommitted
React UI: Player in annotation view & settings page (cvat-ai#1018)
* Active player controls * Setup packages * Playing * Fold/unfold sidebar, minor issues * Improved cvat-canvas integration * Resolved some issues * Added cvat-canvas to Dockerfile.ui * Fit canvas method * Added annotation reducer * Added annotation actions * Added containers * Added components * cvat-canvas removed from dockerignore * Added settings page * Minor improvements * Container for canvas wrapper * Configurable grid * Rotation * fitCanvas added to readme * Aligned table
1 parent de5607d commit 22e6127

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3672
-191
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
/.vscode
77
/db.sqlite3
88
/keys
9-
/cvat-canvas
109
**/node_modules
1110

Dockerfile.ui

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,28 @@ RUN apt update && apt install -yq nodejs npm curl && \
2222
npm install -g n && n 10.16.3
2323

2424
# Create output directories
25-
RUN mkdir /tmp/cvat-ui /tmp/cvat-core
25+
RUN mkdir /tmp/cvat-ui /tmp/cvat-core /tmp/cvat-canvas
2626

2727
# Install dependencies
2828
COPY cvat-core/package*.json /tmp/cvat-core/
29+
COPY cvat-canvas/package*.json /tmp/cvat-canvas/
2930
COPY cvat-ui/package*.json /tmp/cvat-ui/
3031

3132
# Install cvat-core dependencies
3233
WORKDIR /tmp/cvat-core/
3334
RUN npm install
3435

36+
# Install cvat-canvas dependencies
37+
WORKDIR /tmp/cvat-canvas/
38+
RUN npm install
39+
3540
# Install cvat-ui dependencies
3641
WORKDIR /tmp/cvat-ui/
3742
RUN npm install
3843

3944
# Build source code
4045
COPY cvat-core/ /tmp/cvat-core/
46+
COPY cvat-canvas/ /tmp/cvat-canvas/
4147
COPY cvat-ui/ /tmp/cvat-ui/
4248
RUN npm run build
4349

cvat-canvas/README.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Canvas itself handles:
7474
activate(clientID: number, attributeID?: number): void;
7575
rotate(rotation: Rotation, remember?: boolean): void;
7676
focus(clientID: number, padding?: number): void;
77+
fitCanvas(): void;
7778
fit(): void;
7879
grid(stepX: number, stepY: number): void;
7980

@@ -99,7 +100,7 @@ Canvas itself handles:
99100
- Drawn texts have the class ```cvat_canvas_text```
100101
- Tags have the class ```cvat_canvas_tag```
101102
- Canvas image has ID ```cvat_canvas_image```
102-
- Grid on the canvas has ID ```cvat_canvas_grid_pattern```
103+
- Grid on the canvas has ID ```cvat_canvas_grid``` and ```cvat_canvas_grid_pattern```
103104
- Crosshair during a draw has class ```cvat_canvas_crosshair```
104105

105106
### Events
@@ -126,6 +127,7 @@ Standard JS events are used.
126127

127128
// Put canvas to a html container
128129
htmlContainer.appendChild(canvas.html());
130+
canvas.fitCanvas();
129131

130132
// Next you can use its API methods. For example:
131133
canvas.rotate(window.Canvas.Rotation.CLOCKWISE90);
@@ -182,17 +184,18 @@ Than you can use it in TypeScript:
182184

183185
## API Reaction
184186

185-
| | IDLE | GROUPING | SPLITTING | DRAWING | MERGING | EDITING |
186-
|------------|------|----------|-----------|---------|---------|---------|
187-
| html() | + | + | + | + | + | + |
188-
| setup() | + | + | + | + | + | - |
189-
| activate() | + | - | - | - | - | - |
190-
| rotate() | + | + | + | + | + | + |
191-
| focus() | + | + | + | + | + | + |
192-
| fit() | + | + | + | + | + | + |
193-
| grid() | + | + | + | + | + | + |
194-
| draw() | + | - | - | - | - | - |
195-
| split() | + | - | + | - | - | - |
196-
| group | + | + | - | - | - | - |
197-
| merge() | + | - | - | - | + | - |
198-
| cancel() | - | + | + | + | + | + |
187+
| | IDLE | GROUPING | SPLITTING | DRAWING | MERGING | EDITING |
188+
|-------------|------|----------|-----------|---------|---------|---------|
189+
| html() | + | + | + | + | + | + |
190+
| setup() | + | + | + | + | + | - |
191+
| activate() | + | - | - | - | - | - |
192+
| rotate() | + | + | + | + | + | + |
193+
| focus() | + | + | + | + | + | + |
194+
| fit() | + | + | + | + | + | + |
195+
| fitCanvas() | + | + | + | + | + | + |
196+
| grid() | + | + | + | + | + | + |
197+
| draw() | + | - | - | - | - | - |
198+
| split() | + | - | + | - | - | - |
199+
| group | + | + | - | - | - | - |
200+
| merge() | + | - | - | - | + | - |
201+
| cancel() | - | + | + | + | + | + |

0 commit comments

Comments
 (0)