plotly / plotly/Kaleido

Add BytesIO support

Open
#334 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2
Dominant language
Python
Stars
498
Forks
62
Avg merge
1d 11h
Merged PRs (30d)
2

Description

What I'm saying is that I used to do this

img_bytes = pio.to_image(fig, format="svg", width=width, height=height)

and now I have to do the following, where k is an instance of Kaleido:

    img_bytes = await k.calc_fig(
        fig,
        opts={"format": "svg", "width": width, "height": height},
    )

I'm not trying to write the images to a file.

I'm not sure whether the docstring for calc_fig(), claiming "this function does not support parallelism", is accurate.

Originally posted by @s-banach in #231

Contributor guide

No contributing guide indexed for this repository

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 reading the implementation and docstring for calc_fig(), the entry point named in the issue, and trace how image output is currently returned or written. Clarify the expected BytesIO interface and parallelism behavior before changing it; done means callers can obtain image data in memory without writing a file and the documented behavior is accurate.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.