PlotDefinition#
Module: exa.core.analyze_result.plot_definition
- class PlotDefinition(function, default_kwargs)#
Bases:
objectDefines a way to generate a Figure from an Xarray dataset.
Attributes
A callable that generates the figure.
Default keyword arguments that will be passed to function, if not overridden.
Methods
Generate a figure and encode it in base64, so that it can be embedded to an
imgHTML attribute.Generate a figure from xarray.Dataset by calling
function.Generate a figure from RunResult by calling
function.- function: Callable[[...], Figure]#
A callable that generates the figure. The first and only positional argument of function must be the run result where the data is read from. function can accept keyword arguments and must return a single Figure.
- default_kwargs: dict[str, Any]#
Default keyword arguments that will be passed to function, if not overridden.
- generate_from_run_result(run_result, /, **kwargs)#
Generate a figure from RunResult by calling
function.- Parameters:
run_result (RunResult) – The run result containing the full dataset and run data.
kwargs – Keyword arguments passed to
function. These overridedefault_kwargs.
- Returns:
A new
Figure.- Return type:
- generate_from_dataset(dataset, /, **kwargs)#
Generate a figure from xarray.Dataset by calling
function.- Parameters:
dataset (Dataset) – dataset: The full dataset.
kwargs – Keyword arguments passed to
function. These overridedefault_kwargs.
- Returns:
A new
Figure.- Return type:
- embed_base64(data)#
Generate a figure and encode it in base64, so that it can be embedded to an
imgHTML attribute.
Inheritance
