@@ -193,7 +193,7 @@ def create_graph(self) -> Graph:
193193 html = []
194194
195195 image_rows = []
196- if connector .image :
196+ if connector .image and connector . image . position != 'above' :
197197 image_rows = [[html_image (connector .image )],
198198 [html_caption (connector .image )]]
199199
@@ -205,17 +205,17 @@ def create_graph(self) -> Graph:
205205 html_line_breaks (pn_info_string (HEADER_SPN , connector .supplier , connector .spn ))],
206206 [html_line_breaks (connector .type ),
207207 html_line_breaks (connector .subtype ),
208- f'{ connector .pincount } -pin' if connector .show_pincount else None ,
208+ f'{ connector .pincount } -pin' if connector .show_pincount else None ],
209+ [html_caption (connector .image ) if connector .image and connector .image .position == 'above' else None ,
210+ html_image (connector .image ) if connector .image and connector .image .position == 'above' else None ,
209211 translate_color (connector .color , self .options .color_mode ) if connector .color else None ,
210212 html_colorbar (connector .color )],
211213 '<!-- connector table -->' if connector .style != 'simple' else None ]
212214 # fmt: on
213215 imagetable = ''
214216 if connector .image :
215- if connector .image .alignment == 'under ' or connector .image .alignment is None :
217+ if connector .image .position == 'below ' or connector .image .position is None :
216218 rows += image_rows
217- elif connector .image .alignment == 'above' :
218- rows = image_rows + rows
219219 else :
220220 imagetable = '' .join (nested_html_table (image_rows , html_bgcolor_attr (connector .bgcolor )))
221221
@@ -248,7 +248,7 @@ def create_graph(self) -> Graph:
248248
249249 pinhtml .append (" <tr>" )
250250
251- if firstpin and connector .image and connector .image .alignment == 'left' :
251+ if firstpin and connector .image and connector .image .position == 'left' :
252252 firstpin = False
253253 pinhtml .append (f'<td rowspan="{ pincount } ">{ imagetable } </td>' )
254254
@@ -272,7 +272,7 @@ def create_graph(self) -> Graph:
272272 if connector .ports_right :
273273 pinhtml .append (f' <td port="p{ pinindex + 1 } r">{ pinname } </td>' )
274274
275- if firstpin and connector .image and connector .image .alignment == 'right' :
275+ if firstpin and connector .image and connector .image .position == 'right' :
276276 firstpin = False
277277 pinhtml .append (
278278 f'<td rowspan="{ pincount } ">{ imagetable } </td>' )
@@ -741,3 +741,4 @@ def bom(self):
741741 if not self ._bom :
742742 self ._bom = generate_bom (self )
743743 return self ._bom
744+
0 commit comments