AnnualDataSummary: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
no edit summary
No edit summary
No edit summary
{{AddOnBanner|name=Annual Data Summary|type=HTML & Javascript|author=David Jamieson|contact=[[User:Daj|DAJ]]|updated=7 March 2011|version=1.1|updated=17 December 2012|version=1.2 BCJKiwi}}
 
'Annual Data Summary' is a small tool to read the [[dayfile.txt]] produced by Cumulus and summarise this in a table, arranged like a calendar, showing a full years worth of a selected field such as maximum daily temperaturedata.
*The tool uses HTML, and jQuery (a library script that produces Javascript) and includes a CSS file.
*The JavaScript version does not require a webserver with PHP services enabled. (Many of the free hosting services do not offer PHP so this was a solution to that problem).
*The alternative is a PHP version (included so you have the option to use either).
*Both provide identical looking output and functionality, however if you have PHP services on your web server use the PHP version as it is slightly faster.
 
*AAn working example is [http://www.fordingbridgeweathergrantownweather.co.uk/datasummaryhistoric/dataSummary.php here]
 
= Requirements =
 
*webserver space (couldunless beyou are using this tool on your own local machine or on a commercial server)
*Cumulus [[Dayfile.txt]] file onuploaded to the webserver (for the original version of this tool, the default location is a subfolder called 'data')
*JavaScriptJavascript enabled browser (all modern browsers use JavaScriptJavascript)
*optionally, a tool to automate the uploading of dayfile.txt to your webserver once per day after rollover. Example, [[CumulusToolbox]]
*Use of '''Daily''' option on ''Files/Options'' screen to call command to upload 'dayfile.txt' to your web server
*optionally, PHP enabled web server if you wish to use the PHP version
 
= The Source Code =
== Revised PHP ==
Here is a revised set of files (PHP only) ver 1.2.
 
These are available here and update the Ver 1.1 fileset abovebelow to eliminate errors in validation due to non-standard or deprecated code routines.
== Original Fileset ==
They also include a couple of updates from DAJ version as advised by posts in the Forum.
The files include additional notes, and explanations on the changes, where relevant.
An*A working example is [http://wwwsilveracorn.ibtestco.dknz/vejrweather/datasummary.htmlphp here]
*Download the following file...[http://wiki.sandaysoft.com/files/AnnualDataSummary_12.zip AnnualDataSummary_12.zip]
*Follow the instructions below for the PHP version.
 
*The tool uses HTML, jQuery (a library script that produces Javascript) and a CSS file.
*The JavaScript version does not require a webserver with PHP services enabled. (Many of the free hosting services do not offer PHP so this was a solution to that problem).
*The alternative is a PHP version (included so you have the option to use either).
*Both provide identical looking output and functionality, however if you have PHP services on your web server use the PHP version as it is slightly faster.
 
== Alternative Web Tools ==
An working example is [http://www.ibtest.dk/vejr/datasummary.html here]
Available only from either the Website Development or the Third Party Tools sections of the support forum are alternative tools that will display daily or seasonal summaries of the contents of [[dayfile.txt]]. Although they work with daily extremes and other statistics produced by Cumulus in that file, they are also designed to cope with additional information imported into that file. Consequently although Cumulus itself cannot produce nor process 'Nulls', these tools do have some capacity to handle null fields representing missing observations.
 
The tools are written in code to more modern standards than the original here and are generally far more flexible in what they can output.
 
=== Alternative PHP ===
*An extensively coloured version is on the forum at [http://sandaysoft.com/forum/viewtopic.php?f=14&t=5319 'Post subject: Annual Data Summary - Coloured Values']; there is some useful discussion on the trade-off between testing values and efficient code here.
*Further ideas are explored by Mark Crossley and beteljuice in various places on the Cumulus forum e.g. [http://sandaysoft.com/forum/viewtopic.php?f=14&t=11133 'Post subject: Annual data Summary (DAJ script) - show day-of-week'].
*Finally there is [http://sandaysoft.com/forum/viewtopic.php?f=14&t=11397 'Post subject: Yet Another Dayfile Reader (PHP)'] in the Website Development - Web general sub forum. Amongst other features, in this more recent experiment the highlighting makes day of week appear in row headers, you can swap between daily and seasonal views and there is a table summary including averages. See that forum url for links to sites that use this version.
 
=== Alternative JavaScript ===
This section only is by [[User:Sfws|Sfws]] ([[User talk:Sfws|talk]]) 00:53, 18 May 2013 (PDT)
 
An [http://sandaysoft.com/forum/viewtopic.php?f=18&t=8690 alternative Javascript/jQuery solution] is in the 3rd party tools sub forum within the Cumulus forum and its advantages are fully described in a file within the package. They include standards compliance, better integration with standard Cumulus pages, statistical additions to the bottom of each month's column, and easier tailoring to your preferences on wording, language, and text colouring.
 
One site using in January 2013 a variant based on this alternative code, with its own look to the page, is [http://sassafras.id.au/projects/weather/dailyrecords.shtml found here]. Whilst a number of other people have tried later versions of this alternative code, it has not been adopted as widely as the PHP alternatives above, partly because this is designed for tailoring, and those are off the shelf packages.
 
Since this code was originally written in December 2011, my alternative JavaScript version has evolved and now none of the original code remains, and a number of additional features have been added, whilst attempting to preserve ease of customisation to suit any requirements you have e.g. on the language and level of diagnostics output. The updates on the forum are infrequent because the shared version always lags behind my latest experiments.
 
== Original Fileset ==
 
*Download the following file...[http://wiki.sandaysoft.com/files/AnnualDataSummary.zip AnnualDataSummary.zip]
*Unzip the contents (five files will be extracted)
 
Change as needed, save and test
== Revised PHP ==
Here is a revised set of files (PHP only) ver 1.2.
 
These are available here and update the Ver 1.1 fileset above to eliminate errors in validation due to non-standard or deprecated code routines.
They also include a couple of updates from DAJ version as advised by posts in the Forum.
The files include additional notes, and explanations on the changes, where relevant.
*A working example is [http://www.fordingbridgeweather.co.uk/datasummary.php here]
*Download the following file...[http://wiki.sandaysoft.com/files/AnnualDataSummary_12.zip AnnualDataSummary_12.zip]
*Follow the instructions below for the PHP version.
 
= Usage =
Along the top will be a menu of the (in original version) six data sets available and on the top left of the table is the year currently being shown. Change either the year, or click one of the top buttons to change the data set. Depending on the speed of your internet connection, and your browser, the new web page may take a few seconds to be processed as it involves: re-reading the dayfile.txt file, redrawing the table, and inserting the values.
 
If you mouse over a particular value, it will be highlighted together with the corresponding day (row heading) and month (column heading). The highlighting functionality varies a bit between versions (see possible problems below).
== Alternative Web Tools ==
Available only from either the Website Development or the Third Party Tools sections of the support forum are alternative tools that will display daily or seasonal summaries of the contents of [[dayfile.txt]]. Although they work with daily extremes and other statistics produced by Cumulus in that file, they are also designed to cope with additional information imported into that file. Consequently although Cumulus itself cannot produce nor process 'Nulls', these tools do have some capacity to handle null fields representing missing observations.
 
The tools are written in code to more modern standards than the original here and are generally far more flexible in what they can output.
 
=== Alternative PHP ===
*An extensively coloured version is on the forum at [http://sandaysoft.com/forum/viewtopic.php?f=14&t=5319 'Post subject: Annual Data Summary - Coloured Values']; there is some useful discussion on the trade-off between testing values and efficient code here.
*Further ideas are explored by Mark Crossley and beteljuice in various places on the Cumulus forum e.g. [http://sandaysoft.com/forum/viewtopic.php?f=14&t=11133 'Post subject: Annual data Summary (DAJ script) - show day-of-week'].
*Finally there is [http://sandaysoft.com/forum/viewtopic.php?f=14&t=11397 'Post subject: Yet Another Dayfile Reader (PHP)'] in the Website Development - Web general sub forum. Amongst other features, in this more recent experiment the highlighting makes day of week appear in row headers, you can swap between daily and seasonal views and there is a table summary including averages. See that forum url for links to sites that use this version.
 
=== Alternative JavaScript ===
This section only is by [[User:Sfws|Sfws]] 00:53, 18 May 2013 (PDT)
 
WhatSome isdata shown,sets show minimum and how,maximum values in the cells at the intersection of the day and month headings, dependsmost onjust theshow versiona yousingle choosevalue toat installthe intersection.
An [http://sandaysoft.com/forum/viewtopic.php?f=18&t=8690 alternative Javascript/jQuery solution] is in the 3rd party tools sub forum within the Cumulus forum and its advantages are fully described in a file within the package. They include standards compliance, better integration with standard Cumulus pages, statistical additions to the bottom of each month's column, and easier tailoring to your preferences on wording, language, and text colouring.
 
Since this code was originally written in December 2011, my alternative JavaScript version has evolved and now none of the original code remains, and a number of additional features have been added, whilst attempting to preserve ease of customisation to suit any requirements you have e.g. on the language and level of diagnostics output.
 
One site using in January 2013 a variant based on this alternative code, with its own look to the page, is [http://sassafras.id.au/projects/weather/dailyrecords.shtml found here]. Whilst a number of other people have tried later versions of this alternative code, it has not been adopted as widely as the PHP alternatives above, partly because this is designed for tailoring, and those are off the shelf packages.
 
= Usage =
Along the top will be a menu of the (in original version) six data sets available and on the top left of the table is the year currently being shown. Change either the year, or click one of the top buttons to change the data set. Depending on the speed of your internet connection, and your browser, the new web page may take a few seconds to be processed as it involves: re-reading the dayfile.txt file, redrawing the table, and inserting the values.
 
If you mouse over a particular value, it will be highlighted together with the corresponding day (row heading) and month (column heading). The highlighting functionality varies a bit between versions (see possible problems below).
 
What is shown, and how, in the cells at the intersection of the day and month headings, depends on the version you choose to install.
 
== Opening a specific data set when the page is first loaded ==
 
== Processing ==
If you select the pure Javascript original solution downloaded from this section, it means the page viewer's browser is doing all the work. The complete dayfile.txt is reloaded each time you select a dataset, and your browser then filters and processes the required subset of values from it. A table is then constructed by the script at the point indicated by the HTML DIV called 'tableData', and the values are then inserted.
 
If you select one of the varioustwo PHP versions available from this page or the forum links above, the source server does all the work of constructing the HTML page and sends the result to the viewer's browser.
 
= Customisation =
== Understanding the Basics ==
 
The original 'tool' relies on three files for successful operation:
# the jQuery library routines that allow it to work in any user agent (browser)
# datasummary.css (the style sheet) and
 
*variable '''mn''' is a list of the 12 months of the year, in an abbreviated format. You may change these as necessary, but try to keep it to an abbreviation as there is limited space.
*''''label_items'''' is a list of all possible data sets to be displayed. Again you can change these to suit if you are prepared to wade through all the script and make changes elsewhere too. However, the format is a little more involved and you should take some care. Each row represents one data set, with 4 columns of settings for that data set; so the default list is an array of four by six.
 
Example of a row,....
<br>
 
== Styling (applies only to original version of code) ==
 
The table styling is completely configurable using the included datasummary.css [[Stylesheet]]. By default it is using similar colours to the standard Cumulus website. Below are a few of the key entries to consider when adjusting settings (typically colouring)... Also see [http://sandaysoft.com/forum/viewtopic.php?f=14&t=5319 support forum thread about colouring with php]
5,838

edits

Navigation menu