Commit 730c6aac authored by ulc0011's avatar ulc0011

ENH: Heatmaps also for nested regions

parent e0d58da2
......@@ -42,6 +42,13 @@ class Window(QtWidgets.QDialog):
self.button2 = QtWidgets.QCheckBox('Switch axes')
self.button2.clicked.connect(self.change_sw)
self.combo_reg = QtWidgets.QComboBox(self)
self.combo_reg.addItem('Overall summary')
#TODO - multiple measurements handling (2 in range is ad hoc)
for i in range(0,len(self.d["nested_regions_report_data"]),2):
self.combo_reg.addItem("REGION - {}".format(self.d["nested_regions_report_data"][i]["nested_region"]))
if len(self.D) > 1:
self.combo = QtWidgets.QComboBox(self)
for i in range(0,len(self.D)):
......@@ -53,17 +60,24 @@ class Window(QtWidgets.QDialog):
self.plot_data = self.D[0]
self.lab_reg = QtWidgets.QLabel('Choose Area: ')
self.lab_reg.setFont(self.bf)
hl_reg = QtWidgets.QHBoxLayout()
hl_reg.addWidget(self.lab_reg)
hl_reg.addWidget(self.combo_reg)
hl_reg.addWidget(self.button2)
self.combo_reg.activated[str].connect(self.chooseReg)
self.layout.addLayout(hl_reg)
if len(self.D) > 1:
self.label = QtWidgets.QLabel('Choose quantity: ')
self.label.setFont(self.bf)
hl = QtWidgets.QHBoxLayout()
hl.addWidget(self.label)
hl.addWidget(self.combo)
hl.addWidget(self.button2)
hl.addWidget(QtWidgets.QLabel(''))
self.combo.activated[str].connect(self.chooseData)
self.layout.addLayout(hl)
else:
self.layout.addWidget(button2)
self.heat_data = self.plot_data[1]["heat_data"]
self.k = self.plot_data[1]["lines"]
......@@ -119,6 +133,22 @@ class Window(QtWidgets.QDialog):
self.draw_heatmap()
def chooseReg(self, dataLabel):
if dataLabel == "Overall summary":
self.D = self.d["plot_summary_data"]
else:
for i in range(0,len(self.d["nested_regions_report_data"])):
tmp = "REGION - {}".format(self.d["nested_regions_report_data"][i]["nested_region"])
if dataLabel == tmp:
self.D = self.d["nested_regions_report_data"][i]["plot_data"]
self.plot_data = self.D[0]
if len(self.D) > 1:
for i in range(0,len(self.D)):
if str(self.combo.currentText()) == self.D[i][0]["arg"]:
self.plot_data = self.D[i]
self.draw_heatmap()
def change_sw(self):
self.sw = not self.sw
self.draw_heatmap()
......@@ -140,6 +170,18 @@ class Window(QtWidgets.QDialog):
if dataLabel == self.D[i][0]["arg"]:
self.plot_data = self.D[i]
self.draw_heatmap()
'''if self.sw:
self.figure = Figure(figsize=(self.figheight,self.figwidth))
else:
self.figure = Figure(figsize=(self.figwidth,self.figheight))'''
#self.canvas.setHidden(not self.canvas.isHidden())
#self.canvas = FigureCanvas(self.figure)
def draw_heatmap(self):
self.heat_data = self.plot_data[1]["heat_data"]
self.k = self.plot_data[1]["lines"]
self.ky = [h[0] for h in self.heat_data[0]]
......@@ -159,19 +201,6 @@ class Window(QtWidgets.QDialog):
self.figwidth= self.cell_width*self.x + self.marg_left + self.marg_right
self.figheight = self.cell_height*self.y + self.marg_top + self.marg_bottom
self.draw_heatmap()
'''if self.sw:
self.figure = Figure(figsize=(self.figheight,self.figwidth))
else:
self.figure = Figure(figsize=(self.figwidth,self.figheight))'''
#self.canvas.setHidden(not self.canvas.isHidden())
#self.canvas = FigureCanvas(self.figure)
def draw_heatmap(self):
self.data = np.zeros([self.y,self.x])
self.ax.clear()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment