Added componentDidMount heatmap initializer

This commit is contained in:
2020-11-18 12:35:33 +01:00
parent 39a38fe8eb
commit 181985859e
2 changed files with 14 additions and 1 deletions

View File

@ -42,7 +42,14 @@ export default class MapContainer extends Component {
componentDidMount() {
this.context.addHandler(C.probability_method_name, this.probabilityHandler);
this.setState({ heatmapPoints: [...this.context.heatmapPoints] });
const newPoints = [];
for (var p of this.context.heatmapPoints) {
if (p.prob > 0.5) {
newPoints.push(p)
}
}
this.setState({ heatmapPoints: newPoints });
}
componentWillUnmount() {