Skip to content

Commit

Permalink
Optimize the interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
adonis0147 committed Mar 15, 2017
1 parent 51291ee commit 2ede7bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/renderer/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ function updateNodes(source, nodes) {
let node_enter = node.enter().append('g')
.attr('class', 'node')
.attr('transform', (d) => { return `translate(${source.x0}, ${source.y0})` })
.on('click', click)

node_enter.append('rect')
.attr('class', 'node')
Expand All @@ -129,6 +128,7 @@ function updateNodes(source, nodes) {
.style('height', `${NODE_SIZE.height}px`)
.style('color', 'rgba(0, 0, 0, 1)')
.text((d) => { return d.data.name })
.on('click', click)

let node_update = node_enter.merge(node)

Expand All @@ -140,7 +140,6 @@ function updateNodes(source, nodes) {
.attr('width', NODE_SIZE.width)
.attr('height', NODE_SIZE.height)
.style('stroke', (d) => { return d._children ? 'rgb(136, 136, 136)' : '#fff' })
.attr('cursor', 'pointer')

let node_exit = node.exit().transition()
.duration(DURATION)
Expand Down
1 change: 1 addition & 0 deletions static/css/view.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ svg {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}

.link {
Expand Down

0 comments on commit 2ede7bb

Please sign in to comment.