Skip to content

Implement generic waveform visualization system with proper basePath handling#9

Merged
joelmartinez merged 5 commits into
mainfrom
copilot/fix-8
Aug 14, 2025
Merged

Implement generic waveform visualization system with proper basePath handling#9
joelmartinez merged 5 commits into
mainfrom
copilot/fix-8

Conversation

Copilot AI commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

This PR refactors the waveform visualization system to be more maintainable and properly handle different deployment scenarios with basePath configurations.

Changes Made

Generic Canvas Initialization

  • Replaced manual visualization initialization in individual documentation pages with an automated system
  • Added waveform-visualization CSS class to all canvas elements with data-sample attributes
  • Implemented generic JavaScript in SiteFrame.cshtml that automatically discovers and initializes all visualization canvases using querySelector

Proper basePath Support

  • Moved visualizer initialization from individual pages to the SiteFrame.cshtml template
  • Used Razor's @Asset() helper to properly handle basePath configuration from SiteConfig.yml
  • Ensures visualizations work correctly regardless of deployment path

Navigation Updates

  • Removed hardcoded "Library Usage" and "Concepts" navigation links to allow Chloroplast's content menu functionality to handle them
  • Added "Maintainer" link to https://codecube.net as requested
  • Kept the GitHub link in the navigation

Benefits

  • Maintainable: No need to manually define canvas initialization for each page
  • Flexible: Automatically handles any number of canvas elements with the proper class
  • Deployment-ready: Proper basePath handling for different hosting scenarios
  • Clean: Removes duplicate JavaScript code from documentation pages

The system now automatically detects any canvas with the waveform-visualization class and initializes it with the appropriate sample data based on the data-sample attribute.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits August 14, 2025 10:36
Co-authored-by: joelmartinez <90380+joelmartinez@users.noreply.github.com>
Co-authored-by: joelmartinez <90380+joelmartinez@users.noreply.github.com>
Copilot AI changed the title [WIP] Sample CLI and docs visualizations Implement sample CLI application and interactive documentation visualizations Aug 14, 2025
Copilot AI requested a review from joelmartinez August 14, 2025 10:49

@joelmartinez joelmartinez left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot in addition to addressing the comments I left on the PR, when you move the visualizer initialization to the siteframe ... there shouldn't need to be an explicit definition of the items to be visualized. Add a class or something that you can use a selector to just pick however many canvases are in any given piece of documentation, and iterate over those to initialize them.

Comment thread docs/source/library-usage/index.md Outdated
Comment thread docs/templates/SiteFrame.cshtml Outdated
…handling

Co-authored-by: joelmartinez <90380+joelmartinez@users.noreply.github.com>

Copilot AI commented Aug 14, 2025

Copy link
Copy Markdown
Contributor Author

@copilot in addition to addressing the comments I left on the PR, when you move the visualizer initialization to the siteframe ... there shouldn't need to be an explicit definition of the items to be ...

Implemented in commit 7f1bca9. The visualizer initialization is now in SiteFrame.cshtml using a CSS class selector (canvas.waveform-visualization) to automatically find and initialize all visualization canvases. No explicit canvas definitions needed - the system uses data-sample attributes to determine which JSON file to load for each canvas.

…lass and data attributes

Co-authored-by: joelmartinez <90380+joelmartinez@users.noreply.github.com>
Copilot AI changed the title Implement sample CLI application and interactive documentation visualizations Implement generic waveform visualization system with proper basePath handling Aug 14, 2025
Copilot AI requested a review from joelmartinez August 14, 2025 13:21
@joelmartinez joelmartinez marked this pull request as ready for review August 14, 2025 13:24
@joelmartinez joelmartinez merged commit e0a9ba7 into main Aug 14, 2025
2 checks passed
@joelmartinez joelmartinez deleted the copilot/fix-8 branch August 14, 2025 13:24
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