mkdocs-nodegraph 0.3.0__tar.gz → 0.4.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 (20) hide show
  1. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/PKG-INFO +2 -2
  2. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph/__init__.py +1 -1
  3. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph/nodegraph/templates/template.html +170 -108
  4. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph.egg-info/PKG-INFO +2 -2
  5. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/setup.py +2 -2
  6. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/README.md +0 -0
  7. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph/nodegraph/__init__.py +0 -0
  8. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph/nodegraph/generate_graph.py +0 -0
  9. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph/nodegraph/graph_opts.json +0 -0
  10. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph/nodegraph/mdfile.py +0 -0
  11. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph/nodegraph/mdparser.py +0 -0
  12. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph/nodegraph/pyvis_opts.js +0 -0
  13. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph/nodegraph/templates/__init__.py +0 -0
  14. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph/plugin.py +0 -0
  15. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph.egg-info/SOURCES.txt +0 -0
  16. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph.egg-info/dependency_links.txt +0 -0
  17. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph.egg-info/entry_points.txt +0 -0
  18. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph.egg-info/requires.txt +0 -0
  19. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/mkdocs_nodegraph.egg-info/top_level.txt +0 -0
  20. {mkdocs_nodegraph-0.3.0 → mkdocs_nodegraph-0.4.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mkdocs-nodegraph
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Node Graph plugin for Mkdocs Material
5
5
  Home-page: https://yonge123.github.io/mkdocs-nodegraph/nodegraph.html
6
6
  Author: JeongYong Hwang
@@ -9,7 +9,7 @@ License: MIT
9
9
  Project-URL: Source, https://github.com/yonge123/mkdocs-nodegraph/tree/master
10
10
  Project-URL: Bug Tracker, https://github.com/yonge123/mkdocs-nodegraph/issues
11
11
  Project-URL: Documentation, https://github.com/yonge123/mkdocs-nodegraph/tree/master
12
- Keywords: mkdocs,plugin,nodegraph
12
+ Keywords: mkdocs-nodegraph,mkdocs,mkdocs-material,markdown node,graph,nodenetwork,nodeview,graphview,networkgraph,plugin,nodegraph,markdown
13
13
  Requires-Python: >=3.9
14
14
  Description-Content-Type: text/markdown
15
15
  Requires-Dist: mkdocs>=1.4.0
@@ -1,3 +1,3 @@
1
1
  from mkdocs_nodegraph.plugin import GraphViewPlugin
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "0.4.0"
@@ -154,9 +154,10 @@
154
154
  min-height: 100vh;
155
155
  }
156
156
 
157
+
157
158
  .left-panel {
158
159
  background: #222222a6;
159
- width: 210px;
160
+ width: 270px;
160
161
  position: absolute;
161
162
  z-index: 2;
162
163
  border-radius: 10px;
@@ -197,17 +198,41 @@
197
198
  margin-top: 30px;
198
199
  }
199
200
 
201
+ .search-input {
202
+ position: relative;
203
+ width: 100%;
204
+ margin: 3px;
205
+ padding: 5px 5px 5px 5px;
206
+ background-color: white;
207
+ color: rgb(27, 27, 27);
208
+ border: 1px solid #ddd;
209
+ border-radius: 4px;
210
+ font-size: 16px;
211
+ box-sizing: border-box;
212
+ }
213
+ .search-button {
214
+ position: absolute;
215
+ right: 0px;
216
+ top: 37px;
217
+ background: none;
218
+ border: none;
219
+ cursor: pointer;
220
+ }
221
+ .search-icon {
222
+ width: 30px;
223
+ height: 30px;
224
+ }
225
+
200
226
  .physics-btn {
201
227
  font-size: 13px;
202
228
  position: relative;
203
- z-index: 1000;
204
229
  padding: 9px 9px;
205
230
  margin: 3px;
206
231
  background-color: hsl(122, 39%, 49%);
207
232
  color: white;
208
233
  border: none;
209
- border-radius: 2px;
210
- width: 200px;
234
+ border-radius: 4px;
235
+ width: 100%;
211
236
  cursor: pointer;
212
237
  }
213
238
 
@@ -218,14 +243,13 @@
218
243
  .save-btn {
219
244
  font-size: 13px;
220
245
  position: relative;
221
- z-index: 1000;
222
246
  padding: 9px 9px;
223
247
  margin: 3px;
224
248
  background-color: hsl(194, 42%, 45%);
225
249
  color: white;
226
250
  border: none;
227
- border-radius: 2px;
228
- width: 200px;
251
+ border-radius: 4px;
252
+ width: 100%;
229
253
  cursor: pointer;
230
254
  }
231
255
 
@@ -236,25 +260,64 @@
236
260
  .reset-btn {
237
261
  font-size: 14px;
238
262
  position: relative;
239
- z-index: 1000;
240
263
  padding: 9px 9px;
241
264
  margin: 3px;
242
265
  background-color: hsl(0, 0%, 40%);
243
266
  color: white;
244
267
  border: none;
245
- width: 200px;
246
- border-radius: 2px;
268
+ width: 100%;
269
+ border-radius: 4px;
247
270
  cursor: pointer;
248
271
  }
249
272
 
250
273
  .reset-btn:hover {
251
274
  background-color: hsl(0, 0%, 50%);
252
275
  }
276
+ .home-btn {
277
+ font-size: 13px;
278
+ position: relative;
279
+ padding: 9px 9px;
280
+ margin: 3px;
281
+ background-color: hsl(0, 0%, 65%);
282
+ color: white;
283
+ border: none;
284
+ border-radius: 4px;
285
+ width: 100%;
286
+ cursor: pointer;
287
+ }
288
+
289
+ .home-btn:hover {
290
+ background-color: hsl(0, 0%, 71%);
291
+ }
253
292
 
254
293
  input {
255
294
  accent-color: gray;
256
295
  }
257
296
 
297
+ .control-label {
298
+ opacity: 0.9;
299
+ top: 0px;
300
+ left: 0px;
301
+ position: relative;
302
+ font-size: 16px;
303
+ font-weight: bold;
304
+ color: #4CAF50;
305
+ display: block;
306
+ margin-bottom: 5px;
307
+ width: 100%;
308
+ }
309
+
310
+ input[type="range"] {
311
+ color: gray;
312
+ opacity: 0.5;
313
+ width: 100%;
314
+ height: 10px;
315
+ background: #d3d3d3;
316
+ outline: none;
317
+ border-radius: 8px;
318
+ margin-bottom: 6px;
319
+ }
320
+
258
321
  </style>
259
322
  </head>
260
323
 
@@ -337,162 +400,88 @@
337
400
 
338
401
  <div class="panel-content">
339
402
 
403
+ <input type="text" id="searchInput" class="search-input" placeholder="Search...">
404
+ <button id="searchButton" class="search-button">
405
+ <svg class="search-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
406
+ <circle cx="11" cy="11" r="8"></circle>
407
+ <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
408
+ </svg>
409
+ </button>
340
410
  <button class="physics-btn" id="btn_physics" >Physics: ON</button>
341
411
  <button class="save-btn" id="btn_save_node_positions" >Save</button>
412
+ <button class="home-btn" id="btn_home_location" >Home</button>
342
413
  <button class="reset-btn" id="btn_reset_preferences" >Reset</button>
343
414
 
344
- <span id="text_gravitationalConstant" style="
345
- opacity: 0.9;
346
- top: 0px;
347
- left: 0px;
348
- position: relative;
349
- font-size: 16px;
350
- font-weight: bold;
351
- color: #4CAF50;">
415
+ <span id="text_gravitationalConstant" class="control-label">
352
416
  Gravitational Constant
353
417
  </span>
354
418
  <input id="slider_gravitationalConstant"
355
419
  type="range"
356
420
  min="-5000"
357
- max="1100"
358
- style="
359
- color: gray;
360
- opacity: 0.5;
361
- width: 200px;">
421
+ max="1100">
362
422
  </input>
363
423
 
364
- <span id="text_centralGravity" style="
365
- opacity: 0.9;
366
- top: 0px;
367
- left: 0px;
368
- position: relative;
369
- font-size: 16px;
370
- font-weight: bold;
371
- color: #4CAF50;">
424
+ <span id="text_centralGravity" class="control-label">
372
425
  CentralGravity
373
426
  </span>
374
427
  <input id="slider_centralGravity"
375
428
  type="range"
376
429
  min="0"
377
- max="100"
378
- style="
379
- opacity: 0.5;
380
- width: 200px;">
430
+ max="100">
381
431
  </input>
382
432
 
