Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Use d3.group instead of nest, since it has been removed

Roland Geiderb8d7d33b38c2
diff --git a/wger/nutrition/static/js/nutrition.js b/wger/nutrition/static/js/nutrition.js
index 3a4ba488d..59f8cb6dd 100644
--- a/wger/nutrition/static/js/nutrition.js
+++ b/wger/nutrition/static/js/nutrition.js
@@ -168,16 +168,9 @@ function wgerRenderBodyMassIndex() {
'#800000']);
xAxis = d3.axisBottom(x);
-
yAxis = d3.axisLeft(y);
-
stack = d3.stack();
- nest = d3.nest()
- .key(function (d) {
- return d.key;
- });
-
area = d3.area()
.x(function (d) {
return x(d.height);
@@ -211,7 +204,7 @@ function wgerRenderBodyMassIndex() {
'pre_obese',
'obese_class_2',
'obese_class_3']);
- layers = stack(nest.entries(data));
+ layers = stack(d3.group(data, d => d.key));
// Manually set the domains
x.domain(data.map(function (d) {