biolab / orange3-single-cell

🍊🔬 Orange add-on for gene expression of single cell data
https://singlecell.biolab.si/
Other
17 stars 25 forks source link

[FIX] ContingencyTable: Fix for labels getting cut off in circle mode #304

Closed jurijsteblaj closed 5 years ago

jurijsteblaj commented 5 years ago
Issue

Fixes #303

Description of changes

This solution here is quite ugly. I don't know how to fix this properly.

If we input the iris dataset, the longest of the labels at the top has a size hint of (29, 98) after calling self.resizeRowToContents(1). But if self.horizontalHeader().setDefaultSectionSize(self.cell_size) is called before that (the problem can occur at the next call of this method) with value 30, the size hint will be (46, 73). The other two labels have shorter and wider size hints as well. The delegate used is CircleItemDelegate, which uses methods from gui.VerticalItemDelegate for those labels.

The current fix stores the default self.horizontalHeader().defaultSectionSize(), which seems to be 100, and applies it before the call to self.resizeRowToContents(1). After that it sets the value again to self.cell_size.

Includes
codecov-io commented 5 years ago

Codecov Report

Merging #304 into master will decrease coverage by <.01%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
- Coverage   61.36%   61.35%   -0.01%     
==========================================
  Files          28       28              
  Lines        6264     6265       +1     
==========================================
  Hits         3844     3844              
- Misses       2420     2421       +1
Impacted Files Coverage Δ
...gecontrib/single_cell/widgets/contingency_table.py 0% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bcf36ed...327dfe6. Read the comment docs.

jurijsteblaj commented 5 years ago

I now use a constant value instead of storing self.horizontalHeader().defaultSectionSize().

JakaKokosar commented 5 years ago

You can probably squash these two commits into one before merging.