mutable default_link_strokeColor_normal = {
let log = ''
let isPassed = false
let container = DOM.element('div')
let strokeColor = { r: 0.2, g: 0.4, b: 0.6, a: 0.8 }
let backgroundColor = {r: 0, g: 0, b: 0, a: 0}
let expected = rgba2hex({
a: strokeColor.a,
r: strokeColor.r * strokeColor.a,
g: strokeColor.g * strokeColor.a,
b: strokeColor.b * strokeColor.a
})
let width = 100
let height = 100
let r = 10
let strokeWidth = 10
let isSame = isSameForColorCompare
try {
refresh(container)
let netv = new NetV({
container,
width,
height,
node: {r, strokeWidth: 0},
link: {strokeColor, strokeWidth},
backgroundColor
})
netv.data({
nodes: [
{id: '0', x: width / 2, y: height / 4},
{id: '1', x: width / 2, y: height / 4 * 3}
],
links: [{source: '0', target: '1'}]
})
netv.draw()
const canvas = container.querySelector('canvas')
const actualColor = getPixelColor(canvas, width / 2, height / 2)
log = rgba2hex(actualColor)
} catch (e) {
log = e.toString()
}
return {
title: `Default Link StrokeColor: ${JSON.stringify( strokeColor ).replace(/\"/g, '')}`,
container,
log,
expected,
isPassed: isSame(expected, log)
}
}