|
2 | 2 | Introduction |
3 | 3 | ============= |
4 | 4 |
|
5 | | -.. todo:: |
| 5 | +NetVis is a package for interactive visualization of Python NetworkX graphs within JupyterLab. It leverages D3.js for dynamic rendering, providing an intuitive and powerful way to explore and analyze network data. |
6 | 6 |
|
7 | | - add prose explaining project purpose and usage here |
| 7 | + |
| 8 | +Key Features |
| 9 | +------------ |
| 10 | + |
| 11 | +- **Interactive D3.js Visualization**: Force-directed graph layout with interactive node dragging, zooming, and panning |
| 12 | +- **Simple Python API**: Works seamlessly with NetworkX graph data structures |
| 13 | +- **MIME Renderer Architecture**: Automatic rendering in JupyterLab 3.x and 4.x without manual extension configuration |
| 14 | +- **Customizable Appearance**: Support for custom node colors, sizes, and categories |
| 15 | +- **Modern Stack**: Built with TypeScript and modern JupyterLab extension architecture |
| 16 | + |
| 17 | + |
| 18 | +Quick Example |
| 19 | +------------- |
| 20 | + |
| 21 | +Here's a simple example to get you started:: |
| 22 | + |
| 23 | + import net_vis |
| 24 | + |
| 25 | + data = """ |
| 26 | + { |
| 27 | + "nodes": [ |
| 28 | + {"id": "A"}, |
| 29 | + {"id": "B"}, |
| 30 | + {"id": "C"} |
| 31 | + ], |
| 32 | + "links": [ |
| 33 | + {"source": "A", "target": "B"}, |
| 34 | + {"source": "B", "target": "C"} |
| 35 | + ] |
| 36 | + } |
| 37 | + """ |
| 38 | + |
| 39 | + w = net_vis.NetVis(value=data) |
| 40 | + w |
| 41 | + |
| 42 | +When executed in JupyterLab, this displays an interactive force-directed graph where you can: |
| 43 | + |
| 44 | +- **Drag nodes** to rearrange the layout |
| 45 | +- **Zoom and pan** to explore different areas |
| 46 | +- **Hover over nodes** to see labels |
| 47 | +- **Click nodes** to pin/unpin them |
| 48 | + |
| 49 | + |
| 50 | +Architecture (v0.4.0) |
| 51 | +--------------------- |
| 52 | + |
| 53 | +Version 0.4.0 introduces a major architectural change: |
| 54 | + |
| 55 | +**MIME Renderer** |
| 56 | + NetVis now uses JupyterLab's MIME renderer system instead of ipywidgets. This means: |
| 57 | + |
| 58 | + - Simpler installation (no manual extension enabling) |
| 59 | + - Better performance and integration with JupyterLab |
| 60 | + - Cleaner codebase with modern TypeScript |
| 61 | + |
| 62 | +**JupyterLab Only** |
| 63 | + NetVis 0.4.0+ exclusively supports JupyterLab 3.x and 4.x. Jupyter Notebook Classic is no longer supported. |
| 64 | + |
| 65 | +**Python API Unchanged** |
| 66 | + Despite the internal changes, the Python API remains 100% compatible with previous versions. |
| 67 | + |
| 68 | + |
| 69 | +What's New in 0.4.0 |
| 70 | +------------------- |
| 71 | + |
| 72 | +- **MIME renderer architecture** replacing ipywidgets |
| 73 | +- **Simplified installation** - just ``pip install net_vis`` |
| 74 | +- **Removed nbextension support** - JupyterLab only |
| 75 | +- **Python 3.10+ support** including 3.13 and 3.14 |
| 76 | +- **Comprehensive test suite** with 41 TypeScript tests and 16 Python tests |
| 77 | +- **Code quality tools** - ruff and pyright for Python linting and type checking |
| 78 | + |
| 79 | + |
| 80 | +Migrating from 0.3.x |
| 81 | +--------------------- |
| 82 | + |
| 83 | +If you're upgrading from version 0.3.x, your existing code will continue to work without changes. However, you should be aware that: |
| 84 | + |
| 85 | +1. Jupyter Notebook Classic is no longer supported |
| 86 | +2. Manual extension enabling is no longer required |
| 87 | +3. Some internal APIs have changed (if you were using them directly) |
| 88 | + |
| 89 | +For detailed migration instructions, see `MIGRATION.md <https://github.com/cmscom/netvis/blob/main/MIGRATION.md>`_. |
0 commit comments