Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
fix(Time Series): correctly styling child glyphs on click events
Browse files Browse the repository at this point in the history
  • Loading branch information
rashley-iqt committed Apr 12, 2019
1 parent a20465e commit 47377bc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/features/visualization/d3-viz/setup-annotations.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ const setupAnnotations = ({packedData, annotationRoot}) =>{
.select(`g.${className("isAdded-fixed")}`)
const showHide = glyph.classed(className("ringMenuExcluded"));

const childGlyphs = selectAll(`g.${className("isAdded-fixed")}`)
.filter((e) =>{
const ancestors = e.ancestors();
return ancestors.findIndex( a => datumKey(a) === dk) !== -1;
});

const added = selectAll(`g.${className("isAdded")}`)
.filter((e) =>{
const ancestors = e.ancestors();
Expand All @@ -192,6 +198,7 @@ const setupAnnotations = ({packedData, annotationRoot}) =>{

if(!added.empty()){
glyph.classed(className("ringMenuExcluded"), !showHide);
childGlyphs.classed(className("ringMenuExcluded"), !showHide);
added.classed(className("ringMenuExcluded"), !showHide);
}
}
Expand Down Expand Up @@ -231,6 +238,12 @@ const setupAnnotations = ({packedData, annotationRoot}) =>{
.select(`g.${className("isChanged-fixed")}`)
const showHide = glyph.classed(className("ringMenuExcluded"));

const childGlyphs = selectAll(`g.${className("isChanged-fixed")}`)
.filter((e) =>{
const ancestors = e.ancestors();
return ancestors.findIndex( a => datumKey(a) === dk) !== -1;
});

const changed = selectAll(`g.${className("isChanged")}`)
.filter((e) =>{
const ancestors = e.ancestors();
Expand All @@ -239,6 +252,7 @@ const setupAnnotations = ({packedData, annotationRoot}) =>{

if(!changed.empty()){
glyph.classed(className("ringMenuExcluded"), !showHide);
childGlyphs.classed(className("ringMenuExcluded"), !showHide);
changed.classed(className("ringMenuExcluded"), !showHide);
}
}
Expand Down Expand Up @@ -278,6 +292,12 @@ const setupAnnotations = ({packedData, annotationRoot}) =>{
.select(`g.${className("isRemoved-fixed")}`)
const showHide = glyph.classed(className("ringMenuExcluded"));

const childGlyphs = selectAll(`g.${className("isRemoved-fixed")}`)
.filter((e) =>{
const ancestors = e.ancestors();
return ancestors.findIndex( a => datumKey(a) === dk) !== -1;
});

const removed = selectAll(`g.${className("isRemoved")}`)
.filter((e) =>{
const ancestors = e.ancestors();
Expand All @@ -286,6 +306,7 @@ const setupAnnotations = ({packedData, annotationRoot}) =>{

if(!removed.empty()){
glyph.classed(className("ringMenuExcluded"), !showHide);
childGlyphs.classed(className("ringMenuExcluded"), !showHide);
removed.classed(className("ringMenuExcluded"), !showHide);
}
}
Expand Down

0 comments on commit 47377bc

Please sign in to comment.