Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix link map zoom after reload and some tweaks to springy
zadama81b00e130de
diff --git a/db/demo.tar b/db/demo.tarindex fde6a83ef6..4edf706364 100644Binary files a/db/demo.tar and b/db/demo.tar differdiff --git a/libraries/springy.js b/libraries/springy.jsindex a1e8d65f44..65ad9fecf5 100644--- a/libraries/springy.js+++ b/libraries/springy.js@@ -417,11 +417,12 @@{var d = point1.p.subtract(point2.p);var distance = d.magnitude() + 0.1; // avoid massive forces at small distances (and divide by zero)+var direction = d.normalise();// apply force to each end point- point1.applyForce(direction.multiply(this.repulsion).divide(distance * distance * 0.5));- point2.applyForce(direction.multiply(this.repulsion).divide(distance * distance * -0.5));+ point1.applyForce(direction.multiply(this.repulsion).divide(distance * distance * distance * 0.5));+ point2.applyForce(direction.multiply(this.repulsion).divide(distance * distance * distance * -0.5));}});});diff --git a/src/public/javascripts/services/link_map.js b/src/public/javascripts/services/link_map.jsindex bacf44490d..04b5af0430 100644--- a/src/public/javascripts/services/link_map.js+++ b/src/public/javascripts/services/link_map.js@@ -65,8 +65,9 @@ export default class LinkMap {graph,// param explanation here: https://github.com/dhotson/springy/issues/58400.0, // Spring stiffness- 400.0, // Node repulsion- 0.15 // Damping+ 600.0, // Node repulsion+ 0.15, // Damping+ 0.1 // min energy threshold);const getNoteBox = noteId => {@@ -163,9 +164,6 @@ export default class LinkMap {);this.renderer.start();-- // long rendering is annoying and by 3rd seconds the basic layout should be finished- setTimeout(() => this.renderer.stop(), 3000);}moveToCenterOfElement(element) {@@ -213,7 +211,7 @@ export default class LinkMap {this.$linkMapContainer.empty();// reset zoom/pan- this.pzInstance.zoomTo(0, 0, this.options.zoom);+ this.pzInstance.zoomAbs(0, 0, this.options.zoom);this.pzInstance.moveTo(0, 0);}