Skip to content
Snippets Groups Projects

Showing a new model in the detail page (forecasts app)

The VIPSWeb app has the tools to display results from model calculations. It fetches the data from the VIPSLogic backend. Each model has its own characteristics, and VIPSWeb needs to be told how to display the results from each model.

Detail view of results from an Apple scab model forecast

This has to be configured in the admin section of Django. Log in as administrator, or create one if you haven't already.

Add result parameters for the model

For each model, you have to specify the parameters (returned from the model calculations) that should be displayed in the table and in the diagram. All result parameters specified will be displayed in the table, but only the ones configured as "Model graph parameters" will be shown in the chart.

Add a result parameter by clicking as shown below

Click Add to add a new result parameter

The result parameter form is shown below.

  • Namespace = The model ID (dictated by the model) or WEATHER (Weather parameters are most times using the WEATHER namespace)
  • Key = The parameter ID (dictated by the model)
  • Name = The parameter name as displayed to users
  • Description = Further description of the parameter (currently not in use)
  • Measurementunit = How this parameter is measured. If not in any meaningful unit like °C, use "Number"

You can also add local names, by adding "Result parameter local". Use the ISO two-letter code for language and add your translation

The result parameter form

After saving, the parameter is listed among all the others in the VIPSWeb application, as shown below.

The list of result parameters

Configure a result parameter to be shown in the chart

VIPSWeb uses Highcharts to generate charts, coupled with our own parameter-to-chart logic. It's on our TODO list to replace Highcharts To make the chart library recognize a chart parameter and tell it how it should be displayed, click "Add" in "Model graph parameters" as shown below.

Click Add to add a new model chart parameter

The form is show below

  • Model id (some parameters span models, e.g. WEATHER parameters, this is why you need to specify this)
  • Result parameter
  • Color hexcode = The color code for the chart item. Read about it
  • Highcharts type = [spline, area, bar, column, scatter]. Read about it

The model graph parameter form