Skip to content
Snippets Groups Projects
Commit c94b9d03 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

doc: Add how-to for config of model output detail page

parent 192b2a67
No related branches found
No related tags found
No related merge requests found
......@@ -57,4 +57,44 @@ The official Django documentation for this [can be found here](https://docs.djan
</Files>
</Directory>
```
\ No newline at end of file
```
## Developer guide
### Showing a new model in the detail page (forecasts app)
This has to be configured in the admin section of Django. Log in as administrator, or [create one](https://docs.djangoproject.com/en/3.1/intro/tutorial02/#creating-an-admin-user) 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](./docs/illustrations/add_result_param_1.png "Click Add to add a new result parameter")
The result parameter form is shown below.
* Namespace = The model ID (dictated by the model)
* 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 &deg;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](./docs/illustrations/add_result_param_2.png "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](./docs/illustrations/add_result_param_3.png "The list of result parameters")
#### Configure a result parameter to be shown in the chart
VIPSWeb uses [Highcharts](https://www.highcharts.com/) 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](./docs/illustrations/add_result_param_4.png "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](https://www.w3schools.com/htmL/html_colors_hex.asp)
* Highcharts type = [spline, area, bar, column, scatter]. [Read about it](https://www.highcharts.com/docs/chart-and-series-types/chart-types)
![The model graph parameter form](./docs/illustrations/add_result_param_5.png "The model graph parameter form")
\ No newline at end of file
docs/illustrations/add_result_param_1.png

47.8 KiB

docs/illustrations/add_result_param_2.png

104 KiB

docs/illustrations/add_result_param_3.png

135 KiB

docs/illustrations/add_result_param_4.png

49.4 KiB

docs/illustrations/add_result_param_5.png

69.3 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment