-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opacity for edges #1426
Comments
+1 |
Hum, that's weird, sigma does support alpha values: It looks like there is an issue with how the alpha channel is handled though, because the whiter nodes and edges are, the less the alpha value is considered apparently. So I'll leave the issue opened until I solve this bug. @h-a-s-k Could you please send some data and/or code, to help me reproduce your issue? Thanks! |
I tried setting the alpha both as @RaphaelHansen did and also like you showed in 68da672. On my graph with 100k+ edges using sigma@3.0.0-beta.19. When every node and edge is set to red with an alpha of 0.01 edges.forEach((edge, idx) => {
const addedEdge = graph.addEdge(edge.source, edge.target, { size: 1 });
graph.setEdgeAttribute(addedEdge, `color`, chroma('#ff0000').alpha(0.01).hex());
}); compared to pixi.js with same color and alpha: Also could be placebo but when panning around using the reducer method it felt slower than setting a color directly with setEdgeAttribute once: const instance = new Sigma(graph, canvasContainer, {
labelThreshold: 10,
hideEdgesOnMove: false,
renderEdgeLabels: false,
edgeReducer: (_, attr) => {
attr.color = chroma('#ff0000').alpha(0.01).hex();
return attr;
},
}); |
I've noticed that EdgeCurvedArrowProgram handles opacity well (doesn't wash out like the other edge/node programs). |
figured out if u want to do the same for nodes as well, clone the NodeCircleProgram and change line:
to: gl_FragColor = mix(vec4(v_color.rgb * v_color.a, v_color.a), transparent, t); I took inspiration from:
|
@ck-coatue It seems that this has be undone in the current beta relase.
Maybe it was for performance reason but I would love to have a way to make edges semi-transparent. |
Yeah last version with working transparency is |
When exporting using the gephi plugin, opacity seems to work fine(?), however with the latest version of sigma.js it doesn't seem to work when setting the edge color to a rgba value. This would be nice to have since sigma.js has great performance (and doesn't leak memory like a few others) but not having opacity support is a dealbreaker for me.
The text was updated successfully, but these errors were encountered: