Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sascha Herzinger
AdaCharts
Commits
21dc9c41
Commit
21dc9c41
authored
Dec 06, 2018
by
Sascha Herzinger
Browse files
fixed hl issue when leaving canvas
parent
45ca93c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/charts/impl/Heatmap.js
View file @
21dc9c41
...
...
@@ -5,8 +5,8 @@ import '../../assets/css/heatmap.css';
const
ANIMATION_DURATION
=
1000
;
const
W
=
2
000
;
const
H
=
2
000
;
const
W
=
1
000
;
const
H
=
1
000
;
const
margin
=
{
top
:
H
/
10
,
...
...
@@ -212,10 +212,6 @@ export default class extends Chart {
}
highlight
({
row
,
col
})
{
// FIXME: this could be made faster by building an index
const
hoveredData
=
this
.
memory
.
selectAll
(
'
rect
'
)
.
filter
(
d
=>
d
.
row
===
row
&&
d
.
col
===
col
).
data
()[
0
];
this
.
horiHL
.
style
(
'
visibility
'
,
typeof
row
===
'
undefined
'
?
'
hidden
'
:
'
visible
'
)
.
style
(
'
top
'
,
`
${
this
.
yScale
(
row
)
+
margin
.
top
}
px`
);
...
...
@@ -225,12 +221,19 @@ export default class extends Chart {
this
.
tooltip
.
style
(
'
visibility
'
,
(
typeof
row
===
'
undefined
'
&&
typeof
row
===
'
undefined
'
)
?
'
hidden
'
:
'
visible
'
)
.
style
(
'
left
'
,
`
${
this
.
xScale
(
col
)
+
margin
.
left
+
this
.
xScale
.
bandwidth
()}
px`
)
.
style
(
'
top
'
,
`
${
this
.
yScale
(
row
)
+
margin
.
top
+
this
.
yScale
.
bandwidth
()}
px`
)
.
html
(()
=>
`
.
style
(
'
top
'
,
`
${
this
.
yScale
(
row
)
+
margin
.
top
+
this
.
yScale
.
bandwidth
()}
px`
);
if
(
typeof
row
!==
'
undefined
'
&&
typeof
col
!==
'
undefined
'
)
{
// FIXME: this could be made faster by building an index
const
hoveredData
=
this
.
memory
.
selectAll
(
'
rect
'
)
.
filter
(
d
=>
d
.
row
===
row
&&
d
.
col
===
col
).
data
()[
0
];
this
.
tooltip
.
html
(()
=>
`
Value
${
hoveredData
.
value
}
</br>
Row
${
row
}
</br>
Col
${
col
}
</br>
`
);
}
this
.
svg
.
selectAll
(
'
text.ac-row-label
'
)
.
classed
(
'
highlight
'
,
false
)
.
filter
(
d
=>
d
===
row
&&
typeof
row
!==
'
undefined
'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment