Currenty hypertext labels can be cut off, if they are too close to the border. See this example
set terminal svg mouse jsdir 'http://gnuplot.sourceforge.net/demo_hypertext/' set output 'file\example.svg' plot '-' using 1:2:3 with labels hypertext point pt 8 0 1 "Sometext" 1 2 "Somelongtext" e
The label "Somelongtext" can only be seen partially, since the resulting svg-File contains the the viewbox parameter
< svg onload="if (typeof(gnuplot_svg)!='undefined') gnuplot_svg.Init(evt)" width="600" height="480" viewBox="0 0 600 480" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
If the viewBox is not set, the label "Somelongtext" can be read fully. I don't know why the viewBox is set, but at least in this context, I would suggest to ommit the viewBox.
I have modified gnuplot_svg.js so that the hypertext box "bounces" off the bottom of the plot area. Doing the same for the right margin should be possible but requires a bunch of extra bookkeeping. You can see it here:
http://gnuplot.sourceforge.net/demo_svg_4.7/hypertext.html
At least in the context of using a web browser to view the svg plot, modifying the viewBox does not help. The plot area is still bounded by the width and height properties.
That already seems to work and is a better solution than removing the viewBox and the width/height. I am not a javascript expert, but here somebody did achieve the desired effect bouncing of on the right side
http://www.inspire.nl/blog/creating-interactive-graphs-with-svg-part-2/
in action
http://journalinsights.elsevier.com/journals/0038-0717/review_speed
The article also mentions a shadow as a mouse-over effect which could be a nice addition.
Now bounces off both the bottom and the right edge.
Thanks for the great work! Can you tell me where you put the javascript-File? This one http://gnuplot.sourceforge.net/demo_svg_4.7/gnuplot_svg.js only bounces only off the bottom.
http://gnuplot.cvs.sourceforge.net/viewvc/gnuplot/gnuplot/term/js/
There seems to be an issue with that if there are more lines in the hypertext box. Line 2 is indentend by one space, line 3 by two spaces, ...
Hmm. It works just fine here when viewed in the chrome browser.
But firefox seems to get the text width wrong, which could lead to alignment problems as well as an incorrect box size.
What browser are you using? Is it possible to get a screenshot that show the incorrect display?
I just tested the update you made and now everything works fine. (by the way, I did use Google Chrome too when the bug occured)
and would it be possible to highlight the point just in the linked example or should I open a separate feature-request?
The left alignment currently does not work (IE, Firefox or Chrome), the second line is offset by a whole line to the right, the third line is offset by two lines. Some update of http://gnuplot.cvs.sourceforge.net/viewvc/gnuplot/gnuplot/term/js/gnuplot_svg.js must have caused this problem, since everything was working fine so far.
The problem seems to be related to this line in the gnuplot_svg.js
if (typeof tspan_element == tspan')
when I remove it, everything works fine.
I can't reproduce the problem. Could you attach a link to a document that shows the error?
FWIW the line that you quote above contains an error (missing quote) that is not in the original source file. Could it have gotten corrupted somehow?
The missing quote was just a copy and paste error, sorry about that. I uploaded a file to pastebin, I hope this helps http://pastebin.com/CbUsCa7G The mouseover has 3 lines, only the first is aligned well
I am guessing that the problem is a mismatch between the code produced by gnuplot version 4.7, which is what your file says it was created with, and the gnuplot_svg.js mousing code from version 5.1 (current cvs), which is what the file links to. But it's only a guess.
I'm not seeing any problem with svg files produced by 5.1 and linked to the mousing script for 5.1
I just updated to latest official release 5.00 (gp500-win64-mingw) und the error still occurs. I would like to test version 5.1 but I don't know where to download the binaries for windows.
Maybe this gnuplot-code reproduces the error in your environment?
Yes. That test code reproduces the error. And as you say, removing the test for (typeof tspan_element == 'tspan') makes it work again.
So color me confused. I don't really have time right now to track down the history of that test and sort out what the proper fix is, but for now I will comment out that test line in the CVS version.