Skip to content
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

renderToImage(w,h) #118

Open
maxandersen opened this issue Dec 4, 2023 · 6 comments
Open

renderToImage(w,h) #118

maxandersen opened this issue Dec 4, 2023 · 6 comments

Comments

@maxandersen
Copy link

newly added renderToImage(file,w,h) is nice but how about a renderToImage(w,h) ?

this is so the chart can just be shown in interactive shells/jupyter notebooks etc.

@HanSolo
Copy link
Owner

HanSolo commented Dec 5, 2023

You mean returning the png?

@maxandersen
Copy link
Author

Yes. As Image or whatever intermediate representation is available.

@HanSolo
Copy link
Owner

HanSolo commented Dec 5, 2023

Any specific preferences to make it as easy as possible in shell?

@maxandersen
Copy link
Author

Most java jupyter kernels will know how to render a BufferedImage to rendered bitmap this being able to get that with least amount of code is nice.

I.e. chart.render() with some defaults or chart.render(h,w)

For kernels that has chart knowledge they will look at the type and do instance of checks to find a suitable renderer and then it doesn't really matter how complicated it is as it will all be hidden from the user as they will just return chart.

Performance can matter too though - so I don't know what Javafx has internally - whether Image or some other intermediate representation. If it's not Image/BuffeedImage I would just return the cheapest one to get so not doing too expensive operations on every call.

@HanSolo
Copy link
Owner

HanSolo commented Dec 5, 2023

BufferedImage is available via JavaFX/Swing bridge and would be easy to implement, will do that on my way back home today 👍🏻.

HanSolo added a commit that referenced this issue Dec 5, 2023
Added another method that returns a BufferedImage renderToImage(w,h) as requested in issue #118 and (hopefully) fixed the signing issue #119
@HanSolo
Copy link
Owner

HanSolo commented Dec 5, 2023

Implemented the method in commit hash e18cdbb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants