lhcb-ntuple-wizard 1.0.1
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/COPYING +674 -0
- package/README.md +25 -0
- package/dist/components/App.js +136 -0
- package/dist/components/ConfigDict.js +117 -0
- package/dist/components/ConfigList.js +115 -0
- package/dist/components/ConfigNode.js +345 -0
- package/dist/components/ConfigValue.js +99 -0
- package/dist/components/Dataset.js +82 -0
- package/dist/components/Decay.js +64 -0
- package/dist/components/DecayItem.js +122 -0
- package/dist/components/DecayTag.js +65 -0
- package/dist/components/DecayTree.js +518 -0
- package/dist/components/DecaysList.js +121 -0
- package/dist/components/DeleteButton.js +69 -0
- package/dist/components/DescriptorsSearch.js +394 -0
- package/dist/components/EventTypeBadge.js +58 -0
- package/dist/components/ItemSearch.js +146 -0
- package/dist/components/LinesTable.js +810 -0
- package/dist/components/NtupleWizard.js +125 -0
- package/dist/components/ParticleTag.js +67 -0
- package/dist/components/PolarityBadge.js +48 -0
- package/dist/components/SearchItem.js +130 -0
- package/dist/components/SelectParticle.js +94 -0
- package/dist/components/SelectTag.js +88 -0
- package/dist/components/SelectTool.js +80 -0
- package/dist/components/SelectVariables.js +133 -0
- package/dist/components/StrippingBadge.js +76 -0
- package/dist/components/StrippingLine.js +66 -0
- package/dist/components/TupleTool.js +59 -0
- package/dist/components/VariablesSearch.js +154 -0
- package/dist/components/YearBadge.js +48 -0
- package/dist/config.json +83 -0
- package/dist/contexts/MetadataContext.js +154 -0
- package/dist/index.js +18 -0
- package/dist/lib/BKPath.js +83 -0
- package/dist/lib/DTTConfig.js +213 -0
- package/dist/lib/mathjax.js +36 -0
- package/dist/lib/utils.js +228 -0
- package/dist/style/DecaysList.css +15 -0
- package/package.json +65 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
exports.tex2svg = tex2svg;
|
|
8
|
+
var _mathjax = require("mathjax-full/js/mathjax");
|
|
9
|
+
var _tex = require("mathjax-full/js/input/tex");
|
|
10
|
+
var _svg = require("mathjax-full/js/output/svg");
|
|
11
|
+
/*****************************************************************************\
|
|
12
|
+
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
13
|
+
* *
|
|
14
|
+
* This software is distributed under the terms of the GNU General Public *
|
|
15
|
+
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
16
|
+
* *
|
|
17
|
+
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
18
|
+
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
19
|
+
* or submit itself to any jurisdiction. *
|
|
20
|
+
\*****************************************************************************/
|
|
21
|
+
|
|
22
|
+
function tex2svg(inputTeX) {
|
|
23
|
+
var tex = new _tex.TeX({
|
|
24
|
+
packages: ["base", "ams"]
|
|
25
|
+
});
|
|
26
|
+
var svg = new _svg.SVG({
|
|
27
|
+
fontCache: "none"
|
|
28
|
+
});
|
|
29
|
+
var tex_html = _mathjax.mathjax.document("", {
|
|
30
|
+
InputJax: tex,
|
|
31
|
+
OutputJax: svg
|
|
32
|
+
});
|
|
33
|
+
return tex_html.convert(inputTeX);
|
|
34
|
+
}
|
|
35
|
+
var _default = tex2svg;
|
|
36
|
+
exports.default = _default;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.dec_to_options = dec_to_options;
|
|
8
|
+
exports.download = download;
|
|
9
|
+
exports.downloadBlob = downloadBlob;
|
|
10
|
+
exports.downloadConfig_old = downloadConfig_old;
|
|
11
|
+
exports.downloadZip = downloadZip;
|
|
12
|
+
exports.getDTreeName = getDTreeName;
|
|
13
|
+
exports.get_tupleTool_config = get_tupleTool_config;
|
|
14
|
+
exports.get_tupleTool_description = get_tupleTool_description;
|
|
15
|
+
exports.list_to_options = list_to_options;
|
|
16
|
+
exports.loadDict = loadDict;
|
|
17
|
+
exports.parse_searchitem_descriptions = parse_searchitem_descriptions;
|
|
18
|
+
exports.parse_tupleTools = parse_tupleTools;
|
|
19
|
+
exports.tupletools_to_option = tupletools_to_option;
|
|
20
|
+
var _mathjaxReact = require("mathjax-react");
|
|
21
|
+
var _pako = _interopRequireDefault(require("pako"));
|
|
22
|
+
var _config = _interopRequireDefault(require("../config"));
|
|
23
|
+
var _jszip = _interopRequireDefault(require("jszip"));
|
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
27
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
28
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
29
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
30
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
31
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
32
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
34
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
35
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
36
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
37
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
38
|
+
function loadDict(_x) {
|
|
39
|
+
return _loadDict.apply(this, arguments);
|
|
40
|
+
}
|
|
41
|
+
function _loadDict() {
|
|
42
|
+
_loadDict = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(path) {
|
|
43
|
+
var url, response, data, unzipped, decoded, content;
|
|
44
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
45
|
+
while (1) switch (_context.prev = _context.next) {
|
|
46
|
+
case 0:
|
|
47
|
+
url = _config.default["metadata_baseurl"] + path + ".json.gz";
|
|
48
|
+
_context.next = 3;
|
|
49
|
+
return fetch(url);
|
|
50
|
+
case 3:
|
|
51
|
+
response = _context.sent;
|
|
52
|
+
if (response.ok) {
|
|
53
|
+
_context.next = 7;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
console.error(response);
|
|
57
|
+
return _context.abrupt("return", null);
|
|
58
|
+
case 7:
|
|
59
|
+
_context.next = 9;
|
|
60
|
+
return response.arrayBuffer();
|
|
61
|
+
case 9:
|
|
62
|
+
data = _context.sent;
|
|
63
|
+
_context.next = 12;
|
|
64
|
+
return _pako.default.inflate(new Uint8Array(data));
|
|
65
|
+
case 12:
|
|
66
|
+
unzipped = _context.sent;
|
|
67
|
+
decoded = new TextDecoder("utf-8").decode(unzipped);
|
|
68
|
+
content = JSON.parse(decoded);
|
|
69
|
+
return _context.abrupt("return", content);
|
|
70
|
+
case 16:
|
|
71
|
+
case "end":
|
|
72
|
+
return _context.stop();
|
|
73
|
+
}
|
|
74
|
+
}, _callee);
|
|
75
|
+
}));
|
|
76
|
+
return _loadDict.apply(this, arguments);
|
|
77
|
+
}
|
|
78
|
+
function dec_to_options(decays) {
|
|
79
|
+
var arr = decays.map(function (decay) {
|
|
80
|
+
return Object({
|
|
81
|
+
value: decay.list.plain,
|
|
82
|
+
label: /*#__PURE__*/(0, _jsxRuntime.jsx)(_mathjaxReact.MathComponent, {
|
|
83
|
+
tex: decay.descriptors.latex,
|
|
84
|
+
display: false
|
|
85
|
+
})
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
return arr;
|
|
89
|
+
}
|
|
90
|
+
function tupletools_to_option(toolDict) {
|
|
91
|
+
var arr = [];
|
|
92
|
+
Object.keys(toolDict).forEach(function (tool) {
|
|
93
|
+
arr.push({
|
|
94
|
+
value: toolDict[tool]["description"],
|
|
95
|
+
label: tool
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
return arr;
|
|
99
|
+
}
|
|
100
|
+
function list_to_options(lines) {
|
|
101
|
+
var arr = [];
|
|
102
|
+
lines.forEach(function (line) {
|
|
103
|
+
arr.push({
|
|
104
|
+
value: line,
|
|
105
|
+
label: line
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
return arr;
|
|
109
|
+
}
|
|
110
|
+
function parse_searchitem_descriptions(data) {
|
|
111
|
+
var arr = [];
|
|
112
|
+
Object.keys(data).forEach(function (name) {
|
|
113
|
+
arr.push(_defineProperty({}, name, data[name]["description"]));
|
|
114
|
+
});
|
|
115
|
+
return arr;
|
|
116
|
+
}
|
|
117
|
+
function parse_tupleTools(data) {
|
|
118
|
+
var tupleTools = {};
|
|
119
|
+
Object.keys(data).forEach(function (item) {
|
|
120
|
+
tupleTools[item] = data[item]["description"];
|
|
121
|
+
});
|
|
122
|
+
return tupleTools;
|
|
123
|
+
}
|
|
124
|
+
function get_tupleTool_description(tool_name, data) {
|
|
125
|
+
var key_arr = Object.keys(data).filter(function (item) {
|
|
126
|
+
return item === tool_name;
|
|
127
|
+
});
|
|
128
|
+
if (key_arr.length > 0) {
|
|
129
|
+
return data[key_arr[0]]["description"];
|
|
130
|
+
}
|
|
131
|
+
return "";
|
|
132
|
+
}
|
|
133
|
+
function get_tupleTool_config(tool_name, data) {
|
|
134
|
+
var key_arr = Object.keys(data).filter(function (item) {
|
|
135
|
+
return item === tool_name;
|
|
136
|
+
});
|
|
137
|
+
if (key_arr.length > 0) {
|
|
138
|
+
return data[key_arr[0]]["description"];
|
|
139
|
+
}
|
|
140
|
+
return "";
|
|
141
|
+
}
|
|
142
|
+
function downloadConfig_old(output) {
|
|
143
|
+
var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "file.txt";
|
|
144
|
+
var blob = new Blob([output], {
|
|
145
|
+
type: "text/plain"
|
|
146
|
+
});
|
|
147
|
+
//if (
|
|
148
|
+
// window.navigator &&
|
|
149
|
+
// window.navigator.msSaveOrOpenBlob
|
|
150
|
+
//) return window.navigator.msSaveOrOpenBlob(blob);
|
|
151
|
+
|
|
152
|
+
// For other browsers:
|
|
153
|
+
// Create a link pointing to the ObjectURL containing the blob.
|
|
154
|
+
var data = window.URL.createObjectURL(blob);
|
|
155
|
+
var link = document.createElement("a");
|
|
156
|
+
link.href = data;
|
|
157
|
+
link.download = name;
|
|
158
|
+
|
|
159
|
+
// this is necessary as link.click() does not work on the latest firefox
|
|
160
|
+
link.dispatchEvent(new MouseEvent("click", {
|
|
161
|
+
bubbles: true,
|
|
162
|
+
cancelable: true,
|
|
163
|
+
view: window
|
|
164
|
+
}));
|
|
165
|
+
setTimeout(function () {
|
|
166
|
+
// For Firefox it is necessary to delay revoking the ObjectURL
|
|
167
|
+
window.URL.revokeObjectURL(data);
|
|
168
|
+
link.remove();
|
|
169
|
+
}, 100);
|
|
170
|
+
}
|
|
171
|
+
function downloadBlob(blob, name) {
|
|
172
|
+
// Convert your blob into a Blob URL (a special url that points to an object in the browser's memory)
|
|
173
|
+
var blobUrl = URL.createObjectURL(blob);
|
|
174
|
+
|
|
175
|
+
// Create a link element
|
|
176
|
+
var link = document.createElement("a");
|
|
177
|
+
|
|
178
|
+
// Set link's href to point to the Blob URL
|
|
179
|
+
link.href = blobUrl;
|
|
180
|
+
link.download = name;
|
|
181
|
+
|
|
182
|
+
// Append link to the body
|
|
183
|
+
document.body.appendChild(link);
|
|
184
|
+
|
|
185
|
+
// Dispatch click event on the link
|
|
186
|
+
// This is necessary as link.click() does not work on the latest firefox
|
|
187
|
+
link.dispatchEvent(new MouseEvent("click", {
|
|
188
|
+
bubbles: true,
|
|
189
|
+
cancelable: true,
|
|
190
|
+
view: window
|
|
191
|
+
}));
|
|
192
|
+
// Remove link from body
|
|
193
|
+
document.body.removeChild(link);
|
|
194
|
+
}
|
|
195
|
+
function download(output) {
|
|
196
|
+
var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "file.txt";
|
|
197
|
+
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "text/plain";
|
|
198
|
+
var blob = new Blob([output], {
|
|
199
|
+
type: type
|
|
200
|
+
});
|
|
201
|
+
downloadBlob(blob, name);
|
|
202
|
+
}
|
|
203
|
+
function downloadZip(files) {
|
|
204
|
+
var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "archive.zip";
|
|
205
|
+
var zip = (0, _jszip.default)();
|
|
206
|
+
files.forEach(function (_ref) {
|
|
207
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
208
|
+
name = _ref2[0],
|
|
209
|
+
output = _ref2[1];
|
|
210
|
+
var blob = new Blob([output], {
|
|
211
|
+
type: "text/plain"
|
|
212
|
+
});
|
|
213
|
+
zip.file(name, blob);
|
|
214
|
+
});
|
|
215
|
+
zip.generateAsync({
|
|
216
|
+
type: "blob"
|
|
217
|
+
}).then(function (blob) {
|
|
218
|
+
return downloadBlob(blob, name);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function getDTreeName(mappedList) {
|
|
222
|
+
var name = "";
|
|
223
|
+
mappedList.forEach(function (part) {
|
|
224
|
+
name += part["particle"];
|
|
225
|
+
});
|
|
226
|
+
//let name = descriptor.split(' ').join('');
|
|
227
|
+
return name;
|
|
228
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*****************************************************************************\
|
|
2
|
+
* (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration *
|
|
3
|
+
* *
|
|
4
|
+
* This software is distributed under the terms of the GNU General Public *
|
|
5
|
+
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
|
|
6
|
+
* *
|
|
7
|
+
* In applying this licence, CERN does not waive the privileges and immunities *
|
|
8
|
+
* granted to it by virtue of its status as an Intergovernmental Organization *
|
|
9
|
+
* or submit itself to any jurisdiction. *
|
|
10
|
+
\*****************************************************************************/
|
|
11
|
+
|
|
12
|
+
.decaysListClass {
|
|
13
|
+
height: 540px;
|
|
14
|
+
overflow-y: scroll;
|
|
15
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lhcb-ntuple-wizard",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "An application to access large-scale open data from LHCb",
|
|
5
|
+
"url": "https://gitlab.cern.ch/lhcb-dpa/wp6-analysis-preservation-and-open-data/lhcb-ntuple-wizard-frontend/issues",
|
|
6
|
+
"private": false,
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"bootstrap": "^5.1.3",
|
|
15
|
+
"email-validator": "^2.0.4",
|
|
16
|
+
"js-yaml": "^4.1.0",
|
|
17
|
+
"jszip": "^3.7.1",
|
|
18
|
+
"lodash": "^4.17.21",
|
|
19
|
+
"mathjax-react": "^1.0.6",
|
|
20
|
+
"pako": "^2.1.0",
|
|
21
|
+
"react": "^17.0.2",
|
|
22
|
+
"react-bootstrap": "^2.0.3",
|
|
23
|
+
"react-bootstrap-icons": "^1.6.1",
|
|
24
|
+
"react-dom": "^17.0.2",
|
|
25
|
+
"react-graph-vis": "^1.0.7",
|
|
26
|
+
"react-infinite-scroll-component": "^6.1.0",
|
|
27
|
+
"react-router-dom": "^5.2.0",
|
|
28
|
+
"react-scripts": "^5.0.1",
|
|
29
|
+
"react-select": "^4.3.1"
|
|
30
|
+
},
|
|
31
|
+
"overrides": {
|
|
32
|
+
"autoprefixer": "10.4.5"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"start": "react-scripts start",
|
|
36
|
+
"build": "react-scripts build",
|
|
37
|
+
"test": "react-scripts test",
|
|
38
|
+
"eject": "react-scripts eject",
|
|
39
|
+
"transpile": "babel src -d dist --copy-files",
|
|
40
|
+
"prepublishOnly": "npm run transpile"
|
|
41
|
+
},
|
|
42
|
+
"eslintConfig": {
|
|
43
|
+
"extends": [
|
|
44
|
+
"react-app",
|
|
45
|
+
"react-app/jest"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"browserslist": {
|
|
49
|
+
"production": [
|
|
50
|
+
">0.2%",
|
|
51
|
+
"not dead",
|
|
52
|
+
"not op_mini all"
|
|
53
|
+
],
|
|
54
|
+
"development": [
|
|
55
|
+
"last 1 chrome version",
|
|
56
|
+
"last 1 firefox version",
|
|
57
|
+
"last 1 safari version"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@babel/cli": "^7.21.0",
|
|
62
|
+
"@babel/preset-env": "^7.21.4",
|
|
63
|
+
"@babel/preset-react": "^7.18.6"
|
|
64
|
+
}
|
|
65
|
+
}
|