Skip to content

Commit 3ca4a36

Browse files
committed
heatmap: Fix columns group label layout
1 parent c230663 commit 3ca4a36

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Orange/widgets/visualize/utils/heatmap.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,16 +281,18 @@ class Position(enum.IntFlag):
281281

282282
# Start row/column where the heatmap items are inserted
283283
# (after the titles/legends/dendrograms)
284-
Row0 = 3
284+
Row0 = 4
285285
Col0 = 3
286286
# The (color) legend row and column
287287
LegendRow, LegendCol = 0, 4
288288
# The column for the vertical dendrogram
289289
DendrogramColumn = 1
290+
# Horizontal split title column
291+
GroupTitleRow = 1
290292
# The row for the horizontal dendrograms
291-
DendrogramRow = 1
293+
DendrogramRow = 2
292294
# The row for top column annotation labels
293-
TopLabelsRow = 2
295+
TopLabelsRow = 3
294296
# Vertical split title column
295297
GroupTitleColumn = 0
296298

@@ -417,9 +419,10 @@ def setHeatmaps(self, parts: 'Parts') -> None:
417419
if colitem.title:
418420
item = SimpleLayoutItem(
419421
QGraphicsSimpleTextItem(colitem.title, parent=self),
420-
parent=grid
422+
parent=grid, anchor=(0.5, 0.5), anchorItem=(0.5, 0.5)
421423
)
422-
grid.addItem(item, 1, Col0 + 2 * j + 1)
424+
item.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)
425+
grid.addItem(item, self.GroupTitleRow, Col0 + 2 * j + 1)
423426

424427
if colitem.cluster:
425428
dendrogram = DendrogramWidget(

0 commit comments

Comments
 (0)