nutritionix / nutrition-label

Create a FDA-style nutrition label with any nutrition data source (even the Nutritionix API - http://www.nutritionix.com/api)
http://www.nutritionix.com/
MIT License
176 stars 66 forks source link

add a new setting for the 2018 label to allow to only show the textServingSize #123

Closed majin22 closed 4 years ago

majin22 commented 4 years ago

related to #122 where the aim is to show the label with the 9.3 (valueServingUnitQuantity)

one one of the demo (will be added after task #121 is done), there is an extra serving unit quantity value when this code is used


$('#test7').nutritionLabel({
showServingUnitQuantityTextbox : false,
showServingWeightGrams : false,
showIngredients : false,
showServingsPerContainer : false,
showItemName : false,
showServingUnitQuantity : false,
showOnlyTheTextServingSize: true,
textServingSize : 'Serving Size 6.96 10-inch pizza (3.7819<span aria-hidden="true">g</span><span class="sr-only"> grams</span>)',
valueServingUnitQuantity : 9.3, //should not appear on the label, see https://github.com/nutritionix/nutrition-label/issues/122

valueCalories : 400,
valueFatCalories : 220,
valueTotalFat : 24,
valueSatFat : 15,
valueCholesterol : 25,
valueSodium : 430,
valueTotalCarb : 44,
valueSugars : 24,
valueProteins : 4,
valueVitaminD : 12.22,
valuePotassium_2018 : 4.22,
valueCalcium : 7.22,
valueIron : 11.22,
showLegacyVersion : false

});


> 
> ![2018 Version Demo Page](https://user-images.githubusercontent.com/271582/73805406-90385700-4801-11ea-86ec-807bd1dc1185.png)