Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SGS18-READEX
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Ondrej Vysocky
SGS18-READEX
Commits
bbe2f33a
Commit
bbe2f33a
authored
6 years ago
by
ulc0011
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Heatmap displays also key, displaying xLabel and funcLabel on click
#3
parent
7866c3d1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/heatmap.py
+31
-3
31 additions, 3 deletions
src/heatmap.py
with
31 additions
and
3 deletions
src/heatmap.py
+
31
−
3
View file @
bbe2f33a
...
...
@@ -88,6 +88,7 @@ class Window(QtWidgets.QDialog):
self
.
layout
=
QtWidgets
.
QVBoxLayout
()
self
.
plot_data
=
self
.
D
[
0
]
self
.
keyList
=
self
.
plot_data
[
1
][
"
config
"
][
2
:]
self
.
gl
=
QtWidgets
.
QGridLayout
()
...
...
@@ -153,7 +154,7 @@ class Window(QtWidgets.QDialog):
self
.
toolbar
=
NavigationToolbar
(
self
.
canvas
,
self
)
self
.
h2
=
QtWidgets
.
QHBoxLayout
()
self
.
l1
=
QtWidgets
.
QLabel
(
"
Indices of c
licked cell:
"
)
self
.
l1
=
QtWidgets
.
QLabel
(
"
C
licked cell
info
:
"
)
self
.
l1
.
setFont
(
self
.
bf
)
self
.
l2
=
QtWidgets
.
QLabel
(
"
Clicked cell value:
"
)
self
.
l2
.
setFont
(
self
.
bf
)
...
...
@@ -170,12 +171,18 @@ class Window(QtWidgets.QDialog):
#self.h3 = QtWidgets.QHBoxLayout()
self
.
nDecLabel
=
QtWidgets
.
QLabel
(
'
Number of decimals:
'
)
self
.
nDecLabel
.
setFont
(
self
.
bf
)
self
.
keyLab
=
QtWidgets
.
QLabel
(
"
Key:
"
)
self
.
keyLab
.
setFont
(
self
.
bf
)
self
.
keyLabVal
=
QtWidgets
.
QLabel
(
"
"
)
self
.
keyLabVal
.
setFont
(
self
.
nf
)
self
.
gl
.
addWidget
(
self
.
nDecLabel
,
self
.
tmp_idx
,
0
)
self
.
gl
.
addWidget
(
self
.
nDecimals
,
self
.
tmp_idx
,
1
)
self
.
gl
.
addWidget
(
self
.
multLab
,
self
.
tmp_idx
+
1
,
0
)
self
.
gl
.
addWidget
(
self
.
mult
,
self
.
tmp_idx
+
1
,
1
)
self
.
gl
.
addWidget
(
self
.
unitLab
,
self
.
tmp_idx
+
1
,
2
)
self
.
gl
.
addWidget
(
self
.
keyLab
,
self
.
tmp_idx
+
2
,
0
)
self
.
gl
.
addWidget
(
self
.
keyLabVal
,
self
.
tmp_idx
+
2
,
1
)
#self.h3.addWidget(QtWidgets.QLabel(' '))
self
.
gl
.
setVerticalSpacing
(
5
)
...
...
@@ -262,7 +269,11 @@ class Window(QtWidgets.QDialog):
tex_file
.
write
(
'''
\n
\end{document}
'''
)
tex_file
.
close
()
print
(
'
TeX file created
'
)
self
.
sendInfo
.
emit
({
'
quantity
'
:
str
(
self
.
combo
.
currentText
()),
'
region
'
:
str
(
self
.
combo_reg
.
currentText
())})
if
str
(
self
.
combo_reg
.
currentText
())
==
"
Overall summary
"
:
reg
=
list
(
self
.
d
[
'
config
'
][
'
main_reg
'
][
0
].
keys
())[
0
]
else
:
reg
=
str
(
self
.
combo_reg
.
currentText
())[
9
:]
self
.
sendInfo
.
emit
({
'
quantity
'
:
str
(
self
.
combo
.
currentText
()),
'
region
'
:
reg
})
...
...
@@ -279,6 +290,11 @@ class Window(QtWidgets.QDialog):
for
i
in
range
(
0
,
len
(
self
.
D
)):
if
str
(
self
.
combo
.
currentText
())
==
self
.
D
[
i
][
0
][
"
arg
"
]:
self
.
plot_data
=
self
.
D
[
i
]
if
dataLabel
==
"
Overall summary
"
:
self
.
keyList
=
self
.
plot_data
[
1
][
"
config
"
][
2
:]
else
:
self
.
keyList
=
self
.
plot_data
[
1
][
'
head_text_config
'
][
1
].
replace
(
'
\\
,
'
,
'
'
)
self
.
keyList
=
self
.
keyList
.
split
(
'
,
'
)[
2
:]
self
.
draw_heatmap
()
...
...
@@ -291,7 +307,9 @@ class Window(QtWidgets.QDialog):
idx
=
int
(
np
.
floor
(
event
.
xdata
))
idy
=
int
(
np
.
floor
(
event
.
ydata
))
#print('Indices and content of current cell [{},{}]: {}'.format(idy,idx,self.data[idy,idx]))
self
.
l3
.
setText
(
"
[{},{}]
"
.
format
(
idy
,
idx
))
self
.
l3
.
setText
(
"
{}: {} {}, {}: {} {}
"
.
format
(
self
.
plot_data
[
1
][
"
func_label_name
"
],
self
.
ky
[
idx
],
self
.
plot_data
[
1
][
"
func_label_unit
"
],
self
.
plot_data
[
1
][
"
x_label_name
"
],
list
(
self
.
k
)[
idy
],
self
.
plot_data
[
1
][
"
x_label_unit
"
]))
if
self
.
sw
:
self
.
l4
.
setText
(
str
(
self
.
numMult
*
self
.
data
[
idx
,
idy
]))
else
:
...
...
@@ -320,6 +338,16 @@ class Window(QtWidgets.QDialog):
self
.
k
=
self
.
plot_data
[
1
][
"
lines
"
]
self
.
ky
=
[
h
[
0
]
for
h
in
self
.
heat_data
[
0
]]
self
.
keyStr
=
"
None
"
for
i
in
range
(
len
(
self
.
keyList
)):
if
i
==
0
:
self
.
keyStr
=
""
self
.
keyStr
=
self
.
keyStr
+
self
.
keyList
[
i
].
replace
(
"
\\
,
"
,
"
"
)
if
i
<
len
(
self
.
keyList
)
-
1
:
self
.
keyStr
=
self
.
keyStr
+
"
,
"
self
.
keyLabVal
.
setText
(
self
.
keyStr
)
self
.
x
=
len
(
self
.
k
)
self
.
y
=
len
(
self
.
ky
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment