d3graph 3.1.0__tar.gz → 3.1.2__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,3 +1,4 @@
1
1
  include d3graph/d3js/*.js
2
2
  include d3graph/d3js/*.css
3
3
  include d3graph/d3js/*.j2
4
+ include d3graph/d3js/logo.txt
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: d3graph
3
- Version: 3.1.0
3
+ Version: 3.1.2
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
@@ -17,7 +17,7 @@ from d3graph.d3graph import (
17
17
 
18
18
  __author__ = 'Erdogan Tasksen'
19
19
  __email__ = 'erdogant@gmail.com'
20
- __version__ = '3.1.0'
20
+ __version__ = '3.1.2'
21
21
 
22
22
  # Setup root logger
23
23
  _logger = logging.getLogger('d3graph')
@@ -98,7 +98,7 @@ class d3graph:
98
98
  # Set paths
99
99
  self.config['curpath'] = os.path.dirname(os.path.abspath(__file__))
100
100
  self.config['d3_library'] = os.path.abspath(os.path.join(self.config['curpath'], 'd3js/d3.v3.js'))
101
- self.config['d3_script'] = os.path.abspath(os.path.join(self.config['curpath'], 'd3js/d3graphscript.js'))
101
+ self.config['d3_script'] = os.path.abspath(os.path.join(self.config['curpath'], 'd3js/d3graph.js'))
102
102
  self.config['css'] = os.path.abspath(os.path.join(self.config['curpath'], 'd3js/style.css'))
103
103
 
104
104
  def _clean(self, clean_config: bool = True) -> None:
@@ -908,7 +908,7 @@ class d3graph:
908
908
  jinja_env = Environment(loader=PackageLoader(package_name=__name__, package_path='d3js'))
909
909
  except:
910
910
  jinja_env = Environment(loader=PackageLoader(package_name='d3graph', package_path='d3js'))
911
- index_template = jinja_env.get_template('index.html.j2')
911
+ index_template = jinja_env.get_template('d3graph.html.j2')
912
912
  html = index_template.render(content)
913
913
 
914
914
  index_file = self.config['filepath']
@@ -19,11 +19,23 @@
19
19
  HTML into a page that supplies its own button chrome but still wants
20
20
  the slider). -->
21
21
  {% if show_controls or max_slider > min_slider %}
22
- <div class="header-row">
23
- <div class="search-wrap">
24
- <input class="search-input" id="searchInput" type="search" placeholder="Find a node…" autocomplete="off" spellcheck="false" />
25
- <div class="search-results" id="searchResults"></div>
22
+ <div class="header-row">
23
+
24
+ <div class="header-row-left">
25
+ <div class="top-panel-left">
26
+ <a href="https://d3blocks.github.io/d3blocks/" title="D3Blocks">
27
+ <img src="{% include 'logo.txt' %}" alt="D3Blocks" style="width:150px;height:auto;display:block;pointer-events:auto" />
28
+ </a>
29
+ </div>
26
30
  </div>
31
+
32
+ <div class="header-row-left">
33
+ <div class="search-wrap">
34
+ <input class="search-input" id="searchInput" type="search" placeholder="Find a node…" autocomplete="off" spellcheck="false" />
35
+ <div class="search-results" id="searchResults"></div>
36
+ </div>
37
+ </div>
38
+
27
39
  {% if max_slider > min_slider %}
28
40
  {{ slider_comment_start }}
29
41
  <div class="slider-container">
@@ -37,11 +49,13 @@
37
49
  {{ slider_comment_stop }}
38
50
  {% endif %}
39
51
  {% if show_controls %}
52
+
40
53
  <div class="top-panel">
41
54
  <button id="darkModeSwitch" class="button-switch">{% if dark_mode %}☀ Light Mode{% else %}🌙 Dark Mode{% endif %}</button>
42
55
  <button id="edgeToggleButton" class="button-switch">Hide Edges</button>
43
56
  <button id="densityToggleButton" class="button-switch">{% if show_density %}Hide Density{% else %}Show Density{% endif %}</button>
44
57
  </div>
58
+
45
59
  {% endif %}
46
60
  </div>
47
61
  {% endif %}
@@ -50,6 +64,7 @@
50
64
  <!-- Side panel: data/image export actions, previously loose buttons in the
51
65
  top-panel row — grouped here since they're one-off actions rather than
52
66
  persistent view controls, and it keeps the top-panel row shorter. -->
67
+
53
68
  <div class="stats-panel collapsed" id="exportPanel">
54
69
  <div class="stats-panel-title">Export<span class="stats-panel-toggle" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg></span></div>
55
70
  <div class="stats-panel-body">
@@ -77,7 +92,7 @@
77
92
  <!-- Layout panel (Force-directed / Circular / Grid) removed from the UI -
78
93
  circular/grid felt too static to be useful. The underlying setLayout()/
79
94
 
80
- layoutCircular()/layoutGrid() functions are still in d3graphscript.js,
95
+ layoutCircular()/layoutGrid() functions are still in d3graph.js,
81
96
  just unwired, in case this is worth revisiting later. -->
82
97
 
83
98
  <!-- Side panel: interactively tune the force simulation -->
@@ -148,7 +163,7 @@
148
163
 
149
164
  <script>
150
165
  {% include "d3.v3.js" %}
151
- {% include "d3graphscript.js" %}
166
+ {% include "d3graph.js" %}
152
167
 
153
168
  graph = {{ json_data }}
154
169