Comments (4)
Most likely all the extra time is spent building the quadtree index in SigmaJS: https://github.com/jacomyal/sigma.js/blob/9c940aa9b162c7aaaf8b25d88e236cb847c1633a/src/sigma.core.js#L548
For instance, if you are using curve
or curvedArrow
edges that takes extra time to calculate shape: https://github.com/jacomyal/sigma.js/blob/31cc1ee3baf321d355f5597ba4d7e9fc8e2c6ff2/src/classes/sigma.classes.edgequad.js#L711
Did you check profiler? It should show what consumes most of the time. Also check if you got enough of free RAM.
from react-sigma.
Thanks for your replay.
I also tried curvedArrow but it doesn't affect the performance. Could you take a look at my code?
<Sigma
style={{width:"100%", height:"720px", backgroundColor:"#19193b"}}
renderer="canvas"
graph={this.state.bigGraph}
settings={{
drawEdges: true,
drawLabels: true,
drawEdgeLabels: false,
labelThreshold: 0,
enableEdgeHovering:true,
edgeHoverExtremities: true,
defaultLabelColor:"#dddddd",
}}
>
<EdgeShapes default="curvedArrow" />
<ForceLink
worker={true}
barnesHutOptimize={false}
slowDown={5}
gravity={1}
timeout={10000}
/>
<RandomizeNodePositions />
<RelativeSize initialSize={15} />
</Sigma>
If I remove the "enableEdgeHovering:true", it works good without any delays even if I set the "curvedArrow".
Do you think it is normal? Why "enableEdgeHovering" doesn't have the same performance with "EdgeSphapes"?
Thanks so much.
from react-sigma.
I think you are right, it is the building of the quadtree index consumes time. I try to remove this piece of code, it works good.
if (
c.edgequadtree !== undefined &&
c.settings('drawEdges') &&
c.settings('enableEdgeHovering')
) {
c.edgequadtree.index(this.graph, {
prefix: c.readPrefix,
bounds: {
x: bounds.minX,
y: bounds.minY,
width: bounds.maxX - bounds.minX,
height: bounds.maxY - bounds.minY
}
});
}
But do you think 3 seconds delay is normal?
from react-sigma.
If you set edge shapes to line it should work faster, curved and curvedArrow are slower because it calculates curve edges.
<EdgeShapes default="line"/>
https://github.com/dunnock/react-sigma/blob/master/DOCS.md#edgeshapes
from react-sigma.
Related Issues (20)
- How to add a color individual label?
- Styling the Graph HOT 2
- Node type not quite working as expected
- Node type issues HOT 1
- Force Atlas when using Data programatically HOT 1
- Use with NextJS
- HOW TO: Tailwindcss integration
- typescript for react-sigma/lib/Dagre? HOT 1
- onDoubleClick eventHandler to add more interactive actions HOT 2
- Filter component seems to only apply to the first instance
- Reload sigma graph with new layout? HOT 1
- Version mismatch issue
- A complete example on how to update the graph after initialization HOT 2
- TypeScript: React-Sigma not rendering HOT 6
- Graph not rendering HOT 2
- Issue: Graph edges sometimes doesn't render
- How to disable the camera from moving on mousedown? HOT 1
- Overlapping edges and edge labels HOT 2
- Running ForceAtlas2 from a set position. HOT 2
- Sigma wont Render graph after data passed from a fetch request response HOT 4
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 react-sigma.