@marimo-team/islands 0.24.1-dev2 → 0.24.1-dev21
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.
- package/dist/{ConnectedDataExplorerComponent-BUC1MrsF.js → ConnectedDataExplorerComponent-yEsovh7C.js} +4 -4
- package/dist/{chat-ui-o-tATfmW.js → chat-ui-dZ0mdOG3.js} +3 -3
- package/dist/{common-DjnMIXVY.js → common-DhYGWkNU.js} +14 -8
- package/dist/{formats-HSfYlcA8.js → formats-BZtMpeQe.js} +2 -2
- package/dist/{glide-data-editor-BI2i_IEE.js → glide-data-editor-BcvvJTCH.js} +2 -0
- package/dist/{html-to-image-BOiFHx3u.js → html-to-image-p-mxZ3_V.js} +2333 -2311
- package/dist/{loader-DTnbNSVZ.js → loader-Chm6nOqy.js} +1 -1
- package/dist/main.js +1106 -1011
- package/dist/{process-output-HrsM52f8.js → process-output-Bh4xztNq.js} +1 -1
- package/dist/{react-vega-zyfTF9SY.js → react-vega-BE2Uv1cq.js} +1 -1
- package/dist/{reveal-component-BufNyZPY.js → reveal-component-BzecpV7i.js} +5 -5
- package/dist/{spec-BL1GSUUF.js → spec-DR1CyTOo.js} +2 -0
- package/dist/style.css +1 -1
- package/dist/{toDate-BGM7kFtQ.js → toDate-CjUYDkFI.js} +2 -2
- package/dist/{vega-component-CJug-VdR.js → vega-component-CTiCS_5w.js} +5 -5
- package/dist/{vega-embed-container-BRjjqRGz.js → vega-embed-container-B1tc-DoN.js} +2 -2
- package/dist/{vega-loader.browser-CGb-2Kwi.js → vega-loader.browser-VFQfHaoV.js} +1 -1
- package/package.json +1 -1
- package/src/__mocks__/requests.ts +4 -0
- package/src/components/app-config/optional-features.test.ts +78 -0
- package/src/components/app-config/optional-features.tsx +33 -6
- package/src/components/data-table/__tests__/column_formatting.test.ts +7 -0
- package/src/components/data-table/charts/__tests__/schemas.test.ts +17 -2
- package/src/components/data-table/charts/chart-spec/types.ts +2 -0
- package/src/components/data-table/column-formatting/feature.ts +1 -0
- package/src/components/data-table/column-formatting/types.ts +1 -0
- package/src/components/data-table/column-summary/chart-spec-model.tsx +1 -0
- package/src/components/data-table/column-summary/column-summary.tsx +1 -0
- package/src/components/data-table/columns.tsx +4 -3
- package/src/components/datasets/__tests__/icons.test.ts +10 -2
- package/src/components/datasets/icons.tsx +4 -0
- package/src/components/datasources/__tests__/components.test.tsx +14 -1
- package/src/components/editor/actions/export-dialog/__tests__/export-dialog.test.tsx +206 -34
- package/src/components/editor/actions/export-dialog/export-dialog.tsx +9 -3
- package/src/components/editor/actions/export-dialog/format-notice.tsx +69 -24
- package/src/components/editor/actions/export-dialog/use-export-dialog.ts +27 -2
- package/src/components/ui/toaster.tsx +14 -1
- package/src/core/codemirror/code-lens/__tests__/popover.test.ts +13 -0
- package/src/core/codemirror/code-lens/popover.tsx +11 -5
- package/src/core/codemirror/language/languages/sql/__tests__/renderers.test.tsx +15 -4
- package/src/core/codemirror/language/languages/sql/renderers.tsx +1 -0
- package/src/core/islands/bridge.ts +1 -0
- package/src/core/kernel/messages.ts +1 -0
- package/src/core/mode.ts +6 -1
- package/src/core/network/__tests__/requests-lazy.test.ts +40 -0
- package/src/core/network/__tests__/requests-network.test.ts +13 -0
- package/src/core/network/requests-lazy.ts +11 -4
- package/src/core/network/requests-network.ts +8 -0
- package/src/core/network/requests-static.ts +1 -0
- package/src/core/network/requests-toasting.tsx +1 -0
- package/src/core/network/types.ts +5 -0
- package/src/core/wasm/bridge.ts +1 -0
- package/src/plugins/impl/MatrixPlugin.tsx +256 -35
- package/src/plugins/impl/__tests__/DataEditorPlugin.test.ts +13 -1
- package/src/plugins/impl/__tests__/MatrixPlugin.test.tsx +540 -3
- package/src/plugins/impl/data-editor/glide-data-editor.tsx +1 -0
- package/src/plugins/impl/data-editor/glide-utils.ts +1 -0
- package/src/plugins/impl/data-frames/__tests__/schema.test.ts +9 -1
- package/src/plugins/impl/data-frames/utils/__tests__/operators.test.ts +8 -0
- package/src/plugins/impl/data-frames/utils/operators.ts +1 -1
- package/src/plugins/impl/vega/__tests__/vega.test.ts +22 -4
- package/src/plugins/impl/vega/utils.ts +3 -0
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
vegaLoadData,
|
|
8
8
|
vegaLoader,
|
|
9
9
|
} from "../loader";
|
|
10
|
+
import { getVegaFieldTypes } from "../utils";
|
|
10
11
|
|
|
11
12
|
const { ZERO_WIDTH_SPACE, replacePeriodsInColumnNames, uniquifyColumnNames } =
|
|
12
13
|
exportedForTesting;
|
|
@@ -102,15 +103,32 @@ yield_error,yield_center
|
|
|
102
103
|
`);
|
|
103
104
|
});
|
|
104
105
|
|
|
105
|
-
it.each(DATA_TYPES)
|
|
106
|
-
|
|
106
|
+
it.each(DATA_TYPES.filter((type) => type !== "geometry"))(
|
|
107
|
+
"should handle %s data-type",
|
|
108
|
+
async (type) => {
|
|
109
|
+
const csvData = "name,value_column\nAlice,1";
|
|
110
|
+
vi.spyOn(vegaLoader, "load").mockReturnValue(Promise.resolve(csvData));
|
|
111
|
+
|
|
112
|
+
const result = await vegaLoadData(csvData, {
|
|
113
|
+
type: "csv",
|
|
114
|
+
parse: { value_column: type },
|
|
115
|
+
});
|
|
116
|
+
expect(result.length).toEqual(1);
|
|
117
|
+
},
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
it("should parse geometry as a WKT string", async () => {
|
|
121
|
+
const csvData = "name,value_column\nAlice,POINT (0 0)";
|
|
107
122
|
vi.spyOn(vegaLoader, "load").mockReturnValue(Promise.resolve(csvData));
|
|
108
123
|
|
|
124
|
+
const fieldTypes = getVegaFieldTypes({ value_column: "geometry" });
|
|
125
|
+
expect(fieldTypes).toEqual({ value_column: "string" });
|
|
126
|
+
|
|
109
127
|
const result = await vegaLoadData(csvData, {
|
|
110
128
|
type: "csv",
|
|
111
|
-
parse:
|
|
129
|
+
parse: fieldTypes,
|
|
112
130
|
});
|
|
113
|
-
expect(result
|
|
131
|
+
expect(result).toEqual([{ name: "Alice", value_column: "POINT (0 0)" }]);
|
|
114
132
|
});
|
|
115
133
|
|
|
116
134
|
it("should parse csv data with out of bound integers", async () => {
|
|
@@ -55,6 +55,9 @@ export function getVegaFieldTypes(
|
|
|
55
55
|
// the correct formatting. For example, a date like '2024-01-01' will
|
|
56
56
|
// be formatted to '2024-01-01T00:00:00.000Z'.
|
|
57
57
|
return Objects.mapValues(types, (type): VegaDataType => {
|
|
58
|
+
if (type === "geometry") {
|
|
59
|
+
return "string";
|
|
60
|
+
}
|
|
58
61
|
if (type === "date") {
|
|
59
62
|
return "string";
|
|
60
63
|
}
|