pyvis-optimized 4.4.0__tar.gz → 4.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/CHANGELOG.md +60 -19
  2. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/MANIFEST.in +0 -1
  3. {pyvis_optimized-4.4.0/pyvis_optimized.egg-info → pyvis_optimized-4.5.0}/PKG-INFO +4 -4
  4. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/README.md +3 -3
  5. pyvis_optimized-4.5.0/pyvis/_version.py +1 -0
  6. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/network.py +745 -189
  7. pyvis_optimized-4.5.0/pyvis/node.py +63 -0
  8. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/shiny/__init__.py +6 -3
  9. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/shiny/bindings.js +1 -1
  10. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/shiny/wrapper.py +40 -7
  11. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/templates/template.html +3 -0
  12. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/types/common.py +13 -2
  13. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/types/edges.py +5 -1
  14. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/types/nodes.py +4 -1
  15. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/types/physics.py +1 -1
  16. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/utils.py +2 -2
  17. pyvis_optimized-4.5.0/pyvis/vis_config.py +57 -0
  18. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0/pyvis_optimized.egg-info}/PKG-INFO +4 -4
  19. pyvis_optimized-4.4.0/pyvis/_version.py +0 -1
  20. pyvis_optimized-4.4.0/pyvis/node.py +0 -35
  21. pyvis_optimized-4.4.0/pyvis/vis_config.py +0 -24
  22. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/LICENSE_BSD.txt +0 -0
  23. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/examples/edge_attribute_editing_example.py +0 -0
  24. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/examples/shiny_demo.py +0 -0
  25. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/examples/shiny_editor_demo.py +0 -0
  26. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/examples/shiny_simple_demo.py +0 -0
  27. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/notebooks/01_basics.ipynb +0 -0
  28. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/notebooks/02_networkx.ipynb +0 -0
  29. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/notebooks/03_typed_options.ipynb +0 -0
  30. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/notebooks/04_advanced.ipynb +0 -0
  31. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/notebooks/NetworkOfThrones.csv +0 -0
  32. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/notebooks/test.dot +0 -0
  33. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyproject.toml +0 -0
  34. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/__init__.py +0 -0
  35. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/edge.py +0 -0
  36. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/shiny/styles.css +0 -0
  37. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/templates/lib/bindings/utils.js +0 -0
  38. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/templates/lib/tom-select/tom-select.complete.min.js +0 -0
  39. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/templates/lib/tom-select/tom-select.css +0 -0
  40. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/templates/lib/vis-10.1.2/vis-network.min.css +0 -0
  41. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/templates/lib/vis-10.1.2/vis-network.min.js +0 -0
  42. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/types/__init__.py +0 -0
  43. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/types/base.py +0 -0
  44. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/types/configure.py +0 -0
  45. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/types/interaction.py +0 -0
  46. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/types/layout.py +0 -0
  47. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/types/manipulation.py +0 -0
  48. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis/types/network.py +0 -0
  49. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis_optimized.egg-info/SOURCES.txt +0 -0
  50. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis_optimized.egg-info/dependency_links.txt +0 -0
  51. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis_optimized.egg-info/requires.txt +0 -0
  52. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/pyvis_optimized.egg-info/top_level.txt +0 -0
  53. {pyvis_optimized-4.4.0 → pyvis_optimized-4.5.0}/setup.cfg +0 -0
@@ -4,6 +4,66 @@ All notable changes to this project are documented in this file.
4
4
 
5
5
 
6
6
 
