ChartsCompiler: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
571 bytes added ,  15:56, 11 November 2023
m
 
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:
   |__TOC__
   |__TOC__
   |}
   |}
The ChartsCompiler is the "next-generation" method of creating charts for websites on the basis of CumulusMX based systems. Charts are defined in a dedicated [[Charts Definition Language (CDL)|Charts Definition Language]] and compiled into a file (or files) containing both the HTML/javascript menu infrastructure as well as the Highcharts javascript code to create the charts. Data - in JSON files similar like those produced by CumulusMX - is assumed to be present in the directory  from where the page is called. The ChartsCompiler gives the user the possibility to completely freely define and generate charts for all weather variables within CMX (including userdefined and derivatives) for within any website context.
The ChartsCompiler is the "next-generation" method of creating charts for websites on the basis of CumulusMX based systems. Charts are defined in a file ''CutilsCharts.def'' in a dedicated [[Charts Definition Language (CDL)|Charts Definition Language]] and compiled into a file (or files) containing both the HTML/javascript menu infrastructure as well as the Highcharts javascript code to create the charts. Data - in JSON files similar like those produced by CumulusMX - is assumed to be present in the directory  from where the page is called. The ChartsCompiler gives the user the possibility to completely freely define and generate charts for all weather variables within CMX (including userdefined and derivatives) for within any website context.
 
One special feature for all charts in CumulusUtils is the possibility for the background image. This is described in [[Website_Generator#Chart_Background_Images|the chapter on the website]]


The compiler can be used within CumulusUtils website (intrinsic with the Website Generator [[ChartsCompiler#Implicit_activation|(Implicit Activation)]]) and the output can be used standalone (really standalone if you rename the output to .html) or standalone from within a users website (menu or link; [[ChartsCompiler#Explicit_activation|Explicit Activation]]). When used outside the CumulusUtils infrastructure, you must be aware of the [[cumulusutils.ini|parameters]] (section general) ''GeneratejQueryInclude'' and ''DoLibraryIncludes''.
The compiler can be used within CumulusUtils website (intrinsic with the Website Generator [[ChartsCompiler#Implicit_activation|(Implicit Activation)]]) and the output can be used standalone (really standalone if you rename the output to .html) or standalone from within a users website (menu or link; [[ChartsCompiler#Explicit_activation|Explicit Activation]]). When used outside the CumulusUtils infrastructure, you must be aware of the [[cumulusutils.ini|parameters]] (section general) ''GeneratejQueryInclude'' and ''DoLibraryIncludes''.
Line 41: Line 43:
You have to schedule this command if you wish to use the FTP frequency CMX uses for its JSON's.
You have to schedule this command if you wish to use the FTP frequency CMX uses for its JSON's.


Note that these JSON files specific to CumulusUtils '''always reside in the website root''' of CumulusUtils, even if you have more websites and defined the ''CumulusRealTimeLocation''.
NOTES:
#These JSON files specific to CumulusUtils '''always reside in the website root''' of CumulusUtils, even if you have more websites and defined the ''CumulusRealTimeLocation''.
#To the above rule there is the exception of modular use: if the user decides to use CUtils a modular way it is possible to have a separate directory on the webserver below the webroot which contains the CUtils files for the modules in use.
 
There are the following parameters for this in use:
 
  DoModular=false          // When ''true'', CUtils is used in a modular fashion. Incompatible with the Website command
  ModulePath=              // The path on the server where the CUtils specific JSONs will be uploaded to


== Output ==
== Output ==
Line 65: Line 74:


   [Compiler]
   [Compiler]
  ChartContainerHeight=700      => Provides the means for the  user to adjust the height of the chart which in case of modular use is very usefull (default=700)
   DoneToday=17/04/21            => If the user uses data on ''Daily basis'' or ''All basis'' (from the dayfile), the data need to be prepared only once per day.
   DoneToday=17/04/21            => If the user uses data on ''Daily basis'' or ''All basis'' (from the dayfile), the data need to be prepared only once per day.
                                     This parameter tells us the age of the data present to the website.
                                     This parameter tells us the age of the data present to the website.


== Inner working ==
== Inner working ==
Line 75: Line 82:
When the definition is parsed, a list of chart data structures containing all required information is created. After parsing is successful - one pass - the list is passed to the code generator which creates the output.
When the definition is parsed, a list of chart data structures containing all required information is created. After parsing is successful - one pass - the list is passed to the code generator which creates the output.


The user only has influence on the chart definitions. Errors are logged to the standard logfile. There is currently no true error recovery so when an error is encountered it is logged and the compiler exits to fall back to the default cumuluscharts.txt. The user has to correct the error and run the compiler again. A normal way to develop the charts would be to iterate through the command ''CompileOnly'' and when the generation goes without errors, incorporate the charts in the website. When using the command like this, be aware of what is written on the [[Website_Generator#Javascript_libraries|Website Generator page]] on this.
The user only has influence on the chart definitions. Errors are logged to the standard logfile. There is currently no true error recovery so when an error is encountered it is logged and the compiler exits to fall back to the default cumuluscharts.txt. The user has to correct the error and run the compiler again. A normal way to develop the charts would be to iterate through the command ''CompileOnly'' and when the generation goes without errors, incorporate the charts in the website. When using the command like this, be aware of what is written on the [[Website_Generator#Javascript_libraries|Website Generator page]].


Read the [[Charts Definition Language (CDL)|Charts Definition Language]].
Read the [[Charts Definition Language (CDL)|Charts Definition Language]].


[[Category:CumulusUtils]]
[[Category:CumulusUtils]]

Navigation menu