plotly / plotly/plotly.js

With shapes that reference categorical axis, shape is drawn when no category exists

Open
#7,048 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

For the following rendered graph, the shape is described like this:

 {
        "line": {
          "color": "yellow",
          "width": 3
        },
        "type": "rect",
        "x0": "A",
        "x1": "A",
        "xref": "x",
        "y0": 0,
        "y1": 0.5,
        "yref": "paper"
      }

There is no category "A" on the x axis, but the shape is still drawn and appears to be drawn at the centre point of the x axis.

image

Here is a codepen:

https://codepen.io/liamconnors/pen/XWLmRae

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.

Research direction

Start by running the linked CodePen and reproducing the shape configuration against a categorical x axis with no "A" category. Trace the shape-rendering path for categorical axis references; done means the rectangle is not drawn when its referenced category does not exist, while valid category references still render.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.