Template variable not properly resolved in graph visualization links
Goal
Fix the JavaScript template literal issue where
${d.neurowiki_url} is being treated as a literal URL path instead of being properly evaluated to actual neurowiki_url values from the data objects.
Acceptance Criteria
☑ Add neurowiki_url() helper function to generate NeuroWiki URLs
☑ Update /api/graph and /api/graph/{analysis_id} endpoints to include neurowiki_url for each node
☑ Update graph.html to make nodes clickable and show NeuroWiki link in tooltip
☑ Template literal properly evaluates using backticks
Approach
Add neurowiki_url() function to api.py to generate NeuroWiki URLs (pattern: https://neurowiki.xyz/wiki/{entity-name-cleaned})
Update both graph API endpoints to include neurowiki_url in node data
Update graph.html JavaScript to:
- Add neurowiki_url link in tooltip using proper template literal with backticks
- Add click handler to open NeuroWiki page in new tab
- Style cursor as pointer for clickable nodes
Test changes and commitWork Log
2026-04-01 20:12 PT — Slot 2
- Started task: Fix template literal issue in graph visualization
- Read AGENTS.md and existing code in api.py, site/graph.html
- Analyzed the issue: neurowiki_url feature was not fully implemented
- Implemented changes:
- Added neurowiki_url() function to api.py (lines 17-21)
- Updated /api/graph endpoint to include neurowiki_url for each node (line 104)
- Updated /api/graph/{analysis_id} endpoint to include neurowiki_url (line 114)
- Updated site/graph.html tooltip section to:
* Include NeuroWiki link in tooltip using proper template literal (line 146)
* Add click handler to open neurowiki_url in new tab (lines 152-156)
* Set cursor to pointer style (line 157)
- Changes use proper template literals with backticks for string interpolation
- Pattern:
${d.neurowiki_url} within backticks evaluates correctly
- Committed and ready to push
- Result: Done — Graph nodes now have clickable NeuroWiki links with proper URL evaluation