@marimo-team/frontend 0.22.1-dev8 → 0.22.1-dev9

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.
Files changed (28) hide show
  1. package/dist/assets/{ConnectedDataExplorerComponent-BhOfvmd2.js → ConnectedDataExplorerComponent-Bgd8MpO7.js} +1 -1
  2. package/dist/assets/{JsonOutput-DiKJplwR.js → JsonOutput-B5gVaor1.js} +1 -1
  3. package/dist/assets/{add-connection-dialog-BG5MyoeX.js → add-connection-dialog-rcpXb2Qg.js} +1 -1
  4. package/dist/assets/{agent-panel-CND7C-iU.js → agent-panel-DV6YglYM.js} +1 -1
  5. package/dist/assets/{cell-editor-CwiMG3ec.js → cell-editor-DGdVSm8g.js} +1 -1
  6. package/dist/assets/{column-preview-DuaRRihv.js → column-preview-DzVgkEwb.js} +1 -1
  7. package/dist/assets/{command-palette-rRLuA_TQ.js → command-palette-jsUKdXe9.js} +1 -1
  8. package/dist/assets/{edit-page-DlOE_eNk.js → edit-page-BtbZ-agq.js} +3 -3
  9. package/dist/assets/{file-explorer-panel-xbl6tMMi.js → file-explorer-panel-Dj5UWchN.js} +1 -1
  10. package/dist/assets/{form-BQ3vTb1b.js → form-B20VRSP2.js} +1 -1
  11. package/dist/assets/{formats-C_TavbEL.js → formats-N7VZhahg.js} +1 -1
  12. package/dist/assets/{hooks-BYhfK27L.js → hooks-CdA_QjCf.js} +1 -1
  13. package/dist/assets/{index-qjvWzbH2.css → index-CEEbZ31_.css} +1 -1
  14. package/dist/assets/{index-BABbKUpv.js → index-D4Ti6NeW.js} +5 -5
  15. package/dist/assets/{layout-Dzf_yrNt.js → layout-Cj6tuX2_.js} +1 -1
  16. package/dist/assets/{panels-UI7aIWgn.js → panels--RsDtdC1.js} +1 -1
  17. package/dist/assets/{run-page-v-1BqfNl.js → run-page-Burco7cL.js} +1 -1
  18. package/dist/assets/{scratchpad-panel-CHxQ_DzV.js → scratchpad-panel-CJhjbe49.js} +1 -1
  19. package/dist/assets/{session-panel-ClRl_dNb.js → session-panel-CuDkoD_I.js} +1 -1
  20. package/dist/assets/{state-CW8RjcVC.js → state-CUXzbab2.js} +1 -1
  21. package/dist/assets/{useNotebookActions--HXlwpwM.js → useNotebookActions-hwrgEm82.js} +1 -1
  22. package/dist/assets/{utils-BDlGlVyF.js → utils-DWFl4LEP.js} +3 -3
  23. package/dist/assets/{vega-component-DiFt6ZG4.js → vega-component-BAuy1PqH.js} +1 -1
  24. package/dist/index.html +8 -8
  25. package/package.json +1 -1
  26. package/src/plugins/impl/vega/__tests__/utils.test.ts +68 -0
  27. package/src/plugins/impl/vega/utils.ts +14 -5
  28. package/src/plugins/impl/vega/vega.css +2 -1
@@ -6,13 +6,22 @@ import type { DataType, FieldTypes, VegaDataType } from "./vega-loader";
6
6
  export type ContainerWidth = number | "container";
7
7
 
8
8
  /**
9
- * Get the container width from a VegaLite spec.
10
- * @param spec - The VegaLite spec.
11
- * @returns The container width.
9
+ * Get the container width from a Vega-Lite spec.
10
+ *
11
+ * For unit specs, `width` is at the top level. For facet/repeat specs,
12
+ * `width` is nested inside `spec`. This does not handle hconcat/vconcat and Vega spec
13
+ * where the width may be a signal. These cases are covered by
14
+ * the CSS fallback `.vega-embed:has(> .chart-wrapper.fit-x)`.
12
15
  */
13
16
  export function getContainerWidth(spec: unknown): ContainerWidth | undefined {
14
- if (typeof spec === "object" && spec !== null && "width" in spec) {
15
- return spec.width as ContainerWidth | undefined;
17
+ if (typeof spec === "object" && spec !== null) {
18
+ if ("width" in spec) {
19
+ return spec.width as ContainerWidth | undefined;
20
+ }
21
+ // Faceted/repeated spec
22
+ if ("spec" in spec) {
23
+ return getContainerWidth(spec.spec);
24
+ }
16
25
  }
17
26
  return undefined;
18
27
  }
@@ -4,7 +4,8 @@
4
4
  max-width: 100%;
5
5
  }
6
6
 
7
- .vega-embed[data-container-width="container"] {
7
+ .vega-embed[data-container-width="container"],
8
+ .vega-embed:has(> .chart-wrapper.fit-x) {
8
9
  width: 100%;
9
10
  }
10
11