plotly / plotly/plotly.py

[FEATURE]: Provide an obvious way to access underlying data arrays within a Figure object (rather than the base64-encoded versions)

Open
#5,124 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P2 regression
Dominant language
Python
Stars
18.8k
Forks
2.8k
Avg merge
16h 26m
Merged PRs (30d)
21

Description

Hi, I have some some code here, as below (edited to remove extra logs). I'm converting a plotly figure into json, and then loading it with json loads. You would expect that to preserve the original data.

Image'

However, as you can see, the "y" data (which had previously been an array of large numbers) are wrongly converted into this "bdata" thing instead.

Image

I was able to solve this and get the data in the format I wanted by going from 6.0.1 -> 5.24.1, which was the last stable build I was using. I think this is a pretty fundamental issue, so let me know if there's anything else I can share.

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 at the Figure object's JSON conversion path and reproduce the reported case with json loads, comparing the output from versions 6.0.1 and 5.24.1. Trace why the y array becomes bdata and define completion as an obvious way to access the original underlying arrays without base64 encoding.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.