383
- <span id="text_springConstant" style="
384
- opacity: 0.9;
385
- top: 0px;
386
- left: 0px;
387
- position: relative;
388
- font-size: 16px;
389
- font-weight: bold;
390
- color: #4CAF50;">
433
+ <span id="text_springConstant" class="control-label">
391
434
  Spring Constant
392
435
  </span>
393
436
  <input id="slider_springConstant"
394
437
  type="range"
395
438
  min="0"
396
- max="100"
397
- style="
398
- opacity: 0.5;
399
- width: 200px;">
439
+ max="100">
400
440
  </input>
401
441
 
402
- <span id="text_damping" style="
403
- opacity: 0.9;
404
- top: 0px;
405
- left: 0px;
406
- position: relative;
407
- font-size: 16px;
408
- font-weight: bold;
409
- color: #4CAF50;">
442
+ <span id="text_damping" class="control-label">
410
443
  Damping
411
444
  </span>
412
445
  <input id="slider_damping"
413
446
  type="range"
414
447
  min="0"
415
- max="50"
416
- style="
417
- opacity: 0.5;
418
- width: 200px;">
448
+ max="50">
419
449
  </input>
420
450
 
421
- <span id="text_fontSize" style="
422
- opacity: 0.9;
423
- top: 0px;
424
- left: 0px;
425
- position: relative;
426
- font-size: 16px;
427
- font-weight: bold;
428
- color: #4CAF50;">
451
+ <span id="text_fontSize" class="control-label">
429
452
  Font Size
430
453
  </span>
431
454
  <input id="slider_fontSize"
432
455
  type="range"
433
456
  min="30"
434
- max="200"
435
- style="
436
- opacity: 0.5;
437
- width: 200px;">
457
+ max="200">
438
458
  </input>
439
459
 
440
- <span id="text_nodeSize" style="
441
- opacity: 0.9;
442
- top: 0px;
443
- left: 0px;
444
- position: relative;
445
- font-size: 16px;
446
- font-weight: bold;
447
- color: #4CAF50;">
460
+ <span id="text_nodeSize" class="control-label">
448
461
  Node Size
449
462
  </span>
450
463
  <input id="slider_nodeSize"
451
464
  type="range"
452
465
  min="1"
453
- max="100"
454
- style="
455
- opacity: 0.5;
456
- width: 200px;">
466
+ max="100">
457
467
  </input>
458
468
 
459
- <span id="text_edgeLength" style="
460
- opacity: 0.9;
461
- top: 0px;
462
- left: 0px;
463
- position: relative;
464
- font-size: 16px;
465
- font-weight: bold;
466
- color: #4CAF50;">
469
+ <span id="text_edgeLength" class="control-label">
467
470
  Edge Length
468
471
  </span>
469
472
  <input id="slider_edgeLength"
470
473
  type="range"
471
474
  min="1"
472
- max="100"
473
- style="
474
- opacity: 0.5;
475
- width: 200px;">
475
+ max="100">
476
476
  </input>
477
477
 
478
-
479
- <span id="text_edgeWidth" style="
480
- opacity: 0.9;
481
- top: 0px;
482
- left: 0px;
483
- position: relative;
484
- font-size: 16px;
485
- font-weight: bold;
486
- color: #4CAF50;">
478
+ <span id="text_edgeWidth" class="control-label">
487
479
  Edge Width
488
480
  </span>
489
481
  <input id="slider_edgeWidth"
490
482
  type="range"
491
483
  min="1"
492
- max="100"
493
- style="
494
- opacity: 0.5;
495
- width: 200px;">
484
+ max="100">
496
485
  </input>
497
486
 
498
487
  </div>
@@ -850,7 +839,67 @@
850
839
  }
851
840
  savePreferences();
852
841
  }
842
+
843
+ // Reset all node highlights
844
+ function resetHighlight() {
845
+ nodes.forEach(node => {
846
+ nodes.update({
847
+ id: node.id,
848
+ font: {
849
+ color: node.color,
850
+ bold: false,
851
+ size: preferences.fontSize
852
+ }
853
+ });
854
+ });
855
+ }
856
+
857
+ function searchNode() {
858
+ resetHighlight(); // Reset any previous highlights
859
+
860
+ const searchTerm = document.getElementById("searchInput").value.toLowerCase();
861
+ if (!searchTerm) return;
862
+
863
+ const matchingNodes = [];
864
+
865
+ // Find nodes containing the search term
866
+ nodes.forEach(node => {
867
+ if (node.label.toLowerCase().includes(searchTerm)) {
868
+ matchingNodes.push(node.id);
869
+
870
+ // Highlight the matching node by changing font color and making it bold
871
+ nodes.update({
872
+ id: node.id,
873
+ font: {
874
+ color: "yellow",
875
+ bold: true,
876
+ size: (preferences.fontSize * 2),
877
+ }
878
+ });
879
+ }
880
+ });
881
+
882
+ // Focus the network on matched nodes if any found
883
+ if (matchingNodes.length > 0) {
884
+ network.focus(matchingNodes[0], {
885
+ scale: 1.2,
886
+ animation: true
887
+ });
888
+ }
889
+ }
890
+
891
+ // Get DOM elements
892
+ const searchInput = document.getElementById('searchInput');
893
+ const searchButton = document.getElementById('searchButton');
853
894
 
895
+ // Add event listeners
896
+ searchButton.addEventListener('click', searchNode);
897
+ searchInput.addEventListener('keyup', function(event) {
898
+ if (event.key === 'Enter') {
899
+ searchNode();
900
+ }
901
+ });
902
+
854
903
  // Physics
855
904
  const btn_physics = document.getElementById('btn_physics');
856
905
  btn_physics.onclick = togglePhysics;
@@ -866,6 +915,10 @@
866
915
  saveViewState();
867
916
  }
868
917
 
918
+ // Home Location
919
+ const btn_home_location = document.getElementById('btn_home_location');
920
+ btn_home_location.onclick = homeLocation;
921
+
869
922
  // Reset
870
923
  const btn_reset_preferences = document.getElementById('btn_reset_preferences');
871
924
  btn_reset_preferences.onclick = resetPreferences;
@@ -993,6 +1046,15 @@
993
1046
  loadPhysics();
994
1047
  loadViewState();
995
1048
  }
1049
+
1050
+ function homeLocation(){
1051
+ viewState = {"position":{"x":122.26498687735877,"y":1344.4657619150016},"scale":0.14563667453404308}
1052
+ localStorage.setItem('networkViewState', JSON.stringify(viewState));
1053
+ network.moveTo({
1054
+ position: viewState.position,
1055
+ scale: viewState.scale
1056
+ });
1057
+ }
996
1058
 
997
1059
  function resetPreferences(){
998
1060
  document.getElementById('btn_physics').value = default_preferences.physics;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mkdocs-nodegraph
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Node Graph plugin for Mkdocs Material
5
5
  Home-page: https://yonge123.github.io/mkdocs-nodegraph/nodegraph.html
6
6
  Author: JeongYong Hwang
@@ -9,7 +9,7 @@ License: MIT
9
9
  Project-URL: Source, https://github.com/yonge123/mkdocs-nodegraph/tree/master
10
10
  Project-URL: Bug Tracker, https://github.com/yonge123/mkdocs-nodegraph/issues
11
11
  Project-URL: Documentation, https://github.com/yonge123/mkdocs-nodegraph/tree/master
12
- Keywords: mkdocs,plugin,nodegraph
12
+ Keywords: mkdocs-nodegraph,mkdocs,mkdocs-material,markdown node,graph,nodenetwork,nodeview,graphview,networkgraph,plugin,nodegraph,markdown
13
13
  Requires-Python: >=3.9
14
14
  Description-Content-Type: text/markdown
15
15
  Requires-Dist: mkdocs>=1.4.0
@@ -5,13 +5,13 @@ with open('README.md', 'r') as fin:
5
5
 
6
6
  setup(
7
7
  name="mkdocs-nodegraph",
8
- version="0.3.0",
8
+ version="0.4.0",
9
9
  description="Node Graph plugin for Mkdocs Material",
10
10
  long_description=long_description,
11
11
  long_description_content_type="text/markdown",
12
12
  author="JeongYong Hwang",
13
13
  author_email="yonge123@gmail.com",
14
- keywords=["mkdocs", "plugin", "nodegraph"],
14
+ keywords=["mkdocs-nodegraph", "mkdocs", "mkdocs-material", "markdown node", "graph", "nodenetwork", "nodeview", "graphview", "networkgraph", "plugin", "nodegraph", "markdown"],
15
15
  url="https://yonge123.github.io/mkdocs-nodegraph/nodegraph.html",
16
16
  project_urls={
17
17
  "Source": "https://github.com/yonge123/mkdocs-nodegraph/tree/master",