Wolfram Language

Acesso mais produtivo à base de conhecimento

Visualize a nutrição em termos de valores diários recomendados

A Wolfram Knowledgebase não inclui apenas propriedades detalhadas e informação nutricional de mais de 37.000 entidades de "Food" e 1.000 de "FoodType", mas também dados de valores diários recomendados de 176 nutrientes. Juntos, esses grandes conjuntos de dados permitem praticamente que qualquer conteúdo nutricional seja explorado computacionalmente, e então de forma intuituva ser visulaizado usando um simples gráfico.

In[1]:=
Click for copyable input
EntityValue["Nutrient", "EntityCount"]
Out[1]=

Extraia uma lista de valores diários recomendados de nutrientes com base em uma dieta de 2000 calorias por dia.

In[2]:=
Click for copyable input
allDailyValues = Append[DeleteMissing[ EntityValue["Nutrient", "DailyValue", "EntityAssociation"]], Entity["Nutrient", "Energy"] -> Quantity[2000, ("LargeCalories")/("Days")]]*Quantity[1, "Days"]
In[3]:=
Click for copyable input
<|Entity["Nutrient", "Biotin"] -> Quantity[0.0003`, "Grams"], Entity["Nutrient", "Calcium"] -> Quantity[1.`, "Grams"], Entity["Nutrient", "Chloride"] -> Quantity[3.4`, "Grams"], Entity["Nutrient", "Cholesterol"] -> Quantity[0.3`, "Grams"], Entity["Nutrient", "Chromium"] -> Quantity[0.00012`, "Grams"], Entity["Nutrient", "Copper"] -> Quantity[0.002`, "Grams"], Entity["Nutrient", "FoodFolate"] -> Quantity[0.0004`, "Grams"], Entity["Nutrient", "Iodine"] -> Quantity[0.00015`, "Grams"], Entity["Nutrient", "Iron"] -> Quantity[0.018`, "Grams"], Entity["Nutrient", "Magnesium"] -> Quantity[0.4`, "Grams"], Entity["Nutrient", "Manganese"] -> Quantity[0.002`, "Grams"], Entity["Nutrient", "Molybdenum"] -> Quantity[0.000075`, "Grams"], Entity["Nutrient", "Niacin"] -> Quantity[0.02`, "Grams"], Entity["Nutrient", "PantothenicAcid"] -> Quantity[0.01`, "Grams"], Entity["Nutrient", "Phosphorus"] -> Quantity[1.`, "Grams"], Entity["Nutrient", "Potassium"] -> Quantity[3.5`, "Grams"], Entity["Nutrient", "Riboflavin"] -> Quantity[0.0017`, "Grams"], Entity["Nutrient", "Selenium"] -> Quantity[0.00007`, "Grams"], Entity["Nutrient", "Sodium"] -> Quantity[2.4`, "Grams"], Entity["Nutrient", "Thiamin"] -> Quantity[0.0015`, "Grams"], Entity["Nutrient", "TotalCarbohydrates"] -> Quantity[300, "Grams"], Entity["Nutrient", "TotalFat"] -> Quantity[65, "Grams"], Entity["Nutrient", "TotalFiber"] -> Quantity[25, "Grams"], Entity["Nutrient", "TotalProtein"] -> Quantity[50, "Grams"], Entity["Nutrient", "TotalSaturatedFat"] -> Quantity[20, "Grams"], Entity["Nutrient", "VitaminA"] -> Quantity[0.0015`, "Grams"], Entity["Nutrient", "VitaminB12"] -> Quantity[6.`*^-6, "Grams"], Entity["Nutrient", "VitaminB6"] -> Quantity[0.002`, "Grams"], Entity["Nutrient", "VitaminC"] -> Quantity[0.06`, "Grams"], Entity["Nutrient", "VitaminD"] -> Quantity[0.00001`, "Grams"], Entity["Nutrient", "VitaminE"] -> Quantity[0.0200999638200651`, "Grams"], Entity["Nutrient", "VitaminK"] -> Quantity[0.00008`, "Grams"], Entity["Nutrient", "Zinc"] -> Quantity[0.015`, "Grams"], Entity["Nutrient", "Energy"] -> Quantity[2000, "LargeCalories"]|>

