Spaces:
Configuration error
Configuration error
Download web/libs/editor/src/components/InteractiveOverlays/RelationShape.js from bisalsaha/lebel-studio: direct link, hf CLI and curl.
- Browser
- Download file 596 Bytes
-
https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/editor/src/components/InteractiveOverlays/RelationShape.js
- Command line
-
hf download hf://spaces/bisalsaha/lebel-studio/web/libs/editor/src/components/InteractiveOverlays/RelationShape.js
-
curl -L -o RelationShape.js https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/editor/src/components/InteractiveOverlays/RelationShape.js
596 Bytes
| 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; | |
| } | |
| } | |