feat: Migrate from ipywidgets to MIME renderer architecture (v0.4.0) #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Description
Overview
This PR implements a major migration from ipywidgets-based rendering to MIME renderer architecture (v0.4.0). This
change simplifies installation, improves compatibility with modern JupyterLab environments, and provides a
cleaner codebase.
Key Changes
Architecture Overhaul
application/vnd.netvis+jsonlonger supported)
Implementation Improvements
Frontend (TypeScript)
src/mimePlugin.ts- Entry point for JupyterLab MIME extensionsrc/renderer.ts- MIME data rendering logicsrc/graph.ts- D3.js visualization core logic (duplicate code removed)src/widget.ts,src/plugin.ts,src/extension.ts- ipywidgets-related codeBackend (Python)
net_vis/netvis.py- MIME output support via_repr_mimebundle_()_jupyter_nbextension_paths()fromnet_vis/__init__.pynet_vis/tests/test_nbextension_path.py- obsolete nbextension testEnhanced Test Coverage
src/__tests__/mimePlugin.test.ts- MIME plugin unit tests (18 tests)src/__tests__/renderer.test.ts- Renderer component tests (20 tests)src/__tests__/graph.test.ts- Graph visualization logic tests (3 tests)CI/CD Optimization
build.ymlimprovements:/venv/to suppress Haste warningsVersion Management and Frontend-Backend Communication
Breaking Changes
❌ Removed Features
_jupyter_nbextension_paths()function✅ Maintained Compatibility
NetVis(value=data)works without modificationSystem Requirements
Documentation
MIGRATION.md: Migration guide from 0.3.x to 0.4.0CHANGES.md: Detailed changelogREADME.md: Updated installation instructionsTest Results
✅ Python Tests
============================== 16 passed in 0.02s ==============================
✅ TypeScript Tests
Test Suites: 3 passed, 3 total
Tests: 41 passed, 41 total
✅ Lint
✨ Done in 2.35s
✅ Build
TypeScript compilation: Success
Related Issues
Closes #[issue_number] (if applicable)
Review Points
File Statistics