lhcb-ntuple-wizard-test 2.0.7 → 2.2.0
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/App.js +2 -1
- package/dist/components/AddTupleToolButton.d.ts +1 -0
- package/dist/components/AddTupleToolButton.js +16 -0
- package/dist/components/BookkeepingPathDropdown.d.ts +1 -1
- package/dist/components/BookkeepingPathDropdown.js +1 -4
- package/dist/components/DatasetEventTypeBadge.js +1 -1
- package/dist/components/DatasetInfo.js +3 -3
- package/dist/components/DecayCard.d.ts +1 -0
- package/dist/components/DecayCard.js +47 -0
- package/dist/components/DecayLatex.d.ts +1 -1
- package/dist/components/DecayLatex.js +4 -87
- package/dist/components/DecayListItem.js +2 -2
- package/dist/components/DecayTagBadge.d.ts +1 -1
- package/dist/components/DecayTagBadge.js +0 -3
- package/dist/components/DecayTreeCard.d.ts +1 -7
- package/dist/components/DecayTreeCard.js +14 -22
- package/dist/components/DecayTreeCardHeader.d.ts +2 -3
- package/dist/components/DecayTreeCardHeader.js +2 -2
- package/dist/components/DecayTreeGraph.d.ts +1 -5
- package/dist/components/DecayTreeGraph.js +160 -49
- package/dist/components/DeleteButton.d.ts +3 -1
- package/dist/components/DeleteButton.js +2 -2
- package/dist/components/DttNameInput.d.ts +9 -1
- package/dist/components/DttNameInput.js +29 -61
- package/dist/components/GuideLinkButton.d.ts +15 -0
- package/dist/components/GuideLinkButton.js +16 -0
- package/dist/components/NtupleWizard.js +1 -2
- package/dist/components/ParticleDropdown.d.ts +11 -1
- package/dist/components/ParticleDropdown.js +3 -6
- package/dist/components/ParticleLatex.d.ts +6 -0
- package/dist/components/ParticleLatex.js +13 -0
- package/dist/components/ParticleTagBadge.d.ts +2 -1
- package/dist/components/ParticleTagBadge.js +5 -7
- package/dist/components/ParticleTagFilters.d.ts +1 -6
- package/dist/components/ParticleTagFilters.js +16 -17
- package/dist/components/RequestButtonGroup.d.ts +1 -1
- package/dist/components/RequestButtonGroup.js +2 -5
- package/dist/components/RequestRow.d.ts +1 -1
- package/dist/components/RequestRow.js +8 -12
- package/dist/components/StrippingLineDropdown.js +14 -16
- package/dist/components/StrippingLineInfo.d.ts +5 -5
- package/dist/components/StrippingLineInfo.js +14 -4
- package/dist/components/StrippingLineInfoButton.d.ts +6 -0
- package/dist/components/StrippingLineInfoButton.js +7 -0
- package/dist/components/StrippingLineVersionBadge.d.ts +7 -0
- package/dist/components/{StrippingLineBadge.js → StrippingLineVersionBadge.js} +5 -5
- package/dist/components/StrippingLinesCountBadge.d.ts +8 -0
- package/dist/components/StrippingLinesCountBadge.js +11 -0
- package/dist/components/TagDropdown.d.ts +3 -3
- package/dist/components/TagDropdown.js +2 -2
- package/dist/components/{TupleToolDropdown.d.ts → TupleToolClassDropdown.d.ts} +2 -5
- package/dist/components/{TupleToolDropdown.js → TupleToolClassDropdown.js} +16 -13
- package/dist/components/TupleToolDocsAccordion.d.ts +1 -1
- package/dist/components/TupleToolDocsAccordion.js +4 -8
- package/dist/components/TupleToolGroupsAccordion.d.ts +5 -0
- package/dist/components/TupleToolGroupsAccordion.js +31 -0
- package/dist/components/TupleToolLabel.d.ts +1 -1
- package/dist/components/TupleToolLabel.js +2 -5
- package/dist/components/TupleToolsAccordion.d.ts +1 -0
- package/dist/components/TupleToolsAccordion.js +22 -0
- package/dist/components/VerticalLine.d.ts +7 -0
- package/dist/components/VerticalLine.js +4 -0
- package/dist/components/modals/AddTupleToolModal.d.ts +3 -4
- package/dist/components/modals/AddTupleToolModal.js +13 -12
- package/dist/components/modals/ConfigureTupleToolModal.d.ts +2 -2
- package/dist/components/modals/ConfigureTupleToolModal.js +28 -11
- package/dist/components/modals/UploadDttConfigModal.d.ts +1 -1
- package/dist/components/modals/UploadDttConfigModal.js +1 -4
- package/dist/config.d.ts +19 -47
- package/dist/config.js +27 -39
- package/dist/models/bkPath.js +1 -1
- package/dist/models/dtt.d.ts +5 -2
- package/dist/models/dtt.js +37 -18
- package/dist/models/rowData.d.ts +1 -1
- package/dist/models/yamlFile.js +1 -1
- package/dist/pages/DecaySearchPage.js +4 -9
- package/dist/pages/DecayTreeConfigPage.js +5 -39
- package/dist/pages/RequestPage.js +11 -16
- package/dist/providers/DttProvider.d.ts +5 -3
- package/dist/providers/DttProvider.js +33 -55
- package/dist/providers/MetadataProvider.d.ts +1 -1
- package/dist/providers/MetadataProvider.js +11 -5
- package/dist/providers/RequestProvider.js +2 -2
- package/dist/providers/RowProvider.d.ts +2 -2
- package/dist/providers/RowProvider.js +10 -9
- package/dist/providers/RowsProvider.js +0 -3
- package/dist/tests/components/BookkeepingPathDropdown.test.d.ts +1 -0
- package/dist/tests/components/BookkeepingPathDropdown.test.js +118 -0
- package/dist/tests/components/DatasetInfo.test.d.ts +1 -0
- package/dist/tests/components/DatasetInfo.test.js +38 -0
- package/dist/tests/components/DecayCard.test.d.ts +1 -0
- package/dist/tests/components/DecayCard.test.js +115 -0
- package/dist/tests/components/DecayLatex.test.d.ts +1 -0
- package/dist/tests/components/DecayLatex.test.js +31 -0
- package/dist/tests/components/DecayList.test.d.ts +1 -0
- package/dist/tests/components/DecayList.test.js +76 -0
- package/dist/tests/components/DecayListItem.test.d.ts +1 -0
- package/dist/tests/components/DecayListItem.test.js +51 -0
- package/dist/tests/components/DecayTreeCard.test.d.ts +1 -0
- package/dist/tests/components/DecayTreeCard.test.js +119 -0
- package/dist/tests/components/DecayTreeGraph.test.d.ts +1 -0
- package/dist/tests/components/DecayTreeGraph.test.js +125 -0
- package/dist/tests/components/DeleteButton.test.d.ts +1 -0
- package/dist/tests/components/DeleteButton.test.js +45 -0
- package/dist/tests/components/DttNameInput.test.d.ts +1 -0
- package/dist/tests/components/DttNameInput.test.js +75 -0
- package/dist/tests/components/NtupleWizard.test.d.ts +1 -0
- package/dist/tests/components/NtupleWizard.test.js +57 -0
- package/dist/tests/components/ParticleDropdown.test.d.ts +1 -0
- package/dist/tests/components/ParticleDropdown.test.js +23 -0
- package/dist/tests/components/ParticleTagFilters.test.d.ts +1 -0
- package/dist/tests/components/ParticleTagFilters.test.js +87 -0
- package/dist/tests/components/RequestButtonGroup.test.d.ts +1 -0
- package/dist/tests/components/RequestButtonGroup.test.js +132 -0
- package/dist/tests/components/RequestRow.test.d.ts +1 -0
- package/dist/tests/components/RequestRow.test.js +58 -0
- package/dist/tests/components/StrippingLineDropdown.test.d.ts +1 -0
- package/dist/tests/components/StrippingLineDropdown.test.js +88 -0
- package/dist/tests/components/badges.test.d.ts +1 -0
- package/dist/tests/components/badges.test.js +120 -0
- package/dist/tests/components/dropdowns.test.d.ts +1 -0
- package/dist/tests/components/dropdowns.test.js +110 -0
- package/dist/tests/components/dttComponents.test.d.ts +1 -0
- package/dist/tests/components/dttComponents.test.js +287 -0
- package/dist/tests/components/formInputs.test.d.ts +1 -0
- package/dist/tests/components/formInputs.test.js +96 -0
- package/dist/tests/components/metadataComponents.test.d.ts +1 -0
- package/dist/tests/components/metadataComponents.test.js +137 -0
- package/dist/tests/components/miscComponents.test.d.ts +1 -0
- package/dist/tests/components/miscComponents.test.js +134 -0
- package/dist/tests/components/modals.test.d.ts +1 -0
- package/dist/tests/components/modals.test.js +554 -0
- package/dist/tests/components/tupleToolParams.test.d.ts +1 -0
- package/dist/tests/components/tupleToolParams.test.js +213 -0
- package/dist/tests/config.test.d.ts +1 -0
- package/dist/tests/config.test.js +31 -0
- package/dist/tests/mockSetup.d.ts +1 -0
- package/dist/tests/mockSetup.js +30 -0
- package/dist/tests/models/BkPath.test.d.ts +1 -0
- package/dist/tests/models/BkPath.test.js +87 -0
- package/dist/tests/models/Dtt.test.d.ts +1 -0
- package/dist/tests/models/Dtt.test.js +376 -0
- package/dist/tests/models/TupleTool.test.d.ts +1 -0
- package/dist/tests/models/TupleTool.test.js +80 -0
- package/dist/tests/models/YamlFile.test.d.ts +1 -0
- package/dist/tests/models/YamlFile.test.js +123 -0
- package/dist/tests/pages/DecaySearchPage.test.d.ts +1 -0
- package/dist/tests/pages/DecaySearchPage.test.js +228 -0
- package/dist/tests/pages/DecayTreeConfigPage.test.d.ts +1 -0
- package/dist/tests/pages/DecayTreeConfigPage.test.js +105 -0
- package/dist/tests/pages/RequestPage.test.d.ts +1 -0
- package/dist/tests/pages/RequestPage.test.js +439 -0
- package/dist/tests/providers/DttProvider.test.d.ts +1 -0
- package/dist/tests/providers/DttProvider.test.js +105 -0
- package/dist/tests/providers/MetadataProvider.test.d.ts +1 -0
- package/dist/tests/providers/MetadataProvider.test.js +129 -0
- package/dist/tests/providers/RequestProvider.test.d.ts +1 -0
- package/dist/tests/providers/RequestProvider.test.js +306 -0
- package/dist/tests/providers/RowProvider.test.d.ts +1 -0
- package/dist/tests/providers/RowProvider.test.js +110 -0
- package/dist/tests/providers/RowsProvider.test.d.ts +1 -0
- package/dist/tests/providers/RowsProvider.test.js +84 -0
- package/dist/tests/providers/WizardConfigProvider.test.d.ts +1 -0
- package/dist/tests/providers/WizardConfigProvider.test.js +36 -0
- package/dist/tests/setupTests.d.ts +1 -0
- package/dist/tests/setupTests.js +15 -0
- package/dist/tests/testUtils.d.ts +33 -0
- package/dist/tests/testUtils.js +196 -0
- package/dist/tests/utils/latexUtils.test.d.ts +1 -0
- package/dist/tests/utils/latexUtils.test.js +62 -0
- package/dist/tests/utils/utils.test.d.ts +1 -0
- package/dist/tests/utils/utils.test.js +394 -0
- package/dist/utils/latexUtils.d.ts +13 -0
- package/dist/utils/latexUtils.js +86 -0
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.js +40 -4
- package/package.json +24 -10
- package/dist/components/NumStrippingLinesBadge.d.ts +0 -8
- package/dist/components/NumStrippingLinesBadge.js +0 -10
- package/dist/components/StrippingLineBadge.d.ts +0 -7
- package/dist/components/TupleToolGroup.d.ts +0 -6
- package/dist/components/TupleToolGroup.js +0 -22
- package/dist/components/TupleToolList.d.ts +0 -7
- package/dist/components/TupleToolList.js +0 -38
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TagHint } from "../providers/MetadataProvider.js";
|
|
2
2
|
import { Props as SelectProps } from "react-select";
|
|
3
3
|
import { DropdownOption } from "../models/dropdownOption.js";
|
|
4
|
-
export declare function getSelectTagOptions(tags: {
|
|
5
|
-
[key: string]:
|
|
6
|
-
}, filter?: (tag:
|
|
4
|
+
export declare function getSelectTagOptions<T extends TagHint>(tags: {
|
|
5
|
+
[key: string]: T;
|
|
6
|
+
}, filter?: (tag: T) => boolean): DropdownOption[];
|
|
7
7
|
interface Props extends SelectProps<DropdownOption, true> {
|
|
8
8
|
type: "decayTags" | "particleTags";
|
|
9
9
|
filter?: (tag: TagHint) => boolean;
|
|
@@ -22,8 +22,8 @@ export function getSelectTagOptions(tags, filter = () => true) {
|
|
|
22
22
|
}
|
|
23
23
|
export function TagDropdown({ type, filter, ...props }) {
|
|
24
24
|
const metadata = useMetadata();
|
|
25
|
-
const options = getSelectTagOptions(metadata
|
|
26
|
-
return (_jsx("div", { className: "react-select form-control p-0", children: _jsx(Select, { isMulti: true, options: options,
|
|
25
|
+
const options = getSelectTagOptions(metadata.userHints[type], filter);
|
|
26
|
+
return (_jsx("div", { className: "react-select form-control p-0", children: _jsx(Select, { isMulti: true, options: options, ...props,
|
|
27
27
|
// Display the dropdown above text inputs and other elements
|
|
28
28
|
menuPortalTarget: document.body, menuPosition: "fixed", styles: {
|
|
29
29
|
menuPortal: (base) => ({ ...base, zIndex: 9999 }),
|
|
@@ -10,12 +10,9 @@
|
|
|
10
10
|
\*****************************************************************************/
|
|
11
11
|
import { GroupBase, Props as SelectProps } from "react-select";
|
|
12
12
|
import { ReactNode } from "react";
|
|
13
|
-
type
|
|
13
|
+
type ToolDropdownOption = {
|
|
14
14
|
value: string;
|
|
15
15
|
label: ReactNode;
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
filterToolTags: string[];
|
|
19
|
-
}
|
|
20
|
-
export declare function TupleToolDropdown({ filterToolTags, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function TupleToolClassDropdown(props: SelectProps<ToolDropdownOption, false, GroupBase<ToolDropdownOption>>): import("react/jsx-runtime").JSX.Element;
|
|
21
18
|
export {};
|
|
@@ -10,20 +10,23 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
10
10
|
* or submit itself to any jurisdiction. *
|
|
11
11
|
\*****************************************************************************/
|
|
12
12
|
import Select from "react-select";
|
|
13
|
-
import { TupleToolLabel } from "./TupleToolLabel";
|
|
14
13
|
import { useMetadata } from "../providers/MetadataProvider.js";
|
|
15
14
|
import { TupleTool } from "../models/tupleTool";
|
|
16
|
-
|
|
15
|
+
import { useDtt } from "../providers/DttProvider";
|
|
16
|
+
import { config } from "../config";
|
|
17
|
+
export function TupleToolClassDropdown(props) {
|
|
17
18
|
const metadata = useMetadata();
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
const { selectedBranch } = useDtt();
|
|
20
|
+
const allowedTags = ["IParticleTupleTool", ...(selectedBranch.length === 0 ? ["IEventTupleTool"] : [])];
|
|
21
|
+
// Group tools by tag
|
|
22
|
+
const options = allowedTags.map((allowedTag) => ({
|
|
23
|
+
label: allowedTag,
|
|
24
|
+
options: Object.keys(metadata.tupleTools.tupleTools)
|
|
25
|
+
.sort()
|
|
26
|
+
.map(TupleTool.fromString)
|
|
27
|
+
.map((tool) => ({ value: tool.toString(), label: tool.class }))
|
|
28
|
+
.filter((tool) => metadata.tupleTools.tupleTools[tool.value].tags.includes(allowedTag) &&
|
|
29
|
+
!config.disabledTupleTools.includes(tool.value)),
|
|
30
|
+
}));
|
|
31
|
+
return (_jsx("div", { className: "react-select form-control p-0", children: _jsx(Select, { placeholder: "TupleTool class", options: options, ...props }) }));
|
|
29
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
toolClass: string;
|
|
3
3
|
}
|
|
4
|
-
export declare function TupleToolDocsAccordion({ toolClass }: Props): import("react/jsx-runtime").JSX.Element
|
|
4
|
+
export declare function TupleToolDocsAccordion({ toolClass }: Props): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export {};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Accordion
|
|
2
|
+
import { Accordion } from "react-bootstrap";
|
|
3
3
|
import { useMetadata } from "../providers/MetadataProvider";
|
|
4
|
-
import DOMPurify from "dompurify";
|
|
5
4
|
export function TupleToolDocsAccordion({ toolClass }) {
|
|
6
5
|
const metadata = useMetadata();
|
|
7
|
-
if (!metadata) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
6
|
const documentation = metadata.tupleTools.tupleTools[toolClass].documentation;
|
|
11
|
-
return (_jsx(Accordion, { children: _jsxs(Accordion.Item, { eventKey: "0", children: [_jsxs(Accordion.Header, { children: ["Documentation for ", toolClass] }), _jsx(Accordion.Body, { children:
|
|
12
|
-
__html:
|
|
13
|
-
} })) : (
|
|
7
|
+
return (_jsx(Accordion, { children: _jsxs(Accordion.Item, { eventKey: "0", children: [_jsxs(Accordion.Header, { children: ["Documentation for ", toolClass] }), _jsx(Accordion.Body, { children: documentation ? (_jsx("div", { dangerouslySetInnerHTML: {
|
|
8
|
+
__html: documentation,
|
|
9
|
+
} })) : ("No documentation available.") })] }) }));
|
|
14
10
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Accordion, Button, ListGroup, OverlayTrigger, Tooltip } from "react-bootstrap";
|
|
3
|
+
import { CircleSquare, PencilSquare, PlusLg } from "react-bootstrap-icons";
|
|
4
|
+
import { getControlKey } from "../utils/utils";
|
|
5
|
+
import { useDtt } from "../providers/DttProvider";
|
|
6
|
+
import { ParticleLatex } from "./ParticleLatex";
|
|
7
|
+
import _ from "lodash";
|
|
8
|
+
import { AddTupleToolButton } from "./AddTupleToolButton";
|
|
9
|
+
export function TupleToolGroupsAccordion({ setActiveKey }) {
|
|
10
|
+
const { dtt, selectedBranch, setSelectedBranch, hoveredBranch, setHoveredBranch, highlightedBranch } = useDtt();
|
|
11
|
+
function handleGroupSelected(branchGroup) {
|
|
12
|
+
setActiveKey("0");
|
|
13
|
+
setSelectedBranch(branchGroup);
|
|
14
|
+
setHoveredBranch([]);
|
|
15
|
+
}
|
|
16
|
+
const groupsWithTools = dtt.getGroupsWithTools();
|
|
17
|
+
return (_jsxs(Accordion.Item, { eventKey: "1", children: [_jsx(Accordion.Header, { children: _jsxs("div", { className: "d-flex align-items-center gap-2", children: [_jsx(CircleSquare, {}), groupsWithTools.length, " group", groupsWithTools.length === 1 ? "" : "s"] }) }), _jsx(Accordion.Body, { style: { padding: 4 }, children: groupsWithTools.length > 0 ? (_jsxs(ListGroup, { variant: "flush", children: [groupsWithTools.map((group) => {
|
|
18
|
+
const branchGroup = group.split(",");
|
|
19
|
+
return (_jsx(ListGroup.Item, { onMouseEnter: () => setHoveredBranch(branchGroup), onMouseLeave: () => setHoveredBranch([]), onClick: () => handleGroupSelected(branchGroup), style: {
|
|
20
|
+
cursor: "pointer",
|
|
21
|
+
backgroundColor: _.isEqual(hoveredBranch, branchGroup)
|
|
22
|
+
? "var(--bs-gray-100)"
|
|
23
|
+
: "transparent",
|
|
24
|
+
}, children: _jsxs("div", { className: "d-flex justify-content-between align-items-center", children: [_jsx("div", { className: "d-flex flex-wrap align-items-center gap-3", children: branchGroup.map((pid, i) => (_jsx(ParticleLatex, { particleId: pid, highlighted: _.isEqual(highlightedBranch, branchGroup) }, i))) }), _jsx(OverlayTrigger, { overlay: _jsx(Tooltip, { children: "Edit group TupleTools" }), children: _jsx(Button, { size: "sm", variant: "outline-secondary", onClick: () => handleGroupSelected(branchGroup), children: _jsx(PencilSquare, {}) }) })] }) }, group));
|
|
25
|
+
}), selectedBranch.length > 1 && !groupsWithTools.includes(selectedBranch.join(",")) && (_jsx(ListGroup.Item, { onMouseEnter: () => setHoveredBranch(selectedBranch), onMouseLeave: () => setHoveredBranch([]), onClick: () => handleGroupSelected(selectedBranch), style: {
|
|
26
|
+
cursor: "pointer",
|
|
27
|
+
backgroundColor: _.isEqual(hoveredBranch, selectedBranch)
|
|
28
|
+
? "var(--bs-gray-100)"
|
|
29
|
+
: "transparent",
|
|
30
|
+
}, children: _jsxs("div", { className: "d-flex justify-content-between align-items-center", children: [_jsx("div", { className: "d-flex flex-wrap align-items-center gap-3", children: selectedBranch.map((pid, i) => (_jsx(ParticleLatex, { particleId: pid, highlighted: true }, i))) }), _jsx(OverlayTrigger, { overlay: _jsx(Tooltip, { children: "Create group" }), children: _jsx(Button, { size: "sm", variant: "success", onClick: () => handleGroupSelected(selectedBranch), children: _jsx(PlusLg, {}) }) })] }) }, selectedBranch.join(",")))] })) : (_jsxs("div", { className: "text-muted d-flex flex-column gap-2 p-3", children: [selectedBranch.length === 0 ? (_jsxs("div", { children: ["No groups have been created yet. Select multiple particles (", _jsx("code", { children: getControlKey() }), " + click) and add a TupleTool to create a group."] })) : selectedBranch.length === 1 ? (_jsxs("div", { children: ["Select multiple particles (", _jsx("code", { children: getControlKey() }), " + click) to create a group."] })) : (_jsxs("div", { children: ["No groups include the selected particle", selectedBranch.length > 1 ? "s" : "", ". Add a TupleTool to create a group."] })), selectedBranch.length > 1 && _jsx(AddTupleToolButton, {})] })) })] }));
|
|
31
|
+
}
|
|
@@ -2,5 +2,5 @@ import { TupleTool } from "../models/tupleTool";
|
|
|
2
2
|
interface Props {
|
|
3
3
|
tool: TupleTool;
|
|
4
4
|
}
|
|
5
|
-
export declare function TupleToolLabel({ tool }: Props): import("react/jsx-runtime").JSX.Element
|
|
5
|
+
export declare function TupleToolLabel({ tool }: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/*****************************************************************************\
|
|
3
3
|
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
4
4
|
* *
|
|
@@ -13,8 +13,5 @@ import { OverlayTrigger, Tooltip } from "react-bootstrap";
|
|
|
13
13
|
import { useMetadata } from "../providers/MetadataProvider.js";
|
|
14
14
|
export function TupleToolLabel({ tool }) {
|
|
15
15
|
const metadata = useMetadata();
|
|
16
|
-
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return (_jsx(OverlayTrigger, { overlay: _jsx(Tooltip, { children: metadata.tupleTools.tupleTools[tool.class].description }), children: _jsx("span", { children: tool.toString() }) }));
|
|
16
|
+
return (_jsx(OverlayTrigger, { overlay: _jsx(Tooltip, { children: metadata.tupleTools.tupleTools[tool.class].description }), children: _jsxs("div", { className: "d-flex flex-column gap-1", children: [_jsx("code", { style: { textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "nowrap" }, children: tool.class }), _jsx("p", { className: "m-0 text-muted", style: { textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "nowrap" }, children: tool.name })] }) }));
|
|
20
17
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TupleToolsAccordion(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Accordion, Button, ButtonGroup, ListGroup, OverlayTrigger, Tooltip } from "react-bootstrap";
|
|
3
|
+
import { PencilSquare, Tools } from "react-bootstrap-icons";
|
|
4
|
+
import { ConfigureTupleToolModal } from "./modals/ConfigureTupleToolModal";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { useDtt } from "../providers/DttProvider";
|
|
7
|
+
import { TupleToolLabel } from "./TupleToolLabel";
|
|
8
|
+
import { DeleteButton } from "./DeleteButton";
|
|
9
|
+
import { AddTupleToolButton } from "./AddTupleToolButton";
|
|
10
|
+
import { GuideLinkButton } from "./GuideLinkButton";
|
|
11
|
+
export function TupleToolsAccordion() {
|
|
12
|
+
const [showConfigModal, setShowConfigModal] = useState(null);
|
|
13
|
+
const { dtt, removeTool, selectedBranch } = useDtt();
|
|
14
|
+
const tools = dtt.listTools(selectedBranch);
|
|
15
|
+
return (_jsxs(_Fragment, { children: [showConfigModal && (_jsx(ConfigureTupleToolModal, { tool: showConfigModal.tool, deleteIfCancelled: false, onClose: () => setShowConfigModal(null) })), _jsxs(Accordion.Item, { eventKey: "0", children: [_jsx(Accordion.Header, { children: _jsxs("div", { className: "d-flex align-items-center gap-2", children: [_jsx(Tools, {}), tools.length, " TupleTool", tools.length === 1 ? "" : "s", selectedBranch.length === 0 ? " (global)" : selectedBranch.length > 1 ? " (group)" : "", _jsx(GuideLinkButton, { page: "tupleTools", topic: "TupleTools" })] }) }), _jsxs(Accordion.Body, { style: { padding: 4 }, children: [tools.length === 0 ? (_jsxs("div", { className: "text-muted pt-3 pb-2", style: { paddingLeft: "1rem", paddingRight: "1rem" }, children: ["No TupleTools have been added", " ", selectedBranch.length === 0
|
|
16
|
+
? "to the decay"
|
|
17
|
+
: selectedBranch.length === 1
|
|
18
|
+
? "to this particle"
|
|
19
|
+
: "to this group", " ", "yet."] })) : (_jsx(ListGroup, { variant: "flush", children: tools.map((tool) => {
|
|
20
|
+
return (_jsxs(ListGroup.Item, { className: "d-flex justify-content-between align-items-start", children: [_jsx("div", { style: { width: 240 }, children: _jsx(TupleToolLabel, { tool: tool }) }), _jsxs(ButtonGroup, { size: "sm", children: [_jsx(OverlayTrigger, { overlay: _jsx(Tooltip, { children: "Configure TupleTool" }), children: _jsx(Button, { variant: "outline-secondary", onClick: () => setShowConfigModal({ tool }), children: _jsx(PencilSquare, {}) }) }), _jsx(DeleteButton, { outline: true, action: () => removeTool(selectedBranch, tool), popupMessage: "Remove?", placement: "right" })] })] }, tool.toString()));
|
|
21
|
+
}) })), _jsx("div", { className: "pb-2", style: { paddingLeft: "1rem", paddingRight: "1rem" }, children: _jsx(AddTupleToolButton, {}) })] })] })] }));
|
|
22
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import { TupleTool } from "../../models/tupleTool";
|
|
1
2
|
interface Props {
|
|
2
|
-
|
|
3
|
-
filterToolTags: string[];
|
|
4
|
-
onClose: () => void;
|
|
3
|
+
onClose: (newTool: TupleTool | null) => void;
|
|
5
4
|
}
|
|
6
|
-
export declare function AddTupleToolModal({
|
|
5
|
+
export declare function AddTupleToolModal({ onClose }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export {};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button,
|
|
3
|
-
import {
|
|
2
|
+
import { Button, ButtonGroup, FormControl, Modal } from "react-bootstrap";
|
|
3
|
+
import { TupleToolClassDropdown } from "../TupleToolClassDropdown";
|
|
4
4
|
import { TupleToolDocsAccordion } from "../TupleToolDocsAccordion";
|
|
5
5
|
import { useDtt } from "../../providers/DttProvider";
|
|
6
6
|
import { TupleTool } from "../../models/tupleTool";
|
|
7
7
|
import { useEffect, useRef, useState } from "react";
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import { ParticleLatex } from "../ParticleLatex";
|
|
9
|
+
export function AddTupleToolModal({ onClose }) {
|
|
10
|
+
const { dtt, addTool, selectedBranch } = useDtt();
|
|
10
11
|
const nameInputRef = useRef(null);
|
|
11
12
|
const [selectedTool, setSelectedTool] = useState(null);
|
|
12
13
|
useEffect(() => {
|
|
13
14
|
nameInputRef.current?.focus();
|
|
14
15
|
}, [selectedTool]);
|
|
15
|
-
return (_jsxs(Modal, { show: true, onHide: onClose, children: [_jsx(Modal.Header, { closeButton: true, children: "Add TupleTool" }), _jsxs(Modal.Body, { className: "gap-3 d-flex flex-column", children: [_jsxs(
|
|
16
|
+
return (_jsxs(Modal, { show: true, onHide: () => onClose(null), size: "lg", children: [_jsx(Modal.Header, { closeButton: true, children: _jsx(Modal.Title, { children: "Add TupleTool" }) }), _jsxs(Modal.Body, { className: "gap-3 d-flex flex-column", children: [selectedBranch.length > 0 && (_jsxs("div", { className: "d-flex flex-row gap-2", children: [_jsx("h6", { className: "my-auto", children: "Target:" }), selectedBranch.map((pid, i) => (_jsx(ParticleLatex, { particleId: pid }, i)))] })), _jsxs("div", { className: "d-flex flex-row gap-2", children: [_jsx(TupleToolClassDropdown, { onChange: (option) => {
|
|
16
17
|
if (option) {
|
|
17
18
|
setSelectedTool((prev) => new TupleTool(option.value, prev?.name || ""));
|
|
18
19
|
}
|
|
@@ -20,13 +21,13 @@ export function AddTupleToolModal({ branch, filterToolTags, onClose }) {
|
|
|
20
21
|
// Remove all non-word characters
|
|
21
22
|
const name = event.target.value.replaceAll(/[^\w]/g, "");
|
|
22
23
|
setSelectedTool((prev) => new TupleTool(prev.class, name));
|
|
23
|
-
}, value: selectedTool?.name || "", disabled: !selectedTool, isInvalid: !!selectedTool && dtt.toolExists(selectedTool,
|
|
24
|
+
}, value: selectedTool?.name || "", disabled: !selectedTool, isInvalid: !!selectedTool && dtt.toolExists(selectedTool, selectedBranch), onKeyDown: (event) => {
|
|
24
25
|
if (event.key === "Enter") {
|
|
25
|
-
addTool(
|
|
26
|
-
onClose();
|
|
26
|
+
addTool(selectedBranch, selectedTool);
|
|
27
|
+
onClose(selectedTool);
|
|
27
28
|
}
|
|
28
|
-
} }), selectedTool && (_jsxs(FormControl.Feedback, { type: "invalid", children: ["A ", selectedTool.class, " with the name \"", selectedTool.name, "\" already exists"] }))] }), selectedTool && _jsx(TupleToolDocsAccordion, { toolClass: selectedTool.class }),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
} }), selectedTool && (_jsxs(FormControl.Feedback, { type: "invalid", children: ["A ", selectedTool.class, " with the name \"", selectedTool.name, "\" already exists"] }))] }), selectedTool && _jsx(TupleToolDocsAccordion, { toolClass: selectedTool.class }), _jsxs(ButtonGroup, { className: "align-self-end", children: [_jsx(Button, { variant: "outline-dark", onClick: () => onClose(null), children: "Cancel" }), _jsx(Button, { disabled: !selectedTool || dtt.toolExists(selectedTool, selectedBranch), onClick: () => {
|
|
30
|
+
addTool(selectedBranch, selectedTool);
|
|
31
|
+
onClose(selectedTool);
|
|
32
|
+
}, children: "Add tool" })] })] })] }));
|
|
32
33
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TupleTool } from "../../models/tupleTool";
|
|
2
2
|
interface Props {
|
|
3
|
-
branch: string[];
|
|
4
3
|
tool: TupleTool;
|
|
4
|
+
deleteIfCancelled: boolean;
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
}
|
|
7
|
-
export declare function ConfigureTupleToolModal({
|
|
7
|
+
export declare function ConfigureTupleToolModal({ tool, deleteIfCancelled, onClose }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Button, Col, Form, Modal, OverlayTrigger, Row, Tooltip } from "react-bootstrap";
|
|
2
|
+
import { Button, ButtonGroup, Col, Form, Modal, OverlayTrigger, Row, Tooltip } from "react-bootstrap";
|
|
3
3
|
import { StrParamInput } from "../tupleToolParams/StrParamInput";
|
|
4
4
|
import { BoolParamInput } from "../tupleToolParams/BoolParamInput";
|
|
5
5
|
import { NumParamInput } from "../tupleToolParams/NumParamInput";
|
|
@@ -8,36 +8,53 @@ import { DictParamInput } from "../tupleToolParams/DictParamInput";
|
|
|
8
8
|
import { QuestionCircle } from "react-bootstrap-icons";
|
|
9
9
|
import { TupleToolDocsAccordion } from "../TupleToolDocsAccordion";
|
|
10
10
|
import { useDtt } from "../../providers/DttProvider";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
import { config } from "../../config";
|
|
12
|
+
import { toast } from "react-toastify";
|
|
13
|
+
export function ConfigureTupleToolModal({ tool, deleteIfCancelled, onClose }) {
|
|
14
|
+
const { dtt, updateToolParam, removeTool, selectedBranch } = useDtt();
|
|
15
|
+
const toolConfig = dtt.getToolConfig(selectedBranch, tool);
|
|
16
|
+
return (_jsxs(Modal, { show: true, size: "xl", fullscreen: "lg-down", backdrop: "static", keyboard: false, children: [_jsx(Modal.Header, { children: _jsxs(Modal.Title, { style: { textOverflow: "ellipsis", overflow: "hidden", whiteSpace: "nowrap" }, children: ["Configure ", tool.toString()] }) }), _jsxs(Modal.Body, { className: "gap-3 d-flex flex-column", children: [_jsx(Form, { children: Object.entries(toolConfig).map(([paramName, param]) => {
|
|
14
17
|
const { description, type, default: defaultValue, value } = param;
|
|
15
18
|
let inputComponent;
|
|
16
19
|
switch (type) {
|
|
17
20
|
case "str":
|
|
18
|
-
inputComponent = (_jsx(StrParamInput, { value: value, defaultValue: defaultValue, onChange: (newValue) => updateToolParam(
|
|
21
|
+
inputComponent = (_jsx(StrParamInput, { value: value, defaultValue: defaultValue, onChange: (newValue) => updateToolParam(selectedBranch, tool, paramName, newValue), param: paramName }));
|
|
19
22
|
break;
|
|
20
23
|
case "bool":
|
|
21
|
-
inputComponent = (_jsx(BoolParamInput, { value: value, onChange: (newValue) => updateToolParam(
|
|
24
|
+
inputComponent = (_jsx(BoolParamInput, { value: value, onChange: (newValue) => updateToolParam(selectedBranch, tool, paramName, newValue) }));
|
|
22
25
|
break;
|
|
23
26
|
case "int":
|
|
24
27
|
case "uint":
|
|
25
28
|
case "float":
|
|
26
|
-
inputComponent = (_jsx(NumParamInput, { type: type, value: value, defaultValue: defaultValue, onChange: (newValue) => updateToolParam(
|
|
29
|
+
inputComponent = (_jsx(NumParamInput, { type: type, value: value, defaultValue: defaultValue, onChange: (newValue) => updateToolParam(selectedBranch, tool, paramName, newValue) }));
|
|
27
30
|
break;
|
|
28
31
|
case "text":
|
|
29
|
-
inputComponent = (_jsx(ListParamInput, { initialValues: value, defaultValues: defaultValue, newItemValue: "", onChange: (newValue) => updateToolParam(
|
|
32
|
+
inputComponent = (_jsx(ListParamInput, { initialValues: value, defaultValues: defaultValue, newItemValue: "", onChange: (newValue) => updateToolParam(selectedBranch, tool, paramName, newValue), buildInnerInput: (props) => _jsx(StrParamInput, { ...props, param: paramName }) }));
|
|
30
33
|
break;
|
|
31
34
|
case "[int]":
|
|
32
35
|
case "[uint]":
|
|
33
36
|
case "[float]":
|
|
34
|
-
inputComponent = (_jsx(ListParamInput, { initialValues: value, defaultValues: defaultValue, newItemValue: 0, onChange: (newValue) => updateToolParam(
|
|
37
|
+
inputComponent = (_jsx(ListParamInput, { initialValues: value, defaultValues: defaultValue, newItemValue: 0, onChange: (newValue) => updateToolParam(selectedBranch, tool, paramName, newValue), buildInnerInput: (props) => (_jsx(NumParamInput, { type: type.slice(1, -1), ...props })) }));
|
|
35
38
|
break;
|
|
36
39
|
case "{str:str}":
|
|
37
40
|
case "{str:[str]}":
|
|
38
|
-
inputComponent = (_jsx(DictParamInput, { value: value, onChange: (newValue) => updateToolParam(
|
|
41
|
+
inputComponent = (_jsx(DictParamInput, { value: value, onChange: (newValue) => updateToolParam(selectedBranch, tool, paramName, newValue) }));
|
|
39
42
|
break;
|
|
40
43
|
}
|
|
41
44
|
return (_jsxs(Form.Group, { as: Row, className: "mb-2", children: [_jsxs(Form.Label, { column: true, sm: 3, children: [_jsx(OverlayTrigger, { overlay: _jsx(Tooltip, { children: description }), children: _jsx(QuestionCircle, {}) }), _jsxs("code", { children: [" ", paramName, " "] })] }), _jsx(Form.Label, { column: true, sm: 2, children: _jsxs("code", { children: [" ", type, " "] }) }), _jsx(Col, { sm: 7, children: inputComponent })] }, paramName));
|
|
42
|
-
}) })
|
|
45
|
+
}) }), _jsx(TupleToolDocsAccordion, { toolClass: tool.class }), _jsxs(ButtonGroup, { className: "align-self-end", children: [_jsx(Button, { variant: deleteIfCancelled ? "outline-danger" : "outline-dark", onClick: () => {
|
|
46
|
+
if (deleteIfCancelled) {
|
|
47
|
+
removeTool(selectedBranch, tool);
|
|
48
|
+
}
|
|
49
|
+
onClose();
|
|
50
|
+
}, children: "Cancel" }), _jsx(Button, { onClick: () => {
|
|
51
|
+
if (Object.keys(config.tupleToolValidation).includes(tool.class)) {
|
|
52
|
+
const errorMsg = config.tupleToolValidation[tool.class].validate(toolConfig);
|
|
53
|
+
if (errorMsg) {
|
|
54
|
+
toast(errorMsg, { type: "error" });
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
onClose();
|
|
59
|
+
}, children: "Save & close" })] })] })] }));
|
|
43
60
|
}
|
|
@@ -3,5 +3,5 @@ interface Props {
|
|
|
3
3
|
onClose: () => void;
|
|
4
4
|
currentRow?: RowData;
|
|
5
5
|
}
|
|
6
|
-
export declare function UploadDttConfigModal({ onClose, currentRow }: Props): import("react/jsx-runtime").JSX.Element
|
|
6
|
+
export declare function UploadDttConfigModal({ onClose, currentRow }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -28,7 +28,7 @@ export function UploadDttConfigModal({ onClose, currentRow }) {
|
|
|
28
28
|
if (importedConfig.descriptorTemplate === currentRow.decay.descriptors.template) {
|
|
29
29
|
updateRow(currentRow.id, (r) => ({
|
|
30
30
|
...r,
|
|
31
|
-
dtt: importedRow.dtt.
|
|
31
|
+
dtt: currentRow.line ? importedRow.dtt.withInputFromLine(currentRow.line) : importedRow.dtt,
|
|
32
32
|
}));
|
|
33
33
|
onClose();
|
|
34
34
|
}
|
|
@@ -42,9 +42,6 @@ export function UploadDttConfigModal({ onClose, currentRow }) {
|
|
|
42
42
|
onClose();
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
if (!metadata) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
45
|
return (_jsxs(Modal, { show: true, animation: false, children: [_jsx(Modal.Header, { children: _jsx(Modal.Title, { children: " Upload configuration file " }) }), _jsxs(Modal.Body, { children: [_jsx(Form.Group, { controlId: "formFile2", className: "mb-3", children: _jsx(Form.Control, { type: "file", multiple: !currentRow, accept: ".yaml", onChange: (event) => {
|
|
49
46
|
const files = event.target.files;
|
|
50
47
|
if (files) {
|
package/dist/config.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { DagreLayoutOptions } from "cytoscape-dagre";
|
|
2
|
+
import { ToolConfig } from "./models/dtt";
|
|
1
3
|
export declare const config: {
|
|
2
4
|
metadata_baseurl: string;
|
|
3
5
|
metadata_files: {
|
|
@@ -21,58 +23,28 @@ export declare const config: {
|
|
|
21
23
|
lifetime: string;
|
|
22
24
|
};
|
|
23
25
|
dttGraphOptions: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
height: string;
|
|
27
|
+
zoomMin: number;
|
|
28
|
+
zoomMax: number;
|
|
29
|
+
zoomStep: number;
|
|
30
|
+
layout: DagreLayoutOptions;
|
|
29
31
|
nodes: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
strokeWidth: number;
|
|
35
|
-
background: string;
|
|
36
|
-
};
|
|
37
|
-
color: {
|
|
38
|
-
background: string;
|
|
39
|
-
highlight: {
|
|
40
|
-
background: string;
|
|
41
|
-
};
|
|
42
|
-
hover: {
|
|
43
|
-
background: string;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
scaling: {
|
|
47
|
-
min: number;
|
|
48
|
-
max: number;
|
|
49
|
-
};
|
|
50
|
-
value: number;
|
|
51
|
-
shape: string;
|
|
52
|
-
shapeProperties: {
|
|
53
|
-
useBorderWithImage: boolean;
|
|
54
|
-
useImageSize: boolean;
|
|
55
|
-
};
|
|
32
|
+
draggable: boolean;
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
hoverColor: string;
|
|
56
36
|
};
|
|
57
37
|
edges: {
|
|
58
38
|
color: string;
|
|
59
39
|
width: number;
|
|
60
|
-
selectionWidth: number;
|
|
61
|
-
hoverWidth: number;
|
|
62
|
-
};
|
|
63
|
-
physics: {
|
|
64
|
-
enabled: boolean;
|
|
65
40
|
};
|
|
66
|
-
interaction: {
|
|
67
|
-
dragNodes: boolean;
|
|
68
|
-
multiselect: boolean;
|
|
69
|
-
selectConnectedEdges: boolean;
|
|
70
|
-
hoverConnectedEdges: boolean;
|
|
71
|
-
hover: boolean;
|
|
72
|
-
zoomView: boolean;
|
|
73
|
-
};
|
|
74
|
-
height: string;
|
|
75
|
-
autoResize: boolean;
|
|
76
|
-
width: string;
|
|
77
41
|
};
|
|
42
|
+
disabledTupleTools: string[];
|
|
43
|
+
tupleToolValidation: TupleToolValidation;
|
|
78
44
|
};
|
|
45
|
+
interface TupleToolValidation {
|
|
46
|
+
[toolClass: string]: {
|
|
47
|
+
validate: (config: ToolConfig) => string | null;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export {};
|
package/dist/config.js
CHANGED
|
@@ -21,52 +21,40 @@ export const config = {
|
|
|
21
21
|
lifetime: "secondary",
|
|
22
22
|
},
|
|
23
23
|
dttGraphOptions: {
|
|
24
|
+
height: "500px",
|
|
25
|
+
zoomMin: 0.5, // multiplier
|
|
26
|
+
zoomMax: 2.0, // multiplier
|
|
27
|
+
zoomStep: 0.018,
|
|
24
28
|
layout: {
|
|
25
|
-
|
|
29
|
+
rankDir: "TB", // top -> bottom
|
|
30
|
+
nodeSep: 50,
|
|
31
|
+
rankSep: 80,
|
|
32
|
+
animate: false,
|
|
26
33
|
},
|
|
27
34
|
nodes: {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
strokeWidth: 20,
|
|
33
|
-
background: "white",
|
|
34
|
-
},
|
|
35
|
-
color: {
|
|
36
|
-
background: "white",
|
|
37
|
-
highlight: { background: "white" },
|
|
38
|
-
hover: { background: "#eee" },
|
|
39
|
-
},
|
|
40
|
-
scaling: {
|
|
41
|
-
min: 32,
|
|
42
|
-
max: 32,
|
|
43
|
-
},
|
|
44
|
-
value: 1,
|
|
45
|
-
shape: "image",
|
|
46
|
-
shapeProperties: {
|
|
47
|
-
useBorderWithImage: true,
|
|
48
|
-
useImageSize: false,
|
|
49
|
-
},
|
|
35
|
+
draggable: false,
|
|
36
|
+
width: 80,
|
|
37
|
+
height: 30,
|
|
38
|
+
hoverColor: "royalblue",
|
|
50
39
|
},
|
|
51
40
|
edges: {
|
|
52
|
-
color: "
|
|
41
|
+
color: "#222",
|
|
53
42
|
width: 1,
|
|
54
|
-
selectionWidth: 0,
|
|
55
|
-
hoverWidth: 0,
|
|
56
43
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
44
|
+
},
|
|
45
|
+
disabledTupleTools: ["LoKi__Hybrid__ArrayTupleTool"],
|
|
46
|
+
tupleToolValidation: {
|
|
47
|
+
["LoKi__Hybrid__TupleTool"]: {
|
|
48
|
+
validate: (config) => {
|
|
49
|
+
const hasVariables = Object.entries(config["Variables"].value).length > 0;
|
|
50
|
+
const hasBoolVariables = Object.entries(config["BoolVariables"].value).length > 0;
|
|
51
|
+
const hasFloatVariables = Object.entries(config["FloatVariables"].value).length > 0;
|
|
52
|
+
const hasIntVariables = Object.entries(config["IntVariables"].value).length > 0;
|
|
53
|
+
if (!hasVariables && !hasBoolVariables && !hasFloatVariables && !hasIntVariables) {
|
|
54
|
+
return "Please add at least one variable";
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
},
|
|
67
58
|
},
|
|
68
|
-
height: "500px",
|
|
69
|
-
autoResize: true,
|
|
70
|
-
width: "100%",
|
|
71
59
|
},
|
|
72
60
|
};
|
package/dist/models/bkPath.js
CHANGED
|
@@ -8,7 +8,7 @@ export class BkPath {
|
|
|
8
8
|
fileName;
|
|
9
9
|
constructor(path) {
|
|
10
10
|
if (!BkPath.isValid(path)) {
|
|
11
|
-
throw new Error(`Invalid
|
|
11
|
+
throw new Error(`Invalid dataset: ${path}`);
|
|
12
12
|
}
|
|
13
13
|
const parts = path.split("/");
|
|
14
14
|
const [, type, year] = parts;
|
package/dist/models/dtt.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export interface DttConfig {
|
|
|
81
81
|
[particleId: string]: BranchConfig;
|
|
82
82
|
};
|
|
83
83
|
descriptorTemplate?: string;
|
|
84
|
-
|
|
84
|
+
input?: string;
|
|
85
85
|
groups: {
|
|
86
86
|
[particleGroup: string]: GroupConfig;
|
|
87
87
|
};
|
|
@@ -117,7 +117,7 @@ export default class Dtt {
|
|
|
117
117
|
toSavedConfig(): SavedDttConfig;
|
|
118
118
|
private static getBranchConfigs;
|
|
119
119
|
static create(descriptorTemplate: string, branchItemsList: BranchMapItem[], inputs: string[], name: string, toolMetadata: ToolMetadata): Dtt;
|
|
120
|
-
|
|
120
|
+
withInputFromLine(line: StrippingLine): Dtt;
|
|
121
121
|
withName(name: string): Dtt;
|
|
122
122
|
withConfig(config: DttConfig): Dtt;
|
|
123
123
|
withAddedTool(tool: TupleTool, branch?: string[]): Dtt;
|
|
@@ -128,11 +128,14 @@ export default class Dtt {
|
|
|
128
128
|
getToolsByBranch(branch?: string[]): {
|
|
129
129
|
[toolString: string]: ToolConfig;
|
|
130
130
|
};
|
|
131
|
+
getBranchTools(branch?: string[]): string[];
|
|
131
132
|
private static getToolsByBranchFromConfig;
|
|
132
133
|
getParticlesByBranchId(branchIds: string[]): string[];
|
|
133
134
|
private static getDefaultToolConfig;
|
|
134
135
|
getToolConfig(branch: string[], tool: TupleTool): ToolConfig;
|
|
135
136
|
listTools(branch?: string[]): TupleTool[];
|
|
137
|
+
getGroupsWithTools(): string[];
|
|
138
|
+
getGroupsThatIncludeBranch(branch: string[]): string[];
|
|
136
139
|
toolExists(tool: TupleTool, branch?: string[]): boolean;
|
|
137
140
|
}
|
|
138
141
|
export {};
|