@@ -155,8 +155,9 @@ def plot(self, filepath: str = None, **kwargs):
155155class ReferencedObject (PlotDataObject ):
156156 """ PlotData object with reference_path. """
157157
158- def __init__ (self , type_ : str , reference_path : str = "#" , name : str = "" ):
158+ def __init__ (self , type_ : str , reference_path : str = "#" , tooltip : str = None , name : str = "" ):
159159 self .reference_path = reference_path
160+ self .tooltip = tooltip
160161 super ().__init__ (type_ = type_ , name = name )
161162
162163
@@ -451,7 +452,7 @@ class Text(ReferencedObject):
451452
452453 def __init__ (self , comment : str , position_x : float , position_y : float , text_style : TextStyle = None ,
453454 text_scaling : bool = None , max_width : float = None , height : float = None , multi_lines : bool = True ,
454- reference_path : str = "#" , name : str = '' ):
455+ reference_path : str = "#" , tooltip : str = None , name : str = '' ):
455456 self .comment = comment
456457 self .text_style = text_style
457458 self .position_x = position_x
@@ -460,7 +461,7 @@ def __init__(self, comment: str, position_x: float, position_y: float, text_styl
460461 self .max_width = max_width
461462 self .height = height
462463 self .multi_lines = multi_lines
463- super ().__init__ (type_ = 'text' , reference_path = reference_path , name = name )
464+ super ().__init__ (type_ = 'text' , reference_path = reference_path , tooltip = tooltip , name = name )
464465
465466 def mpl_plot (self , ax = None , color = 'k' , alpha = 1. , ** kwargs ):
466467 """ Plots using Matplotlib. """
@@ -483,12 +484,12 @@ class Line2D(ReferencedObject):
483484 """
484485
485486 def __init__ (self , point1 : List [float ], point2 : List [float ], edge_style : EdgeStyle = None ,
486- reference_path : str = "#" , name : str = '' ):
487+ reference_path : str = "#" , tooltip : str = None , name : str = '' ):
487488 self .data = point1 + point2 # Retrocompatibility
488489 self .point1 = point1
489490 self .point2 = point2
490491 self .edge_style = edge_style
491- super ().__init__ (type_ = 'line2d' , reference_path = reference_path , name = name )
492+ super ().__init__ (type_ = 'line2d' , reference_path = reference_path , tooltip = tooltip , name = name )
492493
493494 def mpl_plot (self , ax = None , edge_style = None , ** kwargs ):
494495 """ Plots using matplotlib. """
@@ -519,7 +520,7 @@ class LineSegment2D(ReferencedObject):
519520 """
520521
521522 def __init__ (self , point1 : List [float ], point2 : List [float ], edge_style : EdgeStyle = None ,
522- reference_path : str = "#" , name : str = '' ):
523+ reference_path : str = "#" , tooltip : str = None , name : str = '' ):
523524 # Data is used in typescript
524525 self .data = point1 + point2
525526 self .point1 = point1
@@ -529,7 +530,7 @@ def __init__(self, point1: List[float], point2: List[float], edge_style: EdgeSty
529530 self .edge_style = EdgeStyle ()
530531 else :
531532 self .edge_style = edge_style
532- super ().__init__ (type_ = 'linesegment2d' , reference_path = reference_path , name = name )
533+ super ().__init__ (type_ = 'linesegment2d' , reference_path = reference_path , tooltip = tooltip , name = name )
533534
534535 def bounding_box (self ):
535536 """ Get 2D bounding box of current LineSegment2D. """
@@ -573,8 +574,7 @@ def __init__(self, lines: List[Tuple[float, float]], edge_style: EdgeStyle = Non
573574 reference_path : str = "#" , name : str = "" ):
574575 self .lines = lines
575576 self .edge_style = edge_style
576- self .tooltip = tooltip
577- super ().__init__ (type_ = "wire" , reference_path = reference_path , name = name )
577+ super ().__init__ (type_ = "wire" , reference_path = reference_path , tooltip = tooltip , name = name )
578578
579579 def mpl_plot (self , ax = None , ** kwargs ):
580580 """ Plots using matplotlib. """
@@ -614,8 +614,7 @@ def __init__(self, cx: float, cy: float, r: float, edge_style: EdgeStyle = None,
614614 self .r = r
615615 self .cx = cx
616616 self .cy = cy
617- self .tooltip = tooltip
618- super ().__init__ (type_ = 'circle' , reference_path = reference_path , name = name )
617+ super ().__init__ (type_ = 'circle' , reference_path = reference_path , tooltip = tooltip , name = name )
619618
620619 def bounding_box (self ):
621620 """ Get 2D bounding box of current Circle2D. """
@@ -656,8 +655,7 @@ def __init__(self, x_coord: float, y_coord: float, width: float, height: float,
656655 self .height = height
657656 self .surface_style = surface_style
658657 self .edge_style = edge_style
659- self .tooltip = tooltip
660- super ().__init__ (type_ = 'rectangle' , reference_path = reference_path , name = name )
658+ super ().__init__ (type_ = 'rectangle' , reference_path = reference_path , tooltip = tooltip , name = name )
661659
662660 def bounding_box (self ):
663661 """ Get 2D bounding box of current Circle2D. """
@@ -1141,15 +1139,15 @@ class Arc2D(ReferencedObject):
11411139 """
11421140
11431141 def __init__ (self , cx : float , cy : float , r : float , start_angle : float , end_angle : float , clockwise : bool = None ,
1144- edge_style : EdgeStyle = None , reference_path : str = "#" , name : str = '' ):
1142+ edge_style : EdgeStyle = None , reference_path : str = "#" , tooltip : str = None , name : str = '' ):
11451143 self .cx = cx
11461144 self .cy = cy
11471145 self .r = r
11481146 self .start_angle = start_angle
11491147 self .end_angle = end_angle
11501148 self .clockwise = clockwise
11511149 self .edge_style = edge_style
1152- super ().__init__ (type_ = 'arc' , reference_path = reference_path , name = name )
1150+ super ().__init__ (type_ = 'arc' , reference_path = reference_path , tooltip = tooltip , name = name )
11531151
11541152 def bounding_box (self ):
11551153 """ Get 2D bounding box of current Circle2D. """
@@ -1203,9 +1201,8 @@ def __init__(self, plot_data_primitives: List[Union[Arc2D, LineSegment2D]], edge
12031201 self .plot_data_primitives = plot_data_primitives
12041202 self .edge_style = edge_style
12051203 self .surface_style = surface_style
1206- self .tooltip = tooltip
12071204 self .is_filled = surface_style is not None
1208- super ().__init__ (type_ = 'contour' , reference_path = reference_path , name = name )
1205+ super ().__init__ (type_ = 'contour' , reference_path = reference_path , tooltip = tooltip , name = name )
12091206
12101207 def bounding_box (self ):
12111208 """ Get 2D bounding box of current Contour2D. """
0 commit comments