remove colour list and improve buttton label

This commit is contained in:
Martha King 2024-10-01 16:56:32 +01:00
parent 5ca4b5617b
commit fb7c5e0084

View File

@ -332,10 +332,6 @@ const yLabelText = computed(() => {
} else return null } else return null
}) })
const colorList = computed(() =>
isCustomColorAndAxis.value ? ['red', 'green'] : d3.schemeCategory10,
)
watchEffect(() => { watchEffect(() => {
const boundsExpression = const boundsExpression =
bounds.value != null ? Ast.Vector.tryBuild(bounds.value, tryNumberToEnso) : undefined bounds.value != null ? Ast.Vector.tryBuild(bounds.value, tryNumberToEnso) : undefined
@ -647,7 +643,7 @@ watchPostEffect(() => {
const plotData = getPlotData(data.value) as Point[] const plotData = getPlotData(data.value) as Point[]
const series = Object.keys(data.value.axis).filter((s) => s != 'x') const series = Object.keys(data.value.axis).filter((s) => s != 'x')
const colorScale = (d: string) => { const colorScale = (d: string) => {
const color = d3.scaleOrdinal(colorList.value).domain(series) const color = d3.scaleOrdinal(d3.schemeCategory10).domain(series)
if (data.value.is_multi_series) { if (data.value.is_multi_series) {
return color(d) return color(d)
} }
@ -692,7 +688,7 @@ watchPostEffect(() => {
const color = d3 const color = d3
.scaleOrdinal<string>() .scaleOrdinal<string>()
.domain(seriesLabels.value) .domain(seriesLabels.value)
.range(colorList.value) .range(d3.schemeCategory10)
.domain(seriesLabels.value) .domain(seriesLabels.value)
d3Legend.value.selectAll('circle').remove() d3Legend.value.selectAll('circle').remove()
@ -816,7 +812,7 @@ config.setToolbar([
}, },
{ {
selected: yAxisSelected, selected: yAxisSelected,
title: 'Y Axis Label', title: 'Choose Y Axis Label',
options: { options: {
none: { none: {
icon: 'not_paragraph', icon: 'not_paragraph',