Canvas Gnuplot HTML画布到带有缩放的静态页面

Canvas Gnuplot HTML画布到带有缩放的静态页面,canvas,gnuplot,Canvas,Gnuplot,我的目标是得到一个交互式的gnuplot,在这里你可以放大这样的时间范围 gnuplot>设置终端画布 终端类型现在为“画布” 选项为“圆形尺寸600400增强型fsize 10 lw 1 fontscale 1独立” gnuplot>设置输出'output.html' gnuplot>plot[0:25]sin(x) gnuplot> [hendry@t480sc]$grep.js output.html //gnuplot_common.js提供的命令的简短形式 在我的本地gnuplot

我的目标是得到一个交互式的gnuplot,在这里你可以放大这样的时间范围

gnuplot>设置终端画布
终端类型现在为“画布”
选项为“圆形尺寸600400增强型fsize 10 lw 1 fontscale 1独立”
gnuplot>设置输出'output.html'
gnuplot>plot[0:25]sin(x)
gnuplot>
[hendry@t480sc]$grep.js output.html
//gnuplot_common.js提供的命令的简短形式
在我的本地
gnuplot 5.4 patchlevel 0上,它引用了本地js,所以我需要重写它,它没有缩放按钮(no
table id=“gnuplot\u mousebox”
)。我是否错过了一个技巧来获得一个更为封装的/Web就绪的canvas版本,比如演示版?

不确定“它引用本地js”是什么意思。如果您的意思是元素中的URL指向本地文件,那么可以使用终端选项
jsdir
来更改。例如,如果您正在创建要在其上发布的文件”https://gnuplot.hendry.org“那么你会使用类似于

 set term canvas standalone mousing jsdir "https://gnuplot.hendry.org"
演示只是一个演示,而不是一个工具箱。欢迎您复制定义该mousebox元素的html片段,或者创建自己的。它在gnuplot发行包中

编辑:
帮助设置术语画布

 The default `standalone` mode creates an html page containing javascript
 code that renders the plot using the HTML 5 canvas element.  The html page
 links to two required javascript files 'canvastext.js' and 'gnuplot_common.js'.
 An additional file 'gnuplot_dashedlines.js' is needed to support dashed lines.
 By default these point to local files, on unix-like systems usually in
 directory /usr/local/share/gnuplot/<version>/js.  See installation notes for
 other platforms. You can change this by using the `jsdir` option to specify
 either a different local directory or a general URL.  The latter is usually
 appropriate if the plot is exported for viewing on remote client machines.

 All plots produced by the canvas terminal are mouseable.  The additional
 keyword `mousing` causes the `standalone` mode to add a mouse-tracking box
 underneath the plot. It also adds a link to a javascript file
 'gnuplot_mouse.js' and to a stylesheet for the mouse box 'gnuplot_mouse.css'
 in the same local or URL directory as 'canvastext.js'.
默认的“独立”模式创建一个包含javascript的html页面
使用HTML5画布元素呈现绘图的代码。html页面
链接到两个必需的javascript文件“canvastext.js”和“gnuplot_common.js”。
需要另一个文件“gnuplot_dashedlines.js”来支持虚线。
默认情况下,这些文件指向本地文件,在类似unix的系统上通常是
目录/usr/local/share/gnuplot//js。有关详细信息,请参阅安装说明
其他平台。您可以通过使用'jsdir'选项指定
不同的本地目录或通用URL。后者通常是
如果打印导出以在远程客户端计算机上查看,则适用。
画布终端生成的所有绘图都可以进行鼠标移动。附加的
关键字“mousing”导致“standalone”模式添加鼠标跟踪框
在情节下面。它还添加了一个指向javascript文件的链接
“gnuplot_mouse.js”和鼠标框“gnuplot_mouse.css”的样式表
在与“canvastext.js”相同的本地或URL目录中。

奇怪的是,我的canvas\u help.html中的gnuplot.help\u URL不在我的发行版中
pacman-Ql gnuplot | grep canvas\u help
。为什么
help canvas
不显示jsdir或mousing选项?命名约定有点不幸。“帮助画布”中的“画布”是放置打印元素的概念绘图区域。它不是HTML5的“画布终端”。您正在寻找
帮助设置术语画布
。我将在答案中添加帮助部分的相关段落。
 The default `standalone` mode creates an html page containing javascript
 code that renders the plot using the HTML 5 canvas element.  The html page
 links to two required javascript files 'canvastext.js' and 'gnuplot_common.js'.
 An additional file 'gnuplot_dashedlines.js' is needed to support dashed lines.
 By default these point to local files, on unix-like systems usually in
 directory /usr/local/share/gnuplot/<version>/js.  See installation notes for
 other platforms. You can change this by using the `jsdir` option to specify
 either a different local directory or a general URL.  The latter is usually
 appropriate if the plot is exported for viewing on remote client machines.

 All plots produced by the canvas terminal are mouseable.  The additional
 keyword `mousing` causes the `standalone` mode to add a mouse-tracking box
 underneath the plot. It also adds a link to a javascript file
 'gnuplot_mouse.js' and to a stylesheet for the mouse box 'gnuplot_mouse.css'
 in the same local or URL directory as 'canvastext.js'.