lhcb-ntuple-wizard-test 1.3.2 → 2.0.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/README.md +1 -2
- package/package.json +42 -21
- package/dist/components/App.js +0 -99
- package/dist/components/ConfigDict.js +0 -103
- package/dist/components/ConfigList.js +0 -94
- package/dist/components/ConfigNode.js +0 -320
- package/dist/components/ConfigValue.js +0 -86
- package/dist/components/Dataset.js +0 -67
- package/dist/components/Decay.js +0 -50
- package/dist/components/DecayItem.js +0 -101
- package/dist/components/DecayTag.js +0 -52
- package/dist/components/DecayTree.js +0 -451
- package/dist/components/DecaysList.js +0 -107
- package/dist/components/DeleteButton.js +0 -56
- package/dist/components/DescriptorsSearch.js +0 -352
- package/dist/components/EventTypeBadge.js +0 -45
- package/dist/components/ItemSearch.js +0 -120
- package/dist/components/LinesTable.js +0 -1105
- package/dist/components/NtupleWizard.js +0 -142
- package/dist/components/ParticleTag.js +0 -54
- package/dist/components/PolarityBadge.js +0 -35
- package/dist/components/SearchItem.js +0 -99
- package/dist/components/SelectParticle.js +0 -61
- package/dist/components/SelectTag.js +0 -66
- package/dist/components/SelectTool.js +0 -59
- package/dist/components/SelectVariables.js +0 -106
- package/dist/components/StrippingBadge.js +0 -64
- package/dist/components/StrippingLine.js +0 -50
- package/dist/components/TupleTool.js +0 -46
- package/dist/components/VariablesSearch.js +0 -128
- package/dist/components/YearBadge.js +0 -35
- package/dist/config.json +0 -72
- package/dist/contexts/MetadataContext.js +0 -135
- package/dist/index.js +0 -20
- package/dist/lib/BKPath.js +0 -58
- package/dist/lib/DTTConfig.js +0 -178
- package/dist/lib/mathjax.js +0 -35
- package/dist/lib/utils.js +0 -191
- package/dist/style/DecaysList.css +0 -15
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _reactBootstrap = require("react-bootstrap");
|
|
10
|
-
var _MetadataContext = _interopRequireDefault(require("../contexts/MetadataContext"));
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
17
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*****************************************************************************\
|
|
18
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
19
|
-
* *
|
|
20
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
21
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
22
|
-
* *
|
|
23
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
24
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
25
|
-
* or submit itself to any jurisdiction. *
|
|
26
|
-
\*****************************************************************************/
|
|
27
|
-
class StrippingBadge extends _react.default.Component {
|
|
28
|
-
render() {
|
|
29
|
-
// TODO: configurable baseURL, remove baseURL from metadata (or make it a top-level key)
|
|
30
|
-
const url = this.props.line && this.context.loaded.stripping ? this.context.metadata.stripping[this.props.version][this.props.line].url[this.props.stream] : "http://lhcbdoc.web.cern.ch/lhcbdoc/stripping/config/stripping" + this.props.version + "/index.html";
|
|
31
|
-
const {
|
|
32
|
-
description
|
|
33
|
-
} = this.context.loaded.strippingHints ? this.context.metadata.strippingHints[this.props.version] : {
|
|
34
|
-
description: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Spinner, {
|
|
35
|
-
animation: "border"
|
|
36
|
-
})
|
|
37
|
-
};
|
|
38
|
-
const badgeProps = this.props.showlink ? {
|
|
39
|
-
as: "a",
|
|
40
|
-
href: url,
|
|
41
|
-
target: "_blank"
|
|
42
|
-
} : {};
|
|
43
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.OverlayTrigger, {
|
|
44
|
-
overlay: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Tooltip, {
|
|
45
|
-
children: description
|
|
46
|
-
}),
|
|
47
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Badge, _objectSpread(_objectSpread({
|
|
48
|
-
pill: true,
|
|
49
|
-
bg: "info"
|
|
50
|
-
}, badgeProps), {}, {
|
|
51
|
-
children: "S" + this.props.version
|
|
52
|
-
}))
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
_defineProperty(StrippingBadge, "contextType", _MetadataContext.default);
|
|
57
|
-
StrippingBadge.propTypes = {
|
|
58
|
-
line: _propTypes.default.string,
|
|
59
|
-
version: _propTypes.default.string,
|
|
60
|
-
stream: _propTypes.default.string,
|
|
61
|
-
link: _propTypes.default.string,
|
|
62
|
-
showlink: _propTypes.default.bool
|
|
63
|
-
};
|
|
64
|
-
var _default = exports.default = StrippingBadge;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _reactBootstrap = require("react-bootstrap");
|
|
10
|
-
var _StrippingBadge = _interopRequireDefault(require("./StrippingBadge"));
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
17
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*****************************************************************************\
|
|
18
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
19
|
-
* *
|
|
20
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
21
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
22
|
-
* *
|
|
23
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
24
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
25
|
-
* or submit itself to any jurisdiction. *
|
|
26
|
-
\*****************************************************************************/
|
|
27
|
-
class StrippingLine extends _react.default.Component {
|
|
28
|
-
render() {
|
|
29
|
-
const strippingInfo = this.props.versions.map(version => /*#__PURE__*/(0, _jsxRuntime.jsx)(_StrippingBadge.default, _objectSpread({
|
|
30
|
-
version: version,
|
|
31
|
-
showlink: this.props.showlink
|
|
32
|
-
}, this.props), "".concat(this.props.line, "-S").concat(version, "-badge")));
|
|
33
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
34
|
-
children: [this.props.line, /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Stack, {
|
|
35
|
-
direction: "horizontal",
|
|
36
|
-
style: {
|
|
37
|
-
flexWrap: "wrap"
|
|
38
|
-
},
|
|
39
|
-
gap: 1,
|
|
40
|
-
children: strippingInfo
|
|
41
|
-
})]
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
StrippingLine.propTypes = {
|
|
46
|
-
versions: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
47
|
-
line: _propTypes.default.string,
|
|
48
|
-
showlink: _propTypes.default.bool
|
|
49
|
-
};
|
|
50
|
-
var _default = exports.default = StrippingLine;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _reactBootstrap = require("react-bootstrap");
|
|
10
|
-
var _MetadataContext = _interopRequireDefault(require("../contexts/MetadataContext"));
|
|
11
|
-
var _utils = require("../lib/utils");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
16
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*****************************************************************************\
|
|
17
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
18
|
-
* *
|
|
19
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
20
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
21
|
-
* *
|
|
22
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
23
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
24
|
-
* or submit itself to any jurisdiction. *
|
|
25
|
-
\*****************************************************************************/
|
|
26
|
-
class TupleTool extends _react.default.Component {
|
|
27
|
-
render() {
|
|
28
|
-
const toolClass = this.props.tool.split("/")[0];
|
|
29
|
-
const description = this.context.loaded.tupleTools ? (0, _utils.get_tupleTool_description)(toolClass, this.context.metadata.tupleTools.tupleTools) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Spinner, {
|
|
30
|
-
animation: "border"
|
|
31
|
-
});
|
|
32
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.OverlayTrigger, {
|
|
33
|
-
overlay: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Tooltip, {
|
|
34
|
-
children: description
|
|
35
|
-
}),
|
|
36
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
37
|
-
children: this.props.tool
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
_defineProperty(TupleTool, "contextType", _MetadataContext.default);
|
|
43
|
-
TupleTool.propTypes = {
|
|
44
|
-
tool: _propTypes.default.string
|
|
45
|
-
};
|
|
46
|
-
var _default = exports.default = TupleTool;
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _utils = require("../utils");
|
|
9
|
-
var _Tooltip = _interopRequireDefault(require("react-bootstrap/Tooltip"));
|
|
10
|
-
var _OverlayTrigger = _interopRequireDefault(require("react-bootstrap/OverlayTrigger"));
|
|
11
|
-
var _MetadataContext = _interopRequireDefault(require("../MetadataContext"));
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*****************************************************************************\
|
|
19
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
20
|
-
* *
|
|
21
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
22
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
23
|
-
* *
|
|
24
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
25
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
26
|
-
* or submit itself to any jurisdiction. *
|
|
27
|
-
\*****************************************************************************/
|
|
28
|
-
const {
|
|
29
|
-
search
|
|
30
|
-
} = window.location;
|
|
31
|
-
const query = new URLSearchParams(search).get("s");
|
|
32
|
-
//const [searchQuery, setSearchQuery] = useState(query || '')
|
|
33
|
-
|
|
34
|
-
function compare(a, b) {
|
|
35
|
-
return Object.keys(a)[0] > Object.keys(b)[0] ? 1 : Object.keys(a)[0] < Object.keys(b)[0] ? -1 : 0;
|
|
36
|
-
}
|
|
37
|
-
class VariablesSearch extends _react.default.Component {
|
|
38
|
-
constructor() {
|
|
39
|
-
super(...arguments);
|
|
40
|
-
_defineProperty(this, "state", {
|
|
41
|
-
variables: (0, _utils.parse_searchitem_descriptions)(this.context.metadata.lokiVariables),
|
|
42
|
-
searchQuery: query || ""
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
filterVariables(variables, query) {
|
|
46
|
-
/*
|
|
47
|
-
const nInclOptions = variables.filter(
|
|
48
|
-
variable => !Object.keys(variable)[0].toLowerCase().includes(query.toLowerCase())
|
|
49
|
-
);
|
|
50
|
-
*/
|
|
51
|
-
const inclOptions = variables.filter(variable => Object.keys(variable)[0].toLowerCase().includes(query.toLowerCase()) && Object.keys(variable)[0].toLowerCase() !== query.toLowerCase());
|
|
52
|
-
const matchedOptions = variables.filter(variable => Object.keys(variable)[0].toLowerCase() === query.toLowerCase());
|
|
53
|
-
const orderedNewOptions = matchedOptions.sort(compare);
|
|
54
|
-
//this.setState({
|
|
55
|
-
return orderedNewOptions.concat(inclOptions);
|
|
56
|
-
//});
|
|
57
|
-
/* if (!query) {
|
|
58
|
-
return variables;
|
|
59
|
-
}
|
|
60
|
-
return variables.filter((variable) => {
|
|
61
|
-
const name = Object.keys(variable)[0].toLowerCase();
|
|
62
|
-
return name.includes(query.toLowerCase());
|
|
63
|
-
});*/
|
|
64
|
-
}
|
|
65
|
-
render() {
|
|
66
|
-
//const {decay} = this.props
|
|
67
|
-
const filteredVariables = this.filterVariables(this.state.variables, this.state.searchQuery);
|
|
68
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
69
|
-
width: "20px",
|
|
70
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("form", {
|
|
71
|
-
action: "/",
|
|
72
|
-
method: "get",
|
|
73
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("label", {
|
|
74
|
-
htmlFor: "header-search",
|
|
75
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
76
|
-
className: "visually-hidden",
|
|
77
|
-
children: "Search variables"
|
|
78
|
-
})
|
|
79
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
|
|
80
|
-
value: this.state.searchQuery,
|
|
81
|
-
onInput: e => this.setState({
|
|
82
|
-
searchQuery: e.target.value
|
|
83
|
-
}),
|
|
84
|
-
type: "text",
|
|
85
|
-
id: "header-search",
|
|
86
|
-
placeholder: "Search variables",
|
|
87
|
-
name: "s"
|
|
88
|
-
})]
|
|
89
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
90
|
-
className: "scroll",
|
|
91
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
92
|
-
children: filteredVariables.map((variable, index) =>
|
|
93
|
-
/*#__PURE__*/
|
|
94
|
-
// <li key={Object.keys(variable)[0]}>
|
|
95
|
-
(0, _jsxRuntime.jsx)("div", {
|
|
96
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
97
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_OverlayTrigger.default, {
|
|
98
|
-
placement: "top",
|
|
99
|
-
delay: {
|
|
100
|
-
hide: 450,
|
|
101
|
-
show: 300
|
|
102
|
-
},
|
|
103
|
-
overlay: props => /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip.default, _objectSpread(_objectSpread({}, props), {}, {
|
|
104
|
-
children: Object.values(variable)[0]
|
|
105
|
-
})),
|
|
106
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
107
|
-
children: Object.keys(variable)[0]
|
|
108
|
-
})
|
|
109
|
-
})
|
|
110
|
-
})
|
|
111
|
-
}, index)
|
|
112
|
-
|
|
113
|
-
//</li>
|
|
114
|
-
)
|
|
115
|
-
})
|
|
116
|
-
})]
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
_defineProperty(VariablesSearch, "contextType", _MetadataContext.default);
|
|
121
|
-
var _default = exports.default = VariablesSearch;
|
|
122
|
-
/* <div>
|
|
123
|
-
<ul>
|
|
124
|
-
{filteredVariables.map(variable => (
|
|
125
|
-
<li key={Object.keys(variable)[0]}>{Object.keys(variable)[0]}</li>
|
|
126
|
-
))}
|
|
127
|
-
</ul>
|
|
128
|
-
</div> */
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _reactBootstrap = require("react-bootstrap");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
/*****************************************************************************\
|
|
13
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
14
|
-
* *
|
|
15
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
16
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
17
|
-
* *
|
|
18
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
19
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
20
|
-
* or submit itself to any jurisdiction. *
|
|
21
|
-
\*****************************************************************************/
|
|
22
|
-
|
|
23
|
-
class YearBadge extends _react.default.Component {
|
|
24
|
-
render() {
|
|
25
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Badge, {
|
|
26
|
-
pill: true,
|
|
27
|
-
bg: "success",
|
|
28
|
-
children: this.props.year
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
YearBadge.propTypes = {
|
|
33
|
-
year: _propTypes.default.string
|
|
34
|
-
};
|
|
35
|
-
var _default = exports.default = YearBadge;
|
package/dist/config.json
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"metadata_baseurl": "https://lbwizard-metadata.web.cern.ch/3.1.0/",
|
|
3
|
-
"metadata_files": {
|
|
4
|
-
"particleProperties": "particle_properties",
|
|
5
|
-
"lokiVariables": "loki",
|
|
6
|
-
"decays": "decays",
|
|
7
|
-
"stripping": "stripping",
|
|
8
|
-
"strippingHints": "stripping_hints",
|
|
9
|
-
"userHints": "user_hints",
|
|
10
|
-
"tupleTools": "tupletools",
|
|
11
|
-
"dataset": "dataset",
|
|
12
|
-
"kgdoc": "kgdoc",
|
|
13
|
-
"embedding": "embedding"
|
|
14
|
-
},
|
|
15
|
-
"batch_size": 10,
|
|
16
|
-
"particleTagGroupStyles": {
|
|
17
|
-
"category": "dark",
|
|
18
|
-
"charge": "primary",
|
|
19
|
-
"flavour": "success",
|
|
20
|
-
"spin": "danger",
|
|
21
|
-
"lifetime": "secondary"
|
|
22
|
-
},
|
|
23
|
-
"dttGraphOptions": {
|
|
24
|
-
"layout": {
|
|
25
|
-
"hierarchical": {"sortMethod": "directed"}
|
|
26
|
-
},
|
|
27
|
-
"nodes": {
|
|
28
|
-
"borderWidth": 0,
|
|
29
|
-
"borderWidthSelected": 0,
|
|
30
|
-
"imagePadding": 10,
|
|
31
|
-
"font": {
|
|
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
|
-
}
|
|
50
|
-
},
|
|
51
|
-
"edges": {
|
|
52
|
-
"color": "black",
|
|
53
|
-
"width": 1,
|
|
54
|
-
"selectionWidth": 0,
|
|
55
|
-
"hoverWidth": 0
|
|
56
|
-
},
|
|
57
|
-
"physics": {
|
|
58
|
-
"enabled": false
|
|
59
|
-
},
|
|
60
|
-
"interaction": {
|
|
61
|
-
"dragNodes": false,
|
|
62
|
-
"multiselect": true,
|
|
63
|
-
"selectConnectedEdges": false,
|
|
64
|
-
"hoverConnectedEdges": false,
|
|
65
|
-
"hover": true,
|
|
66
|
-
"zoomView": false
|
|
67
|
-
},
|
|
68
|
-
"height": "500px",
|
|
69
|
-
"autoResize": true,
|
|
70
|
-
"width": "100%"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MetadataContext = void 0;
|
|
7
|
-
exports.MetadataLoadWall = MetadataLoadWall;
|
|
8
|
-
exports.MetadataProvider = MetadataProvider;
|
|
9
|
-
exports.createMetadataLoadWall = createMetadataLoadWall;
|
|
10
|
-
exports.createMetadataProvider = createMetadataProvider;
|
|
11
|
-
exports.useMetadataContext = exports.default = void 0;
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
var _reactBootstrap = require("react-bootstrap");
|
|
14
|
-
var _react = require("react");
|
|
15
|
-
var _utils = require("../lib/utils");
|
|
16
|
-
var _config2 = _interopRequireDefault(require("../config"));
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
22
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
23
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*****************************************************************************\
|
|
24
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
25
|
-
* *
|
|
26
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
27
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
28
|
-
* *
|
|
29
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
30
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
31
|
-
* or submit itself to any jurisdiction. *
|
|
32
|
-
\*****************************************************************************/
|
|
33
|
-
const MetadataContext = exports.MetadataContext = /*#__PURE__*/(0, _react.createContext)({});
|
|
34
|
-
var _default = exports.default = MetadataContext;
|
|
35
|
-
const useMetadataContext = _init => (0, _react.useContext)(MetadataContext);
|
|
36
|
-
exports.useMetadataContext = useMetadataContext;
|
|
37
|
-
function createMetadataProvider(_config, _ref) {
|
|
38
|
-
let {
|
|
39
|
-
children
|
|
40
|
-
} = _ref;
|
|
41
|
-
let metadataTemplate = {};
|
|
42
|
-
Object.keys(_config.metadata_files).forEach((key, _index) => {
|
|
43
|
-
metadataTemplate[key] = {};
|
|
44
|
-
});
|
|
45
|
-
const [metadata, setMetadata] = (0, _react.useState)(metadataTemplate);
|
|
46
|
-
let loadedTemplate = {};
|
|
47
|
-
Object.keys(_config.metadata_files).forEach((key, _index) => {
|
|
48
|
-
loadedTemplate[key] = false;
|
|
49
|
-
});
|
|
50
|
-
const [loaded, setLoaded] = (0, _react.useState)(loadedTemplate);
|
|
51
|
-
const [error, setError] = (0, _react.useState)(null);
|
|
52
|
-
const getMetadata = async () => {
|
|
53
|
-
Object.keys(_config.metadata_files).forEach((key, _index) => {
|
|
54
|
-
(0, _utils.loadDict)(_config.metadata_files[key]).then(result => {
|
|
55
|
-
setMetadata(prevState => _objectSpread(_objectSpread({}, prevState), {}, {
|
|
56
|
-
[key]: result
|
|
57
|
-
}));
|
|
58
|
-
setLoaded(prevState => _objectSpread(_objectSpread({}, prevState), {}, {
|
|
59
|
-
[key]: true
|
|
60
|
-
}));
|
|
61
|
-
}, e => {
|
|
62
|
-
setError(e);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
(0, _react.useEffect)(() => {
|
|
67
|
-
getMetadata();
|
|
68
|
-
}, []);
|
|
69
|
-
if (error) {
|
|
70
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("h1", {
|
|
71
|
-
children: ["Oops: ", "".concat(error)]
|
|
72
|
-
});
|
|
73
|
-
} else {
|
|
74
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MetadataContext.Provider, {
|
|
75
|
-
value: {
|
|
76
|
-
loaded: loaded,
|
|
77
|
-
metadata: metadata
|
|
78
|
-
},
|
|
79
|
-
children: children
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function MetadataProvider(children) {
|
|
84
|
-
return createMetadataProvider(_config2.default, children);
|
|
85
|
-
}
|
|
86
|
-
MetadataProvider.propTypes = {
|
|
87
|
-
children: _propTypes.default.node
|
|
88
|
-
};
|
|
89
|
-
/* Wrap a component with <MetadataLoadWall> to show a loading screen until all metadata is fetched
|
|
90
|
-
* This is the "lazy option". It's better UX to have a fine-grained response to individual keys in context.loaded
|
|
91
|
-
* e.g. this.context.loaded.particleProperties? this.context.metadata.particleProperties[particle].html : particle;
|
|
92
|
-
*/
|
|
93
|
-
function createMetadataLoadWall(_config, _ref2) {
|
|
94
|
-
let {
|
|
95
|
-
children
|
|
96
|
-
} = _ref2;
|
|
97
|
-
const context = useMetadataContext();
|
|
98
|
-
if (Object.values(context.loaded).some(v => !v)) {
|
|
99
|
-
const loadingSpinner = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Spinner, {
|
|
100
|
-
animation: "border",
|
|
101
|
-
role: "status",
|
|
102
|
-
size: "sm"
|
|
103
|
-
});
|
|
104
|
-
const doneBadge = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Badge, {
|
|
105
|
-
bg: "success",
|
|
106
|
-
children: "Done"
|
|
107
|
-
});
|
|
108
|
-
const message = Object.keys(context.loaded).map(x => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.ListGroup.Item, {
|
|
109
|
-
children: [x, " ", context.loaded[x] ? doneBadge : loadingSpinner]
|
|
110
|
-
}, x));
|
|
111
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
112
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactBootstrap.Alert, {
|
|
113
|
-
variant: "warning",
|
|
114
|
-
children: ["Fetching metadata from the", " ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.Alert.Link, {
|
|
115
|
-
href: _config.metadata_baseurl,
|
|
116
|
-
target: "_blank",
|
|
117
|
-
children: "backend"
|
|
118
|
-
}), ". This should take a few seconds."]
|
|
119
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactBootstrap.ListGroup, {
|
|
120
|
-
variant: "flush",
|
|
121
|
-
children: message
|
|
122
|
-
})]
|
|
123
|
-
});
|
|
124
|
-
} else {
|
|
125
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
126
|
-
children: children
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
function MetadataLoadWall(children) {
|
|
131
|
-
return createMetadataLoadWall(_config2.default, children);
|
|
132
|
-
}
|
|
133
|
-
MetadataLoadWall.propTypes = {
|
|
134
|
-
children: _propTypes.default.node
|
|
135
|
-
};
|
package/dist/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _client = require("react-dom/client");
|
|
4
|
-
var _App = _interopRequireDefault(require("./components/App"));
|
|
5
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
6
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
-
/*****************************************************************************\
|
|
8
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
9
|
-
* *
|
|
10
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
11
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
12
|
-
* *
|
|
13
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
14
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
15
|
-
* or submit itself to any jurisdiction. *
|
|
16
|
-
\*****************************************************************************/
|
|
17
|
-
|
|
18
|
-
const container = document.getElementById("root");
|
|
19
|
-
const root = (0, _client.createRoot)(container);
|
|
20
|
-
root.render(/*#__PURE__*/(0, _jsxRuntime.jsx)(_App.default, {}));
|
package/dist/lib/BKPath.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
/*****************************************************************************\
|
|
8
|
-
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
9
|
-
* *
|
|
10
|
-
* This software is distributed under the terms of the GNU General Public *
|
|
11
|
-
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
12
|
-
* *
|
|
13
|
-
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
14
|
-
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
15
|
-
* or submit itself to any jurisdiction. *
|
|
16
|
-
\*****************************************************************************/
|
|
17
|
-
class BKPath {
|
|
18
|
-
constructor(path) {
|
|
19
|
-
this.path = path;
|
|
20
|
-
this.isMC = path.split("/")[1] === "MC";
|
|
21
|
-
}
|
|
22
|
-
getStrippingVersion() {
|
|
23
|
-
return this.path.split("/")[this.isMC ? 7 : 6].replace("Stripping", "").replace("NoPrescalingFlagged", "");
|
|
24
|
-
}
|
|
25
|
-
getYear() {
|
|
26
|
-
return this.path.split("/")[2].replace("Collision", "20");
|
|
27
|
-
}
|
|
28
|
-
getPolarity() {
|
|
29
|
-
const matchingPolarities = ["MagUp", "MagDown"].filter(polarity => this.path.includes(polarity));
|
|
30
|
-
if (matchingPolarities.length === 1) {
|
|
31
|
-
return matchingPolarities;
|
|
32
|
-
} else {
|
|
33
|
-
return "?";
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
getFilename() {
|
|
37
|
-
return this.path.split("/")[this.isMC ? 9 : 8];
|
|
38
|
-
}
|
|
39
|
-
getEventType() {
|
|
40
|
-
return this.path.split("/")[this.isMC ? 8 : 7];
|
|
41
|
-
}
|
|
42
|
-
isValid() {
|
|
43
|
-
const bkArray = this.path.split("/");
|
|
44
|
-
if (bkArray[0] !== "") {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
if (!this.path.toLowerCase().endsWith("dst")) {
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
if (bkArray.length === 9 && bkArray[1] === "LHCb") {
|
|
51
|
-
return true;
|
|
52
|
-
} else if (bkArray.length === 10 && bkArray[1] === "MC") {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
var _default = exports.default = BKPath;
|