`Viz._index_field` a `typing.Literal[str]`

multichartz_backup
Tyler Goodlet 2022-12-16 00:00:46 -05:00
parent 045a1a6acc
commit 6412b4ab5a
1 changed files with 11 additions and 2 deletions

View File

@ -21,6 +21,7 @@ Data vizualization APIs
from __future__ import annotations from __future__ import annotations
from typing import ( from typing import (
Optional, Optional,
Literal,
TYPE_CHECKING, TYPE_CHECKING,
) )
@ -243,8 +244,16 @@ class Viz(msgspec.Struct): # , frozen=True):
is_ohlc: bool = False is_ohlc: bool = False
render: bool = True # toggle for display loop render: bool = True # toggle for display loop
# _index_field: str = 'index' _index_field: Literal[
_index_field: str = 'time' 'index',
'time',
# TODO: idea is to re-index all time series to a common
# longest-len-int-index where we avoid gaps and instead
# graph on the 0 -> N domain of the array index super set.
# 'gapless',
] = 'time'
# downsampling state # downsampling state
_last_uppx: float = 0 _last_uppx: float = 0