this.instantiate = () => {
this.view.add_node(this.graph,
this.node_type,
graph.new_name(this.node_type))
}
}
init() {
let groups = this.graph.defs.groups();
this.group = groups[0];
let nodegen = this.datgui.addFolder("Create Node");
let group_controller = nodegen.add(this, 'group', groups).name('Group');
group_controller.onChange(set_types);
let type_controller = nodegen.add(this, 'node_type').name('Node Type');
type_controller.listen();
let self = this;
function set_types(group) {
let node_types = self.graph.defs.types(group);
self.node_type = node_types[0];
type_controller = type_controller.options(node_types).name('Node Type');
}
set_types(groups[0]);
nodegen.add(this, 'instantiate').name("Add Node");
nodegen.open();
}
populate(node) {