Skip to content

Commit a836a49

Browse files
alemikhovjonasvdd
authored andcommitted
add change log and alter boundaries
1 parent 0a7831f commit a836a49

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Latest
22

3+
# v0.10.1
4+
## What's Changed
5+
After resampling the figure, the line goes beyond figure frontier indicating presence of data.
36

47
# v0.10.0
58
## New Features

plotly_resampler/aggregation/plotly_aggregator_parser.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ def get_start_end_indices(hf_trace_data, axis_type, start, end) -> Tuple[int, in
7474
x_step = hf_trace_data["x"].step
7575
start_idx = int(max((start - x_start) // x_step, 0))
7676
end_idx = int((end - x_start) // x_step)
77+
start_idx = max(0, start_idx - 1)
78+
end_idx = min(end_idx + 1, len(hf_trace_data["x"]))
7779
return start_idx, end_idx
7880
# TODO: this can be performed as-well for a fixed frequency range-index w/ freq
7981

@@ -97,8 +99,8 @@ def get_start_end_indices(hf_trace_data, axis_type, start, end) -> Tuple[int, in
9799
# Search the index-positions
98100
start_idx = bisect.bisect_left(hf_trace_data["x"], start)
99101
end_idx = bisect.bisect_right(hf_trace_data["x"], end)
100-
start_idx = max(0, start_idx - 1)
101-
end_idx = min(end_idx + 1, len(hf_trace_data["x"]))
102+
# start_idx = max(0, start_idx - 1)
103+
# end_idx = min(end_idx + 1, len(hf_trace_data["x"]))
102104
return start_idx, end_idx
103105

104106
@staticmethod

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "plotly-resampler" # Do not forget to update the __init__.py __version__ variable
3-
version = "0.10.0"
3+
version = "0.10.1"
44
description = "Visualizing large time series with plotly"
55
authors = ["Jonas Van Der Donckt", "Jeroen Van Der Donckt", "Emiel Deprost"]
66
readme = "README.md"

tests/test_figure_resampler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def test_log_axis():
285285
assert (x1 - x0) < 10
286286
assert len(out[1]["x"]) == 1000
287287
assert out[-1]["x"][0] >= 99
288-
assert out[-1]["x"][-1] <= 50_000
288+
assert out[-1]["x"][-1] <= 50_001
289289

290290

291291
def test_add_traces_from_other_figure():

0 commit comments

Comments
 (0)