Skip to content

Commit

Permalink
feat: gray out non-matches when searching
Browse files Browse the repository at this point in the history
This PR reduces the saturation (from 60 to 10) for non-matches.

Fixes #553
  • Loading branch information
starpit committed Feb 2, 2023
1 parent 3893041 commit 0ee0c48
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions client/components/Treemap.jsx
Expand Up @@ -22,11 +22,7 @@ export default class Treemap extends Component {
dataObject: this.getTreemapDataObject(nextProps.data)
});
} else if (nextProps.highlightGroups !== this.props.highlightGroups) {
const groupsToRedraw = [
...nextProps.highlightGroups,
...this.props.highlightGroups
];
setTimeout(() => this.treemap.redraw(false, groupsToRedraw));
setTimeout(() => this.treemap.redraw());
}
}

Expand Down Expand Up @@ -102,6 +98,11 @@ export default class Treemap extends Component {
b: 0,
a: 0.8
};
} else if (highlightGroups && highlightGroups.size > 0) {
// this means a search (e.g.) is active, but this module
// does not match; gray it out
// https://github.com/webpack-contrib/webpack-bundle-analyzer/issues/553
variables.groupColor.s = 10;
}
},
/**
Expand Down

0 comments on commit 0ee0c48

Please sign in to comment.