Length

Specifying individual edge lengths:

canvas.edgelayout('individual')

const edgeLengths = {
    '1,2': 80,
    '1,3': 120,
    '2,3': 70,
    '2,4': 60,
    '3,4': 90
}

canvas.nodes([1, 2, 3, 4]).add()

const edges = Object.keys(edgeLengths).map(k => k.split(','))
canvas.edges(edges).data(Object.values(edgeLengths)).add({
    length: d => d,
    labels: d => ({ 0: { 'text': d } })
})