gap_handler_interface
AbstractGapHandler interface-class, subclassed by concrete gap handlers.
AbstractGapHandler
¶
Bases: ABC
Source code in plotly_resampler/aggregation/gap_handler_interface.py
13 14 15 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 |
|
__init__(fill_value=None)
¶
Constructor of AbstractGapHandler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fill_value |
Optional[float]
|
The value to fill the gaps with, by default None. Note that setting this value to 0 for filled area plots is particularly useful. |
None
|
Source code in plotly_resampler/aggregation/gap_handler_interface.py
14 15 16 17 18 19 20 21 22 23 24 25 |
|
insert_fill_value_between_gaps(x_agg, y_agg, idxs)
¶
Insert the fill_value in the y_agg array where there are gaps.
Gaps are determined by the x_agg array. The _get_gap_mask
method is used to
determine a boolean mask indicating the indices where there are gaps.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x_agg |
np.ndarray
|
The x array. This is used to determine the gaps. |
required |
y_agg |
np.ndarray
|
The y array. A copy of this array will be expanded with fill_values where there are gaps. |
required |
idxs |
np.ndarray
|
The index array. This is relevant aggregators that perform data point selection (e.g., max, min, etc.) - this array will be expanded with the same indices where there are gaps. |
required |
Returns:
Type | Description |
---|---|
Tuple[np.ndarray, np.ndarray]
|
The expanded y_agg array and the expanded idxs array respectively. |
Source code in plotly_resampler/aggregation/gap_handler_interface.py
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 |
|