From c14b514eff4d5567afce0f70df2dd78711cce0e2 Mon Sep 17 00:00:00 2001 From: Matthew Huntington Date: Fri, 22 Sep 2023 00:01:09 -0400 Subject: [PATCH] don't wipe points and table each render --- public/app.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/public/app.js b/public/app.js index c24239e..de1cf5e 100644 --- a/public/app.js +++ b/public/app.js @@ -8,10 +8,9 @@ const parseTime = d3.timeParse("%B %e, %Y"); const formatTime = d3.timeFormat("%B %e, %Y"); const renderTable = () => { - d3.select('tbody').html(''); const trs = d3.select('tbody') .selectAll('tr') - .data(instances.filter(d => d.highlighted)) + .data(instances.filter(d => d.highlighted), d => d.id) .enter() .append('tr') .selectAll('td') @@ -22,10 +21,9 @@ const renderTable = () => { } const renderPoints = () => { - d3.select('#points').html(''); const circles = d3.select('#points') .selectAll('circle') - .data(instances) + .data(instances, d => d.id) .enter() .append('circle');