-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from JesseMckinzie/feature_heatmap
Add feature calculation heatmap
- Loading branch information
Showing
4 changed files
with
283 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from qtpy.QtCore import * | ||
from qtpy.QtGui import * | ||
from qtpy.QtWidgets import QHeaderView | ||
|
||
class RotatedHeaderView(QHeaderView): | ||
def __init__(self, parent=None): | ||
super(RotatedHeaderView, self).__init__(Qt.Horizontal, parent) | ||
self.setMinimumSectionSize(20) | ||
|
||
def paintSection(self, painter, rect, logicalIndex ): | ||
painter.save() | ||
# translate the painter such that rotate will rotate around the correct point | ||
painter.translate(rect.x()+rect.width(), rect.y()) | ||
painter.rotate(90) | ||
# and have parent code paint at this location | ||
newrect = QRect(0,0,rect.height(),rect.width()) | ||
super(RotatedHeaderView, self).paintSection(painter, newrect, logicalIndex) | ||
painter.restore() | ||
|
||
def minimumSizeHint(self): | ||
size = super(RotatedHeaderView, self).minimumSizeHint() | ||
size.transpose() | ||
return size | ||
|
||
def sectionSizeFromContents(self, logicalIndex): | ||
size = super(RotatedHeaderView, self).sectionSizeFromContents(logicalIndex) | ||
size.transpose() | ||
return size |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters