Skip to content

Commit c901a0d

Browse files
namedgraphclaude
andauthored
Add 3D Linked Data browser (#288)
* Add 3D force graph view mode Integrates 3d-force-graph / Three.js as a new GraphMode view in the container block. RDF/XML results are converted to nodes and links, rendered in an interactive 3D canvas constrained to the .main.span7 column. Supports node click (info panel), double-click (load linked resources via proxy), hover tooltip, and background click to dismiss. - Add three.js, three-spritetext, 3d-force-graph UMD bundles (v0.159.0 / v1.8.2 / v1.73.3) - Add 3d-force-graph.xsl: ForceGraph3D init template, RDF→graph data conversion, node/link mode templates - Add graph3d.xsl: event handlers (click, dblclick, hover, background), UpdateForceGraph3D, HTTP response handler, tooltip/info panel rendering - Add normalize-rdfxml.xsl, merge-rdfxml.xsl: RDF/XML normalization and merging pipeline - Add bs2:Graph template, GraphMode canvas div, CSS rules for .graph-3d-canvas - Wire graph3d.xsl into client.xsl; add $load-graph3d param to layout.xsl - Remove obsolete graph.xsl Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Initialize 3D graph on document GraphMode; fix blank node merging - layout.xsl: server-side GraphMode outputs a .graph-3d-canvas placeholder div instead of the 2D SVG renderer; client initializes ForceGraph3D - client.xsl: detect .graph-3d-canvas divs in ldh:rdf-document-response and call ldh:InitDocumentGraph3D (mirrors map/chart init pattern) - graph3d.xsl: add ldh:InitDocumentGraph3D named template for document mode - normalize-rdfxml.xsl: add 4th pass to prefix blank node IDs with a document-unique token, preventing ID collisions when merging multiple fetched RDF documents - merge-rdfxml.xsl: include blank node descriptions from new documents in the merge; split rdf:Description match to [@Rdf:about] for property merging and [@Rdf:nodeID] for copy-as-is Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add zoom-to-fit, info panel, and filter panel to 3D graph view - NodeClick writes to info-content panel (dl/dt/dd) instead of tooltip - Tooltip retained only for hover (position-aware) - Zoom-to-fit button and filter checkboxes wired via data-canvas-id - ldh:redisplay-graph reads per-canvas filter state; used by Init and Update - canvas-id param added to all ldh:UpdateForceGraph3D call sites - layout.xsl and view.xsl output info/filter/zoom UI inside canvas div Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Append 3D graph panels client-side after ForceGraph3D mounts ForceGraph3D clears the container element on init, wiping any server-rendered child elements. Mirror the pattern from 3D-Linked-Data/graph-client.xsl: server outputs only the bare canvas div; ldh:AppendGraph3DPanels appends tooltip, info-panel, show-panel, and zoom button via ixsl:append-content after FG3D has mounted. Called from both ldh:InitDocumentGraph3D and the view.xsl initial-load block. Also replaced hardcoded convert-data call in view.xsl with ldh:redisplay-graph so filter checkboxes take effect. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Add CSS for 3D graph overlay panels Panels need position:absolute to overlay the ForceGraph3D WebGL canvas instead of stacking below it (which gets clipped by overflow:hidden). Adds rules for tooltip, info-panel, show-panel, and zoom button. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f33b394 commit c901a0d

File tree

12 files changed

+1596
-193
lines changed

12 files changed

+1596
-193
lines changed

src/main/webapp/static/com/atomgraph/linkeddatahub/css/bootstrap.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,18 @@ div[typeof="https://w3id.org/atomgraph/linkeddatahub#XHTML"] .form-horizontal .c
174174
object { display: block; margin: auto; max-height: 400px; overflow: hidden; width: 100%; }
175175
.chart-canvas { width: 100%; height: 400px; }
176176
.chart-canvas .google-visualization-table { width: 100%; }
177+
.graph-3d-canvas { width: 100%; height: 600px; overflow: hidden; background: #141414; position: relative; }
178+
.graph-3d-tooltip { display: none; position: absolute; background: rgba(0,0,0,0.75); color: #fff; padding: 4px 8px; border-radius: 4px; pointer-events: none; font-size: 12px; z-index: 10; }
179+
.graph-3d-info-panel { position: absolute; top: 10px; right: 10px; z-index: 10; background: rgba(0,0,0,0.7); color: #fff; padding: 8px 12px; border-radius: 4px; max-width: 280px; font-size: 12px; }
180+
.graph-3d-info-panel h4 { margin: 0 0 4px; font-size: 13px; }
181+
.graph-3d-info-panel dl { margin: 0; }
182+
.graph-3d-info-panel dt { font-weight: bold; margin-top: 4px; }
183+
.graph-3d-info-panel dd { margin: 0; word-break: break-all; }
184+
.graph-3d-info-panel a { color: #8cf; }
185+
.graph-3d-show-panel { position: absolute; bottom: 30px; left: 10px; z-index: 10; background: rgba(0,0,0,0.7); color: #fff; padding: 8px 12px; border-radius: 4px; font-size: 12px; }
186+
.graph-3d-show-panel label { display: block; cursor: pointer; }
187+
.graph-3d-show-panel label.sub-option { margin-left: 16px; }
188+
.graph-3d-zoom { position: absolute; top: 10px; left: 10px; z-index: 10; }
177189
.table { display: table; }
178190
.row { display: table-row ; }
179191
.cell { display: table-cell ; }

src/main/webapp/static/com/atomgraph/linkeddatahub/js/3d-force-graph.min.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/static/com/atomgraph/linkeddatahub/js/three-spritetext.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/static/com/atomgraph/linkeddatahub/js/three.min.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)