Mapeie as propriedades dos alimentos com os nutrientes.

In[4]:=
Click for copyable input
propertyNutrientRules = {EntityProperty["Food", "AbsoluteSodiumContent"] -> Entity["Nutrient", "Sodium"], EntityProperty["Food", "AbsoluteTotalCarbohydratesContent"] -> Entity["Nutrient", "TotalCarbohydrates"], EntityProperty["Food", "AbsoluteTotalFatContent"] -> Entity["Nutrient", "TotalFat"], EntityProperty["Food", "AbsoluteTotalFiberContent"] -> Entity["Nutrient", "TotalFiber"], EntityProperty["Food", "AbsoluteIronContent"] -> Entity["Nutrient", "Iron"], EntityProperty["Food", "AbsoluteTotalCaloriesContent"] -> Entity["Nutrient", "Energy"]};

Codifique um café da manhã simples usando EntityGroup e EntityInstance.

In[5]:=
Click for copyable input
breakfast = EntityGroup[{ EntityInstance[Entity[ "Food", { EntityProperty["Food", "CookingMethod"] -> Entity[ "CookingMethod", "HardBoiled"], EntityProperty["Food", "FoodType"] -> ContainsExactly[{ Entity["FoodType", "Egg"]}], EntityProperty[ "Food", "AddedFoodTypes"] -> ContainsExactly[{}]}], Quantity[2, "Servings"]], EntityInstance[Entity[ "Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{ Entity["FoodType", "Bacon"]}], EntityProperty[ "Food", "AddedFoodTypes"] -> ContainsExactly[{}]}], Quantity[3, "Slices"]], EntityInstance[Entity[ "Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{ Entity["FoodType", "HashBrown"]}], EntityProperty[ "Food", "AddedFoodTypes"] -> ContainsExactly[{}]}], Quantity[1, "Servings"]], EntityInstance[Entity[ "Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{ Entity["FoodType", "OrangeJuice"]}], EntityProperty[ "Food", "AddedFoodTypes"] -> ContainsExactly[{}]}], Quantity[2, "Servings"]] }];

Construa um "gráfico bússola" mostrando hexágonos radialmente agrupados indicando 50%, 100% (marcados em verde), e 150% dos valores diários recomendados para seis nutrientes principais.

mostre o input completo da Wolfram Language
In[6]:=
Click for copyable input
compassPlot[ent : _EntityGroup | {__EntityGroup}, opts : OptionsPattern[Graphics]] := Module[{data, n, circlePoints, dailyValues, scaledData, coordinates, fillStyle, opacityStyle, pointStyle, labelCoordPairs, missingPositions, rMax}, (* Get data, total up nutrients *) data = EntityValue[ Replace[ent, eg_EntityGroup :> {eg}], {EntityProperty["Food", "AbsoluteTotalCarbohydratesContent"], EntityProperty["Food", "AbsoluteTotalFatContent"], EntityProperty["Food", "AbsoluteSodiumContent"], EntityProperty["Food", "AbsoluteTotalFiberContent"], EntityProperty["Food", "AbsoluteIronContent"], EntityProperty["Food", "AbsoluteTotalCaloriesContent"]}, "PropertyAssociation" ]; data = Merge[data, Total]; (* Get DailyValues, scale data to DailyValues *) dailyValues = Keys[data] /. propertyNutrientRules /. allDailyValues; scaledData = 100*AssociationThread[ Keys[data], (Values[data]/dailyValues) /. {_Missing -> Quantity[0, "Grams"]}]; (* Compute the coordinates for each of the points *) n = Length[data]; circlePoints = CirclePoints[n]; missingPositions = Cases[MapIndexed[If[Not[FreeQ[#, _Missing]], #2] &, Values[data]], _Integer, Infinity]; coordinates = Normal@AssociationThread[Keys[scaledData], circlePoints*Values[scaledData]]; (* Precompute the label-coordinate pairs *) labelCoordPairs = Thread[Keys[data] -> circlePoints] /. {_Missing -> Quantity[0, "Grams"]}; fillStyle = Opacity[0.5, Black]; opacityStyle = Opacity[0.01, Black]; pointStyle = Blue; rMax = 150; (* Create the plot *) Graphics[{ (* Add lines from the center outwards to indicate "axes" for the \ nutrients *) {Thin, Opacity[0.75], Gray, Dashed, Line[{{0, 0}, #}]} & /@ (rMax*circlePoints), (* For each position, draw a triangle and a line (taking missing values into account) *) MapIndexed[ With[{currentPosition = First[#2], nextPosition = Replace[First[#2] + 1, (n + 1) -> 1]}, { (* For each position, draw a triangle (origin -> point -> next point) *) { fillStyle, EdgeForm[], Polygon[ {{0, 0}, coordinates[[currentPosition, 2]], coordinates[[nextPosition, 2]]}, VertexColors -> { fillStyle, If[MemberQ[missingPositions, currentPosition], opacityStyle, fillStyle], If[MemberQ[missingPositions, nextPosition], opacityStyle, fillStyle] } ] // If[MemberQ[missingPositions, nextPosition | currentPosition], Tooltip[#, Missing["NotAvailable"]] &, Identity] }, (* Connect two points if neither of them are missing data *) If[ FreeQ[missingPositions, nextPosition | currentPosition], {Thickness[0.0033], Gray, Line[{coordinates[[currentPosition, 2]], coordinates[[nextPosition, 2]]}]} ] } ] &, coordinates[[;; -1, -1]]], (* For each non-missing position, put a small point *) { pointStyle, PointSize[0.0100], Tooltip[Point[coordinates[[#, 2]]], Grid[{{ToString[ Round[100*(data[[#]]/dailyValues[[#]]), 0.1]] <> " %", "", coordinates[[#, 1]]}, {data[[#]], "of", dailyValues[[#]]}}]] } & /@ Complement[Range[n], Flatten[missingPositions]], (* Radially nested polygons to indicate 50%, 100%, 150%, etc... of DV *) Table[ {Thin, Opacity[0.75], Sequence @@ If[r === 100, {Thick, Darker@Green}, {Gray, Dashed}], Tooltip[Line[r*Join[circlePoints, circlePoints[[;; 1]]]], ToString[r] <> "%"]}, {r, 50, rMax, 50}], (* Label the axes afterwards so that they aren't covered/ unreadable *) {Text[ Style[StringTrim@ StringReplace[ EntityValue[#1, "Description"], ("absolute" | "content") -> ""]], (rMax*1.175)*#2]} & @@@ labelCoordPairs }, opts ] ]
In[7]:=
Click for copyable input
$Failed
In[8]:=
Click for copyable input
$Failed
In[9]:=
Click for copyable input
\!\(\* GraphicsBox[{{ {GrayLevel[0.5], Thickness[Tiny], Opacity[0.75], Dashing[{Small, Small}], LineBox[NCache[{{0, 0}, {75, (-75) 3^Rational[1, 2]}}, {{0, 0}, {75, -129.9038105676658}}]]}, {GrayLevel[0.5], Thickness[Tiny], Opacity[0.75], Dashing[{Small, Small}], LineBox[{{0, 0}, {150, 0}}]}, {GrayLevel[0.5], Thickness[Tiny], Opacity[0.75], Dashing[{Small, Small}], LineBox[NCache[{{0, 0}, {75, 75 3^Rational[1, 2]}}, {{0, 0}, { 75, 129.9038105676658}}]]}, {GrayLevel[0.5], Thickness[Tiny], Opacity[0.75], Dashing[{Small, Small}], LineBox[NCache[{{0, 0}, {-75, 75 3^Rational[1, 2]}}, {{0, 0}, {-75, 129.9038105676658}}]]}, {GrayLevel[0.5], Thickness[Tiny], Opacity[0.75], Dashing[{Small, Small}], LineBox[{{0, 0}, {-150, 0}}]}, {GrayLevel[0.5], Thickness[Tiny], Opacity[0.75], Dashing[{Small, Small}], LineBox[NCache[{{0, 0}, {-75, (-75) 3^Rational[1, 2]}}, {{0, 0}, {-75, -129.9038105676658}}]]}}, {{ {GrayLevel[0], Opacity[0.5], EdgeForm[None], PolygonBox[{{0, 0}, { 12.862333333333334`, -22.278214837220087`}, { 69.05377945054944, 0.}}, VertexColors->{ Opacity[0.5, GrayLevel[0]], Opacity[0.5, GrayLevel[0]], Opacity[0.5, GrayLevel[0]]}]}, {GrayLevel[0.5], Thickness[0.0033], LineBox[{{12.862333333333334`, -22.278214837220087`}, { 69.05377945054944, 0.}}]}}, { {GrayLevel[0], Opacity[0.5], EdgeForm[None], PolygonBox[{{0, 0}, {69.05377945054944, 0.}, { 19.053369791666668`, 33.0014045345647}}, VertexColors->{ Opacity[0.5, GrayLevel[0]], Opacity[0.5, GrayLevel[0]], Opacity[0.5, GrayLevel[0]]}]}, {GrayLevel[0.5], Thickness[0.0033], LineBox[{{69.05377945054944, 0.}, {19.053369791666668`, 33.0014045345647}}]}}, { {GrayLevel[0], Opacity[0.5], EdgeForm[None], PolygonBox[{{0, 0}, {19.053369791666668`, 33.0014045345647}, {-6.9879999999999995`, 12.103571043291312`}}, VertexColors->{ Opacity[0.5, GrayLevel[0]], Opacity[0.5, GrayLevel[0]], Opacity[0.5, GrayLevel[0]]}]}, {GrayLevel[0.5], Thickness[0.0033], LineBox[{{19.053369791666668`, 33.0014045345647}, {-6.9879999999999995`, 12.103571043291312`}}]}}, { {GrayLevel[0], Opacity[0.5], EdgeForm[None], PolygonBox[{{0, 0}, {-6.9879999999999995`, 12.103571043291312`}, {-26.52083333333334, 0.}}, VertexColors->{ Opacity[0.5, GrayLevel[0]], Opacity[0.5, GrayLevel[0]], Opacity[0.5, GrayLevel[0]]}]}, {GrayLevel[0.5], Thickness[0.0033], LineBox[{{-6.9879999999999995`, 12.103571043291312`}, {-26.52083333333334, 0.}}]}}, { {GrayLevel[0], Opacity[0.5], EdgeForm[None], PolygonBox[{{0, 0}, {-26.52083333333334, 0.}, {-23.22964375, -40.23492321672482}}, VertexColors->{ Opacity[0.5, GrayLevel[0]], Opacity[0.5, GrayLevel[0]], Opacity[0.5, GrayLevel[0]]}]}, {GrayLevel[0.5], Thickness[0.0033], LineBox[{{-26.52083333333334, 0.}, {-23.22964375, -40.23492321672482}}]}}, { {GrayLevel[0], Opacity[0.5], EdgeForm[None], PolygonBox[{{0, 0}, {-23.22964375, -40.23492321672482}, { 12.862333333333334`, -22.278214837220087`}}, VertexColors->{ Opacity[0.5, GrayLevel[0]], Opacity[0.5, GrayLevel[0]], Opacity[0.5, GrayLevel[0]]}]}, {GrayLevel[0.5], Thickness[0.0033], LineBox[{{-23.22964375, -40.23492321672482}, { 12.862333333333334`, -22.278214837220087`}}]}}}, { {RGBColor[0, 0, 1], PointSize[0.01], TagBox[ TooltipBox[PointBox[{12.862333333333334`, -22.278214837220087`}], TagBox[ GridBox[{{"\"25.7 %\"", "\"\"", TemplateBox[{"\"absolute carbohydrate content\"", RowBox[{"EntityProperty", "[", RowBox[{"\"Food\"", ",", "\"AbsoluteTotalCarbohydratesContent\""}], "]"}], "\"EntityProperty[\\\"Food\\\", \ \\\"AbsoluteTotalCarbohydratesContent\\\"]\""}, "EntityProperty"]}, { TemplateBox[{"77.174`", "\"g\"", "grams", "\"Grams\""}, "Quantity", SyntaxForm -> Mod], "\"of\"", TemplateBox[{"300", "\"g\"", "grams", "\"Grams\""}, "Quantity", SyntaxForm -> Mod]}}, AutoDelete -> False, GridBoxItemSize -> { "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], "Grid"]], Annotation[#, Grid[{{"25.7 %", "", EntityProperty["Food", "AbsoluteTotalCarbohydratesContent"]}, { Quantity[77.174, "Grams"], "of", Quantity[300, "Grams"]}}], "Tooltip"]& ]}, {RGBColor[0, 0, 1], PointSize[0.01], TagBox[ TooltipBox[PointBox[{69.05377945054944, 0.}], TagBox[ GridBox[{{"\"69.1 %\"", "\"\"", TemplateBox[{"\"absolute fat content\"", RowBox[{"EntityProperty", "[", RowBox[{"\"Food\"", ",", "\"AbsoluteTotalFatContent\""}], "]"}], "\"EntityProperty[\\\"Food\\\", \ \\\"AbsoluteTotalFatContent\\\"]\""}, "EntityProperty"]}, { TemplateBox[{"44.88495664285714`", "\"g\"", "grams", "\"Grams\""}, "Quantity", SyntaxForm -> Mod], "\"of\"", TemplateBox[{"65", "\"g\"", "grams", "\"Grams\""}, "Quantity", SyntaxForm -> Mod]}}, AutoDelete -> False, GridBoxItemSize -> { "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], "Grid"]], Annotation[#, Grid[{{"69.1 %", "", EntityProperty["Food", "AbsoluteTotalFatContent"]}, { Quantity[44.88495664285714, "Grams"], "of", Quantity[65, "Grams"]}}], "Tooltip"]& ]}, {RGBColor[0, 0, 1], PointSize[0.01], TagBox[ TooltipBox[PointBox[{19.053369791666668`, 33.0014045345647}], TagBox[ GridBox[{{"\"38.1 %\"", "\"\"", TemplateBox[{"\"absolute sodium content\"", RowBox[{"EntityProperty", "[", RowBox[{"\"Food\"", ",", "\"AbsoluteSodiumContent\""}], "]"}], "\"EntityProperty[\\\"Food\\\", \ \\\"AbsoluteSodiumContent\\\"]\""}, "EntityProperty"]}, { TemplateBox[{ "914.5617500000001`", "\"mg\"", "milligrams", "\"Milligrams\""}, "Quantity", SyntaxForm -> Mod], "\"of\"", TemplateBox[{"2.4`", "\"g\"", "grams", "\"Grams\""}, "Quantity", SyntaxForm -> Mod]}}, AutoDelete -> False, GridBoxItemSize -> { "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], "Grid"]], Annotation[#, Grid[{{"38.1 %", "", EntityProperty["Food", "AbsoluteSodiumContent"]}, { Quantity[914.5617500000001, "Milligrams"], "of", Quantity[2.4, "Grams"]}}], "Tooltip"]& ]}, {RGBColor[0, 0, 1], PointSize[0.01], TagBox[ TooltipBox[PointBox[{-6.9879999999999995`, 12.103571043291312`}], TagBox[ GridBox[{{"\"14. %\"", "\"\"", TemplateBox[{"\"absolute fiber content\"", RowBox[{"EntityProperty", "[", RowBox[{"\"Food\"", ",", "\"AbsoluteTotalFiberContent\""}], "]"}], "\"EntityProperty[\\\"Food\\\", \ \\\"AbsoluteTotalFiberContent\\\"]\""}, "EntityProperty"]}, { TemplateBox[{"3.4939999999999998`", "\"g\"", "grams", "\"Grams\""}, "Quantity", SyntaxForm -> Mod], "\"of\"", TemplateBox[{"25", "\"g\"", "grams", "\"Grams\""}, "Quantity", SyntaxForm -> Mod]}}, AutoDelete -> False, GridBoxItemSize -> { "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], "Grid"]], Annotation[#, Grid[{{"14. %", "", EntityProperty["Food", "AbsoluteTotalFiberContent"]}, { Quantity[3.4939999999999998`, "Grams"], "of", Quantity[25, "Grams"]}}], "Tooltip"]& ]}, {RGBColor[0, 0, 1], PointSize[0.01], TagBox[ TooltipBox[PointBox[{-26.52083333333334, 0.}], TagBox[ GridBox[{{"\"26.5 %\"", "\"\"", TemplateBox[{"\"absolute iron content\"", RowBox[{"EntityProperty", "[", RowBox[{"\"Food\"", ",", "\"AbsoluteIronContent\""}], "]"}], "\"EntityProperty[\\\"Food\\\", \\\"AbsoluteIronContent\ \\\"]\""}, "EntityProperty"]}, { TemplateBox[{ "4.773750000000001`", "\"mg\"", "milligrams", "\"Milligrams\""}, "Quantity", SyntaxForm -> Mod], "\"of\"", TemplateBox[{"0.018`", "\"g\"", "grams", "\"Grams\""}, "Quantity", SyntaxForm -> Mod]}}, AutoDelete -> False, GridBoxItemSize -> { "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], "Grid"]], Annotation[#, Grid[{{"26.5 %", "", EntityProperty["Food", "AbsoluteIronContent"]}, { Quantity[4.773750000000001, "Milligrams"], "of", Quantity[0.018, "Grams"]}}], "Tooltip"]& ]}, {RGBColor[0, 0, 1], PointSize[0.01], TagBox[ TooltipBox[PointBox[{-23.22964375, -40.23492321672482}], TagBox[ GridBox[{{"\"46.5 %\"", "\"\"", TemplateBox[{"\"absolute calorie content\"", RowBox[{"EntityProperty", "[", RowBox[{"\"Food\"", ",", "\"AbsoluteTotalCaloriesContent\""}], "]"}], "\"EntityProperty[\\\"Food\\\", \ \\\"AbsoluteTotalCaloriesContent\\\"]\""}, "EntityProperty"]}, { TemplateBox[{ "929.18575`", "\"Cal\"", "dietary Calories", "\"LargeCalories\""}, "Quantity", SyntaxForm -> Mod], "\"of\"", TemplateBox[{ "2000", "\"Cal\"", "dietary Calories", "\"LargeCalories\""}, "Quantity", SyntaxForm -> Mod]}}, AutoDelete -> False, GridBoxItemSize -> { "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], "Grid"]], Annotation[#, Grid[{{"46.5 %", "", EntityProperty["Food", "AbsoluteTotalCaloriesContent"]}, { Quantity[929.18575, "LargeCalories"], "of", Quantity[2000, "LargeCalories"]}}], "Tooltip"]& ]}}, { {GrayLevel[0.5], Thickness[Tiny], Opacity[0.75], Dashing[{Small, Small}], TagBox[ TooltipBox[ LineBox[NCache[{{25, (-25) 3^Rational[1, 2]}, {50, 0}, { 25, 25 3^Rational[1, 2]}, {-25, 25 3^Rational[1, 2]}, {-50, 0}, {-25, (-25) 3^Rational[1, 2]}, { 25, (-25) 3^Rational[1, 2]}}, {{25, -43.30127018922193}, { 50, 0}, { 25, 43.30127018922193}, {-25, 43.30127018922193}, {-50, 0}, {-25, -43.30127018922193}, {25, -43.30127018922193}}]], "\"50%\"", TooltipStyle->"TextStyling"], Annotation[#, "50%", "Tooltip"]& ]}, {RGBColor[0, NCache[ Rational[2, 3], 0.6666666666666666], 0], Thickness[Large], Opacity[ 0.75], TagBox[ TooltipBox[ LineBox[NCache[{{50, (-50) 3^Rational[1, 2]}, {100, 0}, { 50, 50 3^Rational[1, 2]}, {-50, 50 3^Rational[1, 2]}, {-100, 0}, {-50, (-50) 3^Rational[1, 2]}, { 50, (-50) 3^Rational[1, 2]}}, {{50, -86.60254037844386}, { 100, 0}, { 50, 86.60254037844386}, {-50, 86.60254037844386}, {-100, 0}, {-50, -86.60254037844386}, {50, -86.60254037844386}}]], "\"100%\"", TooltipStyle->"TextStyling"], Annotation[#, "100%", "Tooltip"]& ]}, {GrayLevel[0.5], Thickness[Tiny], Opacity[0.75], Dashing[{Small, Small}], TagBox[ TooltipBox[ LineBox[NCache[{{75, (-75) 3^Rational[1, 2]}, {150, 0}, { 75, 75 3^Rational[1, 2]}, {-75, 75 3^Rational[1, 2]}, {-150, 0}, {-75, (-75) 3^Rational[1, 2]}, { 75, (-75) 3^Rational[1, 2]}}, {{75, -129.9038105676658}, { 150, 0}, { 75, 129.9038105676658}, {-75, 129.9038105676658}, {-150, 0}, {-75, -129.9038105676658}, {75, -129.9038105676658}}]], "\"150%\"", TooltipStyle->"TextStyling"], Annotation[#, "150%", "Tooltip"]& ]}}, { InsetBox["\<\"carbohydrate\"\>", {88.125, -152.6369774170073}], InsetBox["\<\"fat\"\>", {176.25, 0.}], InsetBox["\<\"sodium\"\>", {88.125, 152.6369774170073}], InsetBox["\<\"fiber\"\>", {-88.125, 152.6369774170073}], InsetBox["\<\"iron\"\>", {-176.25, 0.}], InsetBox["\<\"calorie\"\>", {-88.125, -152.6369774170073}]}}]\)

Especifique almoço e jantar além de café da manhã.

In[10]:=
Click for copyable input
lunch = EntityGroup[{ EntityInstance[Entity[ "Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{ Entity["FoodType", "PeanutButter"]}], EntityProperty[ "Food", "AddedFoodTypes"] -> ContainsExactly[{}]}], Quantity[2, "Tablespoons"]], EntityInstance[Entity[ "Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{ Entity["FoodType", "Bread"]}], EntityProperty[ "Food", "AddedFoodTypes"] -> ContainsExactly[{}]}], Quantity[2, "Slices"]], EntityInstance[Entity[ "Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{ Entity["FoodType", "Jelly"]}], EntityProperty[ "Food", "AddedFoodTypes"] -> ContainsExactly[{}]}], Quantity[1, "Servings"]] }];
In[11]:=
Click for copyable input
dinner = EntityGroup[{ EntityInstance[Entity[ "Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{ Entity["FoodType", "Spaghetti"]}], EntityProperty[ "Food", "AddedFoodTypes"] -> ContainsExactly[{}]}], Quantity[1, "Servings"]], EntityInstance[Entity[ "Food", {EntityProperty["Food", "FoodType"] -> ContainsExactly[{ Entity["FoodType", "Meatball"]}], EntityProperty[ "Food", "AddedFoodTypes"] -> ContainsExactly[{}]}], Quantity[3, "Items"]], EntityInstance[Entity[ "Food", { EntityProperty["Food", "BrandName"] -> Entity[ "FoodBrandName", "Bertolli"], EntityProperty["Food", "FoodType"] -> ContainsExactly[{ Entity["FoodType", "Sauce"]}], EntityProperty[ "Food", "AddedFoodTypes"] -> ContainsExactly[{}]}], Quantity[1.5, "Servings"]], EntityInstance[Entity[ "Food", { EntityProperty["Food", "Flavor"] -> Entity[ "FoodFlavor", "Cola"], EntityProperty["Food", "FoodType"] -> ContainsExactly[{ Entity["FoodType", "CarbonatedBeverage"]}], EntityProperty[ "Food", "AddedFoodTypes"] -> ContainsExactly[{}]}], Quantity[1, "USSodaCanVolumes"]] }];

Visualize a cobertura nutricional adicional após cada refeição.

mostre o input completo da Wolfram Language
In[12]:=
Click for copyable input
Grid[Partition[ MapThread[ compassPlot[#1, PlotLabel -> #2] &, {Rest[ FoldList[ Append, {}, {breakfast, lunch, dinner}]], {"After Breakfast", "After Lunch", "After Dinner"}}], UpTo[2]]]
Out[12]=

Exemplos Relacionados

de en es ja ko ru zh