mirror of
https://github.com/enso-org/enso.git
synced 2024-12-28 11:53:16 +03:00
Scatterplot fixes (#11041)
This commit is contained in:
parent
a33376c8d7
commit
4ac59827df
@ -541,7 +541,7 @@ watchPostEffect(() => {
|
|||||||
.duration(animationDuration.value)
|
.duration(animationDuration.value)
|
||||||
.attr(
|
.attr(
|
||||||
'd',
|
'd',
|
||||||
symbol.type(matchShape).size((d) => (d.size ?? 1.0) * SIZE_SCALE_MULTIPLER),
|
symbol.type(matchShape).size((d) => (d.size ?? 0.15) * SIZE_SCALE_MULTIPLER),
|
||||||
)
|
)
|
||||||
.style('fill', (d) => colorScale(d.series || ''))
|
.style('fill', (d) => colorScale(d.series || ''))
|
||||||
.attr('transform', (d) => `translate(${xScale_(d.x)}, ${yScale_(d.y)})`)
|
.attr('transform', (d) => `translate(${xScale_(d.x)}, ${yScale_(d.y)})`)
|
||||||
@ -556,6 +556,9 @@ watchPostEffect(() => {
|
|||||||
.attr('x', (d) => xScale_(d.x) + POINT_LABEL_PADDING_X_PX)
|
.attr('x', (d) => xScale_(d.x) + POINT_LABEL_PADDING_X_PX)
|
||||||
.attr('y', (d) => yScale_(d.y) + POINT_LABEL_PADDING_Y_PX)
|
.attr('y', (d) => yScale_(d.y) + POINT_LABEL_PADDING_Y_PX)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
watchPostEffect(() => {
|
||||||
if (data.value.is_multi_series) {
|
if (data.value.is_multi_series) {
|
||||||
const seriesLabels = Object.keys(data.value.axis)
|
const seriesLabels = Object.keys(data.value.axis)
|
||||||
.filter((s) => s != 'x')
|
.filter((s) => s != 'x')
|
||||||
@ -571,9 +574,10 @@ watchPostEffect(() => {
|
|||||||
.range(d3.schemeCategory10)
|
.range(d3.schemeCategory10)
|
||||||
.domain(seriesLabels)
|
.domain(seriesLabels)
|
||||||
|
|
||||||
const legend = d3Legend.value
|
d3Legend.value.selectAll('circle').remove()
|
||||||
|
d3Legend.value.selectAll('text').remove()
|
||||||
|
|
||||||
legend
|
d3Legend.value
|
||||||
.selectAll('dots')
|
.selectAll('dots')
|
||||||
.data(seriesLabels)
|
.data(seriesLabels)
|
||||||
.enter()
|
.enter()
|
||||||
@ -585,7 +589,7 @@ watchPostEffect(() => {
|
|||||||
.attr('r', 6)
|
.attr('r', 6)
|
||||||
.style('fill', (d) => color(d) || DEFAULT_FILL_COLOR)
|
.style('fill', (d) => color(d) || DEFAULT_FILL_COLOR)
|
||||||
|
|
||||||
legend
|
d3Legend.value
|
||||||
.selectAll('labels')
|
.selectAll('labels')
|
||||||
.data(seriesLabels)
|
.data(seriesLabels)
|
||||||
.enter()
|
.enter()
|
||||||
@ -664,7 +668,7 @@ useEvent(document, 'keydown', bindings.handler({ zoomToSelected: () => zoomToSel
|
|||||||
<VisualizationContainer :belowToolbar="true">
|
<VisualizationContainer :belowToolbar="true">
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<SvgButton
|
<SvgButton
|
||||||
name="add"
|
name="select"
|
||||||
title="Enable Selection"
|
title="Enable Selection"
|
||||||
@click="selectionEnabled = !selectionEnabled"
|
@click="selectionEnabled = !selectionEnabled"
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user