-
Notifications
You must be signed in to change notification settings - Fork 72
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
Use in memory drawing for @png etc. when there's no filename? #49
Comments
I have looked into it a bit right now and landed here as well. The question: They certainly could, wouldn't be a complicated task. So we need to modify the macros and the preview function. I lack on knowledge about juno and jupyter, how to display images from data. The Proposal: |
Sounds like a great idea... Perhaps - a new macro called I know nothing about the in-memory code here, it was added by @barche and it works great but if we want to modify/extend it we'll have to get to grips with Juno/Jupyter display systems... |
So the approach would be: Create a new macro I'll try to cook something together. |
I have implemented the approach b), since i didn't want to disrupt anything. I am still thinking about the possibility to also do Old info By the way, as copied from the documentation, all I am not sure what i am doing wrong here.
|
use O not 0. |
Yeah, i should have used copy paste... Yep it works just fine. |
testing is going to be interesting... I’ll take a look tomorrow. |
Yeah, about the tests. I coudn't find any tests on the macros |
Note that this is already possible if you use |
Sorry I just got round to looking at this properly (on my phone over the weekend). If you want a simple macro that does in-memory drawing and display (for PNG) when using Juno or Jupyter, add this code to drawings.jl and export
In Juno, you'd see this: In Jupyter, you'd see this: In the Terminal, you'd see this: It appears to work, but it might be what you're looking for? Perhaps the message should be more helpful... :) |
Yep, that does the job as well. Should i change it to this and create a new pull-request? Or should we use the temporary-file approach? |
Well, it depends on whether the purpose of the original issue (and your subsequent interest) was to do in-memory drawing or just to not have to worry about creating/deleting temporary files. It seemed to start off as the former, and end up as the latter... :) |
I approached it from the user perspective, where i don't care, i just want to see a pretty picture, and i don't want to deal with created files :D |
On my machine it works. Also i don't know if i have to delete the file, or if i can leave it, since it is in a tmp directory. On Wednesday i can look into the in-memory only option. |
I have two reasons for choosing the completely in-memory approach for my notebooks:
|
@barche Thanks, useful info. |
I copied your code and tested it. You can merge it. |
@m3m0ry Thanks for adding this! |
It's sometimes annoying when I draw some pics for a package, it mess up git and I have to rm those drawings manually.
e.g
will just do the drawing in memory and will not create a file.
The text was updated successfully, but these errors were encountered: