-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmeteoJS.min.js.map
1 lines (1 loc) · 777 KB
/
meteoJS.min.js.map
1
{"version":3,"file":"meteoJS.min.js","mappings":";oYAOA,IAAIA,EAAW,SAAUC,GACvB,aAEA,IAEIC,EAFAC,EAAKC,OAAOC,UACZC,EAASH,EAAGI,eAEZC,EAA4B,mBAAXC,OAAwBA,OAAS,CAAC,EACnDC,EAAiBF,EAAQG,UAAY,aACrCC,EAAsBJ,EAAQK,eAAiB,kBAC/CC,EAAoBN,EAAQO,aAAe,gBAE/C,SAASC,EAAOC,EAAKC,EAAKC,GAOxB,OANAf,OAAOgB,eAAeH,EAAKC,EAAK,CAC9BC,MAAOA,EACPE,YAAY,EACZC,cAAc,EACdC,UAAU,IAELN,EAAIC,EACb,CACA,IAEEF,EAAO,CAAC,EAAG,GAKb,CAJE,MAAOQ,GACPR,EAAS,SAASC,EAAKC,EAAKC,GAC1B,OAAOF,EAAIC,GAAOC,CACpB,CACF,CAEA,SAASM,EAAKC,EAASC,EAASC,EAAMC,GAEpC,IAAIC,EAAiBH,GAAWA,EAAQtB,qBAAqB0B,EAAYJ,EAAUI,EAC/EC,EAAY5B,OAAO6B,OAAOH,EAAezB,WACzC6B,EAAU,IAAIC,EAAQN,GAAe,IAMzC,OAFAG,EAAUI,QAuMZ,SAA0BV,EAASE,EAAMM,GACvC,IAAIG,EAAQC,EAEZ,OAAO,SAAgBC,EAAQC,GAC7B,GAAIH,IAAUI,EACZ,MAAM,IAAIC,MAAM,gCAGlB,GAAIL,IAAUM,EAAmB,CAC/B,GAAe,UAAXJ,EACF,MAAMC,EAKR,OAAOI,GACT,CAKA,IAHAV,EAAQK,OAASA,EACjBL,EAAQM,IAAMA,IAED,CACX,IAAIK,EAAWX,EAAQW,SACvB,GAAIA,EAAU,CACZ,IAAIC,EAAiBC,EAAoBF,EAAUX,GACnD,GAAIY,EAAgB,CAClB,GAAIA,IAAmBE,EAAkB,SACzC,OAAOF,CACT,CAC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IAEFyQ,iBAAAA,GACAI,iBAAAA,GACAiC,KAAM,CACJqC,MAAAA,GACAC,MAAAA,GACAC,qBAAAA","sources":["webpack://meteoJS/./node_modules/regenerator-runtime/runtime.js","webpack://meteoJS/webpack/bootstrap","webpack://meteoJS/webpack/runtime/compat get default export","webpack://meteoJS/webpack/runtime/define property getters","webpack://meteoJS/webpack/runtime/hasOwnProperty shorthand","webpack://meteoJS/webpack/runtime/make namespace object","webpack://meteoJS/webpack/runtime/node module decorator","webpack://meteoJS/./src/meteoJS/calc.js","webpack://meteoJS/./src/meteoJS/Events.js","webpack://meteoJS/./src/meteoJS/RepetitiveRequests.js","webpack://meteoJS/./src/meteoJS/Timeline.js","webpack://meteoJS/external var \"jQuery\"","webpack://meteoJS/./src/meteoJS/timeline/Animation.js","webpack://meteoJS/./node_modules/bootstrap-icons/icons/play-fill.svg","webpack://meteoJS/./node_modules/bootstrap-icons/icons/pause-fill.svg","webpack://meteoJS/./src/meteoJS/timeline/animation/ToggleButton.js","webpack://meteoJS/./src/meteoJS/timeline/Visualisation.js","webpack://meteoJS/./src/meteoJS/timeline/visualisation/Text.js","webpack://meteoJS/./src/meteoJS/timeline/visualisation/Slider.js","webpack://meteoJS/./src/meteoJS/timeline/visualisation/bsButtons.js","webpack://meteoJS/./src/meteoJS/timeline/visualisation/bsDropdown.js","webpack://meteoJS/./src/meteoJS/synview/SynviewMap.js","webpack://meteoJS/./src/meteoJS/synview/Collection.js","webpack://meteoJS/external var \"ol.layer.Group\"","webpack://meteoJS/external var \"ol.layer.Vector\"","webpack://meteoJS/external var \"ol.Observable\"","webpack://meteoJS/./src/meteoJS/synview/Resource.js","webpack://meteoJS/./src/meteoJS/synview/ResourceCollection.js","webpack://meteoJS/./src/meteoJS/synview/Type.js","webpack://meteoJS/./src/meteoJS/synview/TypeCollection.js","webpack://meteoJS/./src/meteoJS/synview/Tooltip.js","webpack://meteoJS/./src/meteoJS/Synview.js","webpack://meteoJS/external var \"ol.proj\"","webpack://meteoJS/./src/meteoJS/synview/map/MapOL.js","webpack://meteoJS/./src/meteoJS/synview/map/MapLL.js","webpack://meteoJS/external var \"ol.format.GeoJSON\"","webpack://meteoJS/external var \"ol.source.Vector\"","webpack://meteoJS/./src/meteoJS/synview/resource/Vector.js","webpack://meteoJS/./src/meteoJS/synview/resource/GeoJSON.js","webpack://meteoJS/external var \"ol.source.VectorTile\"","webpack://meteoJS/external var \"ol.layer.VectorTile\"","webpack://meteoJS/./src/meteoJS/synview/resource/VectorTile.js","webpack://meteoJS/./src/meteoJS/synview/resource/GeoJSONTile.js","webpack://meteoJS/external var \"ol.source.ImageStatic\"","webpack://meteoJS/external var \"ol.layer.Image\"","webpack://meteoJS/./src/meteoJS/synview/resource/Image.js","webpack://meteoJS/external var \"ol.source.OSM\"","webpack://meteoJS/external var \"ol.layer.Tile\"","webpack://meteoJS/./src/meteoJS/synview/resource/OSM.js","webpack://meteoJS/./src/meteoJS/Tooltip.js","webpack://meteoJS/external var \"bootstrap\"","webpack://meteoJS/./src/meteoJS/tooltip/BootstrapTooltip.js","webpack://meteoJS/./src/meteoJS/base/Unique.js","webpack://meteoJS/./src/meteoJS/base/Collection.js","webpack://meteoJS/./src/meteoJS/Modelviewer.js","webpack://meteoJS/./src/meteoJS/base/Named.js","webpack://meteoJS/./src/meteoJS/base/UniqueNamed.js","webpack://meteoJS/./src/meteoJS/modelviewer/Variable.js","webpack://meteoJS/./src/meteoJS/modelviewer/TimeVariable.js","webpack://meteoJS/./src/meteoJS/modelviewer/VariableCollection.js","webpack://meteoJS/./src/meteoJS/base/NamedCollection.js","webpack://meteoJS/./src/meteoJS/modelviewer/ResourcesTreeNode.js","webpack://meteoJS/./src/meteoJS/modelviewer/Node.js","webpack://meteoJS/./src/meteoJS/modelviewer/Resource.js","webpack://meteoJS/./src/meteoJS/modelviewer/resource/Image.js","webpack://meteoJS/./src/meteoJS/sounding/Parcel.js","webpack://meteoJS/./src/meteoJS/Sounding.js","webpack://meteoJS/./src/meteoJS/modelviewer/resource/Sounding.js","webpack://meteoJS/./src/meteoJS/modelviewer/Resources.js","webpack://meteoJS/./src/meteoJS/modelviewer/NWPResources.js","webpack://meteoJS/./src/meteoJS/modelviewer/Display.js","webpack://meteoJS/./src/meteoJS/modelviewer/Container.js","webpack://meteoJS/external var \"SVG\"","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/Functions.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/DiagramParcel.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/DiagramSounding.js","webpack://meteoJS/./src/meteoJS/ThermodynamicDiagramPluggable.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/CoordinateSystem.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/coordinateSystem/StueveDiagram.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/coordinateSystem/Emagram.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/coordinateSystem/SkewTlogPDiagram.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/PlotArea.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/PlotDataArea.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/PlotAltitudeDataArea.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/TDDiagram.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/WindbarbsProfile.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/WindspeedProfile.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/Hodograph.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/Axis.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/axes/xAxis.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/axes/yAxis.js","webpack://meteoJS/./src/meteoJS/thermodynamicDiagram/axes/WindspeedProfileAxis.js","webpack://meteoJS/./src/meteoJS/ThermodynamicDiagram.js","webpack://meteoJS/./src/meteoJS/modelviewer/display/Simple.js","webpack://meteoJS/./src/meteoJS/index.js","webpack://meteoJS/./src/meteoJS/modelviewer/display/SelectNavigation.js"],"sourcesContent":["/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n return obj[key];\n }\n try {\n // IE 8 has a broken Object.defineProperty that only works on DOM objects.\n define({}, \"\");\n } catch (err) {\n define = function(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = GeneratorFunctionPrototype;\n define(Gp, \"constructor\", GeneratorFunctionPrototype);\n define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction);\n GeneratorFunction.displayName = define(\n GeneratorFunctionPrototype,\n toStringTagSymbol,\n \"GeneratorFunction\"\n );\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n define(prototype, method, function(arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n define(genFun, toStringTagSymbol, \"GeneratorFunction\");\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return PromiseImpl.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return PromiseImpl.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n });\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n if (PromiseImpl === void 0) PromiseImpl = Promise;\n\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList),\n PromiseImpl\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n define(Gp, toStringTagSymbol, \"Generator\");\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n define(Gp, iteratorSymbol, function() {\n return this;\n });\n\n define(Gp, \"toString\", function() {\n return \"[object Generator]\";\n });\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, in modern engines\n // we can explicitly access globalThis. In older engines we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","/**\n * @module meteoJS/calc\n */\n\n/**\n * Umrechnung eines Luftdrucks zur entsprechenden Höhe in der\n * Internationalen Standard-Atmosphäre (ISA).\n * \n * Formel ist gültig bis 11 km Höhe\n * (https://de.wikipedia.org/wiki/Barometrische_H%C3%B6henformel#Internationale_H.C3.B6henformel)\n * \n * @static\n * @public\n * @param {number|undefined} p Luftdruck [hPa]\n * @return {number|undefined} Höhe in der Standard-Atmosphäre [m ü.M.]\n */\nexport function altitudeISAByPres(p) {\n if (p === undefined ||\n isNaN(p))\n return undefined;\n return 44330.769*(1 - Math.pow(p/1013.25, 0.19029496));\n}\n\n/**\n * Umrechnung einer Höhe in einen Luftdruck in der\n * Internationalen Standard-Atmosphäre (ISA).\n * \n * Formel ist gültig bis 11 km Höhe\n * (https://de.wikipedia.org/wiki/Barometrische_H%C3%B6henformel#Internationale_H.C3.B6henformel)\n * \n * @static\n * @public\n * @param {number|undefined} a Höhe [m ü.M.]\n * @return {number|undefined} Luftdruck in der Standard-Atmosphäre [hPa]\n */\nexport function pressureISAByAltitude(a) {\n if (a === undefined ||\n isNaN(a))\n return undefined;\n return 1013.25*Math.pow(1-a/44330.769, 5.255);\n}\n\n/**\n * Berechnung der potentielle Temperatur θ aus der Temperatur und des Drucks\n * eines Luftpakets.\n * \n * Berechnung zum Normaldruck von 1000 hPa\n * (https://de.wikipedia.org/wiki/Potentielle_Temperatur#Trockenpotentielle_Temperatur)\n * \n * @param {number|undefined} temp Temperatur [K]\n * @param {number|undefined} pres Luftdruck [hPa]\n * @return {number|undefined} Potentielle Temperatur [K]\n */\nexport function potentialTempByTempAndPres(temp, pres) {\n if (temp === undefined || isNaN(temp) ||\n pres === undefined || isNaN(pres))\n return undefined;\n return temp * Math.pow(1000/pres, 0.286);\n}\n\n/**\n * Berechnung der Lufttemperatur bei einem Luftdruck für ein Luftpaket mit\n * entsprechender potentiellen Temperatur.\n * \n * Berechnung zum Normaldurck von 1000 hPa\n * \n * @param {number|undefined} potentialTemp Potentielle Temperatur [K]\n * @param {number|undefined} pres Luftdruck [hPa]\n * @return {number|undefined} Temperatur [K]\n */\nexport function tempByPotentialTempAndPres(potentialTemp, pres) {\n if (potentialTemp === undefined || isNaN(potentialTemp) ||\n pres === undefined || isNaN(pres))\n return undefined;\n return potentialTemp*Math.pow(pres/1000, 0.286);\n}\n\n/**\n * Temperatur eines Luftpaktes mit Druck 'pres' und der Äquivalent potentiellen Temperatur 'thetae'.\n * \n * @param {number|undefined} thetae Äquivalent potentielle Temperatur [K]\n * @param {number|undefined} pres Luftdruck [hPa]\n * @return {number|undefined} Temperatur [K]\n */\nexport function tempByEquiPotTempAndPres(thetae, pres) {\n if (pres === undefined || isNaN(pres))\n return undefined;\n var s = undefined;\n var th = undefined;\n var pcon = Math.pow(1000/pres, .286);\n var t = 273.0;\n var delta = 20;\n var i = 0;\n while (Math.abs(delta) > 0.1 && i < 100) {\n i++;\n s = saturationHMRByTempAndPres(t, pres);\n th = t * pcon * Math.exp(2.5*s/t);\n if ((th-thetae)*delta > 0.0)\n delta = -.5 * delta;\n t = t + delta;\n }\n return t;\n}\n\n/**\n * Taupunkt eines Luftpaktes über Mischungsverhältnis und Druck.\n * \n * @param {number|undefined} hmr Mischungsverhätlnis [g/kg]\n * @param {number|undefined} pres Luftdruck [hPa]\n * @return {number|undefined} Taupunkttemperatur [K]\n */\nexport function dewpointByHMRAndPres(hmr, pres) {\n if (hmr === undefined || isNaN(hmr) ||\n pres === undefined || isNaN(pres))\n return undefined;\n var x = 0.4343 * Math.log(hmr * pres /(622. + hmr));\n return Math.pow(10,.0498646455 * x + 2.4082965 ) -\n 7.07475 +\n 38.9114 * Math.pow((Math.pow(10, .0915 * x) - 1.2035),2);\n}\n\n/**\n * Wetbulb-Temperature, Psychro-Temperature aus Temperatur, Taupunkt und Luftdruck\n * \n * @param {number|undefined} temp Temperatur [K]\n * @param {number|undefined} dewpoint Taupunkttemperatur [K]\n * @param {number|undefined} pres Luftdruck [hPa]\n * @return {number|undefined} Wetbulb-Temperatur [K]\n */\nexport function wetbulbTempByTempAndDewpointAndPres(temp, dewpoint, pres) {\n if (temp === undefined || isNaN(temp) ||\n dewpoint === undefined || isNaN(dewpoint) ||\n pres === undefined || isNaN(pres))\n return undefined;\n var result = dewpoint-273.15;\n var Ediff = 1;\n var incr = 10;\n var previoussign = 1;\n var E = 6.112 * Math.exp((17.67 * result) / (result + 243.5));\n while (Math.abs(Ediff) > 0.05) {\n var Eguess = 6.112 * Math.exp((17.67 * result) / (result + 243.5)) -\n pres * (temp-273.15 - result) * 0.00066 * (1 + (0.00115 * result));\n Ediff = E - Eguess;\n if (Ediff == 0)\n break;\n else {\n if (Ediff < 0) {\n if (-1 != previoussign) {\n previoussign = -1;\n incr = incr/10;\n }\n }\n else {\n if (1 != previoussign) {\n previoussign = 1;\n incr = incr/10;\n }\n }\n }\n if (Math.abs(Ediff) <= 0.05)\n break;\n else\n result = result + incr*previoussign;\n }\n return result+273.15;\n}\n\n/**\n * Äquivalent Potentielle Temperatur eines Luftpaktes.\n * \n * Gemäss Formel von Holten (https://en.wikipedia.org/wiki/Equivalent_potential_temperature#Formula)\n * \n * @param {number|undefined} temp Temperatur [K]\n * @param {number|undefined} dewpoint Taupunkts-Temperatur [K]\n * @param {number|undefined} pres Luftdruck [hPa]\n * @return {number|undefined} Äquivalent potentielle Temperatur [K]\n */\nexport function equiPotentialTempByTempAndDewpointAndPres(temp, dewpoint, pres) {\n var potTemp = potentialTempByTempAndPres(temp, pres);\n if (potTemp === undefined ||\n dewpoint === undefined || isNaN(dewpoint) ||\n temp === undefined || isNaN(temp) ||\n pres === undefined || isNaN(pres))\n return undefined;\n return potTemp *\n Math.exp(2481.9e-3 *\n saturationHMRByTempAndPres(dewpoint, pres) /\n lclTemperatureByTempAndDewpoint(temp, dewpoint));\n}\n\n/**\n * Berechnung des Sättigung-Dampfdrucks zu einer Temperatur\n * \n * @param {number|undefined} temp Temperatur [K]\n * @return {number|undefined} Sättigungs-Dampfdruck [hPa]\n */\nexport function saturationPressureByTemp(temp) {\n if (temp === undefined || isNaN(temp))\n return undefined;\n var coef= new Array(6.1104546, 0.4442351, 1.4302099e-2, 2.6454708e-4, 3.0357098e-6, 2.0972268e-8, 6.0487594e-11,-1.469687e-13);\n var inx=0;\n // sat vap pressures every 5C from -50 to -200\n var escold= new Array(\n 0.648554685769663908E-01, 0.378319512256073479E-01,\n 0.222444934288790197E-01, 0.131828928424683120E-01,\n 0.787402077141244848E-02, 0.473973049488473318E-02,\n 0.287512035504357928E-02, 0.175743037675810294E-02,\n 0.108241739518850975E-02, 0.671708939185605941E-03,\n 0.419964702632039404E-03, 0.264524363863469876E-03,\n 0.167847963736813220E-03, 0.107285397631620379E-03,\n 0.690742634496135612E-04, 0.447940489768084267E-04,\n 0.292570419563937303E-04, 0.192452912634994161E-04,\n 0.127491372410747951E-04, 0.850507010275505138E-05,\n 0.571340025334971129E-05, 0.386465029673876238E-05,\n 0.263210971965005286E-05, 0.180491072930570428E-05,\n 0.124607850555816049E-05, 0.866070571346870824E-06,\n 0.605982217668895538E-06, 0.426821197943242768E-06,\n 0.302616508514379476E-06, 0.215963854234913987E-06,\n 0.155128954578336869E-06);\n\n temp = temp - 273.15;\n var retval = 0;\n //try {\n if (temp > -50.) {\n retval = ( coef[0] + temp*(coef[1] + temp*(coef[2] + temp*(coef[3] +\n temp*(coef[4] + temp*(coef[5] + temp*(coef[6] + temp*coef[7])))))));\n\n } else {\n var tt = (-temp - 50.)/5.;\n //var = (int) tt;\n if (inx < escold.length-1) {\n retval = escold[inx] + (tt % 1.)*(escold[inx+1]-escold[inx]);\n } else {\n retval = 1e-7;\n }\n }\n // } catch (Exception e) {\n // GWT.log(\"caught exception: \"+e);\n // retval = 1e-7;\n //}\n return retval;\n}\n\n/**\n * Berechnung des Sättigungs-Mischungsverhältnisses aus Temperatur und Druck\n * \n * HMR = humidity mixing ratio\n * \n * @param {number|undefined} temp Temperatur [K]\n * @param {number|undefined} pres Luftdruck [hPa]\n * @return {number|undefined} Sättigungs-Mischungsverhältnis [g/kg]\n */\nexport function saturationHMRByTempAndPres(temp, pres) {\n var e = saturationPressureByTemp(temp);\n if (e === undefined ||\n pres === undefined || isNaN(pres))\n return undefined;\n return 621.97*e/(pres - e);\n}\n\n/**\n * Lifting Condensation Level (LCL) eines Luftpakets mit entsprechender\n * potentieller Temperatur und Mischungsverhältnis.\n * \n * @param {number|undefined} potentialTemp Potentielle Temperatur [K]\n * @param {number|undefined} hmr Mischungsverhältnis [g/kg]\n * @return {undefined|number} LCL [hPa]\n */\nexport function lclByPotentialTempAndHMR(potentialTemp, hmr) {\n if (hmr === undefined || isNaN(hmr))\n return undefined;\n // Binäre Suche\n var a = 1013;\n var b = 100;\n while (a-b > 10) {\n var p = b+(a-b)/2;\n var hmrp = saturationHMRByTempAndPres(\n tempByPotentialTempAndPres(potentialTemp, p),\n p);\n if (hmrp === undefined)\n return undefined;\n if (hmrp < hmr)\n b = p;\n else\n a = p;\n }\n return b+(a-b)/2;\n}\n\n/**\n * Potentielle Temperatur zu einem Lifting Condensation Level (LCL) bei\n * gegebenem Mischungsverhältnis.\n * \n * @param {number|undefined} lcl LCL [hPa]\n * @param {number|undefined} hmr Mischungsverhältnis [g/kg]\n * @return {number|undefined} Potentielle Temperatur [K]\n */\nexport function potentialTempByLCLAndHMR(lcl, hmr) {\n if (lcl === undefined || isNaN(lcl))\n return undefined;\n // Binäre Suche\n var a = 323;\n var b = 223;\n while (a-b > 0.1) {\n var Th = b+(a-b)/2;\n var lclTh = lclByPotentialTempAndHMR(Th, hmr);\n if (lclTh === undefined)\n return undefined;\n if (lclTh > lcl)\n b = Th;\n else\n a = Th;\n }\n return b+(a-b)/2;\n}\n\n/**\n * Temperatur eines Luftpaktes, welches zum LCL angehoben wird.\n * \n * @param {number|undefined} temp Lufttemperatur [K]\n * @param {number|undefined} dewpoint Taupunktstemperatur [K]\n * @return {undefined|number} Temperatur [K]\n */\nexport function lclTemperatureByTempAndDewpoint(temp, dewpoint) {\n if (temp === undefined || isNaN(temp) ||\n dewpoint === undefined || isNaN(dewpoint))\n return undefined;\n return (dewpoint - (.001296*dewpoint - .15772)*(temp-dewpoint) );\n}\n\n/**\n * Umwandlung Temperatur von Celsius in Kelvin\n * \n * @param {number|undefined} temp [°C]\n * @return {undefined|number} [K]\n */\nexport function tempCelsiusToKelvin(temp) {\n return (temp === undefined || isNaN(temp)) ? undefined : temp+273.15;\n}\n\n/**\n * Umwandlung Temperatur von Kelvin zu Celsius\n * \n * @param {number|undefined} temp [K]\n * @return {undefined|number} [°C]\n */\nexport function tempKelvinToCelsius(temp) {\n return (temp === undefined || isNaN(temp)) ? undefined : temp-273.15;\n}\n\n/**\n * Umwandlung Windgeschwindigkeit von m/s in km/h\n * \n * @param {number|undefined} wind [m/s]\n * @return {undefined|number} [km/h]\n */\nexport function windspeedMSToKMH(wind) {\n return (wind === undefined || isNaN(wind)) ? undefined : wind*3.6;\n}\n\n/**\n * Umwandlung Windgeschwindigkeit von km/h in m/s\n * \n * @param {number|undefined} wind [km/h]\n * @return {undefined|number} [m/s]\n */\nexport function windspeedKMHToMS(wind) {\n return (wind === undefined || isNaN(wind)) ? undefined : wind/3.6;\n}\n\n/**\n * Umwandlung Windgeschwindigkeit von m/s in Knoten\n * \n * @param {number|undefined} wind [m/s]\n * @return {undefined|number} [kn]\n */\nexport function windspeedMSToKN(wind) {\n return (wind === undefined || isNaN(wind)) ? undefined : wind*900/463;\n}\n\n/**\n * Umwandlung Windgeschwindigkeit von Knoten in m/s\n * \n * @param {number|undefined} wind [kn]\n * @return {undefined|number} [m/s]\n */\nexport function windspeedKNToMS(wind) {\n return (wind === undefined || isNaN(wind)) ? undefined : wind*463/900;\n}\n\n/**\n * Umwandlung Windgeschwindigkeit von m/s in Beaufort\n * \n * @param {number|undefined} wind [m/s]\n * @return {undefined|number} [bf]\n */\nexport function windspeedMSToBF(wind) {\n return (wind === undefined || isNaN(wind)) ?\n undefined :\n Math.min(12, Math.pow(wind/0.8360, 2/3));\n}\n\n/**\n * Umwandlung Windgeschwindigkeit von Beaufort in m/s\n * \n * @param {number|undefined} wind [bf]\n * @return {undefined|number} [m/s\n */\nexport function windspeedBFToMS(wind) {\n return (wind === undefined || isNaN(wind)) ?\n undefined :\n 0.8360 * Math.pow(wind, 3/2);\n}\n\n/**\n * Abschätzung der Schneefallgrenze aus Temperatur und Höhe des 850hPa-Levels\n * \n * Formel aus Weathercalc herauskopiert.\n * \n * @static\n * @public\n * @param {number|undefined} temp Temperatur auf 850 hPa [K]\n * @param {number|undefined} a Höhe des 850 hPa Levels [m ü.M.]\n * @return {number|undefined} Abgeschätzte Schneefallgrenze [m ü.M.]\n */\nexport function snowlineByTemp850hPaAndAltidude(temp, a) {\n if (temp === undefined || isNaN(temp) ||\n a === undefined || isNaN(a))\n return undefined;\n return 153.0 * tempKelvinToCelsius(temp) + 0.9985 * a - 304.26;\n}\n\n/**\n * Barometrische Höhenformel. Berechnung von Luftdruck in anderer Höhe.\n * \n * Formel aus Wiki-Artikel https://de.wikipedia.org/wiki/Barometrische_H%C3%B6henformel\n * \n * @static\n * @public\n * @param {number|undefined} p0 Druck auf dem Startlevel [hPa]\n * @param {number|undefined} h Höhe bis zum Ziellevel (positiv für höher über Meereslevel) [m]\n * @param {number|undefined} T0 Temperatur auf dem Startlevel [K]\n * @param {number|undefined} T1 Temperatur auf dem Ziellevel, wenn undefined\n * wird Isothermie angenommen [K]\n * @return {number|undefined} Luftdruck auf dem Ziellevel [hPa]\n */\nexport function pressureByBarometricFormula(p0, h, T0, T1) {\n if (p0 === undefined || isNaN(p0) ||\n h === undefined || isNaN(h) ||\n T0 === undefined || isNaN(T0))\n return undefined;\n if (h == 0)\n return p0;\n var M = 0.02896;\n var g = 9.807;\n var R = 8.314;\n if (T1 === undefined)\n T1 = T0;\n // Isotherme Atmosphäre\n if (T0 == T1)\n return p0 * Math.exp(-M*g/R/T0*h);\n var a = (T0 - T1)/h;\n return p0 * Math.exp(M*g/R/a*Math.log(1-a*h/T0));\n}\n\n/**\n * Dichte von feuchter Luft.\n * \n * Formel aus Wiki-Artikel https://en.wikipedia.org/wiki/Density_of_air\n * \n * @param {number|undefined} p Luftdruck [hPa]\n * @param {number|undefined} T Lufttemperatur [K]\n * @param {number|undefined} rh Luftfeuchtigkeit []\n * @return {number|undefined} Dichte [kg/m^3]\n */\nexport function densityHumidAirByPressureAndTempAndRelHumidity(p, T, rh) {\n if (p === undefined || isNaN(p) ||\n T === undefined || isNaN(T) ||\n rh === undefined || isNaN(rh))\n return undefined;\n var Rd = 287.058; // J/(kg·K)\n var Rv = 461.495; // J/(kg·K)\n var pv = saturationPressureByTemp(T)*rh;\n return (p - pv)*100/Rd/T + pv*100/Rv/T;\n}","/**\n * @module meteoJS/events\n */\n\n/**\n * Listen for a certain type of event\n * \n * @abstract\n * @param {string} listener - Event type.\n * @param {callback} callback - Listener function.\n * @param {mixed} [thisArg] - Objekt für this beim Ausführen von callback.\n * @returns {number} Listener function key.\n */\nfunction on(listener, callback, thisArg) {\n if (!('listeners' in this) ||\n this.listeners === undefined)\n this.listeners = {};\n if (!(listener in this.listeners))\n this.listeners[listener] = {};\n // Adapted from https://gist.github.com/gordonbrander/2230317\n var result_key = Math.random().toString(36).substr(2, 9);\n this.listeners[listener][result_key] = {\n callback: callback,\n thisArg: thisArg\n };\n return result_key;\n}\n\n/**\n * Unlisten for a certain type of event\n * \n * @abstract\n * @param {string} listener - Event type.\n * @param {number} key - Listener function key.\n */\nfunction un(listener, key) {\n if ('listeners' in this &&\n this.listeners !== undefined &&\n listener in this.listeners &&\n key in this.listeners[listener])\n delete this.listeners[listener][key];\n}\n\n/**\n * Listen once for a certain type of event\n * \n * @abstract\n * @param {string} listener - Event type.\n * @param {callback} callback - Listener function.\n * @param {mixed} [thisArg] - Objekt für this beim Ausführen von callback.\n */\nfunction once(listener, callback, thisArg) {\n if (!('once_listeners' in this) ||\n this.once_listeners === undefined)\n this.once_listeners = {};\n if (!(listener in this.once_listeners) ||\n !('push' in this.once_listeners[listener]))\n this.once_listeners[listener] = [];\n this.once_listeners[listener].push({\n callback: callback,\n thisArg: thisArg\n });\n}\n\n/**\n * Gibt es Listener Funktionen für einen Event Type\n * \n * @abstract\n * @param {string} listener - Event type.\n * @returns {boolean}\n */\nfunction hasListener(listener) {\n return ('listeners' in this &&\n this.listeners !== undefined &&\n listener in this.listeners &&\n Object.keys(this.listeners[listener]).length) ||\n ('once_listeners' in this &&\n listener in this.once_listeners &&\n Object.keys(this.once_listeners[listener]).length);\n}\n\n/**\n * Execute all listener functions für einen Event Type\n * \n * @abstract\n * @param {string} listener - Event type.\n */\nfunction trigger(listener) {\n let args = Array.prototype.slice.call(arguments);\n args.shift();\n if ('listeners' in this &&\n this.listeners !== undefined &&\n listener in this.listeners &&\n typeof this.listeners[listener] == 'object') {\n Object.keys(this.listeners[listener]).forEach(key => {\n this.listeners[listener][key].callback.apply(\n this.listeners[listener][key].thisArg === undefined ?\n this :\n this.listeners[listener][key].thisArg,\n args);\n });\n }\n if ('once_listeners' in this &&\n this.once_listeners !== undefined &&\n listener in this.once_listeners &&\n 'forEach' in this.once_listeners[listener]) {\n let once_listeners = this.once_listeners[listener];\n this.once_listeners[listener] = [];\n once_listeners.forEach(obj => {\n obj.callback.apply(obj.thisArg === undefined ? this : obj.thisArg, args);\n });\n }\n}\n\n/**\n * Fügt einem Objekt alle Event-Funktionen hinzu.\n * \n * @param {object} obj\n */\nexport function addEventFunctions(obj) {\n obj.on = on;\n obj.un = un;\n obj.once = once;\n obj.hasListener = hasListener;\n obj.trigger = trigger;\n}\nexport default addEventFunctions;","/**\n * @module meteoJS/repetitiveRequests\n */\nimport addEventFunctions from './Events.js';\n\n/**\n * Event fired before a request is executed.\n * \n * @event module:meteoJS/repetitiveRequests#before:request\n */\n\n/**\n * Event fired on a successful request.\n * \n * @event module:meteoJS/repetitiveRequests#success:request\n * @property {external:XMLHttpRequest} request - XMLHttpRequest of the successful request.\n */\n\n/**\n * Event fired if a request failed.\n * \n * @event module:meteoJS/repetitiveRequests#error:request\n * @property {external:XMLHttpRequest} request - XMLHttpRequest of the failed request.\n */\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/repetitiveRequests~options\n * @property {undefined|string} [url=undefined] - URL to make repetitive\n * requests to. If undefined, no request will be done.\n * @property {string} [user=''] - User to send with request.\n * @property {string} [password=''] - Password to send with request.\n * @property {boolean} [start=true] - Start repetetive requests on construction.\n * @property {undefined|string} [defaultTimeout=undefined]\n * Default timeout until next request, if response has no Cache-Control\n * HTTP-Header. In milliseconds. If undefined, a further request will only be\n * done, if the reponse returned a valid Cache-Control header.\n * @property {undefined|string} [timeoutOnError=undefined]\n * Timeout until next request after a error response. In milliseconds. If\n * undefined, no further request will be done after an error.\n * @property {boolean} [pauseOnHiddenDocument=false] - Pause making repetitive\n * requests when document is hidden.\n * @property {''|'arraybuffer'|'blob'|'document'|'json'|'text'} [responseType='']\n * Specifies the content type of the response.\n * See {@link https://developer.mozilla.org/de/docs/Web/API/XMLHttpRequest/responseType}.\n */\n\n/**\n * Makes requests again and again. Useful to stay up to date with\n * the data available on the server. If the response returns a Cache-Control\n * HTTP-Header, then the next request will be done per default after this\n * time.\n * \n * @fires module:meteoJS/repetitiveRequests#before:request\n * @fires module:meteoJS/repetitiveRequests#success:request\n * @fires module:meteoJS/repetitiveRequests#error:request\n */\nexport class RepetitiveRequests {\n \n /**\n * @param {module:meteoJS/repetitiveRequests~options} [options] - Options.\n */\n constructor({\n url = undefined,\n user = '',\n password = '',\n start = true,\n defaultTimeout = undefined,\n timeoutOnError = undefined,\n pauseOnHiddenDocument = false,\n responseType = ''\n } = {}) {\n \n /**\n * @type undefined|string\n * @private\n */\n this._url = url;\n \n /**\n * @type string\n * @private\n */\n this._user = user;\n \n /**\n * @type string\n * @private\n */\n this._password = password;\n \n /**\n * @type boolean\n * @private\n */\n this._isStarted = start;\n \n /**\n * @type undefined|integer\n * @private\n */\n this._defaultTimeout = defaultTimeout;\n \n /**\n * @type undefined|integer\n * @private\n */\n this._timeoutOnError = timeoutOnError;\n \n /**\n * @type boolean\n * @private\n */\n this._pauseOnHiddenDocument = pauseOnHiddenDocument;\n this._initPauseOnHiddenDocument();\n\n /**\n * @type boolean\n * @private\n */\n this._isSuppressedByHiddenDocument = false;\n \n /**\n * @type string\n * @private\n */\n this._responseType = responseType;\n \n /**\n * @type mixed\n * @private\n */\n this._timeoutID = undefined;\n \n /**\n * @type boolean\n * @private\n */\n this._loading = false;\n \n if (this._isStarted)\n this.start();\n }\n \n /**\n * Current URL to make requests to.\n * \n * @type undefined|string\n */\n get url() {\n return this._url;\n }\n set url(url) {\n this._url = url;\n }\n \n /**\n * User to send with request.\n * \n * @type string\n */\n get user() {\n return this._user;\n }\n set user(user) {\n this._user = user;\n }\n \n /**\n * Password to send with request.\n * \n * @type string\n */\n get password() {\n return this._password;\n }\n set password(password) {\n this._password = password;\n }\n \n /**\n * Content type of the response.\n * \n * @type string\n */\n get responseType() {\n return this._responseType;\n }\n set responseType(responseType) {\n this._responseType = responseType;\n }\n \n /**\n * Start repetitive requests. Makes immediatly the first request.\n */\n start() {\n this._isStarted = true;\n this._startRequest();\n }\n \n /**\n * Stops repetitive requests. Events aren't triggered anymore. Even if a\n * former request creates a response.\n */\n stop() {\n this._isStarted = false;\n if (this._timeoutID !== undefined) {\n clearTimeout(this._timeoutID);\n this._timeoutID = undefined;\n }\n }\n \n /**\n * Executes next request after the passed delay. If already another request\n * is planned, nothing is done.\n * \n * @private\n * @param {integer} delay - Delay in milliseconds.\n */\n _planRequest({\n delay\n }) {\n if (this._timeoutID !== undefined)\n return;\n \n this._timeoutID = setTimeout(() => {\n if (this._pauseOnHiddenDocument\n && ('hidden' in document)\n && document.hidden) {\n this._isSuppressedByHiddenDocument = true;\n return;\n }\n\n this._startRequest();\n }, delay);\n }\n \n /**\n * Makes a new request and triggeres events.\n * \n * @private\n */\n _startRequest() {\n if (this._timeoutID !== undefined) {\n clearTimeout(this._timeoutID);\n this._timeoutID = undefined;\n }\n \n this._makeRequest()\n .then(({ request }) => {\n if (!this._isStarted)\n return;\n \n let delay = this._defaultTimeout;\n \n // Read ResponseHeader\n let cacheControl = request.getResponseHeader('Cache-Control');\n if (cacheControl !== null) {\n let maxAges = /(^|,\\s*)max-age=([0-9]+)($|\\s*,)/.exec(cacheControl);\n if (maxAges !== null &&\n maxAges[2] > 0)\n delay = Math.round(maxAges[2]*1000);\n }\n \n this.trigger('success:request', { request });\n \n if (delay !== undefined)\n this._planRequest({ delay });\n }, ({ request } = {}) => {\n if (!this._isStarted)\n return;\n \n if (request === undefined)\n return;\n \n this.trigger('error:request', { request });\n \n if (this._timeoutOnError !== undefined)\n this._planRequest({ delay: this._timeoutOnError });\n }, ({ request = undefined }) => {\n /* Promise() returned by _makeRequest() also rejects, when URL isn't\n * defined or is actually loading. In these cases don't throw an\n * error event. */\n if (request !== undefined)\n this.trigger('error:request', { request });\n });\n }\n \n /**\n * Makes a new request immediatly, except another request is already loading.\n * \n * @private\n * @returns {Promise}\n */\n async _makeRequest() {\n this.trigger('before:request');\n return new Promise((resolve, reject) => {\n if (this._url === undefined) {\n reject();\n return;\n }\n \n if (this._loading) {\n reject();\n return;\n }\n this._loading = true;\n \n let request = new XMLHttpRequest();\n if (this.responseType !== undefined)\n request.responseType = this.responseType;\n request.addEventListener('load', () => {\n this._loading = false;\n \n if (request.status == 200)\n resolve({ request });\n else\n reject({ request });\n });\n request.addEventListener('error', () => {\n this._loading = false;\n reject({ request });\n });\n \n request.open('GET', this._url, true, this._user, this._password);\n request.send();\n });\n }\n \n /**\n * @private\n */\n _initPauseOnHiddenDocument() {\n if (!this._pauseOnHiddenDocument)\n return;\n \n document.addEventListener('visibilitychange', () => {\n if (('hidden' in document)\n && !document.hidden\n && this._isSuppressedByHiddenDocument\n && this._isStarted) {\n this._isSuppressedByHiddenDocument = false;\n this.start();\n }\n });\n }\n}\naddEventFunctions(RepetitiveRequests.prototype);\nexport default RepetitiveRequests;\n","/**\n * @module meteoJS/timeline\n */\nimport addEventFunctions from './Events.js';\n\n/**\n * Special key identifier.\n * \n * @typedef {\"ctrl\"|\"alt\"|\"shift\"|\"meta\"|Number}\n * module:meteoJS/timeline~specialKeyIdentifier\n */\n\n/**\n * Definition of pressed keys with optional special keys.\n * \n * @typedef {module:meteoJS/timeline~specialKeyIdentifier|\n module:meteoJS/timeline~specialKeyIdentifier[]}\n * module:meteoJS/timeline~optionPressedKeys\n */\n\n/**\n * Keyboard navigation options.\n * \n * @typedef {Object} module:meteoJS/timeline~optionKeyboardNavigation\n * @param {boolean} [enabled=false] - Enable Keyboard Navigation.\n * @param {module:meteoJS/timeline~optionPressedKeys} [first=36]\n * Keyboard event to execute\n * {@link module:meteoJS/timeline.Timeline#first|first()}.\n * Default: Home.\n * @param {module:meteoJS/timeline~optionPressedKeys} [last=35]\n * Keyboard event to execute\n * {@link module:meteoJS/timeline.Timeline#last|last()}.\n * Default: End.\n * @param {module:meteoJS/timeline~optionPressedKeys} [prev=37]\n * Keyboard event to execute\n * {@link module:meteoJS/timeline.Timeline#prev|prev()}.\n * Default: Arrow left.\n * @param {module:meteoJS/timeline~optionPressedKeys} [next=39]\n * Keyboard event to execute\n * {@link module:meteoJS/timeline.Timeline#next|next()}.\n * Default: Arrow right.\n * @param {module:meteoJS/timeline~optionPressedKeys} [prevAllEnabledTime=[37, 'ctrl']]\n * Keyboard event to execute\n * {@link module:meteoJS/timeline.Timeline#prevAllEnabledTime|prevAllEnabledTime()}.\n * Default: Arrow left + Ctrl.\n * @param {module:meteoJS/timeline~optionPressedKeys} [nextAllEnabledTime=[39, 'ctrl']]\n * Keyboard event to execute\n * {@link module:meteoJS/timeline.Timeline#nextAllEnabledTime|nextAllEnabledTime()}.\n * Default: Arrow right + Ctrl.\n * @param {Object.<string,module:meteoJS/timeline~optionPressedKeys>} [add]\n * Keyboard event to execute {@link module:meteoJS/timeline.Timeline#add|add()}.\n * The keys are combined with an amount integer and a timeKey\n * (definition analog to the add() function).\n * Defaults: ArrowRight plus 3h:Ctrl+Shift, 6h:Shift, 12h:Alt+Shift, 24h:Alt\n * @param {Object.<string,module:meteoJS/timeline~optionPressedKeys>} [sub]\n * Keyboard event to execute {@link module:meteoJS/timeline.Timeline#sub|sub()}.\n * The keys are combined with an amount integer and a timeKey\n * (definition analog to the add() function).\n * Defaults: ArrowLeft plus 3h:Ctrl+Shift, 6h:Shift, 12h:Alt+Shift, 24h:Alt\n */\n\n/**\n * Options for timeline constructor.\n * \n * @typedef {Object} module:meteoJS/timeline~options\n * @param {number|undefined} [maxTimeGap]\n * Maximum of time period (in seconds) between two timestamps. If this option\n * is specified, than e.g. the method getTimes() could return more timestamps\n * than defined by setTimesBySetID.\n * @param {module:meteoJS/timeline~optionKeyboardNavigation}\n * [keyboardNavigation] - Keyboard navigation options.\n */\n\n/**\n * @event module:meteoJS/timeline#change:time\n * @property {Date} oldDate - Time before change.\n */\n\n/**\n * @event module:meteoJS/timeline#change:times\n */\n\n/**\n * @event module:meteoJS/timeline#change:enabledTimes\n */\n\n/**\n * @classdesc\n * Class represents a timeline.\n * On this timeline, you could define different set of times. This is useful for\n * the usecase 1: You have different data types for different times (like radar\n * and satellite pictures). Then, the timeline provides a list of all available\n * times. Each time in each set of times could be enabled or disabled. This\n * yields to the usecase 2: In a viewer of model charts, you probably want to\n * show all the times with charts. (Global models normally have a time interval\n * of 3 hours between charts) But for different parameters, you only provide\n * charts at a greater interval. E.g. you calculate 24h-precipiation sums only\n * for 00 UTC. So you can set the times of the 3-hour-interval and only set\n * the 00 UTC timestamps as enabled. To visualise the timeline use some\n * child class of the\n * {@link module:meteoJS/timeline/visualisation.Visualisation} class. To animate\n * through time steps use the {@link module:meteoJS/timeline/animation.Animation}\n * class.\n * \n * <pre><code>import Timeline from 'meteojs/Timeline';</code></pre>\n */\nexport class Timeline {\n \n /**\n * @param {module:meteoJS/timeline~options} [options] - Options.\n */\n constructor({ maxTimeGap = undefined,\n keyboardNavigation = {} } = {}) {\n /**\n * @type undefined|number\n * @private\n */\n this.maxTimeGap = maxTimeGap;\n \n /**\n * Date object with current selected time. Maybe invalid.\n * @member {Date}\n * @private\n */\n this.selectedTime = new Date('invalid');\n \n /**\n * Times of this timeline. Sorted upwardly.\n * @member {Date[]}\n * @private\n */\n this.times = [];\n \n /**\n * Times of this timeline, that are enabled at least in one set of times.\n * Sorted upwardly.\n * @member {Date[]}\n * @private\n */\n this.enabledTimes = [];\n \n /**\n * Times of this timeline, that are enabled through all set of times.\n * Sorted upwardly.\n * @member {Date[]}\n * @private\n */\n this.allEnabledTimes = [];\n \n /**\n * Objekt mit keys und Date-Arrays (zeitlich sortiert)\n * @type Object.<mixed,Object>\n * @private\n */\n this.timesByKey = {};\n \n /**\n * @type {module:meteoJS/timeline~keyboardNavigationOptions}\n * @private\n */\n this._keyboardNavigation = {};\n this._initKeyboardNavigation(keyboardNavigation);\n }\n \n /**\n * Current selected time.\n * \n * @returns {Date} Selected time, could be invalid.\n */\n getSelectedTime() {\n return this.selectedTime;\n }\n \n /**\n * Sets current selected time. You can select a time returned by getTimes only.\n * If this is not the case, an invalid timestamp will be set.\n * \n * @param {Date} time - Time to select.\n * @returns {module:meteoJS/timeline.Timeline} Returns this.\n * @fires module:meteoJS/timeline#change:time\n */\n setSelectedTime(time) {\n this._setSelectedTime(\n (_indexOfTimeInTimesArray(time, this.times) > -1) ?\n time : new Date('invalid'));\n return this;\n }\n \n /**\n * Returns a list of all timestamps represented by this timeline.\n * This includes on the one hand all timestamps defined by setTimesBySetID, on\n * the other hand there could exists additional timestamps (e.g. through the\n * maxTimeGap option).\n * \n * @returns {Date[]} All defined times, sorted upwardly.\n */\n getTimes() {\n return this.times;\n }\n \n /**\n * Returns a list of all enabled timestamps of this timeline.\n * \n * @returns {Date[]} All enabled times, sorted upwardly.\n */\n getEnabledTimes() {\n return this.enabledTimes;\n }\n \n /**\n * Returns a list of times. These times are enabled throug every set of times.\n * \n * @returns {Date[]} Enabled times, sorted upwardly.\n */\n getAllEnabledTimes() {\n return this.allEnabledTimes;\n }\n \n /**\n * Defines a set of times. Set is identified by an ID.\n * If the set was already defined, the set of times will be overwritten.\n * \n * @param {mixed} id - ID of the set of times.\n * @param {Date[]} times - Times (must be sorted upwardly).\n * @returns {module:meteoJS/timeline.Timeline} Returns this.\n * @fires module:meteoJS/timeline#change:times\n * @fires module:meteoJS/timeline#change:enabledTimes\n */\n setTimesBySetID(id, times) {\n this.timesByKey[id] = {\n times: times,\n enabled: times\n };\n this._updateTimes();\n this._updateEnabledTimes();\n return this;\n }\n \n /**\n * Defines the enbaled times of a set of times. The passed times must be\n * contained in the times of the set (defined earlier by setTimesBySetID).\n * \n * @param {mixed} id - ID of the set of times.\n * @param {Date[]} times - Times to set enabled (must be sorted upwardly).\n * @returns {module:meteoJS/timeline.Timeline} Returns this.\n * @fires module:meteoJS/timeline#change:enabledTimes\n */\n setEnabledTimesBySetID(id, times) {\n if (id in this.timesByKey) {\n this.timesByKey[id].enabled = times;\n this._updateEnabledTimes();\n }\n return this;\n }\n \n /**\n * Returns IDs of all defined sets.\n * \n * @return {mixed[]} IDs.\n */\n getSetIDs() {\n return Object.keys(this.timesByKey);\n }\n \n /**\n * Deletes a set of times.\n * \n * @param {mixed} id - ID of the set of times.\n * @returns {module:meteoJS/timeline.Timeline} Returns this.\n * @fires module:meteoJS/timeline#change:times\n * @fires module:meteoJS/timeline#change:enabledTimes\n */\n deleteSetID(id) {\n if (id in this.timesByKey) {\n delete this.timesByKey[id];\n this._updateTimes();\n this._updateEnabledTimes();\n }\n return this;\n }\n \n /**\n * Set selected time to the first time, which is enabled.\n * \n * @returns {module:meteoJS/timeline.Timeline} Returns this.\n */\n first() {\n this._setSelectedTime(this.getFirstEnabledTime());\n return this;\n }\n \n /**\n * Set selected time to the last time, which is enabled.\n * \n * @returns {module:meteoJS/timeline.Timeline} Returns this.\n */\n last() {\n this._setSelectedTime(this.getLastEnabledTime());\n return this;\n }\n \n /**\n * Changes selected time to the next enabled time.\n * \n * @returns {module:meteoJS/timeline.Timeline} Returns this.\n */\n next() {\n this._setSelectedTime(this.getNextEnabledTime());\n return this;\n }\n \n /**\n * Changes selected time to the previous enabled time.\n * \n * @returns {module:meteoJS/timeline.Timeline} Returns this.\n */\n prev() {\n this._setSelectedTime(this.getPrevEnabledTime());\n return this;\n }\n \n /**\n * Changes selected time to the next time, which is enabled by all sets.\n * \n * @returns {module:meteoJS/timeline.Timeline} Returns this.\n */\n nextAllEnabledTime() {\n this._setSelectedTime(this.getNextAllEnabledTime());\n return this;\n }\n \n /**\n * Changes selected time to the previous time, which is enabled by all sets.\n * \n * @returns {module:meteoJS/timeline.Timeline} Returns this.\n */\n prevAllEnabledTime() {\n this._setSelectedTime(this.getPrevAllEnabledTime());\n return this;\n }\n \n /**\n * Changes the selected time width adding an amount of \"time\".\n * If the \"new\" timestamp is not available, the selected time is not changed.\n * \n * @param {number} amount - \"Time\"-Amount.\n * @param {'years'|'y'|'months'|'M'|'days'|'d'|'hours'|'h'|'minutes'|'m'|'seconds'|'s'|'milliseconds'|'ms'}\n * timeKey - Period, nomenclature analogue to momentjs.\n * @returns {module:meteoJS/timeline.Timeline} - Returns this.\n */\n add(amount, timeKey) {\n let d = this.getSelectedTime();\n let delta = 0;\n switch (timeKey) {\n case 'hours':\n case 'h':\n delta = amount * 3600 * 1000;\n break;\n case 'minutes':\n case 'm':\n delta = amount * 60 * 1000;\n break;\n case 'seconds':\n case 's':\n delta = amount * 1000;\n break;\n case 'milliseconds':\n case 'ms':\n delta = amount;\n break;\n }\n if (delta != 0)\n d = new Date(d.valueOf() + delta);\n \n switch (timeKey) {\n case 'years':\n case 'y':\n d.setUTCFullYear(d.getUTCFullYear() + amount);\n break;\n case 'months':\n case 'M':\n d.setUTCMonth(d.getUTCMonth() + amount);\n break;\n case 'days':\n case 'd':\n d.setUTCDate(d.getUTCDate() + amount);\n break;\n }\n \n if (_indexOfTimeInTimesArray(d, this.times) > -1)\n this._setSelectedTime(d);\n return this;\n }\n \n /**\n * Changes the selected time width subracting an amount of \"time\".\n * If the \"new\" timestamp is not available, the selected time is not changed.\n * \n * @param {number} amount - \"Time\"-Amount.\n * @param {'years'|'y'|'months'|'M'|'days'|'d'|'hours'|'h'|'minutes'|'m'|'seconds'|'s'|'milliseconds'|'ms'}\n * timeKey - Period, nomenclature analogue to momentjs.\n * @returns {module:meteoJS/timeline.Timeline} - Returns this.\n */\n sub(amount, timeKey) {\n let d = this.getSelectedTime();\n let delta = 0;\n switch (timeKey) {\n case 'hours':\n case 'h':\n delta = amount * 3600 * 1000;\n break;\n case 'minutes':\n case 'm':\n delta = amount * 60 * 1000;\n break;\n case 'seconds':\n case 's':\n delta = amount * 1000;\n break;\n case 'milliseconds':\n case 'ms':\n delta = amount;\n break;\n }\n if (delta != 0)\n d = new Date(d.valueOf() - delta);\n \n switch (timeKey) {\n case 'years':\n case 'y':\n d.setUTCFullYear(d.getUTCFullYear() - amount);\n break;\n case 'months':\n case 'M':\n d.setUTCMonth(d.getUTCMonth() - amount);\n break;\n case 'days':\n case 'd':\n d.setUTCDate(d.getUTCDate() - amount);\n break;\n }\n \n if (_indexOfTimeInTimesArray(d, this.times) > -1)\n this._setSelectedTime(d);\n return this;\n }\n \n /**\n * Returns first time in this timeline, which is enabled by at least one set.\n * \n * @returns {Date} First enabled time, could be invalid.\n */\n getFirstEnabledTime() {\n return (this.enabledTimes.length > 0) ?\n this.enabledTimes[0] : new Date('invalid');\n }\n \n /**\n * Returns last time in this timeline, which is enabled by at least one set.\n * \n * @returns {Date} Last enabled time, could be invalid.\n */\n getLastEnabledTime() {\n return (this.enabledTimes.length > 0) ?\n this.enabledTimes[this.enabledTimes.length-1] : new Date('invalid');\n }\n \n /**\n * Returns next time after the selected time, which is enabled by at least\n * one set. If selected time is invalid, the first enabled time is returned.\n * \n * @returns {Date} Next enabled time.\n */\n getNextEnabledTime() {\n if (this.enabledTimes.length < 1)\n return new Date('invalid');\n var index = _indexOfTimeInTimesArray(this.getSelectedTime(), this.enabledTimes);\n if (index > -1) {\n index++;\n return (index < this.enabledTimes.length) ?\n this.enabledTimes[index] :\n this.enabledTimes[this.enabledTimes.length-1];\n }\n else if (isNaN(this.getSelectedTime()))\n return this.enabledTimes[0];\n else {\n // Es war kein Zeitpunkt aus enabledTimes\n var result = new Date('invalid');\n for (var i=0; i<this.enabledTimes.length; i++)\n if (this.getSelectedTime().valueOf() < this.enabledTimes[i].valueOf()) {\n result = this.enabledTimes[i];\n break;\n }\n return result;\n }\n }\n \n /**\n * Returns previous time before the selected time, which is enabled by at least\n * one set. If selected time is invalid, the last enabled time is returned.\n * \n * @returns {Date} Previous enabled time.\n */\n getPrevEnabledTime() {\n if (this.enabledTimes.length < 1)\n return new Date('invalid');\n var index = _indexOfTimeInTimesArray(this.getSelectedTime(), this.enabledTimes);\n if (index > -1) {\n index--;\n return (-1 < index) ? this.enabledTimes[index] : this.enabledTimes[0];\n }\n else if (isNaN(this.getSelectedTime()))\n return this.enabledTimes[0];\n else {\n // Es war kein Zeitpunkt aus enabledTimes\n var result = new Date('invalid');\n for (var i=this.enabledTimes.length-1; i>=0; i--)\n if (this.getSelectedTime().valueOf() > this.enabledTimes[i].valueOf()) {\n result = this.enabledTimes[i];\n break;\n }\n return result;\n }\n }\n \n /**\n * Returns first time in this timeline, which is enabled by at all sets.\n * \n * @returns {Date} First time, which is enabled by all sets.\n */\n getFirstAllEnabledTime() {\n return (this.allEnabledTimes.length > 0) ?\n this.allEnabledTimes[0] : new Date('invalid');\n }\n \n /**\n * Returns last time in this timeline, which is enabled by at all sets.\n * \n * @returns {Date} Last time, which is enabled by all sets.\n */\n getLastAllEnabledTime() {\n return (this.allEnabledTimes.length > 0) ?\n this.allEnabledTimes[this.allEnabledTimes.length-1] : new Date('invalid');\n }\n \n /**\n * Returns next time after the selected time, which is enabled by\n * all sets. If selected time is invalid, the last all enabled time is returned.\n * \n * @returns {Date} Next time, which is enabled by all sets.\n */\n getNextAllEnabledTime() {\n if (this.allEnabledTimes.length < 1)\n return new Date('invalid');\n var index = _indexOfTimeInTimesArray(this.getSelectedTime(), this.allEnabledTimes);\n if (index > -1) {\n index++;\n return (index < this.allEnabledTimes.length) ?\n this.allEnabledTimes[index] :\n this.allEnabledTimes[this.allEnabledTimes.length-1];\n }\n else if (isNaN(this.getSelectedTime()))\n return this.allEnabledTimes[0];\n else {\n // Es war kein Zeitpunkt aus allEnabledTimes\n var result = new Date('invalid');\n for (var i=0; i<this.allEnabledTimes.length; i++)\n if (this.getSelectedTime().valueOf() < this.allEnabledTimes[i].valueOf()) {\n result = this.allEnabledTimes[i];\n break;\n }\n return result;\n }\n }\n \n /**\n * Returns previous time before the selected time, which is enabled by\n * all sets. If selected time is invalid, the first all enabled time is returned.\n * \n * @returns {Date} Previous time, which is enabled by all sets.\n */\n getPrevAllEnabledTime() {\n if (this.allEnabledTimes.length < 1)\n return new Date('invalid');\n var index = _indexOfTimeInTimesArray(this.getSelectedTime(), this.allEnabledTimes);\n if (index > -1) {\n index--;\n return (-1 < index) ? this.allEnabledTimes[index] : this.allEnabledTimes[0];\n }\n else if (isNaN(this.getSelectedTime()))\n return this.allEnabledTimes[0];\n else {\n // Es war kein Zeitpunkt aus allEnabledTimes\n var result = new Date('invalid');\n for (var i=this.allEnabledTimes.length-1; i>=0; i--)\n if (this.getSelectedTime().valueOf() > this.allEnabledTimes[i].valueOf()) {\n result = this.allEnabledTimes[i];\n break;\n }\n return result;\n }\n }\n \n /**\n * Returns if the passed time is an enabled time.\n * \n * @returns {boolean}\n */\n isTimeEnabled(time) {\n return this.enabledTimes.reduce(function (acc, t) {\n return (t.valueOf() == time.valueOf()) ? true : acc;\n }, false);\n }\n \n /**\n * Returns if the passed time is an enabled time.\n * \n * @returns {boolean}\n */\n isTimeAllEnabled(time) {\n return this.allEnabledTimes.reduce(function (acc, t) {\n return (t.valueOf() == time.valueOf()) ? true : acc;\n }, false);\n }\n \n /**\n * Is the selected time the first enabled time.\n * \n * @returns {boolean}\n */\n isFirstEnabledTime() {\n return this.getFirstEnabledTime().valueOf() == this.getSelectedTime().valueOf();\n }\n \n /**\n * Is the selected time the last enabled time.\n * \n * @returns {boolean}\n */\n isLastEnabledTime() {\n return this.getLastEnabledTime().valueOf() == this.getSelectedTime().valueOf();\n }\n \n /**\n * Internal setter of the selected time. Caller must guarantee, that either\n * the passed timestamp exists in this.times or is invalid.\n * @param {Date} selectedTime - Selected time.\n * @fires module:meteoJS/timeline#change:time\n * @private\n */\n _setSelectedTime(selectedTime) {\n var oldTime = this.selectedTime;\n this.selectedTime = selectedTime;\n this.trigger('change:time', oldTime);\n return this.selectedTime;\n }\n \n /**\n * Bringt den Inhalt des Arrays this.times in\n * Übereinstimmung mit dem Inhalt von this.timesByKey\n * @private\n * @fires module:meteoJS/timeline#change:times\n */\n _updateTimes() {\n this.times = [];\n var timesArr = [];\n var times = {};\n for (var key in this.timesByKey)\n this.timesByKey[key].times.forEach(function (t) {\n if (!(t.valueOf() in times)) {\n timesArr.push(t);\n times[t.valueOf()] = t;\n }\n });\n _sortTimesArray(timesArr);\n timesArr.forEach(function (time) {\n if (this.times.length < 1) {\n this.times.push(time);\n return;\n }\n var lastTime = this.times[this.times.length-1];\n if (this.maxTimeGap !== undefined &&\n (time.valueOf()-lastTime.valueOf()) > 1000*this.maxTimeGap) {\n var t = lastTime;\n do {\n t = new Date(t.getTime() + this.maxTimeGap*1000);\n this.times.push(t);\n } while ((time.valueOf()-t.valueOf()) > 1000*this.maxTimeGap);\n }\n this.times.push(time);\n }, this);\n _sortTimesArray(this.times);\n this.trigger('change:times');\n }\n \n /**\n * Bringt den Inhalt der Arrays this.enabledTimes und this.allEnabledTimes in\n * Übereinstimmung mit dem Inhalt von this.timesByKey\n * @private\n * @fires module:meteoJS/timeline#change:enabledTimes\n */\n _updateEnabledTimes() {\n this.enabledTimes = [];\n this.allEnabledTimes = [];\n var enabledTimes = {};\n var allEnabledTimes = {};\n for (var key in this.timesByKey) {\n this.timesByKey[key].enabled.forEach(function (t) {\n if (!(t.valueOf() in enabledTimes)) {\n this.enabledTimes.push(t);\n enabledTimes[t.valueOf()] = t;\n }\n if (!(t.valueOf() in allEnabledTimes))\n allEnabledTimes[t.valueOf()] = 1;\n else\n allEnabledTimes[t.valueOf()]++;\n }, this);\n }\n _sortTimesArray(this.enabledTimes);\n for (var value in allEnabledTimes)\n if (allEnabledTimes[value] == Object.keys(this.timesByKey).length)\n this.allEnabledTimes.push(enabledTimes[value]);\n _sortTimesArray(this.allEnabledTimes);\n this.trigger('change:enabledTimes');\n }\n \n /**\n * Intialize property \"_keyboardNavigation\".\n * \n * @param {module:meteoJS/timeline~optionKeyboardNavigation}\n * [keyboardNavigation] - Keyboard navigation options.\n * @private\n */\n _initKeyboardNavigation({\n enabled = false,\n first = 36,\n last = 35,\n prev = 37,\n next = 39,\n prevAllEnabledTime = [37, 'ctrl'],\n nextAllEnabledTime = [39, 'ctrl'],\n add = undefined,\n sub = undefined\n } = {}) {\n if (add === undefined)\n add = {\n '3h': [39, 'ctrl', 'shift'],\n '6h': [39, 'shift'],\n '12h': [39, 'alt', 'shift'],\n '24h': [39, 'alt']\n };\n if (sub === undefined)\n sub = {\n '3h': [37, 'ctrl', 'shift'],\n '6h': [37, 'shift'],\n '12h': [37, 'alt', 'shift'],\n '24h': [37, 'alt']\n };\n this._keyboardNavigation = {\n enabled,\n first,\n last,\n prev,\n next,\n prevAllEnabledTime,\n nextAllEnabledTime,\n add,\n sub\n };\n if (document && this._keyboardNavigation.enabled)\n document.addEventListener('keydown', event => {\n Object.keys(this._keyboardNavigation).forEach(method => {\n if (method == 'enabled')\n return;\n if (/^(add|sub)$/.test(method)) {\n Object.keys(this._keyboardNavigation[method]).forEach(time => {\n const matches = time.match(/^([0-9]+)\\s*([a-zA-Z]+)$/);\n if (matches === null)\n return;\n if (_isEventMatchPressedKeys(event, this._keyboardNavigation[method][time])) {\n this[method](+matches[1], matches[2]);\n event.preventDefault();\n event.stopPropagation();\n }\n });\n }\n else if (method in this\n && _isEventMatchPressedKeys(event, this._keyboardNavigation[method])) {\n this[method]();\n event.preventDefault();\n event.stopPropagation();\n }\n });\n });\n }\n}\naddEventFunctions(Timeline.prototype);\nexport default Timeline;\n\n/**\n * Gibt den Index eines Zeitpunktes in einem Array aus Zeitpunkten zurück.\n * @param {Date} time Zeitpunkt\n * @param {Date[]} times Array aus Zeitpunkten\n * @returns {number} -1 für \"nicht gefunden\n * @static\n * @private\n */\nexport let _indexOfTimeInTimesArray = (time, times) => {\n return times.findIndex(function (t) {\n return t.valueOf() == time.valueOf();\n });\n};\n\n/**\n * Sortiert einen Array aus Zeitpunkten zeitlich aufwärts\n * @param {Date[]} times Array aus Zeitpunkten\n * @static\n * @private\n */\nfunction _sortTimesArray(times) {\n times.sort(function (a,b) { return a.valueOf()-b.valueOf(); });\n}\n\n/**\n * Returns if an event represents a certain key pressed with (optional)\n * additional special keys.\n * \n * @param {KeyboardEvent} keyboardEvent - Keyboard event.\n * @param {module:meteoJS/timeline~optionPressedKeys} pressedKeys\n * Checks if this keys are pressed.\n * @private\n */\nexport function _isEventMatchPressedKeys(keyboardEvent, pressedKeys) {\n if (typeof pressedKeys != 'object' ||\n !('forEach' in pressedKeys))\n pressedKeys = [pressedKeys];\n if (pressedKeys.length == 0)\n return false;\n let result =\n [['ctrl', 'ctrlKey'],\n ['alt', 'altKey'],\n ['shift', 'shiftKey'],\n ['meta', 'metaKey']]\n .reduce((acc, cur) => acc && (((pressedKeys.indexOf(cur[0]) > -1))\n ? keyboardEvent[cur[1]]\n : !keyboardEvent[cur[1]]),\n true);\n pressedKeys.forEach(o => {\n switch (o) {\n case 'ctrl':\n case 'alt':\n case 'shift':\n case 'meta': break;\n default: if (o != keyboardEvent.keyCode) result = false;\n }\n });\n return result;\n}","const __WEBPACK_NAMESPACE_OBJECT__ = jQuery;","/**\n * @module meteoJS/timeline/animation\n */\nimport $ from 'jquery';\nimport addEventFunctions from '../Events.js';\nimport Timeline from '../Timeline.js';\n\n/**\n * Options for animation constructor.\n * \n * @typedef {Object} module:meteoJS/timeline/animation~options\n * @param {module:meteoJS/timeline.Timeline} timeline - Timeline to animate.\n * @param {number} [restartPause=1.8]\n * Time in seconds to pause before the animation restart.\n * @param {number} [imagePeriod=0.2]\n * Time in seconds between animation of two images.\n * Ignored, if imageFrequency is specified.\n * @param {number|undefined} [imageFrequency]\n * Time of images during one second.\n * @param {boolean} [enabledStepsOnly=true] - Use only enabled times.\n * @param {boolean} [allEnabledStepsOnly=false]\n * Use only times that are enabled by all sets of time.\n */\n\n/**\n * Event on animation start.\n * \n * @event module:meteoJS/timeline/animation#start:animation\n */\n\n/**\n * Event on animation stop.\n * \n * @event module:meteoJS/timeline/animation#stop:animation\n */\n\n/**\n * Event on reaching last timestamp.\n * \n * @event module:meteoJS/timeline/animation#end:animation\n */\n\n/**\n * Event triggered immediatly before restart of animation.\n * \n * @event module:meteoJS/timeline/animation#restart:animation\n */\n\n/**\n * Event triggered when imageFrequency/imagePeriod is changed.\n * \n * @event module:meteoJS/timeline/animation#change:imageFrequency\n */\n\n/**\n * Event triggered when restartPause is changed.\n * \n * @event module:meteoJS/timeline/animation#change:restartPause\n */\n\n/**\n * Object to animate {@link module:meteoJS/timeline.Timeline}.\n * \n * <pre><code>import Animation from 'meteojs/timeline/Animation';</code></pre>\n */\nexport class Animation {\n \n /**\n * @param {module:meteoJS/timeline/animation~options} options - Options.\n */\n constructor({ timeline,\n restartPause = 1.8,\n imagePeriod = 0.2,\n imageFrequency = undefined,\n enabledStepsOnly = true,\n allEnabledStepsOnly = false } = {}) {\n /**\n * @type module:meteoJS/timeline/animation~options\n * @private\n */\n this.options = {\n timeline,\n restartPause,\n imagePeriod,\n imageFrequency,\n enabledStepsOnly,\n allEnabledStepsOnly\n };\n // Normalize options\n if (this.options.timeline === undefined)\n this.options.timeline = new Timeline();\n if (this.options.imageFrequency !== undefined &&\n this.options.imageFrequency != 0)\n this.options.imagePeriod = 1/this.options.imageFrequency;\n /**\n * ID to window.setInterval() of the animation.\n * If undefined, there is no started animation.\n * @type undefined|number\n * @private\n */\n this.animationIntervalID = undefined;\n \n /**\n * ID to window.setTimeout() ot the animation (used for restart-pause).\n * If undefined, there is no started setTimeout (i.e. no restart-pause).\n * @type undefined|number\n * @private\n */\n this.animationTimeoutID = undefined;\n \n /**\n * Current position in this.times in the animation.\n * @type integer\n * @private\n */\n this.animationStep = 0;\n \n /**\n * Hash with timestamps-valueOf's as keys and index in this.times as values.\n * @type Object\n * @private\n */\n this.timesHash = {};\n \n /**\n * List of timestamps. Current list of times of the timeline to animate over.\n * @type Date[]\n * @private\n */\n this.times = [];\n \n // Timeline initialisieren\n let onChangeTimes = () => {\n this.times = this.options.timeline[this._getTimelineTimesMethod()]();\n this.timesHash = {};\n this.times.forEach((time, i) => this.timesHash[time.valueOf()] = i);\n };\n this.options.timeline.on(this._getTimelineChangeTimesEvent(), onChangeTimes);\n onChangeTimes();\n }\n \n /**\n * Returns time period between two animation steps (in s).\n * \n * @returns {number} Time period.\n */\n getImagePeriod() {\n return this.options.imagePeriod;\n }\n \n /**\n * Sets time period between to animation steps (in s)\n * \n * @param {number} imagePeriod - Time period.\n * @returns {module:meteoJS/timeline/animation.Animation} This.\n */\n setImagePeriod(imagePeriod) {\n this.options.imagePeriod = imagePeriod;\n if (this.isStarted())\n this._updateAnimation();\n this.trigger('change:imageFrequency');\n return this;\n }\n \n /**\n * Returns time frequency of animation steps (in 1/s).\n * \n * @returns {number} Time frequency.\n */\n getImageFrequency() {\n return 1/this.options.imagePeriod;\n }\n \n /**\n * Sets time frequency of animation steps (in 1/s).\n * \n * @param {number} imageFrequency - Time frequency.\n * @returns {module:meteoJS/timeline/animation.Animation} This.\n */\n setImageFrequency(imageFrequency) {\n if (imageFrequency != 0)\n this.setImagePeriod(1/imageFrequency);\n return this;\n }\n \n /**\n * Returns time duration before a restart (jump from end to beginning, in s).\n * \n * @returns {number} Time duration.\n */\n getRestartPause() {\n return this.options.restartPause;\n }\n \n /**\n * Sets time duration before a restart (in s).\n * \n * @param {number} restartPause - Time duration.\n * @returns {module:meteoJS/timeline/animation.Animation} This.\n */\n setRestartPause(restartPause) {\n this.options.restartPause = Number(restartPause); // Convert string to number\n this.trigger('change:restartPause');\n return this;\n }\n \n /**\n * Is animation started.\n * \n * @returns {boolean}\n */\n isStarted() {\n return this.animationIntervalID !== undefined ||\n this.animationTimeoutID !== undefined;\n }\n \n /**\n * Starts the animation.\n * \n * @returns {module:meteoJS/timeline/animation.Animation} This.\n * @fires module:meteoJS/timeline/animation#start:animation\n */\n start() {\n if (this.options.timeline.getSelectedTime().valueOf() in this.timesHash)\n this._setStep(this.timesHash[this.options.timeline.getSelectedTime().valueOf()]);\n if (!this.isStarted())\n this._updateAnimation();\n this.trigger('start:animation');\n }\n \n /**\n * Stops the animation.\n * \n * @returns {module:meteoJS/timeline/animation.Animation} This.\n * @fires module:meteoJS/timeline/animation#stop:animation\n */\n stop() {\n this._clearAnimation();\n this.trigger('stop:animation');\n }\n \n /**\n * Toggles the animation.\n * \n * @returns {module:meteoJS/timeline/animation.Animation} This.\n */\n toggle() {\n if (this.isStarted())\n this.stop();\n else\n this.start();\n }\n \n /**\n * Setzt Schritt der Animation\n * @private\n * @param {number} step\n */\n _setStep(step) {\n if (0 <= step && step < this._getCount())\n this.animationStep = step;\n }\n \n /**\n * Gibt timeline-Event Name zum abhören von Änderungen der Zeitschritte zurück.\n * @private\n * @returns {string}\n */\n _getTimelineChangeTimesEvent() {\n return (this.options.enabledStepsOnly || this.options.allEnabledStepsOnly)\n ? 'change:enabledTimes' : 'change:times';\n }\n \n /**\n * Gibt timeline-Methode aller Zeitschritte zurück.\n * @private\n * @returns {string}\n */\n _getTimelineTimesMethod() {\n return this.options.allEnabledStepsOnly ? 'getAllEnabledTimes' :\n this.options.enabledStepsOnly ? 'getEnabledTimes' : 'getTimes';\n }\n \n /**\n * Gibt Anzahl Animationsschritte zurück\n * @private\n * @returns {number}\n */\n _getCount() {\n return this.options.timeline[this._getTimelineTimesMethod()]().length;\n }\n \n /**\n * Handelt die Animation\n * @private\n * @fires module:meteoJS/timeline/animation#end:animation\n * @fires module:meteoJS/timeline/animation#restart:animation\n */\n _updateAnimation() {\n this._clearAnimation();\n if (this.animationStep < this._getCount()-1)\n this._initAnimation();\n else\n this._initRestartPause();\n }\n \n /**\n * Startet Animation\n * @private\n */\n _initAnimation() {\n if (this.animationIntervalID === undefined)\n this.animationIntervalID = window.setInterval(() => {\n this.animationStep++;\n if (this.animationStep < this.times.length)\n this.options.timeline.setSelectedTime(this.times[this.animationStep]);\n if (this.animationStep >= this._getCount()-1) {\n this.trigger('end:animation');\n this._clearAnimation();\n this._initRestartPause();\n }\n }, this.options.imagePeriod * 1000);\n }\n \n /**\n * Startet den Timer für die Restart-Pause\n * Verwende als Zeitspanne imagePeriod+restartPause. Sonst wird bei restartPause\n * 0s der letzte Zeitschritt gar nie angezeigt.\n * @private\n */\n _initRestartPause() {\n if (this.animationTimeoutID === undefined)\n this.animationTimeoutID = window.setTimeout(() => {\n this.animationStep = 0;\n this.trigger('restart:animation');\n if (this.animationStep < this.times.length)\n this.options.timeline.setSelectedTime(this.times[this.animationStep]);\n this._clearAnimation();\n this._initAnimation();\n }, (this.options.imagePeriod + this.options.restartPause) * 1000);\n }\n \n /**\n * Löscht window.interval, falls vorhanden\n * @private\n */\n _clearAnimation() {\n if (this.animationIntervalID !== undefined) {\n window.clearInterval(this.animationIntervalID);\n this.animationIntervalID = undefined;\n }\n if (this.animationTimeoutID !== undefined) {\n window.clearTimeout(this.animationTimeoutID);\n this.animationTimeoutID = undefined;\n }\n }\n \n}\naddEventFunctions(Animation.prototype);\nexport default Animation;\n\n/**\n * Insert an input-group to change frequency.\n * \n * <pre><code>import { insertFrequencyInput } from 'meteojs/timeline/Animation';</code></pre>\n * \n * @param {external:jQuery} node - Node to insert input-group.\n * @param {Object} options - Options for input-group.\n * @param {module:meteoJS/timeline/animation.Animation} options.animation\n * Animation object.\n * @param {string} [options.suffix='fps'] - Suffix text for input-group.\n * @returns {external:jQuery} Input-group node.\n */\nexport function insertFrequencyInput(node, { animation, suffix = 'fps' }) {\n const number = $('<input>')\n .addClass('form-control')\n .attr('type', 'number')\n .attr('min', 1)\n .attr('step', 1);\n const inputGroupNumber = $('<div>')\n .addClass('input-group')\n .append(number)\n .append($('<span>').addClass('input-group-text').text(suffix));\n number.on('change', () => animation.setImageFrequency(number.val()));\n const onChangeImageFrequency = () => number.val(animation.getImageFrequency());\n animation.on('change:imageFrequency', onChangeImageFrequency);\n onChangeImageFrequency();\n node.append(inputGroupNumber);\n return inputGroupNumber;\n}\n\n/**\n * Insert an input-range to change frequency.\n * \n * <pre><code>import { insertFrequencyRange } from 'meteojs/timeline/Animation';</code></pre>\n * \n * @param {external:jQuery} node - Node to insert input-range.\n * @param {Object} options - Options for input-range.\n * @param {module:meteoJS/timeline/animation.Animation} options.animation\n * Animation object.\n * @param {number[]} options.frequencies - Frequencies to select.\n * @returns {external:jQuery} Input-range node.\n */\nexport function insertFrequencyRange(node, { animation, frequencies }) {\n frequencies = frequencies ? frequencies : [1];\n let range = $('<input>')\n .addClass('form-range')\n .attr('type', 'range')\n .attr('min', 0)\n .attr('max', frequencies.length-1);\n range.on('change input', () => {\n let i = range.val();\n if (i < frequencies.length)\n animation.setImageFrequency(frequencies[i]);\n });\n let onChangeImageFrequency = () => {\n let i = frequencies.indexOf(animation.getImageFrequency());\n if (i > -1)\n range.val(i);\n };\n animation.on('change:imageFrequency', onChangeImageFrequency);\n onChangeImageFrequency();\n node.append(range);\n return range;\n}\n\n/**\n * Insert an button-group to change frequency.\n * \n * <pre><code>import { insertFrequencyButtonGroup } from 'meteojs/timeline/Animation';</code></pre>\n * \n * @param {external:jQuery} node - Node to insert the button-group.\n * @param {Object} options - Options for the button-group.\n * @param {module:meteoJS/timeline/animation.Animation} options.animation\n * Animation object.\n * @param {number[]} options.frequencies - Frequencies to select.\n * @param {string|undefined} [options.btnGroupClass='btn-group']\n * Class added to the button-group node.\n * @param {string|undefined} [options.btnClass='btn btn-primary']\n * Class added to each button.\n * @param {string} [options.suffix='fps']\n * Suffix text for each button after frequency.\n * @returns {external:jQuery} Button-group node.\n */\nexport function insertFrequencyButtonGroup(node, {\n animation,\n frequencies,\n btnGroupClass = 'btn-group',\n btnClass = 'btn btn-primary',\n suffix = 'fps'\n}) {\n let btnGroup = $('<div>').addClass(btnGroupClass);\n frequencies = frequencies ? frequencies : [];\n frequencies.forEach(freq => {\n btnGroup.append($('<button>')\n .addClass(btnClass)\n .data('frequency', freq)\n .text(freq + ' ' + suffix)\n .click(() => animation.setImageFrequency(freq)));\n });\n let onChange = () => {\n btnGroup.children('button').removeClass('active').each(function () {\n if ($(this).data('frequency') == animation.getImageFrequency())\n $(this).addClass('active');\n });\n };\n animation.on('change:imageFrequency', onChange);\n onChange();\n node.append(btnGroup);\n return btnGroup;\n}\n\n/**\n * Insert an input-group to change restart pause.\n * \n * <pre><code>import { insertRestartPauseInput } from 'meteojs/timeline/Animation';</code></pre>\n * \n * @param {external:jQuery} node - Node to insert input-group.\n * @param {Object} options - Options for input-group.\n * @param {module:meteoJS/timeline/animation.Animation} options.animation\n * Animation object.\n * @param {string} [options.suffix='s'] - Suffix text for input-group.\n * @returns {external:jQuery} Input-group node.\n */\nexport function insertRestartPauseInput(node, { animation, suffix = 's' }) {\n const input = $('<input>')\n .addClass('form-control')\n .attr('type', 'number')\n .attr('min', 0)\n .attr('step', 0.1);\n const inputGroupNumber = $('<div>')\n .addClass('input-group')\n .append(input)\n .append($('<span>').addClass('input-group-text').text(suffix));\n input.on('change', () => animation.setRestartPause(input.val()));\n const onChange = () => input.val(animation.getRestartPause());\n animation.on('change:restartPause', onChange);\n onChange();\n node.append(inputGroupNumber);\n return inputGroupNumber;\n}\n\n/**\n * Insert an input-range to change restart pause.\n * \n * <pre><code>import { insertRestartPauseRange } from 'meteojs/timeline/Animation';</code></pre>\n * \n * @param {external:jQuery} node - Node to insert input-range.\n * @param {Object} options - Options for input-range.\n * @param {module:meteoJS/timeline/animation.Animation} options.animation\n * Animation object.\n * @param {number[]} options.pauses - Restart pauses to select.\n * @returns {external:jQuery} Input-range node.\n */\nexport function insertRestartPauseRange(node, { animation, pauses }) {\n pauses = pauses ? pauses : [1];\n pauses = pauses.map(p => Math.round(p * 1000));\n let range = $('<input>')\n .addClass('form-range')\n .attr('type', 'range')\n .attr('min', 0)\n .attr('max', pauses.length-1);\n range.on('change input', () => {\n let i = range.val();\n if (i < pauses.length)\n animation.setRestartPause(pauses[i] / 1000);\n });\n let onChangeImageFrequency = () => {\n let i =\n pauses.indexOf(Math.round(animation.getRestartPause() * 1000));\n if (i > -1)\n range.val(i);\n };\n animation.on('change:imageFrequency', onChangeImageFrequency);\n onChangeImageFrequency();\n node.append(range);\n return range;\n}\n\n/**\n * Insert an button-group to change restart pause.\n * \n * <pre><code>import { insertRestartPauseButtonGroup } from 'meteojs/timeline/Animation';</code></pre>\n * \n * @param {external:jQuery} node - Node to insert the button-group.\n * @param {Object} options - Options for the button-group.\n * @param {module:meteoJS/timeline/animation.Animation} options.animation\n * Animation object.\n * @param {number[]} options.pauses - Restart pauses to select.\n * @param {string|undefined} [options.btnGroupClass='btn-group']\n * Class added to the button-group node.\n * @param {string|undefined} [options.btnClass='btn btn-primary']\n * Class added to each button.\n * @param {string} [options.suffix='s']\n * Suffix in each button after duration text.\n * @returns {external:jQuery} Button-group node.\n */\nexport function insertRestartPauseButtonGroup(node, {\n animation,\n pauses,\n btnGroupClass = 'btn-group',\n btnClass = 'btn btn-primary',\n suffix = 's'\n}) {\n let btnGroup = $('<div>').addClass(btnGroupClass);\n pauses = pauses ? pauses : [];\n pauses.forEach(pause => {\n btnGroup.append($('<button>')\n .addClass(btnClass)\n .data('pause', pause)\n .text(pause + ' ' + suffix)\n .click(() => animation.setRestartPause(pause)));\n });\n let onChange = () => {\n btnGroup.children('button').removeClass('active').each(function () {\n if ($(this).data('pause') == animation.getRestartPause())\n $(this).addClass('active');\n });\n };\n animation.on('change:restartPause', onChange);\n onChange();\n node.append(btnGroup);\n return btnGroup;\n}","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"16\\\" height=\\\"16\\\" fill=\\\"currentColor\\\" class=\\\"bi bi-play-fill\\\" viewBox=\\\"0 0 16 16\\\">\\n <path d=\\\"m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z\\\"/>\\n</svg>\";","export default \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"16\\\" height=\\\"16\\\" fill=\\\"currentColor\\\" class=\\\"bi bi-pause-fill\\\" viewBox=\\\"0 0 16 16\\\">\\n <path d=\\\"M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z\\\"/>\\n</svg>\";","/**\n * @module meteoJS/timeline/animation/togglebutton\n */\nimport $ from 'jquery';\nimport { insertFrequencyInput,\n insertFrequencyRange,\n insertRestartPauseInput } from '../Animation.js';\nimport biPlayFill from 'bootstrap-icons/icons/play-fill.svg';\nimport biPauseFill from 'bootstrap-icons/icons/pause-fill.svg';\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/timeline/animation/togglebutton~options\n * @param {module:meteoJS/timeline/animation.Animation} animation Animation object.\n * @param {external:HTMLElement} node\n * Node to append the button and the dropdown menu (if menu set to true).\n * If this is a 'button' element, this will be the animation button and\n * no menu is added.\n * @param {string|external:HTMLElement|undefined} [startedContent]\n * Content or text of button node if animation is running.\n * Default ist the Bootstrap\n * {@link https://icons.getbootstrap.com/icons/pause-fill/|pause-fill} Icon.\n * @param {string|undefined} [startedClass]\n * Classed added to button node if animation is running.\n * @param {string|external:HTMLElement|undefined} [stoppedContent]\n * Content of button node if animation is stopped.\n * Default ist the Bootstrap\n * {@link https://icons.getbootstrap.com/icons/play-fill/|play-fill} Icon.\n * @param {string|undefined} [stoppedClass]\n * Classed added to button node if animation is running.\n * @param {string|undefined} [classButton]\n * Classed added to button node.\n * @param {boolean} [menu=true]\n * Add dropdown menu for animation setup to the button. Ignored, if node is a\n * button element.\n * @param {boolean} [menuImageFrequency=true]\n * Show frequency configuration in the dropdown menu.\n * @param {string} [imageFrequencyCaption='Frequency']\n * Label text for the frequency configuration in the dropdown menu.\n * @param {undefined|integer[]} [menuFrequencies]\n * Array of frequencies for the range slider. If undefined the slider will be\n * hidden.\n * @param {boolean} [menuRestartPause=true]\n * Show restart pause configuration in the dropdown menu.\n * @param {string} [restartPauseCaption='Restart pause']\n * Label text for the restart pause configuration in the dropdown menu.\n */\n\n/**\n * @classdesc\n * Object to style a button accordingly to the status of an animation object.\n * \n * <pre><code>import ToggleButton from 'meteojs/timeline/animation/ToggleButton';</code></pre>\n */\nexport class ToggleButton {\n \n /**\n * @param {module:meteoJS/timeline/animation/togglebutton~options} options Options.\n */\n constructor(options = {}) {\n let { animation = undefined,\n node = undefined,\n startedContent = undefined,\n startedClass = undefined,\n stoppedContent = undefined,\n stoppedClass = undefined,\n classButton = undefined,\n classDropdownToggle = undefined,\n menu = true,\n menuImageFrequency = true,\n imageFrequencyCaption = 'Frequency',\n menuFrequencies = undefined,\n menuRestartPause = true,\n restartPauseCaption = 'Restart pause' } = options;\n if (!('startedContent' in options))\n startedContent = $(biPauseFill);\n if (!('stoppedContent' in options))\n stoppedContent = $(biPlayFill);\n /**\n * @type meteoJS/timeline/animation/togglebutton~options\n * @private\n */\n this.options = {\n animation,\n node,\n startedContent,\n startedClass,\n stoppedContent,\n stoppedClass,\n classButton,\n classDropdownToggle,\n menu,\n menuImageFrequency,\n imageFrequencyCaption,\n menuFrequencies,\n menuRestartPause,\n restartPauseCaption\n };\n \n this.options.node = $(this.options.node);\n let animationButton = this.options.node;\n if (!this.options.node.is('button')) {\n animationButton = $('<button>').addClass('btn');\n this.options.node.append(animationButton);\n }\n animationButton.addClass(this.options.classButton);\n \n let onStart = () => {\n animationButton.removeClass(this.options.stoppedClass);\n animationButton.addClass(this.options.startedClass);\n animationButton.empty();\n if (typeof this.options.startedContent === 'string' ||\n this.options.startedContent instanceof String)\n animationButton.text(this.options.startedContent);\n else\n animationButton.append(this.options.startedContent);\n };\n let onStop = () => {\n animationButton.removeClass(this.options.startedClass);\n animationButton.addClass(this.options.stoppedClass);\n animationButton.empty();\n if (typeof this.options.stoppedContent === 'string' ||\n this.options.stoppedContent instanceof String)\n animationButton.text(this.options.stoppedContent);\n else\n animationButton.append(this.options.stoppedContent);\n };\n this.options.animation.on('start:animation', onStart);\n this.options.animation.on('stop:animation', onStop);\n animationButton.click(() => this.options.animation.toggle());\n this.options.animation.isStarted() ? onStart() : onStop();\n \n if (!this.options.node.is('button') &&\n this.options.menu) {\n // Add dropdown menu\n this.options.node.addClass('btn-group');\n let btnDropdown = $('<button>')\n .attr('type', 'button')\n .addClass('btn dropdown-toggle dropdown-toggle-split')\n .addClass(this.options.classDropdownToggle)\n .attr('data-bs-toggle', 'dropdown')\n .attr('aria-expanded', false);\n btnDropdown.append($('<span>')\n .addClass('visually-hidden')\n .text('Toggle Dropdown'));\n this.options.node.append(btnDropdown);\n let menuDropdown = $('<div>')\n .addClass('dropdown-menu');\n this.options.node.append(menuDropdown);\n \n let form = $('<form>').addClass('px-4 py-3');\n if (this.options.menuImageFrequency || this.options.menuRestartPause)\n menuDropdown.append(form);\n\n if (this.options.menuImageFrequency) {\n const label = $('<label>')\n .addClass('form-label')\n .text(this.options.imageFrequencyCaption);\n const div = $('<div>').append(label);\n if (this.options.menuRestartPause)\n div.addClass('mb-3');\n form.append(div);\n insertFrequencyInput(div, {\n animation: this.options.animation\n });\n if (this.options.menuFrequencies !== undefined)\n insertFrequencyRange(div, {\n animation: this.options.animation,\n frequencies: this.options.menuFrequencies\n });\n }\n \n if (this.options.menuRestartPause) {\n const label = $('<label>')\n .addClass('form-label')\n .text(this.options.restartPauseCaption);\n const div = $('<div>').append(label);\n form.append(div);\n insertRestartPauseInput(div, {\n animation: this.options.animation\n });\n }\n }\n }\n \n}\nexport default ToggleButton;","/**\n * @module meteoJS/timeline/visualisation\n */\nimport addEventFunctions from '../Events.js';\nimport Timeline from '../Timeline.js';\n\n/**\n * Returns a textual representation of a time according to a passed format.\n * \n * This function could be used to convert Date-objects to a readable time with\n * external libraries. One such implementation is given by\n * {@link module:meteoJS/timeline/visualisation.makeTimeTextCallbackFunction}.\n * \n * @typedef {Function}\n * module:meteoJS/timeline/visualisation~timeTextCallbackFunction\n * @param {Date} time - A valid datetime.\n * @param {string} format - Format string.\n * @returns {string} Textual representation.\n */\n\n/**\n * Options for Visualisation.\n * \n * @typedef {Object} module:meteoJS/timeline/visualisation~options\n * @param {module:meteoJS/timeline.Timeline} [timeline]\n * Timeline object.\n * @param {external:jQuery} [node] - Node.\n * @param {module:meteoJS/timeline/animation.Animation} [animation]\n * Animation object. If specified, the animation will be stopped on user\n * interaction with the visualisation object.\n * @param {boolean} [enabledStepsOnly=true] - Use only enabled times.\n * @param {boolean} [allEnabledStepsOnly=false]\n * Use only times that are enabled by all sets of time.\n * @param {string} [textInvalid='-']\n * Output string, if time of timeline is invalid.\n * @param {module:meteoJS/timeline/visualisation~timeTextCallbackFunction}\n * [getTimeText]\n * Returns a textual representation of a time according to a passed format.\n * @param {string} [outputTimezone]\n * 'local' for browser local timezone.\n */\n\n/**\n * Object to visualise {@link module:meteoJS/timeline.Timeline}.\n * \n * How to create your own visualisation object:\n * * Inherit this object\n * * Inherit method onChangeTime()\n * * Inherit method onChangeTimes()\n * * Inherit method emptyNode()\n * * Inherit method onInitNode()\n * * To get all times to display use getTimelineTimes()\n * * Use method timeToText() to convert a Date to String.\n * * Use method attachEventListener() to attach event listeners on a object.\n * The event listener will be deleted automatically if the output is muted.\n * * At the end of the constructor call \"this.setNode(this.options.node);\".\n * \n * <pre><code>import Visualisation from 'meteojs/timeline/Visualisation';</code></pre>\n * \n * @abstract\n * @listens module:meteoJS/timeline#change:time\n * @listens module:meteoJS/timeline#change:times\n * @listens module:meteoJS/timeline#change:enabledTimes\n */\nexport class Visualisation {\n \n /**\n * @param {module:meteoJS/timeline/visualisation~options} options - Options.\n */\n constructor({\n timeline = undefined,\n node = undefined,\n animation = undefined,\n enabledStepsOnly = true,\n allEnabledStepsOnly = false,\n textInvalid = '-',\n getTimeText = undefined,\n outputTimezone = undefined\n } = {}) {\n /**\n * @type Object\n * @private\n */\n this.options = {\n timeline,\n node,\n animation,\n enabledStepsOnly,\n allEnabledStepsOnly,\n textInvalid,\n getTimeText,\n outputTimezone\n };\n \n // Normalize options\n if (this.options.timeline === undefined)\n this.options.timeline = new Timeline();\n \n /**\n * @member {Array[]}\n * @private\n */\n this.listeners = [];\n \n /**\n * @member {undefined|mixed}\n * @private\n */\n this.inputListener = undefined;\n }\n \n /**\n * Sets jQuery-Node for output.\n * \n * @public\n * @param {external:jQuery|undefined} node Node, undefined to mute the output.\n * @returns {module:meteoJS/timeline/visualisation.Visualisation} This.\n */\n setNode(node) {\n if (this.options.node !== undefined)\n this.emptyNode();\n \n if (node === undefined) {\n this.detachEventListeners();\n this.options.node = node;\n }\n else {\n this.options.node = node;\n var isListenersDefined = this.listeners.length > 0;\n if (!isListenersDefined) {\n this.attachEventListener(this.options.timeline, 'change:time', function () {\n this.onChangeTime();\n }, this);\n this.attachEventListener(this.options.timeline, 'change:times', function () {\n this.onChangeTimes();\n }, this);\n this.attachEventListener(this.options.timeline, 'change:enabledTimes', function () {\n this.onChangeTimes();\n }, this);\n }\n this.onInitNode(isListenersDefined);\n this.onChangeTimes();\n this.onChangeTime();\n }\n \n if (this.inputListener === undefined)\n this.inputListener = this.on('input', function () {\n if (this.options.animation !== undefined)\n this.options.animation.stop();\n }, this);\n \n return this;\n }\n \n /**\n * Gets current value of output timezone.\n * \n * @public\n * @returns {string|undefined} Output timezone.\n */\n getOutputTimezone() {\n return this.options.outputTimezone;\n }\n \n /**\n * Sets output timezone, undefined for UTC.\n * \n * @public\n * @param {string|undefined} outputTimezone Timezone for datetime output.\n * @returns {module:meteoJS/timeline/visualisation.Visualisation} This.\n */\n setOutputTimezone(outputTimezone) {\n var updateOutput = (this.options.outputTimezone != outputTimezone);\n this.options.outputTimezone = outputTimezone;\n if (updateOutput &&\n this.options.node !== undefined) {\n this.onChangeTimes();\n this.onChangeTime();\n }\n return this;\n }\n \n /**\n * Called if the timeline triggers the\n * {@link module:meteoJS/timeline#change:time} event.\n * Prerequisite: this.options.node must be defined.\n * \n * @abstract\n * @protected\n */\n onChangeTime() {}\n \n /**\n * Called if the timeline triggers the {@link module:meteoJS/timeline#change:times}\n * or {@link module:meteoJS/timeline#change:enabledTimes} event.\n * Prerequisite: this.options.node must be defined.\n * \n * @abstract\n * @protected\n */\n onChangeTimes() {}\n \n /**\n * Called to empty the output node. Mainly if the output is muted.\n * Prerequisite: this.options.node must be defined.\n * \n * @abstract\n * @protected\n */\n emptyNode() {}\n \n /**\n * Called once an output node is set.\n * Prerequisite: this.options.node must be defined.\n * \n * @abstract\n * @protected\n * @param {boolean} isListenersDefined\n * True if the event listeners are already set.\n */\n onInitNode() {}\n \n /**\n * Returns the times to display. This could be either all times in the timeline\n * or only the enabled times or the all enabled times. The user of the\n * visualisation object select this by the options.\n * \n * @protected\n * @returns {Date[]} Times.\n */\n getTimelineTimes() {\n var methodName = this.options.allEnabledStepsOnly ?\n 'getAllEnabledTimes' :\n this.options.enabledStepsOnly ? 'getEnabledTimes' : 'getTimes';\n return this.options.timeline[methodName]();\n }\n \n /**\n * Converts a Date-object to a string.\n * \n * @protected\n * @param {Date} time - Time.\n * @param {string} format - Format string, passed to the .\n * @returns {string} String.\n */\n timeToText(time, format) {\n if (isNaN(time))\n return this.options.textInvalid;\n if (this.options.getTimeText !== undefined)\n return this.options.getTimeText.call(this, time, format);\n return time.toISOString();\n }\n \n /**\n * Attach an event listener on an object. Object could be a jQuery-object or\n * an object using {@link module:meteoJS/events}.\n * \n * @protected\n * @param {Object} obj - Object to put the event listener on.\n * @param {mixed} listener - Event listener key.\n * @param {Function} func - Function to be executed when event is triggered.\n * @param {Object} [thisArg] - This in the function func when event triggered.\n */\n attachEventListener(obj, listener, func, thisArg) {\n this.listeners.push([obj, listener]);\n obj.on(listener, func, thisArg);\n }\n \n /**\n * Detaches all event listeners.\n * \n * @private\n */\n detachEventListeners() {\n this.listeners.forEach(function (listenerArr) {\n if ('un' in listenerArr[0])\n listenerArr[0].un(listenerArr[1]);\n else if ('off' in listenerArr[0])\n listenerArr[0].off(listenerArr[1]);\n });\n this.listeners = [];\n }\n \n}\naddEventFunctions(Visualisation.prototype);\nexport default Visualisation;\n\n/**\n * moment.js object.\n * \n * @external momentjs\n * @see {@link https://momentjs.com}\n */\n\n/**\n * Format a Date-object via the {@link https://momentjs.com|Moment.js} library.\n * \n * <pre><code>import { makeTimeTextCallbackFunction } from 'meteojs/timeline/Visualisation';</code></pre>\n * \n * @param {external:momentjs} moment - Moment.js object.\n * @returns {module:meteoJS/timeline/visualisation~timeTextCallbackFunction}\n * Callback.\n */\nexport function makeTimeTextCallbackFunction(moment) {\n return function (time, format) {\n const m = moment.utc(time);\n if (this.options.outputTimezone !== undefined)\n (this.options.outputTimezone == 'local')\n ? m.local()\n : m.tz(this.options.outputTimezone);\n return m.format(format);\n };\n}","/**\n * @module meteoJS/timeline/visualisation/text\n */\nimport Visualisation from '../Visualisation.js';\n\n/**\n * Options for constructor.\n * \n * @typedef {module:meteoJS/timeline/visualisation/slider~options}\n * module:meteoJS/timeline/visualisation/text~options\n * @param {string|undefined} format\n * Format string, used for 'getTimeText'.\n */\n\n/**\n * Show current selected time of a timeline as text.\n * \n * <pre><code>import Text from 'meteojs/timeline/visualisation/Text';</code></pre>\n * \n * @extends module:meteoJS/timeline/visualisation.Visualisation\n */\nexport class Text extends Visualisation {\n \n /**\n * @param {module:meteoJS/timeline/visualisation/text~options} options - Options.\n */\n constructor({\n format = undefined,\n ...rest\n } = {}) {\n super(rest);\n \n this.options.format = format;\n this.setNode(this.options.node);\n }\n \n /**\n * @inheritdoc\n */\n onChangeTime() {\n this.options.node.text(\n this.timeToText(this.options.timeline.getSelectedTime(),\n this.options.format));\n }\n \n /**\n * @inheritdoc\n */\n emptyNode() {\n this.options.node.text('');\n }\n \n}\nexport default Text;","/**\n * @module meteoJS/timeline/visualisation/slider\n */\nimport $ from 'jquery';\nimport Visualisation from '../Visualisation.js';\n\n/**\n * Options for constructor.\n * \n * @typedef {module:meteoJS/timeline/visualisation~options}\n module:meteoJS/timeline/visualisation/slider~options\n */\n\n/**\n * Show timeline as a slider.\n * \n * <pre><code>import Slider from 'meteojs/timeline/visualisation/Slider';</code></pre>\n * \n * @extends module:meteoJS/timeline/visualisation.Visualisation\n */\nexport class Slider extends Visualisation {\n \n /**\n * @param {module:meteoJS/timeline/visualisation/slider~options} options\n * Options.\n */\n constructor(options) {\n super(options);\n \n /**\n * @member {Date[]}\n * @private\n */\n this.times = [];\n /**\n * @member {Object}\n * @private\n */\n this.timesIndexes = {};\n \n this.setNode(this.options.node);\n }\n \n /**\n * @inheritdoc\n */\n onChangeTime() {\n var t = this.options.timeline.getSelectedTime();\n if (t.valueOf() in this.timesIndexes)\n this.options.node.val(this.timesIndexes[t.valueOf()]+1);\n else\n this.options.node.val(1);\n }\n \n /**\n * @inheritdoc\n */\n onChangeTimes() {\n this.times = this.getTimelineTimes();\n this.timesIndexes = {};\n this.times.forEach(function (time, i) {\n this.timesIndexes[time.valueOf()] = i;\n }, this);\n this.options.node.prop('max', this.times.length);\n }\n \n /**\n * @inheritdoc\n */\n onInitNode(isListenersDefined) {\n this.options.node.prop('min', 1);\n this.options.node.prop('step', 1);\n if (!isListenersDefined) {\n var that = this;\n this.attachEventListener(this.options.node, 'change input', function () {\n var i = +$(this).val();\n if (0 < i &&\n i <= that.times.length)\n that.options.timeline.setSelectedTime(that.times[i-1]);\n that.trigger('input');\n });\n }\n }\n \n}\nexport default Slider;","/**\n * @module meteoJS/timeline/visualisation/bsButtons\n */\nimport $ from 'jquery';\nimport Visualisation from '../Visualisation.js';\n\n/**\n * Dynamic format string to output the time for each Time-Button.\n * \n * @typedef {Function} module:meteoJS/timeline/visualisation/bsButtons~timeFormatFunction\n * @param {Date} time - Timestamp of the Button.\n * @returns {String} A string to format the time for the Time-Buttons.\n */\n\n/**\n * Options for constructor.\n * \n * @typedef {module:meteoJS/timeline/visualisation~options}\n * module:meteoJS/timeline/visualisation/bsButtons~options\n * @property {String|module:meteoJS/timeline/visualisation/bsButtons~timeFormatFunction} [format='HH']\n * Format-String for the time of the Time-Buttons.\n */\n\n/**\n * Show timeline as a group of buttons.\n * \n * <pre><code>import bsButtons from 'meteojs/timeline/visualisation/bsButtons';</code></pre>\n * \n * @extends module:meteoJS/timeline/visualisation.Visualisation\n */\nexport class bsButtons extends Visualisation {\n \n /**\n * @param {module:meteoJS/timeline/visualisation/bsButtons~options} options - Options.\n */\n constructor({\n format = 'HH',\n grouping = 'daily',\n groupingFormat = 'ddd, DD. MMM',\n classMain = 'btn-toolbar',\n classButtonGroup = 'btn-group',\n classButtonGroupMargin = 'me-2',\n classLabel = undefined,\n classLabelSpan = 'd-block w-100',\n classButton = 'btn',\n classButtonActive = 'active',\n classButtonNotEnabled = 'btn-light',\n classButtonEnabled = 'btn-secondary',\n classButtonAllEnabled = 'btn-primary',\n /*prependNodes = undefined,\n appendNodes = undefined*/\n ...rest\n } = {}) {\n super(rest);\n \n this.options.format = format;\n this.options.grouping = grouping;\n this.options.groupingFormat = groupingFormat;\n this.options.classMain = classMain;\n this.options.classButtonGroup = classButtonGroup;\n this.options.classButtonGroupMargin = classButtonGroupMargin;\n this.options.classLabel = classLabel;\n this.options.classLabelSpan = classLabelSpan;\n this.options.classButton = classButton;\n this.options.classButtonActive = classButtonActive;\n this.options.classButtonNotEnabled = classButtonNotEnabled;\n this.options.classButtonEnabled = classButtonEnabled;\n this.options.classButtonAllEnabled = classButtonAllEnabled;\n \n /**\n * @member {external:jQuery|undefined}\n * @private\n */\n this.toolbarNode = undefined;\n \n this.setNode(this.options.node);\n }\n \n /**\n * @inheritdoc\n */\n onChangeTime() {\n if (this.toolbarNode === undefined)\n return;\n \n var time = this.options.timeline.getSelectedTime();\n var that = this;\n this.toolbarNode.find('button').each(function () {\n var t = new Date(+$(this).data('time'));\n $(this)\n .removeClass(that.options.classButtonActive);\n /*.removeClass(that.options.classButtonAllEnabled)\n .removeClass(that.options.classButtonEnabled)\n .removeClass(that.options.classButtonNotEnabled);*/\n if (time.valueOf() == t.valueOf())\n $(this).addClass(that.options.classButtonActive);\n /*else if (that.options.timeline.isTimeAllEnabled(t))\n $(this).addClass(that.options.classButtonAllEnabled);\n else if (that.options.timeline.isTimeEnabled(t))\n $(this).addClass(that.options.classButtonEnabled);\n else\n $(this).addClass(that.options.classButtonNotEnabled);*/\n });\n }\n \n /**\n * @inheritdoc\n */\n onChangeTimes() {\n if (this.toolbarNode === undefined)\n this.toolbarNode = $('<div>');\n this.toolbarNode.empty();\n \n var groupingFormat =\n (this.options.grouping == 'daily') ? 'YYYY-MM-DD' :\n (this.options.grouping == 'hourly') ? 'YYYY-MM-DD HH' :\n this.options.grouping;\n var lastNode = undefined;\n this.getTimelineTimes().forEach(function (time) {\n if (lastNode === undefined ||\n lastNode.data('date') != this.timeToText(time, groupingFormat)) {\n var btnGroup = $('<div>')\n .addClass(this.options.classButtonGroup)\n .addClass(this.options.classButtonGroupMargin)\n .attr('role', 'group')\n .attr('aria-label', this.timeToText(time, groupingFormat));\n if (this.options.groupingFormat === undefined) {\n lastNode = btnGroup;\n }\n else {\n var span = $('<span>')\n .addClass(this.options.classLabelSpan)\n .text(this.timeToText(time, this.options.groupingFormat));\n lastNode = $('<label>')\n .addClass(this.options.classLabel)\n .append(span);\n btnGroup.attr('aria-label', span.text());\n lastNode.append(btnGroup);\n }\n lastNode.data('date', this.timeToText(time, groupingFormat));\n this.toolbarNode.append(lastNode);\n }\n \n var btn = $('<button>')\n .addClass(this.options.classButton)\n .attr('type', 'button')\n .data('time', time.valueOf());\n if (typeof this.options.format == 'function')\n btn.text(this.timeToText(time, this.options.format.call(this, time)));\n else\n btn.text(this.timeToText(time, this.options.format));\n if (this.options.timeline.isTimeAllEnabled(time))\n btn.addClass(this.options.classButtonAllEnabled);\n else if (this.options.timeline.isTimeEnabled(time))\n btn.addClass(this.options.classButtonEnabled);\n else\n btn.addClass(this.options.classButtonNotEnabled);\n let selectedTime = this.options.timeline.getSelectedTime();\n if (time.valueOf() == selectedTime.valueOf())\n btn.addClass(this.options.classButtonActive);\n var that = this;\n btn.click(function () {\n that.options.timeline.setSelectedTime(new Date(+$(this).data('time')));\n that.trigger('input');\n });\n if (lastNode.hasClass(this.options.classButtonGroup))\n lastNode.append(btn);\n else\n lastNode.children('div').append(btn);\n }, this);\n this.toolbarNode.find('div.'+this.options.classButtonGroup).last().removeClass(this.options.classButtonGroupMargin);\n }\n \n /**\n * @inheritdoc\n */\n emptyNode() {\n this.toolbarNode = undefined;\n this.options.node.empty();\n }\n \n /**\n * @inheritdoc\n */\n onInitNode() {\n this.toolbarNode = $('<div>')\n .addClass(this.options.classMain)\n .attr('role', 'toolbar')\n .attr('aria-label', 'Timeline toolbar');\n this.options.node.append(this.toolbarNode);\n }\n \n}\nexport default bsButtons;","/**\n * @module meteoJS/timeline/visualisation/bsDropdown\n */\nimport $ from 'jquery';\nimport Visualisation from '../Visualisation.js';\nimport Text from './Text.js';\n\n/**\n * Options for constructor.\n * \n * @typedef {module:meteoJS/timeline/visualisation~options}\n * module:meteoJS/timeline/visualisation/bsDropdown~options\n * @param {string|undefined} format\n * Format string for dropdown items, used for 'getTimeText'.\n * @param {string|undefined} buttonFormat\n * Format string for dropdown button, used for 'getTimeText'.\n * @param {string} grouping\n * 'daily', 'hourly' or a format string. Defines if items will be grouped and\n * be title depending on groupingDivider and groupingFormat.\n * @param {boolean} groupingDivider Show dropdown divider above an item group.\n * @param {undefined|string} groupingFormat\n * Format string for a dropdown header above an item group.\n * @param {undefined|string} classMain Class for the main node.\n * @param {undefined|string} classDropdownMenu Class for the dropdown node.\n * @param {undefined|string} classDropdownItem Class for a dropdown item.\n * @param {undefined|string} classItemActive Class for an active item.\n * @param {undefined|string} classItemNotEnabled Class for a not enabled item.\n * @param {undefined|string} classItemEnabled Class for an enabled item.\n * @param {undefined|string} classItemAllEnabled Class for an all enabled item.\n * @param {undefined|string} classDropdownHeader Class for dropdown header.\n * @param {undefined|string} classDropdownDivider Class for dropdown divider.\n * @param {undefined|string} classDropdownButton Class for the dropdown button.\n * @param {undefined|string} classButtonNotEnabled\n * Class for the dropdown button if the selected time is not enabled.\n * @param {undefined|string} classButtonEnabled\n * Class for the dropdown button if the selected time is enabled.\n * @param {undefined|string} classButtonAllEnabled\n * Class for the dropdown button if the selected time is all enabled.\n */\n\n/**\n * Show timeline in a dropdown menu. The menu will be build according to\n * bootstrap.\n * \n * <pre><code>import bsDropdown from 'meteojs/timeline/visualisation/bsDropdown';</code></pre>\n * \n * @extends module:meteoJS/timeline/visualisation.Visualisation\n */\nexport class bsDropdown extends Visualisation {\n \n /**\n * @param {module:meteoJS/timeline/visualisation/bsDropdown~options} options - Options.\n */\n constructor({\n format = 'HH:mm',\n buttonFormat = 'DD. MMMM YYYY HH:mm',\n grouping = 'daily',\n groupingDivider = true,\n groupingFormat = 'ddd, DD. MMMM YYYY',\n classMain = 'dropdown',\n classDropdownMenu = 'dropdown-menu',\n classDropdownItem = 'dropdown-item',\n classItemActive = 'active',\n classItemNotEnabled = 'disabled',\n classItemEnabled = undefined,\n classItemAllEnabled = undefined,\n classDropdownHeader = 'dropdown-header',\n classDropdownDivider = 'dropdown-divider',\n classDropdownButton = 'btn dropdown-toggle',\n classButtonNotEnabled = undefined,\n classButtonEnabled = undefined,\n classButtonAllEnabled = undefined,\n ...rest\n } = {}) {\n super(rest);\n \n this.options.format = format;\n this.options.buttonFormat = buttonFormat;\n this.options.grouping = grouping;\n this.options.groupingDivider = groupingDivider;\n this.options.groupingFormat = groupingFormat;\n this.options.classMain = classMain;\n this.options.classDropdownMenu = classDropdownMenu;\n this.options.classDropdownItem = classDropdownItem;\n this.options.classItemActive = classItemActive;\n this.options.classItemNotEnabled = classItemNotEnabled;\n this.options.classItemEnabled = classItemEnabled;\n this.options.classItemAllEnabled = classItemAllEnabled;\n this.options.classDropdownHeader = classDropdownHeader;\n this.options.classDropdownDivider = classDropdownDivider;\n this.options.classDropdownButton = classDropdownButton;\n this.options.classButtonNotEnabled = classButtonNotEnabled;\n this.options.classButtonEnabled = classButtonEnabled;\n this.options.classButtonAllEnabled = classButtonAllEnabled;\n \n /**\n * @member {module:meteoJS/timeline/visualisation/text.Text}\n * @private\n */\n this.visualisationButtonText = new Text({\n timeline: this.options.timeline,\n format: this.options.buttonFormat,\n textInvalid: this.options.textInvalid,\n outputTimezone: this.options.outputTimezone,\n getTimeText: this.options.getTimeText\n });\n /**\n * @member {external:jQuery|undefined}\n * @private\n */\n this.dropdownNode = undefined;\n \n this.setNode(this.options.node);\n }\n \n /**\n * @inheritdoc\n */\n setOutputTimezone(outputTimezone) {\n super.setOutputTimezone(outputTimezone);\n this.visualisationButtonText.setOutputTimezone(outputTimezone);\n return this;\n }\n \n /**\n * @inheritdoc\n */\n onChangeTime() {\n if (this.dropdownNode === undefined)\n return;\n \n var time = this.options.timeline.getSelectedTime();\n this.options.node.children('li').children('button')\n .removeClass(this.options.classButtonActive)\n .removeClass(this.options.classButtonNotEnabled)\n .removeClass(this.options.classButtonEnabled)\n .removeClass(this.options.classButtonAllEnabled);\n if (this.options.timeline.isTimeAllEnabled(time))\n this.options.node.children('button')\n .addClass(this.options.classButtonAllEnabled);\n else if (this.options.timeline.isTimeEnabled(time))\n this.options.node.children('button')\n .addClass(this.options.classButtonEnabled);\n else\n this.options.node.children('button')\n .addClass(this.options.classButtonNotEnabled);\n var that = this;\n this.dropdownNode\n .children('li')\n .children('button.'+this.options.classDropdownItem)\n .each(function () {\n var t = new Date(+$(this).data('time'));\n $(this)\n .removeClass(that.options.classItemActive)\n .removeClass(that.options.classItemNotEnabled)\n .removeClass(that.options.classItemEnabled)\n .removeClass(that.options.classItemAllEnabled);\n if (time.valueOf() == t.valueOf())\n $(this).addClass(that.options.classItemActive);\n else if (that.options.timeline.isTimeAllEnabled(t))\n $(this).addClass(that.options.classItemAllEnabled);\n else if (that.options.timeline.isTimeEnabled(t))\n $(this).addClass(that.options.classItemEnabled);\n else\n $(this).addClass(that.options.classItemNotEnabled);\n });\n }\n \n /**\n * @inheritdoc\n */\n onChangeTimes() {\n if (this.dropdownNode === undefined)\n this.dropdownNode = $('<div>');\n this.dropdownNode.empty();\n \n var groupingFormat =\n (this.options.grouping == 'daily') ? 'YYYY-MM-DD' :\n (this.options.grouping == 'hourly') ? 'YYYY-MM-DD HH' :\n this.options.grouping;\n var lastGroupTimeStr = undefined;\n this.getTimelineTimes().forEach(function (time) {\n if (lastGroupTimeStr === undefined ||\n lastGroupTimeStr != this.timeToText(time, groupingFormat)) {\n if (lastGroupTimeStr !== undefined && // No divider at the beginning\n this.options.groupingDivider)\n this.dropdownNode\n .append($('<div>')\n .addClass(this.options.classDropdownDivider));\n if (this.options.groupingFormat !== undefined)\n this.dropdownNode\n .append($('<h6>')\n .addClass(this.options.classDropdownHeader)\n .text(this.timeToText(time, this.options.groupingFormat)));\n lastGroupTimeStr = this.timeToText(time, groupingFormat);\n }\n var btn = $('<button>')\n .addClass(this.options.classDropdownItem)\n .attr('type', 'button')\n .text(this.timeToText(time, this.options.format))\n .data('time', time.valueOf());\n var that = this;\n btn.click(function () {\n that.options.timeline.setSelectedTime(new Date(+$(this).data('time')));\n that.trigger('input');\n });\n this.dropdownNode.append($('<li>').append(btn));\n }, this);\n }\n \n /**\n * @inheritdoc\n */\n emptyNode() {\n if (this.visualisationButtonText !== undefined)\n this.visualisationButtonText.setNode(undefined);\n this.dropdownNode = undefined;\n this.options.node.empty();\n }\n \n /**\n * @inheritdoc\n */\n onInitNode() {\n var id = 'dropdownMenuButton';\n var i=0;\n while (document.getElementById(id) != null) {\n id = 'dropdownMenuButton'+(++i);\n }\n \n var button = $('<button>')\n .addClass(this.options.classDropdownButton)\n .attr('type', 'button')\n .attr('id', id)\n .attr('data-bs-toggle', 'dropdown')\n .attr('aria-haspopup', true)\n .attr('aria-expanded', false);\n this.visualisationButtonText.setNode(button);\n this.dropdownNode = $('<ul>')\n .addClass(this.options.classDropdownMenu)\n .attr('aria-labelledby', id);\n this.options.node\n .addClass(this.options.classMain)\n .append(button)\n .append(this.dropdownNode);\n }\n \n}\nexport default bsDropdown;","/**\n * @module meteoJS/synview/map\n */\nimport $ from 'jquery';\nimport addEventFunctions from '../Events.js';\n\n/** \n * Event object.\n * \n * @typedef {Object} module:meteoJS/synview/map~extendedEvent\n * @param {module:meteoJS/synview/type.Type} type Type belonging to the event.\n * @param {Object} layer Layer belonging to the event.\n * @param {Object} feature Vector feature, if present.\n * @param {Mixed[]} color Color of pixel (rgba), if present.\n */\n\n/**\n * Options for meteoJS/synview/map.\n * \n * @typedef {Object} module:meteoJS/synview/map~options\n * @param {mixed} map Map object.\n * @param {mixed} layerGroup Layer group within synview will operate.\n */\n\n/**\n * Triggered on view changes.\n * \n * @event module:meteoJS/synview/map#change:view\n */\n\n/**\n * Triggered on pointer moves over map.\n * \n * @event module:meteoJS/synview/map#move:pointer\n */\n\n/**\n * Triggered on pointer clicks into the map, with no dragging. A double click\n * will fire two events.\n * \n * @event module:meteoJS/synview/map#click:pointer\n */\n\n/**\n * Triggered on pointer clicks into the map, with no dragging and no double\n * click.\n * \n * @event module:meteoJS/synview/map#singleclick:pointer\n */\n\n/**\n * Triggered on pointer double clicks into the map, with no dragging.\n * \n * @event module:meteoJS/synview/map#dblclick:pointer\n */\n\n/**\n * Triggered on pointer dragging.\n * \n * @event module:meteoJS/synview/map#drag:pointer\n */\n\n/**\n * Abstract class to defined interface to the mapping library.\n * \n * @abstract\n * @fires module:meteoJS/synview/map#change:view\n */\nexport class SynviewMap {\n \n /**\n * @param {module:meteoJS/synview/map~options} options Options.\n */\n constructor(options) {\n /**\n * @member {meteoJS/synview/map~options}\n * @private\n */\n this.options = $.extend(true, {\n map: undefined,\n layerGroup: undefined\n }, options);\n }\n \n /**\n * Returns map object.\n * \n * @return {mixed} Map object.\n */\n getMap() {\n return this.options.map;\n }\n \n /**\n * Helper function. Returns the view center in WGS84 coordinates, lat/lon.\n * \n * @abstract\n * @return {number[]|undefined} Center.\n */\n getViewCenter() {}\n \n /**\n * Helper function. Sets the view center in WGS84 coordinates, lat/lon.\n * \n * @abstract\n * @param {number[]|undefined} center Center.\n * @return {module:meteoJS/synview/map.SynviewMap} This.\n */\n setViewCenter() {\n return this;\n }\n \n /**\n * Helper function. Returns the view zoom level.\n * \n * @abstract\n * @return {number|undefined} Zoom level.\n */\n getViewZoom() {}\n \n /**\n * Helper function. Sets the view zoom level.\n * \n * @abstract\n * @param {number|undefined} zoom Zoom level.\n * @return {module:meteoJS/synview/map.SynviewMap} This.\n */\n setViewZoom() {\n return this;\n }\n \n /**\n * Returns a new layer group, already added to the map.\n * \n * @abstract\n * @return {mixed} New layer group.\n */\n makeLayerGroup() {}\n \n /**\n * Returns an event object, that is extended by several keys.\n * Synview internal method.\n * \n * @abstract\n * @param {object} event Map event object.\n * @param {module:meteoJS/synview/typeCollection.TypeCollection} collection Type collection.\n * @return {module:meteoJS/synview/map~extendedEvent} Event object.\n */\n getExtendedEventByTypeCollection(event) {\n event.synviewType = undefined;\n event.layer = undefined;\n event.feature = undefined;\n event.color = undefined;\n return event;\n }\n \n /**\n * Returns index of the passed layer inside the layer group of the passed type.\n * Synview internal method.\n * \n * @abstract\n * @param {object} layer Layer object.\n * @param {module:meteoJS/synview/type.Type} type Type.\n * @return {integer} Index.\n */\n findLayerInType() {\n return -1;\n }\n \n}\naddEventFunctions(SynviewMap.prototype);\nexport default SynviewMap;","/**\n * @module meteoJS/synview/collection\n */\nimport addEventFunctions from '../Events.js';\n\n/**\n * Triggered on adding item to collection.\n * \n * @event module:meteoJS/synview/collection#add:item\n * @param {object} Added item.\n */\n\n/**\n * Triggered on replacing item with already existing ID.\n * \n * @event module:meteoJS/synview/collection#replace:item\n * @param {object} Added item.\n * @param {object} Replaced and removed item.\n */\n\n/**\n * Triggered on removing item from collection.\n * \n * @event module:meteoJS/synview/collection#remove:item\n * @param {object} Removed item.\n */\n\n/**\n * Collection of items.\n * Items have at least a getId() method, which returns a unique ID.\n */\nexport class Collection {\n \n constructor() {\n /**\n * List of IDs of the items.\n * @member {mixed}\n * @private\n */\n this.itemIds = [];\n \n /**\n * List of items, ID as key of the object.\n * @member {Object}\n * @private\n */\n this.items = {};\n }\n \n /**\n * Returns count of items in this collection.\n * \n * @return {integer} Count.\n */\n getCount() {\n return this.itemIds.length;\n }\n \n /**\n * Returns items (in order as appended).\n * \n * @return {Object[]} Items.\n */\n getItems() {\n return this.itemIds.map(function (id) { return this.items[id]; }, this);\n }\n \n /**\n * Returns a list of IDs (in order as appended).\n * \n * @return {mixed[]} List of IDs.\n */\n getItemIds() {\n return this.itemIds;\n }\n \n /**\n * Returns item by ID, undefined if ID doesn't exist.\n * \n * @param {mixed} id ID.\n * @return {Object|undefined} Item.\n */\n getItemById(id) {\n return (id in this.items) ? this.items[id] : undefined;\n }\n \n /**\n * Returns if an ID exists in this collection.\n * \n * @param {mixed} id ID.\n * @return {boolean} If exists.\n */\n containsId(id) {\n return this.getIndexById(id) !== -1;\n }\n \n /**\n * Returns index of the item in this collecition, -1 if not existant.\n * \n * @param {mixed} id ID.\n * @return {integer} Index.\n */\n getIndexById(id) {\n var result = -1;\n this.itemIds.forEach(function (itemId, i) {\n if (itemId == id)\n result = i;\n });\n return result;\n }\n \n /**\n * Append an item to the collection.\n * \n * @param {object} item New item.\n * @return {module:meteoJS/synview/collection.Collection} This.\n * @fires module:meteoJS/synview/collection#add:item\n * @fires module:meteoJS/synview/collection#replace:item\n */\n append(item) {\n var id = item.getId();\n if (this.containsId(id)) {\n this.trigger('replace:item', item, this.getItemById(id));\n this.items[id] = item;\n }\n else {\n this.itemIds.push(id);\n this.items[id] = item;\n this.trigger('add:item', item);\n }\n return this;\n }\n \n /**\n * Removes an item from the collection.\n * \n * @param {mixed} id ID of the item to delete.\n * @return {module:meteoJS/synview/collection.Collection} This.\n * @fires module:meteoJS/synview/collection#remove:item\n */\n remove(id) {\n var item = this.getItemById(id);\n if (item !== undefined) {\n var index = this.getIndexById(id);\n delete this.items[id];\n this.itemIds.splice(index, 1);\n this.trigger('remove:item', item);\n }\n return this;\n }\n \n}\naddEventFunctions(Collection.prototype);\nexport default Collection;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.layer.Group;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.layer.Vector;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.Observable;","/**\n * @module meteoJS/synview/resource\n */\nimport VectorLayer from 'ol/layer/Vector';\nimport { unByKey } from 'ol/Observable';\nimport addEventFunctions from '../Events.js';\n\n/**\n * Options for the constructor.\n * \n * @typedef {Object} module:meteoJS/synview/resource~options\n * @param {undefined|String} url - URL to resource.\n * @param {undefined|Date} datetime\n * Datetime for this resource, undefined if resource have no datetime.\n * @param {undefined|String} mimetype - MIME-Type of the resource.\n * @param {undefined|Integer} reloadTime\n * After this time period the resource will be reloaded. Undefined for no\n * reload. (in seconds)\n * @param {undefined|String} className - Type's classname.\n * @param {undefined|boolean} [imageSmoothingEnabled=undefined]\n * Disable image smoothing to draw sharp edges in image layers.\n * Undefined uses the default (true).\n * @param {Object} ol - Options for openlayers.\n * @param {Object|external:ol/source/Source~Source|undefined} ol.source\n * Options for openlayers source object or OL source object already.\n * @param {Object.<string,Function>|undefined} ol.events \n * Function to listen to module:ol/render/Event~RenderEvent.\n * @param {undefined|external:ol/style/Style~Style|external:ol/style/Style~Style|external:ol/style/Style~StyleFunction} [ol.style]\n * Style for features. If this is a module:ol/style/Style~StyleFunction,\n * then \"this\" will be bound to this module:meteoJS/synview/resource~Resource.\n */\n\n/**\n * Object representing a resource.\n */\nexport class Resource {\n \n /**\n * @param {module:meteoJS/synview/resource~options} options - Options.\n */\n constructor({\n url = undefined,\n datetime = undefined,\n mimetype = undefined,\n reloadTime = undefined,\n className = undefined,\n imageSmoothingEnabled = undefined,\n ol = {}\n } = {}) {\n /**\n * @type {Object}\n * @private\n */\n this.options = {\n url,\n datetime,\n mimetype,\n reloadTime,\n className,\n ol\n };\n this._normalizeOLOptions(this.options.ol);\n \n /**\n * @type {external:ol.layer.Layer|undefined}\n * @private\n */\n this.layer = undefined;\n \n /**\n * @type {ol.layer.Group|L.layerGroup|undefined}\n * @private\n */\n this.layerGroup = undefined;\n \n /**\n * @type {number|undefined}\n * @private\n */\n this.reloadTimerId = undefined;\n \n /**\n * @type {boolean}\n * @private\n */\n this.visible = false;\n \n /**\n * @type {number|undefined}\n * @private\n */\n this.zIndex = undefined;\n \n /**\n * @type {number}\n * @private\n */\n this.opacity = 1.0;\n \n /**\n * @type {boolean}\n * @private\n */\n this._imageSmoothing = imageSmoothingEnabled;\n }\n \n /**\n * Returns an ID for this resource. Should change, if content of resource\n * changes.\n * \n * @return {mixed} Id.\n */\n getId() {\n return this.getUrl();\n }\n \n /**\n * Returns URL to the resource. Undefined if unknown.\n * \n * @return {string|undefined} URL.\n */\n getUrl() {\n return this.options.url;\n }\n \n /**\n * Returns the datetime of the resource.\n * \n * @return {Date|undefined} Date.\n */\n getDatetime() {\n return this.options.datetime;\n }\n \n /**\n * Returns MIME-Type of the resource.\n * \n * @return {string} MIME-Type.\n */\n getMIMEType() {\n return (this.options.mimetype === undefined) ?\n 'application/octet-stream' : this.options.mimetype;\n }\n \n /**\n * Returns the current reload time.\n * \n * @return {undefined|integer} Reload time period.\n */\n getReloadTime() {\n return this.options.reloadTime;\n }\n \n /**\n * Sets the reload time.\n * \n * @param {undefined|integer} reloadTime Reload time period.\n * @return {module:meteoJS/synview/resource.Resource} This.\n */\n setReloadTime(reloadTime) {\n this.options.reloadTime = reloadTime;\n this._reload(); // starts or stops frequent reload\n return this;\n }\n \n /**\n * Returns the visibility of the resource layer.\n * \n * @return {boolean} Visible.\n */\n getVisible() {\n return this.visible;\n }\n \n /**\n * Sets the visibility of the resource layer.\n * \n * @param {boolean} visible Visible.\n * @return {module:meteoJS/synview/resource.Resource} This.\n */\n setVisible(visible) {\n this.visible = visible;\n if (this.layer !== undefined) {\n // OpenLayers\n if ('setVisible' in this.layer)\n this.layer.setVisible(visible);\n // Leaflet\n else {\n if (this.visible)\n this.layer.addTo(this.layerGroup);\n else\n this.layerGroup.removeLayer(this.layer);\n }\n }\n return this;\n }\n \n /**\n * Returns the z-Index of the resource layer.\n * \n * @return {number|undefined} z-Index.\n */\n getZIndex() {\n return this.zIndex;\n }\n \n /**\n * Sets the z-Index of the resource layer.\n * \n * @param {number|undefined} zIndex z-Index.\n * @return {module:meteoJS/synview/resource.Resource} This.\n */\n setZIndex(zIndex) {\n this.zIndex = zIndex;\n if (this.layer !== undefined)\n this.layer.setZIndex(zIndex);\n return this;\n }\n \n /**\n * Returns opacity of the resource layer.\n * \n * @return {number} Opacity.\n */\n getOpacity() {\n return this.opacity;\n }\n \n /**\n * Sets opacity of the resource layer.\n * \n * @param {number} opacity Opacity.\n * @return {module:meteoJS/synview/resource.Resource} This.\n */\n setOpacity(opacity) {\n this.opacity = opacity;\n if (this.layer !== undefined)\n this.layer.setOpacity(opacity);\n return this;\n }\n \n /**\n * Classname.\n * \n * @type undefined|String\n */\n get className() {\n return this.options.className;\n }\n set className(className) {\n this.options.className = className;\n }\n \n /**\n * imageSmoothingEnabled.\n * \n * @type undefined|boolean\n */\n get imageSmoothingEnabled() {\n return this._imageSmoothing;\n }\n set imageSmoothingEnabled(imageSmoothing) {\n this._imageSmoothing = imageSmoothing;\n }\n \n /**\n * Returns the layer group of the resource layer.\n * \n * @return {external:ol.layer.group|external:L.layerGroup|undefined} Layer group.\n */\n getLayerGroup() {\n return this.layerGroup;\n }\n \n /**\n * Sets the layer group and adds the resource layer to this group.\n * If undefined is passed, the resource layer will be deleted and removed for\n * any layer group.\n * \n * @param {external:ol.layer.group|external:L.layerGroup|undefined} layerGroup Layer group.\n * @return {module:meteoJS/synview/resource.Resource} This.\n */\n setLayerGroup(layerGroup) {\n if (this.layerGroup !== undefined &&\n this.layer !== undefined) {\n // OpenLayers\n if ('remove' in this.layerGroup.getLayers())\n this.layerGroup.getLayers().remove(this.layer);\n // Leaflet\n else\n this.layerGroup.removeLayer(this.layer);\n }\n if (layerGroup === undefined)\n this.layer = undefined;\n this.layerGroup = layerGroup;\n if (this.layerGroup !== undefined) {\n // Leaflet\n if ('addLayer' in this.layerGroup) {\n var layer = this.getLLLayer();\n if (this.getVisible())\n this.layerGroup.addLayer(layer);\n }\n // OpenLayers\n else\n this.layerGroup.getLayers().push(this.getOLLayer());\n }\n this.setReloadTime(this.getReloadTime()); // Trigger reload interval\n return this;\n }\n \n /**\n * Returns layer for openlayers of this resource.\n * \n * @return {external:ol.layer.Layer} openlayers layer.\n */\n getOLLayer() {\n if (this.layer !== undefined)\n return this.layer;\n this.layer = this._makeOLLayer();\n return this.layer;\n }\n \n /**\n * Returns openlayers layer of this resource. Must be overwritten by child\n * classes.\n * \n * @protected\n * @return {external:ol.layer.Layer} openlayers layer.\n */\n makeOLLayer() {\n // Dies on instantiation of ol.layer.Layer, so use ol.layer.Vector\n return new VectorLayer({\n className: this.className\n });\n }\n \n /**\n * Returns a ready to use OpenLayers layer.\n * \n * @private\n * @return {external:ol.layer.Layer} openlayers layer.\n */\n _makeOLLayer() {\n let layer = this.makeOLLayer();\n layer.setVisible(this.visible);\n layer.setZIndex(this.zIndex);\n layer.setOpacity(this.opacity);\n if ('events' in this.options.ol &&\n this.options.ol.events !== undefined)\n ['prerender', 'postrender'].forEach(eventName => {\n if (eventName in this.options.ol.events &&\n this.options.ol.events[eventName] !== undefined)\n layer.on(eventName, event => {\n this.options.ol.events[eventName].call(this, event, layer);\n });\n });\n \n if (!this._imageSmoothing) {\n const source = layer.getSource();\n if (source !== null &&\n 'contextOptions_' in source)\n source.contextOptions_ = {\n imageSmoothingEnabled: false,\n msImageSmoothingEnabled: false\n };\n }\n \n return layer;\n }\n \n /**\n * Returns layer for Leaflet of this resource.\n * \n * @return {external:L.layer} Leaflet layer.\n */\n getLLLayer() {\n if (this.layer !== undefined)\n return this.layer;\n this.layer = this._makeLLLayer();\n return this.layer;\n }\n \n /**\n * Returns Leaflet layer of this resource. Must be overwritten by child\n * classes.\n * \n * @protected\n * @return {external:L.Layer} Leaflet layer.\n */\n makeLLLayer() {\n // Dies on instantiation of ol.layer.Layer, so use ol.layer.Vector\n return L.Layer();\n }\n \n /**\n * Preload resource. By default, openlayers loads the resource as soon as\n * the resource gets visible.\n */\n preload() {}\n \n /**\n * Returns a ready to use Leaflet layer.\n * \n * @private\n * @return {external:L.Layer} Leaflet layer.\n */\n _makeLLLayer() {\n return this.makeLLLayer();\n }\n \n /**\n * Reload source.\n * \n * @private\n * @return {module:meteoJS/synview/resource.Resource} This.\n */\n _reload() {\n // Stop possible earlier reload\n if (this.reloadTimerId !== undefined) {\n clearTimeout(this.reloadTimerId);\n this.reloadTimerId = undefined;\n }\n // No frequent reload\n if (this.options.reloadTime === undefined)\n return;\n // Reload could only be handled, if layerGroup is defined\n if (this.layerGroup === undefined)\n return;\n var reloadFunction = (function () {\n this.reloadTimerId = undefined;\n if (this.layerGroup === undefined)\n return;\n var layer = this._makeOLLayer();\n // Hackish reload of sources, it is not handled properly by OpenLayers.\n // 1. Non-tile sources, they have a 'getUrl' method.\n if ('getUrl' in layer.getSource()) {\n var layerGroup = this.layerGroup;\n // event triggered, even if source is cached.\n var key = layer.getSource().on('change', (function () {\n if (layer.getSource().getState() == 'ready' ||\n layer.getSource().getState() == 'error') {\n // Execute code once, once the data is loaded.\n unByKey(key);\n if (layer.getSource().getState() == 'ready' &&\n this.layerGroup !== undefined) {\n layer.setVisible(this.layer.getVisible());\n layer.setOpacity(this.layer.getOpacity());\n layer.setZIndex(this.layer.getZIndex());\n this.layerGroup.getLayers().remove(this.layer);\n this.layer = layer;\n }\n else if (this.layerGroup !== undefined)\n this.layerGroup.getLayers().remove(layer);\n else\n layerGroup.getLayers().remove(layer);\n if (this.reloadTimerId === undefined &&\n this.options.reloadTime !== undefined &&\n this.layerGroup !== undefined)\n this.reloadTimerId =\n setTimeout(reloadFunction, this.options.reloadTime * 1000);\n }\n }).bind(this));\n this.layerGroup.getLayers().push(layer);\n layer.setVisible(true); // Force load of data by make the layer visible.\n }\n else {\n /* Tile sources in OpenLayers doesn't support a request to check, if all\n * tiles are loaded, because cached tiles doesn't generate any event.\n * Uncached tiles fire tileloadstart/end/error events.\n * So we wait a second and exchange then the old with the new layer. If\n * the reload of the data is smaller of one second, this suppresses that\n * neither the old layer nor the new data is visible. */\n this.layerGroup.getLayers().push(layer);\n layer.setVisible(true);\n setTimeout((function () {\n this.layer = layer;\n if (this.reloadTimerId === undefined &&\n this.options.reloadTime !== undefined)\n this.reloadTimerId =\n setTimeout(reloadFunction, this.options.reloadTime * 1000);\n }).bind(this), 1000);\n }\n }).bind(this);\n this.reloadTimerId =\n setTimeout(reloadFunction, this.options.reloadTime * 1000);\n return this;\n }\n \n /**\n * Normalizes this.options.ol.\n * \n * @private\n * @param {Object|external:ol/source/Source~Source|undefined} source\n * @param {Object.<string,Function>|undefined} events\n * @param {external:ol/style/Style~Style|external:ol/style/Style~StyleLike|external:ol/style/Style~StyleFunction|undefined} [style]\n */\n _normalizeOLOptions({\n source = {},\n events = undefined,\n style = undefined\n }) {\n this.options.ol = {\n source,\n events,\n style\n };\n }\n \n}\naddEventFunctions(Resource.prototype);\nexport default Resource;","/**\n * @module meteoJS/synview/resourceCollection\n */\nimport Collection from './Collection.js';\nimport Resource from './Resource.js';\n\n/**\n * Collection of resource objects.\n * Extends meteoJS.synview.collection with storage of time objects.\n * This collection contains either a list of resources assigned with time or\n * one resource with no time (or both). With the methods from\n * meteoJS.synview.collection all resources (with or without time) will be\n * retrieved. Id of the resource without time is '' (empty string).\n * \n * @extends module:meteoJS/synview/collection.Collection\n */\nexport class ResourceCollection extends Collection {\n \n constructor() {\n super();\n \n /**\n * List of the datetime objects of the resources (sorted upwardly).\n * @member {Date[]}\n * @private\n */\n this.times = [];\n }\n \n /**\n * Returns all resources assigned with time (ordered temporal upwardly).\n * \n * @return {module:meteoJS/synview/resource.Resource[]} Resources.\n */\n getResources() {\n return this.times.map(function (time) {\n return this.items[time.valueOf()];\n }, this);\n }\n \n /**\n * Returns times (ordered temporal upwardly).\n * \n * @return {Date[]} Times (no invalid times).\n */\n getTimes() {\n return this.times;\n }\n \n /**\n * @override\n * @param {mixed} id ID.\n * @return {module:meteoJS/synview/resource.Resource} Resource.\n */\n getItemById(id) {\n var res = super.getItemById(id);\n return (res === undefined) ? new Resource() : res;\n }\n \n /**\n * Returns resource valid at passed datetime (could be an invalid datetime).\n * If resource doesn't exist, an empty object is returned.\n * \n * @param {Date} time Datetime.\n * @return {module:meteoJS/synview/resource.Resource} Resource.\n */\n getResourceByTime(time) {\n return this.getItemById(isNaN(time) ? '' : time.valueOf());\n }\n \n /**\n * Returns if a resource with passed time exists. Time could be invalid.\n * \n * @param {Date} Time.\n * @return {boolean} If exists.\n */\n containsTime(time) {\n return this.getIndexById(isNaN(time) ? '' : time.valueOf()) > -1;\n }\n \n /**\n * Returns index of the time inside the times array. Time could be invalid.\n * -1 if not existant.\n * \n * @param {Date} time Time.\n * @return {integer} Index.\n */\n getIndexByTime(time) {\n var result = -1;\n if (!isNaN(time))\n this.times.forEach(function (t, i) {\n if (t.valueOf() == time.valueOf())\n result = i;\n });\n return result;\n }\n \n /**\n * Returns if a resource with ID exists in this collection.\n * \n * @return {module:meteoJS/synview/resource.Resource}\n */\n getNewestResource() {\n if (this.times.length < 1)\n return new Resource();\n return this.getResourceByTime(this.times[this.times.length-1]);\n }\n \n /**\n * Append a resource to the collection.\n * \n * @override\n * @param {module:meteoJS/synview/resource.Resource} resource Resource.\n * @return {module:meteoJS/synview/resourceCollection.ResourceCollection} This.\n */\n append(resource) {\n this._append(resource);\n this._sortTimes();\n return this;\n }\n \n /**\n * Removes a resource from the collection.\n * \n * @override\n * @param {Date} time Resource's time.\n * @return {module:meteoJS/synview/resourceCollection.ResourceCollection} This.\n */\n remove(time) {\n this._remove(isNaN(time) ? '' : time.valueOf());\n this._sortTimes();\n return this;\n }\n \n /**\n * Exchanges the collection content with a list of resource.\n * \n * @param {module:meteoJS/synview/resource.Resource[]} resources Resources.\n * @fires module:meteoJS/synview/collection#add:item\n * @fires module:meteoJS/synview/collection#replace:item\n * @fires module:meteoJS/synview/collection#remove:item\n * @return {module:meteoJS/synview/resourceCollection.ResourceCollection} This.\n */\n setResources(resources) {\n resources.forEach(function (resource) {\n this._append(resource);\n }, this);\n this._filterTimesByResources(resources);\n this._sortTimes();\n return this;\n }\n \n /**\n * Append a resource to the collection without reordering times-array.\n * \n * @private\n * @param {module:meteoJS/synview/resource.Resource} resource Resource.\n */\n _append(resource) {\n var time = resource.getDatetime();\n var id = (time === undefined) ? '' : time.valueOf();\n if (this.containsId(id)) {\n this.trigger('replace:item', resource, this.getItemById(id));\n this.items[id] = resource;\n }\n else {\n this.itemIds.push(id);\n this.items[id] = resource;\n if (time !== undefined && !isNaN(time))\n this.times.push(time);\n this.trigger('add:item', resource);\n }\n }\n \n /**\n * Removes a resource fromt the collection without reordering times-array.\n * \n * @private\n * @param {mixed} id Resource ID.\n */\n _remove(id) {\n var index = this.getIndexById(id);\n if (index > -1) {\n var resource = this.items[id];\n delete this.items[id];\n this.itemIds.splice(index, 1);\n if (id !== undefined && id !== '' && !isNaN(id)) {\n var tIndex = this.times.findIndex(function (t) {\n return t.valueOf() == id;\n });\n if (tIndex > -1)\n this.times.splice(tIndex, 1);\n }\n this.trigger('remove:item', resource);\n }\n }\n \n /**\n * Removes all resources whose times doesn't exist in the collection.\n * \n * @private\n * @param {module:meteoJS/synview/resource.Resource[]}\n */\n _filterTimesByResources(resources) {\n var containsStaticResource = false;\n this.times = this.times.filter(function (t) {\n var filter = false;\n var i = resources.findIndex(function (resource) {\n var match = false;\n var time = resource.getDatetime();\n if (time !== undefined &&\n t.valueOf() == time.valueOf()) {\n match = true;\n }\n else if (time === undefined)\n containsStaticResource = true;\n return match;\n }, this);\n if (i < 0) {\n this.remove(t.valueOf());\n filter = true;\n }\n return !filter;\n }, this);\n if (containsStaticResource)\n this.remove('');\n }\n \n /**\n * Sortiert den Zeit-Array this.times der Reihe nach.\n * @private\n */\n _sortTimes() {\n this.times.sort(function (a, b) {\n return a.valueOf()-b.valueOf();\n });\n }\n \n}\nexport default ResourceCollection;","/**\n * @module meteoJS/synview/type\n */\nimport LayerGroup from 'ol/layer/Group';\nimport addEventFunctions from '../Events.js';\nimport ResourceCollection from './ResourceCollection.js';\nimport Resource from './Resource.js';\n\n/**\n * Preload options.\n * \n * @typedef {Object} module:meteoJS/synview/type~preloadOptions\n * @property {boolean} [enabled=false] - Enable preload of the resources.\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {Object} module:meteoJS/synview/type~options\n * @param {string|undefined} id ID.\n * @param {boolean} [visible] Visibility.\n * @param {undefined|number} [zIndex] zIndex on map.\n * @param {'nearest'|'floor'} [displayMethod]\n * Method to determine the displayed resource.\n * @param {number} [displayMaxResourceAge]\n * Maximum time space between display and resource time (in seconds).\n * @param {number} [displayFadeStart]\n * Fade resource from this age to the display time (in seconds).\n * @param {number} [displayFadeStartOpacity]\n * Opacity (between 0 and 1) at displayFadingTime.\n * @param {undefined|String} className - Classname.\n * @param {undefined|boolean} [imageSmoothingEnabled=undefined]\n * Value of\n * {@link https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/imageSmoothingEnabled|imageSmoothingEnabled}\n * when drawing the layers of this type to canvas.\n * Undefined uses the default (true). When a\n * {@link module:meteoJS/synview/resource.Resource}\n * has explicitly set an own value \n * ({@link module:meteoJS/synview/resource.Resource#imageSmoothingEnabled}),\n * this will be ignored.\n * @param {module:meteoJS/synview/tooltip~contentFunction|undefined} [tooltip]\n * Tooltip function. If color detection will be used with this type, you must\n * set an unique className.\n * @param {module:meteoJS/synview/type~preloadOptions} [preload]\n * Preload options.\n */\n\n/**\n * Triggered on change of visibilty.\n * \n * @event module:meteoJS/synview/type#change:visible\n */\n\n/**\n * Triggered, if the set of timestamps changes (due to resource changes).\n * \n * @event module:meteoJS/synview/type#change:resources\n */\n\n/**\n * @classdesc Type to display by synview, like a serie of radar images.\n * \n * @fires module:meteoJS/synview/type#change:visible\n */\nexport class Type {\n \n /**\n * @param {module:meteoJS/synview/type~options} options Options.\n */\n constructor({\n id = undefined,\n visible = true,\n zIndex = undefined,\n displayMethod = 'floor',\n displayMaxResourceAge = 3*3600,\n displayFadeStart = 15*60,\n displayFadeStartOpacity = 0.95,\n resources = undefined,\n className = undefined,\n imageSmoothingEnabled = undefined,\n tooltip = undefined,\n preload = {}\n } = {}) {\n /**\n * @type Object\n * @private\n */\n this.options = {\n id,\n visible,\n zIndex,\n displayMethod,\n displayMaxResourceAge,\n displayFadeStart,\n displayFadeStartOpacity,\n resources,\n className,\n imageSmoothingEnabled,\n tooltip\n };\n \n /**\n * The mapping group to display all the resources. (openlayers specific)\n * @member {undefined|external:ol/layer/Group~LayerGroup}\n * @default\n * @private\n */\n this.layerGroup = undefined;\n \n /**\n * Collection of resources.\n * @member {module:meteoJS/synview/resourceCollection.ResourceCollection}\n * @private\n */\n this.collection = new ResourceCollection();\n \n /**\n * Time of displayed resource.\n * @member {Date}\n * @private\n */\n this.displayedResourceTime = new Date('invalid');\n \n // Collection initialisieren\n this.collection.on('add:item', function (resource) {\n resource.className = this.className;\n this._addOLLayer(resource);\n if (this._preload.enabled)\n resource.preload();\n }, this);\n this.collection.on('remove:item', function (resource) {\n this._removeOLLayer(resource);\n }, this);\n this.collection.on('replace:item', function (newResource, oldResource) {\n if (newResource !== oldResource) {\n newResource.className = this.className;\n this._replaceOLLayer(newResource, oldResource);\n if (this._preload.enabled)\n newResource.preload();\n }\n }, this);\n \n /**\n * Preload options.\n * @type module:meteoJS/synview/type~preloadOptions\n * @private\n */\n this._preload = preload;\n \n if (this.options.resources !== undefined)\n this.collection.setResources(this.options.resources);\n delete this.options.resources;\n }\n \n /**\n * Returns ID of type.\n * \n * @return {string|undefined}\n */\n getId() {\n return this.options.id;\n }\n \n /**\n * Sets ID of type.\n * \n * @param {string|undefined} id ID.\n * @return {module:meteoJS/synview/type.Type} This.\n */\n setId(id) {\n this.options.id = id;\n return this;\n }\n \n /**\n * Returns visibility.\n * \n * @return {boolean} Visibility.\n */\n getVisible() {\n return this.options.visible;\n }\n \n /**\n * Sets visibility.\n * \n * @param {boolean} visible Visibility.\n * @return {module:meteoJS/synview/type.Type} This.\n * @fires module:meteoJS/synview/type#change:visible\n */\n setVisible(visible) {\n // Nur etwas unternehmen, falls Visible ändert\n if (this.options.visible ? !visible : visible) {\n this.options.visible = visible ? true : false;\n if (this.layerGroup !== undefined)\n this.layerGroup.setVisible(this.options.visible);\n this.getResourceCollection().getItems().forEach(function (resource) {\n if (isNaN(resource.getDatetime()))\n resource.setVisible(this.options.visible);\n resource.setLayerGroup(this.options.visible ? this.layerGroup : undefined);\n }, this);\n this.trigger('change:visible');\n }\n return this;\n }\n \n /**\n * Returns the z Index.\n * \n * @return {undefined|number}\n */\n getZIndex() {\n return this.options.zIndex;\n }\n \n /**\n * Sets the z Index.\n * \n * @param {undefined|number} zIndex z-Index.\n * @return {module:meteoJS/synview/type.Type} This.\n */\n setZIndex(zIndex) {\n this.options.zIndex = zIndex;\n if (this.layerGroup !== undefined)\n this.layerGroup.setZIndex(zIndex);\n this.getResourceCollection().getItems().forEach(function (resource) {\n resource.setZIndex(zIndex);\n });\n return this;\n }\n \n /**\n * Classname.\n * \n * @type undefined|String\n */\n get className() {\n return this.options.className;\n }\n set className(className) {\n this.options.className = className;\n }\n \n /**\n * Returns layer-group of this type on the map.\n * \n * return {external:ol/layer/Group~LayerGroup} Layer-group.\n */\n getLayerGroup() {\n return (this.layerGroup === undefined) ? new LayerGroup() : this.layerGroup;\n }\n \n /**\n * Sets map layer-group for this type.\n * \n * @param {external:ol/layer/Group~LayerGroup} group layer-group.\n * @return {module:meteoJS/synview/type.Type} This.\n */\n setLayerGroup(group) {\n this.layerGroup = group;\n if (this.layerGroup !== undefined) {\n if ('setVisible' in this.layerGroup) // Leaflet doesn't know visibility\n this.layerGroup.setVisible(this.options.visible);\n this.layerGroup.setZIndex(this.options.zIndex);\n }\n this.getResourceCollection().getItems().forEach(function (resource) {\n resource.setLayerGroup(this.options.visible ? group : undefined);\n }, this);\n return this;\n }\n \n /**\n * Returns collection of the resources.\n * Note: If you directly append resources to the collection, no\n * {@link module:meteoJS/synview/type#change:resources} event will be fired.\n * \n * @return {module:meteoJS/synview/resourceCollection.ResourceCollection} resourceCollection.\n */\n getResourceCollection() {\n return this.collection;\n }\n \n /**\n * Append a resource to the collection.\n * If type is visible, this might also change the resources on the map.\n * \n * @param {module:meteoJS/synview/resource.Resource} resource Resource object.\n * @return {module:meteoJS/synview/type.Type} This.\n * @fires module:meteoJS/synview/type#change:resources\n */\n appendResource(resource) {\n this.collection.append(resource);\n \n // show current layer again\n this.setDisplayTime(this.displayedResourceTime);\n \n /* Trigger event after setDisplayTime, therewith the synview object can\n * set the desired time in the timeline object. */\n this.trigger('change:resources');\n return this;\n }\n \n /**\n * Removes a resource from the collection.\n * If type is visible, this might also change the resources on the map.\n * \n * @param {module:meteoJS/synview/resource.Resource} resource Resource object.\n * @return {module:meteoJS/synview/type.Type} This.\n * @fires module:meteoJS/synview/type#change:resources\n */\n removeResource(resource) {\n // hide current layer\n this._hideVisibleResource();\n \n this.collection.remove(resource.getDatetime());\n \n // show current layer again\n this.setDisplayTime(this.displayedResourceTime);\n \n /* Trigger event after setDisplayTime, therewith the synview object can\n * set the desired time in the timeline object. */\n this.trigger('change:resources');\n return this;\n }\n \n /**\n * Sets resources in the collection (and replaces previous ones).\n * If type is visible, this might also change the resources on the map.\n * \n * @param {module:meteoJS/synview/resource.Resource[]} resources List of resource objects.\n * @return {module:meteoJS/synview/type.Type} This.\n * @fires module:meteoJS/synview/type#change:resources\n */\n setResources(resources) {\n // hide current layer\n this._hideVisibleResource();\n \n this.collection.setResources(resources);\n \n // show current layer again\n this.setDisplayTime(this.displayedResourceTime);\n \n /* Trigger event after setDisplayTime, therewith the synview object can\n * set the desired time in the timeline object. */\n this.trigger('change:resources');\n return this;\n }\n \n /**\n * Returns resource of the displayed resource. If type contains resources\n * with timestamps as well as a static resource, only a resource with timestamp\n * will be returned. If type is invisible or no layer group is set, no resource\n * is display, therefore an empty resource will be returned.\n * \n * @return {module:meteoJS/synview/resource.Resource} Resource.\n */\n getDisplayedResource() {\n if (this.getVisible() &&\n this.layerGroup !== undefined) {\n if (isNaN(this.displayedResourceTime))\n return (this.collection.getTimes().length > 0) ?\n new Resource() :\n this.collection.getResourceByTime(this.displayedResourceTime);\n else\n return this.collection.getResourceByTime(this.displayedResourceTime);\n }\n else\n return new Resource();\n }\n \n /**\n * Sets time to display. Corresponding to the options an adequate resource will\n * be searched and displayed. (accessible via getDisplayedResource())\n * \n * @param {Date} time Display time.\n * @return {module:meteoJS/synview/type.Type} This.\n */\n setDisplayTime(time) {\n if (!this.getVisible())\n return this;\n var time_to_show = this._getResourceTimeByDisplayTime(time);\n if (time_to_show === undefined ||\n time_to_show !== undefined &&\n !isNaN(this.displayedResourceTime) &&\n this.displayedResourceTime.valueOf() != time_to_show.valueOf())\n this._hideVisibleResource();\n if (time_to_show !== undefined) {\n this.displayedResourceTime = time_to_show;\n var resource = this.getResourceCollection().getItemById(time_to_show.valueOf());\n if (resource.getId()) {\n resource.setVisible(true);\n var opacity = 1.0;\n if (Math.abs(time.valueOf() - time_to_show.valueOf()) > this.options.displayMaxResourceAge*1000) // 3h\n opacity = 0.0;\n else if (Math.abs(time.valueOf() - time_to_show.valueOf()) > this.options.displayFadeStart*1000) // 15min\n opacity = this.options.displayFadeStartOpacity *\n (Math.abs(time.valueOf() - time_to_show.valueOf()) -\n this.options.displayMaxResourceAge * 1000) /\n (1000 *\n (this.options.displayFadeStart - this.options.displayMaxResourceAge));\n resource.setOpacity(opacity);\n }\n }\n else\n this.displayedResourceTime = new Date('invalid');\n return this;\n }\n \n /**\n * Returns the current tooltip function, undefined for no tooltip.\n * \n * @return {module:meteoJS/synview/tooltip~contentFunction|undefined} Tooltip function.\n */\n getTooltip() {\n return this.options.tooltip;\n }\n \n /**\n * Sets the tooltip function. Undefined for no tooltip.\n * \n * @param {module:meteoJS/synview/tooltip~contentFunction|undefined} tooltip Tooltip function.\n * @return {module:meteoJS/synview/type.Type} This.\n */\n setTooltip(tooltip) {\n this.options.tooltip = tooltip;\n return this;\n }\n \n /**\n * Sets style of all resources (if resource has 'setOLStyle' method).\n * If argument 'style' isn't declared, the style will be updated.\n * Convenience method, you could also loop over all resources.\n * \n * @param {externalol/style/Style~Style} [style] OpenLayers style.\n * @returns {module:meteoJS/synview/type.Type} This.\n */\n setResourcesOLStyle() {\n var styleArguments = arguments;\n this.getResourceCollection().getItems().forEach(function (resource) {\n if ('setOLStyle' in resource)\n resource.setOLStyle.apply(resource, styleArguments);\n });\n return this;\n }\n \n /**\n * Blendet aktuell dargestellten OL-Layer aus.\n * @private\n */\n _hideVisibleResource() {\n if (!isNaN(this.displayedResourceTime))\n this.getResourceCollection()\n .getItemById(this.displayedResourceTime.valueOf())\n .setVisible(false);\n }\n \n /**\n * Füge dem layers-Objekt einen neuen OL-Layer hinzu\n * @private\n * @param {module:meteoJS/synview/resource.Resource} resource Entsprechende Resource zum Hinzufügen\n */\n _addOLLayer(resource) {\n // Show static resources if visible\n if (isNaN(resource.getDatetime()))\n resource.setVisible(this.getVisible());\n if (this.options.imageSmoothingEnabled !== undefined &&\n resource.imageSmoothingEnabled === undefined)\n resource.imageSmoothingEnabled = this.options.imageSmoothingEnabled;\n resource.setLayerGroup(this.getLayerGroup());\n resource.setZIndex(this.options.zIndex);\n }\n \n /**\n * Löscht aus layers-Objekt einen OL-Layer\n * @private\n * @param {module:meteoJS/synview/resource.Resource} resource Entsprechende Resource zum Hinzufügen\n */\n _removeOLLayer(resource) {\n resource.setLayerGroup(undefined);\n }\n \n /**\n * Ersetzt im layers-Objekt einen OL-Layer\n * @private\n * @param {module:meteoJS/synview/resource.Resource} newResource Resource zum Hinzufügen\n * @param {module:meteoJS/synview/resource.Resource} oldResource Resource zum Ersetzen\n */\n _replaceOLLayer(newResource, oldResource) {\n this._removeOLLayer(oldResource);\n this._addOLLayer(newResource);\n }\n \n /**\n * Gibt eine Zeit mit vorhandener Resource zu einer darzustellenden Zeit zurück.\n * Es gibt dazu verschiedene Optionen (this.options.displayMethod):\n * 'nearest': Wähle die zeitlich nächstgelegene Resource aus\n * 'floor': Wähle die Resource direkt zum Zeitpunkt oder zeitlich direkt vor\n * dem Termin.\n * @private\n * @return {undefined|Date} Resource time or undefined if not existing.\n */\n _getResourceTimeByDisplayTime(time) {\n if (isNaN(time))\n return undefined;\n var resultTime = undefined;\n this.collection.getTimes().forEach(function (resourceTime) {\n /*if (resultTime === undefined)\n resultTime = resourceTime;\n else {*/\n switch (this.options.displayMethod) {\n case 'exact':\n if (time.valueOf() == resourceTime.valueOf())\n resultTime = resourceTime;\n break;\n case 'nearest':\n if (resultTime === undefined ||\n Math.abs(time.valueOf() - resourceTime.valueOf()) <\n Math.abs(time.valueOf() - resultTime.valueOf()))\n resultTime = resourceTime;\n break;\n case 'floor':\n default:\n if (resultTime === undefined ||\n resourceTime.valueOf() <= time.valueOf() &&\n (time.valueOf() - resourceTime.valueOf() <\n time.valueOf() - resultTime.valueOf()))\n resultTime = resourceTime;\n }\n //}\n }, this);\n return resultTime;\n }\n \n}\naddEventFunctions(Type.prototype);\nexport default Type;","/**\n * @module meteoJS/synview/typeCollection\n */\nimport $ from 'jquery';\nimport Collection from './Collection.js';\nimport Type from './Type.js';\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/synview/typeCollection~options\n * @param {boolean} [exclusiveVisibility]\n * At the same time, only one single type is visible.\n * @param {boolean} [syncVisibility]\n * If the visibility of a type changes, all other types are also adjusted.\n * If exclusiveVisibility is set to true, this will be ignored.\n */\n\n/**\n * Collection of type-objects.\n * Could ensure, that only a single type of this collection is visible.\n * \n * @extends module:meteoJS/synview/collection.Collection\n * @fires module:meteoJS/synview/typeCollection#change:typeVisible\n */\nexport class TypeCollection extends Collection {\n \n /**\n * @param {module:meteoJS/synview/typeCollection~options} options - Options.\n */\n constructor(options) {\n super();\n \n /**\n * Options.\n * @member {module:meteoJS/synview/typeCollection~options}\n * @private\n */\n this.options = $.extend(true, {\n exclusiveVisibility: false,\n syncVisibility: false\n }, options);\n }\n \n /**\n * Returns type with the passed ID or empty type if not existant.\n * \n * @override\n * @param {mixed} id ID.\n * @return {module:meteoJS/synview/type.Type} Type.\n */\n getItemById(id) {\n var item = super.getItemById(id);\n return (item === undefined) ? new Type() : this.items[id];\n }\n \n /**\n * Append type to this collection. If type with same ID is present, the type\n * will be exchanged.\n * \n * @override\n * @param {module:meteoJS/synview/type.Type} type Type.\n * @return {module:meteoJS/synview/typeCollection.TypeCollection} This.\n */\n append(type) {\n var that = this;\n if (this.options.exclusiveVisibility &&\n type.getVisible() &&\n this.isVisible()) {\n type.setVisible(false);\n }\n else if (that.options.syncVisibility) {\n if (type.getVisible()) {\n if (!this.isVisible())\n this.getItems().forEach(function (t) {\n t.setVisible(true);\n }, this);\n }\n else {\n if (this.isVisible())\n type.setVisible(true);\n }\n }\n type.on('change:visible', function () {\n if (that.options.exclusiveVisibility) {\n if (this.getVisible())\n that.getItems().forEach(function (t) {\n if (t.getId() != this.getId())\n t.setVisible(false);\n }, this);\n }\n else if (that.options.syncVisibility) {\n that.getItems().forEach(function (t) {\n if (t.getId() != this.getId())\n t.setVisible(this.getVisible());\n }, this);\n }\n });\n return super.append(type);\n }\n \n /**\n * Returns the types of this collection with getVisible() == true.\n * \n * @return {module:meteoJS/synview/type.Type[]} Types.\n */\n getVisibleTypes() {\n return this.getItems().filter(function (type) { return type.getVisible(); });\n }\n \n /**\n * Returns, if at least one type is visible.\n * \n * @return {boolean}\n */\n isVisible() {\n return this.getVisibleTypes().length > 0;\n }\n \n /**\n * Sets the option exclusiveVisibility.\n * If several types are visible and this will be set to true, then the first\n * type in the getItems() iterator will stay visible.\n * \n * @return {module:meteoJS/synview/typeCollection.TypeCollection} This.\n */\n setExclusiveVisibility(exclusiveVisibility) {\n if (this.options.exclusiveVisibility != exclusiveVisibility &&\n exclusiveVisibility) {\n var isVisibleType = false;\n this.getItems().forEach(function (t) {\n if (!isVisibleType)\n isVisibleType = t.getVisible();\n else\n t.setVisible(false);\n }, this);\n }\n this.options.exclusiveVisibility = exclusiveVisibility;\n return this;\n }\n \n /**\n * Sets the option syncVisibility.\n * If any type is visible and this will be set to true, then every type will\n * be set visible.\n * \n * @return {module:meteoJS/synview/typeCollection.TypeCollection} This.\n */\n setSyncVisibility(syncVisibility) {\n if (this.options.syncVisibility != syncVisibility &&\n syncVisibility &&\n this.isVisible()) {\n this.getItems().forEach(function (t) {\n t.setVisible(true);\n }, this);\n }\n this.options.syncVisibility = syncVisibility;\n return this;\n }\n \n}\nexport default TypeCollection;","/**\n * @module meteoJS/synview/tooltip\n */\nimport $ from 'jquery';\n\n/**\n * Function called that should return content for the tooltip. Undefined for\n * no tooltip.\n * \n * @typedef {Object} module:meteoJS/synview/tooltip~contentFunction\n * @param\n * @return {string|external:jQuery|undefined} Tooltip content.\n\n sollte auch irgendwie die Resource-Objekt übernehmen...\n */\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/synview/tooltip~options\n * @param {module:meteoJS/synview/map.SynviewMap} map - Map object.\n * @param {module:meteoJS/synview/typeCollection.TypeCollection} typeCollection\n * Collection with all types.\n * @param {module:meteoJS/tooltip.Tooltip} tooltip - Tooltip object.\n */\n\n/**\n * Object to show a tooltip. Is instantiated by the main synview\n * object.\n */\nexport class Tooltip {\n \n /**\n * @param {module:meteoJS/synview/tooltip~options} [options] - Options.\n */\n constructor({\n map,\n typeCollection,\n tooltip\n }) {\n \n /**\n * @type Object|undefined\n * @private\n */\n this.tooltipFeature = undefined;\n \n /**\n * @type mixed[]|undefined\n * @private\n */\n this.tooltipPixelColor = undefined;\n \n /**\n * @type module:meteoJS/synview/map.SynviewMap\n * @private\n */\n this.map = map;\n \n /**\n * @type module:meteoJS/synview/typeCollection.TypeCollection\n * @private\n */\n this.typeCollection = typeCollection;\n \n /**\n * @type module:meteoJS/tooltip.Tooltip\n * @private\n */\n this.tooltip = tooltip;\n \n // Initialize tooltipNode\n if (Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(this.tooltip),\n 'tooltipNode'\n ) &&\n this.tooltip.tooltipNode === undefined)\n this.tooltip.tooltipNode =\n $('<div>')\n .css('position', 'absolute')\n .prependTo(this.map.getMap().getTargetElement());\n \n // On hide tooltip\n this.tooltip.on('hide:tooltip', () => {\n this.tooltipFeature = undefined;\n this.tooltipPixelColor = undefined;\n });\n \n // Mouse moves on map\n this.map.on('move:pointer', e => {\n if (e.dragging)\n return;\n e = this.map.getExtendedEventByTypeCollection(e, this.typeCollection);\n if (e.feature ||\n e.color) {\n if (e.feature === this.tooltipFeature &&\n (e.color === undefined &&\n this.tooltipPixelColor === undefined ||\n e.color !== undefined &&\n this.tooltipPixelColor !== undefined &&\n e.color.join(',') === this.tooltipPixelColor.join(','))) {\n this.tooltip.show({\n posX: e.pixel[0],\n posY: e.pixel[1]\n });\n return;\n }\n \n this.tooltipFeature = undefined;\n this.tooltipPixelColor = undefined;\n let tooltipContent = e.synviewType.getTooltip().call(undefined, e);\n // Show tooltip only if there is content\n if (tooltipContent !== undefined) {\n this.tooltipFeature = e.feature;\n this.tooltipPixelColor = e.color;\n this.tooltip.content = tooltipContent;\n this.tooltip\n .hide()\n .show({\n posX: e.pixel[0],\n posY: e.pixel[1]\n });\n }\n else\n this.tooltip.hide();\n }\n else\n this.tooltip.hide();\n });\n }\n \n}\nexport default Tooltip;","/**\n * @module meteoJS/synview\n */\n\nimport $ from 'jquery';\nimport SynviewMap from './synview/SynviewMap.js';\nimport Timeline from './Timeline.js';\nimport TypeCollection from './synview/TypeCollection.js';\nimport Tooltip from './synview/Tooltip.js';\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/synview~options\n * @param {module:meteoJS/synview/map.SynviewMap|undefined} [map]\n * Synview map object.\n * @param {module:meteoJS/timeline.Timeline|undefined} [timeline]\n * Timeline object.\n * @param {module:meteoJS/tooltip.Tooltip} [tooltip] - Tooltip object.\n */\n\n/**\n * Mapping object to show map data for different timestamps. Create one object\n * per map.\n */\nexport default class Synview {\n \n /**\n * @param {module:meteoJS/synview~options} options - Options.\n */\n constructor(options) {\n /**\n * @type {module:meteoJS/synview~options}\n * @private\n */\n this.options = $.extend(true, {\n map: undefined,\n timeline: undefined,\n tooltip: undefined\n }, options);\n // Normalize options\n if (this.options.map === undefined)\n this.options.map = new SynviewMap();\n if (this.options.timeline === undefined)\n this.options.timeline = new Timeline();\n \n /**\n * Collection of synview types.\n * @member {module:meteoJS/synview/typecollection.TypeCollection}\n */\n this.typeCollection = new TypeCollection();\n /** @type meteoJS/synview/tooltip~Tooltip|undefined */\n this.tooltip = undefined;\n \n // Timeline initialisieren\n this.options.timeline.on('change:time', function () {\n this.getTypeCollection().getItems().map(function (type) {\n type.setDisplayTime(this.options.timeline.getSelectedTime());\n }, this);\n }, this);\n \n // typeCollection initialisieren\n var timeline = this.options.timeline;\n var updateTimes = function () {\n var isLastTime = timeline.isLastEnabledTime();\n // Zeitpunkte einlesen\n if (this.getVisible())\n timeline.setTimesBySetID(this.getId(), this.getResourceCollection().getTimes());\n else\n timeline.setTimesBySetID(this.getId(), []);\n // Switch to last timestamp, if it was the last one already before.\n if (isLastTime)\n timeline.last();\n else if (isNaN(timeline.getSelectedTime()))\n timeline.first();\n };\n var appendType = function (type) {\n type.setLayerGroup(this.options.map.makeLayerGroup());\n updateTimes.call(type);\n type.setDisplayTime(this.getTimeline().getSelectedTime());\n type.on('change:resources', updateTimes);\n // Zeitpunkte bei visible-Änderungen löschen oder hinzufügen\n type.on('change:visible', updateTimes);\n if (type.getTooltip() !== undefined &&\n this.tooltip === undefined) {\n this.tooltip = new Tooltip({\n map: this.options.map,\n typeCollection: this.typeCollection,\n tooltip: this.options.tooltip\n });\n }\n };\n var removeType = function (type) {\n this.getTimeline().deleteSetID(type.getId());\n // Layer-Group löschen (bzw. aus OL entfernen)\n // Events aus dem Type löschen\n };\n this.typeCollection.on('add:item', appendType, this);\n this.typeCollection.on('remove:item', removeType, this);\n this.typeCollection.on('replace:item', function (type, removedType) {\n appendType.call(this, type);\n removeType.call(this, removedType);\n }, this);\n }\n \n /**\n * Returns timeline object.\n * \n * @return {meteoJS.timeline} Timeline.\n */\n getTimeline() {\n return this.options.timeline;\n }\n \n /**\n * Returns map object.\n * \n * @return {meteoJS.synview.map} Map object.\n */\n getMap() {\n return this.options.map;\n }\n \n /**\n * Returns collection object of appended types.\n * \n * @return {meteoJS.synview.typeCollection} Type collection.\n */\n getTypeCollection() {\n return this.typeCollection;\n }\n \n /**\n * Append a type to this synview. Wrapper for getTypeCollection().append(type),\n * but ensures, that the new type has an id different than undefined.\n * \n * @param {meteoJS.synview.type} type Type to append.\n * @return {meteoJS.synview} This.\n */\n appendType(type) {\n if (type.getId() === undefined) {\n var prefixId = 'synview-type-';\n var i = 0;\n var newId;\n do {\n newId = prefixId + (i++);\n } while (this.getTypeCollection().containsId(newId));\n type.setId(newId);\n }\n this.getTypeCollection().append(type);\n return this;\n }\n \n /**\n * Returns the tooltip object.\n * \n * @returns {module:meteoJS/tooltip~Tooltip} - Tooltip object.\n */\n getTooltip() {\n return this.options.tooltip;\n }\n \n}","const __WEBPACK_NAMESPACE_OBJECT__ = ol.proj;","/**\n * @module meteoJS/synview/map/ol\n */\nimport SynviewMap from '../SynviewMap.js';\nimport LayerGroup from 'ol/layer/Group';\nimport { transform, fromLonLat } from 'ol/proj';\n\n/**\n * Name of mercator projection in openlayers\n * \n * @constant {string}\n */\nexport const projmerc = 'EPSG:3857';\n\n/**\n * Name of wgs84 projection in openlayers (lat/lon in degrees)\n * \n * @constant {string}\n */\nexport const projwgs84 = 'EPSG:4326';\n\n/**\n * Object to \"communicate\" with openlayers.\n * \n * @extends module:meteoJS/synview/map.SynviewMap\n */\nexport class MapOL extends SynviewMap {\n \n constructor(options) {\n super(options);\n \n // Normalize options\n if (this.options.layerGroup === undefined) {\n this.options.layerGroup = new LayerGroup();\n this.options.map.addLayer(this.options.layerGroup);\n }\n \n // Listen to view changes.\n this.options.map.getView().on('change:center', (function () {\n this.trigger('change:view', this);\n }).bind(this));\n this.options.map.getView().on('change:resolution', (function () {\n this.trigger('change:view', this);\n }).bind(this));\n this.options.map.on('pointermove', (function (e) {\n this.trigger('move:pointer', e);\n }).bind(this));\n this.options.map.on('click', (function (e) {\n this.trigger('click:pointer', e);\n }).bind(this));\n this.options.map.on('singleclick', (function (e) {\n this.trigger('singleclick:pointer', e);\n }).bind(this));\n this.options.map.on('dblclick', (function (e) {\n this.trigger('dblclick:pointer', e);\n }).bind(this));\n this.options.map.on('pointerdrag', (function (e) {\n this.trigger('drag:pointer', e);\n }).bind(this));\n }\n \n /**\n * Helper function. Returns the view center in WGS84 coordinates, lat/lon.\n * \n * @return {number[]} Center.\n */\n getViewCenter() {\n return transform(\n this.options.map.getView().getCenter(),\n this.options.map.getView().getProjection(),\n projwgs84\n );\n }\n \n /**\n * Helper function. Sets the view center in WGS84 coordinates, lat/lon.\n * \n * @param {number[]} center Center.\n * @return {module:meteoJS/synview/map/ol~MapOL} This.\n */\n setViewCenter(center) {\n var valid = true;\n center = center.map(function (a) {\n if (isNaN(a)) {\n valid = false;\n return undefined;\n }\n else\n return a*1;\n });\n if (valid)\n this.options.map.getView().setCenter(fromLonLat(center));\n return this;\n }\n \n /**\n * Helper function. Returns the view zoom level.\n * \n * @return {number|undefined} Zoom level.\n */\n getViewZoom() {\n return this.options.map.getView().getZoom();\n }\n \n /**\n * Helper function. Sets the view zoom level.\n * \n * @param {number|undefined} zoom Zoom level.\n * @returns {module:meteoJS/synview/map/ol~MapOL} This.\n */\n setViewZoom(zoom) {\n if (!isNaN(zoom))\n this.options.map.getView().setZoom(zoom*1);\n return this;\n }\n \n /**\n * Returns a new layer group, already added to the map.\n * \n * @returns {external:ol/layer/Group~LayerGroup} New layer group.\n */\n makeLayerGroup() {\n var group = new LayerGroup();\n this.options.layerGroup.getLayers().push(group);\n return group;\n }\n \n /**\n * Returns an event object, that is extended by several keys.\n * Synview internal method.\n * \n * @param {external:ol/MapBrowserPointerEvent} event Map event object.\n * @param {module:meteoJS/synview/typeCollection.TypeCollection} collection Type collection.\n * @returns {module:meteoJS/synview/map~extendedEvent} Event object.\n */\n getExtendedEventByTypeCollection(event, collection) {\n event = super.getExtendedEventByTypeCollection(event, collection);\n let visibleTypes = new Map();\n collection.getVisibleTypes()\n .filter(type => { return type.getTooltip() !== undefined; })\n .map(type => visibleTypes.set(type, []));\n let visibleLayers = new Set();\n let visibleLayerClassnames = new Set();\n for (let type of visibleTypes.keys()) {\n type.getLayerGroup().getLayers().getArray()\n .filter(layer => layer.getVisible())\n .forEach(layer => {\n visibleTypes.get(type).push(layer);\n visibleLayers.add(layer);\n visibleLayerClassnames.add(layer.getClassName());\n });\n }\n \n this.options.map.forEachFeatureAtPixel(event.pixel, (feature, layer) => {\n for (let type of visibleTypes.keys()) {\n visibleTypes.get(type).forEach(l => {\n if (event.synviewType !== undefined)\n return;\n if (l === layer) {\n event.feature = feature;\n event.layer = layer;\n event.synviewType = type;\n }\n });\n if (event.synviewType !== undefined)\n break;\n }\n return event.synviewType !== undefined;\n }, {\n hitTolerance: 5,\n layerFilter: layer => visibleLayers.has(layer)\n });\n \n if (event.feature === undefined) {\n this.options.map.forEachLayerAtPixel(event.pixel, (layer, color) => {\n if (color == null || color.length < 1)\n return false;\n for (let type of visibleTypes.keys()) {\n visibleTypes.get(type).forEach(l => {\n if (event.synviewType !== undefined)\n return;\n if (l.getClassName() == layer.getClassName()) {\n event.color = color;\n event.layer = layer;\n event.synviewType = type;\n }\n });\n if (event.synviewType !== undefined)\n break;\n }\n return event.synviewType !== undefined;\n }, {\n hitTolerance: 5,\n layerFilter: layer => visibleLayerClassnames.has(layer.getClassName())\n });\n }\n return event;\n }\n \n /**\n * Returns index of the passed layer inside the layer group of the passed type.\n * Synview internal method.\n * \n * @param {external:ol/layer/Layer~Layer} layer Layer object.\n * @param {module:meteoJS/synview/type.Type} type Type.\n * @return {integer} Index.\n */\n findLayerInType(layer, type) {\n return type.getLayerGroup().getLayers().getArray().findIndex(function (l) {\n return l == layer;\n }) > -1;\n }\n \n}\nexport default MapOL;","/**\n * @module meteoJS/synview/map/ll\n */\nimport SynviewMap from '../SynviewMap.js';\n\n/**\n * Object to \"communicate\" with Leaflet.\n * \n * @extends module:meteoJS/synview/map.SynviewMap\n */\nexport class MapLL extends SynviewMap {\n \n constructor(options) {\n super (options);\n \n // Normalize options\n if (this.options.layerGroup === undefined)\n this.options.layerGroup = L.layerGroup().addTo(this.options.map);\n }\n \n /**\n * Returns a new layer group, already added to the map.\n * \n * @inheritdoc\n * @return {L.layerGroup} New layer group.\n */\n makeLayerGroup() {\n return L.layerGroup().addTo(this.options.layerGroup);\n }\n \n}\nexport default MapLL;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.format.GeoJSON;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source.Vector;","/**\n * @module meteoJS/synview/resource/Vector\n */\nimport VectorSource from 'ol/source/Vector';\nimport VectorLayer from 'ol/layer/Vector';\nimport Resource from '../Resource.js';\nimport { projwgs84 } from '../map/MapOL.js';\n\n/**\n * Object representing a Vector-resource.\n * \n * @extends module:meteoJS/synview/resource.Resource\n */\nexport class Vector extends Resource {\n \n /**\n * @inheritdoc\n */\n getId() {\n var d = this.getDatetime();\n return isNaN(d) ? '' : d.toISOString();\n }\n \n /**\n * Returns openlayers layer of this resource.\n * \n * @inheritdoc\n * @return {external:ol/layer/Vector~VectorLayer} Openlayers layer.\n */\n makeOLLayer() {\n let opt = {\n source: this.options.ol.source,\n events: this.options.ol.events,\n style: this.options.ol.style\n };\n this.options.ol;\n // source not an ol/source/Source~Source object (via duck typing)\n if (!('refresh' in opt.source)) {\n let sourceOptions = opt.source;\n if (this.options.url !== undefined &&\n 'format' in sourceOptions &&\n sourceOptions.format !== undefined)\n sourceOptions.url = this.options.url;\n if (!('projection' in sourceOptions) ||\n sourceOptions.projection === undefined)\n sourceOptions.projection = projwgs84;\n opt.source = new VectorSource(sourceOptions);\n }\n if (typeof opt.style === 'function')\n opt.style = opt.style.bind(this);\n if (this.className)\n opt.className = this.className;\n return new VectorLayer(opt);\n }\n \n /**\n * Sets style of the OpenLayers vector layer.\n * If argument 'style' is omitted, the style will be updated.\n * \n * @param {external:ol/style/Style~Style} [style] OpenLayers style.\n * @returns {module:meteoJS/synview/resource/Vector.Vector} This.\n */\n setOLStyle(style) {\n if (this.layer === undefined)\n this.getOLLayer();\n if (this.layer === undefined ||\n !('setStyle' in this.layer))\n return this;\n if (arguments.length == 0)\n this.layer.setStyle(this.layer.getStyle());\n else\n this.layer.setStyle(style);\n return this;\n }\n \n}\nexport default Vector;","/**\n * @module meteoJS/synview/resource/GeoJSON\n */\nimport GeoJSONFormat from 'ol/format/GeoJSON';\nimport Vector from './Vector.js';\n\n/**\n * Object representing a GeoJSON-resource.\n * \n * @extends module:meteoJS/synview/resource/Vector.Vector\n */\nexport class GeoJSON extends Vector {\n \n constructor(options) {\n super(options);\n \n this.options.ol.source.url = this.options.url;\n this.options.ol.source.format = new GeoJSONFormat();\n }\n \n}\nexport default GeoJSON;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source.VectorTile;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.layer.VectorTile;","/**\n * @module meteoJS/synview/resource/VectorTile\n */\nimport VectorTileSource from 'ol/source/VectorTile';\nimport VectorTileLayer from 'ol/layer/VectorTile';\nimport Vector from './Vector.js';\nimport { projwgs84 } from '../map/MapOL.js';\n\n/**\n * Object representing a VectorTile-resource.\n * \n * @extends module:meteoJS/synview/resource/Vector~Vector\n */\nexport class VectorTile extends Vector {\n \n /**\n * Returns openlayers layer of this resource.\n * \n * @inheritdoc\n * @return {external:ol/layer/VectorTile~VectorTileLayer} Openlayers layer.\n */\n makeOLLayer() {\n let opt = {\n source: this.options.ol.source,\n events: this.options.ol.events,\n style: this.options.ol.style\n };\n // source not an ol/source/Source~Source object (via duck typing)\n if (!('refresh' in opt.source)) {\n let sourceOptions = opt.source;\n if (!('tileUrlFunction' in sourceOptions) &&\n this.options.url !== undefined &&\n 'format' in sourceOptions &&\n sourceOptions.format !== undefined)\n sourceOptions.url = this.options.url;\n if (!('projection' in sourceOptions) ||\n sourceOptions.projection === undefined)\n sourceOptions.projection = projwgs84;\n opt.source = new VectorTileSource(sourceOptions);\n }\n if (typeof opt.style === 'function')\n opt.style = opt.style.bind(this);\n if (this.className)\n opt.className = this.className;\n return new VectorTileLayer(opt);\n }\n \n}\nexport default VectorTile;","/**\n * @module meteoJS/synview/resource/GeoJSONTile\n */\nimport GeoJSON from 'ol/format/GeoJSON';\nimport VectorTile from './VectorTile.js';\n\n/**\n * Object representing a GeoJSON-Tile-resource.\n * \n * @extends module:meteoJS/synview/resource/VectorTile.VectorTile\n */\nexport class GeoJSONTile extends VectorTile {\n \n constructor(options) {\n super(options);\n \n this.options.ol.source.format = new GeoJSON();\n }\n \n}\nexport default GeoJSONTile;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source.ImageStatic;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.layer.Image;","/**\n * @module meteoJS/synview/resource/Image\n */\nimport Static from 'ol/source/ImageStatic';\nimport ImageLayer from 'ol/layer/Image';\nimport { transformExtent } from 'ol/proj';\nimport Resource from '../Resource.js';\nimport { projmerc, projwgs84 } from '../map/MapOL.js';\n\n/**\n * Options for module:meteoJS/synview/resource/Image~Image.\n * \n * @typedef {module:meteoJS/synview/resource~options}\n * module:meteoJS/synview/resource/Image~options\n * @param {number[]} extent - Extent.\n */\n\n/**\n * Object representing an image.\n * \n * <pre><code>import Image from 'meteojs/synview/resource/Image';\nimport { Image } from 'meteojs/synview/resource/Image';\nimport { ImageStatic } from 'meteojs/synview/resource/Image';</code></pre>\n * \n * @extends module:meteoJS/synview/resource.Resource\n */\nexport class ImageStatic extends Resource {\n \n /**\n * @param {module:meteoJS/synview/resource/Image~options} options - Options.\n */\n constructor({\n url = undefined,\n datetime = undefined,\n mimetype = undefined,\n reloadTime = undefined,\n className = undefined,\n extent,\n ol = {}\n } = {}) {\n super({\n url,\n datetime,\n mimetype,\n reloadTime,\n className,\n ol\n });\n \n this.options.extent = extent;\n }\n \n /**\n * Returns openlayers layer of this resource.\n * \n * @inheritdoc\n * @return {external:ol/layer/Image~ImageLayer} Openlayers layer.\n */\n makeOLLayer() {\n let sourceOptions = this.options.ol.source;\n sourceOptions.url = this.options.url;\n sourceOptions.imageExtent =\n transformExtent(this.options.extent,\n projwgs84,\n projmerc);\n return new ImageLayer({\n source: new Static(sourceOptions),\n className: this.className\n });\n }\n \n /**\n * Returns Leaflet layer of this resource.\n * \n * @inheritdoc\n * @return {external:L.imageOverlay} Leaflet layer.\n */\n makeLLLayer() {\n return L.imageOverlay(this.options.url, [\n [this.options.extent[1], this.options.extent[0]],\n [this.options.extent[3], this.options.extent[2]]\n ]);\n }\n \n \n /**\n * @inheritdoc\n */\n preload() {\n this.getOLLayer().getSource().image_.load();\n }\n}\nexport { ImageStatic as Image };\nexport default ImageStatic;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.source.OSM;","const __WEBPACK_NAMESPACE_OBJECT__ = ol.layer.Tile;","/**\n * @module meteoJS/synview/resource/OSM\n */\nimport OSMSource from 'ol/source/OSM';\nimport TileLayer from 'ol/layer/Tile';\nimport Resource from '../Resource.js';\n\n/**\n * Object representing a OSM-resource.\n * \n * @extends module:meteoJS/synview/resource.Resource\n */\nexport class OSM extends Resource {\n \n /**\n * Returns openlayers layer of this resource.\n * \n * @inheritdoc\n * @return {external:ol/layer/Tile~TileLayer} Openlayers layer.\n */\n makeOLLayer() {\n let sourceOptions = this.options.ol.source;\n sourceOptions.url = this.options.url;\n return new TileLayer({\n source: new OSMSource(sourceOptions)\n });\n }\n \n}\nexport default OSM;","/**\n * @module meteoJS/tooltip\n */\nimport addEventFunctions from './Events.js';\n\n/**\n * Triggered, when tooltip starts to be shown.\n * \n * @event module:meteoJS/tooltip#show:tooltip\n */\n\n/**\n * Triggered, when tooltip starts to be hidden.\n * \n * @event module:meteoJS/tooltip#hide:tooltip\n */\n\n/**\n * @classdesc Abstract class to create a tooltip.\n * \n * @abstract\n * @fires module:meteoJS/tooltip#show:tooltip\n * @fires module:meteoJS/tooltip#hide:tooltip\n */\nexport class Tooltip {\n \n constructor() {\n /**\n * @type Boolean\n * @private\n */\n this._isShown = false;\n \n /**\n * @type undefined|mixed\n * @private\n */\n this._content = undefined;\n }\n \n /**\n * Is tooltip shown.\n * \n * @type Boolean\n * @readonly\n */\n get isShown() {\n return this._isShown;\n }\n \n /**\n * Content of tooltip. Could be a String or a HTMLElement or a jQuery object.\n * \n * @type undefined|mixed\n */\n get content() {\n return this._content;\n }\n set content(content) {\n let oldContent = this._content;\n this._content = content;\n if (oldContent !== this._content)\n this.onContentChange();\n }\n \n /**\n * Show tooltip.\n * \n * @abstract\n * @param {Object} [options] - Options.\n * @param {Number} options.posX - Position in x direction.\n * @param {Number} options.posY - Position in y direction.\n * @returns {module:meteoJS/tooltip.Tooltip} This.\n */\n show() {\n let fireShowEvent = !this.isShown;\n this._isShown = true;\n if (fireShowEvent)\n this.trigger('show:tooltip');\n return this;\n }\n \n /**\n * Hide tooltip.\n * \n * @abstract\n * @returns {module:meteoJS/tooltip.Tooltip} This.\n */\n hide() {\n let fireHideEvent = this.isShown;\n this._isShown = false;\n if (fireHideEvent)\n this.trigger('hide:tooltip');\n return this;\n }\n \n /**\n * Update tooltip. E.g. due to content change, which moved the tooltip.\n * \n * @abstract\n * @returns {module:meteoJS/tooltip.Tooltip} This.\n */\n update() {\n return this;\n }\n \n /**\n * Called when property 'content' changes.\n * \n * @abstract\n * @protected\n */\n onContentChange() {}\n \n}\naddEventFunctions(Tooltip.prototype);\nexport default Tooltip;","const __WEBPACK_NAMESPACE_OBJECT__ = bootstrap;","/**\n * @module meteoJS/tooltip/bootstrapTooltip\n */\nimport $ from 'jquery';\nimport { Tooltip as bsTooltip } from 'bootstrap';\nimport Tooltip from '../Tooltip.js';\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/tooltip/bootstrapTooltip~options\n * @property {undefined|external:jQuery|external:HTMLElement} [tooltipNode=undefined]\n * Create Bootstrap's tooltip on this element.\n * @property {Object} [bootstrapOptions] - Options passed to the '.tooltip' method.\n * @property {boolean} [closeOnMouseMove=true]\n * Close tooltip, when mouse is moved over the tooltip.\n * @property {boolean} [closeOnMouseEnter=false]\n * Close tooltip, when mouse is entered in the tooltip.\n */\n\n/**\n * Tooltip which uses the Bootstrap's tooltip.\n * \n * @extends module:meteoJS/tooltip.Tooltip\n * @inheritdoc\n */\nexport class BootstrapTooltip extends Tooltip {\n \n /**\n * @param {module:meteoJS/tooltip/bootstrapTooltip~options} [options] - Options.\n */\n constructor({\n tooltipNode = undefined,\n bootstrapOptions = undefined,\n closeOnMouseMove = true,\n closeOnMouseEnter = false\n } = {}) {\n super();\n \n /**\n * @type undefined|Object\n * @private\n */\n this.bootstrapOptions = bootstrapOptions ? bootstrapOptions : {};\n this._initBootstrapOptions(bootstrapOptions);\n \n /**\n * @type boolean\n * @private\n */\n this.closeOnMouseMove = closeOnMouseMove;\n \n /**\n * @type Bboolean\n * @private\n */\n this.closeOnMouseEnter = closeOnMouseEnter;\n \n /**\n * @type external:jQuery\n * @private\n */\n this._tooltipNode = undefined;\n this.tooltipNode = tooltipNode;\n\n /**\n * @type external:bootrap|undefined\n * @private\n */\n this._bsTooltip = undefined;\n }\n \n /**\n * Bootstap's tooltip is assigned to this node.\n * \n * @type undefined|external:jQuery\n */\n get tooltipNode() {\n return this._tooltipNode;\n }\n set tooltipNode(tooltipNode) {\n if (tooltipNode === undefined) {\n this._tooltipNode = tooltipNode;\n this._bsTooltip = undefined;\n return;\n }\n \n this._tooltipNode = $(tooltipNode);\n this._initTooltipNode();\n }\n \n /**\n * @inheritdoc\n */\n show({\n posX,\n posY\n }) {\n if (this._tooltipNode === undefined || this._bsTooltip === undefined)\n return super.show();\n\n this.tooltipNode\n .css({\n left: `${posX}px`,\n top: `${posY}px`\n });\n if (this.isShown)\n this._bsTooltip.update();\n else\n this._bsTooltip.show();\n return super.show();\n }\n \n /**\n * @inheritdoc\n */\n hide() {\n if (this._tooltipNode === undefined || this._bsTooltip === undefined)\n return super.hide();\n\n if (this.isShown)\n this._bsTooltip.hide();\n return super.hide();\n }\n \n /**\n * @inheritdoc\n */\n update() {\n if (this._bsTooltip !== undefined)\n this._bsTooltip.update();\n return super.update();\n }\n \n /**\n * @inheritdoc\n */\n onContentChange() {\n this._updateNonStringContent();\n this.update();\n }\n \n /**\n * Default options to Bootstrap's tooltip.\n * \n * @private\n */\n _initBootstrapOptions({\n trigger = 'manual',\n title = '-'\n } = {}) {\n this.bootstrapOptions.trigger = trigger;\n this.bootstrapOptions.title = title;\n // Because of a bug in Bootstrap 5.2.x, animation should be disabled.\n // https://github.com/twbs/bootstrap/issues/36875\n this.bootstrapOptions.animation = false;\n }\n \n /**\n * Initialize Bootstrap's tooltip.\n * \n * @private\n */\n _initTooltipNode() {\n if (this._bsTooltip !== undefined)\n this._bsTooltip.dispose();\n this._bsTooltip =\n new bsTooltip(this._tooltipNode[0], this.bootstrapOptions);\n this.tooltipNode[0].addEventListener('inserted.bs.tooltip', () => {\n let tooltipNode = this._updateNonStringContent();\n if (!tooltipNode.length)\n return;\n if (this.closeOnMouseMove)\n tooltipNode.children('.tooltip-inner').mousemove(() => this.hide());\n if (this.closeOnMouseEnter)\n tooltipNode.children('.tooltip-inner').mouseenter(() => this.hide());\n });\n }\n \n /**\n * Updates tooltips content, if not simply a string.\n * \n * @private\n * @returns {external:jQuery} - Tooltip node.\n */\n _updateNonStringContent() {\n if (this.content !== undefined && this._bsTooltip !== undefined)\n $(this._bsTooltip.tip)\n .children('.tooltip-inner')\n .empty()\n .append(this.content);\n return $(this._bsTooltip.tip);\n }\n \n}\nexport default BootstrapTooltip;","/**\n * @module meteoJS/base/unique\n */\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/base/unique~options\n * @property {mixed} [id] - Id.\n */\n\n/**\n * Class that describe an object with an unique id.\n */\nexport class Unique {\n \n /**\n * @param {module:meteoJS/base/unique~options} [options] - Options.\n */\n constructor({ id } = {}) {\n this._id = id;\n }\n \n /**\n * Id.\n * \n * @type {mixed}\n */\n get id() {\n return this._id;\n }\n set id(id) {\n this._id = id;\n this.setId(id);\n }\n \n /**\n * Fired, wenn id-setter is called.\n * \n * @protected\n * @param {mixed} id - Id.\n */\n setId() {}\n}\nexport default Unique;","/**\n * @module meteoJS/base/collection\n */\nimport addEventFunctions from '../Events.js';\nimport Unique from './Unique.js';\n\n/**\n * Triggered on adding item to collection.\n * \n * @event module:meteoJS/base/collection#add:item\n * @param {module:meteoJS/base/unique.Unique} item - Added item.\n */\n\n/**\n * Triggered on replacing item with already existing ID.\n * \n * @event module:meteoJS/base/collection#replace:item\n * @param {module:meteoJS/base/unique.Unique} item - Added item.\n * @param {module:meteoJS/base/unique.Unique} removedItem - Replaced and removed item.\n */\n\n/**\n * Triggered on removing item from collection.\n * \n * @event module:meteoJS/base/collection#remove:item\n * @param {module:meteoJS/base/unique.Unique} item - Removed item.\n */\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/base/collection~options\n * @property {boolean} [fireReplace] - Fire {@link module:meteoJS/base/collection#replace:item|replace:item}.\n * @property {boolean} [fireAddRemoveOnReplace] -\n * Fire {@link module:meteoJS/base/collection#add:item|add:item} and\n * {@link module:meteoJS/base/collection#remove:item|remove:item} on\n * replacing an item.\n * @property {boolean} [appendOnReplace] -\n * Append item to the end, if item is replaced.\n * @property {undefined|Function} [sortFunction] -\n * Sort function to sort the collection list.\n * @property {undefined|Function} [emptyObjectMaker] -\n * Function that returns an empty\n * {@link module:meteoJS/base/unqiue.Unique|Unique}-Object or\n * an instance of a child class.\n */\n\n/**\n * Collection-class for {@link module:meteoJS/base/unqiue.Unique|Unique}-Objects\n * or objects of child classes.\n * \n * @implements {Iterator}\n * @fires module:meteoJS/base/collection#add:item\n * @fires module:meteoJS/base/collection#remove:item\n * @fires module:meteoJS/base/collection#replace:item\n */\nexport class Collection {\n \n /**\n * @param {module:meteoJS/base/collection~options} options - Options.\n */\n constructor({ fireReplace=true,\n fireAddRemoveOnReplace=false,\n appendOnReplace=true,\n sortFunction,\n emptyObjectMaker\n } = {}) {\n /** @type Object */\n this.options = {\n fireReplace,\n fireAddRemoveOnReplace,\n appendOnReplace,\n sortFunction,\n emptyObjectMaker\n };\n \n /**\n * List of the IDs of the items.\n * @type mixed[]\n * @private\n */\n this._itemIds = [];\n \n /**\n * Items, ID as key of the object.\n * @type Object.<mixed,module:meteoJS/base/unique.Unique>\n * @private\n */\n this._items = {};\n }\n \n /**\n * Count of the items in this collection.\n * \n * @type integer\n * @readonly\n */\n get count() {\n return this._itemIds.length;\n }\n \n [Symbol.iterator]() {\n let i = 0;\n return {\n next: () => {\n return (i < this._itemIds.length)\n ? { value: this._items[this._itemIds[i++]] }\n : { done: true };\n }\n };\n }\n \n /**\n * Items (ordered list).\n * \n * @type module:meteoJS/base/unique.Unique[]\n * @readonly\n */\n get items() {\n return this._itemIds.map(id => this._items[id]);\n }\n \n /**\n * List of IDs (ordered list).\n * \n * @type mixed[]\n * @readonly\n */\n get itemIds() {\n return this._itemIds;\n }\n \n /**\n * Sort function for the items.\n * \n * @type undefined|Function\n */\n get sortFunction() {\n return this.options.sortFunction;\n }\n set sortFunction(sortFunction) {\n this.options.sortFunction = sortFunction;\n this._sort();\n }\n \n /**\n * Returns item by ID, Unique-Object with undefined id, if ID doesn't exist.\n * \n * @param {mixed} id - ID.\n * @returns {module:meteoJS/base/unique.Unique} Item.\n */\n getItemById(id) {\n return (id in this._items) ? this._items[id] :\n (this.options.emptyObjectMaker === undefined)\n ? new Unique()\n : this.options.emptyObjectMaker.call(this);\n }\n \n /**\n * Is item appended to the collection.\n * \n * @param {module:meteoJS/base/unique.Unique} item - Item.\n * @returns {boolean} If appended.\n */\n contains(item) {\n let result = this.containsId(item.id);\n if (result)\n result = item === this.getItemById(item.id);\n return result;\n }\n \n /**\n * Exists an ID in this collection.\n * \n * @param {mixed} id - ID.\n * @returns {boolean} If exists.\n */\n containsId(id) {\n return (id in this._items);\n }\n \n /**\n * Append an item to the collection.\n * \n * @param {...module:meteoJS/base/unique.Unique} items - New items.\n * @returns {module:meteoJS/base/collection.Collection} This.\n * @fires module:meteoJS/base/collection#add:item\n * @fires module:meteoJS/base/collection#remove:item\n * @fires module:meteoJS/base/collection#replace:item\n */\n append(...items) {\n const addItem = [];\n const removeItem = [];\n const replaceItem = [];\n items.forEach(item => {\n let id = item.id;\n if (this.containsId(id)) {\n let itemInCollection = this.getItemById(id);\n if (this.options.appendOnReplace) {\n this._itemIds.splice(this._itemIds.indexOf(id), 1);\n this._itemIds.push(id);\n }\n if (itemInCollection !== item) {\n this._items[id] = item;\n if (this.options.fireReplace)\n replaceItem.push([item, itemInCollection]);\n if (this.options.fireAddRemoveOnReplace) {\n removeItem.push(itemInCollection);\n addItem.push(item);\n }\n }\n }\n else {\n this._itemIds.push(id);\n this._items[id] = item;\n addItem.push(item);\n }\n });\n this._sort();\n addItem.forEach(item => this.trigger('add:item', item));\n removeItem.forEach(item => this.trigger('remove:item', item));\n replaceItem.forEach(([item, itemInCollection]) => this.trigger('replace:item', item, itemInCollection));\n return this;\n }\n \n /**\n * Removes an item from the collection.\n * \n * @param {...module:meteoJS/base/unique.Unique} items - Items to remove.\n * @returns {module:meteoJS/base/collection.Collection} This.\n * @fires module:meteoJS/base/collection#remove:item\n */\n remove(...items) {\n items.forEach(item => {\n let i = this._itemIds.indexOf(item.id);\n if (i > -1) {\n let realItem = this._items[item.id];\n delete this._items[item.id];\n this._itemIds.splice(i, 1);\n this.trigger('remove:item', realItem);\n }\n });\n return this;\n }\n \n /**\n * Removes an item by ID from the collection.\n * \n * @param {mixed} id - ID of the item to delete.\n * @returns {module:meteoJS/base/collection.Collection} This.\n * @fires module:meteoJS/base/collection#remove:item\n */\n removeById(...ids) {\n ids.forEach(id => {\n let i = this._itemIds.indexOf(id);\n if (i > -1) {\n let item = this._items[id];\n delete this._items[id];\n this._itemIds.splice(i, 1);\n this.trigger('remove:item', item);\n }\n });\n return this;\n }\n \n /**\n * Sorts Collection-List.\n * \n * @private\n */\n _sort() {\n if (this.options.sortFunction === undefined)\n return;\n this._itemIds.sort((a,b) => {\n return this.options.sortFunction(this._items[a], this._items[b]);\n });\n }\n}\naddEventFunctions(Collection.prototype);\nexport default Collection;","/**\n * @module meteoJS/modelviewer\n */\nimport Collection from './base/Collection.js';\nimport Timeline from './Timeline.js';\n\n/**\n * Creates and returns a HTMLElement or jQuery object for a container. The\n * content of the container is appended to this element. This function has to\n * append the element to the modelviewer's containersNode.\n * \n * @typedef {Function} module:meteoJS/modelviewer~makeContainerNode\n * @param {module:meteoJS/modelviewer/container.Container} container\n * Container to append.\n * @this module:meteoJS/modelviewer~Modelviewer\n * @returns {HTMLElement|jQuery} Top node of the appended container.\n */\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/modelviewer~options\n * @param {module:meteoJS/modelviewer/resources.Resources} resources\n * Available resources.\n * @param {HTMLElement|jQuery} containersNode Node to append the containers.\n * @param {module:meteoJS/timeline.Timeline} [timeline]\n * Shared Timeline between containers.\n * @param {module:meteoJS/modelviewer~makeContainerNode} [makeContainerNode]\n * Function to create the top node of each container.\n * @param {boolean} [firstTimeOnInit=true] - Selects the first time in timeline\n * once for the first time times are added to the timeline.\n * @param {boolean} [lastTimeOnInit=false] - Selects the last time in timeline\n * once for the first time times are added to the timeline.\n * Ignored if firstTimeOnInit is true.\n */\n\n/**\n * @classdesc\n \n * Entscheidet über das Design der Container (auch Darstellungsbreite -> entsprechend welche Navigation)\n * Wie kann der User die Anordnung der Container ändern?\n * Dies soll für Bootstrap aber auch allg. funktionieren\n * Wie soll dazu die Navigation angepasst werden können\n * Handelt wahrscheinlich die Darstellung der Container (irgendwie…)\n * Eigentlich wäre gut, wenn auch keine Abhängikeit von jQuery… (geht das?)\n * Output Container -> Modelviewer\n * Kann entweder nur ein Bild/Sounding/etc. anzeigen\n * Kann je nach dem auch noch Navigation(en) ausgeben\n * Je nach Output unterschiedlicher Aufbau des Container-div's\n * Wie übergibt man diesem Objekt die Darstellung (z.B. der Navigation)\n * Navigation muss sich anpassen (Änderung einer Collection, Änderung der Resource, …)\n * Wie löst man das Vererben der Anzeige des vorangegangenen Containers -> Modelviewer\n * Wie löst man, dass öffnen eines nächsten Runs vom vorangegangenen Container -> Modelviewer\n * Bei Image -> hover funktion -> Modelviewer\n * Bei Image -> Überblenden von Punkten für z.B. Ensembles -> Modelviewer\n * Default-Navigation mit <select>-Nodes. -> Modelviewer\n * 2te Default-Navigation mit vertikal angeordneten Listen -> Modelviewer\n * \n * ToDo:\n * * Alle Zeitpunkte für Modell/Run\n * * Alle Zeitpunkte für eine gewählte Resource (oder mind. displayVariables)\n * -> dabei sollten keine Unter-Nodes berücksichtigt werden.\n * * Auswahl der DisplayVariable entweder nur per 1:1 Übereinstimmung oder aber\n * durch Best-Match (wie soll dies gelöst werden).\n * Aktuell befindet sich ziemlicher Rubbish-Code in den Klassen.\n * collectTimesVariableCollections in Resources ist nicht die Lösung\n */\nexport class Modelviewer extends Collection {\n \n /**\n * @param {module:meteoJS/modelviewer~options} options - Options.\n */\n constructor({ resources,\n containersNode,\n timeline = undefined,\n makeContainerNode = undefined,\n firstTimeOnInit = true,\n lastTimeOnInit = false } = {}) {\n super({\n fireReplace: false,\n fireAddRemoveOnReplace: true\n });\n \n /**\n * @type module:meteoJS/modelviewer/resources.Resources\n * @private\n */\n this._resources = resources;\n \n /**\n * @type HTMLElement\n * @private\n */\n this._containersNode =\n (typeof containersNode == 'object' && containersNode.jquery)\n ? containersNode[0] : containersNode;\n \n /**\n * @type module:meteoJS/timeline.Timeline\n * @private\n */\n this._timeline = (timeline === undefined) ? new Timeline() : timeline;\n \n /**\n * @type undefined|Function\n * @private\n */\n this._makeContainerNode = makeContainerNode;\n \n /**\n * @type Map<module:meteoJS/modelviewer/container.Container,mixed>\n * @private\n */\n let listenerKeys = new Map();\n \n this.on('add:item', container => {\n container.modelviewer = this;\n container.containerNode =\n this._getContainerNode(container);\n if (!isNaN(this.timeline.getSelectedTime().valueOf()) ||\n !firstTimeOnInit && !lastTimeOnInit)\n return;\n \n listenerKeys\n .set(container, container.on('change:selectedVariables', () => {\n if (isNaN(this._timeline.getSelectedTime().valueOf())) {\n if (firstTimeOnInit)\n this._timeline.first();\n else if (lastTimeOnInit)\n this._timeline.last();\n if (!isNaN(this._timeline.getSelectedTime().valueOf()))\n for (let c of listenerKeys.keys()) {\n c.un('change:selectedVariables', listenerKeys.get(c));\n listenerKeys.delete(c);\n }\n }\n }));\n });\n \n this.on('remove:item', container => {\n if (container.containerNode !== undefined &&\n container.containerNode.parentNode != null)\n container.containerNode.parentNode.removeChild(container.containerNode);\n container.modelviewer = undefined;\n container.containerNode = undefined;\n if (listenerKeys.has(container)) {\n container.un('change:selectedVariables', listenerKeys.get(container));\n listenerKeys.delete(container);\n }\n this.timeline.deleteSetID(container.id);\n });\n }\n \n /**\n * Resources.\n * \n * @type module:meteoJS/modelviewer/resources.Resources\n * @readonly\n */\n get resources() {\n return this._resources;\n }\n \n /**\n * Node to append the container's node into.\n * \n * @type HTMLElement\n * @readonly\n */\n get containersNode() {\n return this._containersNode;\n }\n \n /**\n * Timeline.\n * \n * @type module:meteoJS/timeline.Timeline\n * @readonly\n */\n get timeline() {\n return this._timeline;\n }\n \n /**\n * Appends container(s).\n * \n * @param {...module:meteoJS/modelviewer/container.Container} containers\n * New containers.\n * @returns {module:meteoJS/modelviewer.Modelviewer} This.\n * @override\n */\n append(...containers) {\n let ids = [...this.itemIds];\n containers\n .filter(container => container.id !== undefined)\n .forEach(container => ids.push(container.id));\n containers\n .filter(container => container.id === undefined)\n .forEach(container => {\n let i = 1;\n let id = `container${i}`;\n while (ids.indexOf(id) > -1) {\n i++;\n id = `container${i}`;\n }\n container.id = id;\n ids.push(id);\n });\n super.append(...containers);\n return this;\n }\n \n /**\n * Creates a HTMLElement to append the container content into it. This\n * element is appended to the containersNode.\n * \n * @param {module:meteoJS/modelviewer/container.Container} container\n * Create Node for this container.\n * @returns {HTMLElement} Node.\n * @private\n */\n _getContainerNode(container) {\n if (this._makeContainerNode !== undefined) {\n let result =\n this._makeContainerNode.call(this, this.containersNode, container);\n return (typeof result == 'object' && result.jquery) ? result[0] : result;\n }\n else {\n let containerNode =\n (container.containerNode !== undefined)\n ? container.containerNode\n : document.createElement('div');\n if (this.containersNode !== undefined)\n this.containersNode.appendChild(containerNode);\n return containerNode;\n }\n }\n}\nexport default Modelviewer;","/**\n * @module meteoJS/base/named\n */\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/base/named~options\n * @property {string} [name] - Default name.\n * @property {Object.<string,string>} [names] - Names.\n * @property {string[]} [langSortation] - Priority of language codes.\n */\n\n/**\n * Class with a name in different languages.\n */\nexport class Named {\n \n /**\n * @param {module:meteoJS/base/named~options} [options] - Options.\n */\n constructor({ name = undefined, names = {}, langSortation = [] } = {}) {\n /**\n * @type undefined|string\n * @private\n */\n this._name = name;\n \n /**\n * @type Object<string,string>\n * @private\n */\n this._names = names;\n \n /**\n * @type string[]\n * @private\n */\n this._langSortation = langSortation;\n }\n \n /**\n * Default name.\n * \n * @type {string}\n */\n get name() {\n return this.getDefaultName();\n }\n set name(name) {\n this._name = name;\n }\n \n /**\n * Returns the name in the passed language.\n * \n * @param {string} lang - Language code.\n * @returns {string} Name in the passed language.\n */\n getNameByLangNoFallback(lang) {\n return (lang in this._names) ? this._names[lang] : '';\n }\n \n /**\n * Sets the name of a certain language. Pass undefined to delete name.\n * \n * @param {string} lang - Language code.\n * @param {string} name - Name.\n */\n setNameByLang(lang, name) {\n this._names[lang] = name;\n if (name === undefined)\n delete this._names[lang];\n }\n \n /**\n * Default order of the languages.\n * \n * @type string[]\n */\n get langSortation() {\n return this._langSortation;\n }\n set langSortation(langSortation) {\n this._langSortation = langSortation;\n }\n \n /**\n * Default name.\n * \n * @returns {string}\n * @protected\n */\n getDefaultName() {\n return (this._name !== undefined) ? this._name : this.getNameByLang();\n }\n \n /**\n * Returns a name, if available in the passed language, otherwise in a\n * fallback language.\n * \n * @param {string} [lang] - Language code.\n * @param {Object} [options] - Options.\n * @param {string[]} [options.langSortation] - Priority of language codes.\n * @returns {string} Name in the passed or a fallback language.\n */\n getNameByLang(lang = undefined, { langSortation = undefined } = {}) {\n let lS =\n (langSortation === undefined) ? this._langSortation : langSortation;\n let langs = Object.keys(this._names);\n if (langs.length < 1)\n return (this._name === undefined) ? '' : this._name;\n return this._names[langs.sort((a, b) => {\n if (a == lang) return -1;\n if (b == lang) return 1;\n let ia = lS.indexOf(a);\n let ib = lS.indexOf(b);\n if (ib < 0) return 0;\n if (ia < 0) return 1;\n return ia < ib ? -1 : ia == ib ? 0 : 1;\n })[0]];\n }\n}\nexport default Named;","/**\n * @module meteoJS/base/uniquenamed\n */\nimport Unique from './Unique.js';\nimport Named from './Named.js';\n\n/**\n * Options for constructor.\n * \n * @typedef {module:meteoJS/base/named~options}\n * module:meteoJS/base/uniquenamed~options\n * @property {mixed} [id] - Id.\n */\n\n/**\n * Class that describe objects with an unique id and with names.\n * \n * @extends module:meteoJS/base/unique.Unique\n * @extends module:meteoJS/base/named.Named\n */\nexport class UniqueNamed extends Named {\n \n /**\n * @param {module:meteoJS/base/uniquenamed~options} [options] - Options.\n */\n constructor({ id, name = undefined, names = {}, langSortation = [] } = {}) {\n super({\n name,\n names,\n langSortation\n });\n \n Object.defineProperty(this, 'id',\n Object.getOwnPropertyDescriptor(Unique.prototype, 'id'));\n // constructor code of Unique\n this._id = id;\n }\n \n /**\n * @override\n */\n setId(id) {\n Unique.prototype.setId.call(this, id);\n }\n \n /**\n * @override\n */\n getDefaultName() {\n return (this._name !== undefined)\n ? this._name\n : (Object.keys(this._names).length > 0)\n ? this.getNameByLang()\n : (this._id === undefined) ? '' : this._id;\n }\n}\nexport default UniqueNamed;","/**\n * @module meteoJS/modelviewer/variable\n */\nimport UniqueNamed from '../base/UniqueNamed.js';\n\n/**\n * Options for constructor.\n * \n * @typedef {module:meteoJS/base/uniquenamed~options}\n * module:meteoJS/modelviewer/variable~options\n * @param {module:meteoJS/modelviewer/variableCollection.VariableCollection}\n * [variableCollection] - Belongs to this VariableCollection.\n */\n\n/**\n * @classdesc Object for e.g. a model, a runtime or a field.\n */\nexport class Variable extends UniqueNamed {\n \n /**\n * @param {module:meteoJS/modelviewer/variable~options} [options] - Options.\n */\n constructor({ id,\n name = undefined,\n names = {},\n langSortation = [],\n variableCollection } = {}) {\n super({\n id,\n name,\n names,\n langSortation\n });\n \n /**\n * @type undefined|module:meteoJS/modelviewer/variableCollection.VariableCollection\n * @private\n */\n this._variableCollection = variableCollection;\n }\n \n /**\n * This Variable belongs to this VariableCollection.\n * @type undefined|module:meteoJS/modelviewer/variableCollection.VariableCollection\n */\n get variableCollection() {\n return this._variableCollection;\n }\n set variableCollection(variableCollection) {\n this._variableCollection = variableCollection;\n }\n}\nexport default Variable;","/**\n * @module meteoJS/modelviewer/timeVariable\n */\nimport Variable from './Variable.js';\n\n/**\n * Options for TimeVariable constructor\n * \n * @typedef {module:meteoJS/base/uniquenamed~options}\n * module:meteoJS/modelviewer/timeVariable~options\n * @param {Date|undefined} [datetime] - Datetime.\n */\n\n/**\n * @classdesc Class for something representing a time, e.g. runtime or offset.\n */\nexport class TimeVariable extends Variable {\n \n /**\n * @param {module:meteoJS/modelviewer/timeVariable~options} options - Options.\n */\n constructor({ id,\n name = undefined,\n names = {},\n langSortation = [],\n datetime = undefined } = {}) {\n super({\n id,\n name,\n names,\n langSortation\n });\n \n /**\n * @type Date|undefined\n * @private\n */\n this._datetime = (this.id === undefined) ? undefined : new Date(this.id);\n \n if (datetime !== undefined)\n this.datetime = datetime;\n }\n \n /**\n * @override\n */\n setId(id) {\n this._datetime = (id === undefined) ? undefined : new Date(id);\n }\n \n /**\n * @type Date|undefined\n */\n get datetime() {\n return this._datetime;\n }\n set datetime(datetime) {\n this._datetime = datetime;\n this._id = (datetime !== undefined) ? datetime.valueOf() : undefined;\n }\n}\nexport default TimeVariable;","/**\n * @module meteoJS/modelviewer/variableCollection\n */\nimport Variable from './Variable.js';\nimport Unique from '../base/Unique.js';\nimport UniqueNamed from '../base/UniqueNamed.js';\nimport NamedCollection from '../base/NamedCollection.js';\n\n/**\n * Triggered on adding a Variable to collection.\n * \n * @event module:meteoJS/modelviewer/variableCollection#add:variable\n * @param {module:meteoJS/modelviewer/variable.Variable} variable -\n * Added variable.\n */\n\n/**\n * Triggered on removing a Variable from collection.\n * \n * @event module:meteoJS/modelviewer/variableCollection#remove:variable\n * @param {module:meteoJS/modelviewer/variable.Variable} variable -\n * Removed variable.\n */\n\n/**\n * Options for constructor.\n * \n * @typedef {module:meteoJS/base/namedCollection~options}\n * module:meteoJS/modelviewer/variableCollection~options\n */\n\n/**\n * @classdesc A collection of Variable-objects. It also defines a hierarchy\n * of the collections. So a VariableCollection could have children and\n * parents. A variable object can only belong to one collection.\n * @augments module:meteoJS/base/unique.Unique\n * @fires module:meteoJS/modelviewer/variableCollection#add:variable\n * @fires module:meteoJS/modelviewer/variableCollection#remove:variable\n */\nexport class VariableCollection extends NamedCollection {\n \n /**\n * @param {module:meteoJS/modelviewer/variableCollection~options} options\n * - Options.\n */\n constructor({ id,\n fireReplace=true,\n fireAddRemoveOnReplace=false,\n appendOnReplace=true,\n sortFunction,\n names,\n langSortation } = {}) {\n super({\n emptyObjectMaker: () => { return new Variable(); },\n fireReplace,\n fireAddRemoveOnReplace,\n appendOnReplace,\n sortFunction,\n names,\n langSortation\n });\n \n Object.defineProperty(this, 'id',\n Object.getOwnPropertyDescriptor(Unique.prototype, 'id'));\n // constructor code of Unique\n this._id = id;\n \n // ID as name\n Object.defineProperty(this, 'getDefaultName',\n Object.getOwnPropertyDescriptor(UniqueNamed.prototype, 'getDefaultName'));\n \n /**\n * @type undefined|module:meteoJS/modelviewer/node.Node\n * @private\n */\n this._node = undefined;\n \n this.on('add:item', item => {\n if (item.variableCollection !== undefined)\n item.variableCollection.remove(item);\n item.variableCollection = this;\n this.trigger('add:variable', item);\n });\n this.on('remove:item', item => this.trigger('remove:variable', item));\n }\n \n /**\n * @override\n */\n setId(id) {\n Unique.prototype.setId.call(this, id);\n }\n \n /**\n * Variables contained by this collection.\n * \n * @type module:meteoJS/modelviewer/variable.Variable[]\n */\n get variables() {\n return this.items;\n }\n \n /**\n * Alias of getItemById.\n * \n * @param {mixed} id ID.\n * @returns {module:meteoJS/modelviewer/variable.Variable} Variable.\n */\n getVariableById(id) {\n return this.getItemById(id);\n }\n \n /**\n * If defined, this VariableCollection belongs to this node.\n * \n * @type undefined|module:meteoJS/modelviewer/node.Node\n */\n get node() {\n return this._node;\n }\n set node(node) {\n this._node = node;\n }\n}\nexport default VariableCollection;","/**\n * @module meteoJS/base/namedCollection\n */\nimport Collection from './Collection.js';\nimport Named from './Named.js';\n\n/**\n * Options for constructor.\n * \n * @typedef {module:meteoJS/base/collection~options}\n * module:meteoJS/base/namedCollection~options\n * @property {string} [name] - Default name.\n * @property {Object.<string,string>} [names] - Names.\n * @property {string[]} [langSortation] - Priority of language codes.\n */\n\n/**\n * Collection-class with i18n names.\n * \n * @extends module:meteoJS/base/collection.Collection\n * @extends module:meteoJS/base/named.Named\n */\nexport class NamedCollection extends Collection {\n \n /**\n * @param {module:meteoJS/base/namedCollection~options} options - Options.\n */\n constructor({ fireReplace=true,\n fireAddRemoveOnReplace=false,\n appendOnReplace=true,\n sortFunction,\n emptyObjectMaker,\n name = undefined,\n names = {},\n langSortation = []\n } = {}) {\n super({\n fireReplace,\n fireAddRemoveOnReplace,\n appendOnReplace,\n sortFunction,\n emptyObjectMaker\n });\n \n Object.defineProperty(this, 'name',\n Object.getOwnPropertyDescriptor(Named.prototype, 'name'));\n Object.getPrototypeOf(this).getDefaultName = Named.prototype.getDefaultName;\n Object.getPrototypeOf(this).getNameByLang = Named.prototype.getNameByLang;\n Object.getPrototypeOf(this).setNameByLang = Named.prototype.setNameByLang;\n Object.getPrototypeOf(this).getNameByLangNoFallback =\n Named.prototype.getNameByLangNoFallback;\n // Named constructor code\n /**\n * @type undefined|string\n * @private\n */\n this._name = name;\n \n /**\n * @type Object<string,string>\n * @private\n */\n this._names = names;\n \n /**\n * @type string[]\n * @private\n */\n this._langSortation = langSortation;\n }\n}\nexport default NamedCollection;","/**\n * @module meteoJS/modelviewer/resourcesTreeNode\n */\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/modelviewer/resourcesTreeNode~options\n * @param {module:meteoJS/modelviewer/node.Node} node\n * The object is linked to this node.\n */\n\n/**\n * Internal class to manage the available resources inside the\n * {@link module:meteoJS/modelviewer/node.Node|Node class}. Each\n * ResourcesTreeNode object is linked to a Node object. It is a many to one\n * relation. The hierarchy of the ResourcesTree is analogue to the Node\n * hierarchy. But the tree is build via the\n * {@link module:meteoJS/modelviewer/variable.Variable|Variable objects}.\n * So, this class is not only linked to a Node object, but subsequently for a\n * {@link module:meteoJS/modelviewer/variableCollection.VariableCollection|VariableCollection object}.\n * If a {@link module:meteoJS/modelviewer/resource.Resource|Resource} for a\n * certain Variable object from this VariableCollection is added, then a\n * child ResourcesTreeNode object is inserted in the tree (if it doesn't exists)\n * for the Variable object.\n * \n * @internal\n */\nexport class ResourcesTreeNode {\n \n /**\n * @param {module:meteoJS/modelviewer/resourcesNode~options} [options]\n * Options.\n */\n constructor({ node }) {\n \n /**\n * @type module:meteoJS/modelviewer/node.Node\n * @private\n */\n this._node = node;\n\n /**\n * @type Map.<module:meteoJS/modelviewer/variable.Variable,module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode>\n * @private\n */\n this._children = new Map();\n\n /**\n * @type module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode\n * @private\n */\n this._parent = undefined;\n }\n\n /**\n * Linked Node object.\n * \n * @type module:meteoJS/modelviewer/node.Node\n * @readonly\n */\n get node() {\n return this._node;\n }\n\n /**\n * Linked VariableCollection object.\n * \n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection\n * @readonly\n */\n get variableCollection() {\n return this._node.variableCollection;\n }\n\n get children() {\n return [...this._children.values()];\n }\n\n /**\n * The parent object of this ResourcesTree-Node.\n * \n * @type undefined|module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode\n */\n get parent() {\n return this._parent;\n }\n set parent(parent) {\n this._parent = parent;\n }\n\n /**\n * Returns the child corresponding to the passed variable.\n * \n * @param {module:meteoJS/modelviewer/variable.Variable} variable - Variable.\n * @returns {module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode}\n * Child ResourcesTreeNode object for the passed variable.\n */\n getChildByVariable(variable) {\n return this._children.get(variable);\n }\n\n /**\n * Build tree \n * \n * @param {Object} options - Options.\n * @param {module:meteoJS/modelviewer/resource.Resource} options.resource\n * The added Resource object.\n * @param {module:meteoJS/modelviewer/node.Node} options.aimedNode\n * The Resource object will be inserted into this Node object.\n * @returns {undefined|module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode}\n */\n buildChildrenTreeForResource({\n resource,\n aimedNode\n }) {\n if (this.node === aimedNode)\n return this;\n\n const variable =\n resource.getVariableByVariableCollection(this.variableCollection);\n /* Shouldn't get an unknown Variable. The resource is inserted in the\n * Node-tree with a Variable in each Node. */\n if (variable.id === undefined)\n return undefined;\n\n let child = this._children.get(variable);\n if (child !== undefined)\n return child.buildChildrenTreeForResource({ resource, aimedNode });\n // Child doesn't already exist\n this.node.children.forEach(node => {\n // The resource will belong only to one node.\n const childVariable =\n resource.getVariableByVariableCollection(node.variableCollection);\n if (childVariable.id !== undefined)\n child = new ResourcesTreeNode({ node });\n });\n if (child !== undefined) {\n this._children.set(variable, child);\n child.parent = this;\n return child.buildChildrenTreeForResource({ resource, aimedNode });\n }\n return undefined;\n }\n\n /**\n * Removes a child in the Resources-Tree. If this was the only child of this\n * Resources-Tree-Node, then remove this Tree-Node from the parent.\n */\n removeChild({\n child\n }) {\n for (const [variable, c] of this._children.entries())\n if (c === child)\n this._children.delete(variable);\n if (this._children.size < 1\n && this.parent !== undefined)\n this.parent.removeChild({ child: this });\n }\n\n /**\n * Returns the bottom most ResourcesTreeNode object. On the way from the top\n * ResourcesTreeNode to this object, for every passed Variable object a\n * suitable ResourcesTreeNode is passed.\n * \n * @param {...module:meteoJS/modelviewer/variable.Variable} - variables\n * A set of Variable objects.\n * @returns {undefined|module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode}\n * Bottom most object.\n */\n findNodeByVariables(...variables) {\n let v = undefined;\n variables.forEach(variable => {\n if (variable.variableCollection === this.variableCollection)\n v = variable;\n });\n if (v === undefined)\n return undefined;\n const child = this._children.get(v);\n if (child !== undefined) {\n const result = child.findNodeByVariables(...variables);\n return (result === undefined) ? this : result;\n }\n return this;\n }\n}\nexport default ResourcesTreeNode;","/**\n * @module meteoJS/modelviewer/node\n */\nimport addEventFunctions from '../Events.js';\nimport ResourcesTreeNode from './ResourcesTreeNode.js';\n\n/**\n * Triggered on append of a child node.\n * \n * @event module:meteoJS/modelviewer/node#append:child\n * @param {module:meteoJS/modelviewer/node.Node} node - Appended child node.\n */\n\n/**\n * A node has always a correspondent VariableCollection. With the node objects\n * a hierarchy of the collections is build up. This hierarchy is mainly used\n * to achieve a good user experience. This way, the menus in the\n * {@link module:meteoJS/modelviewer/container.Container|modelviewer-container}\n * could be setup to present the user only available fields or levels or only\n * activate buttons which are available for a certain model and run.\n * Additionally a node contains a list of resources, this is used internally\n * in {@link module:meteoJS/modelviewer/resources.Resources}.\n * \n * @fires module:meteoJS/modelviewer/node#append:child\n */\nexport class Node {\n \n /**\n * @param {module:meteoJS/modelviewer/variableCollection.VariableCollection}\n * variableCollection\n * This node belongs to this collection.\n */\n constructor(variableCollection) {\n \n /**\n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection\n * @private\n */\n this._variableCollection = variableCollection;\n variableCollection.node = this;\n \n /**\n * @type module:meteoJS/modelviewer/node.Node[]\n * @private\n */\n this._parents = [];\n \n /**\n * @type module:meteoJS/modelviewer/node.Node[]\n * @private\n */\n this._children = [];\n \n /**\n * @type undefined|module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode\n * @private\n */\n this._resourcesTopNode = undefined;\n\n /**\n * @type Map<module:meteoJS/modelviewer/resourcesTreeNode.ResourcesTreeNode,\n * Map<module:meteoJS/modelviewer/variable.Variable,\n * Set<module:meteoJS/modelviewer/resource.Resource>>>\n * @private\n */\n this._resources = new Map();\n }\n \n /**\n * VariableCollection correspondent to this node.\n * \n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection\n */\n get variableCollection() {\n return this._variableCollection;\n }\n \n /**\n * Parent nodes.\n * \n * @type module:meteoJS/modelviewer/node.Node[]\n */\n get parents() {\n return this._parents;\n }\n \n /**\n * Child nodes.\n * \n * @type module:meteoJS/modelviewer/node.Node[]\n */\n get children() {\n return this._children;\n }\n \n /**\n * Appends a node as a child.\n * \n * @param {...module:meteoJS/modelviewer/node.Node} nodes - Node to append.\n * @returns {module:meteoJS/modelviewer/node.Node} This.\n * @fires module:meteoJS/modelviewer/node#append:child\n */\n appendChild(...nodes) {\n nodes.forEach(node => {\n this._children.push(node);\n node._addParent(this);\n this.trigger('append:child', node);\n });\n return this;\n }\n \n /**\n * Adds a parent node.\n * \n * @param {module:meteoJS/modelviewer/node.Node} node - Node to add.\n * @package\n */\n _addParent(node) {\n this._parents.push(node);\n }\n \n /**\n * All contained resources.\n * \n * @type module:meteoJS/modelviewer/resource.Resource[]\n * @package\n */\n get resources() {\n const result = [];\n for (const m of this._resources.values()) {\n [...m.values()]\n .forEach(resources => result.push(...resources));\n }\n return result;\n }\n \n /**\n * Append resources.\n * \n * @param {...module:meteoJS/modelviewer/resource.Resource} resources\n * Resources.\n * @returns {integer} Count of really added resources.\n * @package\n */\n append(...resources) {\n if (this._resourcesTopNode === undefined)\n this._makeResourcesTopNode();\n\n let addedCount = 0;\n resources.forEach(resource => {\n if (resource.variables\n .filter(v => v.variableCollection === this.variableCollection)\n .length < 1)\n return;\n const resourcesTreeNode =\n this._resourcesTopNode.buildChildrenTreeForResource({\n resource,\n aimedNode: this\n });\n if (resourcesTreeNode !== undefined) {\n const variable = resource\n .getVariableByVariableCollection(resourcesTreeNode.variableCollection);\n if (variable !== undefined) {\n let mapByVariables = this._resources.get(resourcesTreeNode);\n if (mapByVariables === undefined) {\n mapByVariables = new Map();\n this._resources.set(resourcesTreeNode, mapByVariables);\n }\n let resources = mapByVariables.get(variable);\n if (resources === undefined) {\n resources = new Set();\n mapByVariables.set(variable, resources);\n }\n if (!resources.has(resource)) {\n resources.add(resource);\n addedCount++;\n }\n }\n }\n });\n return addedCount;\n }\n \n /**\n * Removes resources.\n * \n * @param {...module:meteoJS/modelviewer/resource.Resource} resources\n * Resources.\n * @returns {integer} Count of really removed resources.\n * @package\n */\n remove(...resources) {\n let removedCount = 0;\n resources.forEach(resource => {\n const resourcesTreeNode = this._resourcesTopNode\n .findNodeByVariables(...resource.variables);\n if (resourcesTreeNode !== undefined) {\n const variable = resource\n .getVariableByVariableCollection(resourcesTreeNode.variableCollection);\n const mapByVariables = this._resources.get(resourcesTreeNode);\n if (mapByVariables !== undefined) {\n const resourcesSet = mapByVariables.get(variable);\n if (resourcesSet !== undefined) {\n resourcesSet.delete(resource);\n removedCount++;\n if (resourcesSet.size < 1) {\n mapByVariables.delete(variable);\n if (mapByVariables.size < 1) {\n this._resources.delete(resourcesTreeNode);\n const parent = resourcesTreeNode.parent;\n if (parent !== undefined)\n parent.removeChild({ child: resourcesTreeNode });\n }\n }\n }\n }\n }\n });\n return removedCount;\n }\n \n /**\n * Returns all or a part of the resources contained in this node. The returned\n * resources are defined by all of the passed variables.\n * \n * @param {boolean} [exactlyMatch=false] - Only return resources, which are\n * defined exactly by the passed variables.\n * @param {...module:meteoJS/modelviewer/variable.Variable} variables\n * Variables.\n * @returns {module:meteoJS/modelviewer/resource.Resource[]} Resources.\n */\n getResourcesByVariables(...variables) {\n if (this._resourcesTopNode === undefined)\n return [];\n\n let exactlyMatch = false;\n if (variables.length &&\n typeof variables[0] === 'boolean')\n exactlyMatch = variables.shift();\n \n if (exactlyMatch && variables.length == 0)\n return [];\n\n if (exactlyMatch) {\n const variablesSet = new Set(variables);\n const node = this._resourcesTopNode.findNodeByVariables(...variables);\n const mapByVariables = this._resources.get(node);\n if (mapByVariables !== undefined) {\n for (const [variable, resources] of mapByVariables) {\n if (!variablesSet.has(variable))\n continue;\n if (resources === undefined || resources.size < 1)\n return [];\n const resource = [...resources][0];\n let isAdded = true;\n variables.forEach(variable => {\n const v = resource.getVariableByVariableCollection(variable.variableCollection);\n if (v !== variable)\n isAdded = false;\n });\n return isAdded ? [...resources] : [];\n }\n }\n return [];\n }\n\n // !exactlyMatch\n const collectResourcesTreeChildren = resourcesTreeNode => {\n let result = new Set();\n if (resourcesTreeNode.children.length < 1) {\n result.add(resourcesTreeNode);\n return result;\n }\n let v = undefined;\n variables.forEach(variable => {\n if (variable.variableCollection === resourcesTreeNode.variableCollection)\n v = variable;\n });\n /* If no variable is found, then collect the nodes of all children. */\n if (v === undefined) {\n resourcesTreeNode.children.forEach(child => {\n result = new Set([...result, ...collectResourcesTreeChildren(child)]);\n });\n }\n else {\n const child = resourcesTreeNode.getChildByVariable(v);\n if (child !== undefined)\n result = new Set([...result, ...collectResourcesTreeChildren(child)]);\n }\n return result;\n };\n const resourcesTreeNodes = collectResourcesTreeChildren(this._resourcesTopNode);\n const result = [];\n [...resourcesTreeNodes].forEach(resourcesTreeNode => {\n const mapByVariables = this._resources.get(resourcesTreeNode);\n if (mapByVariables === undefined)\n return;\n for (const [variable, resources] of mapByVariables) {\n if (variable.variableCollection !== resourcesTreeNode.variableCollection)\n continue;\n if (resources === undefined || resources.size < 1)\n return;\n const resource = [...resources][0];\n let isAdded = true;\n variables.forEach(variable => {\n const v = resource.getVariableByVariableCollection(variable.variableCollection);\n if (v !== variable) {\n isAdded = false;\n }\n });\n if (isAdded)\n result.push(...resources);\n }\n });\n return result;\n }\n\n /**\n * Returns if there exists resources which are defined by all of the passed\n * variables.\n * \n * @param {boolean} [exactlyMatch=false] - Only returns true, if there exists\n * at least one resource, which is defined exactly by the passed variables.\n * @param {...module:meteoJS/modelviewer/variable.Variable} variables\n * Variables.\n * @returns {boolean} Exists at least one resource.\n */\n hasResourcesByVariables(...variables) {\n return (this.getResourcesByVariables(...variables).length > 0);\n }\n\n /**\n * Creates to top node for the resources-tree.\n * \n * @private\n */\n _makeResourcesTopNode() {\n const traversedNodes = new Set();\n const getTopNode = node => {\n const parents = node.parents;\n if (parents.length < 1)\n return node;\n let result = undefined;\n parents.forEach(parentNode => {\n if (!traversedNodes.has(parentNode)) {\n traversedNodes.add(parentNode);\n const r = getTopNode(parentNode);\n if (r !== undefined)\n result = r;\n }\n });\n return result;\n };\n this._resourcesTopNode =\n new ResourcesTreeNode({ node: getTopNode(this) });\n }\n}\naddEventFunctions(Node.prototype);\nexport default Node;","/**\n * @module meteoJS/modelviewer/resource\n */\nimport Variable from './Variable.js';\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/modelviewer/resource~options\n * @param {module:meteoJS/modelviewer/variable.Variable[]} [variables] -\n * Variables, which define this resource uniquely.\n * The variables must be from different VariableCollections.\n * @param {Date} [datetime] - Datetime, ignored if run and offset are defined.\n * @param {Date} [run] - Runtime.\n * @param {integer} [offset] - Offset in seconds.\n */\n\n/**\n * @classdesc Class to describe a data resource like a modelplot or a\n * sounding data. The resource must be defined uniquely by several variables\n * (like model, runtime, …). You should not define the resource by\n * several variables of the same collection.\n * @abstract\n */\nexport class Resource {\n \n /**\n * @param {module:meteoJS/modelviewer/resource~options} [options] - Options.\n */\n constructor({ variables = [],\n datetime = undefined,\n run = undefined,\n offset = undefined } = {}) {\n /**\n * @type Set<module:meteoJS/modelviewer/variable.Variable>\n * @private\n */\n this._variables = new Map();\n variables.forEach(variable =>\n this._variables.set(variable.variableCollection, variable));\n \n /**\n * @type Date|undefined\n * @private\n */\n this._datetime = datetime;\n \n /**\n * @type undefined|Date\n */\n this._run = run;\n \n /**\n * @type undefined|integer\n */\n this._offset = offset;\n \n this._updateDatetime();\n }\n \n /**\n * Variable objects, which define this resource. Like model, run, offset,…\n * \n * @type module:meteoJS/modelviewer/variable.Variable[]\n * @readonly\n */\n get variables() {\n return [...this._variables.values()];\n }\n \n /**\n * Resource is valid for this datetime. If undefined, than the resource is\n * not only valid at one datetime.\n * \n * @type Date|undefined\n */\n get datetime() {\n return this._datetime;\n }\n set datetime(datetime) {\n this._datetime = datetime;\n }\n \n /**\n * Runtime.\n * \n * @type Date|undefined\n */\n get run() {\n return this._run;\n }\n set run(run) {\n this._run = run;\n this._updateDatetime();\n }\n \n /**\n * Offset.\n * \n * @type integer|undefined\n */\n get offset() {\n return this._offset;\n }\n set offset(offset) {\n this._offset = offset;\n this._updateDatetime();\n }\n \n /**\n * Returns the variable-object that is part of the definition of this resource\n * and contains to the passed collection. If you define the resource by\n * several variables of the same variable collection, it is not defined\n * which variable is returned.\n * \n * @param {module:meteoJS/modelviewer/variableCollection.VariableCollection}\n * variableCollection - VariableCollection.\n * @returns {module:meteoJS/modelviewer/variable.Variable}\n */\n getVariableByVariableCollection(variableCollection) {\n const result = this._variables.get(variableCollection);\n return (result === undefined) ? new Variable() : result;\n }\n \n /**\n * Returns if the passed Variable-objects all define this resource.\n * \n * @param {boolean} [exactlyMatch] - Only return true, if the passed\n * variables exactly define the resource.\n * @param {...module:meteoJS/modelviewer/variable.Variable} variables\n * Variables.\n * @returns {boolean} All passed variables defines the resource.\n */\n isDefinedBy(...variables) {\n let exactlyMatch = false;\n if (variables.length &&\n typeof variables[0] === 'boolean')\n exactlyMatch = variables.shift();\n const vars = new Set([...this._variables.values()]);\n if (!exactlyMatch)\n return variables.filter(v => !vars.has(v)).length == 0;\n \n if (variables.filter(v => !vars.has(v)).length != 0)\n return false;\n const variablesSet = new Set(variables);\n return [...vars].filter(v => !variablesSet.has(v)).length == 0;\n }\n \n /**\n * Returns if a Variable-object of the passed collection defines this\n * resource.\n * \n * @param {module:meteoJS/modelviewer/variableCollection.VariableCollection}\n * variableCollection - VariableCollection.\n * @returns {boolean} A variable of the collection defines the resource.\n */\n isDefinedByVariableOf(variableCollection) {\n return this._variables.get(variableCollection) !== undefined;\n }\n \n /**\n * Sets datetime according to run and offset.\n * \n * @private\n */\n _updateDatetime() {\n if (this._run !== undefined &&\n this._offset !== undefined)\n this.datetime = new Date(this._run.valueOf() + this._offset * 1000);\n }\n}\nexport default Resource;","/**\n * @module meteoJS/modelviewer/resource/image\n */\nimport Resource from '../Resource.js';\n\n/**\n * Options for constructor.\n * \n * @typedef {module:meteoJS/modelviewer/resource~options}\n * module:meteoJS/modelviewer/resource/image~options\n * @param {string} [url] - URL to the Image.\n */\n\n/**\n * @classdesc Class to describe an image resource.\n */\nexport class Image extends Resource {\n \n /**\n * @param {module:meteoJS/modelviewer/resource/image~options} [options]\n * Options.\n */\n constructor({ variables = [],\n datetime = undefined,\n run = undefined,\n offset = undefined,\n url = undefined /*, mimetype, ...*/ } = {}) {\n super({\n variables,\n datetime,\n run,\n offset\n });\n \n /**\n * @type string\n * @private\n */\n this._url = url;\n }\n \n /**\n * URL to the Image.\n * \n * @type string\n */\n get url() {\n return this._url;\n }\n}\nexport default Image;","/**\n * @module meteoJS/sounding/parcel\n */\nimport Unique from '../base/Unique.js';\n\n/**\n * Options for the constructor.\n * \n * @typedef {Object} module:meteoJS/sounding/parcel~options\n * @param {undefined|number} [pres=undefined]\n * Parcel beginning pressure (mb).\n * @param {undefined|number} [tmpc=undefined]\n * Parcel beginning temperature (C).\n * @param {undefined|number} [dwpc=undefined]\n * Parcel beginning dewpoint (C).\n * @param {undefined|number} [ptrace=undefined]\n * Parcel trace pressure (mb).\n * @param {undefined|number} [ttrace=undefined]\n * Parcel trace temperature (C).\n * @param {undefined|number} [blayer=undefined]\n * Pressure of the bottom of the layer the parcel is lifted (mb).\n * @param {undefined|number} [tlayer=undefined]\n * Pressure of the top of the layer the parcel is lifted (mb).\n * @param {undefined|number} [lclpres=undefined]\n * Parcel LCL (lifted condensation level) pressure (mb).\n * @param {undefined|number} [lclhght=undefined]\n * Parcel LCL height (m AGL).\n * @param {undefined|number} [lfcpres=undefined]\n * Parcel LFC (level of free convection) pressure (mb).\n * @param {undefined|number} [lfchght=undefined]\n * Parcel LFC height (m AGL).\n * @param {undefined|number} [elpres=undefined]\n * Parcel EL (equilibrium level) pressure (mb).\n * @param {undefined|number} [elhght=undefined]\n * Parcel EL height (m AGL).\n * @param {undefined|number} [mplpres=undefined]\n * Maximum Parcel Level (mb).\n * @param {undefined|number} [mplhght=undefined]\n * Maximum Parcel Level (m AGL).\n * @param {undefined|number} [bplus=undefined]\n * Parcel CAPE (J/kg).\n * @param {undefined|number} [bminus=undefined]\n * Parcel CIN (J/kg).\n * @param {undefined|number} [bfzl=undefined]\n * Parcel CAPE up to freezing level (J/kg).\n * @param {undefined|number} [b3km=undefined]\n * Parcel CAPE up to 3 km (J/kg).\n * @param {undefined|number} [b6km=undefined]\n * Parcel CAPE up to 6 km (J/kg).\n * @param {undefined|number} [p0c=undefined]\n * Pressure value at 0 C (mb).\n * @param {undefined|number} [pm10c=undefined]\n * Pressure value at -10 C (mb).\n * @param {undefined|number} [pm20c=undefined]\n * Pressure value at -20 C (mb).\n * @param {undefined|number} [pm30c=undefined]\n * Pressure value at -30 C (mb).\n * @param {undefined|number} [hght0c=undefined]\n * Height value at 0 C (m AGL).\n * @param {undefined|number} [hghtm10c=undefined]\n * Height value at -10 C (m AGL).\n * @param {undefined|number} [hghtm20c=undefined]\n * Height value at -20 C (m AGL).\n * @param {undefined|number} [hghtm30c=undefined]\n * Height value at -30 C (m AGL).\n * @param {undefined|number} [wm10c=undefined]\n * Wet bulb velocity at -10 C.\n * @param {undefined|number} [wm20c=undefined]\n * Wet bulb velocity at -20 C.\n * @param {undefined|number} [wm30c=undefined]\n * Wet bulb at -30 C.\n * @param {undefined|number} [li5=undefined]\n * Lifted Index at 500 mb (C).\n * @param {undefined|number} [li3=undefined]\n * Lifted Index at 300 mb (C).\n * @param {undefined|number} [brnshear=undefined]\n * Bulk Richardson Number Shear.\n * @param {undefined|number} [brnu=undefined]\n * Bulk Richardson Number U (kts).\n * @param {undefined|number} [brnv=undefined]\n * Bulk Richardson Number V (kts).\n * @param {undefined|number} [brn=undefined]\n * Bulk Richardson Number (unitless).\n * @param {undefined|number} [limax=undefined]\n * Maximum Lifted Index (C).\n * @param {undefined|number} [limaxpres=undefined]\n * Pressure at Maximum Lifted Index (mb).\n * @param {undefined|number} [cap=undefined]\n * Cap Strength (C).\n * @param {undefined|number} [cappres=undefined]\n * Cap strength pressure (mb).\n * @param {undefined|number} [bmin=undefined]\n * Buoyancy minimum in profile (C).\n * @param {undefined|number} [bminpres=undefined]\n * Buoyancy minimum pressure (mb).\n */\n\n/**\n * Class representing a parcel lifting.\n * \n * @extends module:meteoJS/base/unique.Unique\n */\nexport class Parcel extends Unique {\n \n /**\n * @param {module:meteoJS/sounding/parcel~options} [options] - Options.\n */\n constructor({\n id = undefined,\n pres = undefined,\n tmpc = undefined,\n dwpc = undefined,\n ptrace = undefined,\n ttrace = undefined,\n blayer = undefined,\n tlayer = undefined,\n lclpres = undefined,\n lclhght = undefined,\n lfcpres = undefined,\n lfchght = undefined,\n elpres = undefined,\n elhght = undefined,\n mplpres = undefined,\n mplhght = undefined,\n bplus = undefined,\n bminus = undefined,\n bfzl = undefined,\n b3km = undefined,\n b6km = undefined,\n p0c = undefined,\n pm10c = undefined,\n pm20c = undefined,\n pm30c = undefined,\n hght0c = undefined,\n hghtm10c = undefined,\n hghtm20c = undefined,\n hghtm30c = undefined,\n wm10c = undefined,\n wm20c = undefined,\n wm30c = undefined,\n li5 = undefined,\n li3 = undefined,\n brnshear = undefined,\n brnu = undefined,\n brnv = undefined,\n limax = undefined,\n limaxpres = undefined,\n cap = undefined,\n cappres = undefined,\n bmin = undefined,\n bminpres = undefined\n } = {}) {\n super({ id });\n \n /**\n * @type undefined|number\n * @public\n */\n this.pres = pres;\n \n /**\n * @type undefined|number\n * @public\n */\n this.tmpc = tmpc;\n \n /**\n * @type undefined|number\n * @public\n */\n this.dwpc = dwpc;\n \n /**\n * @type undefined|number\n * @public\n */\n this.ptrace = ptrace;\n \n /**\n * @type undefined|number\n * @public\n */\n this.ttrace = ttrace;\n \n /**\n * @type undefined|number\n * @public\n */\n this.blayer = blayer;\n \n /**\n * @type undefined|number\n * @public\n */\n this.tlayer = tlayer;\n \n /**\n * @type undefined|number\n * @public\n */\n this.lclpres = lclpres;\n \n /**\n * @type undefined|number\n * @public\n */\n this.lclhght = lclhght;\n \n /**\n * @type undefined|number\n * @public\n */\n this.lfcpres = lfcpres;\n \n /**\n * @type undefined|number\n * @public\n */\n this.lfchght = lfchght;\n \n /**\n * @type undefined|number\n * @public\n */\n this.elpres = elpres;\n \n /**\n * @type undefined|number\n * @public\n */\n this.elhght = elhght;\n \n /**\n * @type undefined|number\n * @public\n */\n this.mplpres = mplpres;\n \n /**\n * @type undefined|number\n * @public\n */\n this.mplhght = mplhght;\n \n /**\n * @type undefined|number\n * @public\n */\n this.bplus = bplus;\n \n /**\n * @type undefined|number\n * @public\n */\n this.bminus = bminus;\n \n /**\n * @type undefined|number\n * @public\n */\n this.bfzl = bfzl;\n \n /**\n * @type undefined|number\n * @public\n */\n this.b3km = b3km;\n \n /**\n * @type undefined|number\n * @public\n */\n this.b6km = b6km;\n \n /**\n * @type undefined|number\n * @public\n */\n this.p0c = p0c;\n \n /**\n * @type undefined|number\n * @public\n */\n this.pm10c = pm10c;\n \n /**\n * @type undefined|number\n * @public\n */\n this.pm20c = pm20c;\n \n /**\n * @type undefined|number\n * @public\n */\n this.pm30c = pm30c;\n \n /**\n * @type undefined|number\n * @public\n */\n this.hght0c = hght0c;\n \n /**\n * @type undefined|number\n * @public\n */\n this.hghtm10c = hghtm10c;\n \n /**\n * @type undefined|number\n * @public\n */\n this.hghtm20c = hghtm20c;\n \n /**\n * @type undefined|number\n * @public\n */\n this.hghtm30c = hghtm30c;\n \n /**\n * @type undefined|number\n * @public\n */\n this.wm10c = wm10c;\n \n /**\n * @type undefined|number\n * @public\n */\n this.wm20c = wm20c;\n \n /**\n * @type undefined|number\n * @public\n */\n this.wm30c = wm30c;\n \n /**\n * @type undefined|number\n * @public\n */\n this.li5 = li5;\n \n /**\n * @type undefined|number\n * @public\n */\n this.li3 = li3;\n \n /**\n * @type undefined|number\n * @public\n */\n this.brnshear = brnshear;\n \n /**\n * @type undefined|number\n * @public\n */\n this.brnu = brnu;\n \n /**\n * @type undefined|number\n * @public\n */\n this.brnv = brnv;\n \n /**\n * @type undefined|number\n * @public\n */\n this.limax = limax;\n \n /**\n * @type undefined|number\n * @public\n */\n this.limaxpres = limaxpres;\n \n /**\n * @type undefined|number\n * @public\n */\n this.cap = cap;\n \n /**\n * @type undefined|number\n * @public\n */\n this.cappres = cappres;\n \n /**\n * @type undefined|number\n * @public\n */\n this.bmin = bmin;\n \n /**\n * @type undefined|number\n * @public\n */\n this.bminpres = bminpres;\n }\n}\nexport default Parcel;","/**\n * @module meteoJS/sounding\n */\nimport { altitudeISAByPres,\n potentialTempByTempAndPres,\n equiPotentialTempByTempAndDewpointAndPres,\n dewpointByHMRAndPres } from './calc.js';\nimport Collection from './base/Collection.js';\nimport Parcel from './sounding/Parcel.js';\n\n/**\n * Data for a sounding level.\n * Nomenclature is analogue to the SHARPpy project (sharppy/sharptab/profile.py)\n * Exception for some units:\n * * Windspeed always in m/s\n * * Temperature in Kelvin\n * * Relative humidity unitless\n * \n * @typedef {Object} module:meteoJS/sounding~levelData\n * @param {float} pres Pressure level [hPa].\n * @param {float|undefined} [hght] Altitude above sealevel [m].\n * @param {float|undefined} [tmpk] Temperature [K].\n * @param {float|undefined} [dwpk] Dewpoint-temperature [K].\n * @param {float|undefined} [wdir] Wind direction [°].\n * @param {float|undefined} [wspd] Absolute windspeed [m/s].\n * @param {float|undefined} [u] Windspeed in U-direction [m/s].\n * @param {float|undefined} [v] Windspeed in V-direction [m/s].\n * @param {float|undefined} [relh] Relative humidity [].\n * @param {float|undefined} [mixr] Mixing ration [g/kg].\n * @param {float|undefined} [theta] Isentropic temperature [K].\n * @param {float|undefined} [thetae] Equivalent isentropic temperature [K].\n * @param {float|undefined} [wetbulb] Wetbulb isentropic temperature [K].\n * @param {float|undefined} [vtmp] Virtual temperature [K].\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {Object} module:meteoJS/sounding~options\n * @param {boolean} [calcMissing] - Calculate missing data in each level.\n */\n\n/**\n * Class represents an atmospheric (radio-)sounding.\n */\nexport class Sounding {\n \n /**\n * @param {module:meteoJS/sounding~options} [options] - Options.\n */\n constructor({\n calcMissing = false,\n parcels = []\n } = {}) {\n this.options = {\n calcMissing\n };\n this.levels = {};\n \n /**\n * @type module:meteoJS/base/collection.Collection\n * @private\n */\n this._parcelCollection = new Collection({\n fireAddRemoveOnReplace: true,\n fireReplace: false,\n emptyObjectMaker: () => new Parcel()\n });\n this._parcelCollection.append(...parcels);\n }\n \n /**\n * @type module:meteoJS/base/collection.Collection\n * @public\n * @readonly\n */\n get parcelCollection() {\n return this._parcelCollection;\n }\n \n /**\n * Adds/replaces sounding data.\n * \n * @param {module:meteoJS/sounding~levelData[]} levelsData\n * Array with data at different levels.\n * @param {module:meteoJS/sounding~options} [options] - Options.\n * @returns {module:meteoJS/sounding.Sounding} This.\n */\n addLevels(levelsData, options) {\n levelsData.forEach(function (levelData) {\n this.addLevel(levelData, options);\n }, this);\n return this;\n }\n\n /**\n * Adds/replaces Data for a certain level.\n * \n * @param {module:meteoJS/sounding~levelData} levelData - Data to add.\n * @param {module:meteoJS/sounding~options} [options] - Options.\n * @returns {module:meteoJS/sounding.Sounding} This.\n */\n addLevel(levelData, { calcMissing } = {}) {\n calcMissing = calcMissing ? calcMissing : this.options.calcMissing;\n if ('pres' in levelData &&\n levelData.pres !== undefined) {\n if (calcMissing)\n levelData = this.calculateMissingData(levelData);\n this.levels[levelData.pres] = levelData;\n }\n return this;\n }\n\n /**\n * Calculates different parameters, if missing.\n * \n * @param {module:meteoJS/sounding~levelData} d - Data.\n * @returns {module:meteoJS/sounding~levelData} Adjusted data.\n */\n calculateMissingData({ pres, hght,\n u, v, wdir, wspd,\n tmpk, dwpk,\n relh, mixr, theta, thetae, wetbulb, vtmp }) {\n let d = { pres, hght,\n u, v, wdir, wspd,\n tmpk, dwpk,\n relh, mixr, theta, thetae, wetbulb, vtmp };\n \n // Height\n if (d.hght === undefined)\n d.hght = altitudeISAByPres(d.pres);\n \n // Wind\n if (d.u === undefined &&\n d.v === undefined &&\n d.wdir !== undefined &&\n d.wspd !== undefined) {\n d.u = -d.wspd * Math.sin(d.wdir / 180 * Math.PI);\n d.v = -d.wspd * Math.cos(d.wdir / 180 * Math.PI);\n }\n else if (d.u !== undefined &&\n d.v !== undefined &&\n d.wdir === undefined &&\n d.wspd === undefined) {\n d.wspd = Math.sqrt(Math.pow(d.u, 2) + Math.pow(d.v, 2));\n d.wdir = 270 - (Math.atan2(d.v, d.u) / Math.PI * 180);\n }\n \n // Humidity\n if (d.tmpk !== undefined &&\n d.dwpk !== undefined) {\n //if (d.relh === undefined)\n // meteoJS.calc.;\n //if (d.mixr === undefined)\n // d.mixr = meteoJS.calc;\n if (d.theta === undefined)\n d.theta = potentialTempByTempAndPres(d.tmpk, d.pres);\n if (d.thetae === undefined)\n d.thetae =\n equiPotentialTempByTempAndDewpointAndPres(d.tmpk, d.dwpk, d.pres);\n }\n else if (d.mixr !== undefined) {\n if (d.dwpk === undefined)\n d.dwpk = dewpointByHMRAndPres(d.mixr, d.pres);\n }\n \n return d;\n }\n\n /**\n * Removes the Data for a certain level (if existing).\n * \n * @param {float} pres - Remove the data at this Level [hPa].\n * @returns {module:meteoJS/sounding.Sounding} this.\n */\n removeLevel(pres) {\n if (pres in this.levels)\n delete this.levels[pres];\n return this;\n }\n\n /**\n * Get the data for a specific level. Returns the levelData as passed to the\n * constructor or addLevel.\n * \n * @param {float} pres - Level [hPa].\n * @returns {module:meteoJS/sounding~levelData|undefined}\n * Data at a level, undefined if no data available.\n */\n getData(pres) {\n return (pres in this.levels) ? \n this.levels[pres] :\n {\n pres: undefined,\n hght: undefined,\n tmpk: undefined,\n dwpk: undefined,\n wdir: undefined,\n wspd: undefined,\n u: undefined,\n v: undefined,\n relh: undefined,\n mixr: undefined,\n theta: undefined,\n thetae: undefined,\n wetbulb: undefined,\n vtmp: undefined\n };\n }\n\n /**\n * Get data for all defined levels. Upward sorted.\n * \n * @returns {module:meteoJS/sounding~levelData[]} Array of all the data.\n */\n getLevels() {\n return Object\n .keys(this.levels)\n .map(function (pres) { return +pres; })\n .sort(function (a,b) { return a-b; });\n }\n\n /**\n * Get nearest level [hPa] with data.\n * \n * @param {float} pres Pressure [hPa].\n * @returns {float|undefined} Level with data or undefined. [hPa]\n */\n getNearestLevel(pres) {\n if (Object.keys(this.levels).length < 1)\n return undefined;\n return Object\n .keys(this.levels)\n .sort(function (levelA, levelB) {\n return Math.abs(levelA-pres) - Math.abs(levelB-pres);\n }).shift();\n }\n}\nexport default Sounding;","/**\n * @module meteoJS/modelviewer/resource/sounding\n */\nimport Resource from '../Resource.js';\nimport SoundingData from '../../Sounding.js';\n\n/**\n * Options for constructor.\n * \n * @typedef {module:meteoJS/modelviewer/resource~options}\n * module:meteoJS/modelviewer/resource/sounding~options\n * @param {module:meteoJS/sounding.Sounding} [sounding] - Sounding data.\n */\n\n/**\n * @classdesc Class to describe an sounding resource.\n */\nexport class Sounding extends Resource {\n \n /**\n * @param {module:meteoJS/modelviewer/resource/sounding~options} [options]\n * Options.\n */\n constructor({ variables = [],\n datetime = undefined,\n run = undefined,\n offset = undefined,\n sounding = undefined } = {}) {\n super({\n variables,\n datetime,\n run,\n offset\n });\n \n /**\n * @type undefined|module:meteoJS/sounding.Sounding\n * @private\n */\n this._sounding = sounding;\n }\n \n /**\n * Sounding data.\n * \n * @type module:meteoJS/sounding.Sounding\n */\n get sounding() {\n return (this._sounding === undefined) ? new SoundingData() : this._sounding;\n }\n set sounding(sounding) {\n this._sounding = sounding;\n }\n}\nexport default Sounding;","/**\n * @module meteoJS/modelviewer/resources\n */\nimport addEventFunctions from '../Events.js';\nimport Image from './resource/Image.js';\nimport VariableCollection from './VariableCollection.js';\nimport Node from './Node.js';\n\n/**\n * Triggered on adding and removing Resource-Objects.\n * \n * @event module:meteoJS/modelviewer/resources#change:resources\n * @type {Object}\n * @property {module:meteoJS/modelviewer/resource.Resource} [addedResources] -\n * Added resources.\n * @property {module:meteoJS/modelviewer/resource.Resource} [removedResources] -\n * Removed resources.\n */\n\n/**\n * Options for constructor.\n * \n * @typedef {Object} module:meteoJS/modelviewer/resources~options\n * @param {module:meteoJS/modelviewer/node.Node} topNode - Top level node.\n * @param {Set<module:meteoJS/modelviewer/variableCollection.VariableCollection>}\n * timesVariableCollections - These collections group the top part of the\n * hierarchy. For NWP, this contains typically the model and the run\n * collection.\n */\n\n/**\n * @classdesc Linchpin of the modelviewer. In this class every available\n * resource is registered. Additionally requests about data per Variable can\n * be performed, like all available run times of a model or all available\n * fields of model, etc. The hierarchy via\n * {@link module:meteoJS/modelviewer/node.Node|Node}\n * has to be defined before the construction of Resources.\n * \n * @fires module:meteoJS/modelviewer/resources#change:resources\n */\nexport class Resources {\n \n constructor({ topNode,\n timesVariableCollections = [] } = {}) {\n \n /**\n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection\n * @private\n */\n this._topNode = topNode;\n \n /**\n * @type Map<module:meteoJS/modelviewer/node.Node,\n * Set<module:meteoJS/modelviewer/variable.Variable>>\n * @private\n */\n this._availableVariablesMap = new Map();\n \n /**\n * @type Set<module:meteoJS/modelviewer/variableCollection.VariableCollection>\n * @private\n */\n this._timesVariableCollections = timesVariableCollections;\n }\n \n /**\n * VariableCollectionNode that stand on the top of the hierarchy.\n * \n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection\n * @readonly\n */\n get topNode() {\n return this._topNode;\n }\n \n /**\n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection[]\n * @readonly\n */\n get variableCollections() {\n let pushChildCollections;\n pushChildCollections = node => {\n node.children.forEach(n => {\n result.push(n.variableCollection);\n pushChildCollections(n);\n });\n };\n let result = [this.topNode.variableCollection];\n pushChildCollections(this.topNode);\n return result;\n }\n \n /**\n * Map of nodes and their variables (contained in the variableCollection of\n * the node). For each variable exists at least one resource in this\n * Resources-object that is defined by this variable.\n * \n * @type Map<module:meteoJS/modelviewer/node.Node,\n * Set<module:meteoJS/modelviewer/variable.Variable>>\n * @readonly\n */\n get availableVariablesMap() {\n return this._availableVariablesMap;\n }\n \n /**\n * Append resources.\n * \n * @param {...module:meteoJS/modelviewer/resource.Resource} resources\n * Available resources.\n * @returns {module:meteoJS/modelviewer/resources.Resources} This.\n * @fires module:meteoJS/modelviewer/resources#change:resources\n */\n append(...resources) {\n let addedResources = [];\n resources.forEach(resource => {\n let topNode = this._getTopNodeOfResourceDefinition(resource, this.topNode);\n if (topNode !== undefined) {\n let node = this._getTopMostChildWithAllVariables(new Set(resource.variables), topNode, true);\n if (node !== undefined) {\n let addedCount = node.append(resource);\n if (addedCount > 0) {\n addedResources.push(resource);\n this._addAvailableVariablesMapByResource(resource);\n }\n }\n }\n });\n if (addedResources.length > 0) {\n // Debounce firing\n if (INTERNAL_CHANGE_RESOURCES.timeoutId)\n clearTimeout(INTERNAL_CHANGE_RESOURCES.timeoutId);\n INTERNAL_CHANGE_RESOURCES.addedResources.push(...addedResources);\n INTERNAL_CHANGE_RESOURCES.timeoutId = setTimeout(() => {\n this.trigger('change:resources', {\n addedResources: INTERNAL_CHANGE_RESOURCES.addedResources\n });\n INTERNAL_CHANGE_RESOURCES.addedResources = [];\n }, 100);\n }\n return this;\n }\n \n /**\n * Adds variables of a resource to _availableVariablesMap.\n * \n * @param {module:meteoJS/modelviewer/resource.Resource} resource - Resource.\n * @private\n */\n _addAvailableVariablesMapByResource(resource) {\n resource.variables.forEach(variable => {\n if (variable.variableCollection.node === undefined)\n return;\n if (!this._availableVariablesMap.has(variable.variableCollection.node))\n this._availableVariablesMap.set(variable.variableCollection.node, new Set());\n this._availableVariablesMap.get(variable.variableCollection.node).add(variable);\n });\n }\n \n /**\n * Removes resources.\n * \n * @param {...module:meteoJS/modelviewer/resource.Resource} resources\n * Resources.\n * @returns {module:meteoJS/modelviewer/resources.Resources} This.\n * @fires module:meteoJS/modelviewer/resources#change:resources\n */\n remove(...resources) {\n let removedResources = [];\n let removedNodeResourcesMap = new Map();\n resources.forEach(resource => {\n let topNode = this._getTopNodeOfResourceDefinition(resource, this.topNode);\n if (topNode !== undefined) {\n let node = this._getTopMostChildWithAllVariables(new Set(resource.variables), topNode, true);\n if (node !== undefined) {\n let removedCount = node.remove(resource);\n if (removedCount > 0) {\n removedResources.push(resource);\n if (!removedNodeResourcesMap.has(node))\n removedNodeResourcesMap.set(node, new Set());\n removedNodeResourcesMap.get(node).add(resource);\n }\n }\n }\n });\n if (removedNodeResourcesMap.size > 0)\n this._removeAvailableVariablesMapByResources(removedNodeResourcesMap);\n if (removedResources.length > 0)\n this.trigger('change:resources', { removedResources });\n return this;\n }\n \n /**\n * Removes variables from _availableVariablesMap.\n * Prerequisite: The resources have already to be removed of the nodes.\n * \n * @param {Map<module:meteoJS/modelviewer/node.Node,\n * Set<module:meteoJS/modelviewer/resource.Resource>>}\n * removedNodeResourcesMap - Map of Nodes with their removed Resources.\n * @private\n */\n _removeAvailableVariablesMapByResources(removedNodeResourcesMap) {\n let fullCheckVariables = new Set();\n for (let [node, resourcesSet] of removedNodeResourcesMap.entries()) {\n let variables = new Set();\n for (let resource of resourcesSet)\n resource.variables.forEach(variable => variables.add(variable));\n for (let variable of variables)\n if (!node.hasResourcesByVariables(variable))\n fullCheckVariables.add(variable);\n }\n for (let variable of fullCheckVariables) {\n let node = this.getNodeByVariableCollection(variable.variableCollection);\n if (!this._hasResourcesOfNodeChildren(node, [ variable ]))\n if (this._availableVariablesMap.has(node))\n this._availableVariablesMap.get(node).delete(variable);\n }\n }\n \n /**\n * Returns a node of the hierarchy, so that all parents and itself contain\n * all the passed variables. The returned node is the most top in hierarchy\n * as possible. If no node is found, an empty node object is returned.\n * \n * @param {...module:meteoJS/modelviewer/variable.Variable} variables\n * Variables.\n * @returns {module:meteoJS/modelviewer/node.Node} - Node.\n */\n getTopMostNodeWithAllVariables(...variables) {\n let result =\n this._getTopMostChildWithAllVariables(new Set(variables), this.topNode, true);\n return (result === undefined) ? new Node(new VariableCollection()) : result;\n }\n \n /**\n * Returns first node in hierarchy that contains a VariableCollection which\n * is part of the definition of the passed resource.\n * \n * @param {module:meteoJS/modelviewer/resource.Resource} resource\n * Resource.\n * @param {module:meteoJS/modelviewer/node.Node} node\n * Search from 'node' and all the children.\n * @returns {undefined|module:meteoJS/modelviewer/node.Node}\n * Node or undefined if no node is found.\n * @private\n */\n _getTopNodeOfResourceDefinition(resource, node) {\n if (resource.isDefinedByVariableOf(node.variableCollection))\n return node;\n let result = undefined;\n node.children.forEach(childNode => {\n if (result !== undefined)\n result = this._getTopNodeOfResourceDefinition(resource, childNode);\n });\n return result;\n }\n \n /**\n * Returns top most node for which on the way down (beginning from node)\n * all variables are contained by the VariableCollections of the travelled\n * nodes.\n * \n * @param {Set<module:meteoJS/modelviewer/variable.Variable>} variables\n * Variables which have still to be found.\n * @param {module:meteoJS/modelviewer/node.Node} node - Node.\n * @param {boolean} bubbleDown - .\n * @returns {undefined|module:meteoJS/modelviewer/node.Node} Child node.\n */\n _getTopMostChildWithAllVariables(variables, node, bubbleDown) {\n let isVariableContained = false;\n node.variableCollection.variables.forEach(variable => {\n if (variables.has(variable)) {\n isVariableContained = true;\n variables.delete(variable);\n }\n });\n if (variables.size == 0)\n return node;\n else if (node.children.length == 0)\n return undefined;\n else if (!isVariableContained &&\n !bubbleDown)\n return undefined;\n let result = undefined;\n node.children.forEach(childNode => {\n if (result === undefined)\n result = this._getTopMostChildWithAllVariables(variables, childNode, bubbleDown);\n });\n return result;\n }\n \n /**\n * Returns node which contains the passed variableCollection\n * \n * @param {module:meteoJS/modelviewer/variableCollection.VariableCollection}\n * variableCollection\n * VariableCollection.\n * @returns {module:meteoJS/modelviewer/node.Node} Node.\n */\n getNodeByVariableCollection(variableCollection) {\n return (variableCollection.node === undefined)\n ? new Node(new VariableCollection())\n : variableCollection.node;\n }\n \n /**\n * Returns node which contains the variableCollection with the passed Id.\n * \n * @param {mixed} id - Id.\n * @returns {module:meteoJS/modelviewer/node.Node} Node.\n */\n getNodeByVariableCollectionId(id) {\n let result = this._getNodeByVariableCollection(a => id == a.id);\n return (result === undefined) ? new Node(new VariableCollection()) : result;\n }\n \n /**\n * Returns node which contains the passed variableCollection.\n * \n * @param {Function} compareFunc - Argument is a VariableCollection-object.\n * @returns {undefined|module:meteoJS/modelviewer/node.Node} Node.\n * @private\n */\n _getNodeByVariableCollection(compareFunc) {\n return (compareFunc(this.topNode.variableCollection))\n ? this.topNode\n : this._findChildNodeByVariableCollection(compareFunc, this.topNode);\n }\n \n /**\n * Returns a VariableCollection with passed variableCollection of\n * node's children.\n * \n * @param {Function} compareFunc - Argument is a VariableCollection-object.\n * @param {module:meteoJS/modelviewer/node.Node} parentNode\n * Search recursively in this node's children.\n * @returns {undefined|module:meteoJS/modelviewer/node.Node} Node.\n * @private\n */\n _findChildNodeByVariableCollection(compareFunc, parentNode) {\n let result;\n parentNode.children.forEach(n => {\n if (result === undefined &&\n compareFunc(n.variableCollection)) {\n result = n;\n return;\n }\n if (result === undefined &&\n n.children.length > 0)\n result = this._findChildNodeByVariableCollection(compareFunc, n);\n });\n return result;\n }\n \n /**\n * Appends an Image-resource. Alias for append(new Image(…)).\n * \n * @see module:meteoJS/modelviewer/resource/image.Image\n * @returns {module:meteoJS/modelviewer/resources.Resources} This.\n */\n appendImage({ variables, datetime, run, offset, url }) {\n this.append(new Image({\n variables,\n datetime,\n run,\n offset,\n url\n }));\n return this;\n }\n \n /**\n * Returns the {@link module:meteoJS/modelviewer/variable.Variable|Variable}-Objects\n * from the {@link module:meteoJS/modelviewer/variableCollection.VariableCollection|collection}\n * with content. With this method\n * you can deactive for example the other variables, so the user can't select\n * a variable with no resource.\n * \n * This means the method returns a subset from the passed collection. For\n * these Variable-Objects at least one resource is available (in the\n * {@link meteoJS/modelviewer/variableCollection.VariableCollection#node|node}\n * of the collection or one of its children). The resources are defined by\n * on of these Variable-Objects. If you pass 'variables', you can\n * additionally constrain the returned variables. E.g. you look for all\n * run's with resources of a model, you pass the model's Variable-Object.\n * \n * @param {module:meteoJS/modelviewer/variableCollection.VariableCollection}\n * variableCollection\n * Return Variables of this VariableCollection.\n * @param {Object} options - Options.\n * @param {module:meteoJS/modelviewer/variable.Variable[]} [options.variables]\n * Only \n * @returns {Set<module:meteoJS/modelviewer/variable.Variable>}\n * Available variables.\n */\n getAvailableVariables(variableCollection, { variables = [] } = {}) {\n const result = new Set();\n const _checkVariableInNode = (variable, node) => {\n if (node.resources.length > 0) {\n for (const resource of node.resources) {\n if (resource.isDefinedBy(false, variable, ...variables)) {\n result.add(variable);\n return true;\n }\n }\n return false;\n }\n for (const n of node.children) {\n if (_checkVariableInNode(variable, n))\n return true;\n }\n return false;\n };\n Array.from(variableCollection).forEach(variable => {\n _checkVariableInNode(variable, variableCollection.node);\n });\n return result;\n }\n \n /**\n * Traverses all child nodes of the passed node and looks for a resource\n * that is defined by all of the passed variables. If one child node contains\n * such a resource, true is returned.\n * \n * @param {module:meteoJS/modelviewer/node.Node} node - Node.\n * @param {module:meteoJS/modelviewer/variable.Variable[]} variables\n * Look for resources defined by these variables.\n * @param {Set} [traversedNode] - Internal Set.\n * @returns {Boolean} A resource is contained in the child nodes.\n * @private\n */\n _hasResourcesOfNodeChildren(node, variables, traversedNode = new Set()) {\n for (const n of node.children) {\n if (traversedNode.has(n))\n continue;\n traversedNode.add(n);\n if (n.hasResourcesByVariables(...variables))\n return true;\n if (this._hasResourcesOfNodeChildren(n, variables, traversedNode))\n return true;\n }\n }\n \n /**\n * Returns all times with at least one resource. The resources are defined\n * by the passed variable. If exact=true, then the resources are exactly\n * defined by the variables.\n * With NWP models, you could get all times from a model-run with at least\n * one resource when you pass the model and run variable object.\n * If you want to know all available times for a set of variables (e.g. all\n * available image-plots for the EU-region, from the temperature in a specific\n * level), then pass exact=true and all the variables.\n * \n * @param {Object} [options] - Options.\n * @param {module:meteoJS/modelviewer/variable.Variable[]} [options.variables]\n * Variables.\n * @param {boolean} [options.exact=false] - When true, only resources which\n * are exactly defined by the passed variables are taken into account.\n * @returns {Date[]} - Sorted upwardly.\n */\n getTimesByVariables({\n variables = [],\n exact = false\n } = {}) {\n const node = this._getTopMostChildWithAllVariables(\n new Set(variables),\n this.topNode,\n true);\n if (node === undefined)\n return [];\n \n const times = new Set();\n const collectTimes = node => {\n node.getResourcesByVariables(exact, ...variables).forEach(resource => {\n if (resource.datetime !== undefined)\n times.add(resource.datetime.valueOf());\n });\n node.children.forEach(n => collectTimes(n));\n };\n collectTimes(node);\n return [...times].sort().map(t => new Date(t));\n }\n}\naddEventFunctions(Resources.prototype);\nexport default Resources;\n\n/**\n * @private\n */\nconst INTERNAL_CHANGE_RESOURCES = {\n timeoutId: undefined,\n addedResources: []\n};\n","/**\n * @module meteoJS/modelviewer/nwpResources\n */\nimport Resources from './Resources.js';\nimport VariableCollection from './VariableCollection.js';\nimport Node from './Node.js';\nimport Variable from './Variable.js';\nimport TimeVariable from './TimeVariable.js';\n\n/**\n * @classdesc For usage of NWP (numerical weather prediction). This class is\n * designed to use the modelviewer for NWP.\n */\nexport class NWPResources extends Resources {\n \n constructor() {\n let collections = new Set();\n ['models', 'runs', 'regions', 'fields', 'levels', 'accumulations', 'thresholds']\n .forEach(id => collections.add(new VariableCollection({ id })));\n let nodes = {};\n for (let collection of collections)\n nodes[collection.id] = new Node(collection);\n // build hierarchy\n nodes.models.appendChild(nodes.runs);\n nodes.runs.appendChild(nodes.regions);\n nodes.regions.appendChild(nodes.fields);\n nodes.fields.appendChild(nodes.levels, nodes.accumulations);\n nodes.accumulations.appendChild(nodes.thresholds);\n \n super({\n topNode: nodes.models,\n timesVariableCollections: new Set([nodes.models.variableCollection, nodes.runs.variableCollection])\n });\n }\n \n /**\n * Creates a Variable-Object and adds it to the VariableCollection.\n * \n * @param {module:meteoJS/modelviewer/variableCollection.VariableCollection}\n * variableCollection - VariableCollection.\n * @param {Object} [options] - Variable options.\n * @param {mixed} [options.id] - Variable id.\n * @param {string} [options.name] - Default name.\n * @param {Object.<string,string>} [options.names] - Names.\n * @param {string[]} [options.langSortation] - Priority of language codes.\n * @param {Date|undefined} [option.sdatetime] - Datetime.\n * @returns {module:meteoJS/modelviewer/nwpResources.NWPResources} This.\n */\n addVariable(variableCollection,\n { id,\n name = undefined,\n names = {},\n langSortation = [],\n datetime = undefined } = {}) {\n let variable =\n (datetime === undefined)\n ? new Variable({\n id,\n name,\n names,\n langSortation\n })\n : new TimeVariable({\n id,\n name,\n names,\n langSortation,\n datetime\n });\n variableCollection.append(variable);\n return this;\n }\n \n /**\n * Collection of all defined models.\n * \n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection\n * @readonly\n */\n get models() {\n return this.getNodeByVariableCollectionId('models').variableCollection;\n }\n \n /**\n * Collection of all defined runs.\n * \n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection\n * @readonly\n */\n get runs() {\n return this.getNodeByVariableCollectionId('runs').variableCollection;\n }\n \n /**\n * Collection of all defined regions.\n * \n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection\n * @readonly\n */\n get regions() {\n return this.getNodeByVariableCollectionId('regions').variableCollection;\n }\n \n /**\n * Collection of all defined fields.\n * \n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection\n * @readonly\n */\n get fields() {\n return this.getNodeByVariableCollectionId('fields').variableCollection;\n }\n \n /**\n * Collection of all defined levels.\n * \n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection\n * @readonly\n */\n get levels() {\n return this.getNodeByVariableCollectionId('levels').variableCollection;\n }\n \n /**\n * Collection of all defined accumulations.\n * \n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection\n * @readonly\n */\n get accumulations() {\n return this.getNodeByVariableCollectionId('accumulations').variableCollection;\n }\n \n /**\n * Collection of all defined thresholds.\n * \n * @type module:meteoJS/modelviewer/variableCollection.VariableCollection\n * @readonly\n */\n get thresholds() {\n return this.getNodeByVariableCollectionId('thresholds').variableCollection;\n }\n}\nexport default NWPResources;","/**\n * @module meteoJS/modelviewer/display\n */\nimport $ from 'jquery';\nimport addEventFunctions from '../Events.js';\n\n/**\n * Display initalisation event.\n * \n * @event module:meteoJS/modelviewer/display#init:display\n */\n\n/**\n * VariableCollection add event. Also fired, once the object is assigned to\n * a Container object.\n * \n * @event module:meteoJS/modelviewer/display#add:variableCollection\n * @type {Object}\n * @property {module:meteoJS/modelviewer/variableCollection.VariableCollection}\n * variableCollection - The added variableCollection.\n */\n\n/**\n * Adding a variable to a variableCollection event. Also fired for each variable\n * in the available variableCollections, once the object is assigned to a\n * Container object.\n * \n * @event module:meteoJS/modelviewer/display#add:variable\n * @type {Object}\n * @property {module:meteoJS/modelviewer/variable.Variable} variable\n * The added variable.\n */\n\n/**\n * Change visible resource event.\n * \n * @event module:meteoJS/modelviewer/display#change:visibleResource\n * @type {Object}\n */\n\n/**\n * Options for constructor.\n * \n * @typedef {Object}\n * @param\n * {Iterable.<module:meteoJS/modelviewer/variableCollection.VariableCollection>}\n * [alwaysAvailableCollections]\n * Variables from these variableCollections are always available.\n */\n\n/**\n * @classdesc\n * \n * @fires module:meteoJS/modelviewer/display#init:display\n * @fires module:meteoJS/modelviewer/display#add:variableCollection\n * @fires module:meteoJS/modelviewer/display#add:variable\n * @fires module:meteoJS/modelviewer/display#change:visibleResource\n */\nexport class Display {\n \n /**\n * @param {module:meteoJS/modelviewer/display~options} [options] - Options.\n */\n constructor({\n alwaysAvailableCollections = []\n } = {}) {\n \n /**\n * @type Set<module:meteoJS/modelviewer/variableCollection.VariableCollection>\n * @private\n */\n this._alwaysAvailableCollections = new Set(alwaysAvailableCollections);\n \n /**\n * @type undefined|module:meteoJS/modelviewer.Modelviewer\n * @private\n */\n this._modelviewer = undefined;\n \n /**\n * @type undefined|module:meteoJS/modelviewer/container.Container\n * @private\n */\n this._container = undefined;\n \n /**\n * @type undefined|HTMLElement|jQuery\n * @private\n */\n this._parentNode = undefined;\n \n /**\n * @type undefined|HTMLElement|jQuery\n * @private\n */\n this._resourceNode = undefined;\n \n this._resourceOutput = {\n image: undefined,\n thermodynamicDiagram: undefined\n };\n }\n \n /**\n * @type undefined|module:meteoJS/modelviewer.Modelviewer\n * @package\n */\n get modelviewer() {\n return this._modelviewer;\n }\n set modelviewer(modelviewer) {\n this._modelviewer = modelviewer;\n if (this._modelviewer === undefined)\n return;\n \n this._modelviewer.resources.variableCollections.forEach(collection => {\n collection.on('add:variable', variable => {\n this.trigger('add:variable', { variable });\n });\n });\n }\n \n /**\n * @type undefined|module:meteoJS/modelviewer/container.Container\n * @package\n */\n get container() {\n return this._container;\n }\n set container(container) {\n this._container = container;\n if (this._container === undefined)\n return;\n \n this._container.on('change:visibleResource', () => {\n this._onChangeVisibleResource();\n });\n }\n \n /**\n * @type HTMLElement|jQuery\n * @package\n */\n get parentNode() {\n return this._parentNode;\n }\n set parentNode(parentNode) {\n this._parentNode = parentNode;\n this.onInit();\n }\n \n /**\n * @type undefined|HTMLElement|jQuery\n * @package\n */\n get resourceNode() {\n return this._resourceNode;\n }\n set resourceNode(resourceNode) {\n this._resourceNode = resourceNode;\n this._onChangeVisibleResource();\n }\n \n /**\n * Re-Render this display.\n */\n render() {\n this.onInit();\n this.onChangeVisibleResource();\n }\n \n /**\n * @private\n */\n onInit() {\n if (this.parentNode === undefined)\n return;\n \n $(this.parentNode).empty();\n this.trigger('init:display');\n if (this._modelviewer === undefined)\n return;\n \n this._modelviewer.resources.variableCollections\n .forEach(variableCollection => {\n this.trigger('add:variableCollection', { variableCollection });\n for (let variable of variableCollection)\n this.trigger('add:variable', { variable });\n });\n }\n\n /**\n * Returns a subset of variables of the passed VariableCollection object. For\n * all of the returned variables, there exists at least one resource. Theses\n * resources are defined by this variable and the selected variables of the\n * parent node.\n * This method isn't enough performant to be executed in loops or recursive\n * functions.\n * \n * @param {Object} options - Options.\n * @param {module:meteoJS/modelviewer/variableCollection.VariableCollection}\n * options.variableCollection - VariableCollection object.\n * @returns {Set<module:meteoJS/modelviewer/variable.Variable>}\n * Available variables.\n * @public\n */\n getAvailableVariables({ variableCollection }) {\n const variables = this._getParentsVariables(variableCollection.node);\n return this._modelviewer.resources\n .getAvailableVariables(variableCollection, { variables });\n }\n \n /**\n * @private\n */\n _getParentsVariables(node, traversedNodes = new Set()) {\n let result = new Set();\n node.parents.forEach(parentNode => {\n if (traversedNodes.has(parentNode))\n return;\n traversedNodes.add(parentNode);\n Array.from(parentNode.variableCollection).forEach(variable => {\n if (this._container.selectedVariables.has(variable))\n result.add(variable);\n });\n const parentResult = this._getParentsVariables(parentNode, traversedNodes);\n if (parentResult.size > 0)\n result = new Set([...result, ...parentResult]);\n });\n return result;\n }\n \n /**\n * @private\n */\n _onChangeVisibleResource() {\n if (this._resourceNode === undefined) {\n this.trigger('change:visibleResource');\n return;\n }\n if (this._container === undefined)\n return;\n \n let visibleResource = this._container.visibleResource;\n if ('url' in visibleResource) {\n if (this.thermodynamicDiagram !== undefined) {\n this.thermodynamicDiagram = undefined;\n $(this._resourceNode).empty();\n }\n if (this._resourceOutput.image === undefined) {\n $(this._resourceNode).empty();\n this._resourceOutput.image = $('<img>').css({ 'max-width': '100%' });\n $(this._resourceNode).append(this._resourceOutput.image);\n }\n this._resourceOutput.image.attr('src', visibleResource.url);\n }\n else if ('sounding' in visibleResource) {\n if (this._resourceOutput.image !== undefined) {\n this._resourceOutput.image = undefined;\n $(this._resourceNode).empty();\n }\n /*if (this._resourceOutput.thermodynamicDiagram === undefined)\n this._resourceOutput.thermodynamicDiagram = new ThermodynamicDiagram({\n renderTo: $(this._resourceNode)\n });*/\n let isAppended = false;\n this._resourceOutput.thermodynamicDiagram.soundings.forEach(sounding => {\n if (sounding.getSounding() === visibleResource.sounding) {\n isAppended = true;\n sounding.visible(true);\n }\n else\n sounding.visible(false);\n });\n if (!isAppended)\n this._resourceOutput.thermodynamicDiagram\n .addSounding(visibleResource.sounding);\n }\n else {\n if (this._resourceOutput.image !== undefined) {\n this._resourceOutput.image = undefined;\n $(this._resourceNode).empty();\n }\n if (this._resourceOutput.thermodynamicDiagram !== undefined)\n this._resourceOutput.thermodynamicDiagram.soundings\n .forEach(sounding => sounding.visible(false));\n }\n }\n}\naddEventFunctions(Display.prototype);\nexport default Display;","/**\n * @module meteoJS/modelviewer/container\n */\nimport Unique from '../base/Unique.js';\nimport addEventFunctions from '../Events.js';\nimport Resource from './Resource.js';\nimport Node from './Node.js';\nimport Display from './Display.js';\nimport Variable from './Variable.js';\nimport VariableCollection from './VariableCollection.js';\n\n/**\n * Triggered, when visible Resource changes.\n * \n * @event module:meteoJS/modelviewer/container#change:enabledResources\n * @type {Object}\n * @property {Object} options - Options.\n * @property {Map.<integer,module:meteoJS/modelviewer/resource.Resource>}\n * [options.enabledResources] - Enabled resources, selected by selectedVariables.\n */\n\n/**\n * Triggered, when visible Resource changes.\n * \n * @event module:meteoJS/modelviewer/container#change:visibleResource\n */\n\n/**\n * Triggered, when displayVariables is changed.\n * \n * @event module:meteoJS/modelviewer/container#change:displayVariables\n * @type {Object}\n * @property {Object} options - Options.\n * @property {Set.<module:meteoJS/modelviewer/variable.Variable>}\n * [options.addedVariables] - Added variables to displayVariables.\n * @property {Set.<module:meteoJS/modelviewer/variable.Variable>}\n * [options.removedVariables] - Removed variables to displayVariables.\n */\n\n/**\n * Triggered, when selectedVariables is changed.\n * \n * @event module:meteoJS/modelviewer/container#change:selectedVariables\n * @type {Object}\n * @property {Object} options - Options.\n * @property {Set.<module:meteoJS/modelviewer/variable.Variable>}\n * [options.addedVariables] - Added variables to selectedVariables.\n * @property {Set.<module:meteoJS/modelviewer/variable.Variable>}\n * [options.removedVariables] - Removed variables to selectedVariables.\n */\n\n/**\n * If a suitable resource is searched, this method will be called several times.\n * The first argument ist a list of variables. These variables are collected of\n * one hierarchy level, defined by the\n * {@link module:meteoJS/modelviewer/resources.Resources|resources object}.\n * The method returns an ordered list of these passed variables (or a subset).\n * For these variables, further down in the hierarchy, a possible resource is\n * searched. If one is found, this variable will be used for selectedVariables.\n * Method is only used if adaptSuitableResource is enabled. Default algorythm is\n * to return the list in the order of the Iterator.\n * \n * @typedef {Function} module:meteoJS/modelviewer/container~getPossibleVariables\n * @param {module:meteoJS/modelviewer/variable.Variable[]}\n * possibleSelectedVariables - Variables to return an ordered list.\n * @param {Set<module:meteoJS/modelviewer/variable.Variable>}\n * selectedVariables - Already selected variables so far, top-down in\n * hierarchy.\n * @returns {module:meteoJS/modelviewer/variable.Variable[]} - Ordered list.\n */\n\n/**\n * With the passed selectedVariables, the method determines if already a\n * suitable resource should be selected. If method returns true, the property\n * selectedVariables will be set by the passed Set.\n * Method used if adaptSuitableResource is enabled. Default algorythm is to\n * return true if the Node of the lastAddedVariable contains resources.\n * \n * @typedef {Function} module:meteoJS/modelviewer/container~isResourceSelected\n * @param {Set<module:meteoJS/modelviewer/variable.Variable>}\n * selectedVariables - Selected variables so far.\n * @param {undefined|module:meteoJS/modelviewer/variable.Variable}\n * lastAddedVariable - Last added variable to selectedVariables.\n * @returns {boolean} - True if a suitable resource should be selected with the\n * current state of selectedVariables.\n */\n\n/**\n * Options to adapt a suitable resource to display.\n * \n * @typedef {Object}\n * module:meteoJS/modelviewer/container~adaptSuitableResource\n * @param {boolean} enabled - Enabled adapt suitable resource.\n * @param {module:meteoJS/modelviewer/container~getPossibleVariables}\n * getPossibleVariables - Determines order of variables of a hierarchy level.\n * @param {module:meteoJS/modelviewer/container~isResourceSelected}\n * isResourceSelected - Is selectedVariables complete.\n */\n\n/**\n * Options for constructor.\n * \n * @typedef {module:meteoJS/base/unique~options}\n * module:meteoJS/modelviewer/container~options\n * @param {module:meteoJS/modelviewer/display.Display} [display]\n * Display object to output the container content to DOM.\n * @param {module:meteoJS/modelviewer/container~adaptSuitableResource}\n * [adaptSuitableResource] - Options for adapt suitable resource.\n */\n\n/**\n * This object represents a container, that displays one resource.\n * Via displayVariables the appropriate resource is chosen.\n * \n * @extends module:meteoJS/base/unique.Unique\n * @fires module:meteoJS/modelviewer/container#change:visibleResource\n * @fires module:meteoJS/modelviewer/container#change:enabledResources\n * @fires module:meteoJS/modelviewer/container#change:displayVariables\n * @fires module:meteoJS/modelviewer/container#change:selectedVariables\n */\nexport class Container extends Unique {\n\n /**\n * @param {module:meteoJS/modelviewer/container~options} [options] - Options.\n */\n constructor({\n id,\n display = undefined,\n adaptSuitableResource = {}\n } = {}) {\n super({\n id\n });\n \n /**\n * @type undefined|module:meteoJS/modelviewer/display.Display\n * @private\n */\n this._display = (display === undefined) ? new Display() : display;\n this._display.modelviewer = this.modelviewer;\n this._display.container = this;\n this._display.parentNode = this._containerNode;\n \n /**\n * @type module:meteoJS/modelviewer/container~adaptSuitableResource\n * @private\n */\n this._adaptSuitableResource = {};\n this._initAdaptSuitableResource(adaptSuitableResource);\n \n /**\n * @type undefined|module:meteoJS/modelviewer.Modelviewer\n * @private\n */\n this._modelviewer = undefined;\n \n /**\n * @type undefined|module:meteoJS/modelviewer/resource.Resource\n * @private\n */\n this._visibleResource;\n \n /**\n * @type Set<module:meteoJS/modelviewer/variable.Variable>\n * @private\n */\n this._displayVariables = new Set();\n \n /**\n * @type Map.<module:meteoJS/modelviewer/variableCollection.VariableCollection,module:meteoJS/modelviewer/variable.Variable>\n * @private\n */\n this._selectedVariables = new Map();\n \n /**\n * @type module:meteoJS/modelviewer/node.Node|undefined\n * @private\n */\n this._selectedNode = undefined;\n \n /**\n * @type Map<integer,module:meteoJS/modelviewer/resource.Resource>\n * @private\n */\n this._enabledResources = new Map();\n \n /**\n * @type undefined|external:HTMLElement\n * @private\n */\n this._containerNode = undefined;\n\n /**\n * Function to call change:selectedVariables debouncec.\n * \n * @type Function\n * @private\n */\n this._debouncedChangeSelectedVariables = (() => {\n let timeoutId;\n let totalAddedVariables = new Set();\n let totalRemovedVariables = new Set();\n return ({ addedVariables, removedVariables }) => {\n for (const v of addedVariables)\n if (totalRemovedVariables.has(v))\n totalRemovedVariables.delete(v);\n for (const v of removedVariables)\n if (totalAddedVariables.has(v))\n totalAddedVariables.delete(v);\n totalAddedVariables = new Set([...totalAddedVariables, ...addedVariables]);\n totalRemovedVariables = new Set([...totalRemovedVariables, ...removedVariables]);\n /*console.log([\n [...addedVariables].map(v => v.id),\n [...removedVariables].map(v => v.id),\n [...totalAddedVariables].map(v => v.id),\n [...totalRemovedVariables].map(v => v.id),\n ]);*/\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => {\n this.trigger('change:selectedVariables', {\n addedVariables: totalAddedVariables,\n removedVariables: totalRemovedVariables\n });\n totalAddedVariables.clear();\n totalRemovedVariables.clear();\n }, 300);\n };\n })();\n \n /**\n * @type Object<string,Object<string,mixed>>\n * @private\n */\n this._listeners = {\n mirror: [],\n timeline: {\n timeline: undefined,\n listenerKey: undefined\n },\n resources: {\n resources: undefined,\n listenerKey: undefined\n }\n };\n }\n \n /**\n * Display object to generate dom output.\n * \n * @type undefined|module:meteoJS/modelviewer/display.Display\n * @readonly\n */\n get display() {\n return this._display;\n }\n \n /**\n * This container belongs to this modelviewer object.\n * \n * @type undefined|module:meteoJS/modelviewer.Modelviewer\n * @package\n */\n get modelviewer() {\n return this._modelviewer;\n }\n set modelviewer(modelviewer) {\n this._modelviewer = modelviewer;\n if (this._modelviewer === undefined) {\n if (this._listeners.timeline.listenerKey !== undefined)\n this._listeners.timeline.timeline\n .un('change:time', this._listeners.timeline.listenerKey);\n if (this._listeners.resources.listenerKey !== undefined)\n this._listeners.resources.resources\n .un('change:resources', this._listeners.resources.listenerKey);\n return;\n }\n this._display.modelviewer = modelviewer;\n \n this._listeners.timeline.timeline = this._modelviewer.timeline;\n this._listeners.timeline.listenerKey = this._modelviewer.timeline\n .on('change:time', () => this._setVisibleResource());\n this._listeners.resources.resources = this._modelviewer.resources;\n this._listeners.resources.listenerKey = this._modelviewer.resources\n .on('change:resources', () => {\n this._setTimes();\n this._setEnabledResources();\n this._updateSelectedVariables();\n });\n this._setTimes();\n }\n \n /**\n * DOM node to append container's output.\n * \n * @type undefined|external:HTMLElement\n * @package\n */\n get containerNode() {\n return this._containerNode;\n }\n set containerNode(containerNode) {\n this._containerNode = containerNode;\n if (this._containerNode === undefined)\n return;\n this._display.parentNode = this._containerNode;\n }\n \n /**\n * Currently visible resource. Could be an empty resource.\n * \n * @type module:meteoJS/modelviewer/resource.Resource\n * @readonly\n */\n get visibleResource() {\n return (this._visibleResource === undefined) ?\n new Resource() : this._visibleResource;\n }\n \n /**\n * These variables define, which resource is displayed.\n * If adaptSuitableResource is not enabled, then the displayed resource is\n * exactly defined by these variables (and additionally the datetime selected\n * by the timeline object). If adaptSuitableResource is enabled, then a\n * resource is displayed, that matches the variables but can be defined by\n * additional variables.\n * Setter allows Set or Array. Getter returns always Set.\n * \n * @type Set<module:meteoJS/modelviewer/variable.Variable>\n */\n get displayVariables() {\n return this._displayVariables;\n }\n set displayVariables(variables) {\n let addedVariables = new Set();\n variables = new Set(variables);\n for (let variable of variables)\n if (!this._displayVariables.has(variable))\n addedVariables.add(variable);\n let removedVariables = new Set();\n for (let displayVariable of this.displayVariables)\n if (!variables.has(displayVariable))\n removedVariables.add(displayVariable);\n if (\n addedVariables.size > 0 ||\n removedVariables.size > 0\n ) {\n this._displayVariables = variables;\n this._updateSelectedVariables({\n addedVariables,\n removedVariables\n });\n this.trigger(\n 'change:displayVariables',\n { addedVariables, removedVariables }\n );\n }\n }\n \n /**\n * These variables define excactly, which resource will be displayed. These\n * variables are retrieved from the available resources and displayVariables.\n * Together with the selected time in the timeline, the resource to display\n * is uniquely defined.\n * If adaptSuitableResource is not enabled, selectedVariables is equal to\n * displayVariables.\n * \n * @type Set<module:meteoJS/modelviewer/variable.Variable>\n * @readonly\n */\n get selectedVariables() {\n return new Set([...this._selectedVariables.values()]);\n }\n\n /**\n * Returns the selected Variable of a VariableCollection. If no selected\n * variable exists, an empty Variable-Object will be returned.\n * \n * @param {module:meteoJS/modelviewer/variableCollection.VariableCollection}\n * variableCollection - VariableCollection.\n * @returns {module:meteoJS/modelviewer/variable.Variable}\n * The selected Variable of the colleciton.\n */\n getSelectedVariable(variableCollection) {\n const result = this._selectedVariables.get(variableCollection);\n return (result === undefined) ? new Variable({ id: undefined }) : result;\n }\n \n /**\n * Returns an array of times (for the timeline). For all of these times, there\n * exists resources which match with the current displayVariables.\n * \n * @type Date[]\n * @readonly\n */\n get enabledTimes() {\n return [...this._enabledResources.keys()]\n .filter(datetime => !isNaN(datetime))\n .map(datetime => new Date(datetime));\n }\n \n /**\n * Exchanges variables in displayVariables. The variable with the same\n * Collection will be exchanged. If none is found, the variable will be added.\n * \n * @param {Set<module:meteoJS/modelviewer/variable.Variable>} variables\n * Add these variables to the set of displayVariables.\n * @returns {module:meteoJS/modelviewer/container.Container} - This.\n * @fires module:meteoJS/modelviewer/container#change:displayVariables\n */\n exchangeDisplayVariable(variables) {\n let displayVariables = new Set(this.displayVariables);\n for (let variable of variables)\n for (let displayVariable of this.displayVariables)\n if (displayVariable.variableCollection ===\n variable.variableCollection) {\n displayVariables.delete(displayVariable);\n displayVariables.add(variable);\n }\n for (let variable of variables)\n if (!displayVariables.has(variable))\n displayVariables.add(variable);\n this.displayVariables = displayVariables;\n return this;\n }\n \n /**\n * Mirrors (parts of) the displayVariables form another container. With this\n * feature, e.g. in different containers can be viewed plots of different\n * models. If you change e.g. the field in the first container, all other\n * containers, that mirrors form this container, will also change the viewed\n * content. It is possible to mirror different VariableCollections from\n * different containers.\n * \n * @param {module:meteoJS/modelviewer/container.Container} [container]\n * Mirrors from this container.\n * @param {module:meteoJS/modelviewer/variableCollection.VariableCollection[]}\n * [variableCollections] - The displayVariables of these VariableCollections\n * are mirrored. If omitted, all VariableCollections are mirrored.\n */\n mirrorsFrom(container = undefined, variableCollections = undefined) {\n this._listeners.mirror =\n this._listeners.mirror.filter(mirrorConfig => {\n if (mirrorConfig.container === container\n || container === undefined) {\n mirrorConfig.container\n .un('change:displayVariables', mirrorConfig.listenerKey);\n return false;\n }\n return true;\n });\n if (container === undefined)\n return;\n if (variableCollections !== undefined\n && variableCollections.length < 1)\n return;\n if (variableCollections === undefined)\n variableCollections = this.modelviewer.resources.variableCollections;\n const onChangeDisplayVariables = () => {\n const newDisplayVariables = new Set();\n for (const variable of container.displayVariables)\n variableCollections.forEach(collection => {\n if (variable.variableCollection === collection)\n newDisplayVariables.add(variable);\n });\n this.exchangeDisplayVariable(newDisplayVariables);\n };\n const listenerKey = container\n .on('change:displayVariables', onChangeDisplayVariables);\n const mirrorConfig = {\n container,\n listenerKey,\n variableCollections\n };\n this._listeners.mirror.forEach(mC => {\n const newVariableCollection = [];\n mC.variableCollections.forEach(collection => {\n let isContained = false;\n variableCollections.forEach(variableCollection => {\n if (variableCollection === collection)\n isContained = true;\n });\n if (!isContained)\n newVariableCollection.push(collection);\n });\n if (newVariableCollection.length < mC.variableCollections.length)\n this.mirrorsFrom(mC.container, newVariableCollection);\n });\n this._listeners.mirror.push(mirrorConfig);\n onChangeDisplayVariables();\n }\n\n /**\n * Get all containers, from which this container mirrors some variables from.\n * As values of the returned Map-Object an array with the mirrored\n * VariableColletions is returned.\n * \n * @returns {Map.<module:meteoJS/modelviewer/container.Container,module:meteoJS/modelviewer/variableCollection.VariableCollection[]>}\n */\n getMirrorsFrom() {\n const result = new Map();\n this._listeners.mirror.forEach(mirrorConfig => {\n result.set(mirrorConfig.container, mirrorConfig.variableCollections);\n });\n return result;\n }\n \n /**\n * Sets all available times in the timeline object for this container.\n * \n * @private\n */\n _setTimes() {\n let [selectedVariables] =\n this._getSelectedVariablesWithResources(\n [this.modelviewer.resources.topNode],\n new Set(),\n undefined,\n selectedVariables => {\n let result = true;\n this.modelviewer.resources._timesVariableCollections.forEach(collection => {\n let contained = false;\n for (let selectedVariable of selectedVariables) {\n if (collection.contains(selectedVariable))\n contained = true;\n }\n if (!contained)\n result = false;\n });\n return result;\n }\n );\n \n if (selectedVariables === undefined)\n selectedVariables = new Set();\n \n const availableTimes = (selectedVariables.size == 0)\n ? []\n : this.modelviewer.resources\n .getTimesByVariables({ variables: selectedVariables });\n this.modelviewer.timeline.setTimesBySetID(this.id, availableTimes);\n }\n \n /**\n * Updates the selected variables, according to displayVariables.\n * \n * @private\n */\n _updateSelectedVariables({\n addedVariables = undefined,\n removedVariables = undefined\n } = {}) {\n if (!this._adaptSuitableResource.enabled) {\n let selectedNode = undefined;\n const findFirstNodeWithVariable = node => {\n if (node.hasResourcesByVariables(true, ...this.displayVariables))\n selectedNode = node;\n else\n for (const childNode of node.children)\n findFirstNodeWithVariable(childNode);\n };\n findFirstNodeWithVariable(this.modelviewer.resources.topNode);\n this._setSelectedVariables(this.displayVariables, selectedNode);\n return;\n }\n\n let nodes = [];\n const sV = new Set();\n let lSV = undefined;\n if (addedVariables === undefined || removedVariables === undefined)\n nodes.push(this.modelviewer.resources.topNode);\n else {\n const findFirstNodeWithVariable = node => {\n let isFound = false;\n for (const variable of [...addedVariables, ...removedVariables]) {\n if (variable.variableCollection !== undefined\n && variable.variableCollection.node === node) {\n nodes.push(node);\n isFound = true;\n break;\n }\n }\n if (!isFound) {\n const tempSV = this.getSelectedVariable(node.variableCollection);\n if (tempSV.id !== undefined) {\n lSV = tempSV;\n sV.add(lSV);\n for (const childNode of node.children)\n findFirstNodeWithVariable(childNode);\n }\n }\n };\n findFirstNodeWithVariable(this.modelviewer.resources.topNode);\n nodes = nodes.filter((n,i,a) => i===a.indexOf(n));\n if (nodes.length < 1)\n nodes.push(this.modelviewer.resources.topNode);\n }\n let [selectedVariables, lastSelectedVariable] =\n this._getSelectedVariablesWithResources(\n nodes,\n sV,\n lSV\n );\n \n let node;\n if (selectedVariables === undefined) {\n selectedVariables = sV;\n node = (lSV !== undefined)\n ? lSV.variableCollection.node\n : new Node({ variableCollection: new VariableCollection() });\n }\n else\n node = lastSelectedVariable.variableCollection.node;\n this._setSelectedVariables(selectedVariables, node);\n }\n \n /**\n * @typedef result_getSelectedVariablesWithResources\n * @type {Array}\n * @property {undefined|Set<module:meteoJS/modelviewer/variable.Variable>} 0\n * @property {undefined|module:meteoJS/modelviewer/variable.Variable} 1\n */\n \n /**\n * \n * \n * @param {Set<module:meteoJS/modelviewer/node.Node>} nodes - Nodes to check.\n * @param {Set<module:meteoJS/modelviewer/variable.Variable>}\n * selectedVariables - Selected Variables from top until this node.\n * @returns {result_getSelectedVariablesWithResources}\n * Array with first element the SelectedVariables, second element the last\n * selectedVariable (node most down in the tree).\n * @private\n */\n _getSelectedVariablesWithResources(\n nodes,\n selectedVariables,\n lastSelectedVariable,\n isResourceSelected = this._adaptSuitableResource.isResourceSelected\n ) {\n if (isResourceSelected.call(this, selectedVariables, lastSelectedVariable))\n return [selectedVariables, lastSelectedVariable];\n \n let result = [undefined, undefined];\n const checkPossibleVariable = possibleSelectedVariable => {\n let tempSelectedVariables = new Set(selectedVariables);\n tempSelectedVariables.add(possibleSelectedVariable);\n let [resultSelectedVariables, resultLastSelectedVariable] =\n this\n ._getSelectedVariablesWithResources(\n possibleSelectedVariable.variableCollection.node.children,\n tempSelectedVariables,\n possibleSelectedVariable,\n isResourceSelected\n );\n if (resultSelectedVariables !== undefined) {\n result[0] = resultSelectedVariables;\n result[1] = resultLastSelectedVariable;\n return;\n }\n \n let isOnlyTimesVariables = true;\n for (let selectedVariable of tempSelectedVariables) {\n let contained = false;\n this.modelviewer.resources._timesVariableCollections.forEach(collection => {\n if (collection.contains(selectedVariable))\n contained = true;\n });\n if (!contained)\n isOnlyTimesVariables = false;\n }\n if (isOnlyTimesVariables &&\n tempSelectedVariables.size == this.modelviewer.resources._timesVariableCollections.size) {\n result[0] = tempSelectedVariables;\n result[1] = possibleSelectedVariable;\n }\n };\n\n let availableSelectedVariables = [];\n for (let childNode of nodes) {\n if (this.modelviewer.resources.availableVariablesMap.has(childNode) &&\n this.modelviewer.resources.availableVariablesMap.get(childNode).size)\n for (const variable of childNode.variableCollection) {\n if (!this.modelviewer.resources\n .availableVariablesMap.get(childNode).has(variable))\n continue;\n if (this.displayVariables.has(variable))\n checkPossibleVariable(variable);\n else if (this._adaptSuitableResource.enabled)\n availableSelectedVariables.push(variable);\n if (result[0] !== undefined)\n break;\n }\n if (result[0] !== undefined)\n break;\n }\n if (result[0] !== undefined)\n return result;\n \n const possibleSelectedVariables = this._adaptSuitableResource\n .getPossibleVariables\n .call(this, availableSelectedVariables, selectedVariables);\n for (const variable of possibleSelectedVariables) {\n checkPossibleVariable(variable);\n if (result[0] !== undefined)\n break;\n }\n \n return result;\n }\n \n /**\n * @param {Set<module:meteoJS/modelviewer/variable.Variable>}\n * selectedVariables - New selectedVariables.\n * @param {module:meteoJS/modelviewer/node.Node} selectedNode\n * Selectes resources from this Node.\n * @private\n */\n _setSelectedVariables(selectedVariables, selectedNode) {\n let addedVariables = new Set();\n selectedVariables = new Set(selectedVariables);\n for (let variable of selectedVariables)\n if (!this.selectedVariables.has(variable))\n addedVariables.add(variable);\n let removedVariables = new Set();\n for (let selectedVariable of this.selectedVariables)\n if (!selectedVariables.has(selectedVariable))\n removedVariables.add(selectedVariable);\n if (\n addedVariables.size > 0 ||\n removedVariables.size > 0 ||\n this._selectedNode !== selectedNode\n ) {\n this._selectedVariables.clear();\n for (const variable of selectedVariables)\n this._selectedVariables.set(variable.variableCollection, variable);\n this._selectedNode = selectedNode;\n this._setTimes();\n this._setEnabledResources();\n this._debouncedChangeSelectedVariables({\n addedVariables,\n removedVariables\n });\n }\n }\n \n /**\n * Sets internally _enabledResources. These resources are selected by\n * selectedVariable. The visibleResource is determined from this resources.\n * \n * @private\n */\n _setEnabledResources() {\n this._enabledResources.clear();\n if (this._selectedNode === undefined)\n return;\n if (this.selectedVariables.size != 0)\n this._selectedNode\n .getResourcesByVariables(true, ...this.selectedVariables)\n .filter(r => r.datetime && !isNaN(r.datetime.valueOf()))\n .forEach(r => this._enabledResources.set(r.datetime.valueOf(), r));\n this.modelviewer.timeline\n .setEnabledTimesBySetID(this.id, this.enabledTimes);\n this.trigger('change:enabledResources', this._enabledResources);\n this._setVisibleResource();\n }\n \n /**\n * Sets visible resource.\n * \n * @private\n */\n _setVisibleResource() {\n let oldVisibleResource = this._visibleResource;\n let datetime = this.modelviewer.timeline.getSelectedTime().valueOf();\n if (this._enabledResources.has(datetime))\n this._visibleResource = this._enabledResources.get(datetime);\n else\n this._visibleResource = undefined;\n if (this._visibleResource !== oldVisibleResource)\n this.trigger('change:visibleResource');\n }\n \n /**\n * Inits private property _adaptSuitableResource.\n * \n * @param {module:meteoJS/modelviewer/container~adaptSuitableResource}\n * [adaptSuitableResource] - Adapt suitable resource.\n * @private\n */\n _initAdaptSuitableResource({ enabled = true,\n getPossibleVariables = undefined,\n isResourceSelected = undefined,\n //excludeVariableCollectionFromSimiliarDisplay = []\n } = {}) {\n this._adaptSuitableResource = {\n enabled,\n getPossibleVariables,\n isResourceSelected\n };\n \n if (this._adaptSuitableResource.getPossibleVariables === undefined)\n this._adaptSuitableResource.getPossibleVariables =\n availableSV => availableSV;\n if (this._adaptSuitableResource.isResourceSelected === undefined)\n this._adaptSuitableResource.isResourceSelected =\n (selectedVariables, lastAddedVariable) => {\n if (lastAddedVariable === undefined)\n return false;\n let resources = lastAddedVariable.variableCollection\n .node.getResourcesByVariables(true, ...selectedVariables);\n return resources.length > 0;\n };\n }\n}\naddEventFunctions(Container.prototype);\nexport default Container;","const __WEBPACK_NAMESPACE_OBJECT__ = SVG;","/**\n * @module meteoJS/thermodynamicDiagram/functions\n */\nimport { windspeedMSToKN } from '../calc.js';\n\n/**\n * Definition of a line style. Some properties misses.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram~lineStyleOptions\n * @property {string} [color='black'] - Color.\n * @property {number} [width=1] - Width.\n * @property {undefined|number} [opacity=undefined] - Opacity.\n * @property {'butt'|'round'|'square'} [linecap=undefined] - Linecap.\n * @property {'arcs'|'bevel'|'miter'|'miter-clip'|'round'} [linejoin=undefined]\n * Linejoin.\n * @property {string} [dasharray=undefined] - Dasharray.\n * @property {number|string} [dashoffset=undefined] - Dashoffset.\n */\n\n/**\n * Returns normalized lineStyle-Options.\n * \n * @param {module:meteoJS/thermodynamicDiagram~lineStyleOptions}\n * [options] - Options.\n * @param {module:meteoJS/thermodynamicDiagram~lineStyleOptions}\n * [defaults] - Optional defaults.\n * @returns {module:meteoJS/thermodynamicDiagram~lineStyleOptions}\n * Normalized options.\n * @private\n */\nexport function getNormalizedLineStyleOptions({\n color = undefined,\n width = undefined,\n ...result\n} = {}, defaults = {}) {\n result.color = getFirstDefinedValue(color, defaults.color, 'black');\n result.width = getFirstDefinedValue(width, defaults.width, 1);\n Object.keys(defaults).forEach(key => {\n if (key != 'color' && key != 'width' && result[key] === undefined)\n result[key] = defaults[key];\n });\n return result;\n}\n\n/**\n * Definition of font options. Some properties misses.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram~fontOptions\n * @param {mixed} [size=12] - Size.\n * @param {mixed} [color='black'] - Color.\n * @param {'start'|'middle'|'end'} [anchor=undefined] - Anchor.\n */\n\n/**\n * Returns normalized font-Options.\n * \n * @param {module:meteoJS/thermodynamicDiagram~fontOptions}\n * [options] - Options.\n * @param {module:meteoJS/thermodynamicDiagram~fontOptions}\n * [defaults] - Optional defaults.\n * @returns {module:meteoJS/thermodynamicDiagram~fontOptions}\n * Normalized options.\n * @private\n */\nexport function getNormalizedFontOptions({\n size = undefined,\n color = undefined,\n anchor = undefined,\n ...result\n} = {}, defaults = {}) {\n result.size = getFirstDefinedValue(size, defaults.size, 12);\n result.color = getFirstDefinedValue(color, defaults.color, 'black');\n anchor = getFirstDefinedValue(anchor, defaults.anchor);\n if (anchor !== undefined)\n result.anchor = anchor;\n Object.keys(defaults).forEach(key => {\n if (key != 'color' && key != 'size' && key != 'anchor'\n && result[key] === undefined)\n result[key] = defaults[key];\n });\n return result;\n}\n\n/**\n * A line with its visibility and style.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram~lineOptions\n * @param {boolean} [visible=true] - Visibility of the line.\n * @param {module:meteoJS/thermodynamicDiagram~lineStyleOptions}\n * [style] - Line style.\n */\n\n/**\n * Returns normalized line options with visibility and line style.\n * \n * @param {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [options] - Options.\n * @param {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [defaults] - Optional defaults.\n * @returns {module:meteoJS/thermodynamicDiagram~lineOptions}\n * Normalized options.\n * @internal\n */\nexport function getNormalizedLineOptions({\n visible = undefined,\n style = {},\n ...result\n} = {}, defaults = {}) {\n result.visible = getFirstDefinedValue(visible, defaults.visible, true);\n result.style = getNormalizedLineStyleOptions(style, defaults.style);\n Object.keys(defaults).forEach(key => {\n if (key != 'visible' && key != 'style' && result[key] === undefined)\n result[key] = defaults[key];\n });\n return result;\n}\n\n/**\n * A text with its visibility, style and font style.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram~textOptions\n * @param {boolean} [visible=true] - Visibility of the line.\n * @param {module:meteoJS/thermodynamicDiagram~fontOptions}\n * [font] - Font defintions.\n */\n\n/**\n * Returns normalized text options with visibility and line style.\n * \n * @param {module:meteoJS/thermodynamicDiagram~textOptions}\n * [options] - Options.\n * @param {module:meteoJS/thermodynamicDiagram~textOptions}\n * [defaults] - Optional defaults.\n * @returns {module:meteoJS/thermodynamicDiagram~textOptions}\n * Normalized options.\n * @internal\n */\nexport function getNormalizedTextOptions({\n visible = true,\n font = {},\n ...result\n} = {}, defaults = {}) {\n result.visible = getFirstDefinedValue(visible, defaults.visible, true);\n result.font = getNormalizedFontOptions(font, defaults.font);\n Object.keys(defaults).forEach(key => {\n if (key != 'visible' && key != 'font'\n && result[key] === undefined)\n result[key] = defaults[key];\n });\n return result;\n}\n\n/**\n * An object with its visibility, style and font style.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram~lineOptions}\n * module:meteoJS/thermodynamicDiagram~lineTextOptions\n * @property {module:meteoJS/thermodynamicDiagram~fontOptions}\n * [font] - Font defintions.\n */\n\n/**\n * Returns normalized text options with visibility, line and font style.\n * \n * @param {module:meteoJS/thermodynamicDiagram~lineTextOptions}\n * [options] - Options.\n * @param {module:meteoJS/thermodynamicDiagram~lineTextOptions}\n * [defaults] - Optional defaults.\n * @returns {module:meteoJS/thermodynamicDiagram~lineTextOptions}\n * Normalized options.\n * @internal\n */\nexport function getNormalizedLineTextOptions({\n visible = true,\n style = {},\n font = {}\n} = {}, defaults = {}) {\n return {\n visible: getFirstDefinedValue(visible, defaults.visible, true),\n style: getNormalizedLineStyleOptions(style, defaults.style),\n font: getNormalizedFontOptions(font, defaults.font)\n };\n}\n\n/**\n * Updates current options with some new options.\n * \n * @param {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [options] - Current options.\n * @param {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [updateOptions] - Some new options.\n * @returns {module:meteoJS/thermodynamicDiagram~lineOptions}\n * New options object.\n * @private\n */\nexport function updateLineOptions(options = {}, updateOptions = {}) {\n if ('visible' in updateOptions)\n options.visible = updateOptions.visible;\n if ('style' in updateOptions) {\n ['color', 'width', 'opacity', 'linecap', 'linejoin', 'dasharray']\n .forEach(styleKey => {\n if (styleKey in updateOptions.style)\n options.style[styleKey] = updateOptions.style[styleKey];\n });\n }\n return options;\n}\n\n/**\n * Returns the first defined argument.\n * \n * @param {mixed|undefined} [...params] - Some values.\n * @returns {mixed|undefined} - First defined value, if available.\n */\nexport function getFirstDefinedValue(...params) {\n return params\n .reduce((acc, cur) => { return (acc !== undefined) ? acc : cur; });\n}\n\n/**\n * Draws text in a SVG node.\n * \n * @param {Object} options - Options.\n * @param {external:SVG} options.node - SVG node.\n * @param {string} options.text - Text.\n * @param {number} options.x - X coordinate.\n * @param {number} options.y - Base Y coordinate.\n * @param {number} [options.horizontalMargin=0] - Padding in x direction.\n * @param {number} [options.verticalMargin=0] - Padding in y direction.\n * @param {module:meteoJS/thermodynamicDiagram~fontOptions} [options.font] - Font style.\n * @param {string|Object|undefined} [options.fill]\n * Fill for background. If undefined, no background is drawn.\n * @returns {external:SVG} - SVG group containing the inserted elements.\n */\nexport function drawTextInto({\n node,\n text,\n x,\n y,\n horizontalMargin = 0,\n verticalMargin = 0,\n font = {},\n fill = undefined\n}) {\n const group = node.group();\n let background = undefined;\n if (fill !== undefined) {\n if (!('color' in fill))\n fill.color = 'white';\n background = group.rect().fill(fill);\n }\n const f = {...font};\n let fontColor = undefined;\n if ('color' in f) {\n fontColor = f.color;\n delete f.color;\n }\n const textNode = group\n .text(text)\n .attr({ x, y })\n .font(font);\n if (fontColor !== undefined)\n textNode.fill(fontColor);\n if (font['alignment-baseline'] == 'bottom')\n textNode.dy(-textNode.bbox().height - 5);\n textNode\n .dx(horizontalMargin * ((textNode.attr('text-anchor') == 'end') ? -1 : 1))\n .dy(verticalMargin * ((font['alignment-baseline'] == 'bottom') ? -1 : 1));\n if (background !== undefined)\n background.attr({\n x: textNode.bbox().x,\n y: textNode.bbox().y,\n width: textNode.bbox().width,\n height: textNode.bbox().height\n });\n return group;\n}\n\n/**\n * Draws a windbarb into an SVG node.\n * \n * @param {Object} options - Options.\n * @param {external:SVG} options.node - SVG node.\n * @param {number} [options.x=0] - X coordinate for windbarb tip.\n * @param {number} [options.y=0] - Y coordinate for windbarb tip.\n * @param {number} [options.wspd=0] - Wind speed [m/s].\n * @param {number} [options.wdir=0] - Wind direction [°].\n * @param {number} [options.length=50] - Windbarb length.\n * @param {module:meteoJS/thermodynamicDiagram~lineStyleOptions}\n * [options.strokeStyle] - Line style.\n * @param {boolean} [options.fillTriangle=true] - Fill the 50 knots triangles.\n * @param {boolean} [options.triangleRatio=0.2]\n * Width of the 50 knots triangles according to length.\n * @param {boolean} [options.barbDistanceRatio=0.1]\n * Distance between triangles and/or 10 knot lines according to length.\n * @param {boolean} [options.barbHeightRatio=0.375]\n * Height of the triangles and lines according to length.\n */\nexport function drawWindbarbInto({\n node,\n x = 0,\n y = 0,\n wspd = 0,\n wdir = 270,\n length = 50,\n strokeStyle = undefined,\n fillTriangle = true,\n triangleRatio = 1 / 5,\n barbDistanceRatio = 1 / 10,\n barbHeightRatio = 3 / 8,\n circleOnLowWindspeed = true,\n circleRadiusRatio = 1 / 10\n} = {}) {\n strokeStyle = getNormalizedLineStyleOptions(strokeStyle);\n \n const windspeed = windspeedMSToKN(wspd);\n const windbarbGroup = node.group();\n const barbGroup = (windspeed >= 5) ? windbarbGroup.group() : undefined;\n const triangleWidth = length * triangleRatio;\n const barbDistance = length * barbDistanceRatio;\n const windbarbHeight = length * barbHeightRatio;\n let yPosition = y - length;\n let windspeedResidual = windspeed;\n \n if (windspeed < 5 && circleOnLowWindspeed) {\n windbarbGroup\n .circle(length * circleRadiusRatio)\n .cx(x)\n .cy(y)\n .stroke(strokeStyle)\n .fill('none');\n return;\n }\n \n // base line\n windbarbGroup\n .line(x, yPosition, x, y)\n .stroke(strokeStyle);\n \n // 50 knots triangles\n while (windspeedResidual >= 50) {\n barbGroup\n .polyline([\n [x, yPosition],\n [x + windbarbHeight, yPosition + triangleWidth/2],\n [x, yPosition + triangleWidth]\n ])\n .fill(fillTriangle ? strokeStyle : 'none')\n .stroke(strokeStyle);\n windspeedResidual -= 50;\n yPosition += triangleWidth + ((windspeedResidual >= 50) ? barbDistance/2 : barbDistance);\n }\n \n // 10 knots lines\n while (windspeedResidual >= 10) {\n barbGroup\n .line(\n x, yPosition,\n x + windbarbHeight, yPosition - triangleWidth/2\n )\n .stroke(strokeStyle);\n yPosition += barbDistance;\n windspeedResidual -= 10;\n }\n \n if (windspeed < 10)\n yPosition += barbDistance;\n \n // 5 knot line\n if (windspeedResidual >= 5)\n barbGroup\n .line(\n x, yPosition,\n x + windbarbHeight/2, yPosition - triangleWidth/4\n )\n .stroke(strokeStyle);\n \n // compress barbs on high windspeed\n const barbsWidth = yPosition - (y - length);\n if (barbsWidth > length * 0.9)\n barbGroup.scale(1, (length * 0.9) / barbsWidth, x, y - length);\n \n if (wdir != 0)\n windbarbGroup.rotate(wdir, x, y);\n}","/**\n * @module meteoJS/thermodynamicDiagram/diagramParcel\n */\nimport addEventFunctions from '../Events.js';\nimport Unique from '../base/Unique.js';\nimport {\n getNormalizedLineOptions,\n updateLineOptions\n} from '../thermodynamicDiagram/Functions.js';\n\n/**\n * Change visibility event. Only triggered, if the visibility of the parcel\n * changes.\n * \n * @event module:meteoJS/thermodynamicDiagram/diagramParcel#change:visible\n */\n\n/**\n * Change options event.\n * \n * @event module:meteoJS/thermodynamicDiagram/diagramParcel#change:options\n */\n\n/**\n * Style/visibility options for a parcel in the thermodynamic diagram.\n * \n * @typedef {Object}\n * module:meteoJS/thermodynamicDiagram/diagramParcel~parcelOptions\n * @property {boolean} [visible=true]\n * Visibility in the thermodynamic diagram.\n * @property {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [temp] - Options for the temperature curve.\n * @property {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [dewp] - Options for the dewpoint curve.\n */\n\n/**\n * Definition of the options for the constructor.\n * \n * @typedef {module:meteoJS/base/unique~options}\n * module:meteoJS/thermodynamicDiagram/diagramParcel~options\n * @property {module:meteoJS/sounding/parcel.Parcel} [parcel] - Parcel object.\n * @property {boolean} [visible=true] - Visibility of the parcel.\n * @property {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [temp] - Options for the temperature curve.\n * @property {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [dewp] - Options for the dewpoint curve.\n */\n\n/**\n * Representation of a plotted parcel (data and display options)\n * \n * <pre><code>import DiagramParcel from 'meteojs/thermodynamicDiagram/DiagramParcel';</code></pre>\n * \n * @extends module:meteoJS/base/unique.Unique\n * @fires module:meteoJS/thermodynamicDiagram/diagramParcel#change:visible\n * @fires module:meteoJS/thermodynamicDiagram/diagramParcel#change:options\n */\nexport class DiagramParcel extends Unique {\n \n /**\n * @param {module:meteoJS/thermodynamicDiagram/diagramParcel~options} [options] - Options.\n */\n constructor({\n parcel = undefined,\n visible = true,\n temp = {},\n dewp = {},\n ...rest\n } = {}) {\n super(rest);\n \n /**\n * @type module:meteoJS/sounding/parcel.Parcel\n * @private\n */\n this._parcel = parcel;\n if (this.id === undefined && parcel !== undefined)\n this.id = parcel.id;\n \n /**\n * @type {module:meteoJS/thermodynamicDiagram/diagramParcel~parcelOptions}\n * @private\n */\n this._options = {\n visible,\n temp: getNormalizedLineOptions(temp, {\n style: {\n color: 'rgb(255, 153, 0)',\n width: 3,\n linecap: 'round'\n }\n }),\n dewp: getNormalizedLineOptions(dewp, {\n style: {\n color: 'rgb(255, 153, 0)',\n width: 3,\n linecap: 'round'\n }\n })\n };\n }\n\n /**\n * Parcel object.\n * \n * @type module:meteoJS/sounding/parcel.Parcel\n * @readonly\n */\n get parcel() {\n return this._parcel;\n }\n \n /**\n * Visibility of the parcel.\n * \n * @type {boolean}\n * @fires module:meteoJS/thermodynamicDiagram/diagramParcel#change:visible\n */\n get visible() {\n return this._options.visible;\n }\n set visible(visible) {\n let oldVisible = this._options.visible;\n this._options.visible = visible ? true : false;\n if (oldVisible != this._options.visible)\n this.trigger('change:visible');\n }\n \n /**\n * Style options for the parcel.\n * \n * @type {module:meteoJS/thermodynamicDiagram/diagramParcel~parcelOptions}\n * @readonly\n */\n get options() {\n return this._options;\n }\n \n /**\n * Updates the style options for the parcel.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramParcel~parcelOptions}\n * [options] - Options.\n * @fires module:meteoJS/thermodynamicDiagram/diagramParcel#change:visible\n * @fires module:meteoJS/thermodynamicDiagram/diagramParcel#change:options\n */\n update({\n visible = undefined,\n temp = undefined,\n dewp = undefined\n } = {}) {\n let willTrigger = false;\n if (temp === undefined)\n temp = {};\n else\n willTrigger = true;\n if (dewp === undefined)\n dewp = {};\n else\n willTrigger = true;\n \n \n this._options.temp = updateLineOptions(this._options.temp, temp);\n this._options.dewp = updateLineOptions(this._options.dewp, dewp);\n \n if (willTrigger)\n this.trigger('change:options');\n \n if (visible !== undefined)\n this.visible = visible;\n }\n}\naddEventFunctions(DiagramParcel.prototype);\nexport default DiagramParcel;","/**\n * @module meteoJS/thermodynamicDiagram/diagramSounding\n */\nimport addEventFunctions from '../Events.js';\nimport Unique from '../base/Unique.js';\nimport Collection from '../base/Collection.js';\nimport {\n getNormalizedLineOptions,\n updateLineOptions\n} from '../thermodynamicDiagram/Functions.js';\nimport DiagramParcel from './DiagramParcel.js';\n\n/**\n * Change visibility event. Only triggered, if the visibility of the sounding\n * changes, not if only a part's visibility (like hodograph) changes.\n * \n * @event module:meteoJS/thermodynamicDiagram/diagramSounding#change:visible\n */\n\n/**\n * Change options event.\n * \n * @event module:meteoJS/thermodynamicDiagram/diagramSounding#change:options\n */\n\n/**\n * Options for a line-segment of a sounding in the hodograph.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram~lineOptions}\n * module:meteoJS/thermodynamicDiagram/diagramSounding~hodographSegmentOptions\n * @property {number|undefined}\n * [minPressure] - Minimum pressure level of the segment. Unit: hPa.\n * @property {number|undefined}\n * [maxPressure] - Maximum pressure level of the segment. Unit: hPa.\n */\n\n/**\n * Options for a sounding in the hodograph.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram~lineOptions}\n * module:meteoJS/thermodynamicDiagram/diagramSounding~hodographOptions\n * @property {number|undefined}\n * [minPressure] - Minimum pressure level to plot in the hodograph. Unit: hPa.\n * @property {number|undefined}\n * [maxPressure] - Maximum pressure level to plot in the hodograph. Unit: hPa.\n * @property {module:meteoJS/thermodynamicDiagram/diagramSounding~hodographSegmentOptions[]}\n * [segments] - Array of segment definitions.\n */\n\n/**\n * Definition of the options for the constructor.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram/diagramSounding~options\n * @param {boolean} [visible=true] - Visibility of the sounding.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~diagramOptions}\n * [diagram] - Options for the thermodynamic diagram part.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~windprofileOptions}\n * [windprofile] - Options for the windprofile part.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~hodographOptions}\n * [hodograph] - Options for this sounding for the hodograph.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsOptions}\n * [parcels] - Options for this sounding for the parcels.\n */\n\n/**\n * Representation of a plotted sounding (data and display options)\n * \n * <pre><code>import DiagramSounding from 'meteojs/thermodynamicDiagram/DiagramSounding';</code></pre>\n * \n * @extends module:meteoJS/base/unique.Unique\n * @fires module:meteoJS/thermodynamicDiagram/diagramSounding#change:visible\n * @fires module:meteoJS/thermodynamicDiagram/diagramSounding#change:options\n */\nexport class DiagramSounding extends Unique {\n \n /**\n * @param {module:meteoJS/sounding.Sounding} sounding - Sounding data.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~options} [options] - Options.\n */\n constructor(sounding, {\n visible = true,\n diagram = {},\n windprofile = {},\n hodograph = {},\n parcels = {}\n } = {}) {\n super();\n \n /**\n * @type module:meteoJS/sounding.Sounding\n * @private\n */\n this._sounding = sounding;\n \n /**\n * @type module:meteoJS/base/collection.Collection\n * @private\n */\n this._diagramParcelCollection = new Collection({\n fireReplace: false,\n fireAddRemoveOnReplace: true,\n emptyObjectMaker: () => new DiagramParcel()\n });\n \n /**\n * @type boolean\n * @private\n */\n this._visible = visible;\n \n /**\n * @type Object\n * @private\n */\n this._options = {\n diagram: getNormalizedDiagramOptions(diagram),\n windprofile: getNormalizedWindprofileOptions(windprofile),\n hodograph: getNormalizedHodographOptions(hodograph),\n parcels: getNormalizedParcelsOptions(parcels)\n };\n \n // Initialize soundig-object with its parcels.\n if (this._sounding !== undefined) {\n this._sounding.parcelCollection.on('add:item',\n parcel => this.addParcel(parcel));\n this._sounding.parcelCollection.on('remove:item', parcel => {\n for (let diagramParcel of this._diagramParcelCollection)\n if (diagramParcel.parcel === parcel)\n this._diagramParcelCollection.remove(diagramParcel);\n });\n for (let parcel of this._sounding.parcelCollection)\n this.addParcel(parcel);\n }\n }\n \n /**\n * Sounding data.\n * \n * @type module:meteoJS/sounding.Sounding\n * @readonly\n */\n get sounding() {\n return this._sounding;\n }\n \n /**\n * Visibility of the sounding.\n * \n * @type {boolean}\n * @fires module:meteoJS/thermodynamicDiagram/diagramSounding#change:visible\n */\n get visible() {\n return this._visible;\n }\n set visible(visible) {\n let oldVisible = this._visible;\n this._visible = visible ? true : false;\n if (oldVisible != this._visible)\n this.trigger('change:visible');\n }\n \n get options() {\n return this._options;\n }\n \n /**\n * Collection of the DiagramParcel objects.\n * \n * @type module:meteoJS/base/collection.Collection\n * @readonly\n */\n get diagramParcelCollection() {\n return this._diagramParcelCollection;\n }\n \n /**\n * Add a parcel with styles to the sounding.\n * (analogue to {@link module:meteoJS/thermodynamicDiagramPluggable.ThermodynamicDiagramPluggable#addSounding})\n * \n * @param {module:meteoJS/sounding/parcel.Parcel} parcel - Parcel object.\n * @param {module:meteoJS/thermodynamicDiagram/diagramParcel~parcelOptions}\n * [options] - Style options.\n * @returns {module:meteoJS/thermodynamicDiagram/diagramParcel.diagramParcel}\n * Parcel object for the diagram with style options.\n */\n addParcel(parcel, options = undefined) {\n options = (options === undefined) ? this.getParcelOptions(parcel) : options;\n options.parcel = parcel;\n const dp = new DiagramParcel(options);\n this._diagramParcelCollection.append(dp);\n return dp;\n }\n \n /**\n * Updated the style options for this sounding.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~options}\n * [options] - Options.\n * @fires module:meteoJS/thermodynamicDiagram/diagramSounding#change:visible\n * @fires module:meteoJS/thermodynamicDiagram/diagramSounding#change:options\n */\n update({\n visible = undefined,\n diagram = undefined,\n windprofile = undefined,\n hodograph = undefined,\n parcels = undefined\n } = {}) {\n let willTrigger = false;\n if (diagram === undefined)\n diagram = {};\n else\n willTrigger = true;\n if (windprofile === undefined)\n windprofile = {};\n else\n willTrigger = true;\n if (hodograph === undefined)\n hodograph = {};\n else\n willTrigger = true;\n \n this._options.diagram =\n updateDiagramOptions(this._options.diagram, diagram);\n this._options.windprofile =\n updateWindprofileOptions(this._options.windprofile, windprofile);\n this._options.hodograph =\n updateHodographOptions(this._options.hodograph, hodograph);\n if (willTrigger)\n this.trigger('change:options');\n \n if (parcels === undefined)\n parcels = {};\n this._options.parcels =\n updateParcelsOptions(this._options.parcels, parcels);\n for (let diagramParcel of this.diagramParcelCollection) {\n if (diagramParcel.id in parcels)\n diagramParcel.update(parcels[diagramParcel.id]);\n }\n \n if (visible !== undefined)\n this.visible = visible;\n }\n \n /**\n * Returns normalized visibility and style options for a parcel. This is a\n * combination of the specific options for the passed parcel and the defaults.\n * \n * @param {module:meteoJS/sounding/parcel.Parcel} [parcel] - Parcel.\n * @returns {module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsOptions}\n * Parcel options.\n * @public\n */\n getParcelOptions(parcel = undefined) {\n let result = {\n visible: this.options.parcels.default.visible,\n temp: {\n visible: this.options.parcels.default.temp.visible,\n style: {}\n },\n dewp: {\n visible: this.options.parcels.default.dewp.visible,\n style: {}\n }\n };\n ['temp', 'dewp'].forEach(key => {\n Object.keys(this.options.parcels.default[key].style).forEach(styleKey => {\n result[key].style[styleKey] =\n this.options.parcels.default[key].style[styleKey];\n });\n });\n if (parcel !== undefined &&\n parcel.id in this.options.parcels)\n result = updateOptionsPart(result, this.options.parcels[parcel.id],\n ['temp', 'dewp']);\n return result;\n }\n}\naddEventFunctions(DiagramSounding.prototype);\nexport default DiagramSounding;\n\n/**\n * Style/visibility options for a sounding in the thermodynamic diagram.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram/diagramSounding~diagramOptions\n * @param {boolean} [visible=true]\n * Visibility in the thermodynamic diagram.\n * @param {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [temp] - Options for the temperature curve.\n * @param {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [dewp] - Options for the dewpoint curve.\n * @param {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [wetbulb] - Options for the wetbulb temperature curve.\n */\n\n/**\n * Returns normalized diagram options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~diagramOptions}\n * [options] - Options.\n * @returns {module:meteoJS/thermodynamicDiagram/diagramSounding~diagramOptions}\n * Normalized options.\n * @private\n */\nfunction getNormalizedDiagramOptions({\n visible = true,\n temp = {},\n dewp = {},\n wetbulb = {}\n} = {}) {\n return {\n visible,\n temp: getNormalizedLineOptions(temp, {\n style: {\n color: 'red',\n width: 3,\n linecap: 'round'\n }\n }),\n dewp: getNormalizedLineOptions(dewp, {\n style: {\n color: 'blue',\n width: 3,\n linecap: 'round'\n }\n }),\n wetbulb: getNormalizedLineOptions(wetbulb, {\n style: {\n color: 'green',\n width: 2,\n linecap: 'round'\n }\n })\n };\n}\n\n/**\n * Updates diagram options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~diagramOptions}\n * options - Current options.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~diagramOptions}\n * updateOptions - Some new options.\n * @returns {module:meteoJS/thermodynamicDiagram/diagramSounding~diagramOptions}\n * New options object.\n * @private\n */\nfunction updateDiagramOptions(options, updateOptions) {\n return updateOptionsPart(options, updateOptions, ['temp', 'dewp', 'wetbulb']);\n}\n\n/**\n * Style/visibility options for a sounding in the windprofile.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram/diagramSounding~windprofileOptions\n * @param {boolean} [visible=true] - Visibility in the windprofile part.\n * @param {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [windbarbs] - Options for the windbarbs.\n * @param {module:meteoJS/thermodynamicDiagram~lineOptions}\n * [windspeed] - Options for the windspeed line.\n */\n\n/**\n * Returns normalized windprofile options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~windprofileOptions}\n * [options] - Options.\n * @returns {module:meteoJS/thermodynamicDiagram/diagramSounding~windprofileOptions}\n * Normalized options.\n * @private\n */\nfunction getNormalizedWindprofileOptions({\n visible = true,\n windbarbs = {},\n windspeed = {}\n} = {}) {\n return {\n visible,\n windbarbs: getNormalizedLineOptions(windbarbs),\n windspeed: getNormalizedLineOptions(windspeed)\n };\n}\n\n/**\n * Updates windprofile options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~windprofileOptions}\n * options - Current options.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~windprofileOptions}\n * updateOptions - Some new options.\n * @returns {module:meteoJS/thermodynamicDiagram/diagramSounding~windprofileOptions}\n * New options object.\n * @private\n */\nfunction updateWindprofileOptions(options, updateOptions) {\n return updateOptionsPart(options, updateOptions, ['windbarbs', 'windspeed']);\n}\n\n/**\n * Returns normalized hodograph options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~hodographOptions}\n * [options] - Options.\n * @returns {module:meteoJS/thermodynamicDiagram/diagramSounding~hodographOptions}\n * Normalized options.\n * @private\n */\nfunction getNormalizedHodographOptions({\n minPressure = undefined,\n maxPressure = undefined,\n segments = [],\n ...result\n} = {}) {\n result = getNormalizedLineOptions(result, {\n style: {\n color: 'green',\n width: 2\n }\n });\n result.minPressure = minPressure;\n result.maxPressure = maxPressure;\n result.segments = segments.map(({\n minPressure = undefined,\n maxPressure = undefined,\n ...segment\n }) => {\n segment = getNormalizedLineOptions(segment);\n segment.minPressure = minPressure;\n segment.maxPressure = maxPressure;\n return segment;\n });\n return result;\n}\n\n/**\n * Updates hodograph options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~hodographOptions}\n * options - Current options.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~hodographOptions}\n * updateOptions - Some new options.\n * @returns {module:meteoJS/thermodynamicDiagram/diagramSounding~hodographOptions}\n * New options object.\n * @private\n */\nfunction updateHodographOptions(options, updateOptions) {\n options = updateLineOptions(options, updateOptions);\n ['minPressure', 'maxPressure'].forEach(styleKey => {\n if (styleKey in updateOptions)\n options[styleKey] = updateOptions[styleKey];\n });\n if ('segments' in updateOptions)\n options.segments = updateOptions.segments.map(({\n minPressure = undefined,\n maxPressure = undefined,\n ...segment\n }) => {\n segment = getNormalizedLineOptions(segment);\n segment.minPressure = minPressure;\n segment.maxPressure = maxPressure;\n return segment;\n });\n return options;\n}\n\n/**\n * Visibility/style of the parcels. This object can contain further keys with\n * values as {@link module:meteoJS/thermodynamicDiagram/diagramSounding~diagramOptions}\n * which applies to the parcel with the equivalent id.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsOptions\n * @param {boolean} [visible=true] - Visibility of the parcels.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~diagramOptions}\n * [default] - Default options for a parcel.\n */\n\n/**\n * Returns normalized parcels options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsOptions}\n * [options] - Options.\n * @returns {module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsOptions}\n * Normalized options.\n * @private\n */\nfunction getNormalizedParcelsOptions(options = {}) {\n if (options.visible === undefined)\n options.visible = true;\n if (options.default === undefined)\n options.default = {};\n if (options.default.visible === undefined)\n options.default.visible = false;\n if (options.default.temp === undefined)\n options.default.temp = {};\n if (options.default.temp.visible === undefined)\n options.default.temp.visible = true;\n if (options.default.temp.style === undefined)\n options.default.temp.style = {};\n if (options.default.temp.style.color === undefined)\n options.default.temp.style.color = 'rgb(255, 153, 0)';\n if (options.default.temp.style.width === undefined)\n options.default.temp.style.width = 3;\n if (options.default.temp.style.linecap === undefined)\n options.default.temp.style.linecap = 'round';\n if (options.default.dewp === undefined)\n options.default.dewp = {};\n if (options.default.dewp.visible === undefined)\n options.default.dewp.visible = true;\n if (options.default.dewp.style === undefined)\n options.default.dewp.style = {};\n if (options.default.dewp.style.color === undefined)\n options.default.dewp.style.color = 'rgb(255, 194, 102)';\n if (options.default.dewp.style.width === undefined)\n options.default.dewp.style.width = 3;\n if (options.default.dewp.style.linecap === undefined)\n options.default.dewp.style.linecap = 'round';\n return options;\n}\n\n/**\n * Updates Parcels options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsOptions}\n * options - Current options.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsOptions}\n * updateOptions - Some new options.\n * @returns {module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsOptions}\n * New options object.\n * @private\n */\nfunction updateParcelsOptions(options, updateOptions) {\n if ('visible' in updateOptions)\n options.visible = updateOptions.visible;\n if ('default' in updateOptions)\n options.default =\n updateOptionsPart(options.default, updateOptions.default,\n ['temp', 'dewp']);\n Object.keys(updateOptions)\n .filter(key => key != 'visible' && key != 'default')\n .forEach(key =>\n options[key] =\n updateDiagramOptions(\n (key in options) ? options[key] : {},\n updateOptions[key]));\n return options;\n}\n\n/**\n * Updates diagram/windprofile options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~diagramOptions|module:meteoJS/thermodynamicDiagram/diagramSounding~windprofileOptions}\n * options - Current options.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~diagramOptions|module:meteoJS/thermodynamicDiagram/diagramSounding~windprofileOptions}\n * updateOptions - Some new options.\n * @param {Array.<string>} [lineKeys] - Keys to update.\n * @returns {module:meteoJS/thermodynamicDiagram/diagramSounding~diagramOptions|module:meteoJS/thermodynamicDiagram/diagramSounding~windprofileOptions}\n * New options object.\n * @private\n */\nfunction updateOptionsPart(options, updateOptions, lineKeys = []) {\n if ('visible' in updateOptions)\n options.visible = updateOptions.visible;\n lineKeys.forEach(key => {\n if (key in updateOptions)\n options[key] = updateLineOptions(options[key] ? options[key] : { style: {} }, updateOptions[key]);\n });\n return options;\n}","/**\n * @module meteoJS/thermodynamicDiagramPluggable\n */\nimport { SVG } from '@svgdotjs/svg.js';\nimport Collection from './base/Collection.js';\nimport DiagramSounding from './thermodynamicDiagram/DiagramSounding.js';\n\n/**\n * Options for the constructor.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagramPluggable~options\n * @param {external:HTMLElement} [renderTo] - Element to render diagram into.\n * @param {integer} [width=undefined] - Width of the whole container.\n * @param {integer} [height=undefined] - Height of the whole container.\n */\n\n/**\n * Class to draw a SVG thermodynamic diagram.\n * \n * <pre><code>import ThermodynamicDiagramPluggable from 'meteojs/thermodynamicDiagramPluggable';</code></pre>\n * \n * @extends module:meteoJS/base/collection.Collection\n */\nexport class ThermodynamicDiagramPluggable extends Collection {\n \n /**\n * @param {module:meteoJS/thermodynamicDiagram~options} options - Options.\n */\n constructor({\n renderTo = undefined,\n width = undefined,\n height = undefined\n } = {}) {\n super({\n fireReplace: false,\n fireAddRemoveOnReplace: true,\n emptyObjectMaker: () => new DiagramSounding()\n });\n \n /**\n * @type external:SVG\n * @private\n */\n this._svgNode =\n (renderTo === undefined || 'node' in renderTo || 'instance' in renderTo)\n ? SVG(renderTo) : SVG().addTo(renderTo);\n if (width !== undefined ||\n height !== undefined)\n this._svgNode.size(width, height);\n else if (width === undefined &&\n height === undefined &&\n renderTo !== undefined &&\n 'getBoundingClientRect' in renderTo) {\n let boundingRect = renderTo.getBoundingClientRect(); // size incl. padding\n let computedStyle = window.getComputedStyle(renderTo);\n this._svgNode.size(\n boundingRect.width -\n parseFloat(computedStyle.getPropertyValue('padding-left')) -\n parseFloat(computedStyle.getPropertyValue('padding-right')),\n boundingRect.height - \n parseFloat(computedStyle.getPropertyValue('padding-top')) -\n parseFloat(computedStyle.getPropertyValue('padding-bottom'))\n );\n }\n \n /**\n * @type Set.<module:meteoJS/thermodynamicDiagram/plotArea.PlotArea>\n * @private\n */\n this._plotAreas = new Set();\n \n // PlotAltitudeDataArea objects\n this._svgNode.on('mousemove', e => {\n for (let plotArea of this._plotAreas)\n if ('isHoverLabelsRemote' in plotArea)\n plotArea.svgNode.dispatchEvent(e);\n });\n this._svgNode.on('mouseout', e => {\n if (this._svgNode.node === e.target)\n for (let plotArea of this._plotAreas)\n if ('_hoverLabelsGroup' in plotArea)\n plotArea._hoverLabelsGroup.clear();\n });\n \n // PlotDataArea objects\n this.on('add:item', sounding => {\n for (let plotArea of this._plotAreas)\n if ('addSounding' in plotArea)\n plotArea.addSounding(sounding);\n });\n this.on('remove:item', sounding => {\n for (let plotArea of this._plotAreas)\n if ('removeSounding' in plotArea)\n plotArea.removeSounding(sounding);\n });\n }\n\n /**\n * SVG object of the complete diagram.\n * \n * @type external:SVG\n * @readonly\n */\n get svgNode() {\n return this._svgNode;\n }\n \n /**\n * Appends a PlotArea object to this thermodynamic diagram.\n * \n * @param {module:meteoJS/thermodynamicDiagram/plotArea.PlotArea} plotArea\n * PlotArea object.\n * @returns {module:meteoJS/thermodynamicDiagramPluggable.ThermodynamicDiagramPluggable}\n * This.\n */\n appendPlotArea(plotArea) {\n if (this._plotAreas.has(plotArea))\n return;\n \n this._plotAreas.add(plotArea);\n \n plotArea.addTo(this.svgNode);\n plotArea.onCoordinateSystemChange();\n for (let sounding of this)\n if ('addSounding' in plotArea)\n plotArea.addSounding(sounding);\n \n return this;\n }\n \n /**\n * Removes a PlotArea object from this thermodynamic diagram.\n * \n * @param {module:meteoJS/thermodynamicDiagram/plotArea.PlotArea} plotArea\n * PlotArea object.\n * @returns {module:meteoJS/thermodynamicDiagramPluggable.ThermodynamicDiagramPluggable}\n * This.\n */\n removePlotArea(plotArea) {\n if (!this._plotAreas.has(plotArea))\n return;\n \n for (let sounding of this)\n plotArea.removeSounding(sounding);\n this._plotAreas.delete(plotArea);\n \n return this;\n }\n \n /**\n * Exchanges the coordinate system in the PlotArea objects. The optional,\n * second argument defines an already used coordinate system. If this\n * argument is passed, only the coordinate system of the PlotArea's with\n * this coordinate system will exchanged.\n * \n * @param {module:meteoJS/thermodynamicDiagram/coordinateSystem.CoordinateSystem}\n * coordinateSystem - Coordinate system.\n * @param {module:meteoJS/thermodynamicDiagram/coordinateSystem.CoordinateSystem}\n * [formerCoordinateSystem=undefined] - Coordinate system.\n */\n exchangeCoordinateSystem(\n coordinateSystem,\n formerCoordinateSystem = undefined\n ) {\n for (let plotArea of this._plotAreas)\n if (formerCoordinateSystem === undefined ||\n plotArea.coordinateSystem === formerCoordinateSystem)\n plotArea.coordinateSystem = coordinateSystem;\n }\n \n /**\n * Add a sounding to the diagram.\n * \n * @param {module:meteoJS/sounding.Sounding} sounding - Sounding object.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding~options}\n * [options] - Display options.\n * @returns {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * Sounding object for the diagram with display options.\n */\n addSounding(sounding, options = {}) {\n let diagramSounding = new DiagramSounding(sounding, options);\n let i = 1;\n let id = `sounding-${i}`;\n while (this.containsId(id)) {\n i++;\n id = `sounding-${i}`;\n }\n diagramSounding.id = id;\n this.append(diagramSounding);\n return diagramSounding;\n }\n \n}\nexport default ThermodynamicDiagramPluggable;","/**\n * @module meteoJS/thermodynamicDiagram/coordinateSystem\n */\nimport { tempCelsiusToKelvin,\n tempByPotentialTempAndPres,\n tempByEquiPotTempAndPres,\n potentialTempByTempAndPres,\n dewpointByHMRAndPres,\n saturationHMRByTempAndPres } from '../calc.js';\nimport addEventFunctions from '../Events.js';\n\n/**\n * Options change event.\n * \n * @event module:meteoJS/thermodynamicDiagram/coordinateSystem#change:options\n */\n\n/**\n * Pressure options.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram/coordinateSystem~pressureOptions\n * @property {number} [min=100] - Minimum pressure on the diagram.\n * @property {number} [max=1050] - Maximum pressure on the diagram.\n */\n\n/**\n * Temperature options.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram/coordinateSystem~temperatureOptions\n * @property {number} [min=-40°C]\n * Temperature either on bottom-left on the diagram (if reference equals\n * 'base') or on the left of an isobar (if reference is a number).\n * @property {number} [max=45°C]\n * Temperature either on bottom-right on the diagram (if reference equals\n * 'base') or on the right of an isobar (if reference is a number).\n * @property {'base'|integer} [reference='base']\n * Reference for 'min' and 'max' values. Allowed values: 'base' or number.\n * @property {integer} [inclinationAngle=45]\n * Angle of inclination to the right of the isotherms. Allowed values between\n * 0 and 90 (exclusive), in degrees.\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram/coordinateSystem~options\n * @param {integer} [width=100] - Width of the diagram.\n * @param {integer} [height=100] - Height of the diagram.\n * @param {module:meteoJS/thermodynamicDiagram/coordinateSystem~pressureOptions}\n * [pressure] - Pressure options.\n * @param {module:meteoJS/thermodynamicDiagram/coordinateSystem~temperatureOptions}\n * [temperature] - Temperature options.\n */\n\n/**\n * Abstract class to specify the coordinate system of the thermodynamicDiagram.\n * \n * Child classes define the explicit coordinate system.\n * This class defines already: (can be overridden by child classes)\n * * log-P y-axes with horizontal isobars\n * * straight isotherms, inclinated to the right\n * \n * <pre><code>import CoordinateSystem from 'meteojs/thermodynamicDiagram/CoordinateSystem';</code></pre>\n * \n * @abstract\n * @fires module:meteoJS/thermodynamicDiagram/coordinateSystem#change:options\n */\nexport class CoordinateSystem {\n \n /**\n * @param {module:meteoJS/thermodynamicDiagram/coordinateSystem~options} options\n */\n constructor({\n width = 100,\n height = 100,\n pressure = {},\n temperature = {}\n } = {}) {\n /**\n * @type integer\n * @private\n */\n this._width = width;\n \n /**\n * @type integer\n * @private\n */\n this._height = height;\n \n /**\n * @type number\n * @private\n */\n this.temperatureBottomLeft;\n \n /**\n * @type number\n * @private\n */\n this.temperatureBottomRight;\n \n /**\n * @type number\n * @private\n */\n this.inclinationTan;\n \n /**\n * @type Object\n * @private\n */\n this.options = {\n pressure: {},\n temperature: {}\n };\n \n this._initPressureOptions(pressure);\n this._initTemperatureOptions(temperature);\n }\n \n /**\n * Visible width, in pixels.\n * \n * @type integer\n * @public\n */\n get width() {\n return this._width;\n }\n set width(width) {\n const oldWidth = this._width;\n this._width = width;\n if (oldWidth != this._width)\n this.trigger('change:options');\n }\n \n /**\n * Visible height, in pixels.\n * \n * @type integer\n * @public\n */\n get height() {\n return this._height;\n }\n set height(height) {\n const oldHeight = this._height;\n this._height = height;\n if (oldHeight != this._height)\n this.trigger('change:options');\n }\n \n /**\n * Returns if isobars are straight lines in the defined coordinate system.\n * \n * @returns {boolean}\n */\n isIsobarsStraightLine() {\n return true;\n }\n\n /**\n * Returns if the dry adiabats are straight lines\n * in the defined coordinate system.\n * \n * @returns {boolean}\n */\n isDryAdiabatStraightLine() {\n return false;\n }\n \n /**\n * @returns {boolean}\n */\n isIsothermsVertical() {\n return (this.options.temperature.inclinationAngle !== undefined) &&\n (this.options.temperature.inclinationAngle == 0);\n }\n\n /**\n * Pressure for a x-y coordinate.\n * Implementation valid for horizontal isobars, log-P y-axes.\n * \n * @param {number} x - Pixels from the left.\n * @param {number} y - Pixels from bottom.\n * @returns {number} Pressure in hPa.\n */\n getPByXY(x, y) {\n return Math.pow(this.options.pressure.min, y / this.height) *\n Math.pow(this.options.pressure.max,\n (this.height - y)/this.height);\n }\n\n /**\n * Temperature for x-y coordinate.\n * Implementation valid for straight isotherms.\n * \n * @param {number} x - Pixels from the left.\n * @param {number} y - Pixels from bottom.\n * @returns {number} Temperature in Kelvin.\n */\n getTByXY(x, y) {\n // bottom x coordinate of isotherm\n let x0 = x - y * this.inclinationTan;\n return this.temperatureBottomLeft +\n x0 *\n (this.temperatureBottomRight-this.temperatureBottomLeft) / this.width;\n }\n\n /**\n * y coordinate for pressure and x coordinate.\n * Implementation valid for horizontal isobars, log-P y-axes.\n * \n * @param {number} x - Pixels from the left.\n * @param {number} p - Pressure in hPa.\n * @returns {number} Pixels from bottom.\n */\n getYByXP(x, p) {\n return this.height *\n Math.log(this.options.pressure.max / p) /\n Math.log(this.options.pressure.max / this.options.pressure.min);\n }\n\n /**\n * Temperature for pressure and x coordinate.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} x - Pixels from the left.\n * @param {number} p - Pressure in hPa.\n * @returns {number} Temperature in Kelvin.\n */\n getTByXP(x, p) {\n return this.getTByXY(x, this.getYByXP(x, p));\n }\n\n /**\n * x coordinate for temperature and y coordinate.\n * Implementation valid for straight isotherms.\n * \n * @param {number} y - Pixels from bottom.\n * @param {number} T - Temperature in Kelvin.\n * @returns {number} Pixels from the left.\n */\n getXByYT(y, T) {\n // bottom x coordinate \n let x0 =\n (T-this.temperatureBottomLeft) *\n this.width / (this.temperatureBottomRight-this.temperatureBottomLeft);\n return x0 + y * this.inclinationTan;\n }\n\n /**\n * y coordinate for temperature and x coordinate.\n * Implementation valid for straight isotherms.\n * \n * @param {number} x - Pixels from the left.\n * @param {number} T - Temperature in Kelvin.\n * @returns {number|undefined} Pixels from bottom.\n */\n getYByXT(x, T) {\n return (this.inclinationTan != 0) ?\n (x - this.getXByYT(0, T)) / this.inclinationTan :\n undefined;\n }\n\n /**\n * x coordinate for pressure and temperature.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} p - Pressure in hPa.\n * @param {number} T - Temperature in Kelvin.\n * @returns {number} Pixels from the left.\n */\n getXByPT(p, T) {\n return this.getXByYT(this.getYByXP(0, p), T);\n }\n\n /**\n * y coordinate for pressure and temperature.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} p - Pressure in hPa.\n * @param {number} T - Temperature in Kelvin.\n * @returns {number} Pixels from bottom.\n */\n getYByPT(p) {\n return this.getYByXP(0, p);\n }\n\n /**\n * x coordinate for potential temperature and y coordinate.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} y - Pixels from bottom.\n * @param {number} T - Potential temperature in Kelvin.\n * @returns {number} Pixels from the left.\n */\n getXByYPotentialTemperature(y, T) {\n T = tempByPotentialTempAndPres(T, this.getPByXY(0, y));\n return this.getXByYT(y, T);\n }\n\n /**\n * y coordinate for potential temperature and x coordinate.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} x - Pixels from the left.\n * @param {number} T - Potential temperature in Kelvin.\n * @returns {number|undefined} Pixels from bottom.\n */\n getYByXPotentialTemperature(x, T) {\n let a = this.getPByXY(x, 0);\n let b = this.getPByXY(x, this.height);\n if (potentialTempByTempAndPres(this.getTByXP(x, b), b) < T ||\n T < potentialTempByTempAndPres(this.getTByXP(x, a), a))\n return undefined;\n while (a-b > 10) {\n let p = b+(a-b)/2;\n let tBin = this.getTByXP(x, p);\n let potTemp = potentialTempByTempAndPres(tBin, p);\n if (potTemp === undefined)\n return undefined;\n if (potTemp < T)\n a = p;\n else\n b = p;\n }\n let y = this.getYByXP(x, b+(a-b)/2);\n return y;\n }\n\n /**\n * x coordinate for pressure and potential temperature.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} p - Pressure in hPa.\n * @param {number} T - Potential temperature in Kelvin.\n * @returns {number} Pixels from the left.\n */\n getXByPPotentialTemperatur(p, T) {\n T = tempByPotentialTempAndPres(T, p);\n return this.getXByPT(p, T);\n }\n\n /**\n * y coordinate for pressure and potential temperature.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} p - Pressure in hPa.\n * @param {number} T - Potential temperature in Kelvin.\n * @returns {number} Pixels from bottom.\n */\n getYByPPotentialTemperatur(p, T) {\n let x = this.getXByPPotentialTemperatur(p, T);\n return this.getYByXPotentialTemperature(x, T);\n }\n\n /**\n * x coordinate for humid mixing ratio and y coordinate.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} y - Pixels from bottom.\n * @param {number} hmr - Humid mixing ratio. []\n * @returns {number} Pixels from the left.\n */\n getXByYHMR(y, hmr) {\n let p = this.getPByXY(0, y); // horizontal isobars\n return this.getXByYT(y, dewpointByHMRAndPres(hmr, p));\n }\n\n /**\n * y coordinate for humid mixing ratio and x coordinate.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} x - Pixels from the left.\n * @param {number} hmr - Humid mixing ratio. []\n * @returns {number|undefined} Pixels from bottom.\n */\n getYByXHMR(x, hmr) {\n let a = this.getPByXY(x, 0);\n let b = this.getPByXY(x, this.height);\n while (a-b > 10) {\n let p = b+(a-b)/2;\n let hmrp = saturationHMRByTempAndPres(this.getTByXP(x, p), p);\n if (hmrp === undefined)\n return undefined;\n if (hmrp < hmr)\n b = p;\n else\n a = p;\n }\n let y = this.getYByXP(x, b+(a-b)/2);\n return y;\n }\n\n /**\n * x coordinate for pressure and humid mixing ratio.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} p - Pressure in hPa.\n * @param {number} hmr - Humid mixing ratio. []\n * @returns {number} Pixels from the left.\n */\n getXByPHMR(p, hmr) {\n let dewpoint = dewpointByHMRAndPres(hmr, p);\n return this.getXByPT(p, dewpoint);\n }\n\n /**\n * y coordinate for pressure and humid mixing ratio.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} p - Pressure in hPa.\n * @param {number} hmr - Humid mixing ratio. []\n * @returns {number|undefined} Pixels from bottom.\n */\n getYByPHMR(p, hmr) {\n let dewpoint = dewpointByHMRAndPres(hmr, p);\n return this.getYByPT(p, dewpoint);\n }\n\n /**\n * x coordinate for equipotential temperature and y coordainte.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} y - Pixels from bottom.\n * @param {number} thetae - Equipotential temperaturen in Kelvin.\n * @returns {number} Pixels from the left.\n */\n getXByYEquiPotTemp(y, thetae) {\n let T = tempByEquiPotTempAndPres(thetae, this.getPByXY(0, y));\n return this.getXByYT(y, T);\n }\n\n /**\n * y coordinate for equipotential temperature and x coordinate.\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} x - Pixels from the left.\n * @param {number} thetae - Equipotential temperaturen in Kelvin.\n * @returns {number|undefined} Pixels from bottom.\n */\n getYByXEquiPotTemp(x, thetae) {\n let a = 0;\n let b = this.height;\n let y = undefined;\n while (b-a > 10) {\n y = a+(b-a)/2;\n let thetaEY =\n this.getYByXT(x,\n tempByEquiPotTempAndPres(thetae, this.getPByXY(x, y)));\n if (thetaEY === undefined)\n return undefined;\n if (thetaEY < thetae)\n b = y;\n else\n a = y;\n }\n return y;\n }\n\n /**\n * x coordinate for pressure and equipotential temperature .\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} p - Pressure in hPa.\n * @param {number} thetae - Equipotential temperaturen in Kelvin.\n * @returns {number} Pixels from the left.\n */\n getXByPEquiPotTemp(p, thetae) {\n let T = tempByEquiPotTempAndPres(thetae, p);\n return this.getXByPT(p, T);\n }\n\n /**\n * y coordinate for pressure and equipotential temperature .\n * Implementation valid for horizontal isobars, log-P y-axes and straight\n * isotherms.\n * \n * @param {number} p - Pressure in hPa.\n * @param {number} thetae - Equipotential temperaturen in Kelvin.\n * @returns {number|undefined} Pixels from bottom.\n */\n getYByPEquiPotTemp(p, thetae) {\n let T = tempByEquiPotTempAndPres(thetae, p);\n return this.getYByPT(p, T);\n }\n \n /**\n * Updates options. To restore a default value, pass undefined.\n * \n * @param {Object} [options] - Options.\n * @param {module:meteoJS/thermodynamicDiagram/coordinateSystem~pressureOptions}\n * [options.pressure] - Pressure options.\n * @param {module:meteoJS/thermodynamicDiagram/coordinateSystem~temperatureOptions}\n * [options.temperature] - Temperature options.\n */\n update({\n pressure = {},\n temperature = {}\n } = {}) {\n if ('min' in pressure)\n this.options.pressure.min =\n (pressure.min === undefined) ? 100 : pressure.min;\n if ('max' in pressure)\n this.options.pressure.max =\n (pressure.max === undefined) ? 1000 : pressure.max;\n \n if ('min' in temperature)\n this.options.temperature.min =\n (temperature.min === undefined)\n ? tempCelsiusToKelvin(-40) : temperature.min;\n if ('max' in temperature)\n this.options.temperature.max =\n (temperature.max === undefined)\n ? tempCelsiusToKelvin(-45) : temperature.max;\n if ('reference' in temperature)\n this.options.temperature.reference =\n (temperature.reference === undefined) ? 'base' : temperature.reference;\n if ('inclinationAngle' in temperature)\n this.options.temperature.inclinationAngle =\n (temperature.inclinationAngle === undefined)\n ? 45 : temperature.inclinationAngle;\n \n this._normalizeTemperatureRange();\n \n this.trigger('change:options');\n }\n \n /**\n * @private\n */\n _initPressureOptions({\n min = 100,\n max = 1050\n }) {\n this.options.pressure = {\n min,\n max\n };\n }\n \n /**\n * @private\n */\n _initTemperatureOptions({\n min = tempCelsiusToKelvin(-40),\n max = tempCelsiusToKelvin(45),\n reference = 'base',\n inclinationAngle = 45\n }) {\n this.options.temperature = {\n min,\n max,\n reference,\n inclinationAngle\n };\n \n this._normalizeTemperatureRange();\n }\n \n /**\n * @internal\n */\n _normalizeTemperatureRange() {\n this.temperatureBottomLeft = this.options.temperature.min;\n this.temperatureBottomRight = this.options.temperature.max;\n this.inclinationTan =\n (this.options.temperature.inclinationAngle == 45) ?\n 1 :\n (this.options.temperature.inclinationAngle == 0) ?\n 0 :\n Math.tan(this.options.temperature.inclinationAngle * Math.PI/180);\n \n // specific pressure level for temperature range\n if (/^[0-9]+$/.test(this.options.temperature.reference)) {\n let yReference = this.getYByXP(0, this.options.temperature.reference);\n let xTmin = this.inclinationTan * yReference;\n let deltaT =\n (this.temperatureBottomRight - this.temperatureBottomLeft) /\n this.width;\n this.temperatureBottomLeft += deltaT * xTmin;\n this.temperatureBottomRight += deltaT * xTmin;\n }\n }\n}\naddEventFunctions(CoordinateSystem.prototype);\nexport default CoordinateSystem;","/**\n * @module meteoJS/thermodynamicDiagram/coordinateSystem/stueveDiagram\n */\n\nimport CoordinateSystem from '../CoordinateSystem.js';\n\nconst k = 0.2857;\n\n/**\n * Coordinate system for a Stüve-Diagram. Straight lines:\n * * pressure/isobars (horizontal)\n * * temperature/isotherms (vertical)\n * * potential temperature/dry adiabats\n * \n * y-Axes in exponential Scale: p^k (k = 0.2857), thus dry adiabats are\n * straight lines (M. K. Yau and R. R. Rogers, Short Course in Cloud Physics,\n * Third Edition, published by Butterworth-Heinemann, pp. 8).\n * \n * @see {@link https://en.wikipedia.org/wiki/St%C3%BCve_diagram}\n * @extends module:meteoJS/thermodynamicDiagram/coordinateSystem.CoordinateSystem\n */\nexport class StueveDiagram extends CoordinateSystem {\n\n /**\n * @inheritdoc\n */\n constructor({\n width = 100,\n height = 100,\n pressure = {},\n temperature = {}\n } = {}) {\n // vertical isotherms\n temperature.inclinationAngle = 0;\n \n super({\n width,\n height,\n pressure,\n temperature\n });\n }\n \n /**\n * @inheritdoc\n */\n isDryAdiabatStraightLine() {\n return true;\n }\n\n /**\n * @inheritdoc\n */\n getPByXY(x, y) {\n return Math.pow(\n Math.pow(this.options.pressure.max, k) -\n y *\n (Math.pow(this.options.pressure.max, k) -\n Math.pow(this.options.pressure.min, k)) /\n this.height,\n 1/k);\n }\n\n /**\n * @inheritdoc\n */\n getYByXP(x, p) {\n return this.height *\n (Math.pow(this.options.pressure.max, k) - Math.pow(p, k)) /\n (Math.pow(this.options.pressure.max, k) -\n Math.pow(this.options.pressure.min, k));\n }\n\n /**\n * @inheritdoc\n */\n getYByXT() {\n return undefined;\n }\n\n}\nexport default StueveDiagram;","/**\n * @module meteoJS/thermodynamicDiagram/coordinateSystem/emagram\n */\nimport CoordinateSystem from '../CoordinateSystem.js';\n\n/**\n * Coordinate system for an emagram. This diagram has straight lines:\n * Straight lines:\n * * pressure/isobars (horizontal)\n * * temperature/isotherms (vertical)\n * \n * @see {@link https://en.wikipedia.org/wiki/Emagram}\n * @extends module:meteoJS/thermodynamicDiagram/coordinateSystem.CoordinateSystem\n */\nexport class Emagram extends CoordinateSystem {\n \n /**\n * @inheritdoc\n */\n constructor({\n width = 100,\n height = 100,\n pressure = {},\n temperature = {}\n } = {}) {\n // vertical isotherms\n temperature.inclinationAngle = 0;\n \n super({\n width,\n height,\n pressure,\n temperature\n });\n }\n\n}\nexport default Emagram;","/**\n * @module meteoJS/thermodynamicDiagram/coordinateSystem/skewTlogPDiagram\n */\nimport CoordinateSystem from '../CoordinateSystem.js';\n\n/**\n * Coordinate system for a skew-T-log-P diagram. This diagram has straight lines:\n * * pressure/isobars (horizontal)\n * * temperature/isotherms (normally 45 degree inclination to the right)\n * \n * @extends module:meteoJS/thermodynamicDiagram/coordinateSystem.CoordinateSystem\n */\nexport class SkewTlogPDiagram extends CoordinateSystem {\n}\nexport default SkewTlogPDiagram;","/**\n * @module meteoJS/thermodynamicDiagram/plotArea\n */\nimport addEventFunctions from '../Events.js';\nimport { SVG } from '@svgdotjs/svg.js';\n\n/**\n * Event with a sounding object.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram/plotArea~backgroundEvent\n * @property {external:SVG} node\n * SVG node which contains the background nodes.\n */\n\n/**\n * Fired before creating the background.\n * \n * @event module:meteoJS/thermodynamicDiagram/plotArea#prebuild:background\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~backgroundEvent}\n */\n\n/**\n * Fired after creating the background.\n * \n * @event module:meteoJS/thermodynamicDiagram/plotArea#postbuild:background\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~backgroundEvent}\n */\n\n/**\n * Object passed on events.\n * \n * @typedef {external:Event} module:meteoJS/thermodynamicDiagram/plotArea~event\n * @property {number} elementX - X coordinate.\n * @property {number} elementY - Y coordinate.\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/plotArea#click\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/plotArea#dblclick\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/plotArea#mousedown\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/plotArea#mouseup\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/plotArea#mouseover\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/plotArea#mouseout\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/plotArea#mousemove\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/plotArea#touchstart\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/plotArea#touchmove\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/plotArea#touchleave\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/plotArea#touchend\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/plotArea#touchcancel\n * @type {module:meteoJS/thermodynamicDiagram/plotArea~event}\n */\n\n/**\n * Events options. On event a\n * {@link module:meteoJS/thermodynamicDiagram/plotArea~event}\n * is passed to the listener.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram/plotArea~eventsOptions\n * @property {Function} [click] - Click listener.\n * @property {Function} [dblclick] - Dblclick listener.\n * @property {Function} [mousedown] - Mousedown listener.\n * @property {Function} [mouseup] - Mouseup listener.\n * @property {Function} [mouseover] - Mouseover listener.\n * @property {Function} [mouseout] - Mouseout listener.\n * @property {Function} [mousemove] - Mousemove listener.\n * @property {Function} [touchstart] - Touchstart listener.\n * @property {Function} [touchmove] - Touchmove listener.\n * @property {Function} [touchleave] - Touchleave listener.\n * @property {Function} [touchend] - Touchend listener.\n * @property {Function} [touchcancel] - Touchcancel listener.\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram/plotArea~options\n * @param {external:SVG} [svgNode] - SVG Node.\n * @property {module:meteoJS/thermodynamicDiagram/coordinateSystem.CoordinateSystem}\n * [coordinateSystem] - Coordinate system.\n * @param {integer} [x=0] - X.\n * @param {integer} [y=0] - Y.\n * @param {integer} [width=100] - Width.\n * @param {integer} [height=100] - Height.\n * @param {Object} [style] - SVG-Style for this Area. Default: overflow=hidden.\n * @param {boolean} [visible=true] - Visibility.\n * @param {module:meteoJS/thermodynamicDiagram/plotArea~eventsOptions}\n * [events] - Events.\n */\n\n/**\n * Abstract class to define an area on the SVG.\n * \n * <pre><code>import PlotArea from 'meteojs/thermodynamicDiagram/PlotArea';</code></pre>\n * \n * @fires module:meteoJS/thermodynamicDiagram/plotArea#change:visible\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#change:position\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#change:extent\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#prebuild:background\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#postbuild:background\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#click\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#dblclick\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#mousedown\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#mouseup\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#mouseover\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#mouseout\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#mousemove\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#touchstart\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#touchmove\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#touchleave\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#touchend\n * @fires module:meteoJS/thermodynamicDiagram/plotArea#touchcancel\n */\nexport class PlotArea {\n \n /**\n * @param {module:meteoJS/thermodynamicDiagram/plotArea~options}\n * options - Options.\n */\n constructor({\n svgNode = undefined,\n coordinateSystem = undefined,\n x = 0,\n y = 0,\n width = 100,\n height = 100,\n style = {},\n visible = true,\n events = {}\n } = {}) {\n /**\n * @type external:SVG\n * @private\n */\n this._svgNode = SVG()\n .attr({\n x,\n y,\n width,\n height\n })\n .css(this._getNormalizedStyle(style))\n .css('display', visible ? 'inline' : 'none');\n if (svgNode !== undefined)\n this.addTo(svgNode);\n \n /**\n * @type external:SVG\n * @private\n */\n this._svgNodeBackground = this._svgNode.group();\n \n /**\n * @type boolean\n * @private\n */\n this._visible = visible;\n \n /**\n * @type module:meteoJS/thermodynamicDiagram/coordinateSystem.CoordinateSystem\n * @private\n */\n this._coordinateSystem = coordinateSystem;\n \n /**\n * @type mixed\n * @private\n */\n this._coordinateSystemListenerKey = (this._coordinateSystem !== undefined)\n ? this._coordinateSystem\n .on('change:options', () => this.onCoordinateSystemChange())\n : undefined;\n \n this.on('change:extent', () => this.onCoordinateSystemChange());\n \n this._initEvents(events);\n }\n \n /**\n * SVG container node.\n * \n * @type external:SVG\n * @public\n * @readonly\n */\n get svgNode() {\n return this._svgNode;\n }\n \n /**\n * Visibility of the area.\n * \n * @type boolean\n * @public\n */\n get visible() {\n return this._visible;\n }\n set visible(visible) {\n let oldVisible = this._visible;\n this._visible = visible;\n if (oldVisible != this._visible) {\n this._svgNode.style('display', this._visible ? 'inline' : 'none');\n this.trigger('change:visible');\n }\n }\n \n /**\n * X of the top-left edge.\n * \n * @type integer\n * @public\n */\n get x() {\n return this._svgNode.attr('x');\n }\n set x(x) {\n this._svgNode.attr({ x });\n this.trigger('change:position');\n }\n \n /**\n * Y of the top-left edge.\n * \n * @type integer\n * @public\n */\n get y() {\n return this._svgNode.attr('y');\n }\n set y(y) {\n this._svgNode.attr({ y });\n this.trigger('change:position');\n }\n \n /**\n * Width of the area.\n * \n * @type integer\n * @public\n */\n get width() {\n return this._svgNode.attr('width');\n }\n set width(width) {\n this._svgNode.attr({ width });\n this.trigger('change:extent');\n }\n \n /**\n * Height of the area.\n * \n * @type integer\n * @public\n */\n get height() {\n return this._svgNode.attr('height');\n }\n set height(height) {\n this._svgNode.attr({ height });\n this.trigger('change:extent');\n }\n \n /**\n * Overflow-style of the area.\n * \n * @type string\n * @public\n */\n get style() {\n return this._svgNode.css();\n }\n set style(style) {\n this._svgNode.css(style);\n }\n \n /**\n * Coordinate system.\n * \n * @type module:meteoJS/thermodynamicDiagram/coordinateSystem.CoordinateSystem\n * @public\n */\n get coordinateSystem() {\n return this._coordinateSystem;\n }\n set coordinateSystem(coordinateSystem) {\n if (this._coordinateSystemListenerKey !== undefined)\n this._coordinateSystem\n .un('change:options', this._coordinateSystemListenerKey);\n this._coordinateSystem = coordinateSystem;\n this._coordinateSystemListenerKey =\n this._coordinateSystem\n .on('change:options', () => this.onCoordinateSystemChange());\n this.onCoordinateSystemChange();\n }\n \n /**\n * Minimal extent length (either width or height).\n * \n * @type integer\n * @readonly\n */\n get minExtentLength() {\n return Math.min(this.width, this.height);\n }\n \n /**\n * Maximal extent length (either width or height).\n * \n * @type integer\n * @readonly\n */\n get maxExtentLength() {\n return Math.max(this.width, this.height);\n }\n \n /**\n * Sets the plot area as a child of the argument.\n * \n * @param {external:SVG} svgNode - SVG node.\n */\n addTo(svgNode) {\n this._svgNode.addTo(svgNode);\n }\n \n /**\n * Init the area.\n * \n * @protected\n */\n init() {\n this.onCoordinateSystemChange();\n }\n \n /**\n * Called, when the coordinateSystem object changes.\n * \n * @protected\n */\n onCoordinateSystemChange() {\n if (this._coordinateSystem !== undefined)\n this.drawBackground(this._svgNodeBackground);\n }\n \n /**\n * Draw background into SVG group.\n * \n * This method is only called, when this.coordinateSystem isn't undefined.\n * \n * @param {external:SVG} svgNode - SVG group, SVG.G.\n * @protected\n */\n drawBackground(svgNode) {\n svgNode.clear();\n this.trigger('prebuild:background', { node: svgNode });\n this._drawBackground(svgNode);\n this.trigger('postbuild:background', { node: svgNode });\n }\n \n /**\n * Method to inherit from child classes to draw the background of the plot\n * area.\n * \n * This method is only called, when this.coordinateSystem isn't undefined.\n * \n * @param {external:SVG} svgNode - SVG group, SVG.G.\n * @protected\n */\n _drawBackground() {}\n \n /**\n * Returns normalized SVG style.\n * \n * @private\n * @param {Object} style - Input SVG style.\n * @param {string} [style.overflow='hidden'] - Overflow style.\n * @returns {Object} - SVG style.\n */\n _getNormalizedStyle({\n overflow = 'hidden'\n }) {\n return {\n overflow\n };\n }\n \n /**\n * Initialize events.\n * \n * @param {Object} options - Options.\n * @private\n */\n _initEvents({\n click = undefined,\n dblclick = undefined,\n mousedown = undefined,\n mouseup = undefined,\n mouseover = undefined,\n mouseout = undefined,\n mousemove = undefined,\n touchstart = undefined,\n touchmove = undefined,\n touchleave = undefined,\n touchend = undefined,\n touchcancel = undefined\n }) {\n const events = {\n click,\n dblclick,\n mousedown,\n mouseup,\n mouseover,\n mouseout,\n mousemove,\n touchstart,\n touchmove,\n touchleave,\n touchend,\n touchcancel\n };\n Object.keys(events).forEach(eventKey => {\n this._svgNode.on(eventKey, e => {\n const customEvent =\n this.getExtendedEvent(e,\n this._svgNode.point(\n e.pageX - window.pageXOffset,\n e.pageY - window.pageYOffset));\n if (events[eventKey] !== undefined)\n events[eventKey].call(this, customEvent);\n this.trigger(eventKey, customEvent);\n });\n });\n }\n \n /**\n * Extend an event with some properties.\n * \n * @param {external:Event} e - Event.\n * @param {external:SVG} p - Point.\n * @protected\n */\n getExtendedEvent(e, p) {\n e.elementX = p.x;\n e.elementY = p.y;\n return e;\n }\n}\naddEventFunctions(PlotArea.prototype);\nexport default PlotArea;","/**\n * @module meteoJS/thermodynamicDiagram/plotDataArea\n */\nimport PlotArea from './PlotArea.js';\n\n/**\n * Event with a sounding object.\n * \n * @typedef {Object} module:meteoJS/thermodynamicDiagram/plotDataArea~soundingEvent\n * @property {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * sounding - Sounding.\n */\n\n/**\n * Fired on adding a sounding.\n * \n * @event module:meteoJS/thermodynamicDiagram/plotDataArea#add:sounding\n * @type {module:meteoJS/thermodynamicDiagram/plotDataArea~soundingEvent}\n */\n\n/**\n * Fired on removing a sounding.\n * \n * @event module:meteoJS/thermodynamicDiagram/plotDataArea#remove:sounding\n * @type {module:meteoJS/thermodynamicDiagram/plotDataArea~soundingEvent}\n */\n\n/**\n * Event with a sounding object and its SVG node.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotDataArea~soundingEvent}\n * module:meteoJS/thermodynamicDiagram/plotDataArea~insertSoundingEvent\n * @property {external:SVG} node - SVG node, SVG.G.\n */\n\n/**\n * Fired before inserting the sounding data into the svg.\n * \n * @event module:meteoJS/thermodynamicDiagram/plotDataArea#preinsert:sounding\n * @type {module:meteoJS/thermodynamicDiagram/plotDataArea~insertSoundingEvent}\n */\n\n/**\n * Fired after inserting the sounding data into the svg.\n * \n * @event module:meteoJS/thermodynamicDiagram/plotDataArea#postinsert:sounding\n * @type {module:meteoJS/thermodynamicDiagram/plotDataArea~insertSoundingEvent}\n */\n\n/**\n * Function to insert labels.\n * \n * @typedef {Function}\n * module:meteoJS/thermodynamicDiagram/plotDataArea~insertLabelsFunc\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * sounding - Diagram sounding to label.\n * @param {module:meteoJS/sounding~levelData} levelData - Data to label.\n * @param {external:SVG} group - SVG group to insert labels.\n */\n\n/**\n * Getter for the levelData of a certain DiagramSounding according to an event.\n * \n * @typedef {Function}\n * module:meteoJS/thermodynamicDiagram/plotDataArea~getLevelData\n * @param {Object} options - Options.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * options.hoverLabelsSounding\n * For this sounding, the hover labels are shown.\n * @param {module:meteoJS/thermodynamicDiagram/plotArea~event} options.e\n * This event raised the display of hover labels.\n * @param {undefined|number} options.maxDistance\n * Maximum distance to a data point to show a hover label in pixels.\n * If undefined, always a hover label to the nearest point is shown.\n * @returns {module:meteoJS/sounding~levelData}\n * The data to show in the label. This data is passed to\n * {@link module:meteoJS/thermodynamicDiagram/plotDataArea~insertLabelsFunc}.\n */\n\n/**\n * For the returned sounding, the hover labels are shown. As input all\n * currently visible soundings are passed.\n * \n * @typedef {Function}\n * module:meteoJS/thermodynamicDiagram/plotDataArea~getHoverSounding\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding[]}\n * soundings - Currently visible soundings. Array length is always at least 1.\n * @returns {undefined|module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * For this returned sounding, the hover labels are shown. No hover labes are\n * shown, if undefined is returned.\n */\n\n/**\n * Options for labels on hovering the plot area.\n * \n * @typedef {Object}\n * module:meteoJS/thermodynamicDiagram/plotDataArea~hoverLabelsOptions\n * @property {boolean} [visible=true] - Visibility.\n * @property {string} [type='mousemove'] - Event type.\n * @property {number} [maxDistance=undefined]\n * Maximum distance to a data point to show a hover label in pixels.\n * If undefined, always a hover label to the nearest point is shown.\n * @property {boolean} [remote=true]\n * Show labels relative to the mouse position on the diagram, even when the\n * pointer isn't directly on the plot area.\n * @property {module:meteoJS/thermodynamicDiagram/plotDataArea~insertLabelsFunc}\n * [insertLabelsFunc] - Called to insert labels into a SVG group.\n * @property {module:meteoJS/thermodynamicDiagram/plotDataArea~getLevelData}\n * [getLevelData] - .\n * @property {module:meteoJS/thermodynamicDiagram/plotDataArea~getHoverSounding}\n * [getHoverSounding] - Default: Return the first sounding of the\n * passed input array.\n */\n\n/**\n * Visibility of the sounding in an area.\n * \n * @typedef {Function}\n * module:meteoJS/thermodynamicDiagram/plotDataArea~getSoundingVisibility\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * sounding - Sounding to determine its visibility.\n * @returns {boolean} Visibility.\n */\n\n/**\n * Returns x and y coordinates in the Plot-Area for the passed levelData.\n * \n * @typedef {Function}\n * module:meteoJS/thermodynamicDiagram/plotDataArea~getCoordinatesByLevelData\n * @param {string} dataGroupId - Data group id.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * sounding - Corresponding sounding.\n * @param {module:meteoJS/sounding~levelData}\n * levelData - Level data of the sounding.\n * @param {module:meteoJS/thermodynamicDiagram/plotDataArea.PlotDataArea}\n * plotArea - Plot-Area.\n * @returns {Object} - Containing x and y.\n */\n\n/**\n * Draws data into a SVG node.\n * \n * @typedef {Function}\n * module:meteoJS/thermodynamicDiagram/plotDataArea~insertDataGroupInto\n * @param {external:SVG} svgNode - Insert sounding data into this SVG node.\n * @param {string} dataGroupId - Data group id.\n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * sounding - Corresponding sounding.\n * @param {Object[]}\n * data - Data of the sounding, containing x and y coordinates and levelData.\n * @param {module:meteoJS/thermodynamicDiagram/plotDataArea.PlotDataArea}\n * plotArea - Plot-Area.\n */\n\n/**\n * Filter data point before drawing.\n * \n * @typedef {Function}\n * module:meteoJS/thermodynamicDiagram/plotDataArea~filterDataPoint\n * @param {Object} pointData - Point data.\n * @param {module:meteoJS/sounding~levelData} pointData.levelData - Level data.\n * @param {number} pointData.x - x coordinate of the data point.\n * @param {nmber} pointData.y - y coordinate of the data point.\n * @param {Object} lastPointData - Data of the last point.\n * @param {module:meteoJS/sounding~levelData} [lastPointData.levelData]\n * Level data of the last point.\n * @param {number} [lastPointData.x] - x coordinate of the last data point.\n * @param {nmber} [lastPointData.y] - y coordinate of the last data point.\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotArea~options}\n * module:meteoJS/thermodynamicDiagram/plotDataArea~options\n * @property {module:meteoJS/thermodynamicDiagram/plotDataArea~hoverLabelsOptions}\n * [hoverLabels] - Hover labels options.\n * @param {module:meteoJS/thermodynamicDiagram/plotDataArea~getSoundingVisibility} [getSoundingVisibility]\n * Takes a sounding object and returns the visibility for the area.\n * @param {string[]} [dataGroupIds=[]] - IDs of several grouped datas.\n * @param {module:meteoJS/thermodynamicDiagram/plotDataArea~getCoordinatesByLevelData}\n * [getCoordinatesByLevelData] - Coordinate function.\n * @param {module:meteoJS/thermodynamicDiagram/plotDataArea~insertDataGroupInto}\n * [insertDataGroupInto] - SVG drawing function.\n * @param {undefined|module:meteoJS/thermodynamicDiagram/plotDataArea~filterDataPoint}\n * [filterDataPoint] - Function to filter data points, that shouldn't be\n * plotted. If undefined, no data point is filtered\n * (expect minDataPointsDistance is set).\n * @param {number} [minDataPointsDistance=0]\n * Minimum distance between data points in pixels. If filterDataPoint is set,\n * minDataPointsDistance is ignored.\n */\n\n/**\n * Abstract class to define an area on the SVG with sounding data.\n * \n * <pre><code>import PlotDataArea from 'meteojs/thermodynamicDiagram/PlotDataArea';</code></pre>\n * \n * @extends module:meteoJS/thermodynamicDiagram/plotArea.PlotArea\n * \n * @fires module:meteoJS/thermodynamicDiagram/plotDataArea#add:sounding\n * @fires module:meteoJS/thermodynamicDiagram/plotDataArea#remove:sounding\n * @fires module:meteoJS/thermodynamicDiagram/plotDataArea#prebuild:sounding\n * @fires module:meteoJS/thermodynamicDiagram/plotDataArea#postbuild:sounding\n */\nexport class PlotDataArea extends PlotArea {\n \n /**\n * @param {module:meteoJS/thermodynamicDiagram/plotDataArea~options}\n * options - Options.\n */\n constructor({\n svgNode = undefined,\n coordinateSystem = undefined,\n x = 0,\n y = 0,\n width = 100,\n height = 100,\n style = {},\n visible = true,\n events = {},\n hoverLabels = {},\n getSoundingVisibility = sounding => sounding.visible,\n dataGroupIds = [],\n getCoordinatesByLevelData = () => { return { x: undefined, y: undefined }; },\n insertDataGroupInto = () => {},\n filterDataPoint = undefined,\n minDataPointsDistance = 0\n } = {}) {\n super({\n svgNode,\n coordinateSystem,\n x,\n y,\n width,\n height,\n style,\n visible,\n events\n });\n \n /**\n * @type Function\n * @private\n */\n this._getSoundingVisibility = getSoundingVisibility;\n \n /**\n * @type string[]\n * @private\n */\n this._dataGroupIds = dataGroupIds;\n \n /**\n * @type module:meteoJS/thermodynamicDiagram/plotDataArea~getCoordinatesByLevelData\n * @private\n */\n this._getCoordinatesByLevelData = getCoordinatesByLevelData;\n \n /**\n * @type module:meteoJS/thermodynamicDiagram/plotDataArea~insertDataGroupInto\n * @private\n */\n this._insertDataGroupInto = insertDataGroupInto;\n \n /**\n * @type undefined|module:meteoJS/thermodynamicDiagram/plotDataArea~filterDataPoint\n * @private\n */\n this._filterDataPoint = filterDataPoint;\n \n /**\n * @type number\n * @private\n */\n this._minDataPointsDistance = minDataPointsDistance;\n \n /**\n * @type external:SVG\n * @private\n */\n this._svgNodeData = this.svgNode.group();\n \n /**\n * Contains all soundings to draw as key. The value-object contains 3 items:\n * group (SVG), listenerKeyVisible, listenerKeyOptions.\n * \n * @type Map.<module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding,Object>\n * @private\n */\n this._soundings = new Map();\n \n /**\n * @type external:SVG\n * @private\n */\n this._hoverLabelsGroup = this.svgNode.group();\n\n /**\n * @type module:meteoJS/thermodynamicDiagram/plotDataArea~getHoverSounding\n * @private\n */\n this._getHoverSounding; // Will be set inside _initHoverLabels()\n \n this._initHoverLabels(hoverLabels);\n }\n \n /**\n * Groups of different data to plot onto the plot area.\n * \n * @type string[]\n * @readonly\n */\n get dataGroupIds() {\n return this._dataGroupIds;\n }\n \n /**\n * Returns x and y coordinated of some sounding data.\n * \n * @type module:meteoJS/thermodynamicDiagram/plotDataArea~getCoordinatesByLevelData\n * @readonly\n */\n get getCoordinatesByLevelData() {\n return this._getCoordinatesByLevelData;\n }\n \n /**\n * Minimum distance between data points in pixels.\n * \n * @type number\n */\n get minDataPointsDistance() {\n return this._minDataPointsDistance;\n }\n set minDataPointsDistance(minDataPointsDistance) {\n const oldValue = this._minDataPointsDistance;\n this._minDataPointsDistance = minDataPointsDistance;\n \n if (oldValue != this._minDataPointsDistance)\n this.drawSoundings();\n }\n \n /**\n * The current sounding, for which hover labels should be shown.\n * \n * @type undefined|module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding\n * @readonly\n * @private\n */\n get hoverLabelsSounding() {\n const soundings = [];\n for (let sounding of this._soundings.keys()) {\n if (this._getSoundingVisibility(sounding))\n soundings.push(sounding);\n }\n if (soundings.length > 0)\n return this._getHoverSounding(soundings);\n return undefined;\n }\n \n /**\n * Adds a sounding to draw into the area.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * sounding - Sounding object.\n */\n addSounding(sounding) {\n let group = this._svgNodeData.group();\n let listenerKeyVisible = sounding.on('change:visible',\n () => this.onChangeSoundingVisibility(sounding, group));\n let listenerKeyOptions = sounding.on('change:options', () => {\n if (this.coordinateSystem !== undefined)\n this.drawSounding(sounding, group);\n this.onChangeSoundingVisibility(sounding, group);\n });\n this._soundings.set(sounding, {\n group,\n listenerKeyVisible,\n listenerKeyOptions\n });\n this.trigger('add:sounding', sounding);\n \n if (this.coordinateSystem !== undefined)\n this.drawSounding(sounding, group);\n /* Don't call onChangeSoundingVisibility here.\n * This is due to PlotAltitudeDataArea. In this class, hoverLabels will get\n * invisible, when onChangeSoundingVisibility is called. This is not itended\n * when the added sounding is invisible. But intended if the sounding is\n * visible. */\n this.setDisplayOfSounding(sounding, group);\n }\n \n /**\n * Removes a sounding from the area.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * sounding - Sounding object.\n */\n removeSounding(sounding) {\n if (this._soundings.has(sounding)) {\n this._soundings.get(sounding).group.remove();\n sounding.un(this._soundings.get(sounding).listenerKeyVisible);\n sounding.un(this._soundings.get(sounding).listenerKeyOptions);\n this._soundings.delete(sounding);\n }\n this.trigger('remove:sounding', sounding);\n }\n \n /**\n * Called, when the coordinateSystem object changes.\n * \n * @override\n */\n onCoordinateSystemChange() {\n super.onCoordinateSystemChange();\n \n this.drawSoundings();\n }\n \n /**\n * Called, when a sounding changes its visibilty.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * sounding - Sounding object.\n * @param {external:SVG} group - SVG group, SVG.G.\n * @protected\n */\n onChangeSoundingVisibility(sounding, group) {\n this.setDisplayOfSounding(sounding, group);\n this._hoverLabelsGroup.clear();\n }\n \n /**\n * Sets 'display' property of a SVG group of a sounding, depending of the\n * sounding's visibility.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * sounding - Sounding object.\n * @param {external:SVG} group - SVG group, SVG.G.\n * @protected\n */\n setDisplayOfSounding(sounding, group) {\n group.css('display',\n this._getSoundingVisibility(sounding) ? 'inline' : 'none');\n }\n \n /**\n * Draws all soundings.\n * \n * @protected\n */\n drawSoundings() {\n if (this.coordinateSystem === undefined)\n return;\n \n for (let sounding of this._soundings.keys())\n this.drawSounding(sounding, this._soundings.get(sounding).group);\n }\n \n /**\n * Draw the sounding into the SVG group.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * sounding - Sounding object.\n * @param {external:SVG} group - SVG group, SVG.G.\n * @protected\n */\n drawSounding(sounding, group) {\n group.clear();\n \n this.trigger('preinsert:sounding', { sounding, node: group });\n \n const soundingGroup = group.group();\n \n let data = {};\n const filterDataPointFunction = this._getFilterDataPointFunction();\n let lastLevel = {};\n sounding.sounding.getLevels().reverse().forEach(pres => {\n const levelData = sounding.sounding.getData(pres);\n \n this._dataGroupIds.forEach(dataGroupId => {\n if (!(dataGroupId in data))\n data[dataGroupId] = [];\n \n const level = {\n levelData,\n x: undefined,\n y: undefined\n };\n const {x, y} =\n this._getCoordinatesByLevelData(dataGroupId,\n sounding, level.levelData, this);\n level.x = x;\n level.y = y;\n \n if (x === undefined ||\n y === undefined ||\n filterDataPointFunction !== undefined &&\n filterDataPointFunction(level, {...lastLevel}))\n return;\n \n lastLevel = level;\n data[dataGroupId].push(level);\n });\n });\n \n Object.keys(data).forEach(dataGroupId => {\n if (data[dataGroupId].length > 0)\n this._insertDataGroupInto(soundingGroup, dataGroupId,\n sounding, data[dataGroupId], this);\n });\n \n this.trigger('postinsert:sounding', { sounding, node: group });\n\n /* Only hide hoverLabels, when Sounding is visible. */\n if (this._getSoundingVisibility(sounding))\n this._hoverLabelsGroup.clear();\n }\n \n /**\n * @private\n */\n _getFilterDataPointFunction() {\n return (this._filterDataPoint === undefined) ?\n makeFilterDataPointFunction(this._minDataPointsDistance) :\n this._filterDataPoint;\n }\n \n /**\n * Initialize hover labels options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/plotDataArea~hoverLabelsOptions}\n * options - Hover labels options.\n */\n _initHoverLabels({\n visible = true,\n type = 'mousemove',\n maxDistance = undefined,\n insertLabelsFunc = undefined,\n getLevelData = () => {},\n getHoverSounding = soundings => soundings.shift()\n }) {\n this._getHoverSounding = getHoverSounding;\n\n if (!visible ||\n insertLabelsFunc === undefined)\n return;\n \n this.on('change:extent', () => this._hoverLabelsGroup.clear());\n this.on(type, e => {\n const hoverLabelsSounding = this.hoverLabelsSounding;\n if (hoverLabelsSounding === undefined)\n return;\n\n insertLabelsFunc(hoverLabelsSounding,\n getLevelData({ hoverLabelsSounding, e , maxDistance }),\n this._hoverLabelsGroup);\n });\n }\n}\nexport default PlotDataArea;\n\n/**\n * Creates a filterDataPoint function. It filters data points, which doesn't\n * have a minimal distance.\n * \n * @param {number} minDataPointsDistance - Minimal distance.\n * @returns {undefined|module:meteoJS/thermodynamicDiagram/plotDataArea~filterDataPoint}\n * filterDataPoint function.\n * @private\n */\nfunction makeFilterDataPointFunction(minDataPointsDistance) {\n if (minDataPointsDistance === 0)\n return undefined;\n \n return ({ x, y }, lastPoint) => {\n if (lastPoint.x === undefined ||\n lastPoint.y === undefined) {\n lastPoint.x = x;\n lastPoint.y = y;\n return false;\n }\n const distance =\n Math.sqrt(Math.pow(x - lastPoint.x, 2) + Math.pow(y - lastPoint.y, 2));\n const result = (distance < minDataPointsDistance);\n if (!result) {\n lastPoint.x = x;\n lastPoint.y = y;\n }\n return result;\n };\n}","/**\n * @module meteoJS/thermodynamicDiagram/plotAltitudeDataArea\n */\nimport PlotDataArea from './PlotDataArea.js';\n\n/**\n * Options for labels on hovering the diagram. Extended by the \"remote\" option.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotDataArea~hoverLabelsOptions}\n * module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea~hoverLabelsOptions\n * @property {boolean} [remote=true]\n * Show labels relative to the mouse position on the diagram, even when the\n * pointer isn't directly on the plot area.\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotDataArea~options}\n * module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea~options\n * @property {module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea~hoverLabelsOptions}\n * [hoverLabels] - Hover labels options.\n */\n\n/**\n * Abstract class to define an area on the SVG with sounding data, plotted with\n * pressure on the y-axis.\n * \n * <pre><code>import PlotAltitudeDataArea from 'meteojs/thermodynamicDiagram/PlotAltitudeDataArea';</code></pre>\n * \n * @extends module:meteoJS/thermodynamicDiagram/plotDataArea.PlotDataArea\n */\nexport class PlotAltitudeDataArea extends PlotDataArea {\n \n /**\n * @param {module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea~options}\n * options - Options.\n */\n constructor({\n svgNode = undefined,\n coordinateSystem = undefined,\n x = 0,\n y = 0,\n width = 100,\n height = 100,\n style = {},\n visible = true,\n events = {},\n hoverLabels = {},\n getSoundingVisibility = sounding => sounding.visible,\n dataGroupIds = undefined,\n getCoordinatesByLevelData = undefined,\n insertDataGroupInto = undefined,\n filterDataPoint = undefined,\n minDataPointsDistance = 0\n } = {}) {\n super({\n svgNode,\n coordinateSystem,\n x,\n y,\n width,\n height,\n style,\n visible,\n events,\n hoverLabels,\n getSoundingVisibility,\n dataGroupIds,\n getCoordinatesByLevelData,\n insertDataGroupInto,\n filterDataPoint,\n minDataPointsDistance\n });\n \n /**\n * @type boolean\n * @private\n */\n this._isHoverLabelsRemote;\n }\n \n /**\n * Extend an event with pressure.\n * \n * @override\n */\n getExtendedEvent(e, p) {\n e = super.getExtendedEvent(e, p);\n \n e.diagramPres = undefined;\n if (this.coordinateSystem !== undefined)\n e.diagramPres =\n this.coordinateSystem.getPByXY(0,\n this.coordinateSystem.height - e.elementY);\n \n return e;\n }\n \n /**\n * Show also hover labels when mouse isn't over the area.\n * \n * @type boolean\n * @readonly\n */\n get isHoverLabelsRemote() {\n return this._isHoverLabelsRemote;\n }\n \n /**\n * Initialize hover labels options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea~hoverLabelsOptions}\n * options - Hover labels options.\n * @override\n */\n _initHoverLabels({\n visible = true,\n type = 'mousemove',\n maxDistance = undefined,\n remote = true,\n insertLabelsFunc = undefined,\n getLevelData = ({ hoverLabelsSounding, e }) => {\n if (!e.diagramPres)\n return {};\n const sounding = hoverLabelsSounding.sounding;\n return sounding.getData(sounding.getNearestLevel(e.diagramPres));\n },\n getHoverSounding = undefined\n }) {\n this._isHoverLabelsRemote = remote;\n\n super._initHoverLabels({\n visible,\n type,\n maxDistance,\n insertLabelsFunc,\n getLevelData,\n getHoverSounding\n });\n }\n}\nexport default PlotAltitudeDataArea;","/**\n * @module meteoJS/thermodynamicDiagram/tdDiagram\n */\nimport {\n tempCelsiusToKelvin,\n tempKelvinToCelsius,\n potentialTempByTempAndPres,\n saturationHMRByTempAndPres,\n lclByPotentialTempAndHMR,\n lclTemperatureByTempAndDewpoint,\n equiPotentialTempByTempAndDewpointAndPres,\n wetbulbTempByTempAndDewpointAndPres,\n altitudeISAByPres\n} from '../calc.js';\nimport {\n getNormalizedLineStyleOptions,\n getNormalizedFontOptions,\n getFirstDefinedValue,\n drawTextInto\n} from './Functions.js';\nimport PlotAltitudeDataArea from './PlotAltitudeDataArea.js';\n\n/**\n * Object passed on events.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotArea~event}\n * module:meteoJS/thermodynamicDiagram/tdDiagram~event\n * @property {number} p - Pressure coordinate [hPa].\n * @property {number} T - Temperature coordinate [K].\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/tdDiagram#click\n * @type {module:meteoJS/thermodynamicDiagram/tdDiagram~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/tdDiagram#dblclick\n * @type {module:meteoJS/thermodynamicDiagram/tdDiagram~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/tdDiagram#mousedown\n * @type {module:meteoJS/thermodynamicDiagram/tdDiagram~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/tdDiagram#mouseup\n * @type {module:meteoJS/thermodynamicDiagram/tdDiagram~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/tdDiagram#mouseover\n * @type {module:meteoJS/thermodynamicDiagram/tdDiagram~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/tdDiagram#mouseout\n * @type {module:meteoJS/thermodynamicDiagram/tdDiagram~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/tdDiagram#mousemove\n * @type {module:meteoJS/thermodynamicDiagram/tdDiagram~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/tdDiagram#touchstart\n * @type {module:meteoJS/thermodynamicDiagram/tdDiagram~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/tdDiagram#touchmove\n * @type {module:meteoJS/thermodynamicDiagram/tdDiagram~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/tdDiagram#touchleave\n * @type {module:meteoJS/thermodynamicDiagram/tdDiagram~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/tdDiagram#touchend\n * @type {module:meteoJS/thermodynamicDiagram/tdDiagram~event}\n */\n\n/**\n * @event module:meteoJS/thermodynamicDiagram/tdDiagram#touchcancel\n * @type {module:meteoJS/thermodynamicDiagram/tdDiagram~event}\n */\n\n/**\n * Options for pressure label.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram~lineTextOptions}\n * module:meteoJS/thermodynamicDiagram/tdDiagram~presLabelOptions\n * @property {string|Object} [fill]\n * Fill option for background rect. Default is 'white' with opacity 0.7.\n * @property {number} [horizontalMargin=5] - Margin in x direction.\n * @property {number} [verticalMargin=0] - Margin in y direction.\n * @property {number|'100%'} [length=60]\n * Length of the horizontal line. A number is in pixel unit. A string\n * with a appended '%' indicates a length relative to the diagram width.\n * @property {'left'|'right'} [align='left']\n * Align pressure label left/right in the diagram.\n */\n\n/**\n * Options for labels.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram~lineTextOptions}\n * module:meteoJS/thermodynamicDiagram/tdDiagram~labelsOptions\n * @property {string|Object} [fill]\n * Fill option for background rect. Default is 'white' with opacity 0.7.\n * @property {number} [horizontalMargin=10] - Margin in x direction.\n * @property {number} [verticalMargin=0] - Margin in y direction.\n * @property {number} [radius=undefined] - Radius for hover circle.\n * @property {number} [radiusPlus=2]\n * Radius relative to line width for hover circle.\n */\n\n/**\n * Options for labels on hovering the thermodynamic diagram.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea~hoverLabelsOptions}\n * module:meteoJS/thermodynamicDiagram/tdDiagram~hoverLabelsOptions\n * @property {module:meteoJS/thermodynamicDiagram/tdDiagram~presLabelOptions}\n * [pres] - Options for pressure label.\n * @property {module:meteoJS/thermodynamicDiagram/tdDiagram~labelsOptions}\n * [temp] - Options for temperature label.\n * @property {module:meteoJS/thermodynamicDiagram/tdDiagram~labelsOptions}\n * [dewp] - Options for dew point label.\n * @property {module:meteoJS/thermodynamicDiagram/tdDiagram~labelsOptions}\n * [wetbulb] - Options for wetbulb temperature label.\n */\n\n/**\n * Options for parcels in the diagram.\n * \n * @typedef {Object}\n * module:meteoJS/thermodynamicDiagram/tdDiagram~parcelsOptions\n * @property {boolean} [visible=true] - Visibility of parcels.\n */\n\n/**\n * Definition of lines in a thermodynamic diagram.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram~lineStyleOptions}\n * module:meteoJS/thermodynamicDiagram/tdDiagram~linesOptions\n * @property {undefined|Array<number>} [highlightedLines=undefined]\n * Highlight lines at this values.\n * @property {undefined|Array<number>} [lines=undefined]\n * Draw values for this values.\n * @property {number} [max=undefined]\n * Maximum value for a line. Ignored if lines is set.\n * @property {number} [min=undefined]\n * Minimum value for a line. Ignored if lines is set.\n * @property {number} [interval=undefined]\n * Interval between different lines. Ignored if lines is set.\n * @property {number} [maxPressure=undefined]\n * Start line from this maximum pressure.\n * @property {number} [minPressure=undefined]\n * End line at this minimum pressure.\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea~options}\n * module:meteoJS/thermodynamicDiagram/tdDiagram~options\n * @param {module:meteoJS/thermodynamicDiagram/tdDiagram~linesOptions}\n * [isobars] - Isobars configuration.\n * @param {module:meteoJS/thermodynamicDiagram/tdDiagram~linesOptions}\n * [isotherms] - Isotherms configuration.\n * @param {module:meteoJS/thermodynamicDiagram/tdDiagram~linesOptions}\n * [dryadiabats] - Dry adiabats configuration.\n * @param {module:meteoJS/thermodynamicDiagram/tdDiagram~linesOptions}\n * [pseudoadiabats] - Pseudo adiabats configuration.\n * @param {module:meteoJS/thermodynamicDiagram/tdDiagram~linesOptions}\n * [mixingratio] - Mixing ratio configuration.\n * @param {module:meteoJS/thermodynamicDiagram/tdDiagram~hoverLabelsOptions}\n * [hoverLabels] - Hover labels options.\n * @param {module:meteoJS/thermodynamicDiagram/tdDiagram~parcelsOptions}\n * [parcels] - Parcels options.\n */\n\n/**\n * Class to draw the real thermodynamic diagram.\n * \n * <pre><code>import TDDiagram from 'meteojs/thermodynamicDiagram/TDDiagram';</code></pre>\n * \n * @extends module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea.PlotAltitudeDataArea\n * \n * @fires module:meteoJS/thermodynamicDiagram/tdDiagram#click\n * @fires module:meteoJS/thermodynamicDiagram/tdDiagram#dblclick\n * @fires module:meteoJS/thermodynamicDiagram/tdDiagram#mousedown\n * @fires module:meteoJS/thermodynamicDiagram/tdDiagram#mouseup\n * @fires module:meteoJS/thermodynamicDiagram/tdDiagram#mouseover\n * @fires module:meteoJS/thermodynamicDiagram/tdDiagram#mouseout\n * @fires module:meteoJS/thermodynamicDiagram/tdDiagram#mousemove\n * @fires module:meteoJS/thermodynamicDiagram/tdDiagram#touchstart\n * @fires module:meteoJS/thermodynamicDiagram/tdDiagram#touchmove\n * @fires module:meteoJS/thermodynamicDiagram/tdDiagram#touchleave\n * @fires module:meteoJS/thermodynamicDiagram/tdDiagram#touchend\n * @fires module:meteoJS/thermodynamicDiagram/tdDiagram#touchcancel\n */\nexport class TDDiagram extends PlotAltitudeDataArea {\n \n /**\n * @param {module:meteoJS/thermodynamicDiagram/tdDiagram~linesOptions} [options]\n * Options.\n */\n constructor({\n svgNode = undefined,\n coordinateSystem = undefined,\n x = 0,\n y = 0,\n width = 100,\n height = 100,\n style = {},\n visible = true,\n events = {},\n dataGroupIds = ['temp', 'dewp', 'wetbulb'],\n getCoordinatesByLevelData = (dataGroupId, sounding, levelData, plotArea) => {\n if (levelData.pres === undefined)\n return {};\n \n let value = undefined;\n switch (dataGroupId) {\n case 'temp':\n value = levelData.tmpk;\n break;\n case 'dewp':\n value = levelData.dwpk;\n break;\n case 'wetbulb':\n value = wetbulbTempByTempAndDewpointAndPres(\n levelData.tmpk,\n levelData.dwpk,\n levelData.pres\n );\n break;\n }\n if (value === undefined)\n return {};\n \n return {\n x: plotArea.coordinateSystem.getXByPT(levelData.pres, value),\n y: plotArea.coordinateSystem.height -\n plotArea.coordinateSystem.getYByPT(levelData.pres, value),\n value: Math.round(tempKelvinToCelsius(value)*10)/10,\n unit: '℃'\n };\n },\n insertDataGroupInto = (svgNode, dataGroupId, sounding, data) => {\n if (dataGroupId in sounding.options.diagram\n && !sounding.options.diagram[dataGroupId].visible)\n return;\n\n const options =\n (dataGroupId in sounding.options.diagram)\n ? sounding.options.diagram[dataGroupId].style : {};\n svgNode.group()\n .polyline(data.map(level => [ level.x, level.y ]))\n .fill('none').stroke(options);\n },\n filterDataPoint = undefined,\n minDataPointsDistance = 0,\n isobars = {},\n isotherms = {},\n dryadiabats = {},\n pseudoadiabats = {},\n mixingratio = {},\n hoverLabels = {},\n parcels = {}\n } = {}) {\n super({\n svgNode,\n coordinateSystem,\n x,\n y,\n width,\n height,\n style,\n visible,\n events,\n hoverLabels,\n getSoundingVisibility:\n sounding => sounding.visible && sounding.options.diagram.visible,\n dataGroupIds,\n getCoordinatesByLevelData,\n insertDataGroupInto,\n filterDataPoint,\n minDataPointsDistance\n });\n \n this.options = {\n isobars: getNormalizedDiagramLineOptions(isobars),\n isotherms:\n getNormalizedDiagramLineOptions(isotherms, {\n highlightedLines: [tempCelsiusToKelvin(0)]\n }),\n dryadiabats:\n getNormalizedDiagramLineOptions(dryadiabats),\n pseudoadiabats:\n getNormalizedDiagramLineOptions(pseudoadiabats, {\n style: {\n color: 'rgb(102, 51, 0)',\n dasharray: 6\n }\n }),\n mixingratio:\n getNormalizedDiagramLineOptions(mixingratio, {\n minPressure: 500,\n style: {\n color: 'rgb(102, 51, 0)',\n dasharray: 2\n }\n })\n };\n \n this.svgGroups = {\n border: this._svgNodeBackground.group(),\n isobars: this._svgNodeBackground.group(),\n isotherms: this._svgNodeBackground.group(),\n dryadiabats: this._svgNodeBackground.group(),\n mixingratio: this._svgNodeBackground.group(),\n pseudoadiabats: this._svgNodeBackground.group()\n };\n \n /**\n * @type module:meteoJS/thermodynamicDiagram/tdDiagram~parcelsOptions\n * @private\n */\n this._parcelsOptions = parcels;\n if (!('visible' in this._parcelsOptions))\n this._parcelsOptions.visible = true;\n \n /**\n * @typedef {module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsItems}\n * @property {undefined|external:SVG} parcelsGroup\n * SVG Group to plot the parcels.\n * @property {Map.<module:meteoJS/thermodynamicDiagram/diagramParcel.DiagramParcel,external:SVG>} parcelsGroup\n * Pairs of DiagramParcel objects and SVG Group. The parcel is plotted\n * into the group. The group is contained in 'parcelsGroup'.\n * @property {undefined|mixed} addItemListenerKey\n * Listener key for the {@link module:meteoJS/base/collection#add:item} event\n * on {@link module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding#diagramParcelCollection}\n * for each sounding plotted in this diagram.\n * @property {Object[]} changeVisibleListeners\n * @property {Object[]} changeOptionsListeners\n */\n \n /**\n * @type Map.<module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding,module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsItems>\n * @private\n */\n this._parcels = new Map();\n this.on('add:sounding', sounding => {\n /** @type module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsItems */\n const soundingParcelsItems = {\n parcelsGroup: undefined,\n parcelsGroups: new Map(),\n addItemListenerKey: undefined,\n removeItemListenerKey: undefined,\n changeVisibleListeners: [],\n changeOptionsListeners: []\n };\n const onAddParcel = diagramParcel => {\n soundingParcelsItems.changeVisibleListeners.push({\n diagramParcel,\n listenerKey: diagramParcel.on('change:visible', () => {\n if (!soundingParcelsItems.parcelsGroups.has(diagramParcel))\n return;\n const group = soundingParcelsItems.parcelsGroups.get(diagramParcel);\n diagramParcel.visible ? group.show() : group.hide();\n })\n });\n soundingParcelsItems.changeOptionsListeners.push({\n diagramParcel,\n listenerKey: diagramParcel.on('change:options', () => {\n // Delte old parcel\n const soundingParcelsItems = this._parcels.get(sounding);\n if (soundingParcelsItems !== undefined) {\n const group =\n soundingParcelsItems.parcelsGroups.get(diagramParcel);\n if (group !== undefined) {\n soundingParcelsItems.parcelsGroups.delete(diagramParcel);\n group.remove();\n }\n }\n // Redraw\n this.drawParcel(sounding, diagramParcel);\n })\n });\n };\n soundingParcelsItems.addItemListenerKey =\n sounding.diagramParcelCollection.on('add:item', diagramParcel => {\n onAddParcel(diagramParcel);\n this.drawParcel(sounding, diagramParcel);\n });\n soundingParcelsItems.removeItemListenerKey =\n sounding.diagramParcelCollection.on('remove:item', diagramParcel => {\n const group =\n soundingParcelsItems.parcelsGroups.get(diagramParcel);\n if (group !== undefined) {\n soundingParcelsItems.parcelsGroups.delete(diagramParcel);\n group.remove();\n }\n });\n for (let diagramParcel of sounding.diagramParcelCollection)\n onAddParcel(diagramParcel);\n this._parcels.set(sounding, soundingParcelsItems);\n /* After this event, {@link module:meteoJS/thermodynamicDiagram/tdDiagram.TDDiagram#drawSounding}\n * is executed and therefore also\n * {@link module:meteoJS/thermodynamicDiagram/tdDiagram.TDDiagram#drawParcels}.\n */\n });\n // Remove all listeners on the parcels contained in the removed sounding.\n this.on('remove:sounding', sounding => {\n if (this._parcels.has(sounding)) {\n /** @type module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsItems */\n const soundingParcelsItems = this._parcels.get(sounding);\n sounding.diagramParcelCollection\n .un('add:item', soundingParcelsItems.addItemListenerKey);\n sounding.diagramParcelCollection\n .un('remove:item', soundingParcelsItems.removeItemListenerKey);\n soundingParcelsItems.changeVisibleListeners\n .forEach(listenerObj =>\n listenerObj.diagramParcel\n .un('change:visible', listenerObj.listenerKey));\n soundingParcelsItems.changeOptionsListeners\n .forEach(listenerObj =>\n listenerObj.diagramParcel\n .un('change:options', listenerObj.listenerKey));\n }\n this._parcels.delete(sounding);\n });\n \n this.init();\n }\n \n /**\n * Return the visibility of the isobars.\n * @returns {boolean} Visibility of the isobars.\n * @deprecated\n */\n getIsobarsVisible() {\n return this.options.isobars.visible;\n }\n \n /**\n * Sets the visibility of the isobars.\n * @param {boolean} visible Visibility of the isobars.\n * @returns {module:meteoJS/thermodynamicDiagram/tdDiagram.TDDiagram} this.\n * @deprecated\n */\n setIsobarsVisible(visible) {\n this.options.isobars.visible = visible ? true : false;\n this.plotIsobars();\n return this;\n }\n \n /**\n * Return the visibility of the isotherms.\n * @returns {boolean} Visibility of the isotherms.\n * @deprecated\n */\n getIsothermsVisible() {\n return this.options.isotherms.visible;\n }\n \n /**\n * Sets the visibility of the isotherms.\n * @param {boolean} visible Visibility of the isotherms.\n * @returns {module:meteoJS/thermodynamicDiagram/tdDiagram.TDDiagram} this.\n * @deprecated\n */\n setIsothermsVisible(visible) {\n this.options.isotherms.visible = visible ? true : false;\n this.plotIsotherms();\n return this;\n }\n \n /**\n * Return the visibility of the dry adiabats.\n * @returns {boolean} Visibility of the dry adiabats.\n * @deprecated\n */\n getDryadiabatsVisible() {\n return this.options.dryadiabats.visible;\n }\n \n /**\n * Sets the visibility of the dry adiabats.\n * @param {boolean} visible Visibility of the dry adiabats.\n * @returns {module:meteoJS/thermodynamicDiagram/tdDiagram.TDDiagram} this.\n * @deprecated\n */\n setDryadiabatsVisible(visible) {\n this.options.dryadiabats.visible = visible ? true : false;\n this.plotDryadiabats();\n return this;\n }\n \n /**\n * Return the visibility of the pseudo adiabats.\n * @returns {boolean} Visibility of the pseudo adiabats.\n * @deprecated\n */\n getPseudoadiabatsVisible() {\n return this.options.pseudoadiabats.visible;\n }\n \n /**\n * Sets the visibility of the pseudo adiabats.\n * @param {boolean} visible Visibility of the pseudo adiabats.\n * @returns {module:meteoJS/thermodynamicDiagram/tdDiagram.TDDiagram} this.\n * @deprecated\n */\n setPseudoadiabatsVisible(visible) {\n this.options.pseudoadiabats.visible = visible ? true : false;\n this.plotPseudoadiabats();\n return this;\n }\n \n /**\n * Return the visibility of the mixing ratio.\n * @returns {boolean} Visibility of the mixing ratio.\n * @deprecated\n */\n getMixingratioVisible() {\n return this.options.mixingratio.visible;\n }\n \n /**\n * Sets the visibility of the mixing ratio.\n * @param {boolean} visible Visibility of the mixing ratio.\n * @returns {module:meteoJS/thermodynamicDiagram/tdDiagram.TDDiagram} this.\n * @deprecated\n */\n setMixingratioVisible(visible) {\n this.options.mixingratio.visible = visible ? true : false;\n this.plotMixingratio();\n return this;\n }\n \n /**\n * Draw the sounding into the SVG group.\n * \n * @override\n */\n drawSounding(sounding, group) {\n super.drawSounding(sounding, group);\n \n // Draw parcels\n if (this._parcels.has(sounding)) {\n let parcelsObj = this._parcels.get(sounding);\n parcelsObj.parcelsGroup = group.group();\n if (!sounding.options.parcels.visible)\n parcelsObj.parcelsGroup.hide();\n this._parcels.set(sounding, parcelsObj);\n }\n this.drawParcels(sounding);\n }\n \n /**\n * Draws parcels of a sounding.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * sounding - Sounding.\n */\n drawParcels(sounding) {\n if (!this._parcelsOptions.visible)\n return;\n if (!this._parcels.has(sounding))\n return;\n \n /** @type module:meteoJS/thermodynamicDiagram/diagramSounding~parcelsItems */\n const soundingParcelsItems = this._parcels.get(sounding);\n soundingParcelsItems.parcelsGroup.clear();\n soundingParcelsItems.parcelsGroups.clear();\n for (let diagramParcel of sounding.diagramParcelCollection)\n this.drawParcel(sounding, diagramParcel);\n }\n \n /**\n * Draws a parcel.\n * \n * @param {module:meteoJS/thermodynamicDiagram/diagramSounding.DiagramSounding}\n * diagramSounding - DiagramSounding object, which contains the parcel.\n * @param {module:meteoJS/thermodynamicDiagram/diagramParcel.DiagramParcel}\n * diagramParcel - Parcel lift to draw.\n * @param {external:SVG} group - SVG group to draw parcel into.\n * @private\n */\n drawParcel(diagramSounding, diagramParcel) {\n const parcel = diagramParcel.parcel;\n if (parcel.pres === undefined ||\n parcel.tmpc === undefined ||\n parcel.dwpc === undefined)\n return;\n if (!this._parcels.has(diagramSounding))\n return;\n const soundingParcelsItems = this._parcels.get(diagramSounding);\n const group = soundingParcelsItems.parcelsGroup.group();\n soundingParcelsItems.parcelsGroups.set(diagramParcel, group);\n this._parcels.set(diagramSounding, soundingParcelsItems);\n \n const pottmpk =\n potentialTempByTempAndPres(tempCelsiusToKelvin(parcel.tmpc), parcel.pres);\n const hmr =\n saturationHMRByTempAndPres(tempCelsiusToKelvin(parcel.dwpc), parcel.pres);\n const lclpres = lclByPotentialTempAndHMR(pottmpk, hmr);\n const lcltmpk = lclTemperatureByTempAndDewpoint(\n tempCelsiusToKelvin(parcel.tmpc),\n tempCelsiusToKelvin(parcel.dwpc));\n const lclthetaek = equiPotentialTempByTempAndDewpointAndPres(\n lcltmpk, lcltmpk, lclpres);\n \n const options = diagramParcel.options;\n \n // SVG groups\n if (!options.visible)\n group.hide();\n const tempGroup = group.group();\n if (!options.temp.visible)\n tempGroup.hide();\n let dewpGroup = group.group();\n if (!options.dewp.visible)\n dewpGroup.hide();\n \n // Draw temp curve\n const yInterval = 10;\n const y0 = this.coordinateSystem\n .getYByPT(parcel.pres, tempCelsiusToKelvin(parcel.tmpc));\n const x0 = this.coordinateSystem.getXByYPotentialTemperature(y0, pottmpk);\n const y1 = this.coordinateSystem.getYByPPotentialTemperatur(lclpres, pottmpk);\n const x1 = this.coordinateSystem.getXByYPotentialTemperature(y1, pottmpk);\n let tempPolyline = [[x0, y0]];\n if (!this.coordinateSystem.isDryAdiabatStraightLine())\n for (let y=y0+yInterval; y<y1; y+=yInterval) {\n tempPolyline.push([\n this.coordinateSystem.getXByYPotentialTemperature(y, pottmpk),\n y\n ]);\n }\n tempPolyline.push([x1, y1]);\n const y2 = this.coordinateSystem.height;\n const x2 = this.coordinateSystem.getXByYEquiPotTemp(y2, lclthetaek);\n for (let y=y1+yInterval; y<y2; y+=yInterval) {\n tempPolyline.push([\n this.coordinateSystem.getXByYEquiPotTemp(y, lclthetaek),\n y\n ]);\n }\n tempPolyline.push([x2, y2]);\n tempGroup\n .polyline(tempPolyline.map(point => {\n point[1] = this.coordinateSystem.height - point[1];\n return point;\n }))\n .fill('none')\n .stroke(options.temp.style);\n \n // Draw mixing ratio curve\n const x0dwp = this.coordinateSystem.getXByYHMR(y0, hmr);\n const x1dwp = this.coordinateSystem.getXByYHMR(y1, hmr);\n let dewpPolyline = [[x0dwp, y0]];\n for (let y=y0+yInterval; y<y1; y+=yInterval) {\n dewpPolyline.push([\n this.coordinateSystem.getXByYHMR(y, hmr),\n y\n ]);\n }\n dewpPolyline.push([x1dwp, y1]);\n dewpGroup\n .polyline(dewpPolyline.map(point => {\n point[1] = this.coordinateSystem.height - point[1];\n return point;\n }))\n .fill('none')\n .stroke(options.dewp.style);\n }\n \n /**\n * Draw background into SVG group.\n * \n * @override\n */\n _drawBackground(svgNode) {\n super._drawBackground(svgNode);\n \n this.svgGroups = {\n border: svgNode.group(),\n isobars: svgNode.group(),\n isotherms: svgNode.group(),\n dryadiabats: svgNode.group(),\n mixingratio: svgNode.group(),\n pseudoadiabats: svgNode.group()\n };\n \n // Rand des Diagramms\n this.svgGroups.border.clear();\n this.svgGroups.border\n .rect(this.coordinateSystem.width, this.coordinateSystem.height)\n .attr({stroke: 'black', 'stroke-width': 1, 'fill-opacity': 0});\n \n // Hilfelinien zeichnen\n this.plotIsobars(true);\n this.plotIsotherms(true);\n this.plotDryadiabats(true);\n this.plotPseudoadiabats(true);\n this.plotMixingratio(true);\n }\n \n /**\n * @private\n */\n plotIsobars(redraw) {\n let min = this.coordinateSystem.getPByXY(0, this.coordinateSystem.height);\n let max = this.coordinateSystem.getPByXY(0, 0);\n let delta = max - min;\n this._plotLines(\n this.svgGroups.isobars,\n this.options.isobars,\n {\n min: min,\n max: max,\n interval: (delta > 500) ? 100 : (delta > 50) ? 10 : 1\n },\n p => {\n let y = this.coordinateSystem.getYByXP(0, p);\n return [[0, y], [this.coordinateSystem.width, y]];\n },\n redraw\n );\n }\n \n /**\n * @private\n */\n plotIsotherms(redraw) {\n let min = tempKelvinToCelsius(\n this.coordinateSystem.getTByXY(0, this.coordinateSystem.height));\n let max = tempKelvinToCelsius(\n this.coordinateSystem.getTByXY(this.coordinateSystem.width, 0));\n let delta = max - min;\n this._plotLines(\n this.svgGroups.isotherms,\n this.options.isotherms,\n {\n min: min,\n max: max,\n interval: (delta > 50) ? 10 : 5\n },\n T => {\n T = tempCelsiusToKelvin(T);\n let result = [[undefined, undefined], [undefined, undefined]];\n if (this.coordinateSystem.isIsothermsVertical()) {\n result[0][1] = 0;\n result[1][1] = this.coordinateSystem.height;\n result[0][0] = result[1][0] = this.coordinateSystem.getXByYT(result[0][1], T);\n }\n else {\n result[0][1] = 0;\n result[0][0] = this.coordinateSystem.getXByYT(result[0][1], T);\n if (result[0][0] < 0)\n result[0][1] = this.coordinateSystem.getYByXT(result[0][0] = 0, T);\n result[1][0] = this.coordinateSystem.width;\n result[1][1] = this.coordinateSystem.getYByXT(result[1][0], T);\n if (result[1][1] === undefined) {\n result[1][0] = result[0][0];\n result[1][1] = this.coordinateSystem.height;\n }\n else if (result[1][1] > this.coordinateSystem.height) {\n result[1][1] = this.coordinateSystem.height;\n result[1][0] = this.coordinateSystem.getXByYT(result[1][1], T);\n }\n }\n return result;\n },\n redraw\n );\n }\n \n /**\n * @private\n */\n plotDryadiabats(redraw) {\n this._plotLines(\n this.svgGroups.dryadiabats,\n this.options.dryadiabats,\n {\n min: tempKelvinToCelsius(\n potentialTempByTempAndPres(\n this.coordinateSystem.getTByXY(0, 0),\n this.coordinateSystem.getPByXY(0, 0))),\n max: tempKelvinToCelsius(\n potentialTempByTempAndPres(\n this.coordinateSystem.getTByXY(this.coordinateSystem.width, this.coordinateSystem.height),\n this.coordinateSystem.getPByXY(this.coordinateSystem.width, this.coordinateSystem.height))),\n interval: 10\n },\n T => {\n let TKelvin = tempCelsiusToKelvin(T);\n let y0 = 0;\n let x0 = this.coordinateSystem.getXByYPotentialTemperature(y0, TKelvin);\n if (x0 === undefined ||\n x0 > this.coordinateSystem.width) {\n x0 = this.coordinateSystem.width;\n y0 = this.coordinateSystem.getYByXPotentialTemperature(x0, TKelvin);\n }\n let x1 = 0;\n let y1 = this.coordinateSystem.getYByXPotentialTemperature(x1, TKelvin);\n if (y1 === undefined ||\n y1 > this.coordinateSystem.height) {\n y1 = this.coordinateSystem.height;\n x1 = this.coordinateSystem.getXByYPotentialTemperature(y1, TKelvin);\n }\n if (x0 === undefined ||\n y0 === undefined ||\n x1 === undefined ||\n y1 === undefined)\n return undefined;\n if (this.coordinateSystem.isDryAdiabatStraightLine()) {\n return [[x0, y0], [x1, y1]];\n }\n else {\n let points = [[x0, y0]];\n let yInterval = 10;\n for (let y=y0+yInterval; y<y1; y+=yInterval) {\n points.push([\n this.coordinateSystem.getXByYPotentialTemperature(y, TKelvin),\n y\n ]);\n }\n points.push([x1, y1]);\n return points;\n }\n },\n redraw\n );\n }\n \n /**\n * @private\n */\n plotPseudoadiabats(redraw) {\n this._plotLines(\n this.svgGroups.pseudoadiabats,\n this.options.pseudoadiabats,\n {\n lines: [-18, -5, 10, 30, 60, 110, 180]\n },\n thetae => {\n let thetaeKelvin = tempCelsiusToKelvin(thetae);\n const y0 =\n Math.max(\n 0,\n (this.options.pseudoadiabats.maxPressure === undefined)\n ? 0\n : this.coordinateSystem.getYByPEquiPotTemp(\n this.options.pseudoadiabats.maxPressure, thetaeKelvin)\n );\n const x0 = this.coordinateSystem.getXByYEquiPotTemp(y0, thetaeKelvin);\n const y1 =\n Math.min(\n this.coordinateSystem.height,\n (this.options.pseudoadiabats.minPressure === undefined)\n ? this.coordinateSystem.height\n : this.coordinateSystem.getYByPEquiPotTemp(\n this.options.pseudoadiabats.minPressure, thetaeKelvin)\n );\n const x1 = this.coordinateSystem.getXByYEquiPotTemp(y1, thetaeKelvin);\n let points = [[x0, y0]];\n let yInterval = 10;\n for (let y=y0+yInterval; y<y1; y+=yInterval) {\n points.push([\n this.coordinateSystem.getXByYEquiPotTemp(y, thetaeKelvin),\n y\n ]);\n }\n points.push([x1, y1]);\n return points;\n },\n redraw\n );\n }\n \n /**\n * @private\n */\n plotMixingratio(redraw) {\n this._plotLines(\n this.svgGroups.mixingratio,\n this.options.mixingratio,\n {\n lines: [0.01, 0.1, 1, 2, 4, 7, 10, 16, 21, 32, 40]\n },\n hmr => {\n const y0 =\n Math.max(\n 0,\n (this.options.mixingratio.maxPressure === undefined)\n ? 0\n : this.coordinateSystem.getYByPHMR(\n this.options.mixingratio.maxPressure, hmr)\n );\n const x0 = this.coordinateSystem.getXByYHMR(y0, hmr);\n const y1 =\n Math.min(\n this.coordinateSystem.height,\n (this.options.mixingratio.minPressure === undefined)\n ? this.coordinateSystem.height\n : this.coordinateSystem.getYByPHMR(\n this.options.mixingratio.minPressure, hmr)\n );\n const x1 = this.coordinateSystem.getXByYHMR(y1, hmr);\n let points = [[x0, y0]];\n const yInterval = 10;\n for (let y=y0+yInterval; y<y1; y+=yInterval) {\n points.push([\n this.coordinateSystem.getXByYHMR(y, hmr),\n y\n ]);\n }\n points.push([x1, y1]);\n return points;\n },\n redraw\n );\n }\n \n /**\n * @private\n */\n _plotLines(node, options, valuesOptions, pointsFunc, redraw) {\n options.visible\n ? node.show()\n : node.hide();\n if (!redraw)\n return;\n node.clear();\n let lines = [];\n if (options.lines !== undefined)\n lines = options.lines;\n else if (options.min === undefined &&\n options.max === undefined &&\n options.interval === undefined &&\n valuesOptions.lines !== undefined)\n lines = valuesOptions.lines;\n else {\n if (options.min !== undefined)\n valuesOptions.min = options.min;\n if (options.max !== undefined)\n valuesOptions.max = options.max;\n let interval = options.interval;\n if (interval === undefined)\n interval = valuesOptions.interval;\n let start = Math.ceil(valuesOptions.min/interval)*interval;\n let end = Math.floor(valuesOptions.max/interval)*interval;\n for (let v=start; v<=end; v+=interval) {\n lines.push(v);\n }\n }\n let highlightLineWidth = 3;\n if (options.style.width !== undefined)\n highlightLineWidth = options.style.width+2;\n lines.forEach(function (v) {\n let points = pointsFunc.call(this, v);\n let line = (points.length == 2) ?\n node.line(points[0][0], this.coordinateSystem.height-points[0][1],\n points[1][0], this.coordinateSystem.height-points[1][1])\n .stroke(options.style) :\n node.polyline(points.map(function (point) {\n point[1] = this.coordinateSystem.height - point[1];\n return point;\n }, this))\n .fill('none').stroke(options.style);\n if (options.highlightedLines !== undefined) {\n options.highlightedLines.forEach(vHighlight => {\n if (v == tempKelvinToCelsius(vHighlight))\n line.stroke({width: highlightLineWidth});\n });\n }\n }, this);\n }\n \n /**\n * Extend an event with temperature and pressure.\n * \n * @override\n */\n getExtendedEvent(e, p) {\n e = super.getExtendedEvent(e, p);\n e.diagramTmpk =\n this.coordinateSystem.getTByXY(e.elementX,\n this.coordinateSystem.height - e.elementY);\n return e;\n }\n \n /**\n * Initialize hover labels options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/tdDiagram~hoverLabelsOptions}\n * options - Hover labels options.\n * @override\n */\n _initHoverLabels({\n visible = true,\n type = 'mousemove',\n maxDistance = undefined,\n remote = true,\n insertLabelsFunc = undefined,\n getHoverSounding = undefined,\n pres = {},\n temp = {},\n dewp = {},\n wetbulb = {}\n }) {\n pres.length = ('length' in pres) ? pres.length : 60;\n pres.align = ('align' in pres) ? pres.align : 'left';\n if (!('visible' in pres))\n pres.visible = true;\n if (!('style' in pres))\n pres.style = {};\n pres.font = getNormalizedFontOptions(pres.font, {\n anchor: (pres.align == 'right') ? 'end' : 'start'\n });\n if (!('fill' in pres))\n pres.fill = {};\n if (pres.fill.opacity === undefined)\n pres.fill.opacity = 0.7;\n if (pres.horizontalMargin === undefined)\n pres.horizontalMargin = 5;\n \n if (!('visible' in temp))\n temp.visible = true;\n if (!('style' in temp))\n temp.style = {};\n temp.font = getNormalizedFontOptions(temp.font, {\n anchor: 'start',\n 'alignment-baseline': 'bottom'\n });\n if (!('fill' in temp))\n temp.fill = {};\n if (temp.fill.opacity === undefined)\n temp.fill.opacity = 0.7;\n temp.radius = ('radius' in temp) ? temp.radius : undefined;\n temp.radiusPlus = ('radiusPlus' in temp) ? temp.radiusPlus : 2;\n if (temp.horizontalMargin === undefined)\n temp.horizontalMargin = 10;\n \n if (!('visible' in dewp))\n dewp.visible = true;\n if (!('style' in dewp))\n dewp.style = {};\n dewp.font = getNormalizedFontOptions(dewp.font, {\n anchor: 'end',\n 'alignment-baseline': 'bottom'\n });\n if (!('fill' in dewp))\n dewp.fill = {};\n if (dewp.fill.opacity === undefined)\n dewp.fill.opacity = 0.7;\n dewp.radius = ('radius' in dewp) ? dewp.radius : undefined;\n dewp.radiusPlus = ('radiusPlus' in dewp) ? dewp.radiusPlus : 2;\n if (dewp.horizontalMargin === undefined)\n dewp.horizontalMargin = 10;\n \n if (!('visible' in wetbulb))\n wetbulb.visible = true;\n if (!('style' in wetbulb))\n wetbulb.style = {};\n wetbulb.font = getNormalizedFontOptions(wetbulb.font, {\n anchor: 'middle'\n });\n if (!('fill' in wetbulb))\n wetbulb.fill = {};\n if (wetbulb.fill.opacity === undefined)\n wetbulb.fill.opacity = 0.7;\n wetbulb.radius = ('radius' in wetbulb) ? wetbulb.radius : undefined;\n wetbulb.radiusPlus = ('radiusPlus' in wetbulb) ? wetbulb.radiusPlus : 2;\n if (wetbulb.verticalMargin === undefined)\n wetbulb.verticalMargin = 10;\n \n if (insertLabelsFunc === undefined)\n insertLabelsFunc =\n this._makeInsertLabelsFunc(pres, temp, dewp, wetbulb);\n \n super._initHoverLabels({\n visible,\n type,\n maxDistance,\n remote,\n insertLabelsFunc,\n getHoverSounding,\n });\n }\n \n /**\n * Makes a default insertLabelsFunc.\n * \n * @param {Object} pres\n * @param {Object} temp\n * @param {Object} dewp\n * @param {Object} wetbulb\n * @private\n */\n _makeInsertLabelsFunc(pres, temp, dewp, wetbulb) {\n return (sounding, levelData, group) => {\n group.clear();\n \n if (levelData.pres === undefined)\n return;\n \n if (pres.visible)\n drawPressureHoverLabelInto(group, levelData, this.coordinateSystem, pres);\n \n this.dataGroupIds.reverse().forEach(dataGroupId => {\n let labelOptions = {\n visible: false\n };\n switch (dataGroupId) {\n case 'temp': labelOptions = temp; break;\n case 'dewp': labelOptions = dewp; break;\n case 'wetbulb': labelOptions = wetbulb; break;\n }\n if (!labelOptions.visible)\n return;\n \n const { x, y, value, unit } =\n this._getCoordinatesByLevelData(dataGroupId,\n sounding, levelData, this);\n if (x === undefined ||\n y === undefined)\n return;\n \n const lineWidth =\n (dataGroupId in this.hoverLabelsSounding.options.diagram)\n ? this.hoverLabelsSounding.options.diagram[dataGroupId].style.width\n : 3;\n const radius = (labelOptions.radius === undefined)\n ? lineWidth + labelOptions.radiusPlus\n : labelOptions.radius;\n const fillOptions = labelOptions.style;\n if (!('color' in fillOptions) &&\n (dataGroupId in this.hoverLabelsSounding.options.diagram))\n fillOptions.color = sounding.options.diagram[dataGroupId].style.color;\n group\n .circle(2 * radius)\n .attr({ cx: x, cy: y })\n .fill(fillOptions);\n drawTextInto({\n node: group,\n text: `${value} ${unit}`,\n x,\n y,\n horizontalMargin: labelOptions.horizontalMargin,\n verticalMargin: labelOptions.verticalMargin,\n font: labelOptions.font,\n fill: labelOptions.fill\n });\n });\n };\n }\n}\nexport default TDDiagram;\n\n/**\n * Draws pressure hover label.\n * \n * @param {external:SVG} svgNode - SVG node to draw into.\n * @param {number} pres - Pressure.\n * @param {module:meteoJS/thermodynamicDiagram/coordinateSystem.CoordinateSystem}\n * coordinateSystem - Coordinate system.\n * @param {module:meteoJS/thermodynamicDiagram/tdDiagram~presLabelOptions}\n * [options] - Options.\n */\nexport function drawPressureHoverLabelInto(svgNode, levelData, coordinateSystem, {\n length = 60,\n align = 'left',\n horizontalMargin = undefined,\n verticalMargin = undefined,\n style = {},\n font = {},\n fill = {}\n} = {}) {\n let x0 = 0;\n let x1 = length;\n const match = /^([0-9]+)%$/.exec(x1);\n if (match)\n x1 = match[1] / 100 * coordinateSystem.width;\n if (align == 'right') {\n x0 = coordinateSystem.width;\n x1 = coordinateSystem.width - x1;\n }\n const y = coordinateSystem.height -\n coordinateSystem.getYByXP(0, levelData.pres);\n style = getNormalizedLineStyleOptions(style);\n svgNode\n .line([\n [Math.min(x0, x1), y],\n [Math.max(x0, x1), y]\n ])\n .stroke(style);\n font = getNormalizedFontOptions(font);\n font['alignment-baseline'] = 'bottom';\n drawTextInto({\n node: svgNode,\n text: `${Math.round(levelData.pres)} hPa`,\n x: x0,\n y,\n horizontalMargin,\n verticalMargin,\n font,\n fill\n });\n \n font['alignment-baseline'] = 'top';\n let hghtStr = (levelData.hght === undefined)\n ? `~${Math.round(altitudeISAByPres(levelData.pres))} m`\n : `${Math.round(levelData.hght)} m`;\n drawTextInto({\n node: svgNode,\n text: hghtStr,\n x: x0,\n y: y,\n horizontalMargin,\n verticalMargin,\n font,\n fill\n });\n}\n\nfunction getNormalizedDiagramLineOptions({\n highlightedLines = undefined,\n interval = undefined,\n lines = undefined,\n max = undefined,\n min = undefined,\n maxPressure = undefined,\n minPressure = undefined,\n style = undefined,\n visible = undefined\n}, defaults = {}) {\n return {\n highlightedLines: getFirstDefinedValue(highlightedLines, defaults.highlightedLines),\n interval: getFirstDefinedValue(interval, defaults.interval),\n lines: getFirstDefinedValue(lines, defaults.lines),\n max: getFirstDefinedValue(max, defaults.max),\n min: getFirstDefinedValue(min, defaults.min),\n maxPressure: getFirstDefinedValue(maxPressure, defaults.maxPressure),\n minPressure: getFirstDefinedValue(minPressure, defaults.minPressure),\n style: getNormalizedLineStyleOptions(style, defaults.style),\n visible: getFirstDefinedValue(visible, defaults.visible, true)\n };\n}","/**\n * @module meteoJS/thermodynamicDiagram/windbarbsProfile\n */\nimport { drawWindbarbInto } from './Functions.js';\nimport PlotAltitudeDataArea from './PlotAltitudeDataArea.js';\n\n/**\n * Options for the constructor.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea~options}\n * module:meteoJS/thermodynamicDiagram/windbarbsProfile~options\n * @param {number} [windbarbLength]\n * Length of windbarbs. Default is 40% of the Plot-Area width.\n * @param {number} [minDataPointsDistance]\n * Minimum distance between data points in pixels. If filterDataPoint is set,\n * minDataPointsDistance is ignored. If undefined, then minDataPointsDistance\n * is set to the half of windbarbLength.\n */\n\n/**\n * Class to draw the profile with windbarbs.\n * \n * <pre><code>import WindbarbsProfile from 'meteojs/thermodynamicDiagram/WindbarbsProfile';</code></pre>\n * \n * @extends module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea.PlotAltitudeDataArea\n */\nexport class WindbarbsProfile extends PlotAltitudeDataArea {\n \n /**\n * @param {module:meteoJS/thermodynamicDiagram/windbarbsProfile~options}\n * options - Options.\n */\n constructor({\n svgNode = undefined,\n coordinateSystem = undefined,\n x = undefined,\n y = undefined,\n width = undefined,\n height = undefined,\n style = {},\n visible = true,\n events = {},\n hoverLabels = {},\n windbarbLength = undefined,\n dataGroupIds = ['windbarbs'],\n getCoordinatesByLevelData = (dataGroupId, sounding, levelData, plotArea) => {\n if (levelData.pres === undefined ||\n levelData.wspd === undefined ||\n levelData.wdir === undefined)\n return {};\n \n return {\n x: plotArea.width / 2,\n y: plotArea.coordinateSystem.height -\n plotArea.coordinateSystem.getYByXP(0, levelData.pres)\n };\n },\n insertDataGroupInto = (svgNode, dataGroupId, sounding, data, plotArea) => {\n data.forEach(windbarbData => {\n drawWindbarbInto({\n node: svgNode,\n x: plotArea.width/2,\n y: windbarbData.y,\n wspd: windbarbData.levelData.wspd,\n wdir: windbarbData.levelData.wdir,\n length: plotArea._windbarbLength,\n strokeStyle: sounding.options.windprofile.windbarbs.style\n });\n });\n },\n filterDataPoint = undefined,\n minDataPointsDistance = undefined\n }) {\n super({\n svgNode,\n coordinateSystem,\n x,\n y,\n width,\n height,\n style,\n visible,\n events,\n hoverLabels,\n getSoundingVisibility:\n sounding => sounding.visible && sounding.options.windprofile.windbarbs.visible,\n dataGroupIds,\n getCoordinatesByLevelData,\n insertDataGroupInto,\n filterDataPoint,\n minDataPointsDistance:\n (minDataPointsDistance === undefined) ? 0 : minDataPointsDistance\n });\n \n /**\n * @type number\n * @private\n */\n this._windbarbLength = windbarbLength;\n if (this._windbarbLength === undefined)\n this._windbarbLength = this.width * 2/5;\n \n if (minDataPointsDistance === undefined)\n this.minDataPointsDistance = this._windbarbLength / 2;\n \n this.init();\n }\n}\nexport default WindbarbsProfile;","/**\n * @module meteoJS/thermodynamicDiagram/windspeedProfile\n */\nimport {\n windspeedMSToKN,\n windspeedKNToMS,\n windspeedMSToKMH\n} from '../calc.js';\nimport {\n getNormalizedFontOptions,\n getNormalizedLineOptions,\n drawTextInto\n} from './Functions.js';\nimport PlotAltitudeDataArea from './PlotAltitudeDataArea.js';\n\n/**\n * Triggered, when the windspeedMax changes.\n * \n * @event module:meteoJS/thermodynamicDiagram/windspeedProfile#change:windspeedMax\n */\n\n/**\n * Options for labels on hovering the windspeed profile.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea~hoverLabelsOptions}\n * module:meteoJS/thermodynamicDiagram/windspeedProfile~hoverLabelsOptions\n * @property {Object} [windspeed]\n * Options for the output of the windspeed value.\n * @property {boolean} [windspeed.visible=true] - Visibility.\n * @property {string} [windspeed.unit='kn']\n * Unit of the value text. Allowed values: 'm/s', 'kn', 'km/h'\n * @property {integer} [windspeed.decimalPlaces=0]\n * Number of digits to appear after the decimal point.\n * @property {string} [windspeed.prefix=' kn'] - Prefix of the value text.\n * @property {number} [windspeedMax=77.17]\n * The maximum visible windspeed. Unit: m/s.\n */\n\n/**\n * Isobar grid lines.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram~lineOptions}\n * module:meteoJS/thermodynamicDiagram/windspeedProfile~isobarsOptions\n * @property {number} [max]\n * Maximum isobar value for the grid lines. By default, this is the\n * maximum pressure of the coordinate system for x=0.\n * @property {number} [min]\n * Minimum isobar value for the grid lines. By default, this is the\n * minimum pressure of the coordinate system for x=0.\n * @property {number} [interval=100]\n * Interval between the grid lines.\n */\n\n/**\n * Isotach grid lines.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram~lineOptions}\n * module:meteoJS/thermodynamicDiagram/windspeedProfile~isotachsOptions\n * @property {number} [max=undefined]\n * Maximum windspeed value for the grid lines. By default, this is the\n * maximum visible windspeed.\n * @property {number} [min=0]\n * Value for the first grid line.\n * @property {number} [interval=25.72]\n * Interval between the grid lines.\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea~options}\n * module:meteoJS/thermodynamicDiagram/windspeedProfile~options\n * @property {number} [windspeedMax=77.17] - Maximum visible windspeed, in m/s.\n * @property {Object} [grid] - Options for grid.\n * @property {module:meteoJS/thermodynamicDiagram/windspeedProfile~isotachsOptions}\n * [grid.isotachs] - Options for isotach grid. By default, the lines are grey and dashed.\n * @property {module:meteoJS/thermodynamicDiagram/windspeedProfile~isobarsOptions}\n * [grid.isobars] - Options for isobar grid. By default, the lines are grey and dashed.\n * @property {module:meteoJS/thermodynamicDiagram/windspeedProfile~hoverLabelsOptions}\n * [hoverLabels] - Hover labels options.\n */\n\n/**\n * Class to draw windspeed profiles.\n * \n * <pre><code>import WindspeedProfile from 'meteojs/thermodynamicDiagram/WindspeedProfile';</code></pre>\n * \n * @extends module:meteoJS/thermodynamicDiagram/plotAltitudeDataArea.PlotAltitudeDataArea\n * @fires module:meteoJS/thermodynamicDiagram/windspeedProfile#change:windspeedMax\n */\nexport class WindspeedProfile extends PlotAltitudeDataArea {\n \n /**\n * @param {module:meteoJS/thermodynamicDiagram/windspeedProfile~options} options\n * Options.\n */\n constructor({\n svgNode = undefined,\n coordinateSystem = undefined,\n x = undefined,\n y = undefined,\n width = undefined,\n height = undefined,\n style = {},\n visible = true,\n events = {},\n hoverLabels = {},\n dataGroupIds = ['windspeed'],\n getCoordinatesByLevelData = (dataGroupId, sounding, levelData, plotArea) => {\n if (levelData.pres === undefined ||\n levelData.wspd === undefined)\n return {};\n \n return {\n x: plotArea.width * levelData.wspd / plotArea.windspeedMax,\n y: plotArea.coordinateSystem.height -\n plotArea.coordinateSystem.getYByXP(0, levelData.pres)\n };\n },\n insertDataGroupInto = (svgNode, dataGroupId, sounding, data) => {\n svgNode\n .polyline(data.map(level => [ level.x, level.y ]))\n .fill('none')\n .stroke(sounding.options.windprofile.windspeed.style);\n },\n windspeedMax = windspeedKNToMS(150),\n grid = {},\n filterDataPoint = undefined,\n minDataPointsDistance = 0\n } = {}) {\n super({\n svgNode,\n coordinateSystem,\n x,\n y,\n width,\n height,\n style,\n visible,\n events,\n hoverLabels,\n getSoundingVisibility:\n sounding => sounding.visible && sounding.options.windprofile.windspeed.visible,\n dataGroupIds,\n getCoordinatesByLevelData,\n insertDataGroupInto,\n filterDataPoint,\n minDataPointsDistance\n });\n\n /**\n * @type number\n * @private\n */\n this._windspeedMax = windspeedMax;\n\n this._gridOptions = this.getNormalizedGridOptions(grid);\n \n this.init();\n }\n\n /**\n * The maximum visible windspeed. Unit: m/s.\n * \n * @type number\n */\n get windspeedMax() {\n return this._windspeedMax;\n }\n set windspeedMax(windspeedMax) {\n const oldWindspeedMax = this._windspeedMax;\n this._windspeedMax = windspeedMax;\n if (this._windspeedMax != oldWindspeedMax)\n this.trigger('change:windspeedMax');\n }\n \n /**\n * Draw background into SVG group.\n * \n * @override\n */\n _drawBackground(svgNode) {\n super._drawBackground(svgNode);\n\n // isobars\n if (this._gridOptions.isobars.visible) {\n const isobarsNode = svgNode.group();\n for (let i=this._gridOptions.isobars.min; i<=this._gridOptions.isobars.max; i+=this._gridOptions.isobars.interval) {\n const y = this.coordinateSystem.height - this.coordinateSystem.getYByXP(0, i);\n isobarsNode\n .line(0, y, this.width, y)\n .stroke(this._gridOptions.isobars.style);\n }\n }\n\n // isotach grid\n if (this._gridOptions.isotachs.visible) {\n const isotachsNode = svgNode.group();\n for (let i=this._gridOptions.isotachs.min; i<=this._gridOptions.isotachs.max; i+=this._gridOptions.isotachs.interval) {\n const x = this.width * i / this.windspeedMax;\n isotachsNode\n .line(x, 0, x, this.height)\n .stroke(this._gridOptions.isotachs.style);\n }\n }\n }\n \n /**\n * Initialize hover labels options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/windspeedProfile~hoverLabelsOptions}\n * options - Hover labels options.\n * @override\n */\n _initHoverLabels({\n visible = true,\n type = 'mousemove',\n maxDistance = undefined,\n remote = true,\n insertLabelsFunc = undefined,\n getHoverSounding = undefined,\n windspeed = {}\n }) {\n if (!('visible' in windspeed))\n windspeed.visible = true;\n if (!('style' in windspeed))\n windspeed.style = {};\n windspeed.font = getNormalizedFontOptions(windspeed.font, {\n anchor: 'end',\n 'alignment-baseline': 'bottom'\n });\n if (!('fill' in windspeed))\n windspeed.fill = {};\n if (windspeed.fill.opacity === undefined)\n windspeed.fill.opacity = 0.7;\n windspeed.radius = ('radius' in windspeed) ? windspeed.radius : undefined;\n windspeed.radiusPlus =\n ('radiusPlus' in windspeed) ? windspeed.radiusPlus : 2;\n if (windspeed.horizontalMargin === undefined)\n windspeed.horizontalMargin = 10;\n \n if (insertLabelsFunc === undefined)\n insertLabelsFunc = this._makeInsertLabelsFunc(windspeed);\n \n super._initHoverLabels({\n visible,\n type,\n maxDistance,\n remote,\n insertLabelsFunc,\n getHoverSounding\n });\n }\n \n /**\n * Makes a default insertLabelsFunc.\n * \n * @param {module:meteoJS/thermodynamicDiagram/windspeedProfile~hoverLabelsOptions}\n * options - Style options for the hover labels.\n * @private\n */\n _makeInsertLabelsFunc({\n visible = true,\n style = {},\n font = {},\n fill = {},\n horizontalMargin = 10,\n verticalMargin = 0,\n radius = undefined,\n radiusPlus = 2,\n windspeed = {},\n }) {\n windspeed = (({\n visible = true,\n unit = 'kn',\n decimalPlaces = 0,\n prefix = ' kn'\n }) => { return { visible, unit, decimalPlaces, prefix }; })(windspeed);\n return (sounding, levelData, group) => {\n group.clear();\n \n if (levelData === undefined\n || levelData.pres === undefined\n || !windspeed.visible)\n return;\n \n if (!visible ||\n levelData.wspd === undefined)\n return;\n \n const { x, y } =\n this._getCoordinatesByLevelData('windspeed',\n sounding, levelData, this);\n if (x === undefined ||\n y === undefined)\n return;\n \n const dotRadius = (radius === undefined)\n ? sounding.options.windprofile.windspeed.style.width / 2 +\n radiusPlus\n : radius;\n const fillOptions = {...style}; // Deep copy\n if (!('color' in fillOptions))\n fillOptions.color = sounding.options.windprofile.windspeed.style.color;\n group\n .circle(2 * dotRadius)\n .attr({ cx: x, cy: y })\n .fill(fillOptions);\n const labelFont = {...font}; // Deep copy\n if (labelFont.anchor == 'start' &&\n this.width - x < 45)\n labelFont.anchor = 'end';\n if (labelFont.anchor == 'end' &&\n x < 45)\n labelFont.anchor = 'start';\n if (labelFont['alignment-baseline'] == 'bottom' &&\n y < labelFont.size * 5/4)\n labelFont['alignment-baseline'] = 'top';\n if (labelFont['alignment-baseline'] == 'top' &&\n this.height - y < labelFont.size * 5/4)\n labelFont['alignment-baseline'] = 'bottom';\n let text = '';\n switch (windspeed.unit) {\n case 'm/s':\n text = Number.parseFloat(levelData.wspd)\n .toFixed(windspeed.decimalPlaces);\n break;\n case 'kn':\n text = windspeedMSToKN(levelData.wspd)\n .toFixed(windspeed.decimalPlaces);\n break;\n default:\n text = windspeedMSToKMH(levelData.wspd)\n .toFixed(windspeed.decimalPlaces);\n break;\n }\n text = `${text}${windspeed.prefix}`;\n drawTextInto({\n node: group,\n text,\n x,\n y,\n horizontalMargin,\n verticalMargin,\n font: labelFont,\n fill\n });\n };\n }\n \n /**\n * Normalizes options for grid.\n * \n * @private\n */\n getNormalizedGridOptions({\n isotachs = {},\n isobars = {}\n }) {\n isotachs = getNormalizedIsolineOptions(isotachs, {\n min: 0,\n max: this._windspeedMax,\n interval: windspeedKNToMS(50),\n style: {\n color: 'grey',\n dasharray: '2 2'\n }\n });\n const isobarsInterval = 100;\n const min = (this.coordinateSystem === undefined)\n ? 100\n : Math.ceil(this.coordinateSystem.getPByXY(0, this.height)/isobarsInterval)*isobarsInterval;\n const max = (this.coordinateSystem === undefined)\n ? 1050\n : Math.floor(this.coordinateSystem.getPByXY(0, 0)/isobarsInterval)*isobarsInterval;\n isobars = getNormalizedIsolineOptions(isobars, {\n min,\n max,\n interval: isobarsInterval,\n style: {\n color: 'grey',\n dasharray: '1 3'\n }\n });\n \n return {\n isotachs,\n isobars\n };\n }\n}\nexport default WindspeedProfile;\n\n/**\n * Normalize grid options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/windspeedProfile~isobarsOptions|module:meteoJS/thermodynamicDiagram/windspeedProfile~windspeedOptions}\n * options - Options.\n * @returns {module:meteoJS/thermodynamicDiagram/windspeedProfile~isobarsOptions|module:meteoJS/thermodynamicDiagram/windspeedProfile~windspeedOptions}\n * Normalized options.\n */\nfunction getNormalizedIsolineOptions({\n min = undefined,\n max = undefined,\n interval = undefined,\n ...rest\n}, defaults = {}) {\n const options = getNormalizedLineOptions({ ...rest }, defaults);\n options.min = (min === undefined) ? defaults.min : min;\n options.max = (max === undefined) ? defaults.max : max;\n options.interval = (interval === undefined) ? defaults.interval : interval;\n return options;\n}","/**\n * @module meteoJS/thermodynamicDiagram/hodograph\n */\nimport {\n windspeedKMHToMS,\n windspeedKNToMS,\n windspeedMSToKMH,\n windspeedMSToKN } from '../calc.js';\nimport {\n getNormalizedLineOptions,\n getNormalizedTextOptions,\n getNormalizedFontOptions,\n drawTextInto\n} from './Functions.js';\nimport CoordinateSystem from './CoordinateSystem.js';\nimport PlotDataArea from './PlotDataArea.js';\n\n/**\n * Options for the circle grid.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram~lineOptions}\n * module:meteoJS/thermodynamicDiagram/hodograph~gridCirclesOptions\n * @param {number} [interval=13.89]\n * Interval between grid circles (and value for the first grid circle).\n * In m/s.\n */\n\n/**\n * Options for a text backdrop.\n * \n * @typedef {Object}\n * module:meteoJS/thermodynamicDiagram/hodograph~backdropOptions\n * @property {boolean} [visible=true] - Visibility.\n * @property {mixed} [color='white'] - Color.\n */\n\n/**\n * Options for the grid labels.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram~textOptions}\n * module:meteoJS/thermodynamicDiagram/hodograph~gridLabelsOptions\n * @property {number} [angle=225]\n * Angle of the labels starting from the origin\n * (in degrees, 0 relates to North).\n * @property {string} [unit='km/h']\n * Unit of the label values. Allowed values: 'm/s', 'kn', 'km/h'\n * @property {string} [prefix=''] - Prefix of the label text.\n * @property {integer} [decimalPlaces=0] - Number of digits to appear after\n * the decimal point of the label values.\n * @property {module:meteoJS/thermodynamicDiagram/hodograph~backdropOptions}\n * [backdrop] - Options for the backdrop of the grid labels.\n */\n\n/**\n * Options for the hover labels in the hodograph.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/tdDiagram~labelsOptions}\n * module:meteoJS/thermodynamicDiagram/hodograph~labelsOptions\n * @property {Object} [pressure] - Options for the output of the pressure value.\n * @property {boolean} [pressure.visible=true] - Visibility.\n * @property {integer} [pressure.decimalPlaces=0]\n * Number of digits to appear after the decimal point.\n * @property {string} [pressure.prefix=' hPa'] - Prefix of the value text.\n * @property {Object} [windspeed]\n * Options for the output of the windspeed value.\n * @property {boolean} [windspeed.visible=true] - Visibility.\n * @property {string} [windspeed.unit='kn']\n * Unit of the value text. Allowed values: 'm/s', 'kn', 'km/h'\n * @property {integer} [windspeed.decimalPlaces=0]\n * Number of digits to appear after the decimal point.\n * @property {string} [windspeed.prefix=' kn'] - Prefix of the value text.\n * @property {Object} [winddir] - Options for the output of the winddir value.\n * @property {boolean} [winddir.visible=true] - Visibility.\n * @property {integer} [winddir.decimalPlaces=0]\n * Number of digits to appear after the decimal point.\n * @property {string} [winddir.prefix='°'] - Prefix of the value text.\n */\n\n/**\n * Options for the hover labels.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotDataArea~hoverLabelsOptions}\n * module:meteoJS/thermodynamicDiagram/hodograph~hoverLabelsOptions\n * @property {number} [maxDistance=20]\n * Maximum distance to a data point to show a hover label in pixels.\n * If undefined, always a hover label to the nearest point is shown.\n * @property {module:meteoJS/thermodynamicDiagram/hodograph~labelsOptions}\n * [hodograph] - Options for hodograph label.\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotDataArea~options}\n * module:meteoJS/thermodynamicDiagram/hodograph~options\n * @param {Object} [grid] - Options for the hodograph grid.\n * @param {module:meteoJS/thermodynamicDiagram~lineOptions} [grid.axes]\n * Options for the hodograph's x- and y-axes.\n * @param {module:meteoJS/thermodynamicDiagram/hodograph~gridCirclesOptions}\n * [grid.circles] - Options for the hodograph circle grid.\n * @param {module:meteoJS/thermodynamicDiagram/hodograph~gridLabelsOptions}\n * [grid.labels] - Options for the hodograph grid labels.\n * @param {number|undefined} [grid.max=undefined]\n * Maximum value for the grid axes and circles. If undefined, determined from\n * 'windspeedMax'.\n * @param {number} [windspeedMax=41.67]\n * The maximum windspeed [m/s], that should be visible on the plot. This\n * refers to the x- or y-direction with the origin in the middle of the plot,\n * because in these directions, a polar plot has the least extent concerning\n * distance.\n * @param {number[]|undefined} [origin=undefined]\n * Move origin of polar plot. If 'undefined' the origin is in the center. To\n * move, use an array with 2 elements. The first element moves the origin in\n * x direction, the second in y direction. The values are interpreted as\n * relative length (relating to the half width resp. height). Positive values\n * to move in North-East direction. E.g. to move the origin the half way to\n * the upper right corner, use [0.5, 0.5].\n * @param {module:meteoJS/thermodynamicDiagram/hodograph~hoverLabelsOptions}\n * [hoverLabels] - Hover labels options.\n */\n\n/**\n * Class to draw the hodograph.\n * \n * <pre><code>import Hodograph from 'meteojs/thermodynamicDiagram/Hodograph';</code></pre>\n * \n * @extends module:meteoJS/thermodynamicDiagram/plotDataArea.PlotDataArea\n */\nexport class Hodograph extends PlotDataArea {\n \n /**\n * @param {module:meteoJS/thermodynamicDiagram/hodograph~options} options\n * Options.\n */\n constructor({\n svgNode = undefined,\n coordinateSystem = new CoordinateSystem(),\n x,\n y,\n width,\n height,\n style = {},\n visible = true,\n events = {},\n hoverLabels = {},\n dataGroupIds = ['windbarbs'],\n getCoordinatesByLevelData = (dataGroupId, sounding, levelData, plotArea) => {\n let x = undefined;\n let y = undefined;\n if (levelData.wspd !== undefined &&\n levelData.wdir !== undefined) {\n x = levelData.wspd * -Math.sin(levelData.wdir / 180 * Math.PI);\n y = levelData.wspd * Math.cos(levelData.wdir / 180 * Math.PI);\n }\n else if (levelData.u !== undefined &&\n levelData.v !== undefined) {\n x = levelData.u;\n y = -levelData.v;\n }\n if (x === undefined ||\n y === undefined)\n return {};\n return {\n x: plotArea.center[0] + x * plotArea.pixelPerSpeed,\n y: plotArea.center[1] + y * plotArea.pixelPerSpeed\n };\n },\n insertDataGroupInto = (svgNode, dataGroupId, sounding, data) => {\n const basePolylines = [data\n .filter(level => {\n if (sounding.options.hodograph.minPressure !== undefined\n && level.levelData.pres !== undefined\n && level.levelData.pres < sounding.options.hodograph.minPressure)\n return false;\n if (sounding.options.hodograph.maxPressure !== undefined\n && level.levelData.pres !== undefined\n && level.levelData.pres > sounding.options.hodograph.maxPressure)\n return false;\n return true;\n })];\n basePolylines[0].sort((a,b) => b.levelData.pres-a.levelData.pres);\n const segmentPolylines = [];\n for (const segment of sounding.options.hodograph.segments) {\n const def = {\n levels: [],\n visible: segment.visible,\n style: segment.style\n };\n basePolylines.map((basePolyline, i) => {\n let lowSplit = undefined;\n let highSplit = undefined;\n basePolyline.map(l => {\n if ((segment.minPressure !== undefined && segment.minPressure <= l.levelData.pres\n && segment.maxPressure !== undefined && segment.maxPressure >= l.levelData.pres)\n || (segment.minPressure === undefined\n && segment.maxPressure !== undefined && segment.maxPressure >= l.levelData.pres)\n || (segment.minPressure !== undefined && segment.minPressure <= l.levelData.pres\n && segment.maxPressure === undefined)) {\n def.levels.push(l);\n if (highSplit === undefined)\n highSplit = l;\n lowSplit = l;\n }\n });\n if (highSplit !== undefined && lowSplit !== undefined && highSplit !== lowSplit) {\n const indexLow = basePolyline\n .findIndex(l => l.levelData.pres === lowSplit.levelData.pres);\n const indexHigh = basePolyline\n .findIndex(l => l.levelData.pres === highSplit.levelData.pres);\n const newBaseLine = basePolyline.slice(indexLow);\n basePolylines[i] = basePolyline.slice(0, indexHigh+1);\n basePolylines.push(newBaseLine);\n }\n });\n if (def.levels.length > 0)\n segmentPolylines.push(def);\n }\n basePolylines.map(basePolyline => {\n if (basePolyline.length < 2)\n return;\n svgNode\n .polyline(basePolyline.map(level => [ level.x, level.y ]))\n .fill('none').stroke(sounding.options.hodograph.style);\n });\n segmentPolylines.map(segmentPolyline => {\n svgNode\n .polyline(segmentPolyline.levels.map(level => [ level.x, level.y ]))\n .fill('none').stroke(segmentPolyline.style);\n });\n },\n grid = {},\n windspeedMax = windspeedKNToMS(150),\n origin = undefined,\n filterDataPoint = undefined,\n minDataPointsDistance = 0\n } = {}) {\n super({\n svgNode,\n coordinateSystem,\n x,\n y,\n width,\n height,\n style,\n visible,\n events,\n hoverLabels,\n dataGroupIds,\n getCoordinatesByLevelData,\n insertDataGroupInto,\n getSoundingVisibility:\n sounding => sounding.visible && sounding.options.hodograph.visible,\n filterDataPoint,\n minDataPointsDistance\n });\n\n /**\n * @type number[]|undefined\n * @private\n */\n this._origin = origin;\n\n /**\n * @type number\n * @private\n */\n this._windspeedMax = windspeedMax;\n \n this._gridOptions = this.getNormalizedGridOptions(grid);\n\n if (this._gridOptions.max === undefined)\n this._gridOptions.max = windspeedMax;\n this.init();\n }\n\n /**\n * Origin of the hodograph relative to the plot area. If not undefined, it\n * has to be a 2-element array. The first element moves the origin in\n * x direction, the second in y direction. The values are interpreted as\n * relative length (relating to the half width resp. height). Positive values\n * to move in North-East direction. E.g. to move the origin the half way to\n * the upper right corner, use [0.5, 0.5].\n * \n * @type number[]|undefined\n * @public\n */\n get origin() {\n return this._origin;\n }\n set origin(origin) {\n const oldOrigin = this._origin;\n this._origin = origin;\n this._hoverLabelsGroup.clear();\n if (oldOrigin === undefined && this._origin !== undefined\n || oldOrigin !== undefined && this._origin === undefined\n || (oldOrigin !== undefined && this._origin !== undefined\n && (oldOrigin[0] != this._origin[0]\n || oldOrigin[1] != this._origin[1])))\n this.onCoordinateSystemChange();\n }\n\n /**\n * The origin of the hodograph in pixel coordinates.\n * \n * @type number[]\n * @public\n * @readonly\n */\n get center() {\n const center = [this.width/2, this.height/2];\n if (this._origin !== undefined) {\n center[0] += this._origin[0] * this.minExtentLength/2;\n center[1] -= this._origin[1] * this.minExtentLength/2;\n }\n return center;\n }\n\n /**\n * Returns the pixel per speed unit. Mainly for internal usage.\n * \n * @type number\n * @public\n * @readonly\n */\n get pixelPerSpeed() {\n const center = this.center;\n return Math.min(\n Math.max(this.width - center[0], center[0]),\n Math.max(this.height - center[1], center[1])\n ) / this._windspeedMax;\n }\n \n /**\n * Plots hodograph background.\n * \n * @override\n */\n _drawBackground(svgNode) {\n super._drawBackground(svgNode);\n \n const center = this.center;\n const pixelPerSpeed = this.pixelPerSpeed;\n // x-/y-axes\n if (this._gridOptions.axes.visible) {\n svgNode\n .line(0, center[1], this.width, center[1])\n .stroke(this._gridOptions.axes.style);\n svgNode\n .line(center[0], 0, center[0], this.height)\n .stroke(this._gridOptions.axes.style);\n }\n \n // circles and labels\n for (let v = this._gridOptions.circles.interval;\n v <= this._gridOptions.max;\n v += this._gridOptions.circles.interval) {\n let radius = v * pixelPerSpeed;\n svgNode\n .circle(2*radius)\n .attr({\n cx: center[0],\n cy: center[1]\n })\n .fill('none')\n .stroke(this._gridOptions.circles.style);\n if (this._gridOptions.labels.visible) {\n let xText =\n radius *\n Math.cos((this._gridOptions.labels.angle - 90) / 180 * Math.PI);\n let yText =\n radius *\n Math.sin((this._gridOptions.labels.angle - 90) / 180 * Math.PI);\n let text = '';\n switch (this._gridOptions.labels.unit) {\n case 'm/s':\n text = Number.parseFloat(v)\n .toFixed(this._gridOptions.labels.decimalPlaces);\n break;\n case 'kn':\n text = windspeedMSToKN(v)\n .toFixed(this._gridOptions.labels.decimalPlaces);\n break;\n default:\n text = windspeedMSToKMH(v)\n .toFixed(this._gridOptions.labels.decimalPlaces);\n break;\n }\n text += this._gridOptions.labels.prefix;\n let fontColor = undefined;\n const font = {...this._gridOptions.labels.font};\n if ('color' in font) {\n fontColor = font.color;\n delete font.color;\n }\n const textNode = svgNode\n .plain(text)\n .font(this._gridOptions.labels.font)\n .center(center[0] + xText, center[1] + yText);\n if (fontColor !== undefined)\n textNode.fill(fontColor);\n if (font['text-anchor'] == 'end')\n textNode.dx(-textNode.bbox().width/2-3);\n else if (font['text-anchor'] == 'start')\n textNode.dx(+textNode.bbox().width/2+3);\n if (this._gridOptions.labels.angle == 90\n || this._gridOptions.labels.angle == 270)\n textNode.dy(textNode.bbox().height/2+3);\n\n if (this._gridOptions.labels.backdrop.visible) {\n const bbox = textNode.bbox();\n textNode.before(\n svgNode\n .rect(bbox.width, bbox.height)\n .move(bbox.x, bbox.y)\n .fill({ color: this._gridOptions.labels.backdrop.color })\n );\n }\n }\n }\n }\n \n /**\n * Normalizes options for grid.\n * \n * @private\n */\n getNormalizedGridOptions({\n axes = {},\n circles = {},\n labels = {},\n max = undefined\n }) {\n axes = getNormalizedLineOptions(axes);\n circles = getNormalizedLineOptions(circles);\n if (!('interval' in circles) ||\n circles.interval === undefined)\n circles.interval = windspeedKMHToMS(50);\n labels = getNormalizedTextOptions(labels);\n if (!('angle' in labels) ||\n labels.angle === undefined)\n labels.angle = 225;\n if (!('unit' in labels) ||\n labels.unit === undefined)\n labels.unit = 'km/h';\n if (!('prefix' in labels) ||\n labels.prefix === undefined)\n labels.prefix = '';\n if (!('decimalPlaces' in labels) ||\n labels.decimalPlaces === undefined)\n labels.decimalPlaces = 0;\n if (!('backdrop' in labels) ||\n labels.backdrop === undefined)\n labels.backdrop = {};\n if (!('color' in labels.backdrop))\n labels.backdrop.color = 'white';\n if (!('visible' in labels.backdrop))\n labels.backdrop.visible = true;\n if (labels.font.size === undefined)\n labels.font.size = 10;\n \n return {\n axes,\n circles,\n labels,\n max\n };\n }\n\n /**\n * Initialize hover labels options.\n * \n * @param {module:meteoJS/thermodynamicDiagram/hodograph~hoverLabelsOptions}\n * options - Hover labels options.\n */\n _initHoverLabels({\n visible = true,\n type = 'mousemove',\n maxDistance = 20,\n insertLabelsFunc = undefined,\n getLevelData = ({ hoverLabelsSounding, e, maxDistance }) => {\n const sounding = hoverLabelsSounding.sounding;\n\n let smallestDistanceSquare = undefined;\n let nearestLevelData = undefined;\n sounding.getLevels()\n .filter(pres => \n (hoverLabelsSounding.options.hodograph.minPressure === undefined\n || hoverLabelsSounding.options.hodograph.minPressure <= pres)\n && (hoverLabelsSounding.options.hodograph.maxPressure === undefined\n || pres <= hoverLabelsSounding.options.hodograph.maxPressure))\n .map(pres => {\n const levelData = sounding.getData(pres);\n if (levelData.wspd === undefined || levelData.wdir === undefined)\n return;\n const { x, y } =\n this._getCoordinatesByLevelData('windbarbs',\n sounding, levelData, this);\n const distanceSquare =\n Math.pow(e.elementX - x, 2)\n + Math.pow(e.elementY - y, 2);\n if (nearestLevelData === undefined\n || distanceSquare < smallestDistanceSquare) {\n smallestDistanceSquare = distanceSquare;\n nearestLevelData = levelData;\n }\n });\n\n if (maxDistance !== undefined\n && Math.pow(maxDistance, 2) < smallestDistanceSquare)\n nearestLevelData = {};\n return nearestLevelData;\n },\n getHoverSounding = undefined,\n hodograph = {}\n }) {\n if (!('visible' in hodograph))\n hodograph.visible = true;\n if (!('style' in hodograph))\n hodograph.style = {};\n hodograph.font = getNormalizedFontOptions(hodograph.font, {\n anchor: 'end',\n 'alignment-baseline': 'bottom'\n });\n if (!('fill' in hodograph))\n hodograph.fill = {};\n if (hodograph.fill.opacity === undefined)\n hodograph.fill.opacity = 0.7;\n if (hodograph.fill.color === undefined)\n hodograph.fill.color = 'white';\n if (insertLabelsFunc === undefined)\n insertLabelsFunc = this._makeInsertLabelsFunc(hodograph);\n\n super._initHoverLabels({\n visible,\n type,\n maxDistance,\n insertLabelsFunc,\n getLevelData,\n getHoverSounding\n });\n }\n\n /**\n * Makes a default insertLabelsFunc.\n * \n * @param {module:meteoJS/thermodynamicDiagram/hodograph~labelsOptions}\n * options - Style options for the hover labels.\n * @private\n */\n _makeInsertLabelsFunc({\n visible = true,\n style = {},\n font = {},\n fill = {},\n horizontalMargin = 10,\n verticalMargin = 0,\n radius = undefined,\n radiusPlus = 2,\n pressure = {},\n windspeed = {},\n winddir = {}\n }) {\n pressure = (({\n visible = true,\n decimalPlaces = 0,\n prefix = ' hPa'\n }) => { return { visible, decimalPlaces, prefix }; })(pressure);\n windspeed = (({\n visible = true,\n unit = 'kn',\n decimalPlaces = 0,\n prefix = ' kn'\n }) => { return { visible, unit, decimalPlaces, prefix }; })(windspeed);\n winddir = (({\n visible = true,\n decimalPlaces = 0,\n prefix = '°'\n }) => { return { visible, decimalPlaces, prefix }; })(winddir);\n return (sounding, levelData, group) => {\n group.clear();\n\n if (levelData === undefined\n || !visible)\n return;\n\n const { x, y } =\n this._getCoordinatesByLevelData('windbarbs',\n sounding, levelData, this);\n if (x === undefined ||\n y === undefined)\n return;\n\n let defaultStyle = sounding.options.hodograph.style;\n if (levelData.pres !== undefined)\n sounding.options.hodograph.segments.map(segment => {\n if ((segment.minPressure === undefined\n || segment.minPressure <= levelData.pres)\n && (segment.maxPressure === undefined\n || segment.maxPressure >= levelData.pres))\n defaultStyle = segment.style;\n });\n \n const dotRadius = (radius === undefined)\n ? defaultStyle.width / 2 + radiusPlus\n : radius;\n const fillOptions = {...style}; // Deep copy\n if (!('color' in fillOptions))\n fillOptions.color = defaultStyle.color;\n group\n .circle(2 * dotRadius)\n .attr({ cx: x, cy: y })\n .fill(fillOptions);\n const background = group.rect().fill(fill);\n const labelFont = {...font}; // Deep copy\n labelFont.anchor = 'start';\n if (labelFont.anchor == 'start' &&\n this.width - x < 45)\n labelFont.anchor = 'end';\n if (labelFont.anchor == 'end' &&\n x < 45)\n labelFont.anchor = 'start';\n let yDelta = 0;\n let textGroups = [];\n const texts = [];\n if (pressure.visible) {\n const text = Number.parseFloat(levelData.pres)\n .toFixed(pressure.decimalPlaces);\n texts.push(`${text}${pressure.prefix}`);\n }\n if (windspeed.visible) {\n let text = '';\n switch (windspeed.unit) {\n case 'm/s':\n text = Number.parseFloat(levelData.wspd)\n .toFixed(windspeed.decimalPlaces);\n break;\n case 'kn':\n text = windspeedMSToKN(levelData.wspd)\n .toFixed(windspeed.decimalPlaces);\n break;\n default:\n text = windspeedMSToKMH(levelData.wspd)\n .toFixed(windspeed.decimalPlaces);\n break;\n }\n texts.push(`${text}${windspeed.prefix}`);\n }\n if (winddir.visible) {\n const text = Number.parseFloat(levelData.wdir)\n .toFixed(winddir.decimalPlaces);\n texts.push(`${text}${winddir.prefix}`);\n }\n texts.map(text => {\n yDelta += labelFont.size * 5/4;\n textGroups.push(drawTextInto({\n node: group,\n text,\n x,\n y: y + yDelta,\n horizontalMargin,\n verticalMargin,\n font: labelFont\n }));\n });\n if (y+yDelta > this.height)\n textGroups.map(g => g.dy(-yDelta));\n const maxBBox = {\n x: undefined,\n y: undefined,\n x2: undefined,\n y2: undefined\n };\n textGroups.map(g => {\n g.children().map(el => {\n if (el.type != 'text')\n return;\n const bbox = el.bbox();\n if (maxBBox.x === undefined || bbox.x < maxBBox.x)\n maxBBox.x = bbox.x;\n if (maxBBox.y === undefined || bbox.y < maxBBox.y)\n maxBBox.y = bbox.y;\n if (maxBBox.x2 === undefined || maxBBox.x2 < bbox.x2)\n maxBBox.x2 = bbox.x2;\n if (maxBBox.y2 === undefined || maxBBox.y2 < bbox.y2)\n maxBBox.y2 = bbox.y2;\n });\n });\n background.attr({\n x: maxBBox.x,\n y: maxBBox.y,\n width: maxBBox.x2 - maxBBox.x,\n height: maxBBox.y2 - maxBBox.y\n });\n };\n }\n}\nexport default Hodograph;","/**\n * @module meteoJS/thermodynamicDiagram/axis\n */\nimport {\n getNormalizedTextOptions\n} from './Functions.js';\nimport PlotArea from './PlotArea.js';\n\n/**\n * Definitions for the labels of an axis.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram~textOptions}\n * module:meteoJS/thermodynamicDiagram/axis~labelsOptions\n * @property {number} [interval] - Interval between the labels.\n * @property {string} [unit] - Unit of the label values.\n * @property {string} [prefix=''] - Prefix of the label text.\n * @property {integer} [decimalPlaces=0]\n * Number of digits to appear after the decimal point of the label values.\n */\n\n/**\n * Title definition for an axis.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram~textOptions}\n * module:meteoJS/thermodynamicDiagram/axis~titleOptions\n * @property {string} [text=''] - Title text.\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/plotArea~options}\n * module:meteoJS/thermodynamicDiagram/axis~options\n * @property {module:meteoJS/thermodynamicDiagram/axis~labelsOptions} labels\n * Options for the yAxis Labels.\n * @property {module:meteoJS/thermodynamicDiagram/axis~titleOptions} title\n * Options for the title of the Axis.\n * @property {boolean} [isHorizontal=true]\n * Internal. Is the axis horizontal or vertical.\n */\n\n/**\n * Abstract class to draw an axis with labelling.\n * \n * @extends module:meteoJS/thermodynamicDiagram/plotArea.PlotArea\n * @abstract\n */\nexport class Axis extends PlotArea {\n\n /**\n * @param {module:meteoJS/thermodynamicDiagram/axis~options} options\n * Options.\n */\n constructor({\n svgNode = undefined,\n coordinateSystem,\n x,\n y,\n width,\n height,\n style = {},\n visible = true,\n events = {},\n labels = {},\n title = {},\n isHorizontal = true\n }) {\n if (style.overflow === undefined)\n style.overflow = 'visible';\n \n super({\n svgNode,\n coordinateSystem,\n x,\n y,\n width,\n height,\n style,\n visible,\n events\n });\n \n /**\n * @type Object\n * @private\n */\n this._labelsOptions = this.getNormalizedLabelsOptions(labels);\n \n /**\n * @type Object\n * @private\n */\n this._titleOptions = getNormalizedTitleOptions(title);\n\n /**\n * @type boolean\n * @private\n */\n this._isHorizontal = isHorizontal;\n \n this.init();\n }\n\n /**\n * Normalize the options for the labels.\n * \n * @param {module:meteoJS/thermodynamicDiagram/axis~labelsOptions}\n * options - Options.\n * @returns {module:meteoJS/thermodynamicDiagram/axis~labelsOptions}\n * Normalized options.\n */\n getNormalizedLabelsOptions({\n interval = undefined,\n unit = '',\n prefix = '',\n decimalPlaces = 0,\n ...rest\n }) {\n const options = getNormalizedTextOptions({ ...rest }, {\n font: {\n size: 11,\n anchor: 'middle'\n }\n });\n options.interval = interval;\n options.unit = unit;\n options.prefix = prefix;\n options.decimalPlaces = decimalPlaces;\n return options;\n }\n\n /**\n * Draws the labels of the axis.\n * \n * @param {external:SVG} svgNode - Node to draw into.\n * @param {number} min - Minimum value for the labels.\n * @param {number} max - Maximum value for the labels.\n * @param {Function} getTextByInterval\n * Returns the text representation of the label value (its argument).\n * @param {Function} getPositionByInterval\n * Returns the position in pixels of the label value (its argument).\n * @internal\n */\n drawLabels({\n svgNode,\n min,\n max,\n getTextByInterval =\n i => Number.parseFloat(i).toFixed(this._labelsOptions.decimalPlaces),\n getPositionByInterval\n }) {\n for (let i=min; i<=max; i+=this._labelsOptions.interval) {\n let text = getTextByInterval(i);\n text += this._labelsOptions.prefix;\n let fontColor = undefined;\n const font = {...this._labelsOptions.font};\n if ('color' in font) {\n fontColor = font.color;\n delete font.color;\n }\n if (!this._isHorizontal)\n font['anchor'] = 'end';\n const textNode = svgNode\n .plain(text)\n .font(font);\n if (this._isHorizontal) {\n textNode.center(\n getPositionByInterval(i),\n font.size\n );\n if (font['anchor'] == 'end')\n textNode.dx(-textNode.bbox().width/2);\n else if (font['anchor'] == 'start')\n textNode.dx(+textNode.bbox().width/2);\n }\n else\n textNode\n .x(this.width)\n .cy(getPositionByInterval(i))\n .dx(-textNode.bbox().width);\n if (fontColor !== undefined)\n textNode.fill(fontColor);\n }\n }\n\n /**\n * Draws a title for the axis.\n * \n * @param {Object} options - Options.\n * @param {external:SVG} svgNode - Node to insert into.\n * @param {external:SVG} svgLabelsNode - Node of the axis labels.\n * @private\n */\n _drawTitle({\n svgNode,\n svgLabelsNode\n }) {\n let rotation = 0;\n if (!this._isHorizontal)\n rotation = -90;\n let margin = 0;\n if (svgLabelsNode !== undefined)\n margin = (rotation == -90)\n ? svgLabelsNode.bbox().width\n : svgLabelsNode.bbox().height;\n \n let fontColor = undefined;\n const font = {...this._titleOptions.font};\n if ('color' in font) {\n fontColor = font.color;\n delete font.color;\n }\n let cxText = this.width/2;\n let cyText = font.size + margin;\n if (rotation == -90) {\n cxText = this.width - font.size - margin;\n cyText = this.height/2;\n }\n const textNode = svgNode\n .plain(this._titleOptions.text)\n .font(font)\n .center(cxText, cyText)\n .rotate(rotation);\n if (fontColor !== undefined)\n textNode.fill(fontColor);\n if (rotation == -90) {\n if (font['anchor'] == 'end')\n textNode.dy(-textNode.bbox().height/2);\n else if (font['anchor'] == 'start')\n textNode.dy(+textNode.bbox().height/2);\n }\n else {\n if (font['anchor'] == 'end')\n textNode.dx(-textNode.bbox().width/2);\n else if (font['anchor'] == 'start')\n textNode.dx(+textNode.bbox().width/2);\n }\n }\n \n /**\n * Draw background into SVG group.\n * \n * @override\n */\n _drawBackground(svgNode) {\n super._drawBackground(svgNode);\n \n let svgLabelsGroup = undefined;\n if (this._labelsOptions.visible) {\n svgLabelsGroup = svgNode.group();\n this.drawLabels({\n svgNode: svgLabelsGroup\n });\n }\n \n if (this._titleOptions.visible)\n this._drawTitle({\n svgNode: svgNode.group(),\n svgLabelsNode: svgLabelsGroup\n });\n }\n \n}\nexport default Axis;\n\n/**\n * Normalize the options for the title.\n * \n * @param {module:meteoJS/thermodynamicDiagram/axis~titleOptions}\n * options - Options.\n * @returns {module:meteoJS/thermodynamicDiagram/axis~titleOptions}\n * Normalized options.\n */\nfunction getNormalizedTitleOptions({\n text = '',\n ...rest\n}) {\n const options = getNormalizedTextOptions({...rest}, {\n font: {\n anchor: 'middle'\n }\n });\n options.text = text;\n return options;\n}","/**\n * @module meteoJS/thermodynamicDiagram/axes/xAxis\n */\nimport {\n tempKelvinToCelsius,\n tempCelsiusToKelvin\n} from '../../calc.js';\nimport Axis from '../Axis.js';\n\n/**\n * Definitions for the labels of the x-axis of the thermodynamic diagram.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/axis~labelsOptions}\n * module:meteoJS/thermodynamicDiagram/axes/xAxis~labelOptions\n * @property {number} [interval=10] - Interval between the labels.\n * @property {string} [unit='°C']\n * Unit of the label values. Allowed values: '°C', 'K'.\n */\n\n/**\n * Class to draw the xAxis labelling.\n * \n * @extends module:meteoJS/thermodynamicDiagram/axis.Axis\n */\nexport class xAxis extends Axis {\n\n /**\n * Normalize the options for the labels.\n * \n * @param {module:meteoJS/thermodynamicDiagram/axes/xAxis~labelOptions}\n * options - Options.\n * @returns {module:meteoJS/thermodynamicDiagram/axes/xAxis~labelOptions}\n * Normalized options.\n * @override\n */\n getNormalizedLabelsOptions({\n interval = 10,\n unit = '°C',\n ...rest\n }) {\n return super.getNormalizedLabelsOptions({\n interval,\n unit,\n ...rest\n });\n }\n \n /**\n * Draws the labels of the axis.\n * \n * @param {external:SVG} svgNode - Node to draw into.\n * @param {number} [min] - Minimum temperature value to label.\n * @param {number} [max] - Maximum temperature value to label.\n * @param {Function} [getTextByInterval]\n * Returns the text representation of the label value (its argument).\n * @param {Function} [getPositionByInterval]\n * Returns the position in pixels of the label value (its argument).\n * @override\n */\n drawLabels({\n svgNode,\n getTextByInterval = T => Number.parseFloat(T).toFixed(this._labelsOptions.decimalPlaces),\n getPositionByInterval = T => {\n if (this._labelsOptions.unit == '°C')\n T = tempCelsiusToKelvin(T);\n return this.coordinateSystem.getXByYT(0, T);\n }\n }) {\n const min = (this._labelsOptions.unit == '°C')\n ? Math.ceil(tempKelvinToCelsius(this.coordinateSystem.getTByXY(0, 0))/this._labelsOptions.interval)*this._labelsOptions.interval\n : Math.ceil((this.coordinateSystem.getTByXY(0, 0))/this._labelsOptions.interval)*this._labelsOptions.interval;\n const max = (this._labelsOptions.unit == '°C')\n ? Math.floor(tempKelvinToCelsius(this.coordinateSystem.getTByXY(this.width, 0))/this._labelsOptions.interval)*this._labelsOptions.interval\n : Math.floor((this.coordinateSystem.getTByXY(this.width, 0))/this._labelsOptions.interval)*this._labelsOptions.interval;\n super.drawLabels({\n svgNode,\n min,\n max,\n getTextByInterval,\n getPositionByInterval\n });\n }\n \n}\nexport default xAxis;","/**\n * @module meteoJS/thermodynamicDiagram/axes/yAxis\n */\nimport Axis from '../Axis.js';\n\n/**\n * Definitions for the labels of the windspeed profile axis.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/axis~labelsOptions}\n * module:meteoJS/thermodynamicDiagram/axes/yAxis~labelOptions\n * @property {number} [interval=50] - Interval between the labels.\n * @property {string} [unit='hPa']\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/axis~options}\n * module:meteoJS/thermodynamicDiagram/axes/yAxis~options\n * @property {module:meteoJS/thermodynamicDiagram/axes/yAxis~labelOptions}\n * [labels] - Options for the labels.\n */\n\n/**\n * Class to draw the yAxis labelling.\n * \n * @extends module:meteoJS/thermodynamicDiagram/axis.Axis\n */\nexport class yAxis extends Axis {\n\n /**\n * @param {module:meteoJS/thermodynamicDiagram/axes/yAxis~options} options\n * Options.\n */\n constructor({\n svgNode = undefined,\n coordinateSystem,\n x,\n y,\n width,\n height,\n style = {},\n visible = true,\n events = {},\n labels = {},\n title = {}\n }) {\n super({\n svgNode,\n coordinateSystem,\n x,\n y,\n width,\n height,\n style,\n visible,\n events,\n labels,\n title,\n isHorizontal: false\n });\n }\n\n /**\n * Normalize the options for the labels.\n * \n * @param {module:meteoJS/thermodynamicDiagram/axes/yAxis~labelOptions}\n * options - Options.\n * @returns {module:meteoJS/thermodynamicDiagram/axes/yAxis~labelOptions}\n * Normalized options.\n * @override\n */\n getNormalizedLabelsOptions({\n interval = 50,\n unit = 'hPa',\n ...rest\n }) {\n return super.getNormalizedLabelsOptions({\n interval,\n unit,\n ...rest\n });\n }\n\n /**\n * Draws the labels of the axis.\n * \n * @param {external:SVG} svgNode - Node to draw into.\n * @param {number} [min] - Minimum windspeed value to label.\n * @param {number} [max]\n * Maximum windspeed value to label.\n * @param {Function} [getTextByInterval]\n * Returns the text representation of the label value (its argument).\n * @param {Function} [getPositionByInterval]\n * Returns the position in pixels of the label value (its argument).\n * @override\n */\n drawLabels({\n svgNode,\n min = Math.ceil(this.coordinateSystem.getPByXY(0, this.height)/this._labelsOptions.interval)*this._labelsOptions.interval,\n max = Math.floor(this.coordinateSystem.getPByXY(0, 0)/this._labelsOptions.interval)*this._labelsOptions.interval,\n getTextByInterval = level => Number.parseFloat(level).toFixed(this._labelsOptions.decimalPlaces),\n getPositionByInterval = level => this.height - this.coordinateSystem.getYByXP(0, level)\n }) {\n super.drawLabels({\n svgNode,\n min,\n max,\n getTextByInterval,\n getPositionByInterval\n });\n }\n\n}\nexport default yAxis;","/**\n * @module meteoJS/thermodynamicDiagram/axes/windspeedProfileAxis\n */\nimport {\n windspeedKNToMS,\n windspeedMSToKN,\n windspeedMSToKMH\n} from '../../calc.js';\nimport Axis from '../Axis.js';\n\n/**\n * Definitions for the labels of the windspeed profile axis.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/axis~labelsOptions}\n * module:meteoJS/thermodynamicDiagram/axes/windspeedProfileAxis~labelOptions\n * @property {number} [interval=25.72] - Interval between the labels.\n * @property {string} [unit='kn']\n * Unit of the label values. Allowed values: 'm/s', 'kn', 'km/h'.\n * @property {string} [prefix=' kn'] - Prefix of the label text.\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {module:meteoJS/thermodynamicDiagram/axis~options}\n * module:meteoJS/thermodynamicDiagram/axes/windspeedProfileAxis~options\n * @property {module:meteoJS/thermodynamicDiagram/axes/windspeedProfileAxis~labelOptions}\n * [labels] - Options for the labels.\n * @property {number} [windspeedMax=77.17]\n * The maximum windspeed value. Unit: m/s.\n */\n\n/**\n * Class to draw the labelling of the windspeed profile.\n * \n * <pre><code>import WindspeedProfileAxis from 'meteojs/thermodynamicDiagram/axes/WindspeedProfileAxis';</code></pre>\n * \n * @extends module:meteoJS/thermodynamicDiagram/axis.Axis\n */\nexport class WindspeedProfileAxis extends Axis {\n\n /**\n * @param {module:meteoJS/thermodynamicDiagram/axes/windspeedProfileAxis~options}\n * options - Options.\n */\n constructor({\n svgNode = undefined,\n coordinateSystem,\n x,\n y,\n width,\n height,\n style = {},\n visible = true,\n events = {},\n labels = {},\n title = {},\n windspeedMax = windspeedKNToMS(150)\n }) {\n super({\n svgNode,\n coordinateSystem,\n x,\n y,\n width,\n height,\n style,\n visible,\n events,\n labels,\n title\n });\n\n /**\n * @type number\n * @private\n */\n this._windspeedMax = windspeedMax;\n\n this.init();\n }\n\n /**\n * Maximum axis value. Unit: m/s.\n * \n * @type number\n */\n get windspeedMax() {\n return this._windspeedMax;\n }\n set windspeedMax(windspeedMax) {\n const oldWindspeedMax = this._windspeedMax;\n this._windspeedMax = windspeedMax;\n if (this._windspeedMax != oldWindspeedMax)\n this.onCoordinateSystemChange();\n }\n\n /**\n * Normalize the options for the labels.\n * \n * @param {module:meteoJS/thermodynamicDiagram/axes/windspeedProfileAxis~labelOptions}\n * options - Options.\n * @returns {module:meteoJS/thermodynamicDiagram/axes/windspeedProfileAxis~labelOptions}\n * Normalized options.\n * @override\n */\n getNormalizedLabelsOptions({\n interval = windspeedKNToMS(50),\n unit = 'kn',\n prefix = ' kn',\n ...rest\n }) {\n return super. getNormalizedLabelsOptions({\n interval,\n unit,\n prefix,\n ...rest\n });\n }\n\n /**\n * Draws the labels of the axis.\n * \n * @param {external:SVG} svgNode - Node to draw into.\n * @param {number} [min=0] - Minimum windspeed value to label.\n * @param {number} [max=this._windspeedMax]\n * Maximum windspeed value to label.\n * @param {Function} [getTextByInterval]\n * Returns the text representation of the label value (its argument).\n * @param {Function} [getPositionByInterval]\n * Returns the position in pixels of the label value (its argument).\n * @override\n */\n drawLabels({\n svgNode,\n min = 0,\n max = this._windspeedMax,\n getTextByInterval = windspeed => {\n switch (this._labelsOptions.unit) {\n case 'm/s':\n return Number.parseFloat(windspeed)\n .toFixed(this._labelsOptions.decimalPlaces);\n case 'kn':\n return windspeedMSToKN(windspeed)\n .toFixed(this._labelsOptions.decimalPlaces);\n default:\n return windspeedMSToKMH(windspeed)\n .toFixed(this._labelsOptions.decimalPlaces);\n }\n },\n getPositionByInterval =\n windspeed => this.width * windspeed / this._windspeedMax\n }) {\n super.drawLabels({\n svgNode,\n min,\n max,\n getTextByInterval,\n getPositionByInterval\n });\n }\n \n}\nexport default WindspeedProfileAxis;","/**\n * @module meteoJS/thermodynamicDiagram\n */\nimport ThermodynamicDiagramPluggable from './ThermodynamicDiagramPluggable.js';\nimport StueveDiagram from './thermodynamicDiagram/coordinateSystem/StueveDiagram.js';\nimport Emagram from './thermodynamicDiagram/coordinateSystem/Emagram.js';\nimport SkewTlogPDiagram from './thermodynamicDiagram/coordinateSystem/SkewTlogPDiagram.js';\nimport TDDiagram from './thermodynamicDiagram/TDDiagram.js';\nimport WindbarbsProfile from './thermodynamicDiagram/WindbarbsProfile.js';\nimport WindspeedProfile from './thermodynamicDiagram/WindspeedProfile.js';\nimport Hodograph from './thermodynamicDiagram/Hodograph.js';\nimport { xAxis as xAxisClass } from './thermodynamicDiagram/axes/xAxis.js';\nimport { yAxis as yAxisClass } from './thermodynamicDiagram/axes/yAxis.js';\nimport { WindspeedProfileAxis as WindspeedProfileAxisClass } from './thermodynamicDiagram/axes/WindspeedProfileAxis.js';\n\n/**\n * Options for the coordinate system.\n * \n * @typedef {module:meteoJS/thermodynamicDiagramPluggable~options}\n * module:meteoJS/thermodynamicDiagram~coordinateSystemOptions\n * @property {'skewTlogP'|'stueve'|'emagram'} [type='skewTlogP']\n * Thermodynamic diagarm type.\n * @property {module:meteoJS/thermodynamicDiagram/coordinateSystem~pressureOptions}\n * [pressure] - Pressure options.\n * @property {module:meteoJS/thermodynamicDiagram/coordinateSystem~temperatureOptions}\n * [temperature] - Temperature options.\n */\n\n/**\n * Options for the constructor.\n * \n * @typedef {module:meteoJS/thermodynamicDiagramPluggable~options}\n * module:meteoJS/thermodynamicDiagram~options\n * @param {module:meteoJS/thermodynamicDiagram~coordinateSystemOptions}\n * [coordinateSystem] - Coordinate system options.\n * @param {module:meteoJS/thermodynamicDiagram/tdDiagram~options} [diagram]\n * Options for the real thermodynamic diagram.\n * @param {module:meteoJS/thermodynamicDiagram/windbarbsProfile~options}\n * [windbarbs] - Options for the windbarbs profile.\n * @param {module:meteoJS/thermodynamicDiagram/windspeedProfile~options}\n * [windprofile] - Options for the windspeed profile.\n * @param {module:meteoJS/thermodynamicDiagram/axes/windspeedProfileAxis~options}\n * [windspeedProfileAxis] - Options for the windspeed profile axis.\n * @param {module:meteoJS/thermodynamicDiagram/hodograph~options} [hodograph]\n * Options for the hodograph container.\n * @param {module:meteoJS/thermodynamicDiagram/axes/xAxis~options} [xAxis]\n * Options for the xAxis container.\n * @param {module:meteoJS/thermodynamicDiagram/axes/yAxis~options} [yAxis]\n * Options for the yAxis container.\n */\n\n/**\n * Class to draw a SVG thermodynamic diagram.\n * \n * <pre><code>import ThermodynamicDiagram from 'meteojs/ThermodynamicDiagram';</code></pre>\n * \n * @extends module:meteoJS/thermodynamicDiagramPluggable.ThermodynamicDiagramPluggable\n */\nexport class ThermodynamicDiagram extends ThermodynamicDiagramPluggable {\n \n /**\n * @param {module:meteoJS/thermodynamicDiagram~options} options - Options.\n */\n constructor({\n renderTo = undefined,\n width = undefined,\n height = undefined,\n coordinateSystem = {},\n diagram = {},\n windbarbsProfile = {},\n windspeedProfile = {},\n windspeedProfileAxis = {},\n hodograph = {},\n xAxis = {},\n yAxis = {}\n }) {\n super({\n renderTo,\n width,\n height\n });\n \n diagram = normalizePlotAreaOptions(diagram);\n windbarbsProfile = normalizePlotAreaOptions(windbarbsProfile);\n windspeedProfile = normalizePlotAreaOptions(windspeedProfile);\n windspeedProfileAxis = normalizePlotAreaOptions(windspeedProfileAxis);\n hodograph = normalizePlotAreaOptions(hodograph);\n xAxis = normalizePlotAreaOptions(xAxis);\n yAxis = normalizePlotAreaOptions(yAxis);\n \n let defaultPadding = this.svgNode.width() * 0.05;\n if (xAxis.width === undefined &&\n diagram.width === undefined &&\n windbarbsProfile.width === undefined &&\n windspeedProfile.width === undefined) {\n yAxis.width =\n (this.svgNode.width() - 2 * defaultPadding) * 0.1;\n diagram.width =\n (this.svgNode.width() - 2 * defaultPadding) * 0.7;\n windbarbsProfile.width =\n (this.svgNode.width() - 2 * defaultPadding) * 0.2 * 1/3;\n windspeedProfile.width =\n (this.svgNode.width() - 2 * defaultPadding) * 0.2 * 2/3;\n }\n else if (diagram.width === undefined)\n diagram.width =\n this.svgNode.width() - 2 * defaultPadding\n - windbarbsProfile.width- windspeedProfile.width;\n else if (windbarbsProfile.width === undefined &&\n windspeedProfile.width === undefined) {\n windbarbsProfile.width =\n (this.svgNode.width() - 2 * defaultPadding - diagram.width) * 1/3;\n windspeedProfile.width =\n (this.svgNode.width() - 2 * defaultPadding - diagram.width) * 2/3;\n }\n if (yAxis.x === undefined &&\n diagram.x === undefined &&\n windbarbsProfile.x === undefined &&\n windspeedProfile.x === undefined) {\n yAxis.x = defaultPadding;\n diagram.x =\n yAxis.x + yAxis.width;\n windbarbsProfile.x =\n diagram.x + diagram.width;\n windspeedProfile.x =\n windbarbsProfile.x + windbarbsProfile.width;\n }\n else if (diagram.x === undefined)\n diagram.x =\n windbarbsProfile.x - windbarbsProfile.width;\n else if (windbarbsProfile.x === undefined &&\n windspeedProfile.x === undefined) {\n windbarbsProfile.x =\n diagram.x + diagram.width;\n windspeedProfile.x =\n windbarbsProfile.x + windbarbsProfile.width;\n }\n if (xAxis.height === undefined)\n xAxis.height = this.svgNode.height() * 0.06;\n if (diagram.height === undefined)\n diagram.height =\n this.svgNode.height() - xAxis.height - 2 * defaultPadding;\n if (yAxis.height === undefined)\n yAxis.height = diagram.height;\n if (windbarbsProfile.height === undefined)\n windbarbsProfile.height = diagram.height;\n if (windspeedProfile.height === undefined)\n windspeedProfile.height = diagram.height;\n if (diagram.y === undefined)\n diagram.y = defaultPadding;\n if (yAxis.y === undefined)\n yAxis.y = diagram.y;\n if (windbarbsProfile.y === undefined)\n windbarbsProfile.y = diagram.y;\n if (windspeedProfile.y === undefined)\n windspeedProfile.y = diagram.y;\n if (xAxis.width === undefined)\n xAxis.width = diagram.width;\n if (xAxis.x === undefined)\n xAxis.x = diagram.x;\n if (xAxis.y === undefined)\n xAxis.y = diagram.y + diagram.height;\n if (xAxis.height === undefined)\n xAxis.height = defaultPadding;\n\n if (windspeedProfileAxis.width === undefined)\n windspeedProfileAxis.width = windspeedProfile.width;\n if (windspeedProfileAxis.height === undefined)\n windspeedProfileAxis.height = defaultPadding;\n if (windspeedProfileAxis.x === undefined)\n windspeedProfileAxis.x = windspeedProfile.x;\n if (windspeedProfileAxis.y === undefined)\n windspeedProfileAxis.y = windspeedProfile.y + windspeedProfile.height;\n \n // Defintionen zum Hodograph\n if (hodograph.x === undefined)\n hodograph.x = diagram.x;\n if (hodograph.y === undefined)\n hodograph.y = diagram.y;\n if (hodograph.width === undefined)\n hodograph.width = Math.min(diagram.width, diagram.height) * 0.4;\n if (hodograph.height === undefined)\n hodograph.height = hodograph.width;\n \n this.diagram = new TDDiagram(diagram);\n this.appendPlotArea(this.diagram);\n \n this.yAxis = new yAxisClass(yAxis);\n this.appendPlotArea(this.yAxis);\n \n this.xAxis = new xAxisClass(xAxis);\n this.appendPlotArea(this.xAxis);\n \n this.windbarbsProfile = new WindbarbsProfile(windbarbsProfile);\n this.appendPlotArea(this.windbarbsProfile);\n \n this.windspeedProfile = new WindspeedProfile(windspeedProfile);\n this.windspeedProfile.on('prebuild:background', ({ node }) => {\n node\n .rect(this.windspeedProfile.width, this.windspeedProfile.height)\n .fill({ color: 'white' })\n .stroke({ color: 'black', width: 1 });\n });\n this.appendPlotArea(this.windspeedProfile);\n\n this.windspeedProfileAxis = new WindspeedProfileAxisClass(windspeedProfileAxis);\n this.appendPlotArea(this.windspeedProfileAxis);\n \n this.hodograph = new Hodograph(hodograph);\n this.hodograph.on('prebuild:background', ({ node }) => {\n node\n .rect(this.hodograph.width-2, this.hodograph.height-2)\n .move(1,1)\n .fill({ color: 'white' })\n .stroke({ color: 'black', width: 1 });\n });\n this.appendPlotArea(this.hodograph);\n \n if (coordinateSystem.type === undefined)\n coordinateSystem.type = 'skewTlogP';\n coordinateSystem.width = diagram.width;\n coordinateSystem.height = diagram.height;\n \n /**\n * @type module:meteoJS/thermodynamicDiagram/coordinateSystem.CoordinateSystem\n * @private\n */\n this._coordinateSystem;\n this.coordinateSystem =\n (coordinateSystem.type == 'stueve') ?\n new StueveDiagram(coordinateSystem) :\n (coordinateSystem.type == 'emagram') ?\n new Emagram(coordinateSystem) :\n new SkewTlogPDiagram(coordinateSystem);\n }\n \n /**\n * Coordinate system for the different plot areas.\n * \n * @type module:meteoJS/thermodynamicDiagram/coordinateSystem.CoordinateSystem\n * @public\n */\n get coordinateSystem() {\n return this._coordinateSystem;\n }\n set coordinateSystem(coordinateSystem) {\n this._coordinateSystem = coordinateSystem;\n this.exchangeCoordinateSystem(this._coordinateSystem);\n }\n \n /**\n * Returns the object of the thermodynamic diagram plot area.\n * \n * @returns {module:meteoJS/thermodynamicDiagram/tdDiagram.TDDiagram} Diagram object.\n * @deprecated\n */\n getDiagramPlotArea() {\n return this.diagram;\n }\n}\nexport default ThermodynamicDiagram;\n\n/**\n * Returns normalized PlotArea options.\n * \n * @private\n */\nfunction normalizePlotAreaOptions({\n svgNode = undefined,\n coordinateSystem = undefined,\n x = undefined,\n y = undefined,\n width = undefined,\n height = undefined,\n style = {},\n visible = true,\n events = {},\n hoverLabels = {},\n ...result\n}) {\n result.svgNode = svgNode;\n result.coordinateSystem = coordinateSystem;\n result.x = x;\n result.y = y;\n result.width = width;\n result.height = height;\n result.style = style;\n result.visible = visible;\n result.events = events;\n result.hoverLabels = hoverLabels;\n return result;\n}","/**\n * @module meteoJS/modelviewer/display/simple\n */\nimport $ from 'jquery';\nimport ThermodynamicDiagram from '../../ThermodynamicDiagram.js';\nimport Display from '../Display.js';\n\n/**\n * @classdesc Displays a modelviewer container with a navigation on top of the\n * resource. The navigation contains of several select-Nodes (each for a\n * VariableCollection).\n */\nexport class Simple extends Display {\n \n constructor() {\n super();\n \n /**\n * @type undefined|jQuery\n * @private\n */\n this.imgNode = undefined;\n \n /**\n * @type undefined|meteoJS/thermodynamicDiagram.ThermodynamicDiagram\n * @private\n */\n this.thermodynamicDiagram = undefined;\n \n /**\n * @type undefined|jQuery\n * @protected\n */\n this.resourceNode = undefined;\n }\n \n /**\n * @override\n */\n onInit() {\n if (this.parentNode !== undefined) {\n this.resourceNode = $(this.parentNode);\n this.resourceNode.empty();\n }\n }\n \n /**\n * @override\n */\n onChangeVisibleResource() {\n if (this.resourceNode === undefined)\n return;\n let visibleResource = this.container.visibleResource;\n if ('url' in visibleResource) {\n if (this.thermodynamicDiagram !== undefined) {\n this.thermodynamicDiagram = undefined;\n this.resourceNode.empty();\n }\n if (this.imgNode === undefined) {\n this.resourceNode.empty();\n this.imgNode = $('<img>');\n this.resourceNode.append(this.imgNode);\n }\n this.imgNode.attr('src', visibleResource.url);\n this.imgNode.css({ 'max-width': '100%' });\n }\n else if ('sounding' in visibleResource) {\n if (this.imgNode !== undefined) {\n this.imgNode = undefined;\n this.resourceNode.empty();\n }\n if (this.thermodynamicDiagram === undefined)\n this.thermodynamicDiagram = new ThermodynamicDiagram({\n renderTo: this.resourceNode\n });\n let isAppended = false;\n this.thermodynamicDiagram.soundings.forEach(sounding => {\n if (sounding.getSounding() === visibleResource.sounding) {\n isAppended = true;\n sounding.visible(true);\n }\n else\n sounding.visible(false);\n });\n if (!isAppended)\n this.thermodynamicDiagram.addSounding(visibleResource.sounding);\n }\n else {\n this.imgNode = undefined;\n this.resourceNode.empty();\n }\n }\n}\nexport default Simple;","/**\n * @module meteoJS\n */\n\n/**\n * jQuery object.\n * \n * @external jQuery\n * @see {@link https://api.jquery.com|API Doc}\n */\n\n/**\n * Any HTML element.\n * \n * @external HTMLElement\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement}\n */\n\n/**\n * Any event.\n * \n * @external Event\n * @see {@link https://developer.mozilla.org/de/docs/Web/API/Event}\n */\n\n/**\n * XMLHttpRequest object.\n * \n * @external XMLHttpRequest\n * @see {@link https://developer.mozilla.org/de/docs/Web/API/XMLHttpRequest}\n */\n\n/**\n * SVG object.\n * \n * @external SVG\n * @see {@link https://svgjs.com/docs/3.0/|API Doc}\n */\n\nimport 'regenerator-runtime/runtime.js';\n\nimport * as calc from './calc.js';\nexport { calc };\n\nimport { default as addEventFunctions } from './Events.js';\nexport const events = {\n addEventFunctions\n};\n\nexport { default as RepetitiveRequests } from './RepetitiveRequests.js';\n\nexport { default as Timeline } from './Timeline.js';\nimport { default as Animation,\n insertFrequencyInput,\n insertFrequencyRange,\n insertFrequencyButtonGroup,\n insertRestartPauseInput,\n insertRestartPauseRange,\n insertRestartPauseButtonGroup } from './timeline/Animation.js';\nimport { default as ToggleButton } from './timeline/animation/ToggleButton.js';\nimport {\n default as Visualisation,\n makeTimeTextCallbackFunction\n} from './timeline/Visualisation.js';\nimport { default as Text } from './timeline/visualisation/Text.js';\nimport { default as Slider } from './timeline/visualisation/Slider.js';\nimport { default as bsButtons } from './timeline/visualisation/bsButtons.js';\nimport { default as bsDropdown } from './timeline/visualisation/bsDropdown.js';\nexport const timeline = {\n Animation,\n Visualisation,\n makeTimeTextCallbackFunction,\n animation: {\n ToggleButton,\n insertFrequencyInput,\n insertFrequencyRange,\n insertFrequencyButtonGroup,\n insertRestartPauseInput,\n insertRestartPauseRange,\n insertRestartPauseButtonGroup\n },\n visualisation: {\n Text,\n Slider,\n bsButtons,\n bsDropdown\n }\n};\n\nexport { default as Synview } from './Synview.js';\nimport { default as SynviewCollection } from './synview/Collection.js';\nimport { default as Map } from './synview/SynviewMap.js';\nimport { default as MapOL } from './synview/map/MapOL.js';\nimport { default as MapLL } from './synview/map/MapLL.js';\nimport { default as Resource } from './synview/Resource.js';\nimport { default as GeoJSON } from './synview/resource/GeoJSON.js';\nimport { default as GeoJSONTile } from './synview/resource/GeoJSONTile.js';\nimport { default as Image } from './synview/resource/Image.js';\nimport { default as OSM } from './synview/resource/OSM.js';\nimport { default as Vector } from './synview/resource/Vector.js';\nimport { default as VectorTile } from './synview/resource/VectorTile.js';\nimport { default as ResourceCollection } from './synview/ResourceCollection.js';\nimport { default as Tooltip } from './synview/Tooltip.js';\nimport { default as Type } from './synview/Type.js';\nimport { default as TypeCollection } from './synview/TypeCollection.js';\nexport const synview = {\n Collection: SynviewCollection,\n Map,\n map: {\n MapOL,\n MapLL\n },\n Resource,\n resource: {\n GeoJSON,\n GeoJSONTile,\n Image,\n OSM,\n Vector,\n VectorTile\n },\n ResourceCollection,\n Tooltip,\n Type,\n TypeCollection\n};\n\nexport { Tooltip } from './Tooltip.js';\nimport BootstrapTooltip from './tooltip/BootstrapTooltip.js';\nexport const tooltip = {\n BootstrapTooltip\n};\n\nexport { default as Modelviewer } from './Modelviewer.js';\nimport Variable from './modelviewer/Variable.js';\nimport TimeVariable from './modelviewer/TimeVariable.js';\nimport VariableCollection from './modelviewer/VariableCollection.js';\nimport Node from './modelviewer/Node.js';\nimport ModelviewerResource from './modelviewer/Resource.js';\nimport ModelviewerImage from './modelviewer/resource/Image.js';\nimport ModelviewerSounding from './modelviewer/resource/Sounding.js';\nimport Resources from './modelviewer/Resources.js';\nimport NWPResources from './modelviewer/NWPResources.js';\nimport Container from './modelviewer/Container.js';\nimport Display from './modelviewer/Display.js';\nimport Simple from './modelviewer/display/Simple.js';\nimport SelectNavigation from './modelviewer/display/SelectNavigation.js';\nexport const modelviewer = {\n Variable,\n TimeVariable,\n VariableCollection,\n Node,\n Resource: ModelviewerResource,\n resource: {\n Image: ModelviewerImage,\n Sounding: ModelviewerSounding\n },\n Resources,\n NWPResources,\n Container,\n Display,\n display: {\n Simple,\n SelectNavigation\n }\n};\n\nexport { default as Sounding } from './Sounding.js';\nimport { default as Parcel } from './sounding/Parcel.js';\nexport const sounding = {\n Parcel\n};\n\nexport { default as ThermodynamicDiagramPluggable } from './ThermodynamicDiagramPluggable.js';\nexport { default as ThermodynamicDiagram } from './ThermodynamicDiagram.js';\nimport CoordinateSystem from './thermodynamicDiagram/CoordinateSystem.js';\nimport StueveDiagram from './thermodynamicDiagram/coordinateSystem/StueveDiagram.js';\nimport Emagram from './thermodynamicDiagram/coordinateSystem/Emagram.js';\nimport SkewTlogPDiagram from './thermodynamicDiagram/coordinateSystem/SkewTlogPDiagram.js';\nimport DiagramSounding from './thermodynamicDiagram/DiagramSounding.js';\nimport Hodograph from './thermodynamicDiagram/Hodograph.js';\nimport TDDiagram from './thermodynamicDiagram/TDDiagram.js';\nimport PlotAltitudeDataArea from './thermodynamicDiagram/PlotAltitudeDataArea.js';\nimport { drawWindbarbInto } from './thermodynamicDiagram/Functions.js';\nimport WindbarbsProfile from './thermodynamicDiagram/WindbarbsProfile.js';\nimport WindspeedProfile from './thermodynamicDiagram/WindspeedProfile.js';\nimport xAxis from './thermodynamicDiagram/axes/xAxis.js';\nimport yAxis from './thermodynamicDiagram/axes/yAxis.js';\nimport WindspeedProfileAxis from './thermodynamicDiagram/axes/WindspeedProfileAxis.js';\nexport const thermodynamicDiagram = {\n CoordinateSystem,\n coordinateSystem: {\n StueveDiagram,\n Emagram,\n SkewTlogPDiagram\n },\n DiagramSounding,\n PlotAltitudeDataArea,\n Hodograph,\n TDDiagram,\n functions: {\n drawWindbarbInto\n },\n WindbarbsProfile,\n WindspeedProfile,\n axes: {\n xAxis,\n yAxis,\n WindspeedProfileAxis\n }\n};","/**\n * @module meteoJS/modelviewer/display/selectNavigation\n */\nimport $ from 'jquery';\nimport Simple from './Simple.js';\n\n/**\n * @classdesc \n */\nexport class SelectNavigation extends Simple {\n \n constructor({ ignoreVariableCollections = [],\n selectCaption = false,\n navigationClass = undefined,\n selectDivClass = undefined,\n selectClass = undefined } = {}) {\n super();\n \n this.options = {\n ignoreVariableCollections: new Set(ignoreVariableCollections),\n selectCaption,\n navigationClass,\n selectDivClass,\n selectClass\n };\n \n /**\n * @type undefined|jQuery\n * @private\n */\n this.navigationNode = undefined;\n \n /**\n * @type Map<module:meteoJS/modelviewer/variableCollection.variableCollection,jQuery>\n * @private\n */\n this.selectNodes = new Map();\n }\n \n /**\n * @override\n */\n onInit() {\n if (this.parentNode === undefined)\n return;\n this.navigationNode = $('<div>').addClass(this.options.navigationClass);\n this.resourceNode = $('<div>');\n $(this.parentNode).empty().append(this.navigationNode, this.resourceNode);\n if (this.modelviewer !== undefined)\n this.modelviewer.resources.variableCollections\n .filter(collection => !this.options.ignoreVariableCollections.has(collection) && collection.count > 0)\n .forEach(collection => this._appendSelectNode(collection));\n this._changeSelected();\n }\n \n onChangeVisibleResource({ variable } = {}) {\n super.onChangeVisibleResource({ variable });\n this._changeSelected();\n }\n \n onAppendVariable(variable) {\n if (this.selectNodes.has(variable.variableCollection))\n this._appendOptionNode(this.selectNodes.get(variable.variableCollection), variable);\n else\n this._appendSelectNode(variable.variableCollection);\n this._changeSelected();\n }\n \n _appendSelectNode(variableCollection) {\n let selectNode = $('<select>').addClass(this.options.selectClass);\n selectNode.on('change', () => {\n let variable = variableCollection.getItemById(selectNode.val());\n this.container.exchangeDisplayVariable = [ variable ];\n });\n if (this.options.selectCaption) {\n let captionOption = $('<option>').text(variableCollection.name).attr('disabled', 'disabled').prop('selected', 'selected');\n selectNode.append(captionOption);\n }\n variableCollection.variables.forEach(variable => {\n this._appendOptionNode(selectNode, variable);\n });\n this.navigationNode.append($('<div>').addClass(this.options.selectDivClass).append(selectNode));\n this.selectNodes.set(variableCollection, selectNode);\n }\n \n _appendOptionNode(selectNode, variable) {\n let option =\n $('<option>')\n .attr('value', variable.id)\n .text(variable.name)\n .addClass(this.options.optionsClass);\n selectNode.append(option);\n }\n \n _changeSelected() {\n for (let variableCollection of this.selectNodes.keys()) {\n if (!this.selectNodes.has(variableCollection))\n continue;\n let variable = this.container.visibleResource.getVariableByVariableCollection(variableCollection);\n this.selectNodes.get(variableCollection).val(variable.id);\n }\n }\n}\nexport default SelectNavigation;"],"names":["runtime","exports","undefined","Op","Object","prototype","hasOwn","hasOwnProperty","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","obj","key","value","defineProperty","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","state","GenStateSuspendedStart","method","arg","GenStateExecuting","Error","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","type","done","GenStateSuspendedYield","makeInvokeMethod","fn","call","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","this","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","PromiseImpl","invoke","resolve","reject","result","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","module","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","id","loaded","__webpack_modules__","n","getter","__esModule","d","a","definition","o","get","prop","r","nmd","paths","children","altitudeISAByPres","p","Math","pow","pressureISAByAltitude","potentialTempByTempAndPres","temp","pres","tempByPotentialTempAndPres","potentialTemp","tempByEquiPotTempAndPres","thetae","s","pcon","t","delta","abs","saturationHMRByTempAndPres","exp","dewpointByHMRAndPres","hmr","x","log","wetbulbTempByTempAndDewpointAndPres","dewpoint","Ediff","incr","previoussign","E","equiPotentialTempByTempAndDewpointAndPres","potTemp","lclTemperatureByTempAndDewpoint","saturationPressureByTemp","coef","Array","escold","retval","tt","inx","e","lclByPotentialTempAndHMR","b","hmrp","potentialTempByLCLAndHMR","lcl","Th","lclTh","tempCelsiusToKelvin","tempKelvinToCelsius","windspeedMSToKMH","wind","windspeedKMHToMS","windspeedMSToKN","windspeedKNToMS","windspeedMSToBF","min","windspeedBFToMS","snowlineByTemp850hPaAndAltidude","pressureByBarometricFormula","p0","h","T0","T1","M","densityHumidAirByPressureAndTempAndRelHumidity","T","rh","pv","on","listener","callback","thisArg","listeners","result_key","random","toString","substr","un","once","once_listeners","hasListener","trigger","args","arguments","shift","apply","RepetitiveRequests","url","user","password","start","defaultTimeout","timeoutOnError","pauseOnHiddenDocument","responseType","_url","_user","_password","_isStarted","_defaultTimeout","_timeoutOnError","_pauseOnHiddenDocument","_initPauseOnHiddenDocument","_isSuppressedByHiddenDocument","_responseType","_timeoutID","_loading","_startRequest","clearTimeout","delay","setTimeout","document","hidden","_makeRequest","request","cacheControl","getResponseHeader","maxAges","exec","round","_planRequest","XMLHttpRequest","addEventListener","status","open","send","addEventFunctions","Timeline","maxTimeGap","keyboardNavigation","selectedTime","Date","times","enabledTimes","allEnabledTimes","timesByKey","_keyboardNavigation","_initKeyboardNavigation","time","_setSelectedTime","_indexOfTimeInTimesArray","enabled","_updateTimes","_updateEnabledTimes","getFirstEnabledTime","getLastEnabledTime","getNextEnabledTime","getPrevEnabledTime","getNextAllEnabledTime","getPrevAllEnabledTime","amount","timeKey","getSelectedTime","valueOf","setUTCFullYear","getUTCFullYear","setUTCMonth","getUTCMonth","setUTCDate","getUTCDate","index","reduce","acc","oldTime","timesArr","_sortTimesArray","lastTime","getTime","first","last","prevAllEnabledTime","nextAllEnabledTime","add","sub","event","test","matches","match","_isEventMatchPressedKeys","preventDefault","stopPropagation","findIndex","sort","keyboardEvent","pressedKeys","cur","indexOf","keyCode","jQuery","Animation","timeline","restartPause","imagePeriod","imageFrequency","enabledStepsOnly","allEnabledStepsOnly","options","animationIntervalID","animationTimeoutID","animationStep","timesHash","onChangeTimes","_getTimelineTimesMethod","_getTimelineChangeTimesEvent","isStarted","_updateAnimation","setImagePeriod","Number","_setStep","_clearAnimation","step","_getCount","_initAnimation","_initRestartPause","window","setInterval","setSelectedTime","clearInterval","insertFrequencyInput","node","animation","suffix","number","$","addClass","attr","inputGroupNumber","append","text","setImageFrequency","val","onChangeImageFrequency","getImageFrequency","insertFrequencyRange","frequencies","range","insertRestartPauseInput","input","setRestartPause","onChange","getRestartPause","startedContent","startedClass","stoppedContent","stoppedClass","classButton","classDropdownToggle","menu","menuImageFrequency","imageFrequencyCaption","menuFrequencies","menuRestartPause","restartPauseCaption","biPauseFill","biPlayFill","animationButton","is","onStart","removeClass","empty","String","onStop","click","toggle","btnDropdown","menuDropdown","form","label","div","Visualisation","textInvalid","getTimeText","outputTimezone","inputListener","emptyNode","detachEventListeners","isListenersDefined","attachEventListener","onChangeTime","onInitNode","updateOutput","methodName","format","toISOString","func","listenerArr","off","rest","setNode","timeToText","timesIndexes","getTimelineTimes","that","grouping","groupingFormat","classMain","classButtonGroup","classButtonGroupMargin","classLabel","classLabelSpan","classButtonActive","classButtonNotEnabled","classButtonEnabled","classButtonAllEnabled","toolbarNode","find","each","data","lastNode","btnGroup","span","btn","isTimeAllEnabled","isTimeEnabled","hasClass","buttonFormat","groupingDivider","classDropdownMenu","classDropdownItem","classItemActive","classItemNotEnabled","classItemEnabled","classItemAllEnabled","classDropdownHeader","classDropdownDivider","classDropdownButton","visualisationButtonText","Text","dropdownNode","setOutputTimezone","lastGroupTimeStr","getElementById","button","SynviewMap","map","layerGroup","synviewType","layer","feature","color","Collection","itemIds","items","getIndexById","itemId","item","getId","containsId","getItemById","splice","ol","Group","Vector","Observable","Resource","datetime","mimetype","reloadTime","className","imageSmoothingEnabled","_normalizeOLOptions","reloadTimerId","visible","zIndex","opacity","_imageSmoothing","getUrl","_reload","setVisible","addTo","removeLayer","setZIndex","setOpacity","imageSmoothing","getLayers","remove","getLLLayer","getVisible","addLayer","getOLLayer","setReloadTime","getReloadTime","_makeOLLayer","VectorLayer","makeOLLayer","events","eventName","source","getSource","contextOptions_","msImageSmoothingEnabled","_makeLLLayer","L","Layer","makeLLLayer","reloadFunction","getState","unByKey","getOpacity","getZIndex","bind","style","res","getResourceByTime","resource","_append","_sortTimes","_remove","resources","_filterTimesByResources","getDatetime","tIndex","containsStaticResource","filter","Type","displayMethod","displayMaxResourceAge","displayFadeStart","displayFadeStartOpacity","tooltip","preload","collection","ResourceCollection","displayedResourceTime","_addOLLayer","_preload","_removeOLLayer","newResource","oldResource","_replaceOLLayer","setResources","getResourceCollection","getItems","setLayerGroup","LayerGroup","group","setDisplayTime","_hideVisibleResource","getTimes","time_to_show","_getResourceTimeByDisplayTime","styleArguments","setOLStyle","getLayerGroup","resultTime","resourceTime","exclusiveVisibility","syncVisibility","isVisible","getVisibleTypes","isVisibleType","Tooltip","typeCollection","tooltipFeature","tooltipPixelColor","getOwnPropertyDescriptor","tooltipNode","css","prependTo","getMap","getTargetElement","dragging","getExtendedEventByTypeCollection","join","show","posX","pixel","posY","tooltipContent","getTooltip","content","hide","Synview","TypeCollection","getTypeCollection","updateTimes","isLastTime","isLastEnabledTime","setTimesBySetID","appendType","makeLayerGroup","getTimeline","removeType","deleteSetID","removedType","newId","setId","proj","projwgs84","getView","transform","getCenter","getProjection","center","valid","setCenter","fromLonLat","getZoom","zoom","setZoom","visibleTypes","Map","set","visibleLayers","Set","visibleLayerClassnames","getArray","getClassName","forEachFeatureAtPixel","l","hitTolerance","layerFilter","has","forEachLayerAtPixel","GeoJSON","opt","sourceOptions","projection","VectorSource","setStyle","getStyle","GeoJSONFormat","VectorTile","VectorTileSource","VectorTileLayer","ImageStatic","Image","extent","imageExtent","transformExtent","ImageLayer","Static","imageOverlay","image_","load","OSM","Tile","TileLayer","OSMSource","_isShown","_content","oldContent","onContentChange","fireShowEvent","isShown","fireHideEvent","bootstrap","BootstrapTooltip","bootstrapOptions","closeOnMouseMove","closeOnMouseEnter","_initBootstrapOptions","_tooltipNode","_bsTooltip","_initTooltipNode","left","top","update","_updateNonStringContent","title","dispose","bsTooltip","mousemove","mouseenter","tip","_id","fireReplace","fireAddRemoveOnReplace","appendOnReplace","sortFunction","emptyObjectMaker","_itemIds","_items","_sort","Unique","addItem","removeItem","replaceItem","itemInCollection","realItem","ids","Modelviewer","containersNode","makeContainerNode","firstTimeOnInit","lastTimeOnInit","_resources","_containersNode","jquery","_timeline","_makeContainerNode","listenerKeys","container","modelviewer","containerNode","_getContainerNode","c","parentNode","removeChild","containers","createElement","appendChild","names","langSortation","_name","_names","_langSortation","getDefaultName","lang","getNameByLang","lS","langs","ia","ib","Named","variableCollection","_variableCollection","UniqueNamed","_datetime","Variable","_node","setNameByLang","getNameByLangNoFallback","_children","_parent","parent","variable","aimedNode","getVariableByVariableCollection","child","buildChildrenTreeForResource","ResourcesTreeNode","entries","size","v","variables","findNodeByVariables","Node","_parents","_resourcesTopNode","nodes","_addParent","_makeResourcesTopNode","addedCount","resourcesTreeNode","mapByVariables","removedCount","resourcesSet","exactlyMatch","variablesSet","isAdded","collectResourcesTreeChildren","getChildByVariable","resourcesTreeNodes","getResourcesByVariables","traversedNodes","getTopNode","parents","run","offset","_variables","_run","_offset","_updateDatetime","vars","tmpc","dwpc","ptrace","ttrace","blayer","tlayer","lclpres","lclhght","lfcpres","lfchght","elpres","elhght","mplpres","mplhght","bplus","bminus","bfzl","b3km","b6km","p0c","pm10c","pm20c","pm30c","hght0c","hghtm10c","hghtm20c","hghtm30c","wm10c","wm20c","wm30c","li5","li3","brnshear","brnu","brnv","limax","limaxpres","cap","cappres","bmin","bminpres","calcMissing","parcels","levels","_parcelCollection","Parcel","levelsData","levelData","addLevel","calculateMissingData","hght","u","wdir","wspd","tmpk","dwpk","relh","mixr","theta","wetbulb","vtmp","sin","PI","cos","sqrt","atan2","levelA","levelB","Sounding","sounding","_sounding","SoundingData","Resources","topNode","timesVariableCollections","_topNode","_availableVariablesMap","_timesVariableCollections","pushChildCollections","addedResources","_getTopNodeOfResourceDefinition","_getTopMostChildWithAllVariables","_addAvailableVariablesMapByResource","INTERNAL_CHANGE_RESOURCES","timeoutId","removedResources","removedNodeResourcesMap","_removeAvailableVariablesMapByResources","fullCheckVariables","hasResourcesByVariables","getNodeByVariableCollection","_hasResourcesOfNodeChildren","VariableCollection","isDefinedByVariableOf","childNode","bubbleDown","isVariableContained","_getNodeByVariableCollection","compareFunc","_findChildNodeByVariableCollection","_checkVariableInNode","isDefinedBy","from","traversedNode","exact","collectTimes","collections","models","runs","regions","fields","accumulations","thresholds","TimeVariable","getNodeByVariableCollectionId","Display","alwaysAvailableCollections","_alwaysAvailableCollections","_modelviewer","_container","_parentNode","_resourceNode","_resourceOutput","image","thermodynamicDiagram","variableCollections","_onChangeVisibleResource","onInit","resourceNode","onChangeVisibleResource","_getParentsVariables","getAvailableVariables","selectedVariables","parentResult","visibleResource","isAppended","soundings","getSounding","addSounding","Container","totalAddedVariables","totalRemovedVariables","display","adaptSuitableResource","_display","_containerNode","_adaptSuitableResource","_initAdaptSuitableResource","_visibleResource","_displayVariables","_selectedVariables","_selectedNode","_enabledResources","_debouncedChangeSelectedVariables","addedVariables","removedVariables","clear","_listeners","mirror","listenerKey","_setVisibleResource","_setTimes","_setEnabledResources","_updateSelectedVariables","displayVariables","displayVariable","mirrorConfig","onChangeDisplayVariables","newDisplayVariables","exchangeDisplayVariable","mC","newVariableCollection","isContained","mirrorsFrom","_getSelectedVariablesWithResources","contained","selectedVariable","contains","availableTimes","getTimesByVariables","selectedNode","findFirstNodeWithVariable","_setSelectedVariables","sV","lSV","isFound","tempSV","getSelectedVariable","lastSelectedVariable","isResourceSelected","checkPossibleVariable","possibleSelectedVariable","tempSelectedVariables","resultSelectedVariables","resultLastSelectedVariable","isOnlyTimesVariables","availableSelectedVariables","availableVariablesMap","possibleSelectedVariables","getPossibleVariables","setEnabledTimesBySetID","oldVisibleResource","availableSV","lastAddedVariable","SVG","getNormalizedLineStyleOptions","width","defaults","getFirstDefinedValue","getNormalizedFontOptions","anchor","getNormalizedLineOptions","getNormalizedTextOptions","font","updateLineOptions","updateOptions","styleKey","params","drawTextInto","y","horizontalMargin","verticalMargin","fill","background","rect","f","fontColor","textNode","dy","bbox","height","dx","drawWindbarbInto","strokeStyle","fillTriangle","triangleRatio","barbDistanceRatio","barbHeightRatio","circleOnLowWindspeed","circleRadiusRatio","windspeed","windbarbGroup","barbGroup","triangleWidth","barbDistance","windbarbHeight","yPosition","windspeedResidual","circle","cx","cy","stroke","line","polyline","barbsWidth","scale","rotate","DiagramParcel","parcel","dewp","_parcel","_options","linecap","oldVisible","willTrigger","DiagramSounding","diagram","windprofile","hodograph","_diagramParcelCollection","_visible","getNormalizedDiagramOptions","getNormalizedWindprofileOptions","getNormalizedHodographOptions","getNormalizedParcelsOptions","parcelCollection","addParcel","diagramParcel","getParcelOptions","dp","updateDiagramOptions","updateWindprofileOptions","updateHodographOptions","updateParcelsOptions","diagramParcelCollection","updateOptionsPart","windbarbs","minPressure","maxPressure","segments","segment","lineKeys","ThermodynamicDiagramPluggable","renderTo","_svgNode","boundingRect","getBoundingClientRect","computedStyle","getComputedStyle","parseFloat","getPropertyValue","_plotAreas","plotArea","svgNode","dispatchEvent","target","_hoverLabelsGroup","removeSounding","onCoordinateSystemChange","coordinateSystem","formerCoordinateSystem","diagramSounding","CoordinateSystem","pressure","temperature","_width","_height","temperatureBottomLeft","temperatureBottomRight","inclinationTan","_initPressureOptions","_initTemperatureOptions","oldWidth","oldHeight","inclinationAngle","max","x0","getTByXY","getYByXP","getXByYT","getPByXY","getTByXP","getXByPT","getXByPPotentialTemperatur","getYByXPotentialTemperature","getYByPT","thetaEY","getYByXT","reference","_normalizeTemperatureRange","tan","yReference","xTmin","deltaT","k","PlotArea","_getNormalizedStyle","_svgNodeBackground","_coordinateSystem","_coordinateSystemListenerKey","_initEvents","drawBackground","_drawBackground","overflow","dblclick","mousedown","mouseup","mouseover","mouseout","touchstart","touchmove","touchleave","touchend","touchcancel","eventKey","customEvent","getExtendedEvent","point","pageX","pageXOffset","pageY","pageYOffset","elementX","elementY","PlotDataArea","hoverLabels","getSoundingVisibility","dataGroupIds","getCoordinatesByLevelData","insertDataGroupInto","filterDataPoint","minDataPointsDistance","_getSoundingVisibility","_dataGroupIds","_getCoordinatesByLevelData","_insertDataGroupInto","_filterDataPoint","_minDataPointsDistance","_svgNodeData","_soundings","_getHoverSounding","_initHoverLabels","oldValue","drawSoundings","listenerKeyVisible","onChangeSoundingVisibility","listenerKeyOptions","drawSounding","setDisplayOfSounding","soundingGroup","filterDataPointFunction","_getFilterDataPointFunction","lastLevel","getLevels","getData","dataGroupId","level","lastPoint","maxDistance","insertLabelsFunc","getLevelData","getHoverSounding","hoverLabelsSounding","PlotAltitudeDataArea","_isHoverLabelsRemote","diagramPres","remote","getNearestLevel","TDDiagram","unit","isobars","isotherms","dryadiabats","pseudoadiabats","mixingratio","getNormalizedDiagramLineOptions","highlightedLines","dasharray","svgGroups","border","_parcelsOptions","_parcels","soundingParcelsItems","parcelsGroup","parcelsGroups","addItemListenerKey","removeItemListenerKey","changeVisibleListeners","changeOptionsListeners","onAddParcel","drawParcel","listenerObj","init","plotIsobars","plotIsotherms","plotDryadiabats","plotPseudoadiabats","plotMixingratio","parcelsObj","drawParcels","pottmpk","lcltmpk","lclthetaek","tempGroup","dewpGroup","yInterval","y0","getXByYPotentialTemperature","y1","getYByPPotentialTemperatur","x1","tempPolyline","isDryAdiabatStraightLine","y2","x2","getXByYEquiPotTemp","x0dwp","getXByYHMR","x1dwp","dewpPolyline","redraw","_plotLines","interval","isIsothermsVertical","TKelvin","points","lines","thetaeKelvin","getYByPEquiPotTemp","getYByPHMR","valuesOptions","pointsFunc","ceil","end","floor","highlightLineWidth","vHighlight","diagramTmpk","align","radius","radiusPlus","_makeInsertLabelsFunc","hghtStr","drawPressureHoverLabelInto","labelOptions","lineWidth","fillOptions","WindbarbsProfile","windbarbLength","windbarbData","_windbarbLength","WindspeedProfile","windspeedMax","grid","_windspeedMax","_gridOptions","getNormalizedGridOptions","oldWindspeedMax","isobarsNode","isotachs","isotachsNode","decimalPlaces","prefix","dotRadius","labelFont","toFixed","isobarsInterval","getNormalizedIsolineOptions","Hodograph","pixelPerSpeed","basePolylines","segmentPolylines","def","basePolyline","lowSplit","highSplit","indexLow","indexHigh","newBaseLine","segmentPolyline","origin","_origin","oldOrigin","minExtentLength","axes","circles","labels","xText","angle","yText","plain","backdrop","before","move","smallestDistanceSquare","nearestLevelData","distanceSquare","winddir","defaultStyle","yDelta","textGroups","texts","g","maxBBox","el","Axis","isHorizontal","_labelsOptions","getNormalizedLabelsOptions","_titleOptions","_isHorizontal","getTextByInterval","getPositionByInterval","svgLabelsNode","rotation","margin","cxText","cyText","svgLabelsGroup","drawLabels","_drawTitle","xAxis","yAxis","WindspeedProfileAxis","ThermodynamicDiagram","windbarbsProfile","windspeedProfile","windspeedProfileAxis","normalizePlotAreaOptions","defaultPadding","appendPlotArea","yAxisClass","xAxisClass","WindspeedProfileAxisClass","StueveDiagram","Emagram","SkewTlogPDiagram","exchangeCoordinateSystem","Simple","imgNode","makeTimeTextCallbackFunction","moment","m","utc","local","tz","ToggleButton","insertFrequencyButtonGroup","btnGroupClass","btnClass","freq","insertRestartPauseRange","pauses","insertRestartPauseButtonGroup","pause","visualisation","Slider","bsButtons","bsDropdown","synview","SynviewCollection","MapOL","MapLL","GeoJSONTile","ModelviewerResource","ModelviewerImage","ModelviewerSounding","NWPResources","SelectNavigation","ignoreVariableCollections","selectCaption","navigationClass","selectDivClass","selectClass","navigationNode","selectNodes","count","_appendSelectNode","_changeSelected","_appendOptionNode","selectNode","captionOption","option","optionsClass","functions"],"sourceRoot":""}