@@ -112,6 +112,7 @@ def infinite(self, value: str):
112112
113113class Grids (pygfx .Group ):
114114 """Just a class to make accessing the grids easier"""
115+
115116 def __init__ (self , * , xy , xz , yz ):
116117 super ().__init__ ()
117118
@@ -241,16 +242,16 @@ def define_text(pos, text):
241242
242243class Axes :
243244 def __init__ (
244- self ,
245- plot_area ,
246- intersection : tuple [int , int , int ] | None = None ,
247- x_kwargs : dict = None ,
248- y_kwargs : dict = None ,
249- z_kwargs : dict = None ,
250- grids : bool = True ,
251- grid_kwargs : dict = None ,
252- auto_grid : bool = True ,
253- offset : np .ndarray = np .array ([0. , 0. , 0. ])
245+ self ,
246+ plot_area ,
247+ intersection : tuple [int , int , int ] | None = None ,
248+ x_kwargs : dict = None ,
249+ y_kwargs : dict = None ,
250+ z_kwargs : dict = None ,
251+ grids : bool = True ,
252+ grid_kwargs : dict = None ,
253+ auto_grid : bool = True ,
254+ offset : np .ndarray = np .array ([0.0 , 0.0 , 0.0 ]),
254255 ):
255256 self ._plot_area = plot_area
256257
@@ -268,10 +269,7 @@ def __init__(
268269 ** x_kwargs ,
269270 }
270271
271- y_kwargs = {
272- "tick_side" : "left" ,
273- ** y_kwargs
274- }
272+ y_kwargs = {"tick_side" : "left" , ** y_kwargs }
275273
276274 z_kwargs = {
277275 "tick_side" : "left" ,
@@ -290,12 +288,16 @@ def __init__(
290288 self .x .start_pos = 0 , 0 , 0
291289 self .x .end_pos = 100 , 0 , 0
292290 self .x .start_value = self .x .start_pos [0 ] - offset [0 ]
293- statsx = self .x .update (self ._plot_area .camera , self ._plot_area .viewport .logical_size )
291+ statsx = self .x .update (
292+ self ._plot_area .camera , self ._plot_area .viewport .logical_size
293+ )
294294
295295 self .y .start_pos = 0 , 0 , 0
296296 self .y .end_pos = 0 , 100 , 0
297297 self .y .start_value = self .y .start_pos [1 ] - offset [1 ]
298- statsy = self .y .update (self ._plot_area .camera , self ._plot_area .viewport .logical_size )
298+ statsy = self .y .update (
299+ self ._plot_area .camera , self ._plot_area .viewport .logical_size
300+ )
299301
300302 self .z .start_pos = 0 , 0 , 0
301303 self .z .end_pos = 0 , 0 , 100
@@ -327,7 +329,7 @@ def __init__(
327329 "major_thickness" : 2 ,
328330 "minor_thickness" : 0.5 ,
329331 "infinite" : True ,
330- ** grid_kwargs
332+ ** grid_kwargs ,
331333 }
332334
333335 if grids :
@@ -427,7 +429,9 @@ def intersection(self, intersection: tuple[float, float, float] | None):
427429 return
428430
429431 if len (intersection ) != 3 :
430- raise ValueError ("intersection must be a float of 3 elements for [x, y, z] or `None`" )
432+ raise ValueError (
433+ "intersection must be a float of 3 elements for [x, y, z] or `None`"
434+ )
431435
432436 self ._intersection = tuple (float (v ) for v in intersection )
433437
@@ -493,10 +497,12 @@ def update_using_camera(self):
493497
494498 world_zmin , world_zmax = 0 , 0
495499
496- bbox = np .array ([
497- [world_xmin , world_ymin , world_zmin ],
498- [world_xmax , world_ymax , world_zmax ]
499- ])
500+ bbox = np .array (
501+ [
502+ [world_xmin , world_ymin , world_zmin ],
503+ [world_xmax , world_ymax , world_zmax ],
504+ ]
505+ )
500506
501507 else :
502508 # set ruler start and end positions based on scene bbox
@@ -507,7 +513,9 @@ def update_using_camera(self):
507513 # place the ruler close to the left and bottom edges of the viewport
508514 # TODO: determine this for perspective projections
509515 xscreen_10 , yscreen_10 = xpos + (width * 0.1 ), ypos + (height * 0.9 )
510- intersection = self ._plot_area .map_screen_to_world ((xscreen_10 , yscreen_10 ))
516+ intersection = self ._plot_area .map_screen_to_world (
517+ (xscreen_10 , yscreen_10 )
518+ )
511519 else :
512520 # force origin since None is not supported for Persepctive projections
513521 self ._intersection = (0 , 0 , 0 )
@@ -554,20 +562,26 @@ def update(self, bbox, intersection):
554562 self .x .end_pos = world_xmax , world_y_10 , world_z_10
555563
556564 self .x .start_value = self .x .start_pos [0 ] - self .offset [0 ]
557- statsx = self .x .update (self ._plot_area .camera , self ._plot_area .viewport .logical_size )
565+ statsx = self .x .update (
566+ self ._plot_area .camera , self ._plot_area .viewport .logical_size
567+ )
558568
559569 self .y .start_pos = world_x_10 , world_ymin , world_z_10
560570 self .y .end_pos = world_x_10 , world_ymax , world_z_10
561571
562572 self .y .start_value = self .y .start_pos [1 ] - self .offset [1 ]
563- statsy = self .y .update (self ._plot_area .camera , self ._plot_area .viewport .logical_size )
573+ statsy = self .y .update (
574+ self ._plot_area .camera , self ._plot_area .viewport .logical_size
575+ )
564576
565577 if self ._plot_area .camera .fov != 0 :
566578 self .z .start_pos = world_x_10 , world_y_10 , world_zmin
567579 self .z .end_pos = world_x_10 , world_y_10 , world_zmax
568580
569581 self .z .start_value = self .z .start_pos [1 ] - self .offset [2 ]
570- statsz = self .z .update (self ._plot_area .camera , self ._plot_area .viewport .logical_size )
582+ statsz = self .z .update (
583+ self ._plot_area .camera , self ._plot_area .viewport .logical_size
584+ )
571585 major_step_z = statsz ["tick_step" ]
572586
573587 if self .grids :
0 commit comments