18 lines
530 B
Python
18 lines
530 B
Python
from pandas import date_range, Series
|
|
from plotly.basedatatypes import BaseTraceType
|
|
from typing import List
|
|
|
|
class Chart:
|
|
|
|
x: Series = None
|
|
|
|
def traces(self) -> List[BaseTraceType]:
|
|
pass
|
|
|
|
def range_breaks(self) -> List[dict]:
|
|
# Assuming x is either a date or timestamp.
|
|
start_date = self.x.min()
|
|
end_date = self.x.max()
|
|
all_dates = date_range(start = start_date, end = end_date)
|
|
missing_dates = all_dates.difference(self.x)
|
|
return [dict(values = missing_dates)] |