From d4fe6fe718b30e42a70afc0c972f1865d5753714 Mon Sep 17 00:00:00 2001 From: Martha King Date: Tue, 7 Jan 2025 15:49:57 +0000 Subject: [PATCH 1/2] select correct items --- .../visualizations/ScatterplotVisualization.vue | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/gui/src/project-view/components/visualizations/ScatterplotVisualization.vue b/app/gui/src/project-view/components/visualizations/ScatterplotVisualization.vue index b1ade0c8e3e1..e9bd735706ea 100644 --- a/app/gui/src/project-view/components/visualizations/ScatterplotVisualization.vue +++ b/app/gui/src/project-view/components/visualizations/ScatterplotVisualization.vue @@ -757,14 +757,10 @@ watchPostEffect(() => { .range(d3.schemeCategory10) .domain(seriesLabels.value) - d3Legend.value.selectAll('circle').remove() - d3Legend.value.selectAll('text').remove() - d3Legend.value - .selectAll('dots') + .selectAll('circle') .data(seriesLabels.value) - .enter() - .append('circle') + .join((enter) => enter.append('circle')) .attr('cx', function (d, i) { return 90 + i * 120 }) @@ -773,10 +769,9 @@ watchPostEffect(() => { .style('fill', (d) => color(d) || DEFAULT_FILL_COLOR) d3Legend.value - .selectAll('labels') + .selectAll('text') .data(seriesLabels.value) - .enter() - .append('text') + .join((enter) => enter.append('text')) .attr('x', function (d, i) { return 100 + i * 120 }) @@ -784,7 +779,6 @@ watchPostEffect(() => { .style('font-size', '15px') .text((d) => formatLabel(d)) .attr('alignment-baseline', 'middle') - .call((labels) => labels.append('title').text((d) => d)) } }) From 84b0ddc115ae5ff15317b6d4e02e93aa27af3b96 Mon Sep 17 00:00:00 2001 From: Martha King Date: Tue, 7 Jan 2025 15:56:56 +0000 Subject: [PATCH 2/2] reintroduce tooltip --- .../components/visualizations/ScatterplotVisualization.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/app/gui/src/project-view/components/visualizations/ScatterplotVisualization.vue b/app/gui/src/project-view/components/visualizations/ScatterplotVisualization.vue index e9bd735706ea..91de1df7596d 100644 --- a/app/gui/src/project-view/components/visualizations/ScatterplotVisualization.vue +++ b/app/gui/src/project-view/components/visualizations/ScatterplotVisualization.vue @@ -779,6 +779,7 @@ watchPostEffect(() => { .style('font-size', '15px') .text((d) => formatLabel(d)) .attr('alignment-baseline', 'middle') + .call((labels) => labels.append('title').text((d) => d)) } })