fix: it should be value
and not name
This commit is contained in:
@ -34,7 +34,7 @@ function draw(small) {
|
||||
nodeElements.attr('transform', d => `translate(${d.x}, ${d.y})`)
|
||||
.style('font-family', 'monospace')
|
||||
.style('font-size', (small ? '6' : '11') + 'px')
|
||||
.attr('data-word', d => d.name);
|
||||
.attr('data-word', d => d.value);
|
||||
|
||||
nodesEnter.append('circle');
|
||||
|
||||
@ -55,7 +55,7 @@ function draw(small) {
|
||||
let texts = svg.selectAll('g.node text').data(nodes);
|
||||
|
||||
texts.attr('dy', 5)
|
||||
.html(d => `<tspan>${d.name.split('').join('</tspan><tspan>')}</tspan>`)
|
||||
.html(d => `<tspan>${d.value.split('').join('</tspan><tspan>')}</tspan>`)
|
||||
.attr('text-anchor', 'middle')
|
||||
.style('fill', 'white');
|
||||
}
|
||||
|
Reference in New Issue
Block a user