Reduce opacity of lines when in background
This commit is contained in:
parent
17539a5da4
commit
078094e779
|
@ -203,12 +203,12 @@ function createLineGraph(containerId, raceData){
|
||||||
function handleClickOnPoint(d,i){
|
function handleClickOnPoint(d,i){
|
||||||
//select elements that are highlightable but are not highlighted
|
//select elements that are highlightable but are not highlighted
|
||||||
d3.selectAll("[data-opacitychange='" + 1 +"'][data-highlighted='" + 0 +"']")
|
d3.selectAll("[data-opacitychange='" + 1 +"'][data-highlighted='" + 0 +"']")
|
||||||
.style("opacity", 0.3);
|
.style("opacity", 0.10);
|
||||||
|
|
||||||
// if clicked on already highlighted line, remove highlight
|
// if clicked on already highlighted line, remove highlight
|
||||||
if(this.getAttribute("data-highlighted") == 1){
|
if(this.getAttribute("data-highlighted") == 1){
|
||||||
d3.selectAll("[data-line='" + d.driverId +"'][data-opacitychange='" + 1 +"']")
|
d3.selectAll("[data-line='" + d.driverId +"'][data-opacitychange='" + 1 +"']")
|
||||||
.style("opacity", 0.3);
|
.style("opacity", 0.10);
|
||||||
|
|
||||||
d3.selectAll("[data-line='" + d.driverId +"']")
|
d3.selectAll("[data-line='" + d.driverId +"']")
|
||||||
.attr("data-highlighted", 0);
|
.attr("data-highlighted", 0);
|
||||||
|
|
Loading…
Reference in New Issue