@foodpilot/foods 2.7.7 → 2.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,7 @@ const LEGEND_GAP_SPACING_BOTTOM = 2;
22
22
  const HOVER_ANIMATION_DURATION = "0.2s";
23
23
  const SCALE_NORMAL = 1;
24
24
  const HOVER_OFFSET_DIVISOR = 100;
25
+ const CHART_TYPES_WITHOUT_LEGEND = ["table"];
25
26
  const PolymorphicChart = (props) => {
26
27
  const theme = useTheme();
27
28
  const {
@@ -59,6 +60,7 @@ const PolymorphicChart = (props) => {
59
60
  } = aggregation ?? {};
60
61
  const chartRef = useRef(null);
61
62
  const componentRef = useRef(null);
63
+ const shouldShowLegend = !CHART_TYPES_WITHOUT_LEGEND.includes(chartType);
62
64
  const language = i18next.language;
63
65
  const isMobile = useMediaQuery(theme.breakpoints.down("md"));
64
66
  const themePalette = extractPaletteFromTheme(theme, THEME_PALETTE_LIGHT, THEME_PALETTE_DARK);
@@ -282,7 +284,7 @@ const PolymorphicChart = (props) => {
282
284
  display: "flex",
283
285
  width: fullWidthLegend ? "100%" : "inherit",
284
286
  sx: { width: fullWidthLegend ? "100%" : "inherit", flex: 1 },
285
- children: effectiveLegend && (() => {
287
+ children: effectiveLegend && shouldShowLegend && (() => {
286
288
  const legendIndices = Array.from(effLabels.keys());
287
289
  const filteredIdx = aggregationApplicable && aggregateOn ? legendIndices.filter((i) => {
288
290
  const lbl = (effLabels[i] ?? "").trim();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foodpilot/foods",
3
3
  "private": false,
4
- "version": "2.7.7",
4
+ "version": "2.7.9",
5
5
  "type": "module",
6
6
  "main": "./dist/main.js",
7
7
  "module": "./dist/main.js",