MCPcopy Create free account
hub / github.com/algorithm-visualizer/algorithm-visualizer / constructor

Method constructor

src/core/layouts/Layout.js:6–14  ·  view source on GitHub ↗
(key, getObject, children)

Source from the content-addressed store, hash-verified

4
5class Layout {
6 constructor(key, getObject, children) {
7 this.key = key;
8 this.getObject = getObject;
9 this.children = children.map(key => this.getObject(key));
10 this.weights = children.map(() => 1);
11 this.ref = React.createRef();
12
13 this.handleChangeWeights = this.handleChangeWeights.bind(this);
14 }
15
16 add(key, index = this.children.length) {
17 const child = this.getObject(key);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected