diff --git a/README.md b/README.md index b1bac984194eae520617647eba81547fab8ae74b..fde520355eddd4ad766a22fd8148c6a8a1dfe1b3 100644 --- a/README.md +++ b/README.md @@ -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 + + + +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 °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 + + + +After saving, the parameter is listed among all the others in the VIPSWeb application, as shown below. + + + + +#### 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. + + + +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) + + \ No newline at end of file diff --git a/docs/illustrations/add_result_param_1.png b/docs/illustrations/add_result_param_1.png new file mode 100644 index 0000000000000000000000000000000000000000..aa65e91e0d8ee1dbb6333582ead3fb06d8a875f6 Binary files /dev/null and b/docs/illustrations/add_result_param_1.png differ diff --git a/docs/illustrations/add_result_param_2.png b/docs/illustrations/add_result_param_2.png new file mode 100644 index 0000000000000000000000000000000000000000..8e710a7e35a0abab98fa6f73c2ff95d82f823e96 Binary files /dev/null and b/docs/illustrations/add_result_param_2.png differ diff --git a/docs/illustrations/add_result_param_3.png b/docs/illustrations/add_result_param_3.png new file mode 100644 index 0000000000000000000000000000000000000000..042df791a3b071ccaa054b2f7088302553a8dd67 Binary files /dev/null and b/docs/illustrations/add_result_param_3.png differ diff --git a/docs/illustrations/add_result_param_4.png b/docs/illustrations/add_result_param_4.png new file mode 100644 index 0000000000000000000000000000000000000000..6970eeb623cb81e58040874930a3f29635881fbb Binary files /dev/null and b/docs/illustrations/add_result_param_4.png differ diff --git a/docs/illustrations/add_result_param_5.png b/docs/illustrations/add_result_param_5.png new file mode 100644 index 0000000000000000000000000000000000000000..513dead96a012bce3e25789e9486f83037e7c8ec Binary files /dev/null and b/docs/illustrations/add_result_param_5.png differ