Kozea / Kozea/pygal

render_to_file should support rendering to png

Open
#412 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.8k
Forks
419
PR merge metrics
No merged PRs in 30d

Description

`render_to_file` method can saves figures only in `svg` format even if we explicitly write `.png` at the end of file name.
I think it could be good idea to render such type of file as ending of filename suggest. That way is done in `matplotlib`.

Currently, we have `render_to_png` method which is responsible for exporting plot to png format and `render_to_file` which works only with svg format. In my opinion it's too general name, because png is also file. So I recommend changing name from `render_to_file` to `render_to_svg` and creating another method, `render_to_file`, which will support svg and png format as well.

Contributor guide

Open the contributing guide

Research direction

Locate the existing render_to_file and render_to_png methods, then inspect how output formats are selected. Determine the expected API behavior for SVG and PNG, including the proposed rename, and verify that rendering a filename with each extension produces the corresponding format.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
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.