Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #3404 > unrolled thread

svg terminal - use of mouse without <embed>

Started byPatrik Sundberg <patrik.sundberg@gmail.com>
First post2016-09-28 02:40 -0700
Last post2016-09-30 04:23 -0700
Articles 3 — 2 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  svg terminal - use of mouse without <embed> Patrik Sundberg <patrik.sundberg@gmail.com> - 2016-09-28 02:40 -0700
    Re: svg terminal - use of mouse without <embed> sfeam <sfeam@users.sourceforge.net> - 2016-09-29 09:41 -0700
      Re: svg terminal - use of mouse without <embed> Patrik Sundberg <patrik.sundberg@gmail.com> - 2016-09-30 04:23 -0700

#3404 — svg terminal - use of mouse without <embed>

FromPatrik Sundberg <patrik.sundberg@gmail.com>
Date2016-09-28 02:40 -0700
Subjectsvg terminal - use of mouse without <embed>
Message-ID<92a059d0-e40b-4ce8-a6dd-9846105cf434@googlegroups.com>
Hi,

I'm using the gnuplot svg terminal to produce some SVG. However, I'm not actually producing files, I'm dynamically generating content which is dynamically updating a web page via javascript. That means I don't have the ability to use <embed>, instead I just add a node to the DOM with the SVG.

The way the mouse javascript is done it only really works if used as a separate <embed> so that document.documentElement etc refers to only that svg. There are also some issues about clashing id's if including several svg nodes on same page without <embed>.

I can see it's not a trivial refactor to enable mouse to work in non-embed case. I wanted to ask if anyone else has this kind of use case or have thought about the use of mouse without the use of <embed> ? Any workarounds anyone can think of?

I'll see if it becomes important enough for me to try to write a patch to allow non-embed mode + multiple SVGs in the same page without ID clashes.

Thanks,
Patrik

[toc] | [next] | [standalone]


#3405

Fromsfeam <sfeam@users.sourceforge.net>
Date2016-09-29 09:41 -0700
Message-ID<nsjg88$a4b$1@dont-email.me>
In reply to#3404
Patrik Sundberg wrote:

> Hi,
> 
> I'm using the gnuplot svg terminal to produce some SVG. However, I'm
> not actually producing files, I'm dynamically generating content which
> is dynamically updating a web page via javascript. That means I don't
> have the ability to use <embed>, instead I just add a node to the DOM
> with the SVG.
> 
> The way the mouse javascript is done it only really works if used as a
> separate <embed> so that document.documentElement etc refers to only
> that svg. There are also some issues about clashing id's if including
> several svg nodes on same page without <embed>.
> 
> I can see it's not a trivial refactor to enable mouse to work in
> non-embed case. I wanted to ask if anyone else has this kind of use
> case or have thought about the use of mouse without the use of <embed>
> ? Any workarounds anyone can think of?

I don't have an answer with regard to non-embedded svg, but have
you looked at using the HTML5 canvas terminal instead?  

You would probably want to substitute your own mouse-handling *.js
routine for the demonstration one bundled with gnuplot, but that
should not require any change to the gnuplot output for the 
individual plots.

> I'll see if it becomes important enough for me to try to write a patch
> to allow non-embed mode + multiple SVGs in the same page without ID
> clashes.

Please have a look at this draft of a patch from Christoph Bersch:
   https://sourceforge.net/p/gnuplot/patches/532/

It's from quite a while ago and almost certainly won't apply to the
current gnuplot source, but if it does what you want please try to
update or improve it.  Or just add your comments to the tracker item.

	Ethan

 
> Thanks,
> Patrik

[toc] | [prev] | [next] | [standalone]


#3406

FromPatrik Sundberg <patrik.sundberg@gmail.com>
Date2016-09-30 04:23 -0700
Message-ID<d93e9c96-8e0c-4509-8733-0cf9430809e7@googlegroups.com>
In reply to#3405
On Thursday, September 29, 2016 at 5:41:57 PM UTC+1, sfeam wrote:
> Patrik Sundberg wrote:
> 
> > Hi,
> > 
> > I'm using the gnuplot svg terminal to produce some SVG. However, I'm
> > not actually producing files, I'm dynamically generating content which
> > is dynamically updating a web page via javascript. That means I don't
> > have the ability to use <embed>, instead I just add a node to the DOM
> > with the SVG.
> > 
> > The way the mouse javascript is done it only really works if used as a
> > separate <embed> so that document.documentElement etc refers to only
> > that svg. There are also some issues about clashing id's if including
> > several svg nodes on same page without <embed>.
> > 
> > I can see it's not a trivial refactor to enable mouse to work in
> > non-embed case. I wanted to ask if anyone else has this kind of use
> > case or have thought about the use of mouse without the use of <embed>
> > ? Any workarounds anyone can think of?
> 
> I don't have an answer with regard to non-embedded svg, but have
> you looked at using the HTML5 canvas terminal instead?  

That may be the way to go - even if I do like the crisp looking SVGs :)

I can see how I wrap that up a lot easier for my use case. I'll see if I give it a spin or just live without mousing for now.

> You would probably want to substitute your own mouse-handling *.js
> routine for the demonstration one bundled with gnuplot, but that
> should not require any change to the gnuplot output for the 
> individual plots.
> 
> > I'll see if it becomes important enough for me to try to write a patch
> > to allow non-embed mode + multiple SVGs in the same page without ID
> > clashes.
> 
> Please have a look at this draft of a patch from Christoph Bersch:
>    https://sourceforge.net/p/gnuplot/patches/532/
> 
> It's from quite a while ago and almost certainly won't apply to the
> current gnuplot source, but if it does what you want please try to
> update or improve it.  Or just add your comments to the tracker item.

Cool. It doesn't quite cover the same use case - what I need would have to change all IDs so they could be unique and hence able to combine on same html page without use of embed. So a bigger job :(

Thanks,
Patrik

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web