UNPKG

@gravity-ui/graph

Version:

Modern graph editor component

29 lines (28 loc) 848 B
import { Layer } from "../../../../services/Layer"; import { Background } from "./Background"; export class BelowLayer extends Layer { constructor(props) { super({ canvas: { zIndex: 1, classNames: ["no-pointer-events"], transformByCameraPosition: true, }, ...props, }); this.onSignal(this.props.graph.rootStore.settings.$background, () => { this.shouldUpdateChildren = true; this.performRender(); }); } afterInit() { super.afterInit(); this.onGraphEvent("camera-change", this.performRender); } render() { this.resetTransform(); } updateChildren() { return [(this.props.graph.rootStore.settings.$background.value || Background).create({})]; } }