Fix string type dates not being parsed.
Fix table flex alignment Topbar switcher values now update immediately
This commit is contained in:
@ -100,7 +100,7 @@ if __name__ == '__main__':
|
|||||||
df1 = pd.read_csv('ohlc.csv')
|
df1 = pd.read_csv('ohlc.csv')
|
||||||
|
|
||||||
# Columns: time | price
|
# Columns: time | price
|
||||||
df2 = pd.read_csv('ticks.csv', parse_dates=['time'])
|
df2 = pd.read_csv('ticks.csv')
|
||||||
|
|
||||||
chart = Chart()
|
chart = Chart()
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ if __name__ == '__main__':
|
|||||||
df1 = pd.read_csv('ohlc.csv')
|
df1 = pd.read_csv('ohlc.csv')
|
||||||
|
|
||||||
# Columns: time | price
|
# Columns: time | price
|
||||||
df2 = pd.read_csv('ticks.csv', parse_dates=['time'])
|
df2 = pd.read_csv('ticks.csv')
|
||||||
|
|
||||||
chart = Chart()
|
chart = Chart()
|
||||||
|
|
||||||
|
|||||||
@ -210,7 +210,10 @@ class SeriesCommon(Pane):
|
|||||||
|
|
||||||
def _single_datetime_format(self, arg):
|
def _single_datetime_format(self, arg):
|
||||||
if isinstance(arg, (str, int, float)) or not pd.api.types.is_datetime64_any_dtype(arg):
|
if isinstance(arg, (str, int, float)) or not pd.api.types.is_datetime64_any_dtype(arg):
|
||||||
arg = pd.to_datetime(arg, unit='ms')
|
try:
|
||||||
|
arg = pd.to_datetime(arg, unit='ms')
|
||||||
|
except ValueError:
|
||||||
|
arg = pd.to_datetime(arg)
|
||||||
arg = self._interval * (arg.timestamp() // self._interval)+self.offset
|
arg = self._interval * (arg.timestamp() // self._interval)+self.offset
|
||||||
return arg
|
return arg
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@ if (!window.Table) {
|
|||||||
this.reSize(width, height)
|
this.reSize(width, height)
|
||||||
this.container.style.display = 'flex'
|
this.container.style.display = 'flex'
|
||||||
this.container.style.flexDirection = 'column'
|
this.container.style.flexDirection = 'column'
|
||||||
this.container.style.justifyContent = 'space-between'
|
// this.container.style.justifyContent = 'space-between'
|
||||||
|
|
||||||
this.container.style.borderRadius = '5px'
|
this.container.style.borderRadius = '5px'
|
||||||
this.container.style.color = 'white'
|
this.container.style.color = 'white'
|
||||||
|
|||||||
@ -43,6 +43,7 @@ class SwitcherWidget(Widget):
|
|||||||
if option not in self.options:
|
if option not in self.options:
|
||||||
raise ValueError(f"option '{option}' does not exist within {self.options}.")
|
raise ValueError(f"option '{option}' does not exist within {self.options}.")
|
||||||
self.run_script(f'{self.id}.onItemClicked("{option}")')
|
self.run_script(f'{self.id}.onItemClicked("{option}")')
|
||||||
|
self.value = option
|
||||||
|
|
||||||
|
|
||||||
class MenuWidget(Widget):
|
class MenuWidget(Widget):
|
||||||
|
|||||||
Reference in New Issue
Block a user