diff --git a/crawler/frontend/src/components/Map.tsx b/crawler/frontend/src/components/Map.tsx index 6daa3c2..72ef041 100644 --- a/crawler/frontend/src/components/Map.tsx +++ b/crawler/frontend/src/components/Map.tsx @@ -60,7 +60,7 @@ export function Map( return () => { mapRef.current.remove() } - }, []) + }, [data]) function clone(d) { @@ -155,7 +155,10 @@ export function Map( * @type {number} */ var svg_height = 300, svg_width = 70; - var svg = d3.select('#svg'); + // clear svg before starting + d3.select('#svg').selectAll('*').remove(); + // create a new SVG element + const svg = d3.select('#svg'); var defs = svg .attr('height', svg_height) .attr('width', svg_width); @@ -215,7 +218,6 @@ export function Map( for (let property of properties) { listingComponents.push(getPropertyComponent(property)); } - console.log(listingComponents.length) return