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

Zoom and moving around with mouse for Gaston plots, in Pluto #156

Closed
VarLad opened this issue Nov 14, 2020 · 12 comments
Closed

Zoom and moving around with mouse for Gaston plots, in Pluto #156

VarLad opened this issue Nov 14, 2020 · 12 comments

Comments

@VarLad
Copy link

VarLad commented Nov 14, 2020

These two basic functionalities are available easily with svg terminal....
Also, svg terminal is clearer than png one for quality so you might wanna consider that for default....

Also, I did try
set(preamble="set terminal svg size 600,400 dynamic enhanced mousing"), while the size parameter worked, the others didnot.
So.... any way I can implement this myself in Gaston?

@VarLad VarLad changed the title Zoom and moving around with mouse for Gaston plots.... Zoom and moving around with mouse for Gaston plots, in Pluto Nov 14, 2020
@mbaz
Copy link
Owner

mbaz commented Nov 14, 2020

Please don't ask multiple questions in one issue; it becomes difficult to keep track of them. Also, I'd prefer if you asked support questions in Discourse.

You had already opened an issue about support for SVG interactivity in Pluto here. The situation has not changed.

Don't use the preamble to set terminal options. Rather, use termopts. This is explained in the documentation: https://mbaz.github.io/Gaston.jl/stable/faq/#How-to-set-the-terminal-1

@mbaz mbaz closed this as completed Nov 14, 2020
@VarLad
Copy link
Author

VarLad commented Nov 14, 2020

The last issue required a lot of hard work
This one is just
set term svg enhanced dynamic mousing
Easy to implement

Also, in Gaston, with set(term = "svg", termopts="size 600,400 dynamic enhanced mousing")
Doesn't work
Instead I get this

┌ Warning: Gnuplot returned an error message:
│   
│ gnuplot> set term pngcairo size 600,400 dynamic enhanced mousing
│                                         ^
│          line 0: unrecognized terminal option
│ 
└ @ Gaston ~/.julia/packages/Gaston/ctAQy/src/gaston_llplot.jl:182

The closest I got was with preamble...
It works fine in gnuplot

gnuplot> set term svg enhanced dynamic mousing

Terminal type is now 'svg'
Options are 'size 600,480 dynamic enhanced font 'Arial,12' mousing butt dashlength 1.0 '
gnuplot> 

@VarLad
Copy link
Author

VarLad commented Nov 14, 2020

The plots produced with
set term svg enhanced dynamic mousing
already have zooming and dragging functionality automatically, when displayed on a website... You can try it yourself or look at the http://gnuplot.sourceforge.net/demo_svg_5.5/simple.html

@VarLad
Copy link
Author

VarLad commented Nov 14, 2020

Also, this works, only the size parameter though
set(showable="svg", termopts="size 1000,400 dynamic enhanced mousing")

I think its forced on pngcairo on both ijulia and pluto!
Screenshot from 2020-11-15 00-43-59

@mbaz Is that intentional or a bug?

@VarLad
Copy link
Author

VarLad commented Nov 14, 2020

@mbaz
Should I open an issue for it?😅

@mbaz
Copy link
Owner

mbaz commented Nov 14, 2020

To enable SVG plotting, you need a Pluto cell with:

begin
    set(term="svg")
    set(showable="svg")
    set(termopts="dynamic enhanced mousing size 800,600")
end

However, as explained in #146, you will not get an interactive plot, because Pluto does not execute the javascript embedded in the SVG.

@VarLad
Copy link
Author

VarLad commented Nov 15, 2020

@mbaz
html"<embed src=\"http://gnuplot.sourceforge.net/demo_svg_5.5/simple.2.svg\"></embed>"
Tried it in Pluto! Works great and gives the expected output!
I'm asking if you can make Gaston display images "by default" using this?
Any reply on this would help!
Thanks!

@VarLad
Copy link
Author

VarLad commented Nov 15, 2020

The above displays svg in Pluto, which can be zoomed dragged and the 2d coordinates are there on mouse pointer

@VarLad
Copy link
Author

VarLad commented Nov 15, 2020

@mbaz Can you confirm if you can implement it by default in Gaston?

@mbaz
Copy link
Owner

mbaz commented Nov 15, 2020

See fonsp/Pluto.jl#546

Support for raw SVG output embedded in an HTML page will be present in v1.1.0.

@VarLad
Copy link
Author

VarLad commented Nov 15, 2020

Thanks😁

@mbaz
Copy link
Owner

mbaz commented Nov 18, 2020

This is working on my private development branch. Not available yet, but I wanted to let you know. This branch will become v1.1.0 in (I hope) a couple of weeks.

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