plotly / plotly/plotly.js

Console error, "Excepted Number NaN" with LegendOnly attribute

Open
#5,344 3 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

Hi,

I have a console error when I create a plotly graph.

Steps to reproduce :
• I create a new graph with the following properties in the data : showlegend: true, visible: "legendonly"
• I add the showline: true attribute in the layout.

The graph is displayed correctly but I have a console error : Error: <path> attribute d: Expected number, "MNaN,NaNVNaN".

The error only seems to appear when these 3 attributes are combined.

Codepen: https://codepen.io/evanoll/pen/yLaMoRG

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 reproduction and isolate the combination of showlegend, visible: "legendonly", and showline. Trace the rendering path for that combination; done means the graph still displays correctly without the console error or an MNaN,NaNVNaN path.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.