Skip to content

feat: interactive relationship network graph, Cytoscape & Vis.js export formats - #2712

Open
SuperJaba wants to merge 3 commits into
Datalux:developmentfrom
SuperJaba:feat/web-interactive-network-graph
Open

SuperJaba wants to merge 3 commits into
Datalux:developmentfrom
SuperJaba:feat/web-interactive-network-graph

Conversation

@SuperJaba

Copy link
Copy Markdown

Summary

This PR adds an interactive force-directed relationship network graph directly within the Osintgram Web UI, along with support for exporting graphs in standard Cytoscape.js and Vis.js formats.

Key Capabilities

  • Interactive Force-Directed Graph View:
    • Fullscreen/modal interactive canvas visualization running a force-directed physics engine (Coulomb repulsion, Hooke spring attraction, center gravity, velocity damping).
    • 100% self-contained and zero-dependency: operates offline without loading external CDN scripts.
    • Smooth pan, zoom (mousewheel / touch pinch), and drag-and-drop node manipulation.
    • Category filter pills (toggle Follower, Following, Commenter, Tagged accounts) and interactive user search filter.
    • Hover tooltips and detail inspector with Instagram profile link and quick 'Target @user' pivot.
    • High-resolution PNG image export of the current canvas view.
  • Cytoscape & Vis.js Export Formats:
    • Enhanced /api/export/graph endpoint to support format: "cytoscape" and format: "vis" alongside existing GEXF and JSON.
    • Color, size, and degree decoration for nodes and directed edges.
  • Test Coverage:
    • Unit tests for Cytoscape and Vis.js serializers in tests/test_graph_export.py.
    • Integration tests for /api/export/graph formats and security restrictions in tests/test_features_integration.py.
    • Documentation updated in doc/web-ui.md.

@Datalux

Datalux commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Changes needed before merging:

  1. The endpoint accepts up to 10,000 items, but the browser simulation is O(n²) per frame. Above 250 nodes the loops skip nodes (step = 2 with i += step and j += step), so the odd-indexed nodes never get repulsion and the layout is distorted, and with thousands of nodes the tab freezes at start-up. Please cap the interactive view (e.g. the 300-500 nodes with the highest degree, with a "showing N of M" notice) and apply repulsion to all the nodes shown (e.g. a spatial grid).
  2. An unknown format silently returns GEXF. Please return a 400 listing the accepted formats.
  3. catLabel and node.color go into innerHTML unescaped in the tooltip. They come from the server today, but please escape them for consistency.
  4. In export_vis, title contains @{id}, which Vis.js may render as HTML. Please escape it.
  5. Please add tests for a very large graph (the cap) and for an invalid format.

Thanks!

@SuperJaba
SuperJaba force-pushed the feat/web-interactive-network-graph branch from 21a96b7 to 0e81dba Compare October 30, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants