From d4cae5b85afb43e6ffc2bad1f5a7b8df7207a064 Mon Sep 17 00:00:00 2001 From: "Katrina H. Turner" <46706381+KatrinaTurner@users.noreply.github.com> Date: Wed, 29 Sep 2021 21:53:39 -1000 Subject: [PATCH 1/3] use themes for font size and color --- README.md | 1 - package.json | 2 +- src/SankeyPanel.tsx | 8 ++++---- src/components/Node.tsx | 6 +++++- src/components/Sankey.tsx | 5 +++++ src/module.ts | 34 ++++++++++++++++------------------ 6 files changed, 31 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 1fcc6c5..312846d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ The panel will draw links from the first column of data points, to the last in o ## Customizing - **Links:** There are currently two options for link color: multi or single. It is multi-colored by default. To choose a single color for the links, toggle the "Single Link color only" option and choose your color from Grafana's color picker. -- **Text:** You can change the color of the label text by changing the "Text color" option - **Nodes:** You can change the color of the rectangular nodes by changing the "Node color" option - **Node Width** The width of the nodes can be adjusted with the "Node Width" slider or entering a number in the input box. This number must be an integer. - **Node Padding** The vertical padding between nodes can be adjusted with the "Node Padding" slider or entering a number in the input box. This number must be an integer. If your links are too skinny, try adjusting this number diff --git a/package.json b/package.json index 7d5f6a5..a54682f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "netsage-sankey-panel", - "version": "1.0.3", + "version": "1.0.4", "description": "Sankey Panel Plugin for Grafana", "license": "Apache-2.0", "repository": "https://github.com/netsage-project/netsage-sankey-panel", diff --git a/src/SankeyPanel.tsx b/src/SankeyPanel.tsx index 374c5b2..64bcf80 100644 --- a/src/SankeyPanel.tsx +++ b/src/SankeyPanel.tsx @@ -1,11 +1,9 @@ import React from 'react'; -// import React, { useRef } from 'react'; import { PanelProps } from '@grafana/data'; import { SankeyOptions } from 'types'; import { parseData } from 'dataParser'; import { Sankey } from './components/Sankey'; -// import * as d3 from 'd3'; -// import * as d3Sankey from 'd3-sankey'; +import { useTheme2 } from '@grafana/ui'; interface Props extends PanelProps {} /** @@ -18,6 +16,7 @@ export const SankeyPanel: React.FC = ({ options, data, width, height, id let graphOptions = { ...options, }; + const theme = useTheme2(); /** * Feed data and options into data parser. * @param {*} { data, options } @@ -34,7 +33,8 @@ export const SankeyPanel: React.FC = ({ options, data, width, height, id const rowDisplayNames = parsedData[2]; const field = parsedData[3]; const fixColor = parsedData[4]; - const textColor = fixColor(graphOptions.textColor); + // const textColor = fixColor(graphOptions.textColor); + const textColor = theme.colors.text.primary; const nodeColor = fixColor(graphOptions.nodeColor); return ( diff --git a/src/components/Node.tsx b/src/components/Node.tsx index 5cb6ff1..460b156 100644 --- a/src/components/Node.tsx +++ b/src/components/Node.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { useTheme2 } from '@grafana/ui'; interface NodeProps { data: any; @@ -16,6 +17,8 @@ interface NodeProps { * @return {*} the node and its label */ export const Node: React.FC = ({ data, textColor, nodeColor, panelId }) => { + const theme = useTheme2(); + let x0 = data.x0; let x1 = data.x1; let y0 = data.y0; @@ -26,6 +29,7 @@ export const Node: React.FC = ({ data, textColor, nodeColor, panelId const width = x1 - x0; const strokeColor = 'black'; + const fontSize = theme.typography.fontSize; return ( <> @@ -49,7 +53,7 @@ export const Node: React.FC = ({ data, textColor, nodeColor, panelId style={{ fill: textColor, alignmentBaseline: 'middle', - fontSize: 16, + fontSize: fontSize, textAnchor: x0 < width / 2 ? 'start' : 'end', pointerEvents: 'none', userSelect: 'none', diff --git a/src/components/Sankey.tsx b/src/components/Sankey.tsx index e16393c..1f64828 100644 --- a/src/components/Sankey.tsx +++ b/src/components/Sankey.tsx @@ -4,6 +4,9 @@ import { Node } from './Node'; import * as d3Sankey from 'd3-sankey'; import { Tooltip } from './Tooltip'; import { Headers } from './Headers'; +// import { GrafanaTheme2 } from '@grafana/data'; +// import { useTheme2 } from '@grafana/ui'; +// import { css } from '@emotion/css'; // import '../css/styles.css'; @@ -39,6 +42,8 @@ export const Sankey: React.FC = ({ nodePadding, iteration, }) => { + // const theme = useTheme2(); + const MARGIN = { top: 75, bottom: 50, right: 20, left: 20 }; const graphWidth = width - MARGIN.left - MARGIN.right; const graphHeight = height - MARGIN.top - MARGIN.bottom; diff --git a/src/module.ts b/src/module.ts index 0784ad8..11adcd5 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,25 +1,14 @@ import { PanelPlugin, FieldConfigProperty } from '@grafana/data'; -import { standardOptionsCompat } from 'grafana-plugin-support'; +// import { standardOptionsCompat } from 'grafana-plugin-support'; import { SankeyOptions } from './types'; import { SankeyPanel } from './SankeyPanel'; -// import { standardOptionsCompat } from 'grafana-plugin-support'; - /** * Grafana panel plugin main module * * @param {*} { panel: React.ComponentType> | null } * @return {*} { builder: PanelOptionsEditorBuilder } */ -const buildStandardOptions = (): any => { - const options = [ - FieldConfigProperty.Decimals, - FieldConfigProperty.Unit, - // FieldConfigProperty.Color, - ]; - - return standardOptionsCompat(options); -}; const monochromeBool = (monochrome: boolean) => (config: SankeyOptions) => config.monochrome === monochrome; @@ -37,11 +26,6 @@ export const plugin = new PanelPlugin(SankeyPanel) showIf: monochromeBool(true), defaultValue: 'blue', }) - .addColorPicker({ - path: 'textColor', - name: 'Text color', - defaultValue: 'black', - }) .addColorPicker({ path: 'nodeColor', name: 'Node color', @@ -79,5 +63,19 @@ export const plugin = new PanelPlugin(SankeyPanel) }); }) .useFieldConfig({ - standardOptions: buildStandardOptions(), + disableStandardOptions: [ + FieldConfigProperty.NoValue, + FieldConfigProperty.Max, + FieldConfigProperty.Min, + FieldConfigProperty.DisplayName, + ], + standardOptions: { + [FieldConfigProperty.Color]: { + settings: { + byValueSupport: true, + bySeriesSupport: true, + preferThresholdsMode: true, + }, + }, + }, }); From bc94a4240e7b5e587b3cd0491a7128a2a91c4072 Mon Sep 17 00:00:00 2001 From: "Katrina H. Turner" <46706381+KatrinaTurner@users.noreply.github.com> Date: Thu, 30 Sep 2021 06:51:15 -1000 Subject: [PATCH 2/3] fix unit display for value mappings --- src/components/Tooltip.tsx | 7 ++++++- src/dataParser.ts | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/Tooltip.tsx b/src/components/Tooltip.tsx index dc2c4f8..2226308 100644 --- a/src/components/Tooltip.tsx +++ b/src/components/Tooltip.tsx @@ -80,7 +80,12 @@ export const Tooltip: React.FC = ({ rowNames, field }) => { .html(() => { var textVal = field.display(d3.select(this).attr('d')); var name = d3.select(this).attr('name'); - var text = `${name}: ${textVal.text} ${textVal.suffix}`; + var text; + if (textVal.suffix) { + text = `${name}: ${textVal.text} ${textVal.suffix}`; + } else { + text = `${name}: ${textVal.text}`; + } return text; }) .style('padding', '10px 15px') diff --git a/src/dataParser.ts b/src/dataParser.ts index d4a97d7..ae3d0c8 100644 --- a/src/dataParser.ts +++ b/src/dataParser.ts @@ -185,7 +185,13 @@ export function parseData(data: { series: any[] }, options: { valueFieldName: an let rowDisplay = `${pluginDataNodes[currentLink[0]].name}`; for (let i = 0; i < currentLink.length - 1; i++) { var fieldValues = valueField[0].display(row[numFields]); - var displayValue = `${fieldValues.text} ${fieldValues.suffix}`; + var displayValue; + if (fieldValues.suffix) { + displayValue = `${fieldValues.text} ${fieldValues.suffix}`; + } else { + displayValue = `${fieldValues.text}`; + } + pluginDataLinks.push({ source: currentLink[i], target: currentLink[i + 1], From cd0521d3d931cb7e60023b4d9bc9016350a4813c Mon Sep 17 00:00:00 2001 From: "Katrina H. Turner" <46706381+KatrinaTurner@users.noreply.github.com> Date: Thu, 30 Sep 2021 06:52:32 -1000 Subject: [PATCH 3/3] 1.0.4 updates --- netsage-sankey-panel/MANIFEST.txt | 23 +++++++++++----------- netsage-sankey-panel/README.md | 1 - netsage-sankey-panel/module.js | 3 ++- netsage-sankey-panel/module.js.LICENSE.txt | 14 +++++++++++++ netsage-sankey-panel/module.js.map | 2 +- netsage-sankey-panel/plugin.json | 4 ++-- 6 files changed, 31 insertions(+), 16 deletions(-) create mode 100644 netsage-sankey-panel/module.js.LICENSE.txt diff --git a/netsage-sankey-panel/MANIFEST.txt b/netsage-sankey-panel/MANIFEST.txt index 2dd9d23..37f9063 100644 --- a/netsage-sankey-panel/MANIFEST.txt +++ b/netsage-sankey-panel/MANIFEST.txt @@ -8,28 +8,29 @@ Hash: SHA512 "signedByOrg": "netsage", "signedByOrgName": "netsage", "plugin": "netsage-sankey-panel", - "version": "1.0.3", - "time": 1632508460398, + "version": "1.0.4", + "time": 1633020708865, "keyId": "7e4d0c6a708866e7", "files": { "LICENSE": "b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1", "CHANGELOG.md": "aaa78be4710ef41d56ddab1edbd180ef9f9adfea2f293109aae925dc33a1b9b3", - "module.js.map": "cf4245bbc6c423eecc8e462701ddfe51f195a78793c8db4eed4f12105d93e071", - "plugin.json": "c20397edf44b45624d0c9c6a64707133d463962e5977f0b236556b430a78e360", - "README.md": "c5b30b84e983ea9e852bf89379c95532760406bbfadd0174e1fcaac4fc87081d", + "module.js.LICENSE.txt": "0d8f66cd4afb566cb5b7e1540c68f43b939d3eba12ace290f18abc4f4cb53ed0", + "module.js.map": "92db609eccf14830dffb590e4806582b5627c3366698e44ef373ec72ccdecc19", + "plugin.json": "4843f8978b95ca4e7155eb35da16a15111a22388bfbba4d7915582e7899f684e", + "README.md": "496f8ee30c7497dca3ea9b0388b346e9e62569501d05ba83c7d73392c6da0327", "img/sankey2.png": "99651eceae6c3e99f6b0317f4eec4f7827d3d4c242b4f3a29d166a17f0e71cf8", "img/sankey3.png": "9ec6c9fd8df713ce384b96e13f300f123672b293034a448c99ac1f739c54e117", "img/logo.svg": "e1b79c50e08be2be3382fa42850209dc3a7496d56e60a45c4d8a1375a685e633", - "module.js": "3951f47b8407b056356a3bd1597a6b0e8d8c5327d8fa1b7353c61083e3ce7ac1" + "module.js": "1e7abcda57ec1d11b33c63618742a8e1f4af0720d89d1faffd2ed459e37ff815" } } -----BEGIN PGP SIGNATURE----- Version: OpenPGP.js v4.10.1 Comment: https://openpgpjs.org -wqEEARMKAAYFAmFOGiwACgkQfk0ManCIZueAhgIIjtlOtZ/4qTe7cgKPAqeq -Hasi/vflFVf6hHvd4qz8P5N+50SfwGlvEOokMcQ1geoD/6/E1cHq2tmM5Ice -MN/7GAkCCQEiNhw+BBNccYQQpVUBbMXpz1Ox3fg9w7Ln0FBN+NpUi0tXM4jd -q4yqkEaWBF2sqQsjwzI8qmdN/rCdtOOl2ZhcRw== -=RYdi +wqIEARMKAAYFAmFV6yUACgkQfk0ManCIZucd7AIJAb2IQfFfSVKcMfGS1OfW +wGZEad7qpJTrdYK0kYkuKN9KVFaw6GKmb0Kq9JGQMQvJpgOkikNm7EcbbQzc +XNG9OYHmAgkBYseZaPkAOUZS4bdCSiIS6i/h7X3RBLpVkRGdn3WKQQ9ojzon +eeQ7JpUWWolI+G1FMNFgt5cOTM5H7Oo8ydI0B/Y= +=5Co+ -----END PGP SIGNATURE----- diff --git a/netsage-sankey-panel/README.md b/netsage-sankey-panel/README.md index 1fcc6c5..312846d 100644 --- a/netsage-sankey-panel/README.md +++ b/netsage-sankey-panel/README.md @@ -15,7 +15,6 @@ The panel will draw links from the first column of data points, to the last in o ## Customizing - **Links:** There are currently two options for link color: multi or single. It is multi-colored by default. To choose a single color for the links, toggle the "Single Link color only" option and choose your color from Grafana's color picker. -- **Text:** You can change the color of the label text by changing the "Text color" option - **Nodes:** You can change the color of the rectangular nodes by changing the "Node color" option - **Node Width** The width of the nodes can be adjusted with the "Node Width" slider or entering a number in the input box. This number must be an integer. - **Node Padding** The vertical padding between nodes can be adjusted with the "Node Padding" slider or entering a number in the input box. This number must be an integer. If your links are too skinny, try adjusting this number diff --git a/netsage-sankey-panel/module.js b/netsage-sankey-panel/module.js index 7394899..c1e8902 100644 --- a/netsage-sankey-panel/module.js +++ b/netsage-sankey-panel/module.js @@ -1,2 +1,3 @@ -define(["react","d3","@grafana/data","@grafana/ui","@grafana/runtime","emotion"],(function(e,t,r,n,o,i){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r(r.s=9)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports=r},function(e,t){e.exports=n},function(e,t,r){(function(r){var n;t=e.exports=h,n="object"==typeof r&&r.env&&r.env.NODE_DEBUG&&/\bsemver\b/i.test(r.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER")}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var o=Number.MAX_SAFE_INTEGER||9007199254740991,i=t.re=[],s=t.src=[],a=t.tokens={},u=0;function l(e){a[e]=u++}l("NUMERICIDENTIFIER"),s[a.NUMERICIDENTIFIER]="0|[1-9]\\d*",l("NUMERICIDENTIFIERLOOSE"),s[a.NUMERICIDENTIFIERLOOSE]="[0-9]+",l("NONNUMERICIDENTIFIER"),s[a.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*",l("MAINVERSION"),s[a.MAINVERSION]="("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")\\.("+s[a.NUMERICIDENTIFIER]+")",l("MAINVERSIONLOOSE"),s[a.MAINVERSIONLOOSE]="("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")\\.("+s[a.NUMERICIDENTIFIERLOOSE]+")",l("PRERELEASEIDENTIFIER"),s[a.PRERELEASEIDENTIFIER]="(?:"+s[a.NUMERICIDENTIFIER]+"|"+s[a.NONNUMERICIDENTIFIER]+")",l("PRERELEASEIDENTIFIERLOOSE"),s[a.PRERELEASEIDENTIFIERLOOSE]="(?:"+s[a.NUMERICIDENTIFIERLOOSE]+"|"+s[a.NONNUMERICIDENTIFIER]+")",l("PRERELEASE"),s[a.PRERELEASE]="(?:-("+s[a.PRERELEASEIDENTIFIER]+"(?:\\."+s[a.PRERELEASEIDENTIFIER]+")*))",l("PRERELEASELOOSE"),s[a.PRERELEASELOOSE]="(?:-?("+s[a.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+s[a.PRERELEASEIDENTIFIERLOOSE]+")*))",l("BUILDIDENTIFIER"),s[a.BUILDIDENTIFIER]="[0-9A-Za-z-]+",l("BUILD"),s[a.BUILD]="(?:\\+("+s[a.BUILDIDENTIFIER]+"(?:\\."+s[a.BUILDIDENTIFIER]+")*))",l("FULL"),l("FULLPLAIN"),s[a.FULLPLAIN]="v?"+s[a.MAINVERSION]+s[a.PRERELEASE]+"?"+s[a.BUILD]+"?",s[a.FULL]="^"+s[a.FULLPLAIN]+"$",l("LOOSEPLAIN"),s[a.LOOSEPLAIN]="[v=\\s]*"+s[a.MAINVERSIONLOOSE]+s[a.PRERELEASELOOSE]+"?"+s[a.BUILD]+"?",l("LOOSE"),s[a.LOOSE]="^"+s[a.LOOSEPLAIN]+"$",l("GTLT"),s[a.GTLT]="((?:<|>)?=?)",l("XRANGEIDENTIFIERLOOSE"),s[a.XRANGEIDENTIFIERLOOSE]=s[a.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",l("XRANGEIDENTIFIER"),s[a.XRANGEIDENTIFIER]=s[a.NUMERICIDENTIFIER]+"|x|X|\\*",l("XRANGEPLAIN"),s[a.XRANGEPLAIN]="[v=\\s]*("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:\\.("+s[a.XRANGEIDENTIFIER]+")(?:"+s[a.PRERELEASE]+")?"+s[a.BUILD]+"?)?)?",l("XRANGEPLAINLOOSE"),s[a.XRANGEPLAINLOOSE]="[v=\\s]*("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+s[a.XRANGEIDENTIFIERLOOSE]+")(?:"+s[a.PRERELEASELOOSE]+")?"+s[a.BUILD]+"?)?)?",l("XRANGE"),s[a.XRANGE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAIN]+"$",l("XRANGELOOSE"),s[a.XRANGELOOSE]="^"+s[a.GTLT]+"\\s*"+s[a.XRANGEPLAINLOOSE]+"$",l("COERCE"),s[a.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",l("COERCERTL"),i[a.COERCERTL]=new RegExp(s[a.COERCE],"g"),l("LONETILDE"),s[a.LONETILDE]="(?:~>?)",l("TILDETRIM"),s[a.TILDETRIM]="(\\s*)"+s[a.LONETILDE]+"\\s+",i[a.TILDETRIM]=new RegExp(s[a.TILDETRIM],"g");l("TILDE"),s[a.TILDE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAIN]+"$",l("TILDELOOSE"),s[a.TILDELOOSE]="^"+s[a.LONETILDE]+s[a.XRANGEPLAINLOOSE]+"$",l("LONECARET"),s[a.LONECARET]="(?:\\^)",l("CARETTRIM"),s[a.CARETTRIM]="(\\s*)"+s[a.LONECARET]+"\\s+",i[a.CARETTRIM]=new RegExp(s[a.CARETTRIM],"g");l("CARET"),s[a.CARET]="^"+s[a.LONECARET]+s[a.XRANGEPLAIN]+"$",l("CARETLOOSE"),s[a.CARETLOOSE]="^"+s[a.LONECARET]+s[a.XRANGEPLAINLOOSE]+"$",l("COMPARATORLOOSE"),s[a.COMPARATORLOOSE]="^"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+")$|^$",l("COMPARATOR"),s[a.COMPARATOR]="^"+s[a.GTLT]+"\\s*("+s[a.FULLPLAIN]+")$|^$",l("COMPARATORTRIM"),s[a.COMPARATORTRIM]="(\\s*)"+s[a.GTLT]+"\\s*("+s[a.LOOSEPLAIN]+"|"+s[a.XRANGEPLAIN]+")",i[a.COMPARATORTRIM]=new RegExp(s[a.COMPARATORTRIM],"g");l("HYPHENRANGE"),s[a.HYPHENRANGE]="^\\s*("+s[a.XRANGEPLAIN]+")\\s+-\\s+("+s[a.XRANGEPLAIN]+")\\s*$",l("HYPHENRANGELOOSE"),s[a.HYPHENRANGELOOSE]="^\\s*("+s[a.XRANGEPLAINLOOSE]+")\\s+-\\s+("+s[a.XRANGEPLAINLOOSE]+")\\s*$",l("STAR"),s[a.STAR]="(<|>)?=?\\s*\\*";for(var c=0;c256)return null;if(!(t.loose?i[a.LOOSE]:i[a.FULL]).test(e))return null;try{return new h(e,t)}catch(e){return null}}function h(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof h){if(e.loose===t.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>256)throw new TypeError("version is longer than 256 characters");if(!(this instanceof h))return new h(e,t);n("SemVer",e,t),this.options=t,this.loose=!!t.loose;var r=e.trim().match(t.loose?i[a.LOOSE]:i[a.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);-1===r&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,r,n){"string"==typeof r&&(n=r,r=void 0);try{return new h(e,r).inc(t,n).version}catch(e){return null}},t.diff=function(e,t){if(g(e,t))return null;var r=f(e),n=f(t),o="";if(r.prerelease.length||n.prerelease.length){o="pre";var i="prerelease"}for(var s in r)if(("major"===s||"minor"===s||"patch"===s)&&r[s]!==n[s])return o+s;return i},t.compareIdentifiers=d;var p=/^[0-9]+$/;function d(e,t){var r=p.test(e),n=p.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e0}function v(e,t,r){return E(e,t,r)<0}function g(e,t,r){return 0===E(e,t,r)}function I(e,t,r){return 0!==E(e,t,r)}function y(e,t,r){return E(e,t,r)>=0}function R(e,t,r){return E(e,t,r)<=0}function L(e,t,r,n){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return g(e,r,n);case"!=":return I(e,r,n);case">":return m(e,r,n);case">=":return y(e,r,n);case"<":return v(e,r,n);case"<=":return R(e,r,n);default:throw new TypeError("Invalid operator: "+t)}}function O(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof O){if(e.loose===!!t.loose)return e;e=e.value}if(!(this instanceof O))return new O(e,t);n("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===N?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return d(t,e)},t.major=function(e,t){return new h(e,t).major},t.minor=function(e,t){return new h(e,t).minor},t.patch=function(e,t){return new h(e,t).patch},t.compare=E,t.compareLoose=function(e,t){return E(e,t,!0)},t.compareBuild=function(e,t,r){var n=new h(e,r),o=new h(t,r);return n.compare(o)||n.compareBuild(o)},t.rcompare=function(e,t,r){return E(t,e,r)},t.sort=function(e,r){return e.sort((function(e,n){return t.compareBuild(e,n,r)}))},t.rsort=function(e,r){return e.sort((function(e,n){return t.compareBuild(n,e,r)}))},t.gt=m,t.lt=v,t.eq=g,t.neq=I,t.gte=y,t.lte=R,t.cmp=L,t.Comparator=O;var N={};function w(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof w)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new w(e.raw,t);if(e instanceof O)return new w(e.value,t);if(!(this instanceof w))return new w(e,t);if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function T(e,t){for(var r=!0,n=e.slice(),o=n.pop();r&&n.length;)r=n.every((function(e){return o.intersects(e,t)})),o=n.pop();return r}function A(e){return!e||"x"===e.toLowerCase()||"*"===e}function b(e,t,r,n,o,i,s,a,u,l,c,f,h){return((t=A(r)?"":A(n)?">="+r+".0.0":A(o)?">="+r+"."+n+".0":">="+t)+" "+(a=A(u)?"":A(l)?"<"+(+u+1)+".0.0":A(c)?"<"+u+"."+(+l+1)+".0":f?"<="+u+"."+l+"."+c+"-"+f:"<="+a)).trim()}function x(e,t,r){for(var o=0;o0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function S(e,t,r){try{t=new w(t,r)}catch(e){return!1}return t.test(e)}function k(e,t,r,n){var o,i,s,a,u;switch(e=new h(e,n),t=new w(t,n),r){case">":o=m,i=R,s=v,a=">",u=">=";break;case"<":o=v,i=y,s=m,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(S(e,t,n))return!1;for(var l=0;l=0.0.0")),f=f||e,p=p||e,o(e.semver,f.semver,n)?f=e:s(e.semver,p.semver,n)&&(p=e)})),f.operator===a||f.operator===u)return!1;if((!p.operator||p.operator===a)&&i(e,p.semver))return!1;if(p.operator===u&&s(e,p.semver))return!1}return!0}O.prototype.parse=function(e){var t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new h(r[2],this.options.loose):this.semver=N},O.prototype.toString=function(){return this.value},O.prototype.test=function(e){if(n("Comparator.test",e,this.options.loose),this.semver===N||e===N)return!0;if("string"==typeof e)try{e=new h(e,this.options)}catch(e){return!1}return L(e,this.operator,this.semver,this.options)},O.prototype.intersects=function(e,t){if(!(e instanceof O))throw new TypeError("a Comparator is required");var r;if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||(r=new w(e.value,t),S(this.value,r,t));if(""===e.operator)return""===e.value||(r=new w(this.value,t),S(e.semver,r,t));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=L(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),u=L(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||o||i&&s||a||u},t.Range=w,w.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},w.prototype.toString=function(){return this.range},w.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?i[a.HYPHENRANGELOOSE]:i[a.HYPHENRANGE];e=e.replace(r,b),n("hyphen replace",e),e=e.replace(i[a.COMPARATORTRIM],"$1$2$3"),n("comparator trim",e,i[a.COMPARATORTRIM]),e=(e=(e=e.replace(i[a.TILDETRIM],"$1~")).replace(i[a.CARETTRIM],"$1^")).split(/\s+/).join(" ");var o=t?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],s=e.split(" ").map((function(e){return function(e,t){return n("comp",e,t),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){n("caret",e,t);var r=t.loose?i[a.CARETLOOSE]:i[a.CARET];return e.replace(r,(function(t,r,o,i,s){var a;return n("caret",e,t,r,o,i,s),A(r)?a="":A(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":A(i)?a="0"===r?">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":">="+r+"."+o+".0 <"+(+r+1)+".0.0":s?(n("replaceCaret pr",s),a="0"===r?"0"===o?">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+"-"+s+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===o?">="+r+"."+o+"."+i+" <"+r+"."+o+"."+(+i+1):">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0":">="+r+"."+o+"."+i+" <"+(+r+1)+".0.0"),n("caret return",a),a}))}(e,t)})).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map((function(e){return function(e,t){var r=t.loose?i[a.TILDELOOSE]:i[a.TILDE];return e.replace(r,(function(t,r,o,i,s){var a;return n("tilde",e,t,r,o,i,s),A(r)?a="":A(o)?a=">="+r+".0.0 <"+(+r+1)+".0.0":A(i)?a=">="+r+"."+o+".0 <"+r+"."+(+o+1)+".0":s?(n("replaceTilde pr",s),a=">="+r+"."+o+"."+i+"-"+s+" <"+r+"."+(+o+1)+".0"):a=">="+r+"."+o+"."+i+" <"+r+"."+(+o+1)+".0",n("tilde return",a),a}))}(e,t)})).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return function(e,t){e=e.trim();var r=t.loose?i[a.XRANGELOOSE]:i[a.XRANGE];return e.replace(r,(function(r,o,i,s,a,u){n("xRange",e,r,o,i,s,a,u);var l=A(i),c=l||A(s),f=c||A(a),h=f;return"="===o&&h&&(o=""),u=t.includePrerelease?"-0":"",l?r=">"===o||"<"===o?"<0.0.0-0":"*":o&&h?(c&&(s=0),a=0,">"===o?(o=">=",c?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===o&&(o="<",c?i=+i+1:s=+s+1),r=o+i+"."+s+"."+a+u):c?r=">="+i+".0.0"+u+" <"+(+i+1)+".0.0"+u:f&&(r=">="+i+"."+s+".0"+u+" <"+i+"."+(+s+1)+".0"+u),n("xRange return",r),r}))}(e,t)})).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(i[a.STAR],"")}(e,t),n("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(s=s.filter((function(e){return!!e.match(o)}))),s=s.map((function(e){return new O(e,this.options)}),this)},w.prototype.intersects=function(e,t){if(!(e instanceof w))throw new TypeError("a Range is required");return this.set.some((function(r){return T(r,t)&&e.set.some((function(e){return T(e,t)&&r.every((function(r){return e.every((function(e){return r.intersects(e,t)}))}))}))}))},t.toComparators=function(e,t){return new w(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},w.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new h(e,this.options)}catch(e){return!1}for(var t=0;t":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":r&&!m(r,t)||(r=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(r&&e.test(r))return r;return null},t.validRange=function(e,t){try{return new w(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,r){return k(e,t,"<",r)},t.gtr=function(e,t,r){return k(e,t,">",r)},t.outside=k,t.prerelease=function(e,t){var r=f(e,t);return r&&r.prerelease.length?r.prerelease:null},t.intersects=function(e,t,r){return e=new w(e,r),t=new w(t,r),e.intersects(t)},t.coerce=function(e,t){if(e instanceof h)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var r=null;if((t=t||{}).rtl){for(var n;(n=i[a.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),i[a.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;i[a.COERCERTL].lastIndex=-1}else r=e.match(i[a.COERCE]);if(null===r)return null;return f(r[2]+"."+(r[3]||"0")+"."+(r[4]||"0"),t)}}).call(this,r(8))},function(e,t){e.exports=o},function(e,t){e.exports=i},,function(e,t){var r,n,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(e){r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var u,l=[],c=!1,f=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&p())}function p(){if(!c){var e=a(h);c=!0;for(var t=l.length;t;){for(u=l,l=[];++f1)for(var r=1;r0)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}r(6);var u=r(5),l=r(4),c=function(e){var t=u.config.buildInfo.version;switch(e){case"color-scheme":return Object(l.gte)(t,"7.3.0");case"standard-options-object":return Object(l.gte)(t,"7.4.0");case"custom-editor-context":return Object(l.gte)(t,"7.0.3");case"field-config-with-min-max":return Object(l.gte)(t,"7.4.0");default:return!1}};function f(e,t){let r=0;if(void 0===t)for(let t of e)(t=+t)&&(r+=t);else{let n=-1;for(let o of e)(o=+t(o,++n,e))&&(r+=o)}return r}function h(e,t){let r;if(void 0===t)for(const t of e)null!=t&&(r=t)&&(r=t);else{let n=-1;for(let o of e)null!=(o=t(o,++n,e))&&(r=o)&&(r=o)}return r}function p(e,t){let r;if(void 0===t)for(const t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let n=-1;for(let o of e)null!=(o=t(o,++n,e))&&(r>o||void 0===r&&o>=o)&&(r=o)}return r}function d(e,t){return e.sourceLinks.length?e.depth:t-1}function E(e){return function(){return e}}function m(e,t){return g(e.source,t.source)||e.index-t.index}function v(e,t){return g(e.target,t.target)||e.index-t.index}function g(e,t){return e.y0-t.y0}function I(e){return e.value}function y(e){return e.index}function R(e){return e.nodes}function L(e){return e.links}function O(e,t){const r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function N({nodes:e}){for(const t of e){let e=t.y0,r=e;for(const r of t.sourceLinks)r.y0=e+r.width/2,e+=r.width;for(const e of t.targetLinks)e.y1=r+e.width/2,r+=e.width}}function w(){let e,t,r,n=0,o=0,i=1,s=1,a=24,u=8,l=y,c=d,w=R,T=L,A=6;function b(){const e={nodes:w.apply(null,arguments),links:T.apply(null,arguments)};return x(e),S(e),k(e),C(e),P(e),N(e),e}function x({nodes:e,links:t}){for(const[t,r]of e.entries())r.index=t,r.sourceLinks=[],r.targetLinks=[];const n=new Map(e.map((t,r)=>[l(t,r,e),t]));for(const[e,r]of t.entries()){r.index=e;let{source:t,target:o}=r;"object"!=typeof t&&(t=r.source=O(n,t)),"object"!=typeof o&&(o=r.target=O(n,o)),t.sourceLinks.push(r),o.targetLinks.push(r)}if(null!=r)for(const{sourceLinks:t,targetLinks:n}of e)t.sort(r),n.sort(r)}function S({nodes:e}){for(const t of e)t.value=void 0===t.fixedValue?Math.max(f(t.sourceLinks,I),f(t.targetLinks,I)):t.fixedValue}function k({nodes:e}){const t=e.length;let r=new Set(e),n=new Set,o=0;for(;r.size;){for(const e of r){e.depth=o;for(const{target:t}of e.sourceLinks)n.add(t)}if(++o>t)throw new Error("circular link");r=n,n=new Set}}function C({nodes:e}){const t=e.length;let r=new Set(e),n=new Set,o=0;for(;r.size;){for(const e of r){e.height=o;for(const{source:t}of e.targetLinks)n.add(t)}if(++o>t)throw new Error("circular link");r=n,n=new Set}}function P(r){const l=function({nodes:e}){const r=h(e,e=>e.depth)+1,o=(i-n-a)/(r-1),s=new Array(r);for(const t of e){const e=Math.max(0,Math.min(r-1,Math.floor(c.call(null,t,r))));t.layer=e,t.x0=n+e*o,t.x1=t.x0+a,s[e]?s[e].push(t):s[e]=[t]}if(t)for(const e of s)e.sort(t);return s}(r);e=Math.min(u,(s-o)/(h(l,e=>e.length)-1)),function(t){const r=p(t,t=>(s-o-(t.length-1)*e)/f(t,I));for(const n of t){let t=o;for(const o of n){o.y0=t,o.y1=t+o.value*r,t=o.y1+e;for(const e of o.sourceLinks)e.width=e.value*r}t=(s-t+e)/(n.length+1);for(let e=0;e0))continue;let o=(t/n-e.y0)*r;e.y0+=o,e.y1+=o,G(e)}void 0===t&&i.sort(g),_(i,n)}}function D(e,r,n){for(let o=e.length-2;o>=0;--o){const i=e[o];for(const e of i){let t=0,n=0;for(const{target:r,value:o}of e.sourceLinks){let i=o*(r.layer-e.layer);t+=V(e,r)*i,n+=i}if(!(n>0))continue;let o=(t/n-e.y0)*r;e.y0+=o,e.y1+=o,G(e)}void 0===t&&i.sort(g),_(i,n)}}function _(t,r){const n=t.length>>1,i=t[n];j(t,i.y0-e,n-1,r),F(t,i.y1+e,n+1,r),j(t,s,t.length-1,r),F(t,o,0,r)}function F(t,r,n,o){for(;n1e-6&&(i.y0+=s,i.y1+=s),r=i.y1+e}}function j(t,r,n,o){for(;n>=0;--n){const i=t[n],s=(i.y1-r)*o;s>1e-6&&(i.y0-=s,i.y1-=s),r=i.y0-e}}function G({sourceLinks:e,targetLinks:t}){if(void 0===r){for(const{source:{sourceLinks:e}}of t)e.sort(v);for(const{target:{targetLinks:t}}of e)t.sort(m)}}function U(e){if(void 0===r)for(const{sourceLinks:t,targetLinks:r}of e)t.sort(v),r.sort(m)}function X(t,r){let n=t.y0-(t.sourceLinks.length-1)*e/2;for(const{target:o,width:i}of t.sourceLinks){if(o===r)break;n+=i+e}for(const{source:e,width:o}of r.targetLinks){if(e===t)break;n-=o}return n}function V(t,r){let n=r.y0-(r.targetLinks.length-1)*e/2;for(const{source:o,width:i}of r.targetLinks){if(o===t)break;n+=i+e}for(const{target:e,width:o}of t.sourceLinks){if(e===r)break;n-=o}return n}return b.update=function(e){return N(e),e},b.nodeId=function(e){return arguments.length?(l="function"==typeof e?e:E(e),b):l},b.nodeAlign=function(e){return arguments.length?(c="function"==typeof e?e:E(e),b):c},b.nodeSort=function(e){return arguments.length?(t=e,b):t},b.nodeWidth=function(e){return arguments.length?(a=+e,b):a},b.nodePadding=function(t){return arguments.length?(u=e=+t,b):u},b.nodes=function(e){return arguments.length?(w="function"==typeof e?e:E(e),b):w},b.links=function(e){return arguments.length?(T="function"==typeof e?e:E(e),b):T},b.linkSort=function(e){return arguments.length?(r=e,b):r},b.size=function(e){return arguments.length?(n=o=0,i=+e[0],s=+e[1],b):[i-n,s-o]},b.extent=function(e){return arguments.length?(n=+e[0][0],i=+e[1][0],o=+e[0][1],s=+e[1][1],b):[[n,o],[i,s]]},b.iterations=function(e){return arguments.length?(A=+e,b):A},b}var T=Math.PI,A=2*T,b=A-1e-6;function x(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function S(){return new x}x.prototype=S.prototype={constructor:x,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,o,i){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+o)+","+(this._y1=+i)},arcTo:function(e,t,r,n,o){e=+e,t=+t,r=+r,n=+n,o=+o;var i=this._x1,s=this._y1,a=r-e,u=n-t,l=i-e,c=s-t,f=l*l+c*c;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(f>1e-6)if(Math.abs(c*a-u*l)>1e-6&&o){var h=r-i,p=n-s,d=a*a+u*u,E=h*h+p*p,m=Math.sqrt(d),v=Math.sqrt(f),g=o*Math.tan((T-Math.acos((d+f-E)/(2*m*v)))/2),I=g/v,y=g/m;Math.abs(I-1)>1e-6&&(this._+="L"+(e+I*l)+","+(t+I*c)),this._+="A"+o+","+o+",0,0,"+ +(c*h>l*p)+","+(this._x1=e+y*a)+","+(this._y1=t+y*u)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,r,n,o,i){e=+e,t=+t,i=!!i;var s=(r=+r)*Math.cos(n),a=r*Math.sin(n),u=e+s,l=t+a,c=1^i,f=i?n-o:o-n;if(r<0)throw new Error("negative radius: "+r);null===this._x1?this._+="M"+u+","+l:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+u+","+l),r&&(f<0&&(f=f%A+A),f>b?this._+="A"+r+","+r+",0,1,"+c+","+(e-s)+","+(t-a)+"A"+r+","+r+",0,1,"+c+","+(this._x1=u)+","+(this._y1=l):f>1e-6&&(this._+="A"+r+","+r+",0,"+ +(f>=T)+","+c+","+(this._x1=e+r*Math.cos(o))+","+(this._y1=t+r*Math.sin(o))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}};var k=S,C=Array.prototype.slice,P=function(e){return function(){return e}};function M(e){return e[0]}function D(e){return e[1]}function _(e){return e.source}function F(e){return e.target}function j(e){var t=_,r=F,n=M,o=D,i=null;function s(){var s,a=C.call(arguments),u=t.apply(this,a),l=r.apply(this,a);if(i||(i=s=k()),e(i,+n.apply(this,(a[0]=u,a)),+o.apply(this,a),+n.apply(this,(a[0]=l,a)),+o.apply(this,a)),s)return i=null,s+""||null}return s.source=function(e){return arguments.length?(t=e,s):t},s.target=function(e){return arguments.length?(r=e,s):r},s.x=function(e){return arguments.length?(n="function"==typeof e?e:P(+e),s):n},s.y=function(e){return arguments.length?(o="function"==typeof e?e:P(+e),s):o},s.context=function(e){return arguments.length?(i=null==e?null:e,s):i},s}function G(e,t,r,n,o){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,o,n,o)}function U(e){return[e.source.x1,e.y0]}function X(e){return[e.target.x0,e.y1]}var V=function(){return j(G).source(U).target(X)},B=function(e){var t=e.data,r=e.panelId,n=V(),o=t.color,s=r+"-"+t.id;return i.a.createElement(i.a.Fragment,null,i.a.createElement("path",{d:n(t),fill:"none",stroke:o,strokeOpacity:.8,opacity:.7,strokeWidth:t.width,id:s,display:t.displayValue}))},$=function(e){var t=e.data,r=e.textColor,n=e.nodeColor,o=e.panelId,s=t.x0,a=t.x1,u=t.y0,l=t.y1,c=t.index,f=t.name,h=t.value,p=a-s;return i.a.createElement(i.a.Fragment,null,i.a.createElement("rect",{x:s,y:u,rx:5,ry:5,width:p,height:l-u,stroke:"black",fill:n,"data-index":c,id:o+","+t.id,d:h,name:f}),i.a.createElement("text",{x:s

"+e+""})).style("padding","10px 15px").style("background","black").style("color","white").style("border","#A8A8A8 solid 5px").style("border-radius","5px").style("left",i.mouseX+"px").style("top",i.mouseY+"px").style("opacity",0).style("position","absolute").transition().duration(200).style("opacity",.8)})).on("mouseout",(function(e){var t=z.select(this).attr("id");z.selectAll(".tooltip-"+t).transition().duration(300).remove(),z.selectAll("path").attr("opacity",.7)})),z.selectAll("rect").on("mouseover",(function(e,t){var n=this,o=z.select(this).attr("id").split(","),s=o[0],a=[];o.forEach((function(e){a.push(s+"-"+e)})),z.selectAll("path").each((function(e){var t=z.select(this).attr("id"),r=a.find((function(e){return e===t}));z.select(this).attr("opacity",r?1:.2)}));var u=z.select(this).attr("data-index");z.select("body").append("div").attr("class","tooltip-node"+u).html((function(){var e=r.display(z.select(n).attr("d"));return z.select(n).attr("name")+": "+e.text+" "+e.suffix+""})).style("padding","10px 15px").style("background","black").style("color","white").style("border","#A8A8A8 solid 5px").style("border-radius","5px").style("left",i.mouseX+"px").style("top",i.mouseY+"px").style("opacity",0).style("position","absolute").transition().duration(200).style("opacity",.8)})).on("mouseout",(function(e){var t=z.select(this).attr("data-index");z.selectAll(".tooltip-node"+t).transition().duration(300).remove(),z.selectAll("path").attr("opacity",.7)})),function(){window.removeEventListener("mousemove",u)}})),null},Y=function(e){var t=e.displayNames,r=e.width,n=e.id,i=e.topMargin,s=e.textColor;return Object(o.useEffect)((function(){z.select("#"+n).selectAll(".header-text").remove();var e=z.select("#"+n).append("g").attr("id",n+" header"),o=20,a=i/2;if(e.append("text").attr("class","header-text").attr("transform","translate("+o+","+a+")").attr("font-size","14pt").attr("font-weight","500").attr("text-anchor","start").text(t[0]).attr("fill",s),e.append("text").attr("class","header-text").attr("transform","translate("+(r+o)+","+a+")").attr("font-size","14pt").attr("font-weight","500").attr("text-anchor","end").text(t[t.length-2]).attr("fill",s),t.length>3)for(var u=r/(t.length-2),l=1;l "+v[r[o+1]].name)}I.push({name:"row"+y,display:s}),y++})),[{links:m,nodes:v},c,I,f[0],s]}(r,t,l.monochrome,l.color)}catch(e){}var f=c[1],h=c[0],p=c[2],d=c[3],E=c[4],m=E(l.textColor),v=E(l.nodeColor);return i.a.createElement("g",null,i.a.createElement(q,{data:h,displayNames:f,rowDisplayNames:p,width:o,height:a,id:u,textColor:m,nodeColor:v,field:d,nodeWidth:l.nodeWidth,nodePadding:l.nodePadding,iteration:l.iteration}))})).setPanelOptions((function(e){var t;e.addBooleanSwitch({path:"monochrome",name:"Single Link color only",defaultValue:!1}).addColorPicker({path:"color",name:"Link Color",showIf:(t=!0,function(e){return e.monochrome===t}),defaultValue:"blue"}).addColorPicker({path:"textColor",name:"Text color",defaultValue:"black"}).addColorPicker({path:"nodeColor",name:"Node color",defaultValue:"grey"}).addSliderInput({path:"nodeWidth",name:"Node width",defaultValue:30,settings:{min:5,max:100,step:1}}).addSliderInput({path:"nodePadding",name:"Node padding",defaultValue:30,settings:{min:1,max:100,step:1}}).addSliderInput({path:"iteration",name:"Layout iterations",defaultValue:7,settings:{min:1,max:30,step:1}})})).useFieldConfig({standardOptions:(W=[n.FieldConfigProperty.Decimals,n.FieldConfigProperty.Unit],c("standard-options-object")?W.reduce((function(e,t){return e[t]={},e}),{}):W)})}])})); +/*! For license information please see module.js.LICENSE.txt */ +define(["d3","react","@grafana/data","@grafana/ui"],(function(t,e,n,r){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=5)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e){t.exports=n},function(t,e){t.exports=r},,function(t,e,n){"use strict";n.r(e);var r=n(2);var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}var a=n(1),s=n.n(a);function l(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let o of t)(o=+e(o,++r,t))&&(n+=o)}return n}function u(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n=e)&&(n=e);else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(n=o)&&(n=o)}return n}function c(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let o of t)null!=(o=e(o,++r,t))&&(n>o||void 0===n&&o>=o)&&(n=o)}return n}function f(t,e){return t.sourceLinks.length?t.depth:e-1}function d(t){return function(){return t}}function h(t,e){return y(t.source,e.source)||t.index-e.index}function p(t,e){return y(t.target,e.target)||t.index-e.index}function y(t,e){return t.y0-e.y0}function g(t){return t.value}function m(t){return t.index}function x(t){return t.nodes}function b(t){return t.links}function v(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function k({nodes:t}){for(const e of t){let t=e.y0,n=t;for(const n of e.sourceLinks)n.y0=t+n.width/2,t+=n.width;for(const t of e.targetLinks)t.y1=n+t.width/2,n+=t.width}}function w(){let t,e,n,r=0,o=0,i=1,a=1,s=24,w=8,_=m,L=f,M=x,C=b,E=6;function S(){const t={nodes:M.apply(null,arguments),links:C.apply(null,arguments)};return A(t),P(t),O(t),j(t),N(t),k(t),t}function A({nodes:t,links:e}){for(const[e,n]of t.entries())n.index=e,n.sourceLinks=[],n.targetLinks=[];const r=new Map(t.map((e,n)=>[_(e,n,t),e]));for(const[t,n]of e.entries()){n.index=t;let{source:e,target:o}=n;"object"!=typeof e&&(e=n.source=v(r,e)),"object"!=typeof o&&(o=n.target=v(r,o)),e.sourceLinks.push(n),o.targetLinks.push(n)}if(null!=n)for(const{sourceLinks:e,targetLinks:r}of t)e.sort(n),r.sort(n)}function P({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(l(e.sourceLinks,g),l(e.targetLinks,g)):e.fixedValue}function O({nodes:t}){const e=t.length;let n=new Set(t),r=new Set,o=0;for(;n.size;){for(const t of n){t.depth=o;for(const{target:e}of t.sourceLinks)r.add(e)}if(++o>e)throw new Error("circular link");n=r,r=new Set}}function j({nodes:t}){const e=t.length;let n=new Set(t),r=new Set,o=0;for(;n.size;){for(const t of n){t.height=o;for(const{source:e}of t.targetLinks)r.add(e)}if(++o>e)throw new Error("circular link");n=r,r=new Set}}function N(n){const f=function({nodes:t}){const n=u(t,t=>t.depth)+1,o=(i-r-s)/(n-1),a=new Array(n);for(const e of t){const t=Math.max(0,Math.min(n-1,Math.floor(L.call(null,e,n))));e.layer=t,e.x0=r+t*o,e.x1=e.x0+s,a[t]?a[t].push(e):a[t]=[e]}if(e)for(const t of a)t.sort(e);return a}(n);t=Math.min(w,(a-o)/(u(f,t=>t.length)-1)),function(e){const n=c(e,e=>(a-o-(e.length-1)*t)/l(e,g));for(const r of e){let e=o;for(const o of r){o.y0=e,o.y1=e+o.value*n,e=o.y1+t;for(const t of o.sourceLinks)t.width=t.value*n}e=(a-e+t)/(r.length+1);for(let t=0;t0))continue;let o=(e/r-t.y0)*n;t.y0+=o,t.y1+=o,z(t)}void 0===e&&i.sort(y),D(i,r)}}function V(t,n,r){for(let o=t.length-2;o>=0;--o){const i=t[o];for(const t of i){let e=0,r=0;for(const{target:n,value:o}of t.sourceLinks){let i=o*(n.layer-t.layer);e+=X(t,n)*i,r+=i}if(!(r>0))continue;let o=(e/r-t.y0)*n;t.y0+=o,t.y1+=o,z(t)}void 0===e&&i.sort(y),D(i,r)}}function D(e,n){const r=e.length>>1,i=e[r];T(e,i.y0-t,r-1,n),F(e,i.y1+t,r+1,n),T(e,a,e.length-1,n),F(e,o,0,n)}function F(e,n,r,o){for(;r1e-6&&(i.y0+=a,i.y1+=a),n=i.y1+t}}function T(e,n,r,o){for(;r>=0;--r){const i=e[r],a=(i.y1-n)*o;a>1e-6&&(i.y0-=a,i.y1-=a),n=i.y0-t}}function z({sourceLinks:t,targetLinks:e}){if(void 0===n){for(const{source:{sourceLinks:t}}of e)t.sort(p);for(const{target:{targetLinks:e}}of t)e.sort(h)}}function B(t){if(void 0===n)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(p),n.sort(h)}function W(e,n){let r=e.y0-(e.sourceLinks.length-1)*t/2;for(const{target:o,width:i}of e.sourceLinks){if(o===n)break;r+=i+t}for(const{source:t,width:o}of n.targetLinks){if(t===e)break;r-=o}return r}function X(e,n){let r=n.y0-(n.targetLinks.length-1)*t/2;for(const{source:o,width:i}of n.targetLinks){if(o===e)break;r+=i+t}for(const{target:t,width:o}of e.sourceLinks){if(t===n)break;r-=o}return r}return S.update=function(t){return k(t),t},S.nodeId=function(t){return arguments.length?(_="function"==typeof t?t:d(t),S):_},S.nodeAlign=function(t){return arguments.length?(L="function"==typeof t?t:d(t),S):L},S.nodeSort=function(t){return arguments.length?(e=t,S):e},S.nodeWidth=function(t){return arguments.length?(s=+t,S):s},S.nodePadding=function(e){return arguments.length?(w=t=+e,S):w},S.nodes=function(t){return arguments.length?(M="function"==typeof t?t:d(t),S):M},S.links=function(t){return arguments.length?(C="function"==typeof t?t:d(t),S):C},S.linkSort=function(t){return arguments.length?(n=t,S):n},S.size=function(t){return arguments.length?(r=o=0,i=+t[0],a=+t[1],S):[i-r,a-o]},S.extent=function(t){return arguments.length?(r=+t[0][0],i=+t[1][0],o=+t[0][1],a=+t[1][1],S):[[r,o],[i,a]]},S.iterations=function(t){return arguments.length?(E=+t,S):E},S}var _=Math.PI,L=2*_,M=L-1e-6;function C(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function E(){return new C}C.prototype=E.prototype={constructor:C,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,o,i){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+o)+","+(this._y1=+i)},arcTo:function(t,e,n,r,o){t=+t,e=+e,n=+n,r=+r,o=+o;var i=this._x1,a=this._y1,s=n-t,l=r-e,u=i-t,c=a-e,f=u*u+c*c;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(f>1e-6)if(Math.abs(c*s-l*u)>1e-6&&o){var d=n-i,h=r-a,p=s*s+l*l,y=d*d+h*h,g=Math.sqrt(p),m=Math.sqrt(f),x=o*Math.tan((_-Math.acos((p+f-y)/(2*g*m)))/2),b=x/m,v=x/g;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*u)+","+(e+b*c)),this._+="A"+o+","+o+",0,0,"+ +(c*d>u*h)+","+(this._x1=t+v*s)+","+(this._y1=e+v*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,o,i){t=+t,e=+e,i=!!i;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),l=t+a,u=e+s,c=1^i,f=i?r-o:o-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+u:(Math.abs(this._x1-l)>1e-6||Math.abs(this._y1-u)>1e-6)&&(this._+="L"+l+","+u),n&&(f<0&&(f=f%L+L),f>M?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=l)+","+(this._y1=u):f>1e-6&&(this._+="A"+n+","+n+",0,"+ +(f>=_)+","+c+","+(this._x1=t+n*Math.cos(o))+","+(this._y1=e+n*Math.sin(o))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var S=E,A=Array.prototype.slice,P=function(t){return function(){return t}};function O(t){return t[0]}function j(t){return t[1]}function N(t){return t.source}function I(t){return t.target}function V(t){var e=N,n=I,r=O,o=j,i=null;function a(){var a,s=A.call(arguments),l=e.apply(this,s),u=n.apply(this,s);if(i||(i=a=S()),t(i,+r.apply(this,(s[0]=l,s)),+o.apply(this,s),+r.apply(this,(s[0]=u,s)),+o.apply(this,s)),a)return i=null,a+""||null}return a.source=function(t){return arguments.length?(e=t,a):e},a.target=function(t){return arguments.length?(n=t,a):n},a.x=function(t){return arguments.length?(r="function"==typeof t?t:P(+t),a):r},a.y=function(t){return arguments.length?(o="function"==typeof t?t:P(+t),a):o},a.context=function(t){return arguments.length?(i=null==t?null:t,a):i},a}function D(t,e,n,r,o){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,o,r,o)}function F(t){return[t.source.x1,t.y0]}function T(t){return[t.target.x0,t.y1]}var z,B=function(){return V(D).source(F).target(T)},W=function(t){var e=t.data,n=t.panelId,r=B(),o=e.color,i=n+"-"+e.id;return s.a.createElement(s.a.Fragment,null,s.a.createElement("path",{d:r(e),fill:"none",stroke:o,strokeOpacity:.8,opacity:.7,strokeWidth:e.width,id:i,display:e.displayValue}))},X=n(3),Y=function(t){var e=t.data,n=t.textColor,r=t.nodeColor,o=t.panelId,i=Object(X.useTheme2)(),a=e.x0,l=e.x1,u=e.y0,c=e.y1,f=e.index,d=e.name,h=e.value,p=l-a,y=i.typography.fontSize;return s.a.createElement(s.a.Fragment,null,s.a.createElement("rect",{x:a,y:u,rx:5,ry:5,width:p,height:c-u,stroke:"black",fill:r,"data-index":f,id:o+","+e.id,d:h,name:d}),s.a.createElement("text",{x:a

"+t+""})).style("padding","10px 15px").style("background","black").style("color","white").style("border","#A8A8A8 solid 5px").style("border-radius","5px").style("left",o.mouseX+"px").style("top",o.mouseY+"px").style("opacity",0).style("position","absolute").transition().duration(200).style("opacity",.8)})).on("mouseout",(function(t){var e=q.select(this).attr("id");q.selectAll(".tooltip-"+e).transition().duration(300).remove(),q.selectAll("path").attr("opacity",.7)})),q.selectAll("rect").on("mouseover",(function(t,e){var r=this,i=q.select(this).attr("id").split(","),a=i[0],s=[];i.forEach((function(t){s.push(a+"-"+t)})),q.selectAll("path").each((function(t){var e=q.select(this).attr("id"),n=s.find((function(t){return t===e}));q.select(this).attr("opacity",n?1:.2)}));var l=q.select(this).attr("data-index");q.select("body").append("div").attr("class","tooltip-node"+l).html((function(){var t=n.display(q.select(r).attr("d")),e=q.select(r).attr("name");return t.suffix?e+": "+t.text+" "+t.suffix+"":e+": "+t.text+""})).style("padding","10px 15px").style("background","black").style("color","white").style("border","#A8A8A8 solid 5px").style("border-radius","5px").style("left",o.mouseX+"px").style("top",o.mouseY+"px").style("opacity",0).style("position","absolute").transition().duration(200).style("opacity",.8)})).on("mouseout",(function(t){var e=q.select(this).attr("data-index");q.selectAll(".tooltip-node"+e).transition().duration(300).remove(),q.selectAll("path").attr("opacity",.7)})),function(){window.removeEventListener("mousemove",l)}})),null},Q=function(t){var e=t.displayNames,n=t.width,r=t.id,o=t.topMargin,i=t.textColor;return Object(a.useEffect)((function(){q.select("#"+r).selectAll(".header-text").remove();var t=q.select("#"+r).append("g").attr("id",r+" header"),a=20,s=o/2;if(t.append("text").attr("class","header-text").attr("transform","translate("+a+","+s+")").attr("font-size","14pt").attr("font-weight","500").attr("text-anchor","start").text(e[0]).attr("fill",i),t.append("text").attr("class","header-text").attr("transform","translate("+(n+a)+","+s+")").attr("font-size","14pt").attr("font-weight","500").attr("text-anchor","end").text(e[e.length-2]).attr("fill",i),e.length>3)for(var l=n/(e.length-2),u=1;u "+m[n[o+1]].name)}b.push({name:"row"+v,display:a}),v++})),[{links:g,nodes:m},c,b,f[0],a]}(n,e,u.monochrome,u.color)}catch(t){}var d=f[1],h=f[0],p=f[2],y=f[3],g=f[4],m=c.colors.text.primary,x=g(u.nodeColor);return s.a.createElement("g",null,s.a.createElement(G,{data:h,displayNames:d,rowDisplayNames:p,width:i,height:a,id:l,textColor:m,nodeColor:x,field:y,nodeWidth:u.nodeWidth,nodePadding:u.nodePadding,iteration:u.iteration}))})).setPanelOptions((function(t){var e;t.addBooleanSwitch({path:"monochrome",name:"Single Link color only",defaultValue:!1}).addColorPicker({path:"color",name:"Link Color",showIf:(e=!0,function(t){return t.monochrome===e}),defaultValue:"blue"}).addColorPicker({path:"nodeColor",name:"Node color",defaultValue:"grey"}).addSliderInput({path:"nodeWidth",name:"Node width",defaultValue:30,settings:{min:5,max:100,step:1}}).addSliderInput({path:"nodePadding",name:"Node padding",defaultValue:30,settings:{min:1,max:100,step:1}}).addSliderInput({path:"iteration",name:"Layout iterations",defaultValue:7,settings:{min:1,max:30,step:1}})})).useFieldConfig({disableStandardOptions:[r.FieldConfigProperty.NoValue,r.FieldConfigProperty.Max,r.FieldConfigProperty.Min,r.FieldConfigProperty.DisplayName],standardOptions:(z={},z[r.FieldConfigProperty.Color]={settings:{byValueSupport:!0,bySeriesSupport:!0,preferThresholdsMode:!0}},z)})}])})); //# sourceMappingURL=module.js.map \ No newline at end of file diff --git a/netsage-sankey-panel/module.js.LICENSE.txt b/netsage-sankey-panel/module.js.LICENSE.txt new file mode 100644 index 0000000..c18ab1d --- /dev/null +++ b/netsage-sankey-panel/module.js.LICENSE.txt @@ -0,0 +1,14 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ diff --git a/netsage-sankey-panel/module.js.map b/netsage-sankey-panel/module.js.map index d26db00..405ea37 100644 --- a/netsage-sankey-panel/module.js.map +++ b/netsage-sankey-panel/module.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"react\"","webpack:///external \"d3\"","webpack:///external \"@grafana/data\"","webpack:///external \"@grafana/ui\"","webpack:///../node_modules/semver/semver.js","webpack:///external \"@grafana/runtime\"","webpack:///external \"emotion\"","webpack:///../node_modules/process/browser.js","webpack:///../node_modules/tslib/tslib.es6.js","webpack:///../node_modules/grafana-plugin-support/dist/utils/capability.js","webpack:///../node_modules/d3-sankey/node_modules/d3-array/src/sum.js","webpack:///../node_modules/d3-sankey/node_modules/d3-array/src/max.js","webpack:///../node_modules/d3-sankey/node_modules/d3-array/src/min.js","webpack:///../node_modules/d3-sankey/src/align.js","webpack:///../node_modules/d3-sankey/src/constant.js","webpack:///../node_modules/d3-sankey/src/sankey.js","webpack:///../node_modules/d3-path/src/path.js","webpack:///../node_modules/d3-shape/src/array.js","webpack:///../node_modules/d3-shape/src/constant.js","webpack:///../node_modules/d3-shape/src/point.js","webpack:///../node_modules/d3-shape/src/link/index.js","webpack:///../node_modules/d3-sankey/src/sankeyLinkHorizontal.js","webpack:///./components/Link.tsx","webpack:///./components/Node.tsx","webpack:///./components/Tooltip.tsx","webpack:///./components/Headers.tsx","webpack:///./components/Sankey.tsx","webpack:///./module.ts","webpack:///./SankeyPanel.tsx","webpack:///./dataParser.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__WEBPACK_EXTERNAL_MODULE__0__","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","debug","process","env","NODE_DEBUG","test","args","Array","slice","arguments","unshift","SEMVER_SPEC_VERSION","MAX_SAFE_INTEGER","Number","re","src","tokens","R","tok","NUMERICIDENTIFIER","NUMERICIDENTIFIERLOOSE","NONNUMERICIDENTIFIER","MAINVERSION","MAINVERSIONLOOSE","PRERELEASEIDENTIFIER","PRERELEASEIDENTIFIERLOOSE","PRERELEASE","PRERELEASELOOSE","BUILDIDENTIFIER","BUILD","FULLPLAIN","FULL","LOOSEPLAIN","LOOSE","GTLT","XRANGEIDENTIFIERLOOSE","XRANGEIDENTIFIER","XRANGEPLAIN","XRANGEPLAINLOOSE","XRANGE","XRANGELOOSE","COERCE","COERCERTL","RegExp","LONETILDE","TILDETRIM","TILDE","TILDELOOSE","LONECARET","CARETTRIM","CARET","CARETLOOSE","COMPARATORLOOSE","COMPARATOR","COMPARATORTRIM","HYPHENRANGE","HYPHENRANGELOOSE","STAR","parse","version","options","loose","includePrerelease","SemVer","length","er","TypeError","this","trim","match","raw","major","minor","patch","prerelease","split","map","id","num","build","format","valid","v","clean","replace","join","toString","compare","other","compareMain","comparePre","compareIdentifiers","a","b","undefined","compareBuild","inc","release","identifier","push","isNaN","Error","diff","version1","version2","eq","v1","v2","prefix","defaultResult","numeric","anum","bnum","gt","lt","neq","gte","lte","cmp","op","Comparator","comp","semver","ANY","operator","rcompareIdentifiers","compareLoose","versionA","versionB","rcompare","sort","list","rsort","Range","range","set","parseRange","filter","isSatisfiable","comparators","result","remainingComparators","testComparator","pop","every","otherComparator","intersects","isX","toLowerCase","hyphenReplace","$0","from","fM","fm","fp","fpr","fb","to","tM","tm","tp","tpr","tb","testSet","allowed","satisfies","outside","hilo","gtfn","ltefn","ltfn","ecomp","high","low","forEach","comparator","rangeTmp","sameDirectionIncreasing","sameDirectionDecreasing","sameSemVer","differentDirectionsInclusive","oppositeDirectionsLessThan","oppositeDirectionsGreaterThan","comps","hr","compRe","_","M","pr","ret","replaceCaret","replaceCarets","replaceTilde","replaceTildes","gtlt","xM","xm","xp","anyX","replaceXRange","replaceXRanges","replaceStars","parseComparator","some","thisComparators","rangeComparators","thisComparator","rangeComparator","toComparators","maxSatisfying","versions","max","maxSV","rangeObj","minSatisfying","min","minSV","minVersion","minver","compver","validRange","ltr","gtr","parsed","r1","r2","coerce","String","rtl","next","exec","index","lastIndex","__WEBPACK_EXTERNAL_MODULE__5__","__WEBPACK_EXTERNAL_MODULE__6__","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","setTimeout","e","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","concat","drainQueue","timeout","len","run","marker","runClearTimeout","Item","array","noop","nextTick","apply","title","browser","argv","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","__assign","assign","__read","iterator","ar","done","error","hasCapability","capability","buildInfo","sum","values","valueof","justify","node","sourceLinks","depth","constant","x","ascendingSourceBreadth","ascendingBreadth","source","ascendingTargetBreadth","target","y0","defaultId","defaultNodes","graph","nodes","defaultLinks","links","find","nodeById","computeLinkBreadths","y1","link","width","targetLinks","py","linkSort","x0","x1","dx","dy","align","iterations","sankey","computeNodeLinks","computeNodeValues","computeNodeDepths","computeNodeHeights","computeNodeBreadths","entries","Map","fixedValue","Math","current","Set","size","add","height","columns","kx","floor","layer","column","computeNodeLayers","ky","y","reorderLinks","initializeNodeBreadths","alpha","pow","beta","relaxRightToLeft","relaxLeftToRight","w","targetTop","reorderNodeLinks","resolveCollisions","sourceTop","subject","resolveCollisionsBottomToTop","resolveCollisionsTopToBottom","update","nodeId","nodeAlign","nodeSort","nodeWidth","nodePadding","extent","pi","PI","tau","tauEpsilon","Path","_x0","_y0","_x1","_y1","path","constructor","moveTo","closePath","lineTo","quadraticCurveTo","bezierCurveTo","x2","y2","arcTo","x21","y21","x01","y01","l01_2","abs","x20","y20","l21_2","l20_2","l21","sqrt","l01","tan","acos","t01","t21","arc","a0","a1","ccw","cos","sin","cw","da","rect","h","linkSource","linkTarget","curve","context","buffer","curveHorizontal","horizontalSource","horizontalTarget","data","panelId","strokeColor","color","fill","stroke","strokeOpacity","opacity","strokeWidth","display","displayValue","textColor","nodeColor","rx","ry","style","alignmentBaseline","fontSize","textAnchor","pointerEvents","userSelect","rowNames","field","mouseX","mouseY","mousePosition","setMousePosition","updateMousePosition","clientX","clientY","window","addEventListener","event","attr","row","each","thisId","dark","append","html","textVal","transition","duration","remove","rowList","found","thisNode","text","suffix","removeEventListener","displayNames","topMargin","selectAll","head","MARGIN","translateY","colWidth","translateX","rowDisplayNames","iteration","graphWidth","graphHeight","transform","graphOptions","parsedData","monochrome","valueFieldName","fixColor","colorArray","allData","series","fields","numFields","valueField","type","currentColor","frame","pluginDataLinks","pluginDataNodes","col0","rowId","currentLink","findIndex","colId","rowColor","rowDisplay","fieldValues","node0","parseData","pluginData","setPanelOptions","builder","addBooleanSwitch","defaultValue","addColorPicker","showIf","config","addSliderInput","settings","step","useFieldConfig","standardOptions","Decimals","Unit","reduce","acc","curr"],"mappings":"2HACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoB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AAK,IACLwT,KAAM,KAGTF,eAAe,CACd9I,KAAM,cACNvZ,KAAM,eACNiiB,aAAc,GACdK,SAAU,CACRnT,IAAK,EACLJ,IAAK,IACLwT,KAAM,KAGTF,eAAe,CACd9I,KAAM,YACNvZ,KAAM,oBACNiiB,aAAc,EACdK,SAAU,CACRnT,IAAK,EACLJ,IAAK,GACLwT,KAAM,QAIbC,eAAe,CACdC,iBlBtDyCjd,EkBb3B,CACd,sBAAoBkd,SACpB,sBAAoBC,MlBYhBjP,EAAc,2BACPlO,EAAQod,QAAO,SAAUC,EAAKC,GAEjC,OADAD,EAAIC,GAAQ,GACLD,IACR,IAEArd","file":"module.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 9);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","exports = module.exports = SemVer\n\nvar debug\n/* istanbul ignore next */\nif (typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)) {\n debug = function () {\n var args = Array.prototype.slice.call(arguments, 0)\n args.unshift('SEMVER')\n console.log.apply(console, args)\n }\n} else {\n debug = function () {}\n}\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nexports.SEMVER_SPEC_VERSION = '2.0.0'\n\nvar MAX_LENGTH = 256\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nvar MAX_SAFE_COMPONENT_LENGTH = 16\n\n// The actual regexps go on exports.re\nvar re = exports.re = []\nvar src = exports.src = []\nvar t = exports.tokens = {}\nvar R = 0\n\nfunction tok (n) {\n t[n] = R++\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ntok('NUMERICIDENTIFIER')\nsrc[t.NUMERICIDENTIFIER] = '0|[1-9]\\\\d*'\ntok('NUMERICIDENTIFIERLOOSE')\nsrc[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ntok('NONNUMERICIDENTIFIER')\nsrc[t.NONNUMERICIDENTIFIER] = '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*'\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ntok('MAINVERSION')\nsrc[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIER] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIER] + ')'\n\ntok('MAINVERSIONLOOSE')\nsrc[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ntok('PRERELEASEIDENTIFIER')\nsrc[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +\n '|' + src[t.NONNUMERICIDENTIFIER] + ')'\n\ntok('PRERELEASEIDENTIFIERLOOSE')\nsrc[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +\n '|' + src[t.NONNUMERICIDENTIFIER] + ')'\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ntok('PRERELEASE')\nsrc[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +\n '(?:\\\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'\n\ntok('PRERELEASELOOSE')\nsrc[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +\n '(?:\\\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ntok('BUILDIDENTIFIER')\nsrc[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ntok('BUILD')\nsrc[t.BUILD] = '(?:\\\\+(' + src[t.BUILDIDENTIFIER] +\n '(?:\\\\.' + src[t.BUILDIDENTIFIER] + ')*))'\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ntok('FULL')\ntok('FULLPLAIN')\nsrc[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +\n src[t.PRERELEASE] + '?' +\n src[t.BUILD] + '?'\n\nsrc[t.FULL] = '^' + src[t.FULLPLAIN] + '$'\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ntok('LOOSEPLAIN')\nsrc[t.LOOSEPLAIN] = '[v=\\\\s]*' + src[t.MAINVERSIONLOOSE] +\n src[t.PRERELEASELOOSE] + '?' +\n src[t.BUILD] + '?'\n\ntok('LOOSE')\nsrc[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'\n\ntok('GTLT')\nsrc[t.GTLT] = '((?:<|>)?=?)'\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ntok('XRANGEIDENTIFIERLOOSE')\nsrc[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\\\*'\ntok('XRANGEIDENTIFIER')\nsrc[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\\\*'\n\ntok('XRANGEPLAIN')\nsrc[t.XRANGEPLAIN] = '[v=\\\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:' + src[t.PRERELEASE] + ')?' +\n src[t.BUILD] + '?' +\n ')?)?'\n\ntok('XRANGEPLAINLOOSE')\nsrc[t.XRANGEPLAINLOOSE] = '[v=\\\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:' + src[t.PRERELEASELOOSE] + ')?' +\n src[t.BUILD] + '?' +\n ')?)?'\n\ntok('XRANGE')\nsrc[t.XRANGE] = '^' + src[t.GTLT] + '\\\\s*' + src[t.XRANGEPLAIN] + '$'\ntok('XRANGELOOSE')\nsrc[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\\\s*' + src[t.XRANGEPLAINLOOSE] + '$'\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ntok('COERCE')\nsrc[t.COERCE] = '(^|[^\\\\d])' +\n '(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +\n '(?:\\\\.(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +\n '(?:\\\\.(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +\n '(?:$|[^\\\\d])'\ntok('COERCERTL')\nre[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ntok('LONETILDE')\nsrc[t.LONETILDE] = '(?:~>?)'\n\ntok('TILDETRIM')\nsrc[t.TILDETRIM] = '(\\\\s*)' + src[t.LONETILDE] + '\\\\s+'\nre[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')\nvar tildeTrimReplace = '$1~'\n\ntok('TILDE')\nsrc[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'\ntok('TILDELOOSE')\nsrc[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ntok('LONECARET')\nsrc[t.LONECARET] = '(?:\\\\^)'\n\ntok('CARETTRIM')\nsrc[t.CARETTRIM] = '(\\\\s*)' + src[t.LONECARET] + '\\\\s+'\nre[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')\nvar caretTrimReplace = '$1^'\n\ntok('CARET')\nsrc[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'\ntok('CARETLOOSE')\nsrc[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ntok('COMPARATORLOOSE')\nsrc[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'\ntok('COMPARATOR')\nsrc[t.COMPARATOR] = '^' + src[t.GTLT] + '\\\\s*(' + src[t.FULLPLAIN] + ')$|^$'\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ntok('COMPARATORTRIM')\nsrc[t.COMPARATORTRIM] = '(\\\\s*)' + src[t.GTLT] +\n '\\\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'\n\n// this one has to use the /g flag\nre[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')\nvar comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ntok('HYPHENRANGE')\nsrc[t.HYPHENRANGE] = '^\\\\s*(' + src[t.XRANGEPLAIN] + ')' +\n '\\\\s+-\\\\s+' +\n '(' + src[t.XRANGEPLAIN] + ')' +\n '\\\\s*$'\n\ntok('HYPHENRANGELOOSE')\nsrc[t.HYPHENRANGELOOSE] = '^\\\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +\n '\\\\s+-\\\\s+' +\n '(' + src[t.XRANGEPLAINLOOSE] + ')' +\n '\\\\s*$'\n\n// Star ranges basically just allow anything at all.\ntok('STAR')\nsrc[t.STAR] = '(<|>)?=?\\\\s*\\\\*'\n\n// Compile to actual regexp objects.\n// All are flag-free, unless they were created above with a flag.\nfor (var i = 0; i < R; i++) {\n debug(i, src[i])\n if (!re[i]) {\n re[i] = new RegExp(src[i])\n }\n}\n\nexports.parse = parse\nfunction parse (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n var r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nexports.valid = valid\nfunction valid (version, options) {\n var v = parse(version, options)\n return v ? v.version : null\n}\n\nexports.clean = clean\nfunction clean (version, options) {\n var s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\n\nexports.SemVer = SemVer\n\nfunction SemVer (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n if (version instanceof SemVer) {\n if (version.loose === options.loose) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError('Invalid Version: ' + version)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')\n }\n\n if (!(this instanceof SemVer)) {\n return new SemVer(version, options)\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n\n var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError('Invalid Version: ' + version)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map(function (id) {\n if (/^[0-9]+$/.test(id)) {\n var num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n}\n\nSemVer.prototype.format = function () {\n this.version = this.major + '.' + this.minor + '.' + this.patch\n if (this.prerelease.length) {\n this.version += '-' + this.prerelease.join('.')\n }\n return this.version\n}\n\nSemVer.prototype.toString = function () {\n return this.version\n}\n\nSemVer.prototype.compare = function (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return this.compareMain(other) || this.comparePre(other)\n}\n\nSemVer.prototype.compareMain = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n}\n\nSemVer.prototype.comparePre = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n var i = 0\n do {\n var a = this.prerelease[i]\n var b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n}\n\nSemVer.prototype.compareBuild = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n var i = 0\n do {\n var a = this.build[i]\n var b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n}\n\n// preminor will bump the version up to the next minor release, and immediately\n// down to pre-release. premajor and prepatch work the same way.\nSemVer.prototype.inc = function (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 \"pre\" would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n var i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error('invalid increment argument: ' + release)\n }\n this.format()\n this.raw = this.version\n return this\n}\n\nexports.inc = inc\nfunction inc (version, release, loose, identifier) {\n if (typeof (loose) === 'string') {\n identifier = loose\n loose = undefined\n }\n\n try {\n return new SemVer(version, loose).inc(release, identifier).version\n } catch (er) {\n return null\n }\n}\n\nexports.diff = diff\nfunction diff (version1, version2) {\n if (eq(version1, version2)) {\n return null\n } else {\n var v1 = parse(version1)\n var v2 = parse(version2)\n var prefix = ''\n if (v1.prerelease.length || v2.prerelease.length) {\n prefix = 'pre'\n var defaultResult = 'prerelease'\n }\n for (var key in v1) {\n if (key === 'major' || key === 'minor' || key === 'patch') {\n if (v1[key] !== v2[key]) {\n return prefix + key\n }\n }\n }\n return defaultResult // may be undefined\n }\n}\n\nexports.compareIdentifiers = compareIdentifiers\n\nvar numeric = /^[0-9]+$/\nfunction compareIdentifiers (a, b) {\n var anum = numeric.test(a)\n var bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nexports.rcompareIdentifiers = rcompareIdentifiers\nfunction rcompareIdentifiers (a, b) {\n return compareIdentifiers(b, a)\n}\n\nexports.major = major\nfunction major (a, loose) {\n return new SemVer(a, loose).major\n}\n\nexports.minor = minor\nfunction minor (a, loose) {\n return new SemVer(a, loose).minor\n}\n\nexports.patch = patch\nfunction patch (a, loose) {\n return new SemVer(a, loose).patch\n}\n\nexports.compare = compare\nfunction compare (a, b, loose) {\n return new SemVer(a, loose).compare(new SemVer(b, loose))\n}\n\nexports.compareLoose = compareLoose\nfunction compareLoose (a, b) {\n return compare(a, b, true)\n}\n\nexports.compareBuild = compareBuild\nfunction compareBuild (a, b, loose) {\n var versionA = new SemVer(a, loose)\n var versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\n\nexports.rcompare = rcompare\nfunction rcompare (a, b, loose) {\n return compare(b, a, loose)\n}\n\nexports.sort = sort\nfunction sort (list, loose) {\n return list.sort(function (a, b) {\n return exports.compareBuild(a, b, loose)\n })\n}\n\nexports.rsort = rsort\nfunction rsort (list, loose) {\n return list.sort(function (a, b) {\n return exports.compareBuild(b, a, loose)\n })\n}\n\nexports.gt = gt\nfunction gt (a, b, loose) {\n return compare(a, b, loose) > 0\n}\n\nexports.lt = lt\nfunction lt (a, b, loose) {\n return compare(a, b, loose) < 0\n}\n\nexports.eq = eq\nfunction eq (a, b, loose) {\n return compare(a, b, loose) === 0\n}\n\nexports.neq = neq\nfunction neq (a, b, loose) {\n return compare(a, b, loose) !== 0\n}\n\nexports.gte = gte\nfunction gte (a, b, loose) {\n return compare(a, b, loose) >= 0\n}\n\nexports.lte = lte\nfunction lte (a, b, loose) {\n return compare(a, b, loose) <= 0\n}\n\nexports.cmp = cmp\nfunction cmp (a, op, b, loose) {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError('Invalid operator: ' + op)\n }\n}\n\nexports.Comparator = Comparator\nfunction Comparator (comp, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n if (!(this instanceof Comparator)) {\n return new Comparator(comp, options)\n }\n\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n}\n\nvar ANY = {}\nComparator.prototype.parse = function (comp) {\n var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n var m = comp.match(r)\n\n if (!m) {\n throw new TypeError('Invalid comparator: ' + comp)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n}\n\nComparator.prototype.toString = function () {\n return this.value\n}\n\nComparator.prototype.test = function (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n}\n\nComparator.prototype.intersects = function (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n var rangeTmp\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n rangeTmp = new Range(comp.value, options)\n return satisfies(this.value, rangeTmp, options)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n rangeTmp = new Range(this.value, options)\n return satisfies(comp.semver, rangeTmp, options)\n }\n\n var sameDirectionIncreasing =\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '>=' || comp.operator === '>')\n var sameDirectionDecreasing =\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '<=' || comp.operator === '<')\n var sameSemVer = this.semver.version === comp.semver.version\n var differentDirectionsInclusive =\n (this.operator === '>=' || this.operator === '<=') &&\n (comp.operator === '>=' || comp.operator === '<=')\n var oppositeDirectionsLessThan =\n cmp(this.semver, '<', comp.semver, options) &&\n ((this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '<=' || comp.operator === '<'))\n var oppositeDirectionsGreaterThan =\n cmp(this.semver, '>', comp.semver, options) &&\n ((this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '>=' || comp.operator === '>'))\n\n return sameDirectionIncreasing || sameDirectionDecreasing ||\n (sameSemVer && differentDirectionsInclusive) ||\n oppositeDirectionsLessThan || oppositeDirectionsGreaterThan\n}\n\nexports.Range = Range\nfunction Range (range, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (range instanceof Range) {\n if (range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n return new Range(range.value, options)\n }\n\n if (!(this instanceof Range)) {\n return new Range(range, options)\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First, split based on boolean or ||\n this.raw = range\n this.set = range.split(/\\s*\\|\\|\\s*/).map(function (range) {\n return this.parseRange(range.trim())\n }, this).filter(function (c) {\n // throw out any that are not relevant for whatever reason\n return c.length\n })\n\n if (!this.set.length) {\n throw new TypeError('Invalid SemVer Range: ' + range)\n }\n\n this.format()\n}\n\nRange.prototype.format = function () {\n this.range = this.set.map(function (comps) {\n return comps.join(' ').trim()\n }).join('||').trim()\n return this.range\n}\n\nRange.prototype.toString = function () {\n return this.range\n}\n\nRange.prototype.parseRange = function (range) {\n var loose = this.options.loose\n range = range.trim()\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace)\n debug('hyphen replace', range)\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range, re[t.COMPARATORTRIM])\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n\n // normalize spaces\n range = range.split(/\\s+/).join(' ')\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n var set = range.split(' ').map(function (comp) {\n return parseComparator(comp, this.options)\n }, this).join(' ').split(/\\s+/)\n if (this.options.loose) {\n // in loose mode, throw out any that are not valid comparators\n set = set.filter(function (comp) {\n return !!comp.match(compRe)\n })\n }\n set = set.map(function (comp) {\n return new Comparator(comp, this.options)\n }, this)\n\n return set\n}\n\nRange.prototype.intersects = function (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some(function (thisComparators) {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some(function (rangeComparators) {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every(function (thisComparator) {\n return rangeComparators.every(function (rangeComparator) {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n}\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nfunction isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// Mostly just for testing and legacy API reasons\nexports.toComparators = toComparators\nfunction toComparators (range, options) {\n return new Range(range, options).set.map(function (comp) {\n return comp.map(function (c) {\n return c.value\n }).join(' ').trim().split(' ')\n })\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nfunction parseComparator (comp, options) {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nfunction isX (id) {\n return !id || id.toLowerCase() === 'x' || id === '*'\n}\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0\nfunction replaceTildes (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceTilde(comp, options)\n }).join(' ')\n}\n\nfunction replaceTilde (comp, options) {\n var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('tilde', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0\n// ^1.2.3 --> >=1.2.3 <2.0.0\n// ^1.2.0 --> >=1.2.0 <2.0.0\nfunction replaceCarets (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceCaret(comp, options)\n }).join(' ')\n}\n\nfunction replaceCaret (comp, options) {\n debug('caret', comp, options)\n var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('caret', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n if (M === '0') {\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else {\n ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + (+M + 1) + '.0.0'\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + (+M + 1) + '.0.0'\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nfunction replaceXRanges (comp, options) {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map(function (comp) {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nfunction replaceXRange (comp, options) {\n comp = comp.trim()\n var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, function (ret, gtlt, M, m, p, pr) {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n var xM = isX(M)\n var xm = xM || isX(m)\n var xp = xm || isX(p)\n var anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n // >1.2.3 => >= 1.2.4\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n ret = gtlt + M + '.' + m + '.' + p + pr\n } else if (xm) {\n ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr\n } else if (xp) {\n ret = '>=' + M + '.' + m + '.0' + pr +\n ' <' + M + '.' + (+m + 1) + '.0' + pr\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nfunction replaceStars (comp, options) {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0\nfunction hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}\n\n// if ANY of the sets match ALL of its comparators, then pass\nRange.prototype.test = function (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (var i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n}\n\nfunction testSet (set, version, options) {\n for (var i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n var allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n\nexports.satisfies = satisfies\nfunction satisfies (version, range, options) {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\n\nexports.maxSatisfying = maxSatisfying\nfunction maxSatisfying (versions, range, options) {\n var max = null\n var maxSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\n\nexports.minSatisfying = minSatisfying\nfunction minSatisfying (versions, range, options) {\n var min = null\n var minSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\n\nexports.minVersion = minVersion\nfunction minVersion (range, loose) {\n range = new Range(range, loose)\n\n var minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n comparators.forEach(function (comparator) {\n // Clone to avoid manipulating the comparator's semver object.\n var compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!minver || gt(minver, compver)) {\n minver = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected operation: ' + comparator.operator)\n }\n })\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\n\nexports.validRange = validRange\nfunction validRange (range, options) {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\n\n// Determine if version is less than all the versions possible in the range\nexports.ltr = ltr\nfunction ltr (version, range, options) {\n return outside(version, range, '<', options)\n}\n\n// Determine if version is greater than all the versions possible in the range.\nexports.gtr = gtr\nfunction gtr (version, range, options) {\n return outside(version, range, '>', options)\n}\n\nexports.outside = outside\nfunction outside (version, range, hilo, options) {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n var gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisifes the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n var high = null\n var low = null\n\n comparators.forEach(function (comparator) {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nexports.prerelease = prerelease\nfunction prerelease (version, options) {\n var parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\n\nexports.intersects = intersects\nfunction intersects (r1, r2, options) {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\n\nexports.coerce = coerce\nfunction coerce (version, options) {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n var match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n var next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n return parse(match[2] +\n '.' + (match[3] || '0') +\n '.' + (match[4] || '0'), options)\n}\n","module.exports = __WEBPACK_EXTERNAL_MODULE__5__;","module.exports = __WEBPACK_EXTERNAL_MODULE__6__;","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { getFieldConfigWithMinMax, } from \"@grafana/data\";\nimport { config } from \"@grafana/runtime\";\nimport { gte } from \"semver\";\n/**\n * hasCapability returns true if the currently running version of Grafana\n * supports a given feature. Enables graceful degredation for earlier versions\n * that don't support a given capability.\n */\nexport var hasCapability = function (capability) {\n var version = config.buildInfo.version;\n switch (capability) {\n case \"color-scheme\":\n return gte(version, \"7.3.0\");\n case \"standard-options-object\":\n return gte(version, \"7.4.0\");\n case \"custom-editor-context\":\n return gte(version, \"7.0.3\");\n case \"field-config-with-min-max\":\n return gte(version, \"7.4.0\");\n default:\n return false;\n }\n};\n/**\n * standardOptionsCompat translates the standard options API prior to 7.4 to the\n * new API.\n */\nexport var standardOptionsCompat = function (options) {\n if (hasCapability(\"standard-options-object\")) {\n return options.reduce(function (acc, curr) {\n acc[curr] = {};\n return acc;\n }, {});\n }\n return options;\n};\n/**\n * fieldConfigWithMinMaxCompat uses the getFieldConfigWithMinMax if\n * available, otherwise falls back.\n */\nexport var fieldConfigWithMinMaxCompat = function (field) {\n if (hasCapability(\"field-config-with-min-max\")) {\n return getFieldConfigWithMinMax(field, true);\n }\n return field.config;\n};\n//# sourceMappingURL=capability.js.map","export default function sum(values, valueof) {\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n sum += value;\n }\n }\n }\n return sum;\n}\n","export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","import {min} from \"d3-array\";\n\nfunction targetDepth(d) {\n return d.target.depth;\n}\n\nexport function left(node) {\n return node.depth;\n}\n\nexport function right(node, n) {\n return n - 1 - node.height;\n}\n\nexport function justify(node, n) {\n return node.sourceLinks.length ? node.depth : n - 1;\n}\n\nexport function center(node) {\n return node.targetLinks.length ? node.depth\n : node.sourceLinks.length ? min(node.sourceLinks, targetDepth) - 1\n : 0;\n}\n","export default function constant(x) {\n return function() {\n return x;\n };\n}\n","import {max, min, sum} from \"d3-array\";\nimport {justify} from \"./align.js\";\nimport constant from \"./constant.js\";\n\nfunction ascendingSourceBreadth(a, b) {\n return ascendingBreadth(a.source, b.source) || a.index - b.index;\n}\n\nfunction ascendingTargetBreadth(a, b) {\n return ascendingBreadth(a.target, b.target) || a.index - b.index;\n}\n\nfunction ascendingBreadth(a, b) {\n return a.y0 - b.y0;\n}\n\nfunction value(d) {\n return d.value;\n}\n\nfunction defaultId(d) {\n return d.index;\n}\n\nfunction defaultNodes(graph) {\n return graph.nodes;\n}\n\nfunction defaultLinks(graph) {\n return graph.links;\n}\n\nfunction find(nodeById, id) {\n const node = nodeById.get(id);\n if (!node) throw new Error(\"missing: \" + id);\n return node;\n}\n\nfunction computeLinkBreadths({nodes}) {\n for (const node of nodes) {\n let y0 = node.y0;\n let y1 = y0;\n for (const link of node.sourceLinks) {\n link.y0 = y0 + link.width / 2;\n y0 += link.width;\n }\n for (const link of node.targetLinks) {\n link.y1 = y1 + link.width / 2;\n y1 += link.width;\n }\n }\n}\n\nexport default function Sankey() {\n let x0 = 0, y0 = 0, x1 = 1, y1 = 1; // extent\n let dx = 24; // nodeWidth\n let dy = 8, py; // nodePadding\n let id = defaultId;\n let align = justify;\n let sort;\n let linkSort;\n let nodes = defaultNodes;\n let links = defaultLinks;\n let iterations = 6;\n\n function sankey() {\n const graph = {nodes: nodes.apply(null, arguments), links: links.apply(null, arguments)};\n computeNodeLinks(graph);\n computeNodeValues(graph);\n computeNodeDepths(graph);\n computeNodeHeights(graph);\n computeNodeBreadths(graph);\n computeLinkBreadths(graph);\n return graph;\n }\n\n sankey.update = function(graph) {\n computeLinkBreadths(graph);\n return graph;\n };\n\n sankey.nodeId = function(_) {\n return arguments.length ? (id = typeof _ === \"function\" ? _ : constant(_), sankey) : id;\n };\n\n sankey.nodeAlign = function(_) {\n return arguments.length ? (align = typeof _ === \"function\" ? _ : constant(_), sankey) : align;\n };\n\n sankey.nodeSort = function(_) {\n return arguments.length ? (sort = _, sankey) : sort;\n };\n\n sankey.nodeWidth = function(_) {\n return arguments.length ? (dx = +_, sankey) : dx;\n };\n\n sankey.nodePadding = function(_) {\n return arguments.length ? (dy = py = +_, sankey) : dy;\n };\n\n sankey.nodes = function(_) {\n return arguments.length ? (nodes = typeof _ === \"function\" ? _ : constant(_), sankey) : nodes;\n };\n\n sankey.links = function(_) {\n return arguments.length ? (links = typeof _ === \"function\" ? _ : constant(_), sankey) : links;\n };\n\n sankey.linkSort = function(_) {\n return arguments.length ? (linkSort = _, sankey) : linkSort;\n };\n\n sankey.size = function(_) {\n return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], sankey) : [x1 - x0, y1 - y0];\n };\n\n sankey.extent = function(_) {\n return arguments.length ? (x0 = +_[0][0], x1 = +_[1][0], y0 = +_[0][1], y1 = +_[1][1], sankey) : [[x0, y0], [x1, y1]];\n };\n\n sankey.iterations = function(_) {\n return arguments.length ? (iterations = +_, sankey) : iterations;\n };\n\n function computeNodeLinks({nodes, links}) {\n for (const [i, node] of nodes.entries()) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n }\n const nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d]));\n for (const [i, link] of links.entries()) {\n link.index = i;\n let {source, target} = link;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n }\n if (linkSort != null) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(linkSort);\n targetLinks.sort(linkSort);\n }\n }\n }\n\n function computeNodeValues({nodes}) {\n for (const node of nodes) {\n node.value = node.fixedValue === undefined\n ? Math.max(sum(node.sourceLinks, value), sum(node.targetLinks, value))\n : node.fixedValue;\n }\n }\n\n function computeNodeDepths({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.depth = x;\n for (const {target} of node.sourceLinks) {\n next.add(target);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeHeights({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.height = x;\n for (const {source} of node.targetLinks) {\n next.add(source);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeLayers({nodes}) {\n const x = max(nodes, d => d.depth) + 1;\n const kx = (x1 - x0 - dx) / (x - 1);\n const columns = new Array(x);\n for (const node of nodes) {\n const i = Math.max(0, Math.min(x - 1, Math.floor(align.call(null, node, x))));\n node.layer = i;\n node.x0 = x0 + i * kx;\n node.x1 = node.x0 + dx;\n if (columns[i]) columns[i].push(node);\n else columns[i] = [node];\n }\n if (sort) for (const column of columns) {\n column.sort(sort);\n }\n return columns;\n }\n\n function initializeNodeBreadths(columns) {\n const ky = min(columns, c => (y1 - y0 - (c.length - 1) * py) / sum(c, value));\n for (const nodes of columns) {\n let y = y0;\n for (const node of nodes) {\n node.y0 = y;\n node.y1 = y + node.value * ky;\n y = node.y1 + py;\n for (const link of node.sourceLinks) {\n link.width = link.value * ky;\n }\n }\n y = (y1 - y + py) / (nodes.length + 1);\n for (let i = 0; i < nodes.length; ++i) {\n const node = nodes[i];\n node.y0 += y * (i + 1);\n node.y1 += y * (i + 1);\n }\n reorderLinks(nodes);\n }\n }\n\n function computeNodeBreadths(graph) {\n const columns = computeNodeLayers(graph);\n py = Math.min(dy, (y1 - y0) / (max(columns, c => c.length) - 1));\n initializeNodeBreadths(columns);\n for (let i = 0; i < iterations; ++i) {\n const alpha = Math.pow(0.99, i);\n const beta = Math.max(1 - alpha, (i + 1) / iterations);\n relaxRightToLeft(columns, alpha, beta);\n relaxLeftToRight(columns, alpha, beta);\n }\n }\n\n // Reposition each node based on its incoming (target) links.\n function relaxLeftToRight(columns, alpha, beta) {\n for (let i = 1, n = columns.length; i < n; ++i) {\n const column = columns[i];\n for (const target of column) {\n let y = 0;\n let w = 0;\n for (const {source, value} of target.targetLinks) {\n let v = value * (target.layer - source.layer);\n y += targetTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - target.y0) * alpha;\n target.y0 += dy;\n target.y1 += dy;\n reorderNodeLinks(target);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n // Reposition each node based on its outgoing (source) links.\n function relaxRightToLeft(columns, alpha, beta) {\n for (let n = columns.length, i = n - 2; i >= 0; --i) {\n const column = columns[i];\n for (const source of column) {\n let y = 0;\n let w = 0;\n for (const {target, value} of source.sourceLinks) {\n let v = value * (target.layer - source.layer);\n y += sourceTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - source.y0) * alpha;\n source.y0 += dy;\n source.y1 += dy;\n reorderNodeLinks(source);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n function resolveCollisions(nodes, alpha) {\n const i = nodes.length >> 1;\n const subject = nodes[i];\n resolveCollisionsBottomToTop(nodes, subject.y0 - py, i - 1, alpha);\n resolveCollisionsTopToBottom(nodes, subject.y1 + py, i + 1, alpha);\n resolveCollisionsBottomToTop(nodes, y1, nodes.length - 1, alpha);\n resolveCollisionsTopToBottom(nodes, y0, 0, alpha);\n }\n\n // Push any overlapping nodes down.\n function resolveCollisionsTopToBottom(nodes, y, i, alpha) {\n for (; i < nodes.length; ++i) {\n const node = nodes[i];\n const dy = (y - node.y0) * alpha;\n if (dy > 1e-6) node.y0 += dy, node.y1 += dy;\n y = node.y1 + py;\n }\n }\n\n // Push any overlapping nodes up.\n function resolveCollisionsBottomToTop(nodes, y, i, alpha) {\n for (; i >= 0; --i) {\n const node = nodes[i];\n const dy = (node.y1 - y) * alpha;\n if (dy > 1e-6) node.y0 -= dy, node.y1 -= dy;\n y = node.y0 - py;\n }\n }\n\n function reorderNodeLinks({sourceLinks, targetLinks}) {\n if (linkSort === undefined) {\n for (const {source: {sourceLinks}} of targetLinks) {\n sourceLinks.sort(ascendingTargetBreadth);\n }\n for (const {target: {targetLinks}} of sourceLinks) {\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n function reorderLinks(nodes) {\n if (linkSort === undefined) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(ascendingTargetBreadth);\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n // Returns the target.y0 that would produce an ideal link from source to target.\n function targetTop(source, target) {\n let y = source.y0 - (source.sourceLinks.length - 1) * py / 2;\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y += width + py;\n }\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y -= width;\n }\n return y;\n }\n\n // Returns the source.y0 that would produce an ideal link from source to target.\n function sourceTop(source, target) {\n let y = target.y0 - (target.targetLinks.length - 1) * py / 2;\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y += width + py;\n }\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y -= width;\n }\n return y;\n }\n\n return sankey;\n}\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export var slice = Array.prototype.slice;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import {path} from \"d3-path\";\nimport {slice} from \"../array.js\";\nimport constant from \"../constant.js\";\nimport {x as pointX, y as pointY} from \"../point.js\";\nimport pointRadial from \"../pointRadial.js\";\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nfunction link(curve) {\n var source = linkSource,\n target = linkTarget,\n x = pointX,\n y = pointY,\n context = null;\n\n function link() {\n var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);\n if (!context) context = buffer = path();\n curve(context, +x.apply(this, (argv[0] = s, argv)), +y.apply(this, argv), +x.apply(this, (argv[0] = t, argv)), +y.apply(this, argv));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), link) : x;\n };\n\n link.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), link) : y;\n };\n\n link.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), link) : context;\n };\n\n return link;\n}\n\nfunction curveHorizontal(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);\n}\n\nfunction curveVertical(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1);\n}\n\nfunction curveRadial(context, x0, y0, x1, y1) {\n var p0 = pointRadial(x0, y0),\n p1 = pointRadial(x0, y0 = (y0 + y1) / 2),\n p2 = pointRadial(x1, y0),\n p3 = pointRadial(x1, y1);\n context.moveTo(p0[0], p0[1]);\n context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);\n}\n\nexport function linkHorizontal() {\n return link(curveHorizontal);\n}\n\nexport function linkVertical() {\n return link(curveVertical);\n}\n\nexport function linkRadial() {\n var l = link(curveRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n","import {linkHorizontal} from \"d3-shape\";\n\nfunction horizontalSource(d) {\n return [d.source.x1, d.y0];\n}\n\nfunction horizontalTarget(d) {\n return [d.target.x0, d.y1];\n}\n\nexport default function() {\n return linkHorizontal()\n .source(horizontalSource)\n .target(horizontalTarget);\n}\n","// import * as d3 from 'd3';\nimport React from 'react';\nimport * as d3Sankey from 'd3-sankey';\n\ninterface LinkProps {\n data: any;\n panelId: any;\n}\n\n/**\n * Create Sankey links\n *\n * @param data is the link data produced by calling the d3-sankey function\n * @return {*} the sankey link\n */\nexport const Link: React.FC = ({ data, panelId }) => {\n const link: any = d3Sankey.sankeyLinkHorizontal();\n // const strokeColor = '#4ec1e0';\n const strokeColor = data.color;\n const id = `${panelId}-${data.id}`;\n\n return (\n <>\n \n \n );\n};\n","import React from 'react';\n\ninterface NodeProps {\n data: any;\n textColor: string;\n nodeColor: string;\n panelId: any;\n}\n\n/**\n * Create Sankey rectangular nodes with labels\n *\n * @param data is the node data produced by calling the d3-sankey function\n * @param textColor is set in the editor panel, the color of the node label text\n * @param nodeColor is set in the editor panel, the fill color of the nodes\n * @return {*} the node and its label\n */\nexport const Node: React.FC = ({ data, textColor, nodeColor, panelId }) => {\n let x0 = data.x0;\n let x1 = data.x1;\n let y0 = data.y0;\n let y1 = data.y1;\n let index = data.index;\n let name = data.name;\n let value = data.value;\n\n const width = x1 - x0;\n const strokeColor = 'black';\n\n return (\n <>\n \n \n {name}\n \n \n );\n};\n","import React, { useEffect, useState } from 'react';\nimport * as d3 from 'd3';\n\ninterface TooltipProps {\n rowNames: any;\n field: any;\n}\n\nexport const Tooltip: React.FC = ({ rowNames, field }) => {\n // get mouse position for tooltip position\n const [mousePosition, setMousePosition] = useState({ mouseX: 100, mouseY: 100 });\n\n const updateMousePosition = (e: any) => {\n setMousePosition({ mouseX: e.clientX, mouseY: e.clientY });\n };\n\n useEffect(() => {\n window.addEventListener('mousemove', updateMousePosition);\n\n // Links Tooltip\n d3.selectAll('path')\n .on('mouseover', function (event: any, d: any) {\n let id = d3.select(this).attr('id');\n let row = id.split('-');\n let name = rowNames.find((e: any) => e.name === row[1]).display;\n\n // paths: selected opacity -> 1, all else -> 0.2\n d3.selectAll('path').each(function (d) {\n var thisId = d3.select(this).attr('id');\n var dark = id === thisId;\n d3.select(this).attr('opacity', dark ? 1 : 0.4);\n });\n var thisId = d3.select(this).attr('id');\n var div = d3\n .select('body')\n .append('div')\n .attr('class', `tooltip-${thisId}`)\n .html(() => {\n var textVal = d3.select(this).attr('display');\n var text = `${name}
${textVal}`;\n return text;\n })\n .style('padding', '10px 15px')\n .style('background', 'black')\n .style('color', 'white')\n .style('border', '#A8A8A8 solid 5px')\n .style('border-radius', '5px')\n .style('left', mousePosition.mouseX + 'px')\n .style('top', mousePosition.mouseY + 'px')\n .style('opacity', 0)\n .style('position', 'absolute');\n div.transition().duration(200).style('opacity', 0.8);\n })\n .on('mouseout', function (d) {\n var thisId = d3.select(this).attr('id');\n d3.selectAll(`.tooltip-${thisId}`).transition().duration(300).remove();\n d3.selectAll('path').attr('opacity', 0.7);\n });\n\n // Nodes Tooltip\n d3.selectAll('rect')\n .on('mouseover', function (event: any, d: any) {\n let id = d3.select(this).attr('id').split(',');\n let panelId = id[0];\n let rowList: string[] = [];\n id.forEach((e) => {\n rowList.push(`${panelId}-${e}`);\n });\n d3.selectAll('path').each(function (d) {\n var thisId = d3.select(this).attr('id');\n var found = rowList.find((e) => e === thisId);\n d3.select(this).attr('opacity', found ? 1 : 0.2);\n });\n\n var thisNode = d3.select(this).attr('data-index');\n var div = d3\n .select('body')\n .append('div')\n .attr('class', `tooltip-node${thisNode}`)\n .html(() => {\n var textVal = field.display(d3.select(this).attr('d'));\n var name = d3.select(this).attr('name');\n var text = `${name}: ${textVal.text} ${textVal.suffix}`;\n return text;\n })\n .style('padding', '10px 15px')\n .style('background', 'black')\n .style('color', 'white')\n .style('border', '#A8A8A8 solid 5px')\n .style('border-radius', '5px')\n .style('left', mousePosition.mouseX + 'px')\n .style('top', mousePosition.mouseY + 'px')\n .style('opacity', 0)\n .style('position', 'absolute');\n div.transition().duration(200).style('opacity', 0.8);\n })\n .on('mouseout', function (d) {\n var thisNode = d3.select(this).attr('data-index');\n d3.selectAll(`.tooltip-node${thisNode}`).transition().duration(300).remove();\n d3.selectAll('path').attr('opacity', 0.7);\n });\n\n return () => {\n window.removeEventListener('mousemove', updateMousePosition);\n };\n });\n return null;\n};\n","import React, { useEffect } from 'react';\nimport * as d3 from 'd3';\n\ninterface HeaderProps {\n displayNames: any;\n width: any;\n id: any;\n topMargin: number;\n textColor: string;\n}\n\nexport const Headers: React.FC = ({ displayNames, width, id, topMargin, textColor }) => {\n useEffect(() => {\n //clear old headers\n d3.select('#' + id)\n .selectAll('.header-text')\n .remove();\n\n var head = d3\n .select('#' + id)\n .append('g')\n .attr('id', `${id} header`);\n var MARGIN = { top: topMargin, right: 20, bottom: 50, left: 20 };\n\n var translateY = MARGIN.top / 2;\n\n // Add left and right axis labels\n head\n .append('text')\n .attr('class', 'header-text')\n .attr('transform', 'translate(' + MARGIN.left + ',' + translateY + ')') // above left axis\n .attr('font-size', '14pt')\n .attr('font-weight', '500')\n .attr('text-anchor', 'start')\n .text(displayNames[0])\n .attr('fill', textColor);\n\n head\n .append('text')\n .attr('class', 'header-text')\n .attr('transform', 'translate(' + (width + MARGIN.left) + ',' + translateY + ')') // above right axis\n .attr('font-size', '14pt')\n .attr('font-weight', '500')\n .attr('text-anchor', 'end')\n .text(displayNames[displayNames.length - 2]) // last one is value label\n .attr('fill', textColor);\n\n if (displayNames.length > 3) {\n const colWidth = width / (displayNames.length - 2);\n for (let i = 1; i < displayNames.length - 2; i++) {\n let translateX = colWidth * i + MARGIN.left;\n head\n .append('text')\n .attr('class', 'header-text')\n .attr('transform', `translate(${translateX},${translateY})`)\n .attr('font-size', '14pt')\n .attr('font-weight', '500')\n .attr('text-anchor', 'middle')\n .text(displayNames[i])\n .attr('fill', textColor);\n }\n }\n });\n\n return null;\n};\n","import React from 'react';\nimport { Link } from './Link';\nimport { Node } from './Node';\nimport * as d3Sankey from 'd3-sankey';\nimport { Tooltip } from './Tooltip';\nimport { Headers } from './Headers';\n\n// import '../css/styles.css';\n\ninterface SankeyProps {\n data: any;\n width: number;\n height: number;\n displayNames: any;\n rowDisplayNames: any;\n id: any;\n textColor: string;\n nodeColor: string;\n field: any;\n nodeWidth: number;\n nodePadding: number;\n iteration: number;\n}\n\n/**\n * The sankey graph\n */\nexport const Sankey: React.FC = ({\n data,\n width,\n height,\n displayNames,\n rowDisplayNames,\n id,\n textColor,\n nodeColor,\n field,\n nodeWidth,\n nodePadding,\n iteration,\n}) => {\n const MARGIN = { top: 75, bottom: 50, right: 20, left: 20 };\n const graphWidth = width - MARGIN.left - MARGIN.right;\n const graphHeight = height - MARGIN.top - MARGIN.bottom;\n const sankey: any = d3Sankey\n .sankey()\n .iterations(iteration)\n .nodeWidth(nodeWidth)\n .nodePadding(nodePadding)\n .extent([\n [0, 0],\n [graphWidth, graphHeight],\n ]);\n\n // Return an SVG group only if data exists\n if (data) {\n const { links, nodes } = sankey(data);\n\n return (\n \n \n \n \n {links.map((d: { width: any }, i: any) => (\n \n ))}\n \n \n {nodes.map((d: { index: any; x0: any; x1: any; y0: any; y1: any; name: any; value: any }, i: any) => (\n \n ))}\n \n \n );\n }\n return

;\n};\n","import { PanelPlugin, FieldConfigProperty } from '@grafana/data';\nimport { standardOptionsCompat } from 'grafana-plugin-support';\nimport { SankeyOptions } from './types';\nimport { SankeyPanel } from './SankeyPanel';\n\n// import { standardOptionsCompat } from 'grafana-plugin-support';\n\n/**\n * Grafana panel plugin main module\n *\n * @param {*} { panel: React.ComponentType> | null }\n * @return {*} { builder: PanelOptionsEditorBuilder }\n */\nconst buildStandardOptions = (): any => {\n const options = [\n FieldConfigProperty.Decimals,\n FieldConfigProperty.Unit,\n // FieldConfigProperty.Color,\n ];\n\n return standardOptionsCompat(options);\n};\n\nconst monochromeBool = (monochrome: boolean) => (config: SankeyOptions) => config.monochrome === monochrome;\n\nexport const plugin = new PanelPlugin(SankeyPanel)\n .setPanelOptions((builder) => {\n builder\n .addBooleanSwitch({\n path: 'monochrome',\n name: 'Single Link color only',\n defaultValue: false,\n })\n .addColorPicker({\n path: 'color',\n name: 'Link Color',\n showIf: monochromeBool(true),\n defaultValue: 'blue',\n })\n .addColorPicker({\n path: 'textColor',\n name: 'Text color',\n defaultValue: 'black',\n })\n .addColorPicker({\n path: 'nodeColor',\n name: 'Node color',\n defaultValue: 'grey',\n })\n .addSliderInput({\n path: 'nodeWidth',\n name: 'Node width',\n defaultValue: 30,\n settings: {\n min: 5,\n max: 100,\n step: 1,\n },\n })\n .addSliderInput({\n path: 'nodePadding',\n name: 'Node padding',\n defaultValue: 30,\n settings: {\n min: 1,\n max: 100,\n step: 1,\n },\n })\n .addSliderInput({\n path: 'iteration',\n name: 'Layout iterations',\n defaultValue: 7,\n settings: {\n min: 1,\n max: 30,\n step: 1,\n },\n });\n })\n .useFieldConfig({\n standardOptions: buildStandardOptions(),\n });\n","import React from 'react';\n// import React, { useRef } from 'react';\nimport { PanelProps } from '@grafana/data';\nimport { SankeyOptions } from 'types';\nimport { parseData } from 'dataParser';\nimport { Sankey } from './components/Sankey';\n// import * as d3 from 'd3';\n// import * as d3Sankey from 'd3-sankey';\n\ninterface Props extends PanelProps {}\n/**\n * Grafana Sankey diagram panel\n *\n * @param {*} { options, data, width, height, id }\n * @return {*} { Sankey } the Sankey graph\n */\nexport const SankeyPanel: React.FC = ({ options, data, width, height, id }: any): any => {\n let graphOptions = {\n ...options,\n };\n /**\n * Feed data and options into data parser.\n * @param {*} { data, options }\n * @returns [ parsedData, displayNames ]\n */\n var parsedData: any[] = [];\n try {\n parsedData = parseData(data, options, graphOptions.monochrome, graphOptions.color);\n } catch (error) {\n console.error('parsing error: ', error);\n }\n const displayNames = parsedData[1];\n const pluginData = parsedData[0];\n const rowDisplayNames = parsedData[2];\n const field = parsedData[3];\n const fixColor = parsedData[4];\n const textColor = fixColor(graphOptions.textColor);\n const nodeColor = fixColor(graphOptions.nodeColor);\n\n return (\n \n \n \n );\n};\n","import { DataFrameView, Field, getFieldDisplayName, Vector } from '@grafana/data';\n// import { color } from 'd3';\n/**\n * Takes data from Grafana query and returns it in the format needed for this panel\n *\n * @param data the data returned by the query\n * @param options the field options from the editor panel\n * @param monochrome the boolean in the editor panel that sets whether the sankey is single or multi colored\n * @param color the color chosen in the editor panel for the sankey links if monochrome bool is true\n * @return {pluginData} the node and link data for the d3-sankey\n * @return {displayNames} the display names for the headers\n * @return {rowDisplayNames}\n * @return {valueField[0]}\n */\nexport function parseData(data: { series: any[] }, options: { valueFieldName: any }, monochrome: boolean, color: any) {\n const { valueFieldName } = options;\n\n /**\n * Colors\n * if monochrome = true, set all colors to value: color\n * else, set to multi color\n */\n\n function fixColor(color: string) {\n switch (color) {\n case 'dark-green':\n color = '#1A7311';\n break;\n case 'semi-dark-green':\n color = '#36872D';\n break;\n case 'light-green':\n color = '#73BF68';\n break;\n case 'super-light-green':\n color = '#96D88C';\n break;\n case 'dark-yellow':\n color = 'rgb(207, 159, 0)';\n break;\n case 'semi-dark-yellow':\n color = 'rgb(224, 180, 0)';\n break;\n case 'light-yellow':\n color = 'rgb(250, 222, 42)';\n break;\n case 'super-light-yellow':\n color = 'rgb(255, 238, 82)';\n break;\n case 'dark-red':\n color = 'rgb(173, 3, 23)';\n break;\n case 'semi-dark-red':\n color = 'rgb(196, 22, 42)';\n break;\n case 'light-red':\n color = 'rgb(242, 73, 92)';\n break;\n case 'super-light-red':\n color = 'rgb(255, 115, 131)';\n break;\n case 'dark-blue':\n color = 'rgb(18, 80, 176)';\n break;\n case 'semi-dark-blue':\n color = 'rgb(31, 96, 196)';\n break;\n case 'light-blue':\n color = 'rgb(87, 148, 242)';\n break;\n case 'super-light-blue':\n color = 'rgb(138, 184, 255)';\n break;\n case 'dark-orange':\n color = 'rgb(229, 84, 0)';\n break;\n case 'semi-dark-orange':\n color = 'rgb(250, 100, 0)';\n break;\n case 'light-orange':\n color = 'rgb(255, 152, 48)';\n break;\n case 'super-light-orange':\n color = 'rgb(255, 179, 87)';\n break;\n case 'dark-purple':\n color = 'rgb(124, 46, 163)';\n break;\n case 'semi-dark-purple':\n color = 'rgb(143, 59, 184)';\n break;\n case 'light-purple':\n color = 'rgb(184, 119, 217)';\n break;\n case 'super-light-purple':\n color = 'rgb(202, 149, 229)';\n break;\n default:\n break;\n }\n return color;\n }\n\n const colorArray: string[] = [];\n\n if (monochrome) {\n colorArray.push(fixColor(color));\n // colorArray.push(color);\n } else {\n colorArray.push('#018EDB');\n colorArray.push('#DB8500');\n colorArray.push('#7C00DB');\n colorArray.push('#DB0600');\n colorArray.push('#00DB57');\n }\n\n var allData = data.series[0].fields;\n var numFields = allData.length - 1;\n\n // add data checker. are there enough fields?\n\n // get display names\n let displayNames: string[] = [];\n allData.forEach((field: Field>) => {\n displayNames.push(getFieldDisplayName(field));\n });\n\n // Find selected value field or default to the first number field and use for values.\n const valueField = valueFieldName\n ? data.series.map((series: { fields: any[] }) =>\n series.fields.find((field: { name: any }) => field.name === valueFieldName)\n )\n : data.series.map((series: { fields: any[] }) =>\n series.fields.find((field: { type: string }) => field.type === 'number')\n );\n\n let values = [];\n valueField[0].values.buffer.map((value: any) => {\n values.push([value, valueField[0].display(value), valueField[0].name]);\n });\n // display converts value to display value with units\n // name = name of field\n\n const series = data.series[0];\n const frame = new DataFrameView(series);\n\n // initialize arrays\n let pluginDataLinks: Array<{\n source: number;\n target: number;\n value: number;\n displayValue: any;\n id: string;\n color: any;\n node0: any;\n }> = [];\n let pluginDataNodes: Array<{ name: any; id: any; colId: number }> = [];\n let col0: Array<{ name: any; index: number; color: any }> = [];\n let rowDisplayNames: Array<{ name: any; display: any }> = [];\n\n var rowId = 0; // update after each row\n var currentColor;\n\n // Retrieve panel data from panel\n frame.forEach((row) => {\n let currentLink: number[] = [];\n // go through columns to find all nodes\n for (let i = 0; i < numFields; i++) {\n let node = row[i];\n let index = pluginDataNodes.findIndex((e) => e.name === node && e.colId === i);\n if (index === -1) {\n index = pluginDataNodes.push({ name: node, id: [`row${rowId}`], colId: i }) - 1;\n if (i === 0) {\n currentColor = colorArray[col0.length % colorArray.length];\n col0.push({ name: node, index: index, color: currentColor });\n }\n } else {\n pluginDataNodes[index].id.push(`row${rowId}`); // might not need?\n }\n currentLink.push(index);\n }\n // create all the individual links, value is always the last column\n // let rowColor = colorArray[currentLink[0] % colorArray.length];\n let rowColor = col0.find((e) => e.index === currentLink[0])?.color;\n let rowDisplay = `${pluginDataNodes[currentLink[0]].name}`;\n for (let i = 0; i < currentLink.length - 1; i++) {\n var fieldValues = valueField[0].display(row[numFields]);\n var displayValue = `${fieldValues.text} ${fieldValues.suffix}`;\n pluginDataLinks.push({\n source: currentLink[i],\n target: currentLink[i + 1],\n value: row[numFields],\n displayValue: displayValue,\n id: `row${rowId}`,\n color: rowColor,\n node0: currentLink[0],\n });\n rowDisplay = rowDisplay.concat(` -> ${pluginDataNodes[currentLink[i + 1]].name}`);\n }\n rowDisplayNames.push({ name: `row${rowId}`, display: rowDisplay });\n rowId++;\n });\n const pluginData = { links: pluginDataLinks, nodes: pluginDataNodes };\n\n return [pluginData, displayNames, rowDisplayNames, valueField[0], fixColor];\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"d3\"","webpack:///external \"react\"","webpack:///external \"@grafana/data\"","webpack:///external \"@grafana/ui\"","webpack:///../node_modules/tslib/tslib.es6.js","webpack:///../node_modules/d3-sankey/node_modules/d3-array/src/sum.js","webpack:///../node_modules/d3-sankey/node_modules/d3-array/src/max.js","webpack:///../node_modules/d3-sankey/node_modules/d3-array/src/min.js","webpack:///../node_modules/d3-sankey/src/align.js","webpack:///../node_modules/d3-sankey/src/constant.js","webpack:///../node_modules/d3-sankey/src/sankey.js","webpack:///../node_modules/d3-path/src/path.js","webpack:///../node_modules/d3-shape/src/array.js","webpack:///../node_modules/d3-shape/src/constant.js","webpack:///../node_modules/d3-shape/src/point.js","webpack:///../node_modules/d3-shape/src/link/index.js","webpack:///../node_modules/d3-sankey/src/sankeyLinkHorizontal.js","webpack:///./components/Link.tsx","webpack:///./components/Node.tsx","webpack:///./components/Tooltip.tsx","webpack:///./components/Headers.tsx","webpack:///./components/Sankey.tsx","webpack:///./module.ts","webpack:///./SankeyPanel.tsx","webpack:///./dataParser.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","__WEBPACK_EXTERNAL_MODULE__0__","__WEBPACK_EXTERNAL_MODULE__1__","__WEBPACK_EXTERNAL_MODULE__2__","__WEBPACK_EXTERNAL_MODULE__3__","__assign","assign","arguments","length","apply","this","__read","iterator","e","ar","next","done","push","error","sum","values","valueof","undefined","index","max","min","justify","node","sourceLinks","depth","constant","x","ascendingSourceBreadth","a","b","ascendingBreadth","source","ascendingTargetBreadth","target","y0","defaultId","defaultNodes","graph","nodes","defaultLinks","links","find","nodeById","id","Error","computeLinkBreadths","y1","link","width","targetLinks","py","sort","linkSort","x0","x1","dx","dy","align","iterations","sankey","computeNodeLinks","computeNodeValues","computeNodeDepths","computeNodeHeights","computeNodeBreadths","entries","Map","map","fixedValue","Math","current","Set","size","add","height","columns","kx","Array","floor","layer","column","computeNodeLayers","ky","y","reorderLinks","initializeNodeBreadths","alpha","pow","beta","relaxRightToLeft","relaxLeftToRight","w","v","targetTop","reorderNodeLinks","resolveCollisions","sourceTop","subject","resolveCollisionsBottomToTop","resolveCollisionsTopToBottom","update","nodeId","_","nodeAlign","nodeSort","nodeWidth","nodePadding","extent","pi","PI","tau","tauEpsilon","Path","_x0","_y0","_x1","_y1","path","constructor","moveTo","closePath","lineTo","quadraticCurveTo","bezierCurveTo","x2","y2","arcTo","x21","y21","x01","y01","l01_2","abs","x20","y20","l21_2","l20_2","l21","sqrt","l01","tan","acos","t01","t21","arc","a0","a1","ccw","cos","sin","cw","da","rect","h","toString","slice","linkSource","linkTarget","curve","context","buffer","argv","curveHorizontal","horizontalSource","horizontalTarget","data","panelId","strokeColor","color","fill","stroke","strokeOpacity","opacity","strokeWidth","display","displayValue","textColor","nodeColor","theme","fontSize","typography","rx","ry","style","alignmentBaseline","textAnchor","pointerEvents","userSelect","rowNames","field","mouseX","mouseY","mousePosition","setMousePosition","updateMousePosition","clientX","clientY","window","addEventListener","on","event","attr","row","split","each","thisId","dark","append","html","textVal","transition","duration","remove","rowList","forEach","found","thisNode","suffix","text","removeEventListener","displayNames","topMargin","selectAll","head","MARGIN","translateY","colWidth","translateX","rowDisplayNames","iteration","graphWidth","graphHeight","transform","options","graphOptions","parsedData","monochrome","valueFieldName","fixColor","colorArray","allData","series","fields","numFields","valueField","type","currentColor","frame","pluginDataLinks","pluginDataNodes","col0","rowId","currentLink","findIndex","colId","rowColor","rowDisplay","fieldValues","node0","concat","parseData","pluginData","colors","primary","setPanelOptions","builder","addBooleanSwitch","defaultValue","addColorPicker","showIf","config","addSliderInput","settings","step","useFieldConfig","disableStandardOptions","NoValue","Max","Min","DisplayName","standardOptions","Color","byValueSupport","bySeriesSupport","preferThresholdsMode"],"mappings":";0FACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,E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GAEtB3D,EAAYE,EAAMoF,OAAO5C,KAAK6C,QAC9BtF,EAAY6D,EAASJ,EAAazD,WAExC,OACE,2BACE,kBAAC,EAAM,CACLZ,KAAMgG,EACNzC,aAAcA,EACdQ,gBAAiBA,EACjBpL,MAAOA,EACP0B,OAAQA,EACR/B,GAAIA,EACJqI,UAAWA,EACXC,UAAWA,EACXY,MAAOA,EACPpF,UAAWiI,EAAajI,UACxBC,YAAagI,EAAahI,YAC1B2H,UAAWK,EAAaL,gBDtC7BmC,iBAAgB,SAACC,GAHG,IAAC7B,EAIpB6B,EACGC,iBAAiB,CAChBrJ,KAAM,aACNlJ,KAAM,yBACNwS,cAAc,IAEfC,eAAe,CACdvJ,KAAM,QACNlJ,KAAM,aACN0S,QAbgBjC,GAaO,EAbiB,SAACkC,GAA0B,OAAAA,EAAOlC,aAAP,IAcnE+B,aAAc,SAEfC,eAAe,CACdvJ,KAAM,YACNlJ,KAAM,aACNwS,aAAc,SAEfI,eAAe,CACd1J,KAAM,YACNlJ,KAAM,aACNwS,aAAc,GACdK,SAAU,CACR5P,IAAK,EACLD,IAAK,IACL8P,KAAM,KAGTF,eAAe,CACd1J,KAAM,cACNlJ,KAAM,eACNwS,aAAc,GACdK,SAAU,CACR5P,IAAK,EACLD,IAAK,IACL8P,KAAM,KAGTF,eAAe,CACd1J,KAAM,YACNlJ,KAAM,oBACNwS,aAAc,EACdK,SAAU,CACR5P,IAAK,EACLD,IAAK,GACL8P,KAAM,QAIbC,eAAe,CACdC,uBAAwB,CACtB,sBAAoBC,QACpB,sBAAoBC,IACpB,sBAAoBC,IACpB,sBAAoBC,aAEtBC,iBAAe,KACb,EAAC,sBAAoBC,OAAQ,CAC3BT,SAAU,CACRU,gBAAgB,EAChBC,iBAAiB,EACjBC,sBAAsB,IAG3B","file":"module.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","module.exports = __WEBPACK_EXTERNAL_MODULE__2__;","module.exports = __WEBPACK_EXTERNAL_MODULE__3__;","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","export default function sum(values, valueof) {\n let sum = 0;\n if (valueof === undefined) {\n for (let value of values) {\n if (value = +value) {\n sum += value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if (value = +valueof(value, ++index, values)) {\n sum += value;\n }\n }\n }\n return sum;\n}\n","export default function max(values, valueof) {\n let max;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (max < value || (max === undefined && value >= value))) {\n max = value;\n }\n }\n }\n return max;\n}\n","export default function min(values, valueof) {\n let min;\n if (valueof === undefined) {\n for (const value of values) {\n if (value != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null\n && (min > value || (min === undefined && value >= value))) {\n min = value;\n }\n }\n }\n return min;\n}\n","import {min} from \"d3-array\";\n\nfunction targetDepth(d) {\n return d.target.depth;\n}\n\nexport function left(node) {\n return node.depth;\n}\n\nexport function right(node, n) {\n return n - 1 - node.height;\n}\n\nexport function justify(node, n) {\n return node.sourceLinks.length ? node.depth : n - 1;\n}\n\nexport function center(node) {\n return node.targetLinks.length ? node.depth\n : node.sourceLinks.length ? min(node.sourceLinks, targetDepth) - 1\n : 0;\n}\n","export default function constant(x) {\n return function() {\n return x;\n };\n}\n","import {max, min, sum} from \"d3-array\";\nimport {justify} from \"./align.js\";\nimport constant from \"./constant.js\";\n\nfunction ascendingSourceBreadth(a, b) {\n return ascendingBreadth(a.source, b.source) || a.index - b.index;\n}\n\nfunction ascendingTargetBreadth(a, b) {\n return ascendingBreadth(a.target, b.target) || a.index - b.index;\n}\n\nfunction ascendingBreadth(a, b) {\n return a.y0 - b.y0;\n}\n\nfunction value(d) {\n return d.value;\n}\n\nfunction defaultId(d) {\n return d.index;\n}\n\nfunction defaultNodes(graph) {\n return graph.nodes;\n}\n\nfunction defaultLinks(graph) {\n return graph.links;\n}\n\nfunction find(nodeById, id) {\n const node = nodeById.get(id);\n if (!node) throw new Error(\"missing: \" + id);\n return node;\n}\n\nfunction computeLinkBreadths({nodes}) {\n for (const node of nodes) {\n let y0 = node.y0;\n let y1 = y0;\n for (const link of node.sourceLinks) {\n link.y0 = y0 + link.width / 2;\n y0 += link.width;\n }\n for (const link of node.targetLinks) {\n link.y1 = y1 + link.width / 2;\n y1 += link.width;\n }\n }\n}\n\nexport default function Sankey() {\n let x0 = 0, y0 = 0, x1 = 1, y1 = 1; // extent\n let dx = 24; // nodeWidth\n let dy = 8, py; // nodePadding\n let id = defaultId;\n let align = justify;\n let sort;\n let linkSort;\n let nodes = defaultNodes;\n let links = defaultLinks;\n let iterations = 6;\n\n function sankey() {\n const graph = {nodes: nodes.apply(null, arguments), links: links.apply(null, arguments)};\n computeNodeLinks(graph);\n computeNodeValues(graph);\n computeNodeDepths(graph);\n computeNodeHeights(graph);\n computeNodeBreadths(graph);\n computeLinkBreadths(graph);\n return graph;\n }\n\n sankey.update = function(graph) {\n computeLinkBreadths(graph);\n return graph;\n };\n\n sankey.nodeId = function(_) {\n return arguments.length ? (id = typeof _ === \"function\" ? _ : constant(_), sankey) : id;\n };\n\n sankey.nodeAlign = function(_) {\n return arguments.length ? (align = typeof _ === \"function\" ? _ : constant(_), sankey) : align;\n };\n\n sankey.nodeSort = function(_) {\n return arguments.length ? (sort = _, sankey) : sort;\n };\n\n sankey.nodeWidth = function(_) {\n return arguments.length ? (dx = +_, sankey) : dx;\n };\n\n sankey.nodePadding = function(_) {\n return arguments.length ? (dy = py = +_, sankey) : dy;\n };\n\n sankey.nodes = function(_) {\n return arguments.length ? (nodes = typeof _ === \"function\" ? _ : constant(_), sankey) : nodes;\n };\n\n sankey.links = function(_) {\n return arguments.length ? (links = typeof _ === \"function\" ? _ : constant(_), sankey) : links;\n };\n\n sankey.linkSort = function(_) {\n return arguments.length ? (linkSort = _, sankey) : linkSort;\n };\n\n sankey.size = function(_) {\n return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], sankey) : [x1 - x0, y1 - y0];\n };\n\n sankey.extent = function(_) {\n return arguments.length ? (x0 = +_[0][0], x1 = +_[1][0], y0 = +_[0][1], y1 = +_[1][1], sankey) : [[x0, y0], [x1, y1]];\n };\n\n sankey.iterations = function(_) {\n return arguments.length ? (iterations = +_, sankey) : iterations;\n };\n\n function computeNodeLinks({nodes, links}) {\n for (const [i, node] of nodes.entries()) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n }\n const nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d]));\n for (const [i, link] of links.entries()) {\n link.index = i;\n let {source, target} = link;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n }\n if (linkSort != null) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(linkSort);\n targetLinks.sort(linkSort);\n }\n }\n }\n\n function computeNodeValues({nodes}) {\n for (const node of nodes) {\n node.value = node.fixedValue === undefined\n ? Math.max(sum(node.sourceLinks, value), sum(node.targetLinks, value))\n : node.fixedValue;\n }\n }\n\n function computeNodeDepths({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.depth = x;\n for (const {target} of node.sourceLinks) {\n next.add(target);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeHeights({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.height = x;\n for (const {source} of node.targetLinks) {\n next.add(source);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeLayers({nodes}) {\n const x = max(nodes, d => d.depth) + 1;\n const kx = (x1 - x0 - dx) / (x - 1);\n const columns = new Array(x);\n for (const node of nodes) {\n const i = Math.max(0, Math.min(x - 1, Math.floor(align.call(null, node, x))));\n node.layer = i;\n node.x0 = x0 + i * kx;\n node.x1 = node.x0 + dx;\n if (columns[i]) columns[i].push(node);\n else columns[i] = [node];\n }\n if (sort) for (const column of columns) {\n column.sort(sort);\n }\n return columns;\n }\n\n function initializeNodeBreadths(columns) {\n const ky = min(columns, c => (y1 - y0 - (c.length - 1) * py) / sum(c, value));\n for (const nodes of columns) {\n let y = y0;\n for (const node of nodes) {\n node.y0 = y;\n node.y1 = y + node.value * ky;\n y = node.y1 + py;\n for (const link of node.sourceLinks) {\n link.width = link.value * ky;\n }\n }\n y = (y1 - y + py) / (nodes.length + 1);\n for (let i = 0; i < nodes.length; ++i) {\n const node = nodes[i];\n node.y0 += y * (i + 1);\n node.y1 += y * (i + 1);\n }\n reorderLinks(nodes);\n }\n }\n\n function computeNodeBreadths(graph) {\n const columns = computeNodeLayers(graph);\n py = Math.min(dy, (y1 - y0) / (max(columns, c => c.length) - 1));\n initializeNodeBreadths(columns);\n for (let i = 0; i < iterations; ++i) {\n const alpha = Math.pow(0.99, i);\n const beta = Math.max(1 - alpha, (i + 1) / iterations);\n relaxRightToLeft(columns, alpha, beta);\n relaxLeftToRight(columns, alpha, beta);\n }\n }\n\n // Reposition each node based on its incoming (target) links.\n function relaxLeftToRight(columns, alpha, beta) {\n for (let i = 1, n = columns.length; i < n; ++i) {\n const column = columns[i];\n for (const target of column) {\n let y = 0;\n let w = 0;\n for (const {source, value} of target.targetLinks) {\n let v = value * (target.layer - source.layer);\n y += targetTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - target.y0) * alpha;\n target.y0 += dy;\n target.y1 += dy;\n reorderNodeLinks(target);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n // Reposition each node based on its outgoing (source) links.\n function relaxRightToLeft(columns, alpha, beta) {\n for (let n = columns.length, i = n - 2; i >= 0; --i) {\n const column = columns[i];\n for (const source of column) {\n let y = 0;\n let w = 0;\n for (const {target, value} of source.sourceLinks) {\n let v = value * (target.layer - source.layer);\n y += sourceTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - source.y0) * alpha;\n source.y0 += dy;\n source.y1 += dy;\n reorderNodeLinks(source);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n function resolveCollisions(nodes, alpha) {\n const i = nodes.length >> 1;\n const subject = nodes[i];\n resolveCollisionsBottomToTop(nodes, subject.y0 - py, i - 1, alpha);\n resolveCollisionsTopToBottom(nodes, subject.y1 + py, i + 1, alpha);\n resolveCollisionsBottomToTop(nodes, y1, nodes.length - 1, alpha);\n resolveCollisionsTopToBottom(nodes, y0, 0, alpha);\n }\n\n // Push any overlapping nodes down.\n function resolveCollisionsTopToBottom(nodes, y, i, alpha) {\n for (; i < nodes.length; ++i) {\n const node = nodes[i];\n const dy = (y - node.y0) * alpha;\n if (dy > 1e-6) node.y0 += dy, node.y1 += dy;\n y = node.y1 + py;\n }\n }\n\n // Push any overlapping nodes up.\n function resolveCollisionsBottomToTop(nodes, y, i, alpha) {\n for (; i >= 0; --i) {\n const node = nodes[i];\n const dy = (node.y1 - y) * alpha;\n if (dy > 1e-6) node.y0 -= dy, node.y1 -= dy;\n y = node.y0 - py;\n }\n }\n\n function reorderNodeLinks({sourceLinks, targetLinks}) {\n if (linkSort === undefined) {\n for (const {source: {sourceLinks}} of targetLinks) {\n sourceLinks.sort(ascendingTargetBreadth);\n }\n for (const {target: {targetLinks}} of sourceLinks) {\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n function reorderLinks(nodes) {\n if (linkSort === undefined) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(ascendingTargetBreadth);\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n // Returns the target.y0 that would produce an ideal link from source to target.\n function targetTop(source, target) {\n let y = source.y0 - (source.sourceLinks.length - 1) * py / 2;\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y += width + py;\n }\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y -= width;\n }\n return y;\n }\n\n // Returns the source.y0 that would produce an ideal link from source to target.\n function sourceTop(source, target) {\n let y = target.y0 - (target.targetLinks.length - 1) * py / 2;\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y += width + py;\n }\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y -= width;\n }\n return y;\n }\n\n return sankey;\n}\n","var pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export var slice = Array.prototype.slice;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import {path} from \"d3-path\";\nimport {slice} from \"../array.js\";\nimport constant from \"../constant.js\";\nimport {x as pointX, y as pointY} from \"../point.js\";\nimport pointRadial from \"../pointRadial.js\";\n\nfunction linkSource(d) {\n return d.source;\n}\n\nfunction linkTarget(d) {\n return d.target;\n}\n\nfunction link(curve) {\n var source = linkSource,\n target = linkTarget,\n x = pointX,\n y = pointY,\n context = null;\n\n function link() {\n var buffer, argv = slice.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);\n if (!context) context = buffer = path();\n curve(context, +x.apply(this, (argv[0] = s, argv)), +y.apply(this, argv), +x.apply(this, (argv[0] = t, argv)), +y.apply(this, argv));\n if (buffer) return context = null, buffer + \"\" || null;\n }\n\n link.source = function(_) {\n return arguments.length ? (source = _, link) : source;\n };\n\n link.target = function(_) {\n return arguments.length ? (target = _, link) : target;\n };\n\n link.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), link) : x;\n };\n\n link.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), link) : y;\n };\n\n link.context = function(_) {\n return arguments.length ? ((context = _ == null ? null : _), link) : context;\n };\n\n return link;\n}\n\nfunction curveHorizontal(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);\n}\n\nfunction curveVertical(context, x0, y0, x1, y1) {\n context.moveTo(x0, y0);\n context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1);\n}\n\nfunction curveRadial(context, x0, y0, x1, y1) {\n var p0 = pointRadial(x0, y0),\n p1 = pointRadial(x0, y0 = (y0 + y1) / 2),\n p2 = pointRadial(x1, y0),\n p3 = pointRadial(x1, y1);\n context.moveTo(p0[0], p0[1]);\n context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);\n}\n\nexport function linkHorizontal() {\n return link(curveHorizontal);\n}\n\nexport function linkVertical() {\n return link(curveVertical);\n}\n\nexport function linkRadial() {\n var l = link(curveRadial);\n l.angle = l.x, delete l.x;\n l.radius = l.y, delete l.y;\n return l;\n}\n","import {linkHorizontal} from \"d3-shape\";\n\nfunction horizontalSource(d) {\n return [d.source.x1, d.y0];\n}\n\nfunction horizontalTarget(d) {\n return [d.target.x0, d.y1];\n}\n\nexport default function() {\n return linkHorizontal()\n .source(horizontalSource)\n .target(horizontalTarget);\n}\n","// import * as d3 from 'd3';\nimport React from 'react';\nimport * as d3Sankey from 'd3-sankey';\n\ninterface LinkProps {\n data: any;\n panelId: any;\n}\n\n/**\n * Create Sankey links\n *\n * @param data is the link data produced by calling the d3-sankey function\n * @return {*} the sankey link\n */\nexport const Link: React.FC = ({ data, panelId }) => {\n const link: any = d3Sankey.sankeyLinkHorizontal();\n // const strokeColor = '#4ec1e0';\n const strokeColor = data.color;\n const id = `${panelId}-${data.id}`;\n\n return (\n <>\n \n \n );\n};\n","import React from 'react';\nimport { useTheme2 } from '@grafana/ui';\n\ninterface NodeProps {\n data: any;\n textColor: string;\n nodeColor: string;\n panelId: any;\n}\n\n/**\n * Create Sankey rectangular nodes with labels\n *\n * @param data is the node data produced by calling the d3-sankey function\n * @param textColor is set in the editor panel, the color of the node label text\n * @param nodeColor is set in the editor panel, the fill color of the nodes\n * @return {*} the node and its label\n */\nexport const Node: React.FC = ({ data, textColor, nodeColor, panelId }) => {\n const theme = useTheme2();\n\n let x0 = data.x0;\n let x1 = data.x1;\n let y0 = data.y0;\n let y1 = data.y1;\n let index = data.index;\n let name = data.name;\n let value = data.value;\n\n const width = x1 - x0;\n const strokeColor = 'black';\n const fontSize = theme.typography.fontSize;\n\n return (\n <>\n \n \n {name}\n \n \n );\n};\n","import React, { useEffect, useState } from 'react';\nimport * as d3 from 'd3';\n\ninterface TooltipProps {\n rowNames: any;\n field: any;\n}\n\nexport const Tooltip: React.FC = ({ rowNames, field }) => {\n // get mouse position for tooltip position\n const [mousePosition, setMousePosition] = useState({ mouseX: 100, mouseY: 100 });\n\n const updateMousePosition = (e: any) => {\n setMousePosition({ mouseX: e.clientX, mouseY: e.clientY });\n };\n\n useEffect(() => {\n window.addEventListener('mousemove', updateMousePosition);\n\n // Links Tooltip\n d3.selectAll('path')\n .on('mouseover', function (event: any, d: any) {\n let id = d3.select(this).attr('id');\n let row = id.split('-');\n let name = rowNames.find((e: any) => e.name === row[1]).display;\n\n // paths: selected opacity -> 1, all else -> 0.2\n d3.selectAll('path').each(function (d) {\n var thisId = d3.select(this).attr('id');\n var dark = id === thisId;\n d3.select(this).attr('opacity', dark ? 1 : 0.4);\n });\n var thisId = d3.select(this).attr('id');\n var div = d3\n .select('body')\n .append('div')\n .attr('class', `tooltip-${thisId}`)\n .html(() => {\n var textVal = d3.select(this).attr('display');\n var text = `${name}
${textVal}`;\n return text;\n })\n .style('padding', '10px 15px')\n .style('background', 'black')\n .style('color', 'white')\n .style('border', '#A8A8A8 solid 5px')\n .style('border-radius', '5px')\n .style('left', mousePosition.mouseX + 'px')\n .style('top', mousePosition.mouseY + 'px')\n .style('opacity', 0)\n .style('position', 'absolute');\n div.transition().duration(200).style('opacity', 0.8);\n })\n .on('mouseout', function (d) {\n var thisId = d3.select(this).attr('id');\n d3.selectAll(`.tooltip-${thisId}`).transition().duration(300).remove();\n d3.selectAll('path').attr('opacity', 0.7);\n });\n\n // Nodes Tooltip\n d3.selectAll('rect')\n .on('mouseover', function (event: any, d: any) {\n let id = d3.select(this).attr('id').split(',');\n let panelId = id[0];\n let rowList: string[] = [];\n id.forEach((e) => {\n rowList.push(`${panelId}-${e}`);\n });\n d3.selectAll('path').each(function (d) {\n var thisId = d3.select(this).attr('id');\n var found = rowList.find((e) => e === thisId);\n d3.select(this).attr('opacity', found ? 1 : 0.2);\n });\n\n var thisNode = d3.select(this).attr('data-index');\n var div = d3\n .select('body')\n .append('div')\n .attr('class', `tooltip-node${thisNode}`)\n .html(() => {\n var textVal = field.display(d3.select(this).attr('d'));\n var name = d3.select(this).attr('name');\n var text;\n if (textVal.suffix) {\n text = `${name}: ${textVal.text} ${textVal.suffix}`;\n } else {\n text = `${name}: ${textVal.text}`;\n }\n return text;\n })\n .style('padding', '10px 15px')\n .style('background', 'black')\n .style('color', 'white')\n .style('border', '#A8A8A8 solid 5px')\n .style('border-radius', '5px')\n .style('left', mousePosition.mouseX + 'px')\n .style('top', mousePosition.mouseY + 'px')\n .style('opacity', 0)\n .style('position', 'absolute');\n div.transition().duration(200).style('opacity', 0.8);\n })\n .on('mouseout', function (d) {\n var thisNode = d3.select(this).attr('data-index');\n d3.selectAll(`.tooltip-node${thisNode}`).transition().duration(300).remove();\n d3.selectAll('path').attr('opacity', 0.7);\n });\n\n return () => {\n window.removeEventListener('mousemove', updateMousePosition);\n };\n });\n return null;\n};\n","import React, { useEffect } from 'react';\nimport * as d3 from 'd3';\n\ninterface HeaderProps {\n displayNames: any;\n width: any;\n id: any;\n topMargin: number;\n textColor: string;\n}\n\nexport const Headers: React.FC = ({ displayNames, width, id, topMargin, textColor }) => {\n useEffect(() => {\n //clear old headers\n d3.select('#' + id)\n .selectAll('.header-text')\n .remove();\n\n var head = d3\n .select('#' + id)\n .append('g')\n .attr('id', `${id} header`);\n var MARGIN = { top: topMargin, right: 20, bottom: 50, left: 20 };\n\n var translateY = MARGIN.top / 2;\n\n // Add left and right axis labels\n head\n .append('text')\n .attr('class', 'header-text')\n .attr('transform', 'translate(' + MARGIN.left + ',' + translateY + ')') // above left axis\n .attr('font-size', '14pt')\n .attr('font-weight', '500')\n .attr('text-anchor', 'start')\n .text(displayNames[0])\n .attr('fill', textColor);\n\n head\n .append('text')\n .attr('class', 'header-text')\n .attr('transform', 'translate(' + (width + MARGIN.left) + ',' + translateY + ')') // above right axis\n .attr('font-size', '14pt')\n .attr('font-weight', '500')\n .attr('text-anchor', 'end')\n .text(displayNames[displayNames.length - 2]) // last one is value label\n .attr('fill', textColor);\n\n if (displayNames.length > 3) {\n const colWidth = width / (displayNames.length - 2);\n for (let i = 1; i < displayNames.length - 2; i++) {\n let translateX = colWidth * i + MARGIN.left;\n head\n .append('text')\n .attr('class', 'header-text')\n .attr('transform', `translate(${translateX},${translateY})`)\n .attr('font-size', '14pt')\n .attr('font-weight', '500')\n .attr('text-anchor', 'middle')\n .text(displayNames[i])\n .attr('fill', textColor);\n }\n }\n });\n\n return null;\n};\n","import React from 'react';\nimport { Link } from './Link';\nimport { Node } from './Node';\nimport * as d3Sankey from 'd3-sankey';\nimport { Tooltip } from './Tooltip';\nimport { Headers } from './Headers';\n// import { GrafanaTheme2 } from '@grafana/data';\n// import { useTheme2 } from '@grafana/ui';\n// import { css } from '@emotion/css';\n\n// import '../css/styles.css';\n\ninterface SankeyProps {\n data: any;\n width: number;\n height: number;\n displayNames: any;\n rowDisplayNames: any;\n id: any;\n textColor: string;\n nodeColor: string;\n field: any;\n nodeWidth: number;\n nodePadding: number;\n iteration: number;\n}\n\n/**\n * The sankey graph\n */\nexport const Sankey: React.FC = ({\n data,\n width,\n height,\n displayNames,\n rowDisplayNames,\n id,\n textColor,\n nodeColor,\n field,\n nodeWidth,\n nodePadding,\n iteration,\n}) => {\n // const theme = useTheme2();\n\n const MARGIN = { top: 75, bottom: 50, right: 20, left: 20 };\n const graphWidth = width - MARGIN.left - MARGIN.right;\n const graphHeight = height - MARGIN.top - MARGIN.bottom;\n const sankey: any = d3Sankey\n .sankey()\n .iterations(iteration)\n .nodeWidth(nodeWidth)\n .nodePadding(nodePadding)\n .extent([\n [0, 0],\n [graphWidth, graphHeight],\n ]);\n\n // Return an SVG group only if data exists\n if (data) {\n const { links, nodes } = sankey(data);\n\n return (\n \n \n \n \n {links.map((d: { width: any }, i: any) => (\n \n ))}\n \n \n {nodes.map((d: { index: any; x0: any; x1: any; y0: any; y1: any; name: any; value: any }, i: any) => (\n \n ))}\n \n \n );\n }\n return
;\n};\n","import { PanelPlugin, FieldConfigProperty } from '@grafana/data';\n// import { standardOptionsCompat } from 'grafana-plugin-support';\nimport { SankeyOptions } from './types';\nimport { SankeyPanel } from './SankeyPanel';\n\n/**\n * Grafana panel plugin main module\n *\n * @param {*} { panel: React.ComponentType> | null }\n * @return {*} { builder: PanelOptionsEditorBuilder }\n */\n\nconst monochromeBool = (monochrome: boolean) => (config: SankeyOptions) => config.monochrome === monochrome;\n\nexport const plugin = new PanelPlugin(SankeyPanel)\n .setPanelOptions((builder) => {\n builder\n .addBooleanSwitch({\n path: 'monochrome',\n name: 'Single Link color only',\n defaultValue: false,\n })\n .addColorPicker({\n path: 'color',\n name: 'Link Color',\n showIf: monochromeBool(true),\n defaultValue: 'blue',\n })\n .addColorPicker({\n path: 'nodeColor',\n name: 'Node color',\n defaultValue: 'grey',\n })\n .addSliderInput({\n path: 'nodeWidth',\n name: 'Node width',\n defaultValue: 30,\n settings: {\n min: 5,\n max: 100,\n step: 1,\n },\n })\n .addSliderInput({\n path: 'nodePadding',\n name: 'Node padding',\n defaultValue: 30,\n settings: {\n min: 1,\n max: 100,\n step: 1,\n },\n })\n .addSliderInput({\n path: 'iteration',\n name: 'Layout iterations',\n defaultValue: 7,\n settings: {\n min: 1,\n max: 30,\n step: 1,\n },\n });\n })\n .useFieldConfig({\n disableStandardOptions: [\n FieldConfigProperty.NoValue,\n FieldConfigProperty.Max,\n FieldConfigProperty.Min,\n FieldConfigProperty.DisplayName,\n ],\n standardOptions: {\n [FieldConfigProperty.Color]: {\n settings: {\n byValueSupport: true,\n bySeriesSupport: true,\n preferThresholdsMode: true,\n },\n },\n },\n });\n","import React from 'react';\nimport { PanelProps } from '@grafana/data';\nimport { SankeyOptions } from 'types';\nimport { parseData } from 'dataParser';\nimport { Sankey } from './components/Sankey';\nimport { useTheme2 } from '@grafana/ui';\n\ninterface Props extends PanelProps {}\n/**\n * Grafana Sankey diagram panel\n *\n * @param {*} { options, data, width, height, id }\n * @return {*} { Sankey } the Sankey graph\n */\nexport const SankeyPanel: React.FC = ({ options, data, width, height, id }: any): any => {\n let graphOptions = {\n ...options,\n };\n const theme = useTheme2();\n /**\n * Feed data and options into data parser.\n * @param {*} { data, options }\n * @returns [ parsedData, displayNames ]\n */\n var parsedData: any[] = [];\n try {\n parsedData = parseData(data, options, graphOptions.monochrome, graphOptions.color);\n } catch (error) {\n console.error('parsing error: ', error);\n }\n const displayNames = parsedData[1];\n const pluginData = parsedData[0];\n const rowDisplayNames = parsedData[2];\n const field = parsedData[3];\n const fixColor = parsedData[4];\n // const textColor = fixColor(graphOptions.textColor);\n const textColor = theme.colors.text.primary;\n const nodeColor = fixColor(graphOptions.nodeColor);\n\n return (\n \n \n \n );\n};\n","import { DataFrameView, Field, getFieldDisplayName, Vector } from '@grafana/data';\n// import { color } from 'd3';\n/**\n * Takes data from Grafana query and returns it in the format needed for this panel\n *\n * @param data the data returned by the query\n * @param options the field options from the editor panel\n * @param monochrome the boolean in the editor panel that sets whether the sankey is single or multi colored\n * @param color the color chosen in the editor panel for the sankey links if monochrome bool is true\n * @return {pluginData} the node and link data for the d3-sankey\n * @return {displayNames} the display names for the headers\n * @return {rowDisplayNames}\n * @return {valueField[0]}\n */\nexport function parseData(data: { series: any[] }, options: { valueFieldName: any }, monochrome: boolean, color: any) {\n const { valueFieldName } = options;\n\n /**\n * Colors\n * if monochrome = true, set all colors to value: color\n * else, set to multi color\n */\n\n function fixColor(color: string) {\n switch (color) {\n case 'dark-green':\n color = '#1A7311';\n break;\n case 'semi-dark-green':\n color = '#36872D';\n break;\n case 'light-green':\n color = '#73BF68';\n break;\n case 'super-light-green':\n color = '#96D88C';\n break;\n case 'dark-yellow':\n color = 'rgb(207, 159, 0)';\n break;\n case 'semi-dark-yellow':\n color = 'rgb(224, 180, 0)';\n break;\n case 'light-yellow':\n color = 'rgb(250, 222, 42)';\n break;\n case 'super-light-yellow':\n color = 'rgb(255, 238, 82)';\n break;\n case 'dark-red':\n color = 'rgb(173, 3, 23)';\n break;\n case 'semi-dark-red':\n color = 'rgb(196, 22, 42)';\n break;\n case 'light-red':\n color = 'rgb(242, 73, 92)';\n break;\n case 'super-light-red':\n color = 'rgb(255, 115, 131)';\n break;\n case 'dark-blue':\n color = 'rgb(18, 80, 176)';\n break;\n case 'semi-dark-blue':\n color = 'rgb(31, 96, 196)';\n break;\n case 'light-blue':\n color = 'rgb(87, 148, 242)';\n break;\n case 'super-light-blue':\n color = 'rgb(138, 184, 255)';\n break;\n case 'dark-orange':\n color = 'rgb(229, 84, 0)';\n break;\n case 'semi-dark-orange':\n color = 'rgb(250, 100, 0)';\n break;\n case 'light-orange':\n color = 'rgb(255, 152, 48)';\n break;\n case 'super-light-orange':\n color = 'rgb(255, 179, 87)';\n break;\n case 'dark-purple':\n color = 'rgb(124, 46, 163)';\n break;\n case 'semi-dark-purple':\n color = 'rgb(143, 59, 184)';\n break;\n case 'light-purple':\n color = 'rgb(184, 119, 217)';\n break;\n case 'super-light-purple':\n color = 'rgb(202, 149, 229)';\n break;\n default:\n break;\n }\n return color;\n }\n\n const colorArray: string[] = [];\n\n if (monochrome) {\n colorArray.push(fixColor(color));\n // colorArray.push(color);\n } else {\n colorArray.push('#018EDB');\n colorArray.push('#DB8500');\n colorArray.push('#7C00DB');\n colorArray.push('#DB0600');\n colorArray.push('#00DB57');\n }\n\n var allData = data.series[0].fields;\n var numFields = allData.length - 1;\n\n // add data checker. are there enough fields?\n\n // get display names\n let displayNames: string[] = [];\n allData.forEach((field: Field>) => {\n displayNames.push(getFieldDisplayName(field));\n });\n\n // Find selected value field or default to the first number field and use for values.\n const valueField = valueFieldName\n ? data.series.map((series: { fields: any[] }) =>\n series.fields.find((field: { name: any }) => field.name === valueFieldName)\n )\n : data.series.map((series: { fields: any[] }) =>\n series.fields.find((field: { type: string }) => field.type === 'number')\n );\n\n let values = [];\n valueField[0].values.buffer.map((value: any) => {\n values.push([value, valueField[0].display(value), valueField[0].name]);\n });\n // display converts value to display value with units\n // name = name of field\n\n const series = data.series[0];\n const frame = new DataFrameView(series);\n\n // initialize arrays\n let pluginDataLinks: Array<{\n source: number;\n target: number;\n value: number;\n displayValue: any;\n id: string;\n color: any;\n node0: any;\n }> = [];\n let pluginDataNodes: Array<{ name: any; id: any; colId: number }> = [];\n let col0: Array<{ name: any; index: number; color: any }> = [];\n let rowDisplayNames: Array<{ name: any; display: any }> = [];\n\n var rowId = 0; // update after each row\n var currentColor;\n\n // Retrieve panel data from panel\n frame.forEach((row) => {\n let currentLink: number[] = [];\n // go through columns to find all nodes\n for (let i = 0; i < numFields; i++) {\n let node = row[i];\n let index = pluginDataNodes.findIndex((e) => e.name === node && e.colId === i);\n if (index === -1) {\n index = pluginDataNodes.push({ name: node, id: [`row${rowId}`], colId: i }) - 1;\n if (i === 0) {\n currentColor = colorArray[col0.length % colorArray.length];\n col0.push({ name: node, index: index, color: currentColor });\n }\n } else {\n pluginDataNodes[index].id.push(`row${rowId}`); // might not need?\n }\n currentLink.push(index);\n }\n // create all the individual links, value is always the last column\n // let rowColor = colorArray[currentLink[0] % colorArray.length];\n let rowColor = col0.find((e) => e.index === currentLink[0])?.color;\n let rowDisplay = `${pluginDataNodes[currentLink[0]].name}`;\n for (let i = 0; i < currentLink.length - 1; i++) {\n var fieldValues = valueField[0].display(row[numFields]);\n var displayValue;\n if (fieldValues.suffix) {\n displayValue = `${fieldValues.text} ${fieldValues.suffix}`;\n } else {\n displayValue = `${fieldValues.text}`;\n }\n\n pluginDataLinks.push({\n source: currentLink[i],\n target: currentLink[i + 1],\n value: row[numFields],\n displayValue: displayValue,\n id: `row${rowId}`,\n color: rowColor,\n node0: currentLink[0],\n });\n rowDisplay = rowDisplay.concat(` -> ${pluginDataNodes[currentLink[i + 1]].name}`);\n }\n rowDisplayNames.push({ name: `row${rowId}`, display: rowDisplay });\n rowId++;\n });\n const pluginData = { links: pluginDataLinks, nodes: pluginDataNodes };\n\n return [pluginData, displayNames, rowDisplayNames, valueField[0], fixColor];\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/netsage-sankey-panel/plugin.json b/netsage-sankey-panel/plugin.json index 806f62b..9a964d6 100644 --- a/netsage-sankey-panel/plugin.json +++ b/netsage-sankey-panel/plugin.json @@ -25,8 +25,8 @@ } ], "screenshots": [{"name":"sankey2", "path":"img/sankey2.png"}, {"name":"sankey3", "path":"img/sankey3.png"}], - "version": "1.0.3", - "updated": "2021-09-24" + "version": "1.0.4", + "updated": "2021-09-30" }, "dependencies": { "grafanaDependency": ">=7.0.3",