File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -99,9 +99,14 @@ def clear_values(self) -> None:
9999 self .pop ()
100100 self ._spark_list = [] # empty the list
101101
102- def add_value (self , value : float ) -> None :
102+ def add_value (self , value : float , update : bool = True ) -> None :
103103 """Add a value to the sparkline.
104104 :param value: The value to be added to the sparkline
105+ :param update: trigger recreation of primitives
106+
107+ Note: when adding multiple values it is more efficient to call
108+ this method with parameter 'update=False' and then to manually
109+ call the update()-method
105110 """
106111
107112 if value is not None :
@@ -110,7 +115,8 @@ def add_value(self, value: float) -> None:
110115 ): # if list is full, remove the first item
111116 self ._spark_list .pop (0 )
112117 self ._spark_list .append (value )
113- self .update ()
118+ if update :
119+ self .update ()
114120
115121 # pylint: disable=no-else-return
116122 @staticmethod
You can’t perform that action at this time.
0 commit comments