Share

gnuplot development

Tracker: Patches

5 Embedded hyperlinks - ID: 2172587
Last Update: Comment added ( akmala )

This is a more complete implementation of hyperlinks, allowing the user to
attach links to individual objects, labels, or plots. As of now it only
does anything interesting for svg output, but I hope that at least partial
functionality can later be added to the cairo-based terminals, the
TeX-based terminal, and possibly to others as well.

Examples:
set label 1 "Click me!" at screen 0.1, screen 0.8
set label 1 href "http://gnuplot.projects.sourceforge.net"

set obj 10 circle at 3,4 radius .1
set obj 10 href "circle_info.txt"

plot "foo" with lines href "foo.dat"


Live demo at
http://skuld.bmsc.washington.edu/~merritt/gnuplot/index.html#svg+xlink


Ethan Merritt ( sfeam ) - 2008-10-16 18:51

5

Open

None

Nobody/Anonymous

None

None

Public


Comments ( 9 )




Date: 2009-10-15 19:19
Sender: akmala

More details on the splot issue:

the following commands:

set label 1 "Click here" at 2,2,2
set label 1 href "http://gnuplot.sourceforge.net"
splot ...

generate only the following lines in the svg output:

<g transform="translate(300.0,188.4)" style="stroke:none;
fill:black; font-family:arial; font-size:11.00pt; text-anchor:start">
<text><tspan>Click here</tspan>
</text>
</g>


whereas the same 'set label' commands followed by 'plot' instead of
'splot' yield the same lines within
<a xlink:...> </a>:

<a xlink:href="http://gnuplot.projects.sourceforge.net">
<g transform="translate(318.9,212.3)" style="stroke:none;
fill:black; font-family:arial; font-size:11.00pt; text-anchor:start">
<text><tspan>Click me!</tspan>
</text>
</g>
</a>

Thus, the link does not appear when using splot.



Date: 2009-10-15 18:04
Sender: akmala

Perfect. Thank you very much. Incidentally, I note while href works as
expected with plot, I cannot make it work for me when using splot. Is this
intentional? Mousing over an SVG splot output, I notice that the cursor
changes shape, but does not link to anything.


Date: 2009-10-14 03:39
Sender: sfeamProject Admin

I don't know what caused your error message, but I've attached an updated
version of the patch that applies cleanly to current CVS.


Date: 2009-10-13 20:19
Sender: akmala

My attempt to patch gnuplot 4.3.0 with href_16dec2008.patch failed ...
would appreciate any guidance.

graphics.c: In function `place_labels':
graphics.c:1433: error: structure has no member named `href'
graphics.c:1434: error: structure has no member named `href'
graphics.c: In function `place_objects':
graphics.c:1470: error: structure has no member named `href'
graphics.c:1471: error: structure has no member named `href'
graphics.c:1544: error: structure has no member named `href'



Date: 2008-12-16 17:36
Sender: sfeamProject Admin

File Added: href_16dec2008.patch


Date: 2008-11-29 19:57
Sender: sfeamProject Admin

Updated and added to demo web page
File Added: href_28nov2008.patch


Date: 2008-10-20 20:11
Sender: sfeamProject Admin

Modified to handle svg both with and without enhanced text mode
File Added: href_20oct2008.patch


Date: 2008-10-17 21:22
Sender: sfeamProject Admin

And here is a sample output pdf file created using
set term epslatex color standalone
set output 'hyper.tex'
load 'hyper.dem'

I then edited the output TeX file to include the following line:
\usepackage[pdftex,colorlinks,baseurl=http://mysite]{hyperref}

and ran
convert hyper-inc.eps hyper-inc.pdf
pdflatex hyper

Note that when this same demo file is run through the svg terminal, all
elements in each individual plot trigger the hyperlink. But in epslatex,
only the text elements are processed by LaTeX and so only the plot titles
are connected to the hyperlink.
File Added: hyper.pdf


Date: 2008-10-17 21:15
Sender: sfeamProject Admin

This version adds support for hyperlinks in the epslatex terminal driver.
File Added: href_17oct2008.patch


Log in to comment.




Attached Files ( 2 )

Filename Description Download
hyper.pdf hyperlink demo run through pdflatex Download
href_13oct2009.patch updated to apply cleanly against current cvs Download

Changes ( 12 )

Field Old Value Date By
File Deleted 305541: 2009-10-14 03:40 sfeam
File Added 346539: href_13oct2009.patch 2009-10-14 03:38 sfeam
File Added 305541: href_16dec2008.patch 2008-12-16 17:36 sfeam
File Deleted 298146: 2008-12-16 17:36 sfeam
File Deleted 303440: 2008-12-16 17:36 sfeam
File Deleted 297808: 2008-11-29 19:57 sfeam
File Added 303440: href_28nov2008.patch 2008-11-29 19:57 sfeam
File Added 298146: href_20oct2008.patch 2008-10-20 20:11 sfeam
File Added 297809: hyper.pdf 2008-10-17 21:22 sfeam
File Deleted 297647: 2008-10-17 21:15 sfeam
File Added 297808: href_17oct2008.patch 2008-10-17 21:15 sfeam
File Added 297647: href_16oct2008.patch 2008-10-16 18:51 sfeam