@ocelescope/core 0.10.1 → 0.10.2
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/ActivityPicker-BfA34hBU.js +29 -0
- package/dist/{AreaChart-DoD3LM50.js → AreaChart-q6rVcUIp.js} +4 -3
- package/dist/AttributePicker-Dd8eKA_3.js +95 -0
- package/dist/{BarChart-Cixo5Okd.js → BarChart-BLZS87ex.js} +4 -3
- package/dist/E2ORelationPicker-CcDSJWc0.js +46 -0
- package/dist/EventAttributePicker-Ch0rYS1h.js +27 -0
- package/dist/EventPicker-DbqFMMr2.js +39 -0
- package/dist/HistogramChart-GgiQdlsk.js +87 -0
- package/dist/{LineChart-CVz-dkJI.js → LineChart-Cq935Tk2.js} +4 -3
- package/dist/O2ORelationPicker-_XU1FfIX.js +44 -0
- package/dist/ObjectAttributePicker-Dpt3IfC5.js +27 -0
- package/dist/ObjectPicker-Bd68wl9p.js +39 -0
- package/dist/ObjectTypePicker-CXCMky34.js +42 -0
- package/dist/{OcelChart-DvGTjJXo.js → OcelChart-BnXjHb_r.js} +1 -1
- package/dist/OptionPicker-D9rUIwbY.js +351 -0
- package/dist/{PieChart-DBiASngC.js → PieChart-DZFHaTXD.js} +4 -3
- package/dist/{ScatterChart-jIQOjQes.js → ScatterChart-DJfJmABJ.js} +4 -3
- package/dist/{SqlChart-bwDArK2l.js → SqlChart-Bf7D5o5P.js} +33 -33
- package/dist/{SunburstChart-D6FhYBHI.js → SunburstChart-CMNYlKon.js} +3 -2
- package/dist/attributeOptions-D4slIoZx.js +37 -0
- package/dist/{cartesian-5TPNWjl_.js → cartesian-Dt7weMqK.js} +1 -1
- package/dist/index.d.ts +240 -143
- package/dist/index.js +28 -100
- package/dist/relationOptions-DTtIOIr1.js +33 -0
- package/dist/{series-BBXVjHHY.js → series-W1jsVape.js} +1 -1
- package/dist/style.css +596 -731
- package/dist/{Plot-CxHHyXot.js → useChart-jzzXgs0j.js} +28 -1
- package/dist/{useOcelId-BSU0-Srk.js → useOcelId-DIu_aGLH.js} +5 -2
- package/dist/useSearch-Ad3AtTVj.js +19 -0
- package/package.json +17 -18
- package/dist/ActivityPicker-DbrGeiC_.js +0 -18
- package/dist/EventAttributePicker-Cf2vVKv5.js +0 -27
- package/dist/NamePicker-Be-qmr1x.js +0 -43
- package/dist/ObjectAttributePicker-CL43EsYt.js +0 -27
- package/dist/ObjectTypePicker-CKmszS0y.js +0 -18
package/dist/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { t as useCurrentOcel } from "./useCurrentOCEL-BeBa7K0g.js";
|
|
2
|
-
import { t as useOcelId } from "./useOcelId-BSU0-Srk.js";
|
|
3
2
|
import { t as useOcelQuery } from "./useOcelQuery-D1QM-Zgv.js";
|
|
4
3
|
import { ActionIcon, Anchor, AppShell, Box, Burger, Button, Center, ColorSchemeScript, CopyButton, Divider, Group, LoadingOverlay, MantineProvider, Modal, MultiSelect, NavLink, Select, Stack, Table, Text, ThemeIcon, Tooltip, UnstyledButton, createTheme, mantineHtmlProps, useMantineTheme } from "@mantine/core";
|
|
5
|
-
import { getDownloadFlatLogQueryKey, getDownloadOCELQueryKey, getDownloadResourceAsPnmlQueryKey, getDownloadResourceQueryKey, getDownloadVariantFlatLogQueryKey, useActivities, useAggregatedAttributes, useAttributeNames, useE2o, useE2oCombinations, useEventAttributes,
|
|
4
|
+
import { getDownloadFlatLogQueryKey, getDownloadOCELQueryKey, getDownloadResourceAsPnmlQueryKey, getDownloadResourceQueryKey, getDownloadVariantFlatLogQueryKey, useActivities, useAggregatedAttributes, useAttributeNames, useE2o, useE2oCombinations, useEventAttributes, useGetDefaultOcel, useGetOcels, useImportDefaultOcel, useLogout, useO2o, useO2oCombinations, useObjectAttributes, useObjectTypes, useUpload } from "@ocelescope/api-base";
|
|
6
5
|
import { HydrationBoundary, QueryClient, QueryClientProvider, keepPreviousData, useQueryClient } from "@tanstack/react-query";
|
|
7
6
|
import { BookOpenIcon, BugIcon, CheckIcon, ChevronDownIcon, ChevronRightIcon, ContainerIcon, DownloadIcon, FilterIcon, GlobeIcon, HelpCircleIcon, LightbulbIcon, LogOutIcon, MailIcon, PackageIcon, PackagePlusIcon, PuzzleIcon, TriangleAlertIcon, UploadIcon, XIcon } from "lucide-react";
|
|
8
7
|
import { DataTable } from "mantine-datatable";
|
|
@@ -17,7 +16,7 @@ import z from "zod";
|
|
|
17
16
|
import { Notifications, showNotification } from "@mantine/notifications";
|
|
18
17
|
import { Theme } from "@r4pm/components/ui";
|
|
19
18
|
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
|
|
20
|
-
import {
|
|
19
|
+
import { useDisclosure } from "@mantine/hooks";
|
|
21
20
|
import { env as env$1, useSessionStore } from "@ocelescope/api-client";
|
|
22
21
|
import Link from "next/link.js";
|
|
23
22
|
import { useRouter } from "next/router.js";
|
|
@@ -365,14 +364,15 @@ const BarList = ({ data, labelHeader, valueHeader = "Frequency", maxVisibleItems
|
|
|
365
364
|
//#endregion
|
|
366
365
|
//#region src/components/charts/index.tsx
|
|
367
366
|
const browserOnly = (load) => dynamic(load, { ssr: false });
|
|
368
|
-
const BarChart = browserOnly(() => import("./BarChart-
|
|
369
|
-
const
|
|
370
|
-
const
|
|
371
|
-
const
|
|
372
|
-
const
|
|
373
|
-
const
|
|
374
|
-
const
|
|
375
|
-
const
|
|
367
|
+
const BarChart = browserOnly(() => import("./BarChart-BLZS87ex.js").then((n) => n.n).then((module) => module.BarChart));
|
|
368
|
+
const HistogramChart = browserOnly(() => import("./HistogramChart-GgiQdlsk.js").then((n) => n.n).then((module) => module.HistogramChart));
|
|
369
|
+
const LineChart = browserOnly(() => import("./LineChart-Cq935Tk2.js").then((n) => n.n).then((module) => module.LineChart));
|
|
370
|
+
const AreaChart = browserOnly(() => import("./AreaChart-q6rVcUIp.js").then((n) => n.n).then((module) => module.AreaChart));
|
|
371
|
+
const ScatterChart = browserOnly(() => import("./ScatterChart-DJfJmABJ.js").then((n) => n.n).then((module) => module.ScatterChart));
|
|
372
|
+
const PieChart = browserOnly(() => import("./PieChart-DZFHaTXD.js").then((n) => n.n).then((module) => module.PieChart));
|
|
373
|
+
const SunburstChart = browserOnly(() => import("./SunburstChart-CMNYlKon.js").then((n) => n.n).then((module) => module.SunburstChart));
|
|
374
|
+
const SqlChart = browserOnly(() => import("./SqlChart-Bf7D5o5P.js").then((module) => module.SqlChart));
|
|
375
|
+
const OcelChart = browserOnly(() => import("./OcelChart-BnXjHb_r.js").then((module) => module.OcelChart));
|
|
376
376
|
//#endregion
|
|
377
377
|
//#region src/components/Dropzone/Dropzone.module.css
|
|
378
378
|
var Dropzone_module_default = {
|
|
@@ -550,6 +550,10 @@ const sseHandler = async (req, res) => {
|
|
|
550
550
|
});
|
|
551
551
|
const webStream = backendRes.body;
|
|
552
552
|
const nodeStream = Readable.fromWeb(webStream);
|
|
553
|
+
nodeStream.on("error", (err) => {
|
|
554
|
+
if (!controller.signal.aborted) console.error("SSE stream error:", err);
|
|
555
|
+
res.end();
|
|
556
|
+
});
|
|
553
557
|
nodeStream.pipe(res);
|
|
554
558
|
res.on("close", () => {
|
|
555
559
|
console.log("Client disconnected");
|
|
@@ -1324,94 +1328,18 @@ const OcelescopeDocument = () => {
|
|
|
1324
1328
|
});
|
|
1325
1329
|
};
|
|
1326
1330
|
//#endregion
|
|
1327
|
-
//#region src/components/
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
placeholder,
|
|
1340
|
-
searchable: true,
|
|
1341
|
-
disabled,
|
|
1342
|
-
data: [.../* @__PURE__ */ new Set([...ids, ...picked])],
|
|
1343
|
-
searchValue: search,
|
|
1344
|
-
onSearchChange: onSearch,
|
|
1345
|
-
nothingFoundMessage: emptyText ?? (loading ? "Searching…" : "Nothing found")
|
|
1346
|
-
};
|
|
1347
|
-
return selection.multiple ? /* @__PURE__ */ jsx(MultiSelect, {
|
|
1348
|
-
...shared,
|
|
1349
|
-
value: picked,
|
|
1350
|
-
onChange: selection.onChange,
|
|
1351
|
-
clearable: true
|
|
1352
|
-
}) : /* @__PURE__ */ jsx(Select, {
|
|
1353
|
-
...shared,
|
|
1354
|
-
value: picked[0] ?? null,
|
|
1355
|
-
onChange: (next) => selection.onChange(next ?? void 0)
|
|
1356
|
-
});
|
|
1357
|
-
};
|
|
1358
|
-
//#endregion
|
|
1359
|
-
//#region src/components/pickers/internal/useSearch.ts
|
|
1360
|
-
/** What the reader has typed, slowed to one request per pause in typing. */
|
|
1361
|
-
const useSearch = () => {
|
|
1362
|
-
const [search, setSearch] = useState("");
|
|
1363
|
-
const [debounced] = useDebouncedValue(search, 300);
|
|
1364
|
-
return {
|
|
1365
|
-
search,
|
|
1366
|
-
setSearch,
|
|
1367
|
-
debounced: debounced || void 0
|
|
1368
|
-
};
|
|
1369
|
-
};
|
|
1370
|
-
//#endregion
|
|
1371
|
-
//#region src/components/pickers/EventPicker.tsx
|
|
1372
|
-
/** Events of the log, found by typing part of an id. */
|
|
1373
|
-
const EventPicker = ({ ocelId, ocelVersion = "filtered", limit = 50, ...picker }) => {
|
|
1374
|
-
const id = useOcelId(ocelId);
|
|
1375
|
-
const { search, setSearch, debounced } = useSearch();
|
|
1376
|
-
const { data, isPending } = useEventIds(id, {
|
|
1377
|
-
search: debounced,
|
|
1378
|
-
size: limit,
|
|
1379
|
-
ocel_version: ocelVersion
|
|
1380
|
-
}, { query: { enabled: id != null } });
|
|
1381
|
-
return /* @__PURE__ */ jsx(IdPicker, {
|
|
1382
|
-
ids: data?.response ?? [],
|
|
1383
|
-
search,
|
|
1384
|
-
onSearch: setSearch,
|
|
1385
|
-
loading: isPending,
|
|
1386
|
-
...picker
|
|
1387
|
-
});
|
|
1388
|
-
};
|
|
1389
|
-
//#endregion
|
|
1390
|
-
//#region src/components/pickers/ObjectPicker.tsx
|
|
1391
|
-
/** Objects of the log, found by typing part of an id. */
|
|
1392
|
-
const ObjectPicker = ({ ocelId, ocelVersion = "filtered", limit = 50, ...picker }) => {
|
|
1393
|
-
const id = useOcelId(ocelId);
|
|
1394
|
-
const { search, setSearch, debounced } = useSearch();
|
|
1395
|
-
const { data, isPending } = useObjectIds(id, {
|
|
1396
|
-
search: debounced,
|
|
1397
|
-
size: limit,
|
|
1398
|
-
ocel_version: ocelVersion
|
|
1399
|
-
}, { query: { enabled: id != null } });
|
|
1400
|
-
return /* @__PURE__ */ jsx(IdPicker, {
|
|
1401
|
-
ids: data?.response ?? [],
|
|
1402
|
-
search,
|
|
1403
|
-
onSearch: setSearch,
|
|
1404
|
-
loading: isPending,
|
|
1405
|
-
...picker
|
|
1406
|
-
});
|
|
1407
|
-
};
|
|
1408
|
-
//#endregion
|
|
1409
|
-
//#region src/components/pickers/index.tsx
|
|
1410
|
-
const NamePicker = dynamic(() => import("./NamePicker-Be-qmr1x.js").then((module) => module.NamePicker), { ssr: false });
|
|
1411
|
-
const ActivityPicker = dynamic(() => import("./ActivityPicker-DbrGeiC_.js").then((module) => module.ActivityPicker), { ssr: false });
|
|
1412
|
-
const ObjectTypePicker = dynamic(() => import("./ObjectTypePicker-CKmszS0y.js").then((module) => module.ObjectTypePicker), { ssr: false });
|
|
1413
|
-
const EventAttributePicker = dynamic(() => import("./EventAttributePicker-Cf2vVKv5.js").then((module) => module.EventAttributePicker), { ssr: false });
|
|
1414
|
-
const ObjectAttributePicker = dynamic(() => import("./ObjectAttributePicker-CL43EsYt.js").then((module) => module.ObjectAttributePicker), { ssr: false });
|
|
1331
|
+
//#region src/components/Pickers/index.tsx
|
|
1332
|
+
const clientOnly = (load) => dynamic(load, { ssr: false });
|
|
1333
|
+
const OptionPicker = clientOnly(() => import("./OptionPicker-D9rUIwbY.js").then((m) => m.OptionPicker));
|
|
1334
|
+
const ActivityPicker = clientOnly(() => import("./ActivityPicker-BfA34hBU.js").then((m) => m.ActivityPicker));
|
|
1335
|
+
const ObjectTypePicker = clientOnly(() => import("./ObjectTypePicker-CXCMky34.js").then((m) => m.ObjectTypePicker));
|
|
1336
|
+
const EventPicker = clientOnly(() => import("./EventPicker-DbqFMMr2.js").then((m) => m.EventPicker));
|
|
1337
|
+
const ObjectPicker = clientOnly(() => import("./ObjectPicker-Bd68wl9p.js").then((m) => m.ObjectPicker));
|
|
1338
|
+
const EventAttributePicker = clientOnly(() => import("./EventAttributePicker-Ch0rYS1h.js").then((m) => m.EventAttributePicker));
|
|
1339
|
+
const ObjectAttributePicker = clientOnly(() => import("./ObjectAttributePicker-Dpt3IfC5.js").then((m) => m.ObjectAttributePicker));
|
|
1340
|
+
const AttributePicker = clientOnly(() => import("./AttributePicker-Dd8eKA_3.js").then((m) => m.AttributePicker));
|
|
1341
|
+
const E2ORelationPicker = clientOnly(() => import("./E2ORelationPicker-CcDSJWc0.js").then((m) => m.E2ORelationPicker));
|
|
1342
|
+
const O2ORelationPicker = clientOnly(() => import("./O2ORelationPicker-_XU1FfIX.js").then((m) => m.O2ORelationPicker));
|
|
1415
1343
|
//#endregion
|
|
1416
1344
|
//#region src/components/RelationTable.tsx
|
|
1417
1345
|
const PAGE_SIZE = 10;
|
|
@@ -1713,4 +1641,4 @@ const useDownloadResourceAsPnml = useDownloadFromServer(getDownloadResourceAsPnm
|
|
|
1713
1641
|
const defineModule = (def) => def;
|
|
1714
1642
|
const defineModuleRoute = (def) => def;
|
|
1715
1643
|
//#endregion
|
|
1716
|
-
export { ActivityPicker, AreaChart, AttributesTable, BarChart, BarList, EventAttributePicker, EventPicker, FileDropzone, FullScreenUpload, HelpModal,
|
|
1644
|
+
export { ActivityPicker, AreaChart, AttributePicker, AttributesTable, BarChart, BarList, E2ORelationPicker, EventAttributePicker, EventPicker, FileDropzone, FullScreenUpload, HelpModal, HistogramChart, LineChart, O2ORelationPicker, ObjectAttributePicker, ObjectPicker, ObjectTypePicker, OcelChart, OcelSelect, OcelescopeApp, OcelescopeDocument, OptionPicker, PieChart, RelationTable, ScatterChart, SqlChart, SunburstChart, UploadModal, UploadSection, createModulesPage, defineModule, defineModuleRoute, env, formatAttributeValue, getModuleRoute, sseHandler, useCurrentOcel, useDownloadFile, useDownloadFlatOCEL, useDownloadOCEL, useDownloadResource, useDownloadResourceAsPnml, useDownloadVariantFlatLog, useInvalidate, useOcelQuery };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/components/Pickers/internal/relationOptions.ts
|
|
2
|
+
const relationId = (relation) => JSON.stringify([
|
|
3
|
+
relation.source,
|
|
4
|
+
relation.target,
|
|
5
|
+
relation.qualifier
|
|
6
|
+
]);
|
|
7
|
+
const relationLabel = (relation) => relation.qualifier ? `${relation.target} · ${relation.qualifier}` : relation.target;
|
|
8
|
+
/**
|
|
9
|
+
* Rows of the E2O or O2O endpoint as options: one per target type and
|
|
10
|
+
* qualifier, counted by how many relations there are. Grouped by source
|
|
11
|
+
* unless the picker is narrowed to one.
|
|
12
|
+
*/
|
|
13
|
+
const relationOptions = ({ rows, source, unit, sourceColor, targetColor }) => rows.filter((row) => source === void 0 || row.source === source).map((row) => {
|
|
14
|
+
const relation = {
|
|
15
|
+
source: row.source,
|
|
16
|
+
target: row.target,
|
|
17
|
+
qualifier: row.qualifier
|
|
18
|
+
};
|
|
19
|
+
const perSource = row.min_count === row.max_count ? `${row.min_count}` : `${row.min_count}–${row.max_count}`;
|
|
20
|
+
return {
|
|
21
|
+
value: relation,
|
|
22
|
+
label: relationLabel(relation),
|
|
23
|
+
description: `${perSource} per ${unit}`,
|
|
24
|
+
count: row.sum,
|
|
25
|
+
color: targetColor(row.target),
|
|
26
|
+
group: source === void 0 ? {
|
|
27
|
+
label: row.source,
|
|
28
|
+
color: sourceColor(row.source)
|
|
29
|
+
} : void 0
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
export { relationLabel as n, relationOptions as r, relationId as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as measureOf, i as label, o as plotted } from "./useChart-jzzXgs0j.js";
|
|
2
2
|
//#region src/components/charts/internal/series.ts
|
|
3
3
|
/**
|
|
4
4
|
* The rows as traces: one per value of the `series` column, or one per measure
|