Skip to content

Commit f64cbca

Browse files
committed
FEAT: Begin work on adding heatmap to base model.
1 parent a5fda57 commit f64cbca

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

faslr/common/model.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import pandas as pd
88

99
from faslr.model import FModelWidget
10+
from faslr.utilities.style_parser import parse_styler
1011

1112
from PyQt6.QtGui import (
1213
QKeyEvent,
@@ -35,6 +36,7 @@
3536

3637
from PyQt6.QtWidgets import (
3738
QApplication,
39+
QCheckBox,
3840
QHBoxLayout,
3941
QPushButton,
4042
QVBoxLayout,
@@ -461,6 +463,8 @@ def __init__(
461463
):
462464
super().__init__()
463465
self.parent: FSelectionModelWidget = parent
466+
467+
self.check_heatmap = QCheckBox(text='Heatmap')
464468
self.add_average_button = QPushButton("Available Averages")
465469
self.add_average_button.setFixedWidth(self.add_average_button.sizeHint().width())
466470

@@ -487,8 +491,10 @@ def __init__(
487491
data=averages
488492
)
489493

494+
self.layout.addWidget(self.check_heatmap)
490495
self.layout.addWidget(self.add_average_button)
491496

497+
# self.check_heatmap.stateChanged.connext(self.toggle_heatmap)
492498
self.add_average_button.clicked.connect(self.open_average_box) # noqa
493499

494500
def open_average_box(self) -> None:
@@ -497,6 +503,19 @@ def open_average_box(self) -> None:
497503
"""
498504
self.average_box.show()
499505

506+
# def toggle_heatmap(self):
507+
#
508+
# selection_model: FSelectionModel = self.parent.selection_model
509+
#
510+
# if self.check_heatmap.isChecked():
511+
# selection_model.heatmap_frame = parse_styler(
512+
# selection_model.df_ratio,
513+
# cmap="coolwarm"
514+
# )
515+
# selection_model.layoutChanged.emit() # noqa
516+
# else:
517+
# selection_model.layoutChanged.emit() # noqa
518+
500519
class FModelView(FTableView):
501520
"""
502521
Model view for displaying the ratios and averages that the user uses to make a selection.

0 commit comments

Comments
 (0)