feat: graph_explorer app — agnostic operations.db viewer (issue 0049k)
App C++ ImGui que abre cualquier operations.db del registry y lo visualiza
como grafo con shapes/iconos/layouts/filtros/labels.
Composicion del registry:
- viz/graph_renderer + graph_force_layout(_gpu) + graph_layouts +
graph_viewport + graph_labels + graph_icons + graph_sources
- core: toolbar, modal_dialog, select, text_input, tree_view, page_header,
fullscreen_window, button, badge, empty_state
Capas:
- data.{h,cpp} — dispatcher GraphLoadFn (operations hoy; json/graphml manana).
- types_registry.{h,cpp} — parser YAML minimal + tabler_codepoint_by_name +
apply_types_yaml + IconAtlas builder.
- views.{h,cpp} — Toolbar, Legend, Inspector, Stats, modal Filters/Open.
- layout_store.{h,cpp} — graph_explorer.db SQLite con tabla layouts(graph_hash,
node_id, x, y, pinned, updated_at). UPSERT por nodo.
- main.cpp — CLI (--input/--types/--layout) + fn::run_app + bucle
force layout (CPU/GPU toggle) + render con 3 columnas (Legend / Viewport /
Inspector+Stats).
examples/types.yaml: 10 entidades OSINT (Person/Email/Domain/Phone/Org/IBAN/
Account/Document/Address/Url) + 5 relaciones (owns/knows/located_in/
transfers_to/member_of) con shapes Tabler reales.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#include "data.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
namespace ge {
|
||||
|
||||
bool load_graph(const InputArgs& args, GraphData* out, graph::GraphLoadStats* stats) {
|
||||
if (!out || !stats) return false;
|
||||
*stats = graph::GraphLoadStats{};
|
||||
if (!args.uri || !*args.uri) {
|
||||
stats->errors = 1;
|
||||
std::snprintf(stats->error_msg, sizeof(stats->error_msg),
|
||||
"no input uri");
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (args.kind) {
|
||||
case INPUT_OPERATIONS:
|
||||
return graph::graph_load_from_operations(args.uri, out, stats);
|
||||
case INPUT_NONE:
|
||||
default:
|
||||
stats->errors = 1;
|
||||
std::snprintf(stats->error_msg, sizeof(stats->error_msg),
|
||||
"unsupported input kind");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool reload_graph(const InputArgs& args, GraphData* out, graph::GraphLoadStats* stats) {
|
||||
if (out) graph::graph_free(out);
|
||||
return load_graph(args, out, stats);
|
||||
}
|
||||
|
||||
} // namespace ge
|
||||
Reference in New Issue
Block a user