reset the map when new parameters are chosen
This commit is contained in:
parent
7c70da4bed
commit
ba4a95825b
1 changed files with 5 additions and 3 deletions
|
|
@ -60,7 +60,7 @@ export function Map(
|
||||||
return () => {
|
return () => {
|
||||||
mapRef.current.remove()
|
mapRef.current.remove()
|
||||||
}
|
}
|
||||||
}, [])
|
}, [data])
|
||||||
|
|
||||||
|
|
||||||
function clone(d) {
|
function clone(d) {
|
||||||
|
|
@ -155,7 +155,10 @@ export function Map(
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
var svg_height = 300, svg_width = 70;
|
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
|
var defs = svg
|
||||||
.attr('height', svg_height)
|
.attr('height', svg_height)
|
||||||
.attr('width', svg_width);
|
.attr('width', svg_width);
|
||||||
|
|
@ -215,7 +218,6 @@ export function Map(
|
||||||
for (let property of properties) {
|
for (let property of properties) {
|
||||||
listingComponents.push(getPropertyComponent(property));
|
listingComponents.push(getPropertyComponent(property));
|
||||||
}
|
}
|
||||||
console.log(listingComponents.length)
|
|
||||||
return <ScrollArea className="rounded-md border">
|
return <ScrollArea className="rounded-md border">
|
||||||
<div className="overflow-y-auto h-[500px] w-[500px] scrollbar-thin scrollbar-thumb-rounded">
|
<div className="overflow-y-auto h-[500px] w-[500px] scrollbar-thin scrollbar-thumb-rounded">
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue