TimeSeries Dashboard (Plotly Figure)¶
TimeSeriesDashboardGenerator
¶
Main class for generating timeseries heatmap dashboards.
Creates comprehensive dashboards that visualize timeseries data as heatmaps with hour-of-day on y-axis and time aggregations on x-axis. Supports faceting by data columns (MultiIndex) or analysis parameters, customizable KPI statistics, and flexible color schemes including per-facet colorscales.
The dashboard displays heatmaps alongside statistical summaries and supports various time aggregations (daily, weekly, monthly) with configurable grouping functions (mean, sum, min, max, etc.).
The input data must be a pandas DataFrame or Series with:
- DateTime index (required for time-based aggregations)
- For faceting: MultiIndex columns with named levels
Examples:
Basic usage with single variable:
>>> import pandas as pd
>>> import numpy as np
>>> from datetime import datetime, timedelta
>>>
>>> # Create sample timeseries data
>>> dates = pd.date_range('2023-01-01', periods=8760, freq='H')
>>> data = pd.Series(np.random.randn(8760), index=dates, name='power')
>>>
>>> # Generate basic dashboard
>>> generator = TimeSeriesDashboardGenerator(x_axis='date')
>>> fig = generator.get_figure(data)
>>> fig.show()
Multi-variable with faceting:
>>> # Create multi-column data with proper MultiIndex
>>> variables = ['solar', 'wind', 'load']
>>> scenarios = ['base', 'high', 'low']
>>>
>>> # Method 1: Using pd.concat to create MultiIndex
>>> data_dict = {}
>>> for scenario in scenarios:
>>> scenario_data = pd.DataFrame({
>>> var: np.random.randn(8760) for var in variables
>>> }, index=dates)
>>> data_dict[scenario] = scenario_data
>>>
>>> data_multi = pd.concat(data_dict, axis=1, names=['scenario', 'variable'])
>>> print(data_multi)
scenario base ... low
variable solar wind load ... load
datetime
2023-01-01 00:00:00 -0.95 -1.57 0.89 ... 0.06
2023-01-01 01:00:00 1.18 0.88 -0.62 ... 1.18
2023-01-01 02:00:00 0.25 0.31 0.12 ... 0.24
2023-01-01 03:00:00 -2.02 -0.59 -0.92 ... 0.45
2023-01-01 04:00:00 1.13 0.73 -1.04 ... -0.05
... ... ... ... ... ...
>>>
>>> # Generate dashboard with row and column facets
>>> generator = TimeSeriesDashboardGenerator(
>>> x_axis='date',
>>> facet_row='variable', # First level of MultiIndex
>>> facet_col='scenario', # Second level of MultiIndex
>>> facet_row_order=['solar', 'wind', 'load'],
>>> facet_col_order=['base', 'high', 'low']
>>> )
>>> fig = generator.get_figure(data_multi)
Custom KPI statistics:
>>> # Define custom aggregation functions
>>> custom_stats = {
>>> 'Peak': lambda x: x.max(),
>>> 'Valley': lambda x: x.min(),
>>> 'Peak-Valley': lambda x: x.max() - x.min(),
>>> 'Above 50%': lambda x: (x > x.quantile(0.5)).sum() / len(x) * 100,
>>> 'Volatility': lambda x: x.std() / x.mean() * 100
>>> }
>>>
>>> generator = TimeSeriesDashboardGenerator(
>>> x_axis='week',
>>> stat_aggs=custom_stats,
>>> facet_row='variable'
>>> )
>>> fig = generator.get_figure(data_multi)
Parameter-based faceting (multiple x-axis or aggregations):
>>> # Compare different time aggregations
>>> generator = TimeSeriesDashboardGenerator(
>>> x_axis=['date', 'week', 'month'], # Multiple x-axis types
>>> facet_col='x_axis', # Facet by x_axis parameter
>>> facet_row='variable'
>>> )
>>> fig = generator.get_figure(data_multi)
>>>
>>> # Compare different aggregation methods
>>> generator = TimeSeriesDashboardGenerator(
>>> x_axis='month',
>>> groupby_aggregation=['min', 'mean', 'max'], # Multiple agg methods
>>> facet_col='groupby_aggregation', # Facet by aggregation
>>> facet_row='variable'
>>> )
>>> fig = generator.get_figure(data_multi)
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 | |
__init__
¶
__init__(x_axis: X_AXIS_TYPES = 'date', facet_col: str = None, facet_row: str = None, facet_col_wrap: int = None, facet_col_order: list[str] = None, facet_row_order: list[str] = None, ratio_of_stat_col: float = 0.1, stat_aggs: Dict[str, Callable[[Series], float | int]] = None, groupby_aggregation: GROUPBY_AGG_TYPES = 'mean', title: str = None, color_continuous_scale: str | list[str] | list[tuple[float, str]] = None, color_continuous_midpoint: int | float = None, range_color: tuple[float, float] | list[int | float] = None, per_facet_col_colorscale: bool = False, per_facet_row_colorscale: bool = False, facet_row_color_settings: dict = None, facet_col_color_settings: dict = None, subplots_vertical_spacing: float = None, subplots_horizontal_spacing: float = None, time_series_figure_kwargs: dict = None, stat_figure_kwargs: dict = None, universal_figure_kwargs: dict = None, use_string_for_axis: bool = False, config_cls: type[DashboardConfig] = DashboardConfig, data_processor_cls: type[DataProcessor] = DataProcessor, color_manager_cls: type[ColorManager] = ColorManager, trace_generator_cls: type[TraceGenerator] = TraceGenerator, **figure_kwargs)
Initialize the timeseries dashboard generator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_axis
|
X_AXIS_TYPES
|
Time aggregation for x-axis or list for faceting. |
'date'
|
facet_col
|
str
|
Column faceting specification. |
None
|
facet_row
|
str
|
Row faceting specification. |
None
|
facet_col_wrap
|
int
|
Maximum columns per row in faceted layout. |
None
|
facet_col_order
|
list[str]
|
Custom ordering for column facets. |
None
|
facet_row_order
|
list[str]
|
Custom ordering for row facets. |
None
|
ratio_of_stat_col
|
float
|
Width ratio of statistics column to heatmap. |
0.1
|
stat_aggs
|
Dict[str, Callable[[Series], float | int]]
|
Custom KPI aggregation functions. |
None
|
groupby_aggregation
|
GROUPBY_AGG_TYPES
|
Data aggregation method or list for faceting. |
'mean'
|
title
|
str
|
Dashboard title. |
None
|
color_continuous_scale
|
str | list[str] | list[tuple[float, str]]
|
Plotly colorscale specification. |
None
|
color_continuous_midpoint
|
int | float
|
Midpoint for diverging colorscales. |
None
|
range_color
|
tuple[float, float] | list[int | float]
|
Fixed color range for heatmaps. |
None
|
per_facet_col_colorscale
|
bool
|
Enable separate colorscales per column facet. |
False
|
per_facet_row_colorscale
|
bool
|
Enable separate colorscales per row facet. |
False
|
facet_row_color_settings
|
dict
|
Custom color settings per row facet. |
None
|
facet_col_color_settings
|
dict
|
Custom color settings per column facet. |
None
|
subplots_vertical_spacing
|
float
|
Vertical spacing between subplots. |
None
|
subplots_horizontal_spacing
|
float
|
Horizontal spacing between subplots. |
None
|
time_series_figure_kwargs
|
dict
|
Additional heatmap trace parameters. |
None
|
stat_figure_kwargs
|
dict
|
Additional statistics trace parameters. |
None
|
universal_figure_kwargs
|
dict
|
Parameters applied to all traces. |
None
|
use_string_for_axis
|
bool
|
Convert axis values to strings. |
False
|
config_cls
|
type[DashboardConfig]
|
Configuration class for dependency injection. |
DashboardConfig
|
data_processor_cls
|
type[DataProcessor]
|
Data processor class for dependency injection. |
DataProcessor
|
color_manager_cls
|
type[ColorManager]
|
Color manager class for dependency injection. |
ColorManager
|
trace_generator_cls
|
type[TraceGenerator]
|
Trace generator class for dependency injection. |
TraceGenerator
|
**figure_kwargs
|
Additional figure-level parameters. |
{}
|
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 | |
get_figure
¶
get_figure(data: DataFrame, **kwargs)
Generate a complete dashboard figure from timeseries data.
Creates a plotly figure containing heatmaps with associated statistics, properly formatted axes, and optional faceting. Applies all configured styling, color schemes, and layout settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
DataFrame
|
Input timeseries DataFrame or Series with datetime index. |
required |
**kwargs
|
Runtime configuration overrides. |
{}
|
Returns:
| Type | Description |
|---|---|
|
Plotly Figure object containing the complete dashboard visualization. |
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 | |
get_figures_chunked
¶
get_figures_chunked(data: DataFrame, max_n_rows_per_figure: int = None, n_figures: int = None, chunk_title_suffix: bool = True, **kwargs) -> list[Figure]
Generate multiple figures by splitting facet rows into chunks.
Useful for handling large datasets with many row facets by creating multiple smaller figures instead of one large figure.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
DataFrame
|
Input timeseries DataFrame with datetime index. |
required |
max_n_rows_per_figure
|
int
|
Maximum number of row facets per figure. |
None
|
n_figures
|
int
|
Total number of figures to create (alternative to max_n_rows_per_figure). |
None
|
chunk_title_suffix
|
bool
|
Whether to add "(Part X/Y)" suffix to titles. |
True
|
**kwargs
|
Runtime configuration overrides. |
{}
|
Returns:
| Type | Description |
|---|---|
list[Figure]
|
List of plotly Figure objects, each containing a subset of row facets. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If both or neither of max_n_rows_per_figure and n_figures are provided. |
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 | |
DashboardConfig
¶
Configuration class for timeseries dashboard visualization.
Manages all configuration parameters for generating heatmap-based timeseries dashboards with customizable statistics, faceting, and color schemes.
Custom KPI Statistics
You can define custom KPIs by providing a dictionary of functions that operate on pandas Series. Each function should take a Series and return a single numeric value.
KPI Customization Example:
>>> custom_kpis = {
... 'Peak Load': lambda x: x.max(),
... 'Capacity Factor': lambda x: x.mean() / x.max() * 100,
... 'Ramp Rate': lambda x: x.diff().abs().max(),
... 'Hours Above Mean': lambda x: (x > x.mean()).sum(),
... 'Volatility': lambda x: x.std() / x.mean() * 100 if x.mean() != 0 else 0
... }
Available built-in statistics are provided in DEFAULT_STATISTICS and STATISTICS_LIBRARY class attributes.
Data Format Requirements
Input data must be a pandas DataFrame or Series with: - DatetimeIndex (hourly or sub-hourly recommended) - For faceting: MultiIndex columns with named levels - Column names will be used as facet category labels
MultiIndex structure for faceting:
>>> # Two-level MultiIndex example
>>> data.columns = pd.MultiIndex.from_tuples([
>>> ('scenario1', 'solar'), ('scenario1', 'wind'),
>>> ('scenario2', 'solar'), ('scenario2', 'wind')
>>> ], names=['scenario', 'technology'])
>>>
>>> # Use column level names for faceting
>>> config = DashboardConfig(
... facet_row='technology', # Use 'technology' level
... facet_col='scenario' # Use 'scenario' level
... )
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
__init__
¶
__init__(x_axis: X_AXIS_TYPES = 'date', facet_col: str = None, facet_row: str = None, facet_col_wrap: int = None, facet_col_order: list[str] = None, facet_row_order: list[str] = None, ratio_of_stat_col: float = 0.1, stat_aggs: Dict[str, Callable[[Series], float | int]] = None, groupby_aggregation: GROUPBY_AGG_TYPES = 'mean', title: str = None, color_continuous_scale: str | list[str] | list[tuple[float, str]] = 'Turbo', color_continuous_midpoint: int | float = None, range_color: list[int | float] = None, per_facet_col_colorscale: bool = False, per_facet_row_colorscale: bool = False, facet_row_color_settings: dict = None, facet_col_color_settings: dict = None, subplots_vertical_spacing: float = None, subplots_horizontal_spacing: float = None, time_series_figure_kwargs: dict = None, stat_figure_kwargs: dict = None, universal_figure_kwargs: dict = None, use_string_for_axis: bool = False, **figure_kwargs)
Initialize dashboard configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_axis
|
X_AXIS_TYPES
|
X-axis aggregation type ('date', 'year_month', 'year_week', 'week', 'month', 'year') or list of aggregation types for faceting. |
'date'
|
facet_col
|
str
|
Column name to use for column faceting, or 'x_axis'/'groupby_aggregation' for parameter-based faceting. |
None
|
facet_row
|
str
|
Column name to use for row faceting, or 'x_axis'/'groupby_aggregation' for parameter-based faceting. |
None
|
facet_col_wrap
|
int
|
Maximum number of columns per row when using column faceting. |
None
|
facet_col_order
|
list[str]
|
Custom ordering for column facets. |
None
|
facet_row_order
|
list[str]
|
Custom ordering for row facets. |
None
|
ratio_of_stat_col
|
float
|
Width ratio of statistics column relative to heatmap column. |
0.1
|
stat_aggs
|
Dict[str, Callable[[Series], float | int]]
|
Dictionary of statistic names to aggregation functions for KPI calculation. |
None
|
groupby_aggregation
|
GROUPBY_AGG_TYPES
|
Aggregation method for grouping data ('mean', 'sum', etc.) or list of methods for faceting. |
'mean'
|
title
|
str
|
Dashboard title. |
None
|
color_continuous_scale
|
str | list[str] | list[tuple[float, str]]
|
Plotly colorscale name or custom colorscale. |
'Turbo'
|
color_continuous_midpoint
|
int | float
|
Midpoint value for diverging colorscales. |
None
|
range_color
|
list[int | float]
|
Fixed color range [min, max] for heatmaps. |
None
|
per_facet_col_colorscale
|
bool
|
Whether to use separate colorscales per column facet. |
False
|
per_facet_row_colorscale
|
bool
|
Whether to use separate colorscales per row facet. |
False
|
facet_row_color_settings
|
dict
|
Custom color settings per row facet category. |
None
|
facet_col_color_settings
|
dict
|
Custom color settings per column facet category. |
None
|
subplots_vertical_spacing
|
float
|
Vertical spacing between subplots. |
None
|
subplots_horizontal_spacing
|
float
|
Horizontal spacing between subplots. |
None
|
time_series_figure_kwargs
|
dict
|
Additional kwargs for heatmap traces. |
None
|
stat_figure_kwargs
|
dict
|
Additional kwargs for statistics traces. |
None
|
universal_figure_kwargs
|
dict
|
kwargs applied to all traces. |
None
|
use_string_for_axis
|
bool
|
Whether to convert axis values to strings. |
False
|
**figure_kwargs
|
Additional figure-level kwargs. |
{}
|
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
DataProcessor
¶
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | |
get_grouped_data
staticmethod
¶
get_grouped_data(series: Series, x_axis: str, groupby_aggregation: str) -> DataFrame
Group and aggregate time series data into heatmap format.
Transforms timeseries data into a matrix suitable for heatmap visualization with hour-of-day on y-axis and specified time aggregation on x-axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
series
|
Series
|
Input timeseries data with datetime index. |
required |
x_axis
|
str
|
Time aggregation method ('date', 'week', 'month', etc.). |
required |
groupby_aggregation
|
str
|
Aggregation function name ('mean', 'sum', etc.). |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with time categories as columns and hour-of-day as rows. |
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | |
ColorManager
¶
Manages color settings and scale computation for dashboard visualizations.
Handles colorscale selection, range computation, and facet-specific color customization for heatmap and statistics traces.
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 | |
get_color_settings_for_facet_category
staticmethod
¶
get_color_settings_for_facet_category(config: DashboardConfig, facet_key: tuple[str, str])
Get color settings for a specific facet category.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
DashboardConfig
|
Dashboard configuration object. |
required |
facet_key
|
tuple[str, str]
|
Tuple of (row_key, col_key) identifying the facet. |
required |
Returns:
| Type | Description |
|---|---|
|
Dictionary of color settings for the specified facet category. |
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |
compute_color_params
staticmethod
¶
compute_color_params(data, config: DashboardConfig, facet_key: tuple[str, str] = None)
Compute color parameters for heatmap traces.
Calculates colorscale, min/max values, and other color-related parameters based on data range and configuration settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Input data for color range calculation. |
required | |
config
|
DashboardConfig
|
Dashboard configuration object. |
required |
facet_key
|
tuple[str, str]
|
Optional facet identifier for per-facet colorscales. |
None
|
Returns:
| Type | Description |
|---|---|
|
Dictionary of color parameters for plotly traces. |
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 | |
TraceGenerator
¶
Generates plotly trace objects for dashboard visualization.
Creates heatmap traces for timeseries data, statistics traces for KPI display, and colorscale traces for custom color legends.
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | |
get_heatmap_trace
classmethod
¶
get_heatmap_trace(data: DataFrame, ts_kwargs, color_kwargs, use_string_for_axis, **kwargs)
Create a heatmap trace for timeseries data visualization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
DataFrame
|
DataFrame with time categories as columns and hour-of-day as rows. |
required |
ts_kwargs
|
Additional kwargs for the heatmap trace. |
required | |
color_kwargs
|
Color-related parameters (colorscale, zmin, zmax). |
required | |
use_string_for_axis
|
Whether to convert axis values to strings. |
required | |
**kwargs
|
Additional plotly Heatmap parameters. |
{}
|
Returns:
| Type | Description |
|---|---|
|
Plotly Heatmap trace object for timeseries visualization. |
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | |
get_stats_trace
classmethod
¶
get_stats_trace(series: Series, stat_aggs, stat_kwargs, color_kwargs, **kwargs)
Create a heatmap trace for displaying KPI statistics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
series
|
Series
|
Input timeseries data for statistics calculation. |
required |
stat_aggs
|
Dictionary of statistic names to aggregation functions. |
required | |
stat_kwargs
|
Additional kwargs for the statistics trace. |
required | |
color_kwargs
|
Color-related parameters (colorscale, zmin, zmax). |
required | |
**kwargs
|
Additional plotly Heatmap parameters. |
{}
|
Returns:
| Type | Description |
|---|---|
|
Plotly Heatmap trace object displaying calculated statistics. |
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 | |
create_colorscale_trace
staticmethod
¶
create_colorscale_trace(z_min, z_max, colorscale, orientation='v', title=None)
Create a colorscale trace for custom color legend display.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
z_min
|
Minimum value for colorscale range. |
required | |
z_max
|
Maximum value for colorscale range. |
required | |
colorscale
|
Plotly colorscale specification. |
required | |
orientation
|
Colorscale orientation ('v' for vertical, 'h' for horizontal). |
'v'
|
|
title
|
Optional title for the colorscale. |
None
|
Returns:
| Type | Description |
|---|---|
|
Plotly Heatmap trace object representing the colorscale legend. |
Source code in submodules/mesqual/mesqual/visualizations/plotly_figures/timeseries_dashboard.py
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | |