@gravity-ui/graph
Version:
Modern graph editor component
28 lines (27 loc) • 905 B
JavaScript
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.canvas,
},
...props,
});
this.background = this.props.graph.rootStore.settings.$background.value || Background;
}
afterInit() {
this.onSignal(this.props.graph.rootStore.settings.$background, () => {
this.background = this.props.graph.rootStore.settings.$background.value || Background;
this.shouldUpdateChildren = true;
this.performRender();
});
super.afterInit();
}
updateChildren() {
return [this.background.create({})];
}
}