7
+ ## [4.5.0] - 2026-10-24
8
+
9
+ ### Breaking Changes
10
+ - **Duplicate node ids raise.** `add_node()` (and so `add_nodes()`/`from_nx()`)
11
+ raises `ValueError` when the id already exists, instead of warning and
12
+ ignoring the call. This reverses 4.3.0's "warn on duplicate nodes"; use
13
+ `update_node()` to change an existing node.
14
+ - **`Font(align="right")` is rejected.** vis-network honours `center`/`left`
15
+ for node labels and `horizontal`/`top`/`middle`/`bottom` for edge labels;
16
+ `NodeOptions`/`EdgeOptions` now raise `ValueError` for an align that does
17
+ nothing on that element.
18
+ - **`show()` follows `Network(notebook=...)`.** It used to default to notebook
19
+ mode regardless of the constructor. Since `Network()` defaults to
20
+ `notebook=False`, a bare `net.show("g.html")` in Jupyter now opens a browser
21
+ tab instead of returning an inline IFrame (a warning is emitted when a
22
+ Jupyter kernel is detected). Use `Network(notebook=True)` or
23
+ `show(..., notebook=True)` in notebooks.
24
+ - **`update_node(font_color=...)`** now sets the label colour instead of
25
+ storing a stray `font_color` key.
26
+
27
+ ### Added
28
+ - Graph query helpers: `get_node_ids()`, `get_edge_ids()`, `get_neighbors()`,
29
+ `get_node_degree()` and `has_edge()`.
30
+ - `CDNResource` enum in `pyvis.vis_config` (string-compatible) for
31
+ `cdn_resources`.
32
+ - `update_node()`/`update_edge()` accept a plain dict as `options=`, like
33
+ `add_node()`/`add_edge()`.
34
+
35
+ ### Changed
36
+ - **Label colour precedence is the same on every path:** a per-node
37
+ `font_color` beats a colour inside `font`, which beats
38
+ `Network(font_color=...)`. Previously the plain-kwargs path let the network
39
+ colour overwrite `font={"color": ...}`.
40
+ - A string `font` such as `"14px arial"` is kept as given instead of being
41
+ replaced by `{"color": ...}`; a `font_color` passed with it is ignored with a
42
+ warning.
43
+ - `add_nodes(options=dict)` behaves like `add_nodes(options=NodeOptions(...))`
44
+ and no longer injects the default `shape`/`color`.
45
+ - `set_group()` styling now reaches vis-network (merged into
46
+ `options.groups`), and a node with a `group` no longer has `shape="dot"`
47
+ forced on it; groups without a shape still render as dots.
48
+ - `add_legend(step_x=..., step_y=...)` is deprecated; both never had an effect.
49
+ - Edge lookups in `update_edge()`/`remove_edge()` use an index (O(1)).
50
+
51
+ ### Fixed
52
+ - `add_nodes()` options paths coerce numpy ids, deep-copy options per node and
53
+ no longer validate kwargs they then ignore.
54
+ - `font_color` inside an `options` dict is applied instead of stored as a
55
+ stray key; caller `font` and edge option dicts are no longer mutated.
56
+ - `from_nx()` drops an edge `options` attribute as it already did for nodes.
57
+ - `get_network_json()` warns for DOT networks; `generate_html()` warns when
58
+ `edge_attribute_edit` overrides `manipulation.enabled=False`.
59
+ - Legend edges draw `from` and `both` arrowheads.
60
+ - Shiny: `cluster_node_properties` is sent as vis.js `clusterNodeProperties`
61
+ (it was silently ignored) and `stabilize(iterations=0)` is honoured.
62
+ - Docs: tutorial, install guide, API reference, Shiny guide and developer docs
63
+ match the current API.
64
+ - Packaging: `notebooks/lib` re-synced with the package (tom-select 2.4.3),
65
+ conda recipes check the same files, `environment.yml` uses `shiny>=1.0`.
66
+
7
67
  ## [4.4.0] - 2026-09-06
8
68
 
9
69
  ### Breaking Changes
@@ -60,25 +120,6 @@ described under 4.3.0 below ships here instead.
60
120
  - pass font_color to template and validate against CSS injection
61
121
 
62
122
  ### Fixed
63
- - preserve per-node font_color through from_nx
64
- - validate every Literal field, correct font align and arrow type sets
65
- - release listeners and registry entries when a network output is cleared or removed
66
- - null args, command queueing, container sizing, config fallback and configChange
67
- - keep numeric node ids intact in updateData, search restore and edge editing
68
- - drop unsupported cluster() and omit absent arguments instead of sending null
69
- - correct update_data and package docstrings, pin the output config attribute
70
- - resolve module namespaces for controller and standalone network commands
71
- - apply module physics toggle on a copy and only when the control is rendered
72
- - build module networks from the documented dict spec
73
- - drop dead configure plumbing and repair the edge editing example
74
- - isolate get_network_json, harden edge keys and from_nx, correct docstrings
75
- - copy local lib resources beside the HTML file and refresh stale copies
76
- - detect cycles and validate dict keys in from_nx numpy coercion
77
- - recurse into lists/dicts when coercing numpy scalars in from_nx
78
- - accept plain dict options in add_node/add_edge and apply font_color on the typed path
79
- - coerce numpy scalars in from_nx instead of dropping attributes
80
- - load the notebook template lazily in generate_html
81
- - render when physics is a bool or a node title is not a string
82
123
  - parameterize collection types, constrain Literal fields, add type guard tests, fix layout doctype
83
124
  - CI subshell bug, duplicate tests, float string conversion, addEventListener, legend validation, renames cache, recipe guards
84
125
  - add error context to write_html file operations
@@ -15,7 +15,6 @@ recursive-include notebooks *.ipynb *.csv *.dot
15
15
 
16
16
  # Exclude development files
17
17
  exclude .gitignore
18
- exclude .coveragerc
19
18
  recursive-exclude * __pycache__
20
19
  recursive-exclude * *.py[co]
21
20
  recursive-exclude * .pytest_cache
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyvis-optimized
3
- Version: 4.4.0
3
+ Version: 4.5.0
4
4
  Summary: A Python network graph visualization library - Optimized Edition
5
5
  Author-email: Jose Unpingco <datascience@westhealth.org>
6
6
  Maintainer: PyVis Contributors
@@ -232,10 +232,10 @@ See the [Shiny Integration Guide](docs/SHINY_INTEGRATION_GUIDE.md) for complete
232
232
  ## Testing
233
233
 
234
234
  ```bash
235
- pytest pyvis/tests/ --ignore=pyvis/tests/test_html.py -v
235
+ pytest pyvis/tests/ --ignore=pyvis/tests/test_html.py --ignore=pyvis/tests/test_bindings_js.py --ignore=pyvis/tests/test_shiny_e2e.py -v
236
236
  ```
237
237
 
238
- That command runs 474 tests covering core network operations, typed options, Shiny integration, security, error handling, and regression tests for edge cases. The full suite is 495 (run `pytest --co` for the current count); the extra 21 are the Playwright browser tests in `test_html.py`, `test_bindings_js.py`, and `test_shiny_e2e.py`, which need `pip install pyvis-optimized[test]` followed by `python -m playwright install chromium`.
238
+ That command runs the non-browser tests (the same set CI's `test` job runs), covering core network operations, typed options, Shiny integration, security, error handling, and regression tests for edge cases. The three ignored files are the Playwright browser tests, which need `pip install pyvis-optimized[test]` followed by `python -m playwright install chromium`. Run `pytest --co -q` for the current counts.
239
239
 
240
240
  ## Versioning
241
241
 
@@ -260,7 +260,7 @@ pyvis/
260
260
  shiny/ # Shiny for Python integration
261
261
  wrapper.py # Controller, standalone functions, rendering
262
262
  bindings.js # JavaScript binding for vis-network
263
- tests/ # 495 tests across 29 modules (see `pytest --co` for current count)
263
+ tests/ # Test suite (see `pytest --co` for the current count)
264
264
  auto_version.py # Version bump + changelog + tag script
265
265
  ```
266
266
 
@@ -180,10 +180,10 @@ See the [Shiny Integration Guide](docs/SHINY_INTEGRATION_GUIDE.md) for complete
180
180
  ## Testing
181
181
 
182
182
  ```bash
183
- pytest pyvis/tests/ --ignore=pyvis/tests/test_html.py -v
183
+ pytest pyvis/tests/ --ignore=pyvis/tests/test_html.py --ignore=pyvis/tests/test_bindings_js.py --ignore=pyvis/tests/test_shiny_e2e.py -v
184
184
  ```
185
185
 
186
- That command runs 474 tests covering core network operations, typed options, Shiny integration, security, error handling, and regression tests for edge cases. The full suite is 495 (run `pytest --co` for the current count); the extra 21 are the Playwright browser tests in `test_html.py`, `test_bindings_js.py`, and `test_shiny_e2e.py`, which need `pip install pyvis-optimized[test]` followed by `python -m playwright install chromium`.
186
+ That command runs the non-browser tests (the same set CI's `test` job runs), covering core network operations, typed options, Shiny integration, security, error handling, and regression tests for edge cases. The three ignored files are the Playwright browser tests, which need `pip install pyvis-optimized[test]` followed by `python -m playwright install chromium`. Run `pytest --co -q` for the current counts.
187
187
 
188
188
  ## Versioning
189
189
 
@@ -208,7 +208,7 @@ pyvis/
208
208
  shiny/ # Shiny for Python integration
209
209
  wrapper.py # Controller, standalone functions, rendering
210
210
  bindings.js # JavaScript binding for vis-network
211
- tests/ # 495 tests across 29 modules (see `pytest --co` for current count)
211
+ tests/ # Test suite (see `pytest --co` for the current count)
212
212
  auto_version.py # Version bump + changelog + tag script
213
213
  ```
214
214
 
@@ -0,0 +1 @@
1
+ __version__ = '4.5.0'