Agree completely.

Another idea is to adapt the existing cheetahgenerator to put out JSON
format:

$current.json


or

$month.outTemp.json


Other formats could be requested in a similar manner:

$month.outTemp.csv(delimiter=',')



I would start by figuring out the various use cases. If what you're going
to want is, say, a vector of temperatures for the month, then this would be
the way to go. OTOH, if what you need is a month's worth of data, holding
all observation types, then the present tag machinery is not designed for
this.

It is tempting to specify a whole new 'jsongenerator', but you're going to
have to come up with some way of allowing the user to specify exactly what
s/he wants. I suspect you'll end up with something like the present tag
system that cheetahgenerator uses. I hate to introduce a whole new syntax
that the user has to learn without a real good reason.

Specific answers to your questions:


   1. No. I think users are likely to want something like daily average
   temperature.
   2. Rather than using tags, this would be an alternative of specifying
   what's needed: use the present config file format. I can see advantages and
   disadvantages to this approach. Pro: probably a simple one-to-one mapping
   from config section to a JSON file. Con: Something new to learn.
   3. Don't know. Would depend on the use cases you come up with.

Re: Skin. Make sure you see what Matthew has been doing with his 'newskin
<https://github.com/weewx/weewx/tree/newskin>' branch, which has similar
design goals.

-tk

-tk





On Sun, Jan 8, 2017 at 3:27 AM, Darryn Capes-Davis <
[email protected]> wrote:

> Hi All,
>
> I am now doubt going to start a bit of a conversation with this one. I
> came across the use of Highcharts on a Weather website today and it looks
> pretty neat. My first thought would be to generate Json data from Weewx and
> code up the client size which would be pretty straight forward.
>
> I have reviewed the forums and see that both Json and plotting has been
> discussed. It looks like the Bee's Knees will be WeeRT and a new client
> front end (thread: Dynamic History Plots Using D3).
>
> What I am looking for is something that can be completed quite rapidly
> using Highcharts. It may not be the best, nor lightweight, nor fit everyone
> due to Highcharts licensing, but it will be something.
>
> The main part for discussion is how to get Json data out of Weewx.
>
> Option 1: Code up $all_values timebinder (or similar) and use Cheetah
> template engine. While this will work I am feeling it will not be as
> flexible as it needs.
>
> Option 2: Code up a new 'jsongenerator' which works similar to
> imagegenerator, borrowing its conf structure etc., but output is json data
> and not an image.
>
> I believe coding up a jsongenerator would be straightforward and would be
> happy to do. If so, we may need to think about the following.
>
> jsongenerator Q1: Will it be just raw data?
> jsongenerator Q2: Will a [head] or something be need to give information
> about the file? I am thinking start_ts, stop_ts, observations
> included.. (Any examples people have used? Any requirements?)
> jsongenerator Q3: For multiple observations in a file (like multiple on a
> plot), will it be a row collection of the observations? Or a collection of
> each observation? I think the former as this would be easy to put into
> client side charting applications.
>
> Then for the Skin, I would reduce the Current, Week, Month, Year down to
> one page and have a selection to choose what data to display in graphs.
> (Weewx would have output Json files for each). Not the most elegant but is
> a nice transition from the current 'standard' Skins into something client
> driven but not too fat or heavy (and not waiting for the 'new' world).
>
> Your thoughts. I intend to code up next weekend (unless otherwise
> convinced!).
>
> Regards
>
> Darryn
>

Reply via email to