Apologies as this feels like a really simple one but I can’t figure it out.
I’m trying to migrate from an old version of Sigmajs to 2.4 which I’ve got working but it looks like the settings have been changed in this new version, namely the following is missing:
minEdgeSize: 1,
maxEdgeSize: 3,
minNodeSize: 2,
maxNodeSize: 10,
How do you change max/min for Nodes & Edges in the new version as this in my experience always needs some tweaking coming out of software like Gephi. I assume it has something to do with the Reducers but I can’t figure it out for the life of me, any help would be adored.
// Reducers
nodeReducer: null,
edgeReducer: null,
nodeReducer: null | ((node: string, data: N) => Partial<NodeDisplayData>);
edgeReducer: null | ((edge: string, data: E) => Partial<EdgeDisplayData>);
Thank you
I’ve tried stuff like this but I’ve got nowhere:
nodeReducer: (node, data) => {
const maxSize = 10;
const minSize = 2;
const size = data.size;
const scaledSize = ((size - minSize) / (maxSize - minSize)) * (maxSize - minSize) + minSize;
return {
size: scaledSize,
RaphaelH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.