/
vshmidt
/
label-studio
Обзор
Документация
Войти
/
vshmidt
/
label-studio
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
web/libs/editor/src/components/InteractiveOverlays/RelationShape.js
32 строки
596 B
Sergey
feat: LEAP-1445: Add comments overlay (#6459)
08 окт 2024, 16:33
Не верифицирован
08 окт 2024, 16:33
0a86fa3
Код
Авторство
О чём код?
import { BoundingBox } from "./BoundingBox"; /* eslint-disable no-unused-expressions */ export class RelationShape { params = {}; _onUpdated = null; constructor(params) { Object.assign(this.params, params); if (this.params.watcher) { this._watcher = new this.params.watcher(this.params.root, this.params.element, this.onChanged); } } boundingBox() { return BoundingBox.bbox(this.params.element); } onUpdate(callback) { this.onUpdated = callback; } onChanged = () => { this.onUpdated?.(); }; destroy() { this.onUpdated = null; } }