[Web] fix TypeError in Heatmap calculation