@@ -399,7 +399,9 @@ class _CanvasBase(DOMWidget):
399399 _view_module = Unicode (module_name ).tag (sync = True )
400400 _view_module_version = Unicode (module_version ).tag (sync = True )
401401
402- _canvas_manager = Instance (_CanvasManager , default_value = _CANVAS_MANAGER ).tag (sync = True , ** widget_serialization )
402+ _canvas_manager = Instance (_CanvasManager , default_value = _CANVAS_MANAGER ).tag (
403+ sync = True , ** widget_serialization
404+ )
403405
404406 width = CInt (700 ).tag (sync = True )
405407 height = CInt (500 ).tag (sync = True )
@@ -705,7 +707,9 @@ def fill_rects(self, x, y, width, height=None):
705707 else :
706708 populate_args (height , args , buffers )
707709
708- self ._canvas_manager .send_draw_command (self , COMMANDS ["fillRects" ], args , buffers )
710+ self ._canvas_manager .send_draw_command (
711+ self , COMMANDS ["fillRects" ], args , buffers
712+ )
709713
710714 def stroke_rects (self , x , y , width , height = None ):
711715 """Draw a rectangular outlines of sizes ``(width, height)`` at the ``(x, y)`` positions.
@@ -725,7 +729,9 @@ def stroke_rects(self, x, y, width, height=None):
725729 else :
726730 populate_args (height , args , buffers )
727731
728- self ._canvas_manager .send_draw_command (self , COMMANDS ["strokeRects" ], args , buffers )
732+ self ._canvas_manager .send_draw_command (
733+ self , COMMANDS ["strokeRects" ], args , buffers
734+ )
729735
730736 def fill_styled_rects (self , x , y , width , height , color , alpha = 1 ):
731737 """Draw filled and styled rectangles of sizes ``(width, height)`` at the ``(x, y)`` positions
@@ -799,7 +805,9 @@ def fill_arc(self, x, y, radius, start_angle, end_angle, anticlockwise=False):
799805
800806 def fill_circle (self , x , y , radius ):
801807 """Draw a filled circle centered at ``(x, y)`` with a radius of ``radius``."""
802- self ._canvas_manager .send_draw_command (self , COMMANDS ["fillCircle" ], [x , y , radius ])
808+ self ._canvas_manager .send_draw_command (
809+ self , COMMANDS ["fillCircle" ], [x , y , radius ]
810+ )
803811
804812 def stroke_arc (self , x , y , radius , start_angle , end_angle , anticlockwise = False ):
805813 """Draw an arc outline centered at ``(x, y)`` with a radius of ``radius``."""
@@ -830,7 +838,9 @@ def fill_arcs(self, x, y, radius, start_angle, end_angle, anticlockwise=False):
830838 populate_args (end_angle , args , buffers )
831839 args .append (anticlockwise )
832840
833- self ._canvas_manager .send_draw_command (self , COMMANDS ["fillArcs" ], args , buffers )
841+ self ._canvas_manager .send_draw_command (
842+ self , COMMANDS ["fillArcs" ], args , buffers
843+ )
834844
835845 def stroke_arcs (self , x , y , radius , start_angle , end_angle , anticlockwise = False ):
836846 """Draw an arc outlines centered at ``(x, y)`` with a radius of ``radius``.
@@ -847,7 +857,9 @@ def stroke_arcs(self, x, y, radius, start_angle, end_angle, anticlockwise=False)
847857 populate_args (end_angle , args , buffers )
848858 args .append (anticlockwise )
849859
850- self ._canvas_manager .send_draw_command (self , COMMANDS ["strokeArcs" ], args , buffers )
860+ self ._canvas_manager .send_draw_command (
861+ self , COMMANDS ["strokeArcs" ], args , buffers
862+ )
851863
852864 def fill_circles (self , x , y , radius ):
853865 """Draw filled circles centered at ``(x, y)`` with a radius of ``radius``.
@@ -861,7 +873,9 @@ def fill_circles(self, x, y, radius):
861873 populate_args (y , args , buffers )
862874 populate_args (radius , args , buffers )
863875
864- self ._canvas_manager .send_draw_command (self , COMMANDS ["fillCircles" ], args , buffers )
876+ self ._canvas_manager .send_draw_command (
877+ self , COMMANDS ["fillCircles" ], args , buffers
878+ )
865879
866880 def stroke_circles (self , x , y , radius ):
867881 """Draw a circle outlines centered at ``(x, y)`` with a radius of ``radius``.
@@ -970,7 +984,9 @@ def fill_polygon(self, points):
970984
971985 populate_args (points , args , buffers )
972986
973- self ._canvas_manager .send_draw_command (self , COMMANDS ["fillPolygon" ], args , buffers )
987+ self ._canvas_manager .send_draw_command (
988+ self , COMMANDS ["fillPolygon" ], args , buffers
989+ )
974990
975991 def stroke_polygon (self , points ):
976992 """Draw polygon outline from a list of points ``[(x1, y1), (x2, y2), ..., (xn, yn)]``."""
@@ -1135,7 +1151,9 @@ def stroke_lines(self, points):
11351151
11361152 populate_args (points , args , buffers )
11371153
1138- self ._canvas_manager .send_draw_command (self , COMMANDS ["strokeLines" ], args , buffers )
1154+ self ._canvas_manager .send_draw_command (
1155+ self , COMMANDS ["strokeLines" ], args , buffers
1156+ )
11391157
11401158 def stroke_styled_line_segments (
11411159 self , points , color , alpha = 1 , points_per_line_segment = None
@@ -1240,7 +1258,9 @@ def fill(self, rule_or_path="nonzero"):
12401258 [widget_serialization ["to_json" ](rule_or_path , None )],
12411259 )
12421260 else :
1243- self ._canvas_manager .send_draw_command (self , COMMANDS ["fill" ], [rule_or_path ])
1261+ self ._canvas_manager .send_draw_command (
1262+ self , COMMANDS ["fill" ], [rule_or_path ]
1263+ )
12441264
12451265 def move_to (self , x , y ):
12461266 """Move the "pen" to the given ``(x, y)`` coordinates."""
@@ -1256,7 +1276,9 @@ def line_to(self, x, y):
12561276
12571277 def rect (self , x , y , width , height ):
12581278 """Add a rectangle of size ``(width, height)`` at the ``(x, y)`` position in the current path."""
1259- self ._canvas_manager .send_draw_command (self , COMMANDS ["rect" ], [x , y , width , height ])
1279+ self ._canvas_manager .send_draw_command (
1280+ self , COMMANDS ["rect" ], [x , y , width , height ]
1281+ )
12601282
12611283 def arc (self , x , y , radius , start_angle , end_angle , anticlockwise = False ):
12621284 """Add a circular arc centered at ``(x, y)`` with a radius of ``radius`` to the current path.
0 commit comments