Take outer-interval values in `Viz.datums_range()`
parent
c8209dc565
commit
63d773d77a
|
@ -19,6 +19,10 @@ Data vizualization APIs
|
||||||
|
|
||||||
'''
|
'''
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
from math import (
|
||||||
|
ceil,
|
||||||
|
floor,
|
||||||
|
)
|
||||||
from typing import (
|
from typing import (
|
||||||
Optional,
|
Optional,
|
||||||
Literal,
|
Literal,
|
||||||
|
@ -456,13 +460,13 @@ class Viz(msgspec.Struct): # , frozen=True):
|
||||||
array = self.shm.array
|
array = self.shm.array
|
||||||
|
|
||||||
index = array[index_field]
|
index = array[index_field]
|
||||||
first = round(index[0])
|
first = floor(index[0])
|
||||||
last = round(index[-1])
|
last = ceil(index[-1])
|
||||||
|
|
||||||
# first and last datums in view determined by
|
# first and last datums in view determined by
|
||||||
# l / r view range.
|
# l / r view range.
|
||||||
leftmost = round(l)
|
leftmost = floor(l)
|
||||||
rightmost = round(r)
|
rightmost = ceil(r)
|
||||||
|
|
||||||
# invalid view state
|
# invalid view state
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in New Issue