-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export image #11
Export image #11
Conversation
dimes/dimensional_plot.py
Outdated
width: int | None = None, | ||
height: int | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like these are never set in any calls to this function. Can we remove them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
width
and height
are set in lines 245 and 246. Is that what you mean, or is there something else wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two calls to finalize_plot
(line 461 and line 471), but neither of them actually pass in width
or height
so they are always None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want width and height to be passed into finalize_plot? I was debating whether to pass them into finalize_plot or DimensionalPlot.
If passed into DimensionalPlot, then jpeg and html plots are both adjusted. If only passed into write_plot_image (as well as finalize_plot), then jpeg files are the only files with modified height and width, which makes more sense to me.
We could also pass in width and height into write_html_plot, but I don't think that is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review latest changes
dimes/dimensional_plot.py
Outdated
def write_image_plot(self, path: Path, scale: int | None = None) -> None: | ||
"Write plots to html file at specified path." | ||
self.finalize_plot() | ||
self.figure.write_image(path, scale=scale) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to add a comment to explain what "scale" is and how it is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a look at the updated write_image_plot
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a formatter was automatically applied to this file, causing unrelated diffs. Not sure I like it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you want to do about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change your editor settings so it doesn't automatically format TOML files (or at least disable the reordering of keywords).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find the setting. I will need your help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
dimes/dimensional_plot.py
Outdated
width: int | None = None, | ||
height: int | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two calls to finalize_plot
(line 461 and line 471), but neither of them actually pass in width
or height
so they are always None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change your editor settings so it doesn't automatically format TOML files (or at least disable the reordering of keywords).
write_image_plot
to save plots as images with option to setscale
(image resolution).width
andheight
of image toDimensionalPlot
(width
andheight
could be moved towrite_image_plot
).kaleido
topyproject.toml
, aplotly
requirement to save plots as images.