diff --git a/src/App.js b/src/App.js index 3a514c9eb..6750f8ee3 100644 --- a/src/App.js +++ b/src/App.js @@ -364,19 +364,19 @@ class App extends Component {
- + Added - + Changed - + Removed diff --git a/src/features/visualization/d3-viz/setup-annotations.js b/src/features/visualization/d3-viz/setup-annotations.js index 91453b831..18dd07ba8 100644 --- a/src/features/visualization/d3-viz/setup-annotations.js +++ b/src/features/visualization/d3-viz/setup-annotations.js @@ -187,14 +187,22 @@ const setupAnnotations = ({packedData, annotationRoot}) =>{ const childGlyphs = selectAll(`g.${className("isAdded-fixed")}`) .filter((e) =>{ - const ancestors = e.ancestors(); - return ancestors.findIndex( a => datumKey(a) === dk) !== -1; + if(e){ + const ancestors = e.ancestors(); + return ancestors.findIndex( a => datumKey(a) === dk) !== -1; + } + else + return false; }); const added = selectAll(`g.${className("isAdded")}`) .filter((e) =>{ - const ancestors = e.ancestors(); - return ancestors.findIndex( a => datumKey(a) === dk) !== -1; + if(e){ + const ancestors = e.ancestors(); + return ancestors.findIndex( a => datumKey(a) === dk) !== -1; + } + else + return false; }); if(!added.empty()){ @@ -241,14 +249,22 @@ const setupAnnotations = ({packedData, annotationRoot}) =>{ const childGlyphs = selectAll(`g.${className("isChanged-fixed")}`) .filter((e) =>{ - const ancestors = e.ancestors(); - return ancestors.findIndex( a => datumKey(a) === dk) !== -1; + if(e){ + const ancestors = e.ancestors(); + return ancestors.findIndex( a => datumKey(a) === dk) !== -1; + } + else + return false; }); const changed = selectAll(`g.${className("isChanged")}`) .filter((e) =>{ - const ancestors = e.ancestors(); - return ancestors.findIndex( a => datumKey(a) === dk) !== -1; + if(e){ + const ancestors = e.ancestors(); + return ancestors.findIndex( a => datumKey(a) === dk) !== -1; + } + else + return false; }); if(!changed.empty()){ @@ -295,14 +311,22 @@ const setupAnnotations = ({packedData, annotationRoot}) =>{ const childGlyphs = selectAll(`g.${className("isRemoved-fixed")}`) .filter((e) =>{ - const ancestors = e.ancestors(); - return ancestors.findIndex( a => datumKey(a) === dk) !== -1; + if(e){ + const ancestors = e.ancestors(); + return ancestors.findIndex( a => datumKey(a) === dk) !== -1; + } + else + return false; }); const removed = selectAll(`g.${className("isRemoved")}`) .filter((e) =>{ - const ancestors = e.ancestors(); - return ancestors.findIndex( a => datumKey(a) === dk) !== -1; + if(e){ + const ancestors = e.ancestors(); + return ancestors.findIndex( a => datumKey(a) === dk) !== -1; + } + else + return false; }); if(!removed.empty()){