Adjust vis.js options to avoid crossed edges/overlapping

Viewed 1758

So I've read this post, where someone visualizes 4chan posts in a graph. It looks very cool so I wanted to try it out myself. Everything is working good but I'm having some problems with my visjs options.

I am trying to get as close to the options he used. Sadly he hasn't posted them anywhere.

This is what I've got so far:

var options = {
  nodes: {
    shape: 'dot',
    scaling: {
      min: 10,
      max: 30,
      customScalingFunction: function (min,max,total,value) { return value },
      label: {
        min: 8,
        max: 30,
        drawThreshold: 12,
        maxVisible: 20
      }
    },
    font: {
      size: 12,
      face: 'Tahoma'
    }
  },
  edges: {
    width: 0.15,
    color: {inherit: 'from'},
    smooth: {
      type: 'continuous'
    }
  },
  physics: {
      barnesHut: {
          springLength: 1000,
          springConstant: 1,
          avoidOverlap: 1
      }
  },
  interaction: {
    tooltipDelay: 200,
    hideEdgesOnDrag: true
  }
};

My Problem is, that they still don't seem quite right and I also have trouble with overlapping nodes.

JSFiddle Sorry for the unclean code.

0 Answers
Related