Comments (5)
Before use function zoomTo set value:
sigInst._core.mousecaptor.isMouseDown = !sigInst._core.mousecaptor.isMouseDown;
OR
sigInst._core.mousecaptor.isMouseDown = TRUE;
from sigma.js.
Thanks but following your suggestion in a previous post I've already attempted this way and it doesn't work. with this line before the zoomTo the search don't even start (the graph doesn't move at all)...any idea?
from sigma.js.
Solved changing draw() with draw(2,2,2). Now the problem is that I cannot search for another node while I'm zoomed on the first one. The graph move to a total different place. Probably there is an issue with coordinates system and how displayX/Y are updated?
from sigma.js.
Dirty way to solve is to put a position(0,0,1) before the zoomTo
from sigma.js.
When i search any name on my inputBox then name node comes to the center and Zoom in. I tried according to you , but i can't do. I hope so u give me positive response as soon as possible. i written my code below plz check it & guide me -
function init() {
var sigInst = sigma.init($('#sigma-example')[0]).drawingProperties({
defaultLabelColor: "#ffffff",
defaultLabelSize: 14,
defaultLabelBGColor: "#ffffff",
defaultHoverLabelBGColor: "#ffffff",
defaultLabelHoverColor: "#000000",
labelThreshold: 10,
defaultEdgeType: "curve",
hoverFontStyle: "bold",
fontStyle: "bold",
activeFontStyle: "bold"
})
.graphProperties({
minNodeSize: 1,
maxNodeSize: 7,
minEdgeSize: 0.2,
maxEdgeSize: 0.5
})
.mouseProperties({
minRatio: 0.75, // How far can we zoom out?
maxRatio: 20, // How far can we zoom in?
});
sigInst.parseJson("js/demo.php",
function(){
sigInst.draw(2,2,2);
//sigInst.position(0,0,1).draw();
var $mysearch = $('#searchsubtmit');
var x = document.getElementById("searchResult");
$mysearch.bind('click',function(){
var saveInputValue = document.getElementById('searchbox').value;
var a;
var b = !1;
b = this.exactMatch?("^"+saveInputValue+"$").toLowerCase():saveInputValue.toLowerCase();
// alert(b);
var node;
sigInst.iterNodes(function(n){
node = n;
//console.log(n.label);
var c = !1;
c = this.exactMatch?("^"+n.label+"$").toLowerCase():n.label.toLowerCase();
// alert(b);
//------------------------- This code for zoom in & center
if(b == c){
sigInst._core.mousecaptor.isMouseDown = !sigInst._core.mousecaptor.isMouseDown;
sigma.instances[1].zoomTo(n['displayX'],n['displayY'],5);
x.innerHTML = c
alert(n.label);
}
}
)
}
)draw(2,2,2);
-------------------------//
});
Thank u
from sigma.js.
Related Issues (20)
- about loop edge, curved edge, quadratic edge HOT 2
- v3.0.0-beta.10: Package.json module (esm) export "./rendering" incomplete HOT 3
- Node scaling issue on MacOS with NodeBorderProgram and NodePointProgram HOT 8
- NodeCircleProgram is buggy on Chrome mobile
- @sigma/edge-curve is buggy on Chrome mobile
- How do I do custom shapes? HOT 1
- Create a snapshot of "sigma-containter" HOT 1
- Questions about the use of the sigma HOT 1
- The error of edge reduce HOT 3
- Optimizing Zoom Functionality for Scalable Graphics HOT 3
- CDN release for latest version HOT 4
- Sigma with VueJs HOT 2
- Utility functions not available when loading sigma statically via cdn HOT 1
- Add Kenelyze to the In The Wild section
- Changing programs with `setSetting` has no effect HOT 1
- Height and width for images in nodes HOT 2
- Angular: update from 2.4 to sigma 3.0 beta, cannot find type declarations error during compile HOT 2
- Opacity for edges HOT 1
- Combined (border+image) Program Node Rendering Issue
- Can't set Edge Size Smaller than 1 in 2.4.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sigma.js.