Re: Generating static htmls with interactive plots

2020-04-07 Thread Mayuresh
On Mon, Apr 06, 2020 at 07:42:34PM +0530, Mayuresh wrote:
> On Mon, Apr 06, 2020 at 11:50:55AM +0100, Mike Pumford wrote:
> > If you want I can provide some of my simple js test code to help you out.

This link helped me get a going. It's pretty simple and useful.

https://plotly.com/javascript/line-charts/#basic-line-plot

Mayuresh


Re: Generating static htmls with interactive plots

2020-04-06 Thread Mayuresh
On Tue, Apr 07, 2020 at 01:13:05AM +, m...@netbsd.org wrote:
> However I don't know if it's even possible to make it zoom "correctly"
> with just SVG. Certainly the default from gnuplot does not do this.
> 
> So after experimenting I think d3.js might be a better choice...

Yes, first thing I had thought of was to generate svgs using gnuplot.
Besides pan and zoom there are many nuances of plots like highlighting the
values, highlighting one curve where you click when there are multiple on
the same plot etc.

As other posts suggest I'll be trying plotly. Will also look at d3.

Mayuresh


Re: Generating static htmls with interactive plots

2020-04-06 Thread maya
On Mon, Apr 06, 2020 at 03:00:15PM +0530, Mayuresh wrote:
> I have a NetBSD based web server which serves mainly static contents and
> files. There is one requirement to include some time series plots with
> some monthly data points - so, the plots do not need to take any
> parameters from a browser and can be statically generated.
> 
> Only requirement is for the plots to have some interactivity, such as
> zooming, panning, mouseover text and so on.
> 
> I hear nodejs has a collection of packages for this. But not sure about
> ability to generate a static html.
> 
> Came across python plotly and it seems to have the ability to generate
> static htmls the way I want.
> 
> Just wanted to know if there are more options to explore if someone has
> tried in similar situations.
> 
> Mayuresh

To generate SVG:

> cat infile
1,1
2,4
4,16
5,25

gnuplot> set datafile separator ','
gnuplot> set term svg
gnuplot> set output 'out.svg'
gnuplot> plot 'infile' using 1:2 with lines, ''

However I don't know if it's even possible to make it zoom "correctly"
with just SVG. Certainly the default from gnuplot does not do this.

So after experimenting I think d3.js might be a better choice...


Re: Generating static htmls with interactive plots

2020-04-06 Thread Mayuresh
On Mon, Apr 06, 2020 at 11:50:55AM +0100, Mike Pumford wrote:
> If you want I can provide some of my simple js test code to help you out.

That will be of great help! Thank you.

In my case I just have a csv data with 2 columns of type date and integer.
But any example will go to get me going.

Mayuresh


Re: Generating static htmls with interactive plots

2020-04-06 Thread Mike Pumford




On 06/04/2020 11:30, g...@duzan.org wrote:

=> I have a NetBSD based web server which serves mainly static contents and
=> files. There is one requirement to include some time series plots with
=> some monthly data points - so, the plots do not need to take any
=> parameters from a browser and can be statically generated.
=>
=> Only requirement is for the plots to have some interactivity, such as
=> zooming, panning, mouseover text and so on.
=>

IF you can provide the data as a static file (say in json format) you 
can use plotly.js on the browser side to turn that into a graph. The 
plotly.js library supports zooming/panning and other functionality all 
without refetching the data from the server.


I use this as part of a full vuejs application (with nodejs backed) for 
displaying server monitoring data but its not particularly hard to load 
the data into plotly on the browser side and use it stand alone. This is 
what I did in my early experimental phases.


If you want I can provide some of my simple js test code to help you out.

Mike


Re: Generating static htmls with interactive plots

2020-04-06 Thread gary
=> I have a NetBSD based web server which serves mainly static contents and
=> files. There is one requirement to include some time series plots with
=> some monthly data points - so, the plots do not need to take any
=> parameters from a browser and can be statically generated.
=>
=> Only requirement is for the plots to have some interactivity, such as
=> zooming, panning, mouseover text and so on.
=>
=> I hear nodejs has a collection of packages for this. But not sure about
=> ability to generate a static html.
=>
=> Came across python plotly and it seems to have the ability to generate
=> static htmls the way I want.
=>
=> Just wanted to know if there are more options to explore if someone has
=> tried in similar situations.
=>
=> Mayuresh
=>

   It is only an idea, not a solution, but I'm reminded of Flame
Graphs[1], which manage to pull off something similar in a static SVG
file. I would assume that a similar approach could get you what you
want, but it would require some design and coding.

   Gary Duzan


[1] http://www.brendangregg.com/flamegraphs.html



Generating static htmls with interactive plots

2020-04-06 Thread Mayuresh
I have a NetBSD based web server which serves mainly static contents and
files. There is one requirement to include some time series plots with
some monthly data points - so, the plots do not need to take any
parameters from a browser and can be statically generated.

Only requirement is for the plots to have some interactivity, such as
zooming, panning, mouseover text and so on.

I hear nodejs has a collection of packages for this. But not sure about
ability to generate a static html.

Came across python plotly and it seems to have the ability to generate
static htmls the way I want.

Just wanted to know if there are more options to explore if someone has
tried in similar situations.

Mayuresh