forked from cvat-ai/cvat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Base code and settings for cvat-canvas (cvat-ai#594)
- Loading branch information
Showing
9 changed files
with
527 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (C) 2018 Intel Corporation | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
module.exports = { | ||
"env": { | ||
"node": true, | ||
"browser": true, | ||
"es6": true, | ||
}, | ||
"parserOptions": { | ||
"parser": "@typescript-eslint/parser", | ||
"sourceType": "module", | ||
"ecmaVersion": 6, | ||
}, | ||
"plugins": [ | ||
"security", | ||
"no-unsanitized", | ||
"no-unsafe-innerhtml", | ||
"@typescript-eslint", | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:security/recommended", | ||
"plugin:no-unsanitized/DOM", | ||
"plugin:@typescript-eslint/recommended", | ||
"airbnb", | ||
], | ||
"rules": { | ||
"no-new": [0], | ||
"class-methods-use-this": [0], | ||
"no-plusplus": [0], | ||
"no-restricted-syntax": [0, {"selector": "ForOfStatement"}], | ||
"no-continue": [0], | ||
"security/detect-object-injection": 0, | ||
"indent": ["warn", 4], | ||
"no-useless-constructor": 0, | ||
"func-names": [0], | ||
"no-console": [0], // this rule deprecates console.log, console.warn etc. because "it is not good in production code" | ||
"@typescript-eslint/no-explicit-any": [0], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,83 @@ | ||
/* | ||
* Copyright (C) 2018 Intel Corporation | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
function tmp(message: string) { | ||
console.log(message) | ||
return message; | ||
/* eslint-disable */ | ||
// Temporary disable eslint | ||
|
||
interface CanvasInterface { | ||
html(): HTMLElement; | ||
setup(frameData: any, objectStates: any[]): void; | ||
activate(clientID: number, attributeID?: number): void; | ||
rotate(direction: Rotation): void; | ||
focus(clientID: number, padding?: number): void; | ||
fit(): void; | ||
grid(stepX: number, stepY: number): void; | ||
|
||
draw(shapeType: string, numberOfPoints: number, initialState: any): any; | ||
split(enabled?: boolean): any; | ||
group(enabled?: boolean): any; | ||
merge(enabled?: boolean): any; | ||
|
||
cancel(): void; | ||
} | ||
|
||
export enum Rotation { | ||
CLOCKWISE90, | ||
ANTICLOCKWISE90, | ||
} | ||
|
||
export class Canvas implements CanvasInterface { | ||
public constructor() { | ||
return this; | ||
} | ||
|
||
public html(): HTMLElement { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public setup(frameData: any, objectStates: any[]): void { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public activate(clientID: number, attributeID: number = null): void { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public rotate(direction: Rotation): void { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public focus(clientID: number, padding: number = 0): void { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public fit(): void { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public grid(stepX: number, stepY: number): void { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public draw(shapeType: string, numberOfPoints: number, initialState: any): any { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public split(enabled: boolean = false): any { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public group(enabled: boolean = false): any { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public merge(enabled: boolean = false): any { | ||
throw new Error('Method not implemented.'); | ||
} | ||
|
||
public cancel(): void { | ||
throw new Error('Method not implemented.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters