d3graph 2.9.6__tar.gz → 3.0.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: d3graph
3
- Version: 2.9.6
3
+ Version: 3.0.0
4
4
  Summary: Python package to create interactive network based on d3js.
5
5
  Author-email: Erdogan Taskesen <erdogant@gmail.com>
6
6
  License-Expression: BSD-3-Clause
@@ -105,8 +105,8 @@ from d3graph import d3graph
105
105
 
106
106
 
107
107
  <p align="left">
108
- <a href="https://erdogant.github.io/docs/d3graph/titanic_example/index.html">
109
- <img src="https://github.com/d3blocks/d3blocks/blob/main/docs/figs/d3graph/socialmedia.gif" width="1000"/>
108
+ <a href="http://erdogant.github.io/docs/d3graph/d3graph/socialmedia.html">
109
+ <img src="http://erdogant.github.io/docs/d3graph/d3graph/socialmedia.gif" width="1000"/>
110
110
  </a>
111
111
  </p>
112
112
 
@@ -74,8 +74,8 @@ from d3graph import d3graph
74
74
 
75
75
 
76
76
  <p align="left">
77
- <a href="https://erdogant.github.io/docs/d3graph/titanic_example/index.html">
78
- <img src="https://github.com/d3blocks/d3blocks/blob/main/docs/figs/d3graph/socialmedia.gif" width="1000"/>
77
+ <a href="http://erdogant.github.io/docs/d3graph/d3graph/socialmedia.html">
78
+ <img src="http://erdogant.github.io/docs/d3graph/d3graph/socialmedia.gif" width="1000"/>
79
79
  </a>
80
80
  </p>
81
81
 
@@ -17,7 +17,7 @@ from d3graph.d3graph import (
17
17
 
18
18
  __author__ = 'Erdogan Tasksen'
19
19
  __email__ = 'erdogant@gmail.com'
20
- __version__ = '2.9.6'
20
+ __version__ = '3.0.0'
21
21
 
22
22
  # Setup root logger
23
23
  _logger = logging.getLogger('d3graph')
@@ -129,6 +129,7 @@ class d3graph:
129
129
  density_blur: int = 15,
130
130
  density_opacity: float = 0.8,
131
131
  show_controls: bool = True,
132
+ highlight_full_network: bool = True,
132
133
  ) -> None:
133
134
  """Build and show the graph.
134
135
 
@@ -216,6 +217,13 @@ class d3graph:
216
217
  just hidden, so there's no extra DOM/clutter in the embed. The weight/component
217
218
  sliders are controlled separately via show_slider; the Save button specifically
218
219
  is also controlled via save_button, independent of this.
220
+ highlight_full_network : bool, (default: True)
221
+ Controls how much of the graph lights up when a node is clicked.
222
+ True: The entire connected network reachable from the clicked node (every node
223
+ and edge in its connected component, not just its direct neighbors) is
224
+ highlighted; everything outside that component is dimmed.
225
+ False: Only the clicked node's directly-connected neighbors/edges (one hop)
226
+ are highlighted, matching the old default behavior.
219
227
 
220
228
  Returns
221
229
  -------
@@ -246,6 +254,7 @@ class d3graph:
246
254
  self.config['density_blur'] = density_blur
247
255
  self.config['density_opacity'] = density_opacity
248
256
  self.config['show_controls'] = show_controls
257
+ self.config['highlight_full_network'] = highlight_full_network
249
258
 
250
259
  # Allow show() to override the link_tension set at __init__ time
251
260
  if link_tension is not None:
@@ -874,6 +883,7 @@ class d3graph:
874
883
  'density_blur': self.config.get('density_blur', 8),
875
884
  'density_opacity': self.config.get('density_opacity', 0.6),
876
885
  'show_controls': self.config.get('show_controls', True),
886
+ 'highlight_full_network': self.config.get('highlight_full_network', True),
877
887
  'save_button': self.config['save_button'],
878
888
  'node_text_inside': self.config.get('node_text_inside', False),
879
889
  'CLICK_COMMENT': CLICK_COMMENT,