Skip to content

Commit

Permalink
arcs are now over dotted lines (#7) also using ids for arc deletion t…
Browse files Browse the repository at this point in the history
…o improve performance
  • Loading branch information
Jakob-L-M committed Aug 26, 2021
1 parent 2121f81 commit 9cfdcc4
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions visualization/pub.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,22 +202,22 @@ function update_graph(start_d, end_d) {
}

let past_arcs = $('.graph_arc').map(function () {
return $(this).attr('class').split(' ')[2]
return $(this).attr('id')
})

past_arcs = Array.from(new Set(past_arcs))
current_arcs = Array.from(new Set(current_arcs))
let diff = past_arcs.filter(x => !current_arcs.includes(x))
for (let i = 0; i < diff.length; i++) {
$(` .${diff[i]} `).remove()
$(` #${diff[i]} `).remove()
}

update_arcs();


update_lines();

update_dates();


update_arcs();
// circle bars
function update_arcs() {
let u = vis.selectAll('.graph_arc')
Expand All @@ -227,7 +227,8 @@ function update_graph(start_d, end_d) {

u.enter()
.append("path")
.attr("class", function (d) { return `graph_arc ${d.word} ${d.id}` })
.attr("class", function (d) { return `graph_arc ${d.word}` })
.attr("id", (d) => d.id)
.attr("transform", `translate(${width / 2}, ${height / 2})`)
.on("mouseover", handleMouseOver)
.on("mouseout", handleMouseOut)
Expand Down

0 comments on commit 9cfdcc4

Please sign in to comment.