9797 'right' :'q' , 'top' :'r' , 'bottom' :'s' , '_cloneid' :'t' ,
9898 'logx' :'u' , 'logy' :'v' , 'dot' :'w' , 'dot_radius' :'x' ,
9999 'markers' :'y' , 'legend' :'z' , 'label' :'A' , 'delta' :'B' , 'marker_color' :'C' ,
100- 'size_units' :'D' , 'userpan' :'E' }
100+ 'size_units' :'D' , 'userpan' :'E' , 'scroll' : 'F' }
101101
102102# methods are X in {'m': '23X....'}
103103# pos is normally updated as an attribute, but for interval-based trails, it is updated (multiply) as a method
@@ -2282,6 +2282,7 @@ def __init__(self, **args):
22822282 self ._title = ""
22832283 self ._xtitle = ""
22842284 self ._ytitle = ""
2285+ self ._scroll = False
22852286 argsToSend = []
22862287
22872288 ## override default vector attributes
@@ -2296,7 +2297,7 @@ def __init__(self, **args):
22962297
22972298 ## override default scalar attributes
22982299 scalarAttributes = ['width' , 'height' , 'title' , 'xtitle' , 'ytitle' ,'align' ,
2299- 'xmin' , 'xmax' , 'ymin' , 'ymax' , 'logx' , 'logy' , 'fast' ]
2300+ 'xmin' , 'xmax' , 'ymin' , 'ymax' , 'logx' , 'logy' , 'fast' , 'scroll' ]
23002301 for a in scalarAttributes :
23012302 if a in args :
23022303 argsToSend .append (a )
@@ -2309,6 +2310,12 @@ def __init__(self, **args):
23092310
23102311 cmd = {"cmd" : objName , "idx" : self .idx }
23112312
2313+ if self ._scroll :
2314+ if not ('xmin' in argsToSend and 'xmax' in argsToSend ):
2315+ raise AttributeError ("For a scrolling graph, both xmin and xmax must be specified." )
2316+ if self ._xmax <= self ._xmin :
2317+ raise AttributeError ("For a scrolling graph, xmax must be greater than xmin." )
2318+
23122319 ## send only args specified in constructor
23132320 for a in argsToSend :
23142321 aval = getattr (self ,a )
@@ -2322,11 +2329,16 @@ def __init__(self, **args):
23222329 def fast (self ): return self ._fast
23232330 @fast .setter
23242331 def fast (self ,val ):
2325- # if _isnotebook and not val:
2326- # raise AttributeError('"fast = False" is currently not available in a Jupyter notebook.')
23272332 self ._fast = val
23282333 self .addattr ('fast' )
23292334
2335+ @property
2336+ def scroll (self ): return self ._scroll
2337+ @scroll .setter
2338+ def scroll (self ,val ):
2339+ self ._scroll = val
2340+ self .addattr ('scroll' )
2341+
23302342 @property
23312343 def width (self ): return self ._width
23322344 @width .setter
0 commit comments