plotly / plotly/plotly.js

Unclear Intended behavior for marker.size=0 for scatter and scattergl

Open
#6,862 0 comments 0 reactions 1 assignee View on GitHub

@LiamConnors is already working on this.

Since Jul 12, 2024.

bug P3
Dominant language
JavaScript
Stars
18.3k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
28

Description

Setting the marker size to zero could have two reasonable interpretations:

  1. 0 is a valid input and the markers don't get plotted
  2. 0 is not a valid input and the markers get plotted in the default size

It seems Option 2 is the current implementation as of v2.28.0 (codepen link). But is that intentional? The documentation says

size
Parent: data[type=scattergl].marker
Type: number or array of numbers greater than or equal to 0
Default: 6
Sets the marker size(in px).

The documentation sounds a bit more like option 1, to me, because 0 is inside the valid range. Also, an array of all 0s does not get plotted, which I assumed should be the same behavior of a single 0.

Should the documentation be clarified or the implementation be changed?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.