hdhelpers 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,44 @@
1
+ .idea/
2
+ *.iml
3
+ target
4
+ .classpath
5
+ .settings
6
+ .factorypath
7
+ .project
8
+ __pycache__
9
+ .ipynb_checkpoints
10
+ *.pyc
11
+ *.pyo
12
+ .coverage
13
+ .pytest_cache
14
+ .mypy_cache
15
+ .s.PGSQL*
16
+ .ruff_cache
17
+
18
+ *.hd-creds
19
+ hd-docker-compose-trafos
20
+ runtime/**/lab
21
+ runtime/**/venv
22
+ runtime/**/testvenv
23
+ runtime/**/nix_venv_*
24
+ runtime/ruff_report.xml
25
+ runtime/test_results.xml
26
+ runtime/.coverage*
27
+ runtime/.coverage.xml
28
+ hdhelpers/coverage.xml
29
+ runtime/**/writable_sqlite.db
30
+ runtime/upload_settings/*
31
+ runtime/settings/*
32
+ hdhelpers/dist/*
33
+ demo-adapter-python/**/lab
34
+ demo-adapter-python/**/venv
35
+ demo-adapter-python/**/nix_venv_*
36
+ demo-adapter-python/ruff_report.xml
37
+ demo-adapter-python/test_results.xml
38
+ demo-adapter-python/.coverage*
39
+ demo-adapter-python/.coverage.xml
40
+ demo-adapter-python/upload_settings/*
41
+ demo-adapter-python/settings/*
42
+ .vscode/.ropeproject/objectdb
43
+ .tmp
44
+ .jupyter
@@ -0,0 +1 @@
1
+ 3.13
@@ -0,0 +1,9 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright © 2025 fuseki GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,161 @@
1
+ Metadata-Version: 2.4
2
+ Name: hdhelpers
3
+ Version: 0.0.1
4
+ Summary: Streamlines plotting and timezone handling in hetida designer components
5
+ Project-URL: homepage, https://fuseki.com/data-science/hetida-designer/
6
+ Project-URL: documentation, https://github.com/hetida/hetida-designer/tree/release/docs
7
+ Project-URL: repository, https://github.com/hetida/hetida-designer
8
+ Author-email: Christoph Dingel <cdingel@fuseki.com>, Steffen Wittkamp <swittkamp@fuseki.com>
9
+ License: The MIT License (MIT)
10
+
11
+ Copyright © 2025 fuseki GmbH
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
+ License-File: LICENSE
19
+ Classifier: Development Status :: 2 - Pre-Alpha
20
+ Classifier: Environment :: Console
21
+ Classifier: Intended Audience :: Science/Research
22
+ Classifier: License :: OSI Approved :: MIT License
23
+ Classifier: Operating System :: Unix
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Topic :: Scientific/Engineering
26
+ Requires-Python: >=3.13
27
+ Requires-Dist: pandas<3,>=2
28
+ Requires-Dist: plotly<7,>=6
29
+ Requires-Dist: pydantic<3,>=2
30
+ Description-Content-Type: text/markdown
31
+
32
+ # hdhelpers
33
+ ## What is hdhelpers?
34
+ hdhelpers is a package designed for and included in the standard installation of the [hetida designer](https://github.com/hetida/hetida-designer).
35
+
36
+ It contains functions that streamline plotting components, especially those that are used in the [hetida platform](https://hetida.io/), by
37
+ * accessing series metadata that complies with the hetida platform metadata scheme
38
+ * accessing metadata that the hetida platform writes into the hetida designer's `plot_target_settings` context variable
39
+ * adjusting the timezone of timestamps, series, and dataframes
40
+ * providing toggleable standardized styling options and json serialization for plotly plots
41
+
42
+ ## Getting Started with hdhelpers
43
+ Since the intended use of the hdhelpers package is as a part of the hetida designer, it is highly recommended to follow the [hetida designer setup guide](https://github.com/hetida/hetida-designer/blob/release/README.md#getting-started-with-hetida-designer).
44
+
45
+ For a specific example of how to use hdhelpers functionality in a hetida designer component, see [Example](#example).
46
+
47
+ ## Developing for hdhelpers
48
+ In the development of this package, [uv](https://docs.astral.sh/uv/) was used for setting up a virtual environnment, managing dependencies, building and publishing the package. Though its use is not technically required, the following instructions assume that you use uv, too.
49
+
50
+ ### Setting up a Development Environment
51
+ First, move to the `runtime/hdhelpers` subdirectory, which contains the hdhelpers package.
52
+
53
+ Create a virtual environment with `uv venv`, which you can then find in the `.venv` subdirectory. There, uv installs all dependencies defined in `pyproject.toml`.
54
+
55
+ All uv commands that need a python environment will use `.venv`, so you should use it for your development, too.
56
+
57
+ Finally, in case you need to add a new dependency, do so via `uv add <new_dependency>`. That way, uv finds versions of all dependencies that are compatible with each other.
58
+
59
+ ### Deploying Your Code
60
+ Once you are done writing your code, including unit tests, use `./run check` to see if your code quality is sufficient.
61
+
62
+ Before you build the package, , then set an appropriate [version number](https://packaging.python.org/en/latest/discussions/versioning/#semantic-versioning) in `pyproject.toml`.
63
+
64
+ To build the package and delete any files that are currently in the `dist` subdirectory, execute `rm -r dist && uv build`. [Hatchling](https://pypi.org/project/hatchling/), the build backend specified in `pyproject.toml`, will build a new sdist and wheel in the `dist` subdirectory.
65
+
66
+ The hetida designer docker compose dev setup installs hdhelpers from [TestPyPI](https://packaging.python.org/en/latest/guides/using-testpypi/) using the following command in the `Dockerfile-runtime`:
67
+ ```
68
+ RUN pip install -U --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ hdhelpers
69
+ ```
70
+ **Note: TestPyPI occasionally deletes projects to free up disk space. If your hetida designer docker compose dev setup cannot find hdhelpers, make sure the project is still on TestPyPI before following other debugging approaches!**
71
+
72
+ To publish the build from the `dist` subdirectory to TestPyPI, use `uv publish --index testpypi`. To do so, you need a TestPyPI account with a token to enter in the command line as password following the username "\_\_token__".
73
+
74
+ Next time your hetida designer docker compose dev setup builds the runtime container, it will install the hdhelpers version that you just deployed.
75
+
76
+ ## <a name="example"></a> Example
77
+ Let's say we want to plot the following timeseries in a style that looks good on a hetida platform dashboard.
78
+ ```
79
+ {
80
+ "__hd_wrapped_data_object__":"SERIES",
81
+ "__metadata__": {
82
+ "single_metric_metadata": {
83
+ "ref_interval_end_timestamp":"2020-01-01T08:17:00.000Z",
84
+ "ref_interval_start_timestamp": "2020-01-01T08:10:00.000Z",
85
+ "structured_metadata": {
86
+ "metric": {
87
+ "short_display_name": "Water Level",
88
+ "unit": "cm"
89
+ }
90
+ }
91
+ }
92
+ }, "__data__": {
93
+ "2020-01-01T08:10:00.000Z": 1,
94
+ "2020-01-01T08:15:00.000Z": 2,
95
+ "2020-01-01T08:16:00.000Z": 3,
96
+ "2020-01-01T08:17:00.000Z": 4
97
+ }
98
+ }
99
+ ```
100
+ Our component code might look like this:
101
+ ```
102
+ from hdhelpers import get_and_pad_start_and_end_timestamp, get_title_with_unit, modify_timezone, plotly_fig_to_json_dict
103
+ import plotly.graph_objects as go
104
+ ...
105
+ def main(*, series, timezone):
106
+ # entrypoint function for this component
107
+ # ***** DO NOT EDIT LINES ABOVE *****
108
+ # write your function code here.
109
+ series = modify_timezone(series, timezone)
110
+
111
+ fig = go.Figure([go.Scatter(x=series.index, y=series.values)])
112
+
113
+ start, end = get_and_pad_start_and_end_timestamp(series=series, timezone=timezone, start_padding='5s', end_padding='5s')
114
+ fig.update_xaxes(range=(start, end))
115
+
116
+ full_title = get_title_with_unit(series=series, default_title="Level")
117
+ fig.update_layout(yaxis_title=full_title)
118
+
119
+ return {"plot": plotly_fig_to_json_dict(fig=fig, use_platform_defaults=True)}
120
+ ```
121
+ First, we use `modify_timezone` to set the timezone. Setting it to a string containing "plot_target", like "plot_target_timezone" or "plot_target_settings", will use the dashboard's timezone, but throw an exception if no such timezone is defined. Therefore, we might want to enter the timezone as a component input parameter with a default value of "plot_target_timezone", so it can be set to another value when the component is executed outside of the hetida platform.
122
+
123
+ With the timezone-corrected data in place, we turn it into a plotly scatter plot called `fig`, that we can then style to our liking.
124
+
125
+ Now, we use `get_and_pad_start_and_end_timestamp` for precise control over the x-axis range. We do not set `start` and `end` because we want to parse them from the series metadata. The timezone of the axis and that of the data should be the same, so we pass it to the function as `timezone` just like we did with `modify_timezone`. We also set a padding, so the markers of the first and last data point are not cut in half by the edge of the plot. With start and end parsed, we can update `fig`'s x-axis range.
126
+
127
+ Next, we use `get_title_with_unit` so our y-axis can be labeled with the series metadata. With the above input series, title and unit will be parsed from the series metadata, but in case the component is ever run without series metadata, we provide a `default_title`, but we leave the `default_unit` at its empty default value. Then, we update `fig` with our title.
128
+
129
+ Lastly, we use `plotly_fig_to_json_dict` to apply standardized stylings of our choice and serialize the plotly figure into a json dict. We set `use_platform_defaults` to True to switch on all the styling options at once, as detailed in [Styling Flags](#flags).
130
+
131
+ As a result we get the following plot:
132
+
133
+ ![hdhelpers example plot](./../../docs/assets/hdhelpers_example_plot.png)
134
+
135
+ ### <a name="flags"></a> Styling Flags
136
+ `use_platform_defaults=True` sets the following flags to `True`, which are by default `False`:
137
+ * `hide_legend` sets the plotly layout parameter `showlegend=False` to hide the plot's legend
138
+ * `hide_x_title` sets the plotly xaxes parameter `title_text=''` to hide the x-axis title
139
+ * `update_x_axes_tickformat` sets the plotly xaxes parameter `tickformat` to the `datetime_tick_format` property the hetida platform writes into the hetida designer's `plot_target_settings` context variable (unless the property is `None`)
140
+ * `use_default_standoff` sets the plotly yaxes parameter `title_standoff=5`
141
+ * `use_muplot_axes_color` sets the plotly xaxes and yaxes parameter `color` to the `axes_label_color` property the hetida platform writes into the hetida designer's `plot_target_settings` context variable (unless the property is `None`)
142
+ * `use_muplot_grid` makes the plotly grid visible and colors it in according to the `grid_color` property the hetida platform writes into the hetida designer's `plot_target_settings` context variable (unless the property is `None`)
143
+ * `use_muplot_line_and_markers` sets the plotly traces to the following style, which matches the hetida platform's µplots:
144
+ ```
145
+ {
146
+ "marker": {"size": 3},
147
+ "line": {"width": 1},
148
+ "mode": "lines+markers",
149
+ "marker_symbol": "circle",
150
+ }
151
+ ```
152
+ * `use_platform_background` sets the plotly layout parameter `paper_bgcolor` to the `background_color` property the hetida platform writes into the hetida designer's `plot_target_settings` context variable (unless the property is `None`) and it sets `plot_bgcolor=rgba(0,0,0,0)` so the "paper background" is visible through the "plot background"
153
+
154
+ `plotly_fig_to_json_dict` has five more boolean parameters:
155
+ * `add_config_settings` sets the plotly figure's locale to the `plot_target_locale` property the hetida platform writes into the hetida designer's `plot_target_settings` context variable (unless the property is `None`)
156
+ * `remove_plotly_bar` sets the plotly figure's `displayModeBar` setting to `False` to remove the plotly bar from the plot
157
+ * `remove_plotly_icon` sets the plotly figure's `displaylogo` setting to `False` to remove the plotly logo from the plot
158
+ * `use_minimum_margin` sets the plotly layout parameter `margin={"autoexpand": True, "l": 0, "r": 0, "b": 0, "t": 0, "pad": 0}` to minimize the plot's margins
159
+ * `use_simple_white_template` sets the plotly layout parameter `template=simple_white`
160
+
161
+ Beyond that, there is one more thing `plotly_fig_to_json_dict` does: It sets the `colorway` to the `line_colors` in `plot_target_settings` (unless they are `None`). This cannot be turned off because the colorway is automatically overwritten by any explicitly set line color, so it being "always on" does not hinder plot customization.
@@ -0,0 +1,130 @@
1
+ # hdhelpers
2
+ ## What is hdhelpers?
3
+ hdhelpers is a package designed for and included in the standard installation of the [hetida designer](https://github.com/hetida/hetida-designer).
4
+
5
+ It contains functions that streamline plotting components, especially those that are used in the [hetida platform](https://hetida.io/), by
6
+ * accessing series metadata that complies with the hetida platform metadata scheme
7
+ * accessing metadata that the hetida platform writes into the hetida designer's `plot_target_settings` context variable
8
+ * adjusting the timezone of timestamps, series, and dataframes
9
+ * providing toggleable standardized styling options and json serialization for plotly plots
10
+
11
+ ## Getting Started with hdhelpers
12
+ Since the intended use of the hdhelpers package is as a part of the hetida designer, it is highly recommended to follow the [hetida designer setup guide](https://github.com/hetida/hetida-designer/blob/release/README.md#getting-started-with-hetida-designer).
13
+
14
+ For a specific example of how to use hdhelpers functionality in a hetida designer component, see [Example](#example).
15
+
16
+ ## Developing for hdhelpers
17
+ In the development of this package, [uv](https://docs.astral.sh/uv/) was used for setting up a virtual environnment, managing dependencies, building and publishing the package. Though its use is not technically required, the following instructions assume that you use uv, too.
18
+
19
+ ### Setting up a Development Environment
20
+ First, move to the `runtime/hdhelpers` subdirectory, which contains the hdhelpers package.
21
+
22
+ Create a virtual environment with `uv venv`, which you can then find in the `.venv` subdirectory. There, uv installs all dependencies defined in `pyproject.toml`.
23
+
24
+ All uv commands that need a python environment will use `.venv`, so you should use it for your development, too.
25
+
26
+ Finally, in case you need to add a new dependency, do so via `uv add <new_dependency>`. That way, uv finds versions of all dependencies that are compatible with each other.
27
+
28
+ ### Deploying Your Code
29
+ Once you are done writing your code, including unit tests, use `./run check` to see if your code quality is sufficient.
30
+
31
+ Before you build the package, , then set an appropriate [version number](https://packaging.python.org/en/latest/discussions/versioning/#semantic-versioning) in `pyproject.toml`.
32
+
33
+ To build the package and delete any files that are currently in the `dist` subdirectory, execute `rm -r dist && uv build`. [Hatchling](https://pypi.org/project/hatchling/), the build backend specified in `pyproject.toml`, will build a new sdist and wheel in the `dist` subdirectory.
34
+
35
+ The hetida designer docker compose dev setup installs hdhelpers from [TestPyPI](https://packaging.python.org/en/latest/guides/using-testpypi/) using the following command in the `Dockerfile-runtime`:
36
+ ```
37
+ RUN pip install -U --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ hdhelpers
38
+ ```
39
+ **Note: TestPyPI occasionally deletes projects to free up disk space. If your hetida designer docker compose dev setup cannot find hdhelpers, make sure the project is still on TestPyPI before following other debugging approaches!**
40
+
41
+ To publish the build from the `dist` subdirectory to TestPyPI, use `uv publish --index testpypi`. To do so, you need a TestPyPI account with a token to enter in the command line as password following the username "\_\_token__".
42
+
43
+ Next time your hetida designer docker compose dev setup builds the runtime container, it will install the hdhelpers version that you just deployed.
44
+
45
+ ## <a name="example"></a> Example
46
+ Let's say we want to plot the following timeseries in a style that looks good on a hetida platform dashboard.
47
+ ```
48
+ {
49
+ "__hd_wrapped_data_object__":"SERIES",
50
+ "__metadata__": {
51
+ "single_metric_metadata": {
52
+ "ref_interval_end_timestamp":"2020-01-01T08:17:00.000Z",
53
+ "ref_interval_start_timestamp": "2020-01-01T08:10:00.000Z",
54
+ "structured_metadata": {
55
+ "metric": {
56
+ "short_display_name": "Water Level",
57
+ "unit": "cm"
58
+ }
59
+ }
60
+ }
61
+ }, "__data__": {
62
+ "2020-01-01T08:10:00.000Z": 1,
63
+ "2020-01-01T08:15:00.000Z": 2,
64
+ "2020-01-01T08:16:00.000Z": 3,
65
+ "2020-01-01T08:17:00.000Z": 4
66
+ }
67
+ }
68
+ ```
69
+ Our component code might look like this:
70
+ ```
71
+ from hdhelpers import get_and_pad_start_and_end_timestamp, get_title_with_unit, modify_timezone, plotly_fig_to_json_dict
72
+ import plotly.graph_objects as go
73
+ ...
74
+ def main(*, series, timezone):
75
+ # entrypoint function for this component
76
+ # ***** DO NOT EDIT LINES ABOVE *****
77
+ # write your function code here.
78
+ series = modify_timezone(series, timezone)
79
+
80
+ fig = go.Figure([go.Scatter(x=series.index, y=series.values)])
81
+
82
+ start, end = get_and_pad_start_and_end_timestamp(series=series, timezone=timezone, start_padding='5s', end_padding='5s')
83
+ fig.update_xaxes(range=(start, end))
84
+
85
+ full_title = get_title_with_unit(series=series, default_title="Level")
86
+ fig.update_layout(yaxis_title=full_title)
87
+
88
+ return {"plot": plotly_fig_to_json_dict(fig=fig, use_platform_defaults=True)}
89
+ ```
90
+ First, we use `modify_timezone` to set the timezone. Setting it to a string containing "plot_target", like "plot_target_timezone" or "plot_target_settings", will use the dashboard's timezone, but throw an exception if no such timezone is defined. Therefore, we might want to enter the timezone as a component input parameter with a default value of "plot_target_timezone", so it can be set to another value when the component is executed outside of the hetida platform.
91
+
92
+ With the timezone-corrected data in place, we turn it into a plotly scatter plot called `fig`, that we can then style to our liking.
93
+
94
+ Now, we use `get_and_pad_start_and_end_timestamp` for precise control over the x-axis range. We do not set `start` and `end` because we want to parse them from the series metadata. The timezone of the axis and that of the data should be the same, so we pass it to the function as `timezone` just like we did with `modify_timezone`. We also set a padding, so the markers of the first and last data point are not cut in half by the edge of the plot. With start and end parsed, we can update `fig`'s x-axis range.
95
+
96
+ Next, we use `get_title_with_unit` so our y-axis can be labeled with the series metadata. With the above input series, title and unit will be parsed from the series metadata, but in case the component is ever run without series metadata, we provide a `default_title`, but we leave the `default_unit` at its empty default value. Then, we update `fig` with our title.
97
+
98
+ Lastly, we use `plotly_fig_to_json_dict` to apply standardized stylings of our choice and serialize the plotly figure into a json dict. We set `use_platform_defaults` to True to switch on all the styling options at once, as detailed in [Styling Flags](#flags).
99
+
100
+ As a result we get the following plot:
101
+
102
+ ![hdhelpers example plot](./../../docs/assets/hdhelpers_example_plot.png)
103
+
104
+ ### <a name="flags"></a> Styling Flags
105
+ `use_platform_defaults=True` sets the following flags to `True`, which are by default `False`:
106
+ * `hide_legend` sets the plotly layout parameter `showlegend=False` to hide the plot's legend
107
+ * `hide_x_title` sets the plotly xaxes parameter `title_text=''` to hide the x-axis title
108
+ * `update_x_axes_tickformat` sets the plotly xaxes parameter `tickformat` to the `datetime_tick_format` property the hetida platform writes into the hetida designer's `plot_target_settings` context variable (unless the property is `None`)
109
+ * `use_default_standoff` sets the plotly yaxes parameter `title_standoff=5`
110
+ * `use_muplot_axes_color` sets the plotly xaxes and yaxes parameter `color` to the `axes_label_color` property the hetida platform writes into the hetida designer's `plot_target_settings` context variable (unless the property is `None`)
111
+ * `use_muplot_grid` makes the plotly grid visible and colors it in according to the `grid_color` property the hetida platform writes into the hetida designer's `plot_target_settings` context variable (unless the property is `None`)
112
+ * `use_muplot_line_and_markers` sets the plotly traces to the following style, which matches the hetida platform's µplots:
113
+ ```
114
+ {
115
+ "marker": {"size": 3},
116
+ "line": {"width": 1},
117
+ "mode": "lines+markers",
118
+ "marker_symbol": "circle",
119
+ }
120
+ ```
121
+ * `use_platform_background` sets the plotly layout parameter `paper_bgcolor` to the `background_color` property the hetida platform writes into the hetida designer's `plot_target_settings` context variable (unless the property is `None`) and it sets `plot_bgcolor=rgba(0,0,0,0)` so the "paper background" is visible through the "plot background"
122
+
123
+ `plotly_fig_to_json_dict` has five more boolean parameters:
124
+ * `add_config_settings` sets the plotly figure's locale to the `plot_target_locale` property the hetida platform writes into the hetida designer's `plot_target_settings` context variable (unless the property is `None`)
125
+ * `remove_plotly_bar` sets the plotly figure's `displayModeBar` setting to `False` to remove the plotly bar from the plot
126
+ * `remove_plotly_icon` sets the plotly figure's `displaylogo` setting to `False` to remove the plotly logo from the plot
127
+ * `use_minimum_margin` sets the plotly layout parameter `margin={"autoexpand": True, "l": 0, "r": 0, "b": 0, "t": 0, "pad": 0}` to minimize the plot's margins
128
+ * `use_simple_white_template` sets the plotly layout parameter `template=simple_white`
129
+
130
+ Beyond that, there is one more thing `plotly_fig_to_json_dict` does: It sets the `colorway` to the `line_colors` in `plot_target_settings` (unless they are `None`). This cannot be turned off because the colorway is automatically overwritten by any explicitly set line color, so it being "always on" does not hinder plot customization.