Skip to content

Commit

Permalink
added safeguard for log scale / markers+text
Browse files Browse the repository at this point in the history
  • Loading branch information
dvmoritzschoefl committed Nov 5, 2024
1 parent a31fe5f commit 94e519c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vis/scatter/useData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function useData({
yaxis: pair.yref,
textposition: subplots.text.map((_, i) => textPositionOptions[i % textPositionOptions.length]),
...(isEmpty(selectedList) ? {} : { selectedpoints: selectedList.map((idx) => subplots.idToIndex.get(idx)) }),
mode: config.showLabels === ELabelingOptions.NEVER ? 'markers' : 'text+markers',
mode: config.showLabels === ELabelingOptions.NEVER || config.xAxisScale === 'log' || config.yAxisScale === 'log' ? 'markers' : 'text+markers',
...(config.showLabels === ELabelingOptions.NEVER
? {}
: config.showLabels === ELabelingOptions.ALWAYS
Expand Down Expand Up @@ -118,7 +118,7 @@ export function useData({
// text: scatter.plotlyData.text,
textposition: scatter.plotlyData.text.map((_, i) => textPositionOptions[i % textPositionOptions.length]),
...(isEmpty(selectedList) ? {} : { selectedpoints: selectedList.map((idx) => scatter.idToIndex.get(idx)) }),
mode: config.showLabels === ELabelingOptions.NEVER ? 'markers' : 'text+markers',
mode: config.showLabels === ELabelingOptions.NEVER || config.xAxisScale === 'log' || config.yAxisScale === 'log' ? 'markers' : 'text+markers',
...(config.showLabels === ELabelingOptions.NEVER
? {}
: config.showLabels === ELabelingOptions.ALWAYS
Expand Down Expand Up @@ -162,7 +162,7 @@ export function useData({
y: group.data.y,
xaxis: group.xref,
yaxis: group.yref,
mode: config.showLabels === ELabelingOptions.NEVER ? 'markers' : 'text+markers',
mode: config.showLabels === ELabelingOptions.NEVER || config.xAxisScale === 'log' || config.yAxisScale === 'log' ? 'markers' : 'text+markers',
textposition: group.data.text.map((_, i) => textPositionOptions[i % textPositionOptions.length]),
...(config.showLabels === ELabelingOptions.NEVER
? {}
Expand Down

0 comments on commit 94e519c

Please sign in to comment.