40 float x_min,
float x_max,
float row_h,
int depth)
44 const std::string header_label = std::string(role_label(tree.
role))
47 auto node_ref = tree.
node;
48 std::vector<ValueSpec> values {
51 .reader = [node_ref] {
return std::to_string(node_ref->get_last_output()); },
57 std::vector<RowBuffer> rbufs;
58 rbufs.reserve(values.size());
59 for (
const auto& spec : values)
63 surface, cursor, ind, x_max, row_h,
false);
66 result.
group = std::move(group);
70 child, surface, cursor,
71 x_min, x_max, row_h, depth + 1);
74 child_result.group.header.header_id);
75 result.
children.push_back(std::move(child_result));
86 const std::shared_ptr<Nodes::Node>& n,
89 float x_min,
float x_max,
float row_h,
int depth)
95 std::vector<ValueSpec> values {
98 .reader = [node_ref] {
return std::to_string(node_ref->get_last_output()); },
104 std::vector<RowBuffer> rbufs;
105 rbufs.reserve(values.size());
106 for (
const auto& spec : values)
110 surface, cursor, ind, x_max, row_h,
false);
113 result.
group = std::move(group);
115 for (
const auto& tree : n->get_modulator_tree()) {
117 tree, surface, cursor,
118 x_min, x_max, row_h, depth + 1);
121 child.group.header.header_id);
122 result.
children.push_back(std::move(child));
136 float x_min,
float x_max,
float row_h,
int depth)
142 ?
"root [ch " + std::to_string(channel) +
"]"
145 std::vector<ValueSpec> values {
148 .reader = [&root] {
return std::to_string(root.get_node_size()); },
154 std::vector<RowBuffer> rbufs;
155 rbufs.reserve(values.size());
156 for (
const auto& spec : values)
160 surface, cursor, ind, x_max, row_h,
false);
163 result.
group = std::move(group);
165 for (
const auto& n : root.nodes()) {
168 auto node_result =
node(
170 x_min, x_max, row_h, depth + 1);
172 result.
children.push_back(std::move(node_result));
206 const std::shared_ptr<Nodes::Network::NodeNetwork>& net,
209 float x_min,
float x_max,
float row_h,
int depth)
213 const std::string header_label
219 std::vector<ValueSpec> values {
222 .reader = [net_ref] {
return std::to_string(net_ref->get_node_count()); },
226 .reader = [net_ref] {
return net_ref->is_enabled() ?
"true" :
"false"; },
230 .reader = [net_ref] {
231 const auto ch = net_ref->get_registered_channels();
233 for (
size_t i = 0; i < ch.size(); ++i) {
236 s += std::to_string(ch[i]);
238 return s.empty() ?
"-" : s;
245 std::vector<RowBuffer> rbufs;
246 rbufs.reserve(values.size());
247 for (
const auto& spec : values)
251 surface, cursor, ind, x_max, row_h,
false);
254 result.
group = std::move(group);
265 float x_min,
float x_max,
float row_h)
273 const std::string root_label =
"NodeGraphManager ["
274 + std::to_string(tokens.size()) +
" token"
275 + (tokens.size() == 1 ?
"" :
"s") +
"]";
278 std::vector<ValueSpec> root_values {
281 .reader = [&ngm] {
return std::to_string(ngm.get_active_tokens().size()); },
287 std::vector<RowBuffer> rbufs;
288 rbufs.reserve(root_values.size());
289 for (
const auto& spec : root_values)
293 surface, cursor, x_min, x_max, row_h,
false);
296 result.
group = std::move(root_group);
298 for (
const auto tok : tokens) {
303 std::ranges::sort(channels);
305 std::vector<ValueSpec> tok_values {
308 .reader = [&ngm, tok] {
return std::to_string(ngm.get_node_count(tok)); },
312 .reader = [&ngm, tok] {
return std::to_string(ngm.get_network_count(tok)); },
318 std::vector<RowBuffer> tok_rbufs;
319 tok_rbufs.reserve(tok_values.size());
320 for (
const auto& spec : tok_values)
323 auto tok_group =
make_value_group(tok_values, std::move(tok_hbuf), tok_rbufs,
327 tok_result.
group = std::move(tok_group);
338 net_section.
group = std::move(net_group);
342 for (
const auto ch : channels) {
349 ch_result.
group = std::move(ch_group);
350 surface.
layer().
relate(net_section.group.header.header_id, ch_result.group.header.header_id);
355 auto nr =
node_network(net, surface, cursor, x_min, x_max, row_h, 4);
356 surface.
layer().
relate(ch_result.group.header.header_id, nr.group.header.header_id);
357 ch_result.children.push_back(std::move(nr));
360 net_section.children.push_back(std::move(ch_result));
366 auto nr =
node_network(net, surface, cursor, x_min, x_max, row_h, 3);
367 surface.
layer().
relate(net_section.group.header.header_id, nr.group.header.header_id);
368 net_section.children.push_back(std::move(nr));
372 tok_result.
children.push_back(std::move(net_section));
383 nodes_section.
group = std::move(nodes_group);
387 for (
const auto ch : channels) {
388 auto rn =
root_node(tok, ch, surface, cursor, x_min, x_max, row_h, 3);
389 surface.
layer().
relate(nodes_section.group.header.header_id, rn.group.header.header_id);
390 nodes_section.children.push_back(std::move(rn));
393 auto rn =
root_node(tok, 0, surface, cursor, x_min, x_max, row_h, 3);
394 surface.
layer().
relate(nodes_section.group.header.header_id, rn.group.header.header_id);
395 nodes_section.children.push_back(std::move(rn));
398 tok_result.
children.push_back(std::move(nodes_section));
401 result.
children.push_back(std::move(tok_result));