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
acf9f89a
Commit
acf9f89a
authored
Jan 31, 2019
by
Sascha Herzinger
Browse files
fixed flickering partially
parent
1f685112
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/charts/impl/Scatterplot.js
View file @
acf9f89a
...
...
@@ -2,7 +2,7 @@ import * as d3 from 'd3';
import
Chart
from
'
../Chart
'
;
import
'
../../assets/css/scatterplot.css
'
;
const
ANIMATION_DURATION
=
50
0
;
const
ANIMATION_DURATION
=
0
;
export
default
class
extends
Chart
{
constructor
({
container
})
{
...
...
@@ -66,6 +66,7 @@ export default class extends Chart {
categories
,
callback
,
_selectedCategory
,
_skipAnimation
})
{
this
.
values
=
typeof
values
===
'
undefined
'
?
this
.
values
:
values
;
this
.
categories
=
typeof
categories
===
'
undefined
'
?
this
.
categories
:
categories
;
...
...
@@ -258,9 +259,9 @@ ${!categoryKeys ? d[2] : this.categories[d[2]]}</br>
.
merge
(
legendElement
)
.
on
(
'
click
'
,
(
d
)
=>
{
if
(
d
===
_selectedCategory
)
{
this
.
render
({});
this
.
render
({
_skipAnimation
:
true
});
}
else
{
this
.
render
({
_selectedCategory
:
d
});
this
.
render
({
_selectedCategory
:
d
,
_skipAnimation
:
true
});
}
})
.
style
(
'
opacity
'
,
d
=>
((
typeof
_selectedCategory
===
'
undefined
'
||
d
===
_selectedCategory
)
?
1
:
0.3
));
...
...
@@ -303,7 +304,7 @@ ${!categoryKeys ? d[2] : this.categories[d[2]]}</br>
ctx
.
fill
();
});
},
0
);
if
(
elapsed
>
ANIMATION_DURATION
*
2
)
{
if
(
elapsed
>
ANIMATION_DURATION
*
2
||
_skipAnimation
)
{
t
.
stop
();
// draw tooltips once after animation is over
this
.
colorToTooltipMap
=
{};
...
...
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