@hpcc-js/eclwatch 3.8.2 → 3.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +3 -3
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +14 -14
package/dist/index.umd.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hpcc-js/codemirror"),require("@hpcc-js/comms"),require("@hpcc-js/phosphor"),require("@hpcc-js/tree"),require("@hpcc-js/util"),require("@hpcc-js/common"),require("@hpcc-js/dgrid"),require("@hpcc-js/graph"),require("@hpcc-js/layout"),require("@hpcc-js/timeline")):typeof define==`function`&&define.amd?define([`exports`,`@hpcc-js/codemirror`,`@hpcc-js/comms`,`@hpcc-js/phosphor`,`@hpcc-js/tree`,`@hpcc-js/util`,`@hpcc-js/common`,`@hpcc-js/dgrid`,`@hpcc-js/graph`,`@hpcc-js/layout`,`@hpcc-js/timeline`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@hpcc-js/eclwatch`]={},e[`@hpcc-js/codemirror`],e[`@hpcc-js/comms`],e[`@hpcc-js/phosphor`],e[`@hpcc-js/tree`],e[`@hpcc-js/util`],e[`@hpcc-js/common`],e[`@hpcc-js/dgrid`],e[`@hpcc-js/graph`],e[`@hpcc-js/layout`],e[`@hpcc-js/timeline`]))})(this,function(e,t,n,r,i,a,o,s,c,l,u){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var d=`@hpcc-js/eclwatch`,f=`3.8.
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hpcc-js/codemirror"),require("@hpcc-js/comms"),require("@hpcc-js/phosphor"),require("@hpcc-js/tree"),require("@hpcc-js/util"),require("@hpcc-js/common"),require("@hpcc-js/dgrid"),require("@hpcc-js/graph"),require("@hpcc-js/layout"),require("@hpcc-js/timeline")):typeof define==`function`&&define.amd?define([`exports`,`@hpcc-js/codemirror`,`@hpcc-js/comms`,`@hpcc-js/phosphor`,`@hpcc-js/tree`,`@hpcc-js/util`,`@hpcc-js/common`,`@hpcc-js/dgrid`,`@hpcc-js/graph`,`@hpcc-js/layout`,`@hpcc-js/timeline`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@hpcc-js/eclwatch`]={},e[`@hpcc-js/codemirror`],e[`@hpcc-js/comms`],e[`@hpcc-js/phosphor`],e[`@hpcc-js/tree`],e[`@hpcc-js/util`],e[`@hpcc-js/common`],e[`@hpcc-js/dgrid`],e[`@hpcc-js/graph`],e[`@hpcc-js/layout`],e[`@hpcc-js/timeline`]))})(this,function(e,t,n,r,i,a,o,s,c,l,u){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var d=`@hpcc-js/eclwatch`,f=`3.8.4`,p=`3.29.1`,ECLArchiveViewer=class extends r.SplitPanel{_prevHash;_contentStr;_directoryPane=new i.DirectoryTree;_fileEditorPane=new t.Editor().text(``);constructor(){super(`horizontal`),this._directoryPane.rowClick=e=>{this._fileEditorPane.text(e).render()}}transformArchiveTreeData(e){let t={label:e.name,children:e._children.map(transformNode).filter(e=>e)};if(t.children&&t.children[0]&&t.children[0].label===`html`)return{label:`root`,children:[{label:`error`,content:JSON.stringify(t,null,4)}]};return t;function transformNode(e){let t={};if(t.label=e.name+(e.$&&e.$.key?` (${e.$.key})`:``),e._children&&e._children.length>0)t.children=e._children.map(e=>transformNode(e)).filter(e=>e);else if(typeof e.content==`string`&&e.content.trim())t.content=e.content;else return!1;return t}}updateDirectoryPane(e){let t;if(e)try{t=JSON.parse(e)}catch{t=(0,a.xml2json)(e)}if(t){let e=this.transformArchiveTreeData(t);this._directoryPane.data(e).render()}}enter(e,t){super.enter(e,t),this.addWidget(this._directoryPane).addWidget(this._fileEditorPane)}update(e,t){super.update(e,t);let r=(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==r||this._contentStr===void 0?n.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchArchive().then(e=>{this._contentStr=e,this.updateDirectoryPane(this._contentStr),this._prevHash=r}):this.updateDirectoryPane(this._contentStr),this.relativeSizes([this.directoryWidthRatio(),1-this.directoryWidthRatio()])}};ECLArchiveViewer.prototype._class+=` eclwatch_ECLArchiveViewer`,ECLArchiveViewer.prototype.publish(`baseUrl`,``,`string`,`HPCC Platform Base URL`),ECLArchiveViewer.prototype.publish(`wuid`,``,`string`,`Workunit ID`),ECLArchiveViewer.prototype.publish(`directoryWidthRatio`,.38,`number`,`Default directory panel width ratio relative to the full width`),ECLArchiveViewer.prototype.publish(`contentString`,null,`string`,`XML/JSON archive content string`),ECLArchiveViewer.prototype.publishProxy(`directoryPaneColor`,`_directoryPane`,`backgroundColor`),ECLArchiveViewer.prototype.publishProxy(`directoryPaneHoverColor`,`_directoryPane`,`hoverBackgroundColor`),ECLArchiveViewer.prototype.publishProxy(`iconSize`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`fontColor`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`fontFamily`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`fontSize`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`folderIconOpen`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`folderIconClosed`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`textFileIcon`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`codeFileIcon`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`verticalScroll`,`_directoryPane`);var LegendVertex=class extends c.Vertex{constructor(){super()}enter(e,t){super.enter(e,t),this._icon.on(`click`,()=>{this.click(this.data())})}click(e){}},WUGraphLegend=class extends l.Legend{icon=(0,o.local)();_disabled2={};disabled(e){if(!arguments.length){let e=[];for(let t in this._disabled2)this._disabled2[t]&&e.push(t);return e}return this._disabled2={},e.forEach(e=>this._disabled2[e]=!0),this}toggle(e){this._disabled2[e]=!this._disabled2[e]}update(e,t){super.update(e,t);let n=this,r=this._g.selectAll(`.legendItem`).data(this.data(),e=>e.kind);r.enter().append(`g`).attr(`class`,`legendItem`).each(function(e){n.icon.set(this,new LegendVertex().target(this).data(e.kind).textbox_shape_colorStroke(`none`).textbox_shape_colorFill(`none`).iconAnchor(`left`).faChar(e.faChar).text(`${e.label} (${e.count})`).tooltip(`${e.kind} - ${e.label}`).on(`click`,e=>{n.toggle(e),n.render(),n.click(e)}).on(`mouseover`,e=>{n.mouseover(e)}).on(`mouseout`,e=>{n.mouseout(e)}))}).merge(r).each(function(e,t){let r=n.icon.get(this).icon_shape_colorFill(n._disabled2[e.kind]?`gray`:null).render().getBBox();(0,o.select)(this).attr(`transform`,`translate(${r.width/2}, ${t*30})`)}),r.exit().each(function(e){n.icon.get(this).target(null).render()}).remove();let i=this.getBBox(!0,!0);this._g.attr(`transform`,`translate(16, ${this.height()/2-i.height/2})`)}click(e){}mouseover(e){}mouseout(e){}};WUGraphLegend.prototype._class+=` eclwatch_WUGraphLegend`;function faCharFactory(e){switch(e){case`2`:return``;case`3`:return``;case`5`:return``;case`6`:return``;case`12`:return``;case`15`:return``;case`17`:return``;case`22`:return``;case`23`:return``;case`25`:return``;case`26`:return``;case`29`:return``;case`36`:return``;case`44`:return``;case`47`:return``;case`54`:return``;case`56`:return``;case`59`:return``;case`61`:return``;case`82`:return``;case`88`:return``;case`92`:return``;case`93`:return``;case`99`:return``;case`105`:return``;case`7`:return``;case`9`:return``;case`16`:return``;case`19`:return``;case`21`:return``;case`35`:return``;case`37`:return``;case`71`:return``;case`133`:return``;case`148`:return``;case`168`:return``}return``}var WUScopeController=class{graphDB;subgraphsMap={};rSubgraphsMap={};verticesMap={};rVerticesMap={};edgesMap={};rEdgesMap={};kindMap={};_disabled={};constructor(){}clear(){this.subgraphsMap={},this.rSubgraphsMap={},this.verticesMap={},this.rVerticesMap={},this.edgesMap={},this.rEdgesMap={}}set(e){this.graphDB=e,this.graphGui(this.graphDB),this.kindMap={},this.graphDB.walk(e=>{if(!(e instanceof a.Subgraph))if(e instanceof a.Vertex){let t=e._.attr(`Kind`).RawValue;this.kindMap[t]||(this.kindMap[t]=[]),this.kindMap[t].push(e)}else e instanceof a.Edge})}disabled(e){if(!arguments.length){let e=[];for(let t in this._disabled)this._disabled[t]&&e.push(t);return e}return this._disabled={},e.forEach(e=>this._disabled[e]=!0),this}graphGui(e){let t={subgraphs:[],vertices:[],edges:[],hierarchy:[]};return e.walk(e=>{if(e instanceof a.Subgraph){let n=this.appendSubgraph(e,t.hierarchy,t.subgraphs);n.showMinMax(e.vertices.length>3||n.minState()!==`normal`)}else e instanceof a.Vertex?this.appendVertex(e,t.hierarchy,t.vertices):e instanceof a.Edge&&this.appendEdge(e,t.edges)}),t}format(e,t){let n=``,r=e.indexOf(`%`),i=-1;for(;r>=0;){if(n+=e.substring(i+1,r),i=e.indexOf(`%`,r+1),i<0){console.warn(`Invalid Label Template`);break}let a=e.substring(r+1,i);n+=a?t[e.substring(r+1,i)]||``:`%`,r=e.indexOf(`%`,i+1)}return n+=e.substring(i+1,e.length),n.split(`\\n`).join(`
|
|
2
2
|
`)}createSubgraph(e){let t=this.subgraphsMap[e._.Id];return t||(t=new c.Subgraph().title(e._.Id).on(`minClick`,()=>{this.minClick(t)}),this.subgraphsMap[e._.Id]=t,this.rSubgraphsMap[t.id()]=e),t}createVertex(e){let t=this.verticesMap[e._.Id];if(!t){let n=e._.rawAttrs();if(e._.ScopeType===`dummy`){let n=this.subgraphsMap[e.parent._.Id];t=new o.Icon().shape_colorFill(`darkred`).shape_colorStroke(`darkred`).image_colorFill(`white`).faChar(``).on(`click`,()=>{n.minState(`normal`),this.minClick(n)})}else{t=new c.Vertex().icon_shape_colorFill(`#1f77b4`).icon_image_colorFill(`white`).faChar(faCharFactory(n.Kind)).text(n.Label);let r=[];e._.hasAttr(`Definition`)&&r.push({faChar:``,tooltip:`Definition`,shape_colorFill:`lightgray`,shape_colorStroke:`lightgray`,image_colorFill:`black`}),e._.hasAttr(`IsInternal`)&&r.push({faChar:``,tooltip:`IsInternal`,shape_colorFill:`red`,shape_colorStroke:`red`,image_colorFill:`white`}),t.annotationIcons(r)}this.verticesMap[e._.Id]=t,this.rVerticesMap[t.id()]=e}return t}isSpill(e){let t=e.source._.attr(`Kind`).RawValue,n=e.target._.attr(`Kind`).RawValue;return t===`2`||n===`71`}spansSubgraph(e){return e.source.parent._.Id!==e.target.parent._.Id}createEdge(e){let t=this.edgesMap[e._.Id];if(!t){let n=e._.rawAttrs(),r=this.verticesMap[e.source._.Id],i=this.verticesMap[e.target._.Id];if(r&&i){let a=this.isSpill(e),o=this.spansSubgraph(e),s=this.format(`%Label%
|
|
3
3
|
%NumRowsProcessed%`,n),l=null,u=100;n.IsDependency?(u=10,l=`1,5`):n._childGraph?l=`5,5`:a?(u=25,l=`5,5,10,5`):o&&(u=5,l=`5,5`),t=new c.Edge().sourceVertex(r).targetVertex(i).sourceMarker(`circle`).targetMarker(`arrow`).weight(u).strokeDasharray(l).text(s),this.edgesMap[e._.Id]=t,this.rEdgesMap[t.id()]=e}}return t}appendSubgraph(e,t,n){let r=this.createSubgraph(e);n.push(r);let i=this.subgraphsMap[e.parent._.Id];return i&&t.push({parent:i,child:r}),r}appendVertex(e,t,n){let r=this.createVertex(e);n.push(r);let i=this.subgraphsMap[e.parent._.Id];return i&&t.push({parent:i,child:r}),r}appendEdge(e,t){let n=this.createEdge(e);return n&&t.push(n),n}filterLegend(e){for(let t=e.vertices.length-1;t>=0;--t){let r=e.vertices[t],i=r._.attr(`Kind`).RawValue;this._disabled[i]&&r.remove(!1,(e,t)=>new n.BaseScope({ScopeName:r._.ScopeName+`:in`,Id:e.Id+`->`+t.Id,ScopeType:`dummy-edge`,Properties:{Property:[r._.attr(`Label`)]},Notes:{Note:[]},SinkActivity:``}))}}filterPartial(e){for(let t of e.subgraphs)switch(this.subgraphsMap[t._.Id].minState()){case`partial`:let e=t.vertices,r=[],i=[];for(let t of e)t.inEdges.length===0||t.inEdges.some(e=>e.source.parent!==e.target.parent)||t.outEdges.length===0||t.outEdges.some(e=>e.source.parent!==e.target.parent)?r.push(t):i.push(t);if(i.length>1){let e=new n.BaseScope({ScopeName:t._.ScopeName,Id:t._.Id+`:dummy`,ScopeType:`dummy`,Properties:{Property:[{Name:`Activities`,RawValue:``+i.length,Formatted:``+i.length,Measure:`count`,Creator:``,CreatorType:``}]},Notes:{Note:[]},SinkActivity:``}),a=t.createVertex(e);for(let e of i){for(let i of e.inEdges)if(r.indexOf(i.source)>=0){let e=new n.BaseScope({ScopeName:i.source._.ScopeName,Id:i.source._.Id+`->`+a._.Id,ScopeType:`dummy-in`,Properties:{Property:[]},Notes:{Note:[]},SinkActivity:``});t.createEdge(i.source,a,e)}for(let i of e.outEdges)if(r.indexOf(i.target)>=0){let e=new n.BaseScope({ScopeName:i.target._.ScopeName,Id:a._.Id+`->`+i.target._.Id,ScopeType:`dummy-out`,Properties:{Property:[]},Notes:{Note:[]},SinkActivity:``});t.createEdge(a,i.target,e)}}i.forEach(e=>e.remove(!0))}break}}filterEmptySubgraphs(e){for(;;){let t=e.subgraphs.filter(e=>e.subgraphs.length===0&&e.vertices.length===0);if(t.length===0)break;t.forEach(e=>e.remove(!0))}}removeObsoleteSubgraphs(e){for(let t of[...e.subgraphs])t.vertices.length===0&&t.remove(!1)}graphData(){let e=this.graphDB.clone();return this.filterLegend(e),this.filterPartial(e),this.filterEmptySubgraphs(e),this.removeObsoleteSubgraphs(e),this.graphGui(e)}calcLegend(){let e=[];for(let t in this.kindMap)e.push({kind:parseInt(t),faChar:faCharFactory(t),label:this.kindMap[t][0]._.attr(`Label`).RawValue.split(`
|
|
4
|
-
`)[0],count:this.kindMap[t].length});return e}vertices(e){let t=[];for(let n of this.kindMap[e])t.push(this.verticesMap[n._.Id]);return t}formatRow(e,t,n){let r=e._.formattedAttrs();for(let e in r){let i=t.indexOf(e);i===-1?(t.push(e),n.push(r[e])):n[i]=r[e]}for(let e=0;e<100;++e)n[e]===void 0&&(n[e]=``);return n}activityData(){let e=[`Id`,`Kind`,`Label`];return{columns:e,data:this.graphDB.vertices.map(t=>{let n=[parseInt(t._.Id.split(`a`)[1])];return this.formatRow(t,e,n)})}}edgeData(){let e=[`Id`,`Label`];return{columns:e,data:this.graphDB.edges.map(t=>{let n=[t._.Id];return this.formatRow(t,e,n)})}}subgraphData(){let e=[`Id`,`Label`];return{columns:e,data:this.graphDB.subgraphs.map(t=>{let n=[t._.Id];return this.formatRow(t,e,n)})}}calcGraphTooltip(e){let t,n;if(e instanceof c.Subgraph){let r=this.rSubgraphsMap[e.id()];t=r._,n=r.parent._}else if(e instanceof c.Vertex||e instanceof o.Icon){let r=this.rVerticesMap[e.id()];t=r._,n=r.parent._}else if(e instanceof c.Edge){let r=this.rEdgesMap[e.id()];t=r._,n=r.parent._}return t?t.calcTooltip(n):``}subgraph(e){return this.subgraphsMap[e]}vertex(e){return this.verticesMap[e]}edge(e){return this.edgesMap[e]}minClick(e){}},WUGraph=class extends l.ChartPanel{_partialAll=new o.Button().faChar(`fa-window-restore`).tooltip(`Partial All`).on(`click`,()=>{this.stateClick(this._partialAll)});_maxAll=new o.Button().faChar(`fa-window-maximize`).tooltip(`Max All`).on(`click`,()=>{this.stateClick(this._maxAll)});_toggleGraph=new o.ToggleButton().faChar(`fa-chain`).tooltip(`Graph`).selected(!0).on(`click`,()=>{this.viewClick(this._toggleGraph)});_toggleActivities=new o.ToggleButton().faChar(`fa-table`).tooltip(`Activitiies`).selected(!1).on(`click`,()=>{this.viewClick(this._toggleActivities)});_toggleEdges=new o.ToggleButton().faChar(`fa-table`).tooltip(`Edges`).selected(!1).on(`click`,()=>{this.viewClick(this._toggleEdges)});_toggleSubgraphs=new o.ToggleButton().faChar(`fa-table`).tooltip(`Subgraphs`).selected(!1).on(`click`,()=>{this.viewClick(this._toggleSubgraphs)});_graph=new c.Graph().layout(`Hierarchy`).applyScaleOnLayout(!0).showToolbar(!1).allowDragging(!1);_activities=new s.Table().pagination(!1);_edges=new s.Table().pagination(!1);_subgraphs=new s.Table().pagination(!1);_legend=new WUGraphLegend(this).on(`click`,e=>{this.render()}).on(`mouseover`,e=>{let t={};for(let n of this._gc.vertices(e))t[n.id()]=!0;this._graph.highlightVerticies(t)}).on(`mouseout`,e=>{this._graph.highlightVerticies()});_view=new l.Carousel().widgets([this._graph,this._activities,this._edges,this._subgraphs]);_gc=new WUScopeController;constructor(){super(),this.topOverlay(!1),this.widget(this._view);let e=[this._toggleGraph,this._toggleActivities,this._toggleEdges,this._toggleSubgraphs,new o.Spacer,this._partialAll,this._maxAll,new o.Spacer,...this._graph.iconBarButtons(),new o.Spacer];this.buttons(e.concat(this.buttons())),this._gc.minClick=e=>{this.loadGraph(),this._graph.render(t=>{this._graph.selection([e]).centerOnItem(e)})},this._graph.tooltipHTML(e=>this._gc.calcGraphTooltip(e))}stateClick(e){switch(e){case this._partialAll:this._graph.data().subgraphs.forEach(e=>{e.minState(`partial`)});break;case this._maxAll:this._graph.data().subgraphs.forEach(e=>{e.minState(`normal`)});break}this.render()}viewClick(e){switch(this._toggleGraph.selected(e===this._toggleGraph),this._toggleActivities.selected(e===this._toggleActivities),this._toggleEdges.selected(e===this._toggleEdges),this._toggleSubgraphs.selected(e===this._toggleSubgraphs),e){case this._toggleGraph:this._view.active(0);break;case this._toggleActivities:this._view.active(1);break;case this._toggleEdges:this._view.active(2);break;case this._toggleSubgraphs:this._view.active(3);break}this.render(e=>{})}_prevHashSum;_prevScopeGraph;fetchScopeGraph(){let e=(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid(),graphID:this.graphID(),subgraphID:this.subgraphID()});return!this._prevScopeGraph||this._prevHashSum!==e?(this.startProgress(),this._prevHashSum=e,this._gc.clear(),n.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchGraphs().then(e=>{for(let t of e)if(t.Name===this.graphID())return this.finishProgress(),t.fetchScopeGraph(this.subgraphID())}).then(e=>(this._prevScopeGraph=e,this._prevScopeGraph))):Promise.resolve(this._prevScopeGraph)}enter(e,t){super.enter(e,t)}update(e,t){super.update(e,t)}exit(e,t){super.exit(e,t)}loadGraph(){this._gc.disabled(this._legend.disabled()),this._graph.data(this._gc.graphData(),!0);{let{columns:e,data:t}=this._gc.activityData();this._activities.columns(e).data(t)}{let{columns:e,data:t}=this._gc.edgeData();this._edges.columns(e).data(t)}{let{columns:e,data:t}=this._gc.subgraphData();this._subgraphs.columns(e).data(t)}}render(e){return this.wuid()&&this.graphID()?this.fetchScopeGraph().then(t=>{this._gc.set(t),this._legend.data(this._gc.calcLegend()),this.loadGraph(),super.render(e)}):super.render(e),this}selection(e){if(!arguments.length)return this._graph.selection();let t=this._gc.vertex(e)||this._gc.edge(e)||this._gc.subgraph(e);return t&&this._graph.selection([t]),this}};WUGraph.prototype._class+=` eclwatch_WUGraph`,WUGraph.prototype.publish(`baseUrl`,``,`string`,`HPCC Platform Base URL`),WUGraph.prototype.publish(`wuid`,``,`string`,`Workunit ID`),WUGraph.prototype.publish(`graphID`,``,`string`,`Graph ID`),WUGraph.prototype.publish(`subgraphID`,``,`string`,`Subgraph ID`);function entitiesEncode(e){return String(e).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function safeEncode(e){switch(Object.prototype.toString.call(e)){case`[object Undefined]`:case`[object Boolean]`:case`[object Number]`:return e;case`[object String]`:return entitiesEncode(e);default:console.warn(`Unknown cell type: `+Object.prototype.toString.call(e))}return e}var Store=class{wuResult;schema;_columns;_cache={};rowFormatter;_filter={};onError;constructor(e,t,n,r={},i){this.wuResult=e,this.schema=t,this._columns=this.schema2Columns(this.schema.root),this.rowFormatter=new s.RowFormatter(this._columns,n),this._filter=r,this.onError=i}columns(){return this._columns}schema2Columns(e,t=``){return e?e.children().filter(e=>e.name.indexOf(`__hidden`,e.name.length-8)===-1).map((e,n)=>{let r=e.name,i=e.attrs[`hpcc:keyed`],a={field:t+r,leafID:r,idx:n,label:r+(i?` (i)`:``),className:`resultGridCell`,hidden:!1,sortable:!1,width:i?16:0,isSet:e.isSet},o=this.schema2Columns(e,t+r+`_`);return o.length?(a.width+=10+o.reduce((e,t)=>e+t.width,0),a.children=o):(a.width+=e.charWidth()*9,a.formatter=(e,t)=>{switch(typeof e){case`string`:return{html:e.replace(/\t/g,` `).trim()};case`undefined`:return``}return e}),a}):[]}isChildDataset(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=0,n=null;for(let r in e)n||=Object.prototype.toString.call(e[r]),t++;return t===1&&n===`[object Array]`}rowToTable(e,t,n){if(this.isChildDataset(e)){for(let r in e)this.rowToTable(e[r],t,n);return}let r=s.domConstruct.create(`table`,{border:1,cellspacing:0,width:`100%`},n);switch(Object.prototype.toString.call(e)){case`[object Object]`:let i=s.domConstruct.create(`tr`,null,r);for(let t in e)s.domConstruct.create(`th`,{innerHTML:safeEncode(t)},i);i=s.domConstruct.create(`tr`,null,r);for(let r in e)switch(Object.prototype.toString.call(e[r])){case`[object Object]`:case`[object Array]`:this.rowToTable(e[r],t,n);break;default:s.domConstruct.create(`td`,{innerHTML:safeEncode(e[r])},i);break}break;case`[object Array]`:for(let t=0;t<e.length;++t)switch(Object.prototype.toString.call(e[t])){case`[object Boolean]`:case`[object Number]`:case`[object String]`:let n=s.domConstruct.create(`tr`,null,r);s.domConstruct.create(`td`,{innerHTML:safeEncode(e[t])},n);break;default:if(t===0){let n=s.domConstruct.create(`tr`,null,r);for(let r in e[t])s.domConstruct.create(`th`,{innerHTML:safeEncode(r)},n)}s.domConstruct.create(`tr`,null,r);for(let r in e[t])if(e[t][r])if(Object.prototype.toString.call(e[t][r])===`[object Object]`||Object.prototype.toString.call(e[t][r])===`[object Array]`){let i=s.domConstruct.create(`td`,null,n);this.rowToTable(e[t][r],e[t],i)}else if(r.indexOf(`__html`,r.length-6)!==-1)s.domConstruct.create(`td`,{innerHTML:e[t][r]},n);else if(r.indexOf(`__javascript`,r.length-12)!==-1)s.domConstruct.create(`td`,null,n);else{let i=e[t][r];s.domConstruct.create(`td`,{innerHTML:safeEncode(i)},n)}else s.domConstruct.create(`td`,{innerHTML:``},n)}break}}getIdentity(e){return e.__hpcc_id}_request(e,t){if(!this.wuResult)return Promise.resolve({totalLength:0,data:[]});let n=`${e}->${t}`;if(this._cache[n])return this._cache[n];let r=this.wuResult.fetchRows(e,t-e,!1,this._filter).then(t=>({totalLength:this.wuResult.Total,data:t.map((t,n)=>{let r=this.rowFormatter.format(t);return r.__hpcc_id=e+n,r.__hpcc_orig=t,r})})).catch(e=>(this.onError(e.Message||`An exception has occurred`),{totalLength:0,data:[]}));return this._cache[n]=r,r}fetchRange(e){let t=new s.Deferred;return this._request(e.start,e.end).then(e=>t.resolve(e)),new s.QueryResults(t.then(e=>e.data),{totalLength:t.then(e=>e.totalLength)})}},WUResult=class extends s.Common{_result;_localStore;constructor(){super(),this.renderHtml(!1)}hashSum(e={}){return(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid(),resultName:this.resultName(),sequence:this.sequence(),nodeGroup:this.nodeGroup(),logicalFile:this.logicalFile(),userID:this.user(),password:this.password(),bypassCache:this.bypassCache(),...e})}_prevResultHash;calcResult(){let e=this.hashSum();if(this._prevResultHash!==e){this._prevResultHash=e;let t={baseUrl:this.baseUrl(),userID:this.user(),password:this.password()};this.wuid()&&this.resultName()?this._result=n.Result.attach(t,this.wuid(),this.resultName()):this.wuid()&&this.sequence()!==void 0?this._result=n.Result.attach(t,this.wuid(),this.sequence()):this.logicalFile()&&this.nodeGroup()?this._result=n.Result.attachLogicalFile(t,this.nodeGroup(),this.logicalFile()):this.logicalFile()&&(this._result=n.Result.attachLogicalFile(t,``,this.logicalFile())),this._result&&this.bypassCache()&&this._result.bypassCache(this.bypassCache())}return this._result}fetch(e,t,n=new AbortController){let r=this.calcResult();return r?r.fetchRows(e,t,!1,{},n.signal):Promise.resolve([])}_prevStoreHash;_prevQueryHash;update(e,t){super.update(e,t);let n=this.hashSum({renderHtml:this.renderHtml(),filter:this.filter()});if(this._prevStoreHash!==n){this._prevStoreHash=n;let e=this.calcResult();e&&e.fetchXMLSchema().then(t=>{this._localStore=new Store(e,t,this.renderHtml(),this.filter(),e=>{this._dgrid&&(this._dgrid.noDataMessage=`<span class='dojoxGridNoData'>${e}</span>`,this._dgrid.refresh())}),this._dgrid?.set(`columns`,this._localStore.columns()),this._dgrid?.set(`collection`,this._localStore)})}}click(e,t,n){}};WUResult.prototype._class+=` eclwatch_WUResult`,WUResult.prototype.publish(`baseUrl`,``,`string`,`URL to WsWorkunits`),WUResult.prototype.publish(`user`,``,`string`,`User ID`),WUResult.prototype.publish(`password`,``,`string`,`Password`),WUResult.prototype.publish(`wuid`,``,`string`,`Workunit ID`),WUResult.prototype.publish(`resultName`,``,`string`,`Result Name`),WUResult.prototype.publish(`sequence`,void 0,`number`,`Sequence Number`),WUResult.prototype.publish(`nodeGroup`,``,`string`,`NodeGroup`),WUResult.prototype.publish(`logicalFile`,``,`string`,`Logical File Name`),WUResult.prototype.publish(`filter`,{},`object`,`Filter`),WUResult.prototype.publish(`bypassCache`,!1,`boolean`,`Bypass cached results`);var m=function(e){return e.CREATE=`Created`,e.COMPILE=`Compiled`,e.EXECUTE=`Executed`,e.COMPLETE=`Completed`,e}({}),h=function(e){return e.CREATE=`Creating`,e.COMPILE=`Compiling`,e.EXECUTE=`Executing`,e.COMPLETE=`Completed`,e}({}),WUStatus=class extends c.Graph{_wu;_wuHandle;_create;_compile;_execute;_complete;constructor(){super(),this.zoomable(!1).zoomToFitLimit(1).layout(`Hierarchy`).hierarchyRankDirection(`LR`).showToolbar(!1).allowDragging(!1)}_prevHash;attachWorkunit(){let e=(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==e&&(this._prevHash=e,this._wu=n.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()),this._wuHandle&&this._wuHandle.release(),this._wuHandle=this._wu.watch(e=>{this.lazyRender()}))}createVertex(e){return new c.Vertex().icon_diameter(32).icon_shape_colorFill(`none`).icon_shape_colorStroke(`none`).icon_image_colorFill(`darkgray`).iconAnchor(`middle`).textbox_shape_colorFill(`none`).textbox_shape_colorStroke(`none`).textbox_text_colorFill(`darkgray`).faChar(e)}updateVertex(e,t){e.icon_image_colorFill(t).textbox_text_colorFill(t)}updateVertexStatus(e,t=!1){let n=this._wu.isFailed()?`darkred`:`darkgreen`;switch(this._create.text(`Created`),this._compile.text(`Compiled`),this._execute.text(`Executed`),this._complete.text(`Completed`),e){case 0:this.updateVertex(this._create,`darkgray`),this.updateVertex(this._compile,`darkgray`),this.updateVertex(this._execute,`darkgray`),this.updateVertex(this._complete,`darkgray`);break;case 1:this._create.text(`Creating`),this.updateVertex(this._create,t?`orange`:n),this.updateVertex(this._compile,`darkgray`),this.updateVertex(this._execute,`darkgray`),this.updateVertex(this._complete,`darkgray`);break;case 2:this._compile.text(`Compiling`),this.updateVertex(this._create,n),this.updateVertex(this._compile,t?`orange`:n),this.updateVertex(this._execute,n),this.updateVertex(this._complete,`darkgray`);break;case 3:this._execute.text(`Executing`),this.updateVertex(this._create,n),this.updateVertex(this._compile,n),this.updateVertex(this._execute,t?`orange`:n),this.updateVertex(this._complete,`darkgray`);break;case 4:this.updateVertex(this._create,n),this.updateVertex(this._compile,n),this.updateVertex(this._execute,n),this.updateVertex(this._complete,n);break}}createEdge(e,t){return new c.Edge().sourceVertex(e).targetVertex(t).strokeColor(`black`).showArc(!1)}enter(e,t){super.enter(e,t),this._create=this.createVertex(``),this._compile=this.createVertex(``),this._execute=this.createVertex(``),this._complete=this.createVertex(``);let n=this.createEdge(this._create,this._compile),r=this.createEdge(this._compile,this._execute),i=this.createEdge(this._execute,this._complete);this.data({vertices:[this._create,this._compile,this._execute,this._complete],edges:[n,r,i]})}update(e,t){switch(this.attachWorkunit(),this._wu.StateID){case n.WUStateID.Blocked:case n.WUStateID.Wait:case n.WUStateID.Scheduled:case n.WUStateID.UploadingFiled:this.updateVertexStatus(1);break;case n.WUStateID.Compiling:this.updateVertexStatus(2,!0);break;case n.WUStateID.Submitted:this.updateVertexStatus(1,!0);break;case n.WUStateID.Compiled:this.updateVertexStatus(2);break;case n.WUStateID.Aborting:case n.WUStateID.Running:this.updateVertexStatus(3,!0);break;case n.WUStateID.Aborted:case n.WUStateID.Archived:case n.WUStateID.Completed:this.updateVertexStatus(4);break;case n.WUStateID.Failed:this.updateVertexStatus(4,!1);break;case n.WUStateID.DebugPaused:case n.WUStateID.DebugRunning:case n.WUStateID.Paused:case n.WUStateID.Unknown:default:this.updateVertexStatus(0);break}super.update(e,t),this.zoomToFit()}exit(e,t){this._wuHandle&&this._wuHandle.release(),super.exit(e,t)}};WUStatus.prototype._class+=` eclwatch_WUStatus`,WUStatus.prototype.publish(`baseUrl`,``,`string`,`HPCC Platform Base URL`),WUStatus.prototype.publish(`wuid`,``,`string`,`Workunit ID`);function I1DChart(){}I1DChart.prototype._dataFamily=`1D`,I1DChart.prototype._palette=o.Palette.rainbow(`default`),I1DChart.prototype.click=function(e,t,n){},I1DChart.prototype.dblclick=function(e,t,n){};function I2DChart(){}I2DChart.prototype._dataFamily=`2D`,I2DChart.prototype._palette=o.Palette.ordinal(`default`),I2DChart.prototype.fillColor=function(e,t,n,r){return this._palette(e[0])},I2DChart.prototype.strokeColor=function(e,t,n,r){return(0,o.hsl)(this.fillColor(e,t,n,r)).darker().toString()},I2DChart.prototype.textColor=function(e,t,n,r){return o.Palette.textColor(this.fillColor(e,t,n,r))},I2DChart.prototype.click=function(e,t,n){},I2DChart.prototype.dblclick=function(e,t,n){};function I2DAggrChart(){}I2DAggrChart.prototype._palette=o.Palette.rainbow(`default`),I2DAggrChart.prototype.fillColor=function(e,t,n){return this._palette(e.length)},I2DAggrChart.prototype.strokeColor=function(e,t,n){return(0,o.hsl)(this.fillColor(e,t,n)).darker().toString()},I2DAggrChart.prototype.textColor=function(e,t,n){return o.Palette.textColor(this.fillColor(e,t,n))},I2DAggrChart.prototype.click=function(e,t,n){},I2DAggrChart.prototype.dblclick=function(e,t,n){};function IGraph(){}IGraph.prototype._dataFamily=`graph`,IGraph.prototype.vertex_click=function(e,t,n,r){r&&r.vertex},IGraph.prototype.vertex_dblclick=function(e,t,n,r){r&&r.vertex},IGraph.prototype.edge_click=function(e,t,n,r){r&&r.edge},IGraph.prototype.edge_dblclick=function(e,t,n,r){r&&r.edge};function IInput(){}IInput.prototype=Object.create(o.Widget.prototype),IInput.prototype.constructor=IInput,IInput.prototype.isValid=function(){return!(this.validate()&&!new RegExp(this.validate()).test(this.value()))},IInput.prototype.hasValue=function(){if(typeof this.type==`function`){switch(this.type()){case`radio`:case`checkbox`:if(this.value()&&this.value()!==`false`)return!0;break;default:if(this.value())return!0;break}return!1}return this.value()!==``},IInput.prototype.blur=function(e){},IInput.prototype.keyup=function(e){},IInput.prototype.focus=function(e){},IInput.prototype.click=function(e){},IInput.prototype.dblclick=function(e){},IInput.prototype.change=function(e,t){},IInput.prototype.resetValue=function(e){e.value(e._inputElement[0].node().value)},IInput.prototype.disable=function(e){this._inputElement.forEach(function(t,n){t.attr(`disabled`,e?`disabled`:null)})},IInput.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},IInput.prototype.publish(`name`,``,`string`,`HTML name for the input`),IInput.prototype.publish(`label`,``,`string`,`Descriptive label`),IInput.prototype.publish(`value`,``,`string`,`Input Current Value`),IInput.prototype.publish(`validate`,null,`string`,`Input Validation`);function INDChart(){}INDChart.prototype._dataFamily=`ND`,INDChart.prototype._palette=o.Palette.ordinal(`default`),INDChart.prototype.fillColor=function(e,t,n,r){return this._palette(t)},INDChart.prototype.strokeColor=function(e,t,n,r){return(0,o.hsl)(this.fillColor(e,t,n,r)).darker().toString()},INDChart.prototype.textColor=function(e,t,n,r){return o.Palette.textColor(this.fillColor(e,t,n,r))},INDChart.prototype.click=function(e,t,n){},INDChart.prototype.dblclick=function(e,t,n){};function tip(){let e=d3TipDirection,t=d3TipOffset,n=d3TipHTML,r=functor(document.body),i=initNode(),a=null,s=null,c=null,tip=function(e){if(a=getSVGNode(e),!a)return;s=a.createSVGPoint();let t=r();t&&i&&t.appendChild(i)};tip.show=function(e,i,a){c=a[i];let o=Array.prototype.slice.call(arguments),s=n.apply(this,o);if(s===null)return tip;let d=t.apply(this,o),f=getNodeEl(),p=u.length,m,h=r().getBoundingClientRect();for(f.html(s).style(`opacity`,1).style(`pointer-events`,`all`);p--;)f.classed(u[p],!1);let g=!1,_={},v=u[0];for(let e=0;e<u.length&&(g=_placement_attempt(u[e]),!g);e++);if(g)f.classed(`notick`,!1);else{f.classed(`notick`,!0);let e=_vertical_adjustment(_[v]),t=_horizontal_adjustment(_[v]);_placement_attempt(v,e,t)}return tip;function _horizontal_adjustment(e){return e.left>e.right?e.left>0?-e.left:0:e.right>0?e.right:0}function _vertical_adjustment(e){return e.top>e.bottom?e.top>0?-e.top:0:e.bottom}function _placement_attempt(e,t,n){t||=0,n||=0,f.style(`white-space`,`nowrap`),m=l.get(e).apply(this),f.classed(e,!0).style(`top`,m.top+d[0]-t+`px`).style(`left`,m.left+d[1]-n+`px`);let r=f.node().getBoundingClientRect(),i=r.top>h.top&&r.left>h.left&&r.bottom<h.bottom&&r.right<h.right;return _[e]={top:h.top-r.top,right:r.right-h.right,bottom:r.bottom-h.bottom,left:h.left-r.left},f.style(`white-space`,`normal`),_[e].total_overflow=Object.keys(_[e]).filter(t=>_[e][t]>0).reduce((t,n)=>t+_[e][n],0),_[v].total_overflow>_[e].total_overflow&&(v=e),i||f.classed(e,!1),i}},tip.hide=function(){return getNodeEl().style(`opacity`,0).style(`pointer-events`,`none`),tip},tip.attr=function(e,t){if(arguments.length<2&&typeof e==`string`)return getNodeEl().attr(e);let n=Array.prototype.slice.call(arguments);return o.selection.prototype.attr.apply(getNodeEl(),n),tip},tip.style=function(e,t){if(arguments.length<2&&typeof e==`string`)return getNodeEl().style(e);let n=Array.prototype.slice.call(arguments);return o.selection.prototype.style.apply(getNodeEl(),n),tip},tip.direction=function(t){return arguments.length?(e=t==null?t:functor(t),tip):e},tip.offset=function(e){return arguments.length?(t=e==null?e:functor(e),tip):t},tip.html=function(e){return arguments.length?(n=e==null?e:functor(e),tip):n},tip.rootElement=function(e){return arguments.length?(r=functor(e),tip):r},tip.destroy=function(){return i&&=(getNodeEl().remove(),null),tip};function d3TipDirection(){return`n`}function d3TipOffset(){return[0,0]}function d3TipHTML(){return` `}let l=(0,o.map)({n:directionNorth,s:directionSouth,e:directionEast,w:directionWest,nw:directionNorthWest,ne:directionNorthEast,sw:directionSouthWest,se:directionSouthEast}),u=l.keys();function directionNorth(){let e=getScreenBBox(window);return{top:e.n.y-i.offsetHeight,left:e.n.x-i.offsetWidth/2}}function directionSouth(){let e=getScreenBBox(window);return{top:e.s.y+8,left:e.s.x-i.offsetWidth/2}}function directionEast(){let e=getScreenBBox(window);return{top:e.e.y-i.offsetHeight/2,left:e.e.x+8}}function directionWest(){let e=getScreenBBox(window);return{top:e.w.y-i.offsetHeight/2,left:e.w.x-i.offsetWidth-8}}function directionNorthWest(){let e=getScreenBBox(window);return{top:e.nw.y-i.offsetHeight,left:e.nw.x-i.offsetWidth}}function directionNorthEast(){let e=getScreenBBox(window);return{top:e.ne.y-i.offsetHeight,left:e.ne.x}}function directionSouthWest(){let e=getScreenBBox(window);return{top:e.sw.y,left:e.sw.x-i.offsetWidth}}function directionSouthEast(){let e=getScreenBBox(window);return{top:e.se.y,left:e.se.x}}function initNode(){let e=(0,o.select)(document.createElement(`div`));return e.attr(`class`,`d3-tip`).style(`position`,`absolute`).style(`top`,`0px`).style(`opacity`,0).style(`pointer-events`,`none`).style(`box-sizing`,`border-box`),e.node()}function getSVGNode(e){let t=e.node();return t?t.tagName.toLowerCase()===`svg`?t:t.ownerSVGElement:null}function getNodeEl(){return i??(i=initNode(),r().appendChild(i)),(0,o.select)(i)}function getScreenBBox(e){let t=c||e;for(;t.getCTM==null&&t.parentNode!=null;)t=t.parentNode;let n={},r=t.getCTM(),i=t.getBBox(),a=i.width,o=i.height,l=i.x,u=i.y;return s.x=l,s.y=u,n.nw=s.matrixTransform(r),s.x+=a,n.ne=s.matrixTransform(r),s.y+=o,n.se=s.matrixTransform(r),s.x-=a,n.sw=s.matrixTransform(r),s.y-=o/2,n.w=s.matrixTransform(r),s.x+=a,n.e=s.matrixTransform(r),s.x-=a/2,s.y-=o/2,n.n=s.matrixTransform(r),s.y+=o,n.s=s.matrixTransform(r),n}function functor(e){return typeof e==`function`?e:function(){return e}}return tip}function ITooltip(){if(this.tooltip=tip(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=(0,o.format)(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=(0,o.format)(this.tooltipValueFormat())),this.layerEnter){let e=this.layerEnter;this.layerEnter=function(t,n,r){this._parentOverlay||=t._parentOverlay,this.tooltipEnter(n),e.apply(this,arguments)};let t=this.layerUpdate;this.layerUpdate=function(e){t.apply(this,arguments),this.tooltipUpdate()};let n=this.layerExit;this.layerExit=function(e){this.tooltipExit(),n.apply(this,arguments)}}else{let e=this.enter;this.enter=function(t,n){this.tooltipEnter(n),e.apply(this,arguments)};let t=this.update;this.update=function(e,n){t.apply(this,arguments),this.tooltipUpdate()};let n=this.exit;this.exit=function(e,t){this.tooltipExit(),n.apply(this,arguments)}}}ITooltip.prototype=Object.create(o.Widget.prototype),ITooltip.prototype.constructor=ITooltip,ITooltip.prototype.tooltipEnter=function(e){let t=this.parentOverlay();t.empty()||this.tooltip.rootElement(t.node().parentNode),e.call(this.tooltip)},ITooltip.prototype.tooltipUpdate=function(){this.tooltip.offset(()=>{if(event&&this.tooltipFollowMouse()){let e=document.querySelector(`.d3-tip`);return e.style.display=`block`,e.style.left=this.tooltipOffset()+event.clientX+`px`,e.style.top=event.clientY+`px`,[]}switch(this.tooltip.direction()()){case`e`:return[0,this.tooltipOffset()];default:return[-this.tooltipOffset(),0]}});let e=this.tooltip.attr(`class`);e&&(e=e.split(` notick`).join(``)+(this.tooltipTick()?``:` notick`)+(this.tooltipStyle()===`none`?` hidden`:``),e=e.split(` `).filter(function(e){return e.indexOf(`ITooltip-tooltipStyle-`)!==0}).join(` `),e+=` ITooltip-tooltipStyle-`+this.tooltipStyle(),this.tooltip.attr(`class`,e))},ITooltip.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},ITooltip.prototype._tooltipHTML=function(e){return e},ITooltip.prototype.tooltipHTML=function(e){return this.tooltip.html(e)},ITooltip.prototype.tooltipFormat=function(e={}){switch(e.label=e.label===void 0?``:e.label,this._labelFormatter?e.label=this._labelFormatter(e.label)||``:this.formatData&&this.parseData&&(e.label=this.formatData(this.parseData(e.label))),e.series=e.series||``,e.value instanceof Date?e.value=e.value||``:this._valueFormatter?e.value=this._valueFormatter(e.value)||``:this.formatValue&&this.parseValue&&(e.value=this.formatValue(this.parseValue(e.value))),this.tooltipStyle()){case`none`:break;case`series-table`:let t=`<table class="ITooltip-series-table"><thead><tr><th colspan="2">`+e.label+`</th></tr></thead><tbody>`;return e.arr.forEach(function(e){t+=`<tr>`,t+=`<td>`,t+=`<div class="series-table-row-color" style="background-color:`+e.color+`"></div>`,t+=`<div class="series-table-row-label">`+e.label+`</div>`,t+=`</td>`,t+=`<td><div class="series-table-row-value">`+e.value+`</div></td>`,t+=`</tr>`}),t+=`</tbody>`,t+=`</table>`,t;default:return e.series?`<span style='color:`+this.tooltipSeriesColor()+`'>`+e.series+`</span> / <span style='color:`+this.tooltipLabelColor()+`'>`+e.label+`</span>: <span style='color:`+this.tooltipValueColor()+`'>`+e.value+`</span>`:e.label===``?`<span style='color:`+this.tooltipValueColor()+`'>`+e.value+`</span>`:`<span style='color:`+this.tooltipLabelColor()+`'>`+e.label+`</span>: <span style='color:`+this.tooltipValueColor()+`'>`+e.value+`</span>`}},ITooltip.prototype.tooltipKeyValueFormat=function(e,t){let n=``;for(let r in t)if(r!==e){let e=t&&t[r]?t[r]:``;n+=`<tr><td style="${this.tooltipLabelColor_exists()?`color:`+this.tooltipLabelColor():``}">${r}</td><td style="font-weight:normal">${e}</td></tr>`}return`<table>
|
|
4
|
+
`)[0],count:this.kindMap[t].length});return e}vertices(e){let t=[];for(let n of this.kindMap[e])t.push(this.verticesMap[n._.Id]);return t}formatRow(e,t,n){let r=e._.formattedAttrs();for(let e in r){let i=t.indexOf(e);i===-1?(t.push(e),n.push(r[e])):n[i]=r[e]}for(let e=0;e<100;++e)n[e]===void 0&&(n[e]=``);return n}activityData(){let e=[`Id`,`Kind`,`Label`];return{columns:e,data:this.graphDB.vertices.map(t=>{let n=[parseInt(t._.Id.split(`a`)[1])];return this.formatRow(t,e,n)})}}edgeData(){let e=[`Id`,`Label`];return{columns:e,data:this.graphDB.edges.map(t=>{let n=[t._.Id];return this.formatRow(t,e,n)})}}subgraphData(){let e=[`Id`,`Label`];return{columns:e,data:this.graphDB.subgraphs.map(t=>{let n=[t._.Id];return this.formatRow(t,e,n)})}}calcGraphTooltip(e){let t,n;if(e instanceof c.Subgraph){let r=this.rSubgraphsMap[e.id()];t=r._,n=r.parent._}else if(e instanceof c.Vertex||e instanceof o.Icon){let r=this.rVerticesMap[e.id()];t=r._,n=r.parent._}else if(e instanceof c.Edge){let r=this.rEdgesMap[e.id()];t=r._,n=r.parent._}return t?t.calcTooltip(n):``}subgraph(e){return this.subgraphsMap[e]}vertex(e){return this.verticesMap[e]}edge(e){return this.edgesMap[e]}minClick(e){}},WUGraph=class extends l.ChartPanel{_partialAll=new o.Button().faChar(`fa-window-restore`).tooltip(`Partial All`).on(`click`,()=>{this.stateClick(this._partialAll)});_maxAll=new o.Button().faChar(`fa-window-maximize`).tooltip(`Max All`).on(`click`,()=>{this.stateClick(this._maxAll)});_toggleGraph=new o.ToggleButton().faChar(`fa-chain`).tooltip(`Graph`).selected(!0).on(`click`,()=>{this.viewClick(this._toggleGraph)});_toggleActivities=new o.ToggleButton().faChar(`fa-table`).tooltip(`Activitiies`).selected(!1).on(`click`,()=>{this.viewClick(this._toggleActivities)});_toggleEdges=new o.ToggleButton().faChar(`fa-table`).tooltip(`Edges`).selected(!1).on(`click`,()=>{this.viewClick(this._toggleEdges)});_toggleSubgraphs=new o.ToggleButton().faChar(`fa-table`).tooltip(`Subgraphs`).selected(!1).on(`click`,()=>{this.viewClick(this._toggleSubgraphs)});_graph=new c.Graph().layout(`Hierarchy`).applyScaleOnLayout(!0).showToolbar(!1).allowDragging(!1);_activities=new s.Table().pagination(!1);_edges=new s.Table().pagination(!1);_subgraphs=new s.Table().pagination(!1);_legend=new WUGraphLegend(this).on(`click`,e=>{this.render()}).on(`mouseover`,e=>{let t={};for(let n of this._gc.vertices(e))t[n.id()]=!0;this._graph.highlightVerticies(t)}).on(`mouseout`,e=>{this._graph.highlightVerticies()});_view=new l.Carousel().widgets([this._graph,this._activities,this._edges,this._subgraphs]);_gc=new WUScopeController;constructor(){super(),this.topOverlay(!1),this.widget(this._view);let e=[this._toggleGraph,this._toggleActivities,this._toggleEdges,this._toggleSubgraphs,new o.Spacer,this._partialAll,this._maxAll,new o.Spacer,...this._graph.iconBarButtons(),new o.Spacer];this.buttons(e.concat(this.buttons())),this._gc.minClick=e=>{this.loadGraph(),this._graph.render(t=>{this._graph.selection([e]).centerOnItem(e)})},this._graph.tooltipHTML(e=>this._gc.calcGraphTooltip(e))}stateClick(e){switch(e){case this._partialAll:this._graph.data().subgraphs.forEach(e=>{e.minState(`partial`)});break;case this._maxAll:this._graph.data().subgraphs.forEach(e=>{e.minState(`normal`)});break}this.render()}viewClick(e){switch(this._toggleGraph.selected(e===this._toggleGraph),this._toggleActivities.selected(e===this._toggleActivities),this._toggleEdges.selected(e===this._toggleEdges),this._toggleSubgraphs.selected(e===this._toggleSubgraphs),e){case this._toggleGraph:this._view.active(0);break;case this._toggleActivities:this._view.active(1);break;case this._toggleEdges:this._view.active(2);break;case this._toggleSubgraphs:this._view.active(3);break}this.render(e=>{})}_prevHashSum;_prevScopeGraph;fetchScopeGraph(){let e=(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid(),graphID:this.graphID(),subgraphID:this.subgraphID()});return!this._prevScopeGraph||this._prevHashSum!==e?(this.startProgress(),this._prevHashSum=e,this._gc.clear(),n.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchGraphs().then(e=>{for(let t of e)if(t.Name===this.graphID())return this.finishProgress(),t.fetchScopeGraph(this.subgraphID())}).then(e=>(this._prevScopeGraph=e,this._prevScopeGraph))):Promise.resolve(this._prevScopeGraph)}enter(e,t){super.enter(e,t)}update(e,t){super.update(e,t)}exit(e,t){super.exit(e,t)}loadGraph(){this._gc.disabled(this._legend.disabled()),this._graph.data(this._gc.graphData(),!0);{let{columns:e,data:t}=this._gc.activityData();this._activities.columns(e).data(t)}{let{columns:e,data:t}=this._gc.edgeData();this._edges.columns(e).data(t)}{let{columns:e,data:t}=this._gc.subgraphData();this._subgraphs.columns(e).data(t)}}render(e){return this.wuid()&&this.graphID()?this.fetchScopeGraph().then(t=>{this._gc.set(t),this._legend.data(this._gc.calcLegend()),this.loadGraph(),super.render(e)}):super.render(e),this}selection(e){if(!arguments.length)return this._graph.selection();let t=this._gc.vertex(e)||this._gc.edge(e)||this._gc.subgraph(e);return t&&this._graph.selection([t]),this}};WUGraph.prototype._class+=` eclwatch_WUGraph`,WUGraph.prototype.publish(`baseUrl`,``,`string`,`HPCC Platform Base URL`),WUGraph.prototype.publish(`wuid`,``,`string`,`Workunit ID`),WUGraph.prototype.publish(`graphID`,``,`string`,`Graph ID`),WUGraph.prototype.publish(`subgraphID`,``,`string`,`Subgraph ID`);function entitiesEncode(e){return String(e).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function safeEncode(e){switch(Object.prototype.toString.call(e)){case`[object Undefined]`:case`[object Boolean]`:case`[object Number]`:return e;case`[object String]`:return entitiesEncode(e);default:console.warn(`Unknown cell type: `+Object.prototype.toString.call(e))}return e}var Store=class{wuResult;schema;_columns;_cache={};rowFormatter;_filter={};onError;constructor(e,t,n,r={},i){this.wuResult=e,this.schema=t,this._columns=this.schema2Columns(this.schema.root),this.rowFormatter=new s.RowFormatter(this._columns,n),this._filter=r,this.onError=i}columns(){return this._columns}schema2Columns(e,t=``){return e?e.children().filter(e=>e.name.indexOf(`__hidden`,e.name.length-8)===-1).map((e,n)=>{let r=e.name,i=e.attrs[`hpcc:keyed`],a={field:t+r,leafID:r,idx:n,label:r+(i?` (i)`:``),className:`resultGridCell`,hidden:!1,sortable:!1,width:i?16:0,isSet:e.isSet},o=this.schema2Columns(e,t+r+`_`);return o.length?(a.width+=10+o.reduce((e,t)=>e+t.width,0),a.children=o):(a.width+=e.charWidth()*9,a.formatter=(e,t)=>{switch(typeof e){case`string`:return{html:e.replace(/\t/g,` `).trim()};case`undefined`:return``}return e}),a}):[]}isChildDataset(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=0,n=null;for(let r in e)n||=Object.prototype.toString.call(e[r]),t++;return t===1&&n===`[object Array]`}rowToTable(e,t,n){if(this.isChildDataset(e)){for(let r in e)this.rowToTable(e[r],t,n);return}let r=s.domConstruct.create(`table`,{border:1,cellspacing:0,width:`100%`},n);switch(Object.prototype.toString.call(e)){case`[object Object]`:let i=s.domConstruct.create(`tr`,null,r);for(let t in e)s.domConstruct.create(`th`,{innerHTML:safeEncode(t)},i);i=s.domConstruct.create(`tr`,null,r);for(let r in e)switch(Object.prototype.toString.call(e[r])){case`[object Object]`:case`[object Array]`:this.rowToTable(e[r],t,n);break;default:s.domConstruct.create(`td`,{innerHTML:safeEncode(e[r])},i);break}break;case`[object Array]`:for(let t=0;t<e.length;++t)switch(Object.prototype.toString.call(e[t])){case`[object Boolean]`:case`[object Number]`:case`[object String]`:let n=s.domConstruct.create(`tr`,null,r);s.domConstruct.create(`td`,{innerHTML:safeEncode(e[t])},n);break;default:if(t===0){let n=s.domConstruct.create(`tr`,null,r);for(let r in e[t])s.domConstruct.create(`th`,{innerHTML:safeEncode(r)},n)}s.domConstruct.create(`tr`,null,r);for(let r in e[t])if(e[t][r])if(Object.prototype.toString.call(e[t][r])===`[object Object]`||Object.prototype.toString.call(e[t][r])===`[object Array]`){let i=s.domConstruct.create(`td`,null,n);this.rowToTable(e[t][r],e[t],i)}else if(r.indexOf(`__html`,r.length-6)!==-1)s.domConstruct.create(`td`,{innerHTML:e[t][r]},n);else if(r.indexOf(`__javascript`,r.length-12)!==-1)s.domConstruct.create(`td`,null,n);else{let i=e[t][r];s.domConstruct.create(`td`,{innerHTML:safeEncode(i)},n)}else s.domConstruct.create(`td`,{innerHTML:``},n)}break}}getIdentity(e){return e.__hpcc_id}_request(e,t){if(!this.wuResult)return Promise.resolve({totalLength:0,data:[]});let n=`${e}->${t}`;if(this._cache[n])return this._cache[n];let r=this.wuResult.fetchRows(e,t-e,!1,this._filter).then(t=>({totalLength:this.wuResult.Total,data:t.map((t,n)=>{let r=this.rowFormatter.format(t);return r.__hpcc_id=e+n,r.__hpcc_orig=t,r})})).catch(e=>(this.onError(e.Message||`An exception has occurred`),{totalLength:0,data:[]}));return this._cache[n]=r,r}fetchRange(e){let t=new s.Deferred;return this._request(e.start,e.end).then(e=>t.resolve(e)),new s.QueryResults(t.then(e=>e.data),{totalLength:t.then(e=>e.totalLength)})}},WUResult=class extends s.Common{_result;_localStore;constructor(){super(),this.renderHtml(!1)}hashSum(e={}){return(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid(),resultName:this.resultName(),sequence:this.sequence(),nodeGroup:this.nodeGroup(),logicalFile:this.logicalFile(),userID:this.user(),password:this.password(),bypassCache:this.bypassCache(),...e})}_prevResultHash;calcResult(){let e=this.hashSum();if(this._prevResultHash!==e){this._prevResultHash=e;let t={baseUrl:this.baseUrl(),userID:this.user(),password:this.password()};this.wuid()&&this.resultName()?this._result=n.Result.attach(t,this.wuid(),this.resultName()):this.wuid()&&this.sequence()!==void 0?this._result=n.Result.attach(t,this.wuid(),this.sequence()):this.logicalFile()&&this.nodeGroup()?this._result=n.Result.attachLogicalFile(t,this.nodeGroup(),this.logicalFile()):this.logicalFile()&&(this._result=n.Result.attachLogicalFile(t,``,this.logicalFile())),this._result&&this.bypassCache()&&this._result.bypassCache(this.bypassCache())}return this._result}fetch(e,t,n=new AbortController){let r=this.calcResult();return r?r.fetchRows(e,t,!1,{},n.signal):Promise.resolve([])}_prevStoreHash;_prevQueryHash;update(e,t){super.update(e,t);let n=this.hashSum({renderHtml:this.renderHtml(),filter:this.filter()});if(this._prevStoreHash!==n){this._prevStoreHash=n;let e=this.calcResult();e&&e.fetchXMLSchema().then(t=>{this._localStore=new Store(e,t,this.renderHtml(),this.filter(),e=>{this._dgrid&&(this._dgrid.noDataMessage=`<span class='dojoxGridNoData'>${e}</span>`,this._dgrid.refresh())}),this._dgrid?.set(`columns`,this._localStore.columns()),this._dgrid?.set(`collection`,this._localStore)})}}click(e,t,n){}};WUResult.prototype._class+=` eclwatch_WUResult`,WUResult.prototype.publish(`baseUrl`,``,`string`,`URL to WsWorkunits`),WUResult.prototype.publish(`user`,``,`string`,`User ID`),WUResult.prototype.publish(`password`,``,`string`,`Password`),WUResult.prototype.publish(`wuid`,``,`string`,`Workunit ID`),WUResult.prototype.publish(`resultName`,``,`string`,`Result Name`),WUResult.prototype.publish(`sequence`,void 0,`number`,`Sequence Number`),WUResult.prototype.publish(`nodeGroup`,``,`string`,`NodeGroup`),WUResult.prototype.publish(`logicalFile`,``,`string`,`Logical File Name`),WUResult.prototype.publish(`filter`,{},`object`,`Filter`),WUResult.prototype.publish(`bypassCache`,!1,`boolean`,`Bypass cached results`);var m=function(e){return e.CREATE=`Created`,e.COMPILE=`Compiled`,e.EXECUTE=`Executed`,e.COMPLETE=`Completed`,e}({}),h=function(e){return e.CREATE=`Creating`,e.COMPILE=`Compiling`,e.EXECUTE=`Executing`,e.COMPLETE=`Completed`,e}({}),WUStatus=class extends c.Graph{_wu;_wuHandle;_create;_compile;_execute;_complete;constructor(){super(),this.zoomable(!1).zoomToFitLimit(1).layout(`Hierarchy`).hierarchyRankDirection(`LR`).showToolbar(!1).allowDragging(!1)}_prevHash;attachWorkunit(){let e=(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==e&&(this._prevHash=e,this._wu=n.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()),this._wuHandle&&this._wuHandle.release(),this._wuHandle=this._wu.watch(e=>{this.lazyRender()}))}createVertex(e){return new c.Vertex().icon_diameter(32).icon_shape_colorFill(`none`).icon_shape_colorStroke(`none`).icon_image_colorFill(`darkgray`).iconAnchor(`middle`).textbox_shape_colorFill(`none`).textbox_shape_colorStroke(`none`).textbox_text_colorFill(`darkgray`).faChar(e)}updateVertex(e,t){e.icon_image_colorFill(t).textbox_text_colorFill(t)}updateVertexStatus(e,t=!1){let n=this._wu.isFailed()?`darkred`:`darkgreen`;switch(this._create.text(m.CREATE),this._compile.text(m.COMPILE),this._execute.text(m.EXECUTE),this._complete.text(m.COMPLETE),e){case 0:this.updateVertex(this._create,`darkgray`),this.updateVertex(this._compile,`darkgray`),this.updateVertex(this._execute,`darkgray`),this.updateVertex(this._complete,`darkgray`);break;case 1:this._create.text(h.CREATE),this.updateVertex(this._create,t?`orange`:n),this.updateVertex(this._compile,`darkgray`),this.updateVertex(this._execute,`darkgray`),this.updateVertex(this._complete,`darkgray`);break;case 2:this._compile.text(h.COMPILE),this.updateVertex(this._create,n),this.updateVertex(this._compile,t?`orange`:n),this.updateVertex(this._execute,n),this.updateVertex(this._complete,`darkgray`);break;case 3:this._execute.text(h.EXECUTE),this.updateVertex(this._create,n),this.updateVertex(this._compile,n),this.updateVertex(this._execute,t?`orange`:n),this.updateVertex(this._complete,`darkgray`);break;case 4:this.updateVertex(this._create,n),this.updateVertex(this._compile,n),this.updateVertex(this._execute,n),this.updateVertex(this._complete,n);break}}createEdge(e,t){return new c.Edge().sourceVertex(e).targetVertex(t).strokeColor(`black`).showArc(!1)}enter(e,t){super.enter(e,t),this._create=this.createVertex(``),this._compile=this.createVertex(``),this._execute=this.createVertex(``),this._complete=this.createVertex(``);let n=this.createEdge(this._create,this._compile),r=this.createEdge(this._compile,this._execute),i=this.createEdge(this._execute,this._complete);this.data({vertices:[this._create,this._compile,this._execute,this._complete],edges:[n,r,i]})}update(e,t){switch(this.attachWorkunit(),this._wu.StateID){case n.WUStateID.Blocked:case n.WUStateID.Wait:case n.WUStateID.Scheduled:case n.WUStateID.UploadingFiled:this.updateVertexStatus(1);break;case n.WUStateID.Compiling:this.updateVertexStatus(2,!0);break;case n.WUStateID.Submitted:this.updateVertexStatus(1,!0);break;case n.WUStateID.Compiled:this.updateVertexStatus(2);break;case n.WUStateID.Aborting:case n.WUStateID.Running:this.updateVertexStatus(3,!0);break;case n.WUStateID.Aborted:case n.WUStateID.Archived:case n.WUStateID.Completed:this.updateVertexStatus(4);break;case n.WUStateID.Failed:this.updateVertexStatus(4,!1);break;case n.WUStateID.DebugPaused:case n.WUStateID.DebugRunning:case n.WUStateID.Paused:case n.WUStateID.Unknown:default:this.updateVertexStatus(0);break}super.update(e,t),this.zoomToFit()}exit(e,t){this._wuHandle&&this._wuHandle.release(),super.exit(e,t)}};WUStatus.prototype._class+=` eclwatch_WUStatus`,WUStatus.prototype.publish(`baseUrl`,``,`string`,`HPCC Platform Base URL`),WUStatus.prototype.publish(`wuid`,``,`string`,`Workunit ID`);function I1DChart(){}I1DChart.prototype._dataFamily=`1D`,I1DChart.prototype._palette=o.Palette.rainbow(`default`),I1DChart.prototype.click=function(e,t,n){},I1DChart.prototype.dblclick=function(e,t,n){};function I2DChart(){}I2DChart.prototype._dataFamily=`2D`,I2DChart.prototype._palette=o.Palette.ordinal(`default`),I2DChart.prototype.fillColor=function(e,t,n,r){return this._palette(e[0])},I2DChart.prototype.strokeColor=function(e,t,n,r){return(0,o.hsl)(this.fillColor(e,t,n,r)).darker().toString()},I2DChart.prototype.textColor=function(e,t,n,r){return o.Palette.textColor(this.fillColor(e,t,n,r))},I2DChart.prototype.click=function(e,t,n){},I2DChart.prototype.dblclick=function(e,t,n){};function I2DAggrChart(){}I2DAggrChart.prototype._palette=o.Palette.rainbow(`default`),I2DAggrChart.prototype.fillColor=function(e,t,n){return this._palette(e.length)},I2DAggrChart.prototype.strokeColor=function(e,t,n){return(0,o.hsl)(this.fillColor(e,t,n)).darker().toString()},I2DAggrChart.prototype.textColor=function(e,t,n){return o.Palette.textColor(this.fillColor(e,t,n))},I2DAggrChart.prototype.click=function(e,t,n){},I2DAggrChart.prototype.dblclick=function(e,t,n){};function IGraph(){}IGraph.prototype._dataFamily=`graph`,IGraph.prototype.vertex_click=function(e,t,n,r){r&&r.vertex},IGraph.prototype.vertex_dblclick=function(e,t,n,r){r&&r.vertex},IGraph.prototype.edge_click=function(e,t,n,r){r&&r.edge},IGraph.prototype.edge_dblclick=function(e,t,n,r){r&&r.edge};function IInput(){}IInput.prototype=Object.create(o.Widget.prototype),IInput.prototype.constructor=IInput,IInput.prototype.isValid=function(){return!(this.validate()&&!new RegExp(this.validate()).test(this.value()))},IInput.prototype.hasValue=function(){if(typeof this.type==`function`){switch(this.type()){case`radio`:case`checkbox`:if(this.value()&&this.value()!==`false`)return!0;break;default:if(this.value())return!0;break}return!1}return this.value()!==``},IInput.prototype.blur=function(e){},IInput.prototype.keyup=function(e){},IInput.prototype.focus=function(e){},IInput.prototype.click=function(e){},IInput.prototype.dblclick=function(e){},IInput.prototype.change=function(e,t){},IInput.prototype.resetValue=function(e){e.value(e._inputElement[0].node().value)},IInput.prototype.disable=function(e){this._inputElement.forEach(function(t,n){t.attr(`disabled`,e?`disabled`:null)})},IInput.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},IInput.prototype.publish(`name`,``,`string`,`HTML name for the input`),IInput.prototype.publish(`label`,``,`string`,`Descriptive label`),IInput.prototype.publish(`value`,``,`string`,`Input Current Value`),IInput.prototype.publish(`validate`,null,`string`,`Input Validation`);function INDChart(){}INDChart.prototype._dataFamily=`ND`,INDChart.prototype._palette=o.Palette.ordinal(`default`),INDChart.prototype.fillColor=function(e,t,n,r){return this._palette(t)},INDChart.prototype.strokeColor=function(e,t,n,r){return(0,o.hsl)(this.fillColor(e,t,n,r)).darker().toString()},INDChart.prototype.textColor=function(e,t,n,r){return o.Palette.textColor(this.fillColor(e,t,n,r))},INDChart.prototype.click=function(e,t,n){},INDChart.prototype.dblclick=function(e,t,n){};function tip(){let e=d3TipDirection,t=d3TipOffset,n=d3TipHTML,r=functor(document.body),i=initNode(),a=null,s=null,c=null,tip=function(e){if(a=getSVGNode(e),!a)return;s=a.createSVGPoint();let t=r();t&&i&&t.appendChild(i)};tip.show=function(e,i,a){c=a[i];let o=Array.prototype.slice.call(arguments),s=n.apply(this,o);if(s===null)return tip;let d=t.apply(this,o),f=getNodeEl(),p=u.length,m,h=r().getBoundingClientRect();for(f.html(s).style(`opacity`,1).style(`pointer-events`,`all`);p--;)f.classed(u[p],!1);let g=!1,_={},v=u[0];for(let e=0;e<u.length&&(g=_placement_attempt(u[e]),!g);e++);if(g)f.classed(`notick`,!1);else{f.classed(`notick`,!0);let e=_vertical_adjustment(_[v]),t=_horizontal_adjustment(_[v]);_placement_attempt(v,e,t)}return tip;function _horizontal_adjustment(e){return e.left>e.right?e.left>0?-e.left:0:e.right>0?e.right:0}function _vertical_adjustment(e){return e.top>e.bottom?e.top>0?-e.top:0:e.bottom}function _placement_attempt(e,t,n){t||=0,n||=0,f.style(`white-space`,`nowrap`),m=l.get(e).apply(this),f.classed(e,!0).style(`top`,m.top+d[0]-t+`px`).style(`left`,m.left+d[1]-n+`px`);let r=f.node().getBoundingClientRect(),i=r.top>h.top&&r.left>h.left&&r.bottom<h.bottom&&r.right<h.right;return _[e]={top:h.top-r.top,right:r.right-h.right,bottom:r.bottom-h.bottom,left:h.left-r.left},f.style(`white-space`,`normal`),_[e].total_overflow=Object.keys(_[e]).filter(t=>_[e][t]>0).reduce((t,n)=>t+_[e][n],0),_[v].total_overflow>_[e].total_overflow&&(v=e),i||f.classed(e,!1),i}},tip.hide=function(){return getNodeEl().style(`opacity`,0).style(`pointer-events`,`none`),tip},tip.attr=function(e,t){if(arguments.length<2&&typeof e==`string`)return getNodeEl().attr(e);let n=Array.prototype.slice.call(arguments);return o.selection.prototype.attr.apply(getNodeEl(),n),tip},tip.style=function(e,t){if(arguments.length<2&&typeof e==`string`)return getNodeEl().style(e);let n=Array.prototype.slice.call(arguments);return o.selection.prototype.style.apply(getNodeEl(),n),tip},tip.direction=function(t){return arguments.length?(e=t==null?t:functor(t),tip):e},tip.offset=function(e){return arguments.length?(t=e==null?e:functor(e),tip):t},tip.html=function(e){return arguments.length?(n=e==null?e:functor(e),tip):n},tip.rootElement=function(e){return arguments.length?(r=functor(e),tip):r},tip.destroy=function(){return i&&=(getNodeEl().remove(),null),tip};function d3TipDirection(){return`n`}function d3TipOffset(){return[0,0]}function d3TipHTML(){return` `}let l=(0,o.map)({n:directionNorth,s:directionSouth,e:directionEast,w:directionWest,nw:directionNorthWest,ne:directionNorthEast,sw:directionSouthWest,se:directionSouthEast}),u=l.keys();function directionNorth(){let e=getScreenBBox(window);return{top:e.n.y-i.offsetHeight,left:e.n.x-i.offsetWidth/2}}function directionSouth(){let e=getScreenBBox(window);return{top:e.s.y+8,left:e.s.x-i.offsetWidth/2}}function directionEast(){let e=getScreenBBox(window);return{top:e.e.y-i.offsetHeight/2,left:e.e.x+8}}function directionWest(){let e=getScreenBBox(window);return{top:e.w.y-i.offsetHeight/2,left:e.w.x-i.offsetWidth-8}}function directionNorthWest(){let e=getScreenBBox(window);return{top:e.nw.y-i.offsetHeight,left:e.nw.x-i.offsetWidth}}function directionNorthEast(){let e=getScreenBBox(window);return{top:e.ne.y-i.offsetHeight,left:e.ne.x}}function directionSouthWest(){let e=getScreenBBox(window);return{top:e.sw.y,left:e.sw.x-i.offsetWidth}}function directionSouthEast(){let e=getScreenBBox(window);return{top:e.se.y,left:e.se.x}}function initNode(){let e=(0,o.select)(document.createElement(`div`));return e.attr(`class`,`d3-tip`).style(`position`,`absolute`).style(`top`,`0px`).style(`opacity`,0).style(`pointer-events`,`none`).style(`box-sizing`,`border-box`),e.node()}function getSVGNode(e){let t=e.node();return t?t.tagName.toLowerCase()===`svg`?t:t.ownerSVGElement:null}function getNodeEl(){return i??(i=initNode(),r().appendChild(i)),(0,o.select)(i)}function getScreenBBox(e){let t=c||e;for(;t.getCTM==null&&t.parentNode!=null;)t=t.parentNode;let n={},r=t.getCTM(),i=t.getBBox(),a=i.width,o=i.height,l=i.x,u=i.y;return s.x=l,s.y=u,n.nw=s.matrixTransform(r),s.x+=a,n.ne=s.matrixTransform(r),s.y+=o,n.se=s.matrixTransform(r),s.x-=a,n.sw=s.matrixTransform(r),s.y-=o/2,n.w=s.matrixTransform(r),s.x+=a,n.e=s.matrixTransform(r),s.x-=a/2,s.y-=o/2,n.n=s.matrixTransform(r),s.y+=o,n.s=s.matrixTransform(r),n}function functor(e){return typeof e==`function`?e:function(){return e}}return tip}function ITooltip(){if(this.tooltip=tip(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=(0,o.format)(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=(0,o.format)(this.tooltipValueFormat())),this.layerEnter){let e=this.layerEnter;this.layerEnter=function(t,n,r){this._parentOverlay||=t._parentOverlay,this.tooltipEnter(n),e.apply(this,arguments)};let t=this.layerUpdate;this.layerUpdate=function(e){t.apply(this,arguments),this.tooltipUpdate()};let n=this.layerExit;this.layerExit=function(e){this.tooltipExit(),n.apply(this,arguments)}}else{let e=this.enter;this.enter=function(t,n){this.tooltipEnter(n),e.apply(this,arguments)};let t=this.update;this.update=function(e,n){t.apply(this,arguments),this.tooltipUpdate()};let n=this.exit;this.exit=function(e,t){this.tooltipExit(),n.apply(this,arguments)}}}ITooltip.prototype=Object.create(o.Widget.prototype),ITooltip.prototype.constructor=ITooltip,ITooltip.prototype.tooltipEnter=function(e){let t=this.parentOverlay();t.empty()||this.tooltip.rootElement(t.node().parentNode),e.call(this.tooltip)},ITooltip.prototype.tooltipUpdate=function(){this.tooltip.offset(()=>{if(event&&this.tooltipFollowMouse()){let e=document.querySelector(`.d3-tip`);return e.style.display=`block`,e.style.left=this.tooltipOffset()+event.clientX+`px`,e.style.top=event.clientY+`px`,[]}switch(this.tooltip.direction()()){case`e`:return[0,this.tooltipOffset()];default:return[-this.tooltipOffset(),0]}});let e=this.tooltip.attr(`class`);e&&(e=e.split(` notick`).join(``)+(this.tooltipTick()?``:` notick`)+(this.tooltipStyle()===`none`?` hidden`:``),e=e.split(` `).filter(function(e){return e.indexOf(`ITooltip-tooltipStyle-`)!==0}).join(` `),e+=` ITooltip-tooltipStyle-`+this.tooltipStyle(),this.tooltip.attr(`class`,e))},ITooltip.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},ITooltip.prototype._tooltipHTML=function(e){return e},ITooltip.prototype.tooltipHTML=function(e){return this.tooltip.html(e)},ITooltip.prototype.tooltipFormat=function(e={}){switch(e.label=e.label===void 0?``:e.label,this._labelFormatter?e.label=this._labelFormatter(e.label)||``:this.formatData&&this.parseData&&(e.label=this.formatData(this.parseData(e.label))),e.series=e.series||``,e.value instanceof Date?e.value=e.value||``:this._valueFormatter?e.value=this._valueFormatter(e.value)||``:this.formatValue&&this.parseValue&&(e.value=this.formatValue(this.parseValue(e.value))),this.tooltipStyle()){case`none`:break;case`series-table`:let t=`<table class="ITooltip-series-table"><thead><tr><th colspan="2">`+e.label+`</th></tr></thead><tbody>`;return e.arr.forEach(function(e){t+=`<tr>`,t+=`<td>`,t+=`<div class="series-table-row-color" style="background-color:`+e.color+`"></div>`,t+=`<div class="series-table-row-label">`+e.label+`</div>`,t+=`</td>`,t+=`<td><div class="series-table-row-value">`+e.value+`</div></td>`,t+=`</tr>`}),t+=`</tbody>`,t+=`</table>`,t;default:return e.series?`<span style='color:`+this.tooltipSeriesColor()+`'>`+e.series+`</span> / <span style='color:`+this.tooltipLabelColor()+`'>`+e.label+`</span>: <span style='color:`+this.tooltipValueColor()+`'>`+e.value+`</span>`:e.label===``?`<span style='color:`+this.tooltipValueColor()+`'>`+e.value+`</span>`:`<span style='color:`+this.tooltipLabelColor()+`'>`+e.label+`</span>: <span style='color:`+this.tooltipValueColor()+`'>`+e.value+`</span>`}},ITooltip.prototype.tooltipKeyValueFormat=function(e,t){let n=``;for(let r in t)if(r!==e){let e=t&&t[r]?t[r]:``;n+=`<tr><td style="${this.tooltipLabelColor_exists()?`color:`+this.tooltipLabelColor():``}">${r}</td><td style="font-weight:normal">${e}</td></tr>`}return`<table>
|
|
5
5
|
<thead>
|
|
6
6
|
<tr><th colspan="2" style="font-weight:bold;font-size:16px">${t[e]}</th></tr>
|
|
7
7
|
</thead>
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
${n}
|
|
10
10
|
</tbody>
|
|
11
11
|
</table>`},ITooltip.prototype.publish(`tooltipStyle`,`default`,`set`,`Style mode`,[`default`,`none`,`series-table`],{}),ITooltip.prototype.publish(`tooltipFollowMouse`,!1,`boolean`,`If true, the tooltip will follow mouse movement`,null,{}),ITooltip.prototype.publish(`tooltipLabelFormat`,void 0,`string`,`Format of tooltip label(s) (the domain axis)`,null,{}),ITooltip.prototype.publish(`tooltipValueFormat`,void 0,`string`,`Number format of tooltip value(s)`,null,{}),ITooltip.prototype.publish(`tooltipSeriesColor`,`#EAFFFF`,`html-color`,`Color of tooltip series text`,null,{}),ITooltip.prototype.publish(`tooltipLabelColor`,`#CCFFFF`,`html-color`,`Color of tooltip label text (the domain axis)`,null,{}),ITooltip.prototype.publish(`tooltipValueColor`,`white`,`html-color`,`Color of tooltip value(s)`,null,{}),ITooltip.prototype.publish(`tooltipTick`,!0,`boolean`,`Show tooltip tick`,null,{}),ITooltip.prototype.publish(`tooltipOffset`,8,`number`,`Offset from the cursor`,null,{});var g=ITooltip.prototype.tooltipLabelFormat;ITooltip.prototype.tooltipLabelFormat=function(e){let t=g.apply(this,arguments);return arguments.length&&(this._labelFormatter=(0,o.format)(e)),t};var _=ITooltip.prototype.tooltipValueFormat;ITooltip.prototype.tooltipValueFormat=function(e){let t=_.apply(this,arguments);return arguments.length&&(this._valueFormatter=(0,o.format)(e)),t};function ITree(){}ITree.prototype.constructor=ITree,ITree.prototype.click=function(e,t,n){},ITree.prototype.dblclick=function(e,t,n){},ITree.prototype._palette=o.Palette.ordinal(`default`),(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.d3-tip{color:#fff;z-index:10;background:#000000a8;border-radius:2px;padding:12px;font-weight:700;line-height:1;pointer-events:none!important}.d3-tip.hidden{visibility:hidden}.d3-tip:after{content:" ";box-sizing:border-box;border:4px solid #000000a8;width:8px;height:8px;margin:0;display:inline-block;position:absolute;pointer-events:none!important}.d3-tip.n:after{border-top-width:8px;border-bottom-color:#0000;border-left-color:#0000;border-right-color:#0000;top:100%;left:calc(50% - 4px)}.d3-tip.e:after{border-top-color:#0000;border-bottom-color:#0000;border-left-color:#0000;border-right-width:8px;top:calc(50% - 4px);left:-12px}.d3-tip.s{margin-top:8px}.d3-tip.s:after{border-top-color:#0000;border-bottom-width:8px;border-left-color:#0000;border-right-color:#0000;top:-12px;left:calc(50% - 4px)}.d3-tip.w:after{border-top-color:#0000;border-bottom-color:#0000;border-left-width:8px;border-right-color:#0000;top:calc(50% - 4px);left:100%}.d3-tip.notick:after{border-color:#0000!important}.common_Widget .over{stroke:#000000a8;opacity:.66}.d3-tip.ITooltip-tooltipStyle-series-table{padding:0}.d3-tip .ITooltip-series-table th,.d3-tip .ITooltip-series-table td{text-align:left;border:1px solid #d1d1d1;padding:6px}.d3-tip .ITooltip-series-table .series-table-row-color{width:10px;height:10px;margin-right:10px;display:inline-block}.d3-tip .ITooltip-series-table .series-table-row-label{display:inline-block}.d3-tip .ITooltip-series-table th{background-color:#b3b3b3}.d3-tip .ITooltip-series-table td{color:#555;background-color:#fff;font-weight:400}.d3-tip .ITooltip-series-table td:first-child{border-right:0}table.ITooltip-series-table td:last-child{border-left:1px dotted #a3a3a3}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();var v=Object.defineProperty,__name=(e,t)=>v(e,`name`,{value:t,configurable:!0}),b=Math.PI,S=2*b,C=1e-6,w=S-C;function Path(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function path(){return new Path}Path.prototype=path.prototype={constructor:Path,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(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,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(d>C)if(!(Math.abs(u*s-c*l)>C)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((b-Math.acos((m+d-h)/(2*g*_)))/2),S=v/_,w=v/g;Math.abs(S-1)>C&&(this._+=`L`+(e+S*l)+`,`+(t+S*u)),this._+=`A`+i+`,`+i+`,0,0,`+ +(u*f>l*p)+`,`+(this._x1=e+w*s)+`,`+(this._y1=t+w*c)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+c+`,`+l:(Math.abs(this._x1-c)>C||Math.abs(this._y1-l)>C)&&(this._+=`L`+c+`,`+l),n&&(d<0&&(d=d%S+S),d>w?this._+=`A`+n+`,`+n+`,0,1,`+u+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+u+`,`+(this._x1=c)+`,`+(this._y1=l):d>C&&(this._+=`A`+n+`,`+n+`,0,`+ +(d>=b)+`,`+u+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}};function constant_default$3(e){return function constant(){return e}}__name(constant_default$3,`default`);var T=Math.abs,E=Math.atan2,D=Math.cos,O=Math.max,k=Math.min,A=Math.sin,j=Math.sqrt,M=Math.PI,N=M/2,P=2*M;function acos(e){return e>1?0:e<-1?M:Math.acos(e)}function asin$1(e){return e>=1?N:e<=-1?-N:Math.asin(e)}__name(asin$1,`asin`);function arcInnerRadius$1(e){return e.innerRadius}__name(arcInnerRadius$1,`arcInnerRadius`);function arcOuterRadius$1(e){return e.outerRadius}__name(arcOuterRadius$1,`arcOuterRadius`);function arcStartAngle$1(e){return e.startAngle}__name(arcStartAngle$1,`arcStartAngle`);function arcEndAngle$1(e){return e.endAngle}__name(arcEndAngle$1,`arcEndAngle`),__name(arc_default$1,`default`);function arcPadAngle$1(e){return e&&e.padAngle}__name(arcPadAngle$1,`arcPadAngle`);function intersect$1(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}__name(intersect$1,`intersect`);function cornerTangents$1(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/j(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,b=h-p,S=v*v+b*b,C=i-a,w=f*h-m*p,T=(b<0?-1:1)*j(O(0,C*C*S-w*w)),E=(w*b-v*T)/S,D=(-w*v-b*T)/S,k=(w*b+v*T)/S,A=(-w*v+b*T)/S,M=E-g,N=D-_,P=k-g,F=A-_;return M*M+N*N>P*P+F*F&&(E=k,D=A),{cx:E,cy:D,x01:-u,y01:-d,x11:E*(i/C-1),y11:D*(i/C-1)}}__name(cornerTangents$1,`cornerTangents`);function arc_default$1(){var e=arcInnerRadius$1,t=arcOuterRadius$1,n=constant_default$3(0),r=null,i=arcStartAngle$1,a=arcEndAngle$1,o=arcPadAngle$1,s=null;function arc(){var c,l,u=+e.apply(this,arguments),d=+t.apply(this,arguments),f=i.apply(this,arguments)-N,p=a.apply(this,arguments)-N,m=T(p-f),h=p>f;if(s||=c=path(),d<u&&(l=d,d=u,u=l),!(d>1e-12))s.moveTo(0,0);else if(m>P-1e-12)s.moveTo(d*D(f),d*A(f)),s.arc(0,0,d,f,p,!h),u>1e-12&&(s.moveTo(u*D(p),u*A(p)),s.arc(0,0,u,p,f,h));else{var g=f,_=p,v=f,b=p,S=m,C=m,w=o.apply(this,arguments)/2,O=w>1e-12&&(r?+r.apply(this,arguments):j(u*u+d*d)),F=k(T(d-u)/2,+n.apply(this,arguments)),I=F,L=F,R,z;if(O>1e-12){var B=asin$1(O/u*A(w)),V=asin$1(O/d*A(w));(S-=B*2)>1e-12?(B*=h?1:-1,v+=B,b-=B):(S=0,v=b=(f+p)/2),(C-=V*2)>1e-12?(V*=h?1:-1,g+=V,_-=V):(C=0,g=_=(f+p)/2)}var H=d*D(g),U=d*A(g),ee=u*D(b),W=u*A(b);if(F>1e-12){var G=d*D(_),te=d*A(_),ne=u*D(v),re=u*A(v),K;if(m<M&&(K=intersect$1(H,U,ne,re,G,te,ee,W))){var ie=H-K[0],ae=U-K[1],oe=G-K[0],se=te-K[1],ce=1/A(acos((ie*oe+ae*se)/(j(ie*ie+ae*ae)*j(oe*oe+se*se)))/2),le=j(K[0]*K[0]+K[1]*K[1]);I=k(F,(u-le)/(ce-1)),L=k(F,(d-le)/(ce+1))}}C>1e-12?L>1e-12?(R=cornerTangents$1(ne,re,H,U,d,L,h),z=cornerTangents$1(G,te,ee,W,d,L,h),s.moveTo(R.cx+R.x01,R.cy+R.y01),L<F?s.arc(R.cx,R.cy,L,E(R.y01,R.x01),E(z.y01,z.x01),!h):(s.arc(R.cx,R.cy,L,E(R.y01,R.x01),E(R.y11,R.x11),!h),s.arc(0,0,d,E(R.cy+R.y11,R.cx+R.x11),E(z.cy+z.y11,z.cx+z.x11),!h),s.arc(z.cx,z.cy,L,E(z.y11,z.x11),E(z.y01,z.x01),!h))):(s.moveTo(H,U),s.arc(0,0,d,g,_,!h)):s.moveTo(H,U),!(u>1e-12)||!(S>1e-12)?s.lineTo(ee,W):I>1e-12?(R=cornerTangents$1(ee,W,G,te,u,-I,h),z=cornerTangents$1(H,U,ne,re,u,-I,h),s.lineTo(R.cx+R.x01,R.cy+R.y01),I<F?s.arc(R.cx,R.cy,I,E(R.y01,R.x01),E(z.y01,z.x01),!h):(s.arc(R.cx,R.cy,I,E(R.y01,R.x01),E(R.y11,R.x11),!h),s.arc(0,0,u,E(R.cy+R.y11,R.cx+R.x11),E(z.cy+z.y11,z.cx+z.x11),h),s.arc(z.cx,z.cy,I,E(z.y11,z.x11),E(z.y01,z.x01),!h))):s.arc(0,0,u,b,v,h)}if(s.closePath(),c)return s=null,c+``||null}return arc.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-M/2;return[D(r)*n,A(r)*n]},arc.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$3(+t),arc):e},arc.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default$3(+e),arc):t},arc.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$3(+e),arc):n},arc.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:constant_default$3(+e),arc):r},arc.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default$3(+e),arc):i},arc.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:constant_default$3(+e),arc):a},arc.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:constant_default$3(+e),arc):o},arc.context=function(e){return arguments.length?(s=e??null,arc):s},arc}function Linear$1(e){this._context=e}__name(Linear$1,`Linear`),Linear$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}},__name(linear_default$1,`default`);function linear_default$1(e){return new Linear$1(e)}function x$1(e){return e[0]}__name(x$1,`x`);function y$1(e){return e[1]}__name(y$1,`y`);function line_default$1(){var e=x$1,t=y$1,n=constant_default$3(!0),r=null,i=linear_default$1,a=null;function line(o){var s,c=o.length,l,u=!1,d;for(r??(a=i(d=path())),s=0;s<=c;++s)!(s<c&&n(l=o[s],s,o))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(l,s,o),+t(l,s,o));if(d)return a=null,d+``||null}return line.x=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$3(+t),line):e},line.y=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default$3(+e),line):t},line.defined=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$3(!!e),line):n},line.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),line):i},line.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),line):r},line}__name(line_default$1,`default`);function area_default$1(){var e=x$1,t=null,n=constant_default$3(0),r=y$1,i=constant_default$3(!0),a=null,o=linear_default$1,s=null;function area(c){var l,u,d,f=c.length,p,m=!1,h,g=Array(f),_=Array(f);for(a??(s=o(h=path())),l=0;l<=f;++l){if(!(l<f&&i(p=c[l],l,c))===m)if(m=!m)u=l,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=l-1;d>=u;--d)s.point(g[d],_[d]);s.lineEnd(),s.areaEnd()}m&&(g[l]=+e(p,l,c),_[l]=+n(p,l,c),s.point(t?+t(p,l,c):g[l],r?+r(p,l,c):_[l]))}if(h)return s=null,h+``||null}function arealine(){return line_default$1().defined(i).curve(o).context(a)}return area.x=function(n){return arguments.length?(e=typeof n==`function`?n:constant_default$3(+n),t=null,area):e},area.x0=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$3(+t),area):e},area.x1=function(e){return arguments.length?(t=e==null?null:typeof e==`function`?e:constant_default$3(+e),area):t},area.y=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$3(+e),r=null,area):n},area.y0=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$3(+e),area):n},area.y1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:constant_default$3(+e),area):r},area.lineX0=area.lineY0=function(){return arealine().x(e).y(n)},area.lineY1=function(){return arealine().x(e).y(r)},area.lineX1=function(){return arealine().x(t).y(n)},area.defined=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default$3(!!e),area):i},area.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),area):o},area.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),area):a},area}__name(area_default$1,`default`);function descending_default(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}__name(descending_default,`default`);function identity_default$2(e){return e}__name(identity_default$2,`default`);function pie_default(){var e=identity_default$2,t=descending_default,n=null,r=constant_default$3(0),i=constant_default$3(P),a=constant_default$3(0);function pie(o){var s,c=o.length,l,u,d=0,f=Array(c),p=Array(c),m=+r.apply(this,arguments),h=Math.min(P,Math.max(-P,i.apply(this,arguments)-m)),g,_=Math.min(Math.abs(h)/c,a.apply(this,arguments)),v=_*(h<0?-1:1),b;for(s=0;s<c;++s)(b=p[f[s]=s]=+e(o[s],s,o))>0&&(d+=b);for(t==null?n!=null&&f.sort(function(e,t){return n(o[e],o[t])}):f.sort(function(e,n){return t(p[e],p[n])}),s=0,u=d?(h-c*v)/d:0;s<c;++s,m=g)l=f[s],b=p[l],g=m+(b>0?b*u:0)+v,p[l]={data:o[l],index:s,value:b,startAngle:m,endAngle:g,padAngle:_};return p}return pie.value=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$3(+t),pie):e},pie.sortValues=function(e){return arguments.length?(t=e,n=null,pie):t},pie.sort=function(e){return arguments.length?(n=e,t=null,pie):n},pie.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:constant_default$3(+e),pie):r},pie.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default$3(+e),pie):i},pie.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:constant_default$3(+e),pie):a},pie}__name(pie_default,`default`);function point$7(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}__name(point$7,`point`);function Basis$1(e){this._context=e}__name(Basis$1,`Basis`),__name(basis_default,`default`),Basis$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point$7(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:point$7(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function basis_default(e){return new Basis$1(e)}function Bundle$1(e,t){this._basis=new Basis$1(e),this._beta=t}__name(Bundle$1,`Bundle`),Bundle$1.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var F=(function custom(e){function bundle(t){return e===1?new Basis$1(t):new Bundle$1(t,e)}return bundle.beta=function(e){return custom(+e)},bundle})(.85);function point$6(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}__name(point$6,`point`);function Cardinal$1(e,t){this._context=e,this._k=(1-t)/6}__name(Cardinal$1,`Cardinal`),Cardinal$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:point$6(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:point$6(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var I=(function custom(e){function cardinal(t){return new Cardinal$1(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function point$5(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}__name(point$5,`point`);function CatmullRom$1(e,t){this._context=e,this._alpha=t}__name(CatmullRom$1,`CatmullRom`),CatmullRom$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:point$5(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var L=(function custom(e){function catmullRom(t){return e?new CatmullRom$1(t,e):new Cardinal$1(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function sign$1(e){return e<0?-1:1}__name(sign$1,`sign`);function slope3$1(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(sign$1(a)+sign$1(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}__name(slope3$1,`slope3`);function slope2$1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}__name(slope2$1,`slope2`);function point$4(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}__name(point$4,`point`);function MonotoneX$1(e){this._context=e}__name(MonotoneX$1,`MonotoneX`),MonotoneX$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:point$4(this,this._t0,slope2$1(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,point$4(this,slope2$1(this,n=slope3$1(this,e,t)),n);break;default:point$4(this,this._t0,n=slope3$1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function MonotoneY$1(e){this._context=new ReflectContext$1(e)}__name(MonotoneY$1,`MonotoneY`),(MonotoneY$1.prototype=Object.create(MonotoneX$1.prototype)).point=function(e,t){MonotoneX$1.prototype.point.call(this,t,e)};function ReflectContext$1(e){this._context=e}__name(ReflectContext$1,`ReflectContext`),ReflectContext$1.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function monotoneX(e){return new MonotoneX$1(e)}function Natural$1(e){this._context=e}__name(Natural$1,`Natural`),Natural$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=controlPoints$1(e),i=controlPoints$1(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function controlPoints$1(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}__name(natural_default,`default`),__name(controlPoints$1,`controlPoints`);function natural_default(e){return new Natural$1(e)}function Step$2(e,t){this._context=e,this._t=t}__name(Step$2,`Step`),Step$2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}},__name(step_default,`default`);function step_default(e){return new Step$2(e,.5)}function stepBefore(e){return new Step$2(e,0)}function stepAfter(e){return new Step$2(e,1)}var R=Array.prototype.slice;function identity_default$1(e){return e}__name(identity_default$1,`default`);var z=1,B=2,V=3,H=4,U=1e-6;function translateX(e){return`translate(`+(e+.5)+`,0)`}function translateY(e){return`translate(0,`+(e+.5)+`)`}function number(e){return function(t){return+e(t)}}function center(e){var t=Math.max(0,e.bandwidth()-1)/2;return e.round()&&(t=Math.round(t)),function(n){return+e(n)+t}}function entering(){return!this.__axis}function axis(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,c=e===z||e===H?-1:1,l=e===H||e===B?`x`:`y`,u=e===z||e===V?translateX:translateY;function axis(d){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),p=i??(t.tickFormat?t.tickFormat.apply(t,n):identity_default$1),m=Math.max(a,0)+s,h=t.range(),g=+h[0]+.5,_=+h[h.length-1]+.5,v=(t.bandwidth?center:number)(t.copy()),b=d.selection?d.selection():d,S=b.selectAll(`.domain`).data([null]),C=b.selectAll(`.tick`).data(f,t).order(),w=C.exit(),T=C.enter().append(`g`).attr(`class`,`tick`),E=C.select(`line`),D=C.select(`text`);S=S.merge(S.enter().insert(`path`,`.tick`).attr(`class`,`domain`).attr(`stroke`,`currentColor`)),C=C.merge(T),E=E.merge(T.append(`line`).attr(`stroke`,`currentColor`).attr(l+`2`,c*a)),D=D.merge(T.append(`text`).attr(`fill`,`currentColor`).attr(l,c*m).attr(`dy`,e===z?`0em`:e===V?`0.71em`:`0.32em`)),d!==b&&(S=S.transition(d),C=C.transition(d),E=E.transition(d),D=D.transition(d),w=w.transition(d).attr(`opacity`,U).attr(`transform`,function(e){return isFinite(e=v(e))?u(e):this.getAttribute(`transform`)}),T.attr(`opacity`,U).attr(`transform`,function(e){var t=this.parentNode.__axis;return u(t&&isFinite(t=t(e))?t:v(e))})),w.remove(),S.attr(`d`,e===H||e==B?o?`M`+c*o+`,`+g+`H0.5V`+_+`H`+c*o:`M0.5,`+g+`V`+_:o?`M`+g+`,`+c*o+`V0.5H`+_+`V`+c*o:`M`+g+`,0.5H`+_),C.attr(`opacity`,1).attr(`transform`,function(e){return u(v(e))}),E.attr(l+`2`,c*a),D.attr(l,c*m).text(p),b.filter(entering).attr(`fill`,`none`).attr(`font-size`,10).attr(`font-family`,`sans-serif`).attr(`text-anchor`,e===B?`start`:e===H?`end`:`middle`),b.each(function(){this.__axis=v})}return axis.scale=function(e){return arguments.length?(t=e,axis):t},axis.ticks=function(){return n=R.call(arguments),axis},axis.tickArguments=function(e){return arguments.length?(n=e==null?[]:R.call(e),axis):n.slice()},axis.tickValues=function(e){return arguments.length?(r=e==null?null:R.call(e),axis):r&&r.slice()},axis.tickFormat=function(e){return arguments.length?(i=e,axis):i},axis.tickSize=function(e){return arguments.length?(a=o=+e,axis):a},axis.tickSizeInner=function(e){return arguments.length?(a=+e,axis):a},axis.tickSizeOuter=function(e){return arguments.length?(o=+e,axis):o},axis.tickPadding=function(e){return arguments.length?(s=+e,axis):s},axis}function axisTop(e){return axis(z,e)}function axisRight(e){return axis(B,e)}function axisBottom(e){return axis(V,e)}function axisLeft(e){return axis(H,e)}var Axis=class extends o.SVGWidget{_origType;_origTimePattern;parser;parserInvert;formatter;d3Scale;d3Axis;d3Guides;_guideElement;svg;svgAxis;svgGuides;_tickFormatFunc;constructor(e=`origin`){super(),this._drawStartPos=e,this.updateScale()}lowValue(){return this.parse(this.low())}highValue(){return this.parse(this.high())}parse(e,t){if(e instanceof Array)return e.map(function(e){return this.parse(e)},this);if(e!=null){if(this.parser)return this.parser(typeof e==`number`?e.toString():e);if(t&&typeof e==`string`)return+e}return e}parseInvert(e){return e instanceof Array?e.map(function(e){return this.parseInvert(e)},this):this.parserInvert&&e?this.parserInvert(e):e}format(e){return e instanceof Array?e.map(function(e){return this.format(e)},this):e!=null&&this.formatter?this.formatter(e):e}parseFormat(e){return this.format(this.parse(e))}tickFormatFunc(e){return arguments.length?(this._tickFormatFunc=e,this.updateScale(),this):this._tickFormatFunc}scalePos(e){let t=this.d3Scale(this.parse(e));return this.type()===`ordinal`&&(t+=this.bandwidth()/2),t}bandwidth(){return this.d3Scale.bandwidth?this.d3Scale.bandwidth():0}isHorizontal(){switch(this.orientation()){case`left`:case`right`:return!1;default:}return!0}domain(e){return arguments.length?(this.d3Scale.domain(e),this):this.d3Scale.domain()}range(e){if(!arguments.length){if(this.d3Scale.rangeRoundBands)return this.d3Scale.rangeExtent();if(this.d3Scale.rangeRound)return this.d3Scale.range()}return this.d3Scale.rangeRoundBands?this.d3Scale.rangeRoundBands(e,.1):this.d3Scale.rangeRound&&this.d3Scale.range(e),this}invert(e){return this.d3Scale.invert(e)}guideTarget(e){return this._guideElement=(0,o.select)(e).attr(`class`,this._class),this}enter(e,t){super.enter(e,t),this.svg=t.append(`g`),this.svgAxis=this.svg.append(`g`).attr(`class`,`axis`),this.svgGuides=(this._guideElement||t).append(`g`).attr(`class`,`guide`)}_prevOrientation;updateScale(){switch(this.type()){case`ordinal`:if(this.d3Scale=(0,o.scaleBand)().paddingInner(this.ordinalPaddingInner()).paddingOuter(this.ordinalPaddingOuter()),this.ordinals_exists()&&this.d3Scale.domain(this.ordinals()),this.parser=null,this.ordinalMappings_exists()){let e=this.ordinalMappings();this.formatter=t=>e[t]||t}else this.formatter=null;break;case`linear`:this.d3Scale=(0,o.scaleLinear)(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?(0,o.format)(this.tickFormat()):null;break;case`pow`:this.d3Scale=(0,o.scalePow)().exponent(this.powExponent()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?(0,o.format)(this.tickFormat()):null;break;case`log`:this.d3Scale=(0,o.scaleLog)().base(this.logBase()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?(0,o.format)(this.tickFormat()):null;break;case`time`:this.d3Scale=(0,o.scaleTime)(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=this.timePattern_exists()?(0,o.timeParse)(this.timePattern()):null,this.parserInvert=this.timePattern_exists()?(0,o.timeFormat)(this.timePattern()):null,this._tickFormatFunc?this.formatter=this._tickFormatFunc:this.formatter=this.tickFormat_exists()?(0,o.timeFormat)(this.tickFormat()):null;break;default:}if(this._prevOrientation!==this.orientation()){switch(this.orientation()){case`left`:this.d3Axis=axisLeft(this.d3Scale),this.d3Guides=axisLeft(this.d3Scale);break;case`top`:this.d3Axis=axisTop(this.d3Scale),this.d3Guides=axisTop(this.d3Scale);break;case`right`:this.d3Axis=axisRight(this.d3Scale),this.d3Guides=axisRight(this.d3Scale);break;default:this.d3Axis=axisBottom(this.d3Scale),this.d3Guides=axisBottom(this.d3Scale);break}this._prevOrientation=this.orientation(),this.svgAxis&&this.svgAxis.html(``),this.svgGuides&&this.svgGuides.html(``)}if(this.extend())switch(this.type()){case`ordinal`:break;default:let e,t,n,r,i,a;this.isHorizontal()?(e=this.width(),this.d3Scale.range([0,e]),t=e*this.extend()/100,n=this.d3Scale.invert(0),i=this.d3Scale.invert(-t),r=this.d3Scale.invert(e),a=this.d3Scale.invert(e+t)):(e=this.height(),this.d3Scale.range([e,0]),t=e*this.extend()/100,n=this.d3Scale.invert(e),i=this.d3Scale.invert(e+t),r=this.d3Scale.invert(0),a=this.d3Scale.invert(-t)),i===n&&(i=n-n*this.extend()/100),a===r&&(a=r+r*this.extend()/100),Math.sign(n)!==Math.sign(i)&&(i=0),Math.sign(r)!==Math.sign(a)&&(a=0),this.d3Scale.domain([i,a]);break}this.d3Axis.scale(this.d3Scale).tickFormat(this.formatter).ticks(this.tickCount()),this.d3Guides.scale(this.d3Scale).tickSize(this.tickLength_exists()?-this.tickLength():0).tickFormat(``).ticks(this.tickCount());let e=this.ticks();return e.length&&(this.d3Axis.tickValues(e.map(e=>this.parse(e.value))).tickFormat((t,n)=>e[n].label),this.d3Guides.tickValues(e.map(e=>this.parse(e.value)))),this}adjustText(e,t){let n=this.isHorizontal(),r=this.orientation()===`left`,i=this.orientation()===`bottom`,a=this,s=e.selectAll(`.tick > text`).style(`font-family`,this.fontFamily()).style(`font-size`,this.fontSize_exists()?this.fontSize()+`px`:null);if(this.overlapMode()===`linebreak`)this.type()===`ordinal`&&s.call(function(){return a.linebreak.apply(a,arguments)},this.bandwidth());else if(this.overlapMode()===`wrap`)this.type()===`ordinal`&&s.call(function(){return a.wrap.apply(a,arguments)},this.bandwidth());else switch(n?this.overlapMode():`none`){case`stagger`:s.style(`text-anchor`,`middle`).attr(`dy`,function(e,n){return(i?1:-1)*((i?.71:0)+n%t)+`em`}).attr(`dx`,0).attr(`visibility`,null).attr(`transform`,`rotate(0)`);break;case`hide`:s.style(`text-anchor`,`middle`).attr(`dy`,(i?.71:0)+`em`).attr(`dx`,0).attr(`visibility`,function(e,n){return n%t?`hidden`:null}).attr(`transform`,`rotate(0)`);break;case`rotate`:let e=-this.labelRotation()||0;if(e!==0&&t>1){s.each(function(){let t=(0,o.select)(this),n=t.node().getBBox(),r=(i?1:-1)*Math.sin(Math.PI*(-Math.abs(e)/180));t.style(`text-anchor`,e>0?i?`start`:`end`:i?`end`:`start`).attr(`dy`,n.height/2*r+`px`).attr(`dx`,e>0?i?`0.71em`:`-0.71em`:i?`-0.71em`:`0.71em`).attr(`transform`,`rotate(`+e+`)`).attr(`visibility`,null)});break}default:s.style(`text-anchor`,n?`middle`:r?`end`:`start`).attr(`dy`,n?(i?.71:0)+`em`:`0.32em`).attr(`dx`,0).attr(`visibility`,null).attr(`transform`,`rotate(0)`)}}calcTickOverlapModulus(e){let t=1;switch(this.overlapMode()){case`rotate`:case`stagger`:case`hide`:let n=[];e.selectAll(`.tick > text`).each(function(){let e=this.getBoundingClientRect();for(let r=n.length-1;r>=0&&!(n[r].right<e.left);--r)n.length+1-r>t&&(t=n.length+1-r);n.push(e)});break;default:}return t}calcOverflow(e,t){if(this.updateScale(),this.hidden())return{left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:1};let n=this.isHorizontal();this.range(n?[0,this.width()]:[this.height(),0]);let r=e.append(`g`).attr(`class`,this.classID()),i=r.append(`g`);i.attr(`class`,n?`x`:`y`).call(this.d3Axis),t&&e.selectAll(`.tick > text`).remove();let a={left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:this.calcTickOverlapModulus(i)};this.adjustText(i,a.tickOverlapModulus);let o=i.node().getBBox();switch(a.depth=n?o.height:o.width,this.shrinkToFit()){case`low`:case`both`:a.left=n?-o.x:0,a.bottom=n?0:-(this.height()-(o.height+o.y));break;default:}switch(this.shrinkToFit()){case`high`:case`both`:a.top=n?0:-o.y,a.right=n?-(this.width()-o.x-o.width):0;break;default:}return r.remove(),a}wrap(e,t,n){n||=/\s+/;let r=this;e.each(function(){let e=(0,o.select)(this),i=e.text().split(n).reverse(),a=[],s=0,c=1.1,l=e.attr(`x`),u=e.attr(`y`),d=parseFloat(e.style(`font-size`))||10,f=Math.floor(t/(d*c))-1,p=r.isHorizontal()?1:Math.ceil(i.length/f),m=parseFloat(e.attr(`dy`)),h=e.text(null).append(`tspan`).attr(`x`,l).attr(`y`,u).attr(`dy`,m+`em`),g=0,_=i.pop();for(;_;)a.push(_),h.text(a.join(` `)),g++,h.node().getComputedTextLength()>t&&g>=p&&(a.pop(),h.text(a.join(` `)),a=[_],h=e.append(`tspan`).attr(`x`,l).attr(`y`,u).attr(`dy`,++s*c+m+`em`).text(_),g=0),_=i.pop();r.isHorizontal()||e.selectAll(`tspan`).attr(`y`,-s/2+`em`)})}linebreak(e,t){this.wrap(e,t,`
|
|
12
|
-
`)}update(e,t){super.update(e,t),this.svg.style(`display`,this.hidden()?`none`:null);let n=this.calcOverflow(t),r=this.isHorizontal()?n.left:this.height()-n.top-n.bottom,i=this.isHorizontal()?this.width()-n.right-this.padding():0+this.padding();this.range(this.reverse()?[i,r]:[r,i]);let a=this;function doPosition(e){e.attr(`transform`,function(){switch(a.orientation()){case`left`:return`translate(`+n.depth+`, `+n.top+`)`;case`top`:return`translate(0,`+n.depth+`)`;case`right`:return`translate(`+(a.width()-n.depth)+`, `+n.top+`)`;case`bottom`:return`translate(0,`+(a.height()-n.depth)+`)`;default:}return`translate(0,0)`})}this.svg.style(`visibility`,this.type()===`none`?`hidden`:null).transition().call(doPosition),this._guideElement&&this.svgGuides.transition().call(doPosition),this.svgAxis.call(this.d3Axis),this.adjustText(this.svgAxis,n.tickOverlapModulus);let o={x:this.pos().x,width:this.width()},s=this.svgAxis.selectAll(`.axisTitle`).data(this.title()?[this.title()]:[]),c=s.enter().append(`text`).attr(`class`,`axisTitle`).merge(s).transition().attr(`dx`,null).style(`text-anchor`,`end`);switch(this.orientation()){case`left`:c.attr(`transform`,`rotate(-90)`).attr(`x`,-2).attr(`y`,2).attr(`dy`,`.71em`);break;case`right`:c.attr(`transform`,`rotate(-90)`).attr(`x`,-2).attr(`y`,4).attr(`dx`,null).attr(`dy`,`-.71em`);break;case`top`:c.attr(`transform`,`rotate(0)`).attr(`x`,o.width-2).attr(`y`,2).attr(`dx`,null).attr(`dy`,`.71em`);break;case`bottom`:c.attr(`transform`,`rotate(0)`).attr(`x`,o.width-2).attr(`y`,-2).attr(`dy`,null);break;default:}c.text(this.title_exists()?this.title():``),s.exit().remove(),this.svgGuides.call(this.d3Guides).selectAll(`.tick`).classed(`guide-0`,e=>e===0&&this.low()<0)}rerender(){this.svgAxis.call(this.d3Axis),this.svgGuides.call(this.d3Guides)}postUpdate(e,t){super.postUpdate(e,t),this._guideElement&&this._guideElement.attr(`transform`,this._element.attr(`transform`))}};Axis.prototype._class+=` chart_Axis`,Axis.prototype.publish(`type`,`linear`,`set`,`Type`,[`none`,`ordinal`,`linear`,`pow`,`log`,`time`]),Axis.prototype.publish(`timePattern`,`%Y-%m-%d`,`string`,`Time Series Pattern`,null,{disable:e=>e.type()!==`time`}),Axis.prototype.publish(`reverse`,!1,`boolean`,`Reverse`),Axis.prototype.publish(`title`,null,`string`,`Title`),Axis.prototype.publish(`orientation`,`bottom`,`set`,`Placement/orientation of the axis`,[`left`,`top`,`right`,`bottom`]),Axis.prototype.publish(`powExponent`,2,`number`,`Power exponent (disabled when type is not 'pow')`,null,{disable:e=>e.type()!==`pow`}),Axis.prototype.publish(`logBase`,10,`number`,`Logarithmic base (disabled when type is not 'log')`,null,{disable:e=>e.type()!==`log`}),Axis.prototype.publish(`ordinals`,[],`array`,`Array of ordinal values to display (disabled when type is not 'ordinal')`,null,{disable:e=>e.type()!==`ordinal`}),Axis.prototype.publish(`fontSize`,null,`number`,`Size of tick label font (pixels)`,null,{optional:!0}),Axis.prototype.publish(`fontFamily`,null,`string`,`Font family of tick labels`,null,{optional:!0}),Axis.prototype.publish(`tickCount`,null,`number`,`Number of ticks to display (disabled when type is 'ordinal')`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`tickFormat`,null,`string`,`Format rules for tick text (disabled when type is 'ordinal')`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`tickLength`,null,`number`,`Height (or width for left/right orientations) of the axis ticks (in pixels)`,null,{optional:!0}),Axis.prototype.publish(`ticks`,[],`array`,`Custom tick labels`,null,{optional:!0}),Axis.prototype.publish(`low`,null,`any`,`Minimum tick value (disabled when type is ordinal)`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`high`,null,`any`,`Maximum tick value (disabled when type is ordinal)`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`overlapMode`,`none`,`set`,`Specifies the behavior when tick labels overlap`,[`none`,`stagger`,`hide`,`rotate`,`linebreak`,`wrap`]),Axis.prototype.publish(`labelRotation`,33,`number`,`Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')`,null,{optional:!0,disable:e=>e.overlapMode()!==`rotate`}),Axis.prototype.publish(`shrinkToFit`,`both`,`set`,`shrinkToFit`,[`none`,`low`,`high`,`both`]),Axis.prototype.publish(`extend`,5,`number`,`Extend the axis range by this % beyond what is needed to display the data (disabled when type is 'ordinal')`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`hidden`,!1,`boolean`,`Hides axis when 'true'`),Axis.prototype.publish(`ordinalPaddingInner`,.1,`number`,`Determines the ratio of the range that is reserved for blank space between band (0->1)`,null,{disable:e=>e.type()!==`ordinal`}),Axis.prototype.publish(`ordinalPaddingOuter`,.1,`number`,`Determines the ratio of the range that is reserved for blank space before the first band and after the last band (0->1)`,null,{disable:e=>e.type()!==`ordinal`}),Axis.prototype.publish(`ordinalMappings`,null,`object`,`Alternative label mappings (icons)`,null,{optional:!0}),Axis.prototype.publish(`padding`,0,`number`,`Padding space at top of axis (pixels)`,null,{optional:!0}),Axis.prototype._origType=Axis.prototype.type,Axis.prototype.type=function(e){let t=Axis.prototype._origType.apply(this,arguments);return e!==void 0&&(this._type=e,this.updateScale()),t},Axis.prototype._origTimePattern=Axis.prototype.timePattern,Axis.prototype.timePattern=function(e){let t=Axis.prototype._origTimePattern.apply(this,arguments);return e!==void 0&&(this._timePattern=e,this.updateScale()),t};var XYAxis=class extends o.SVGWidget{domainAxis;valueAxis;xAxis;yAxis;xyBrush;xBrush;yBrush;margin;focusChart;constructor(){super(),o.Utility.SimpleSelectionMixin.call(this),this._drawStartPos=`origin`,this.domainAxis=new Axis().classed({domain:!0}).orientation_default(`bottom`).type(`ordinal`).overlapMode_default(`stagger`).shrinkToFit_default(`high`).extend_default(0),this.valueAxis=new Axis().classed({value:!0}).orientation_default(`left`).type(`linear`).shrinkToFit_default(`high`),this.xyBrush=(0,o.brush)().on(`end`,()=>this.brushMoved()).on(`start.handle brush.handle end.handle`,()=>this.brushMoved2()),this.xBrush=(0,o.brushX)().on(`end`,()=>this.brushMoved()).on(`start.handle brush.handle end.handle`,()=>this.brushMoved2()),this.yBrush=(0,o.brushY)().on(`end`,()=>this.brushMoved()).on(`start.handle brush.handle end.handle`,()=>this.brushMoved2())}_prevBrush;resetSelection(){return this._prevBrush=null,this}parseData(e){return this.domainAxis.parse(e)}parseValue(e){return this.valueAxis.parse(e,!0)}formatData(e){return this.domainAxis.format(e)}formatValue(e){return this.valueAxis.format(e)}parsedData(){return this.data().map(function(e){let t=0;return e.map(function(e,n){if(n===0)return this.parseData(e);if(n>=this.columns().length)return e;let r=this.yAxisStacked()?[t,t+this.parseValue(e)]:this.parseValue(e);return t+=this.parseValue(e),r},this)},this)}bandwidth(){return this.domainAxis.bandwidth()}svg;svgRegions;svgDomainGuide;svgValueGuide;svgData;svgDataClipRect;svgFocus;svgBrush;enter(e,t){super.enter(e,t),this.svg=t.append(`g`),this.svgRegions=t.append(`g`),this.svgDomainGuide=this.svg.append(`g`),this.svgValueGuide=this.svg.append(`g`),this.svgData=this.svg.append(`g`),this.svgDataClipRect=this.svg.append(`clipPath`).attr(`id`,this.id()+`_clippath`).append(`rect`).attr(`x`,0).attr(`y`,0),this.svgData=this.svg.append(`g`).attr(`clip-path`,`url(#`+this.id()+`_clippath)`),this._selection.widgetElement(this.svgData),this.svgFocus=t.append(`g`),this.domainAxis.target(this.svg.node()).guideTarget(this.svgDomainGuide.node()),this.valueAxis.target(this.svg.node()).guideTarget(this.svgValueGuide.node()),this.svgBrush=t.append(`g`).attr(`class`,`brush`),this.chartsEnter(this,this.svgData,250)}resizeBrushHandle(e,t,n){let r,i,a;return e.type===`e`||e.type===`w`?(r=+(e.type===`e`),i=r?1:-1,a=n/3,`M`+.5*i+`,`+a+`A6,6 0 0 `+r+` `+6.5*i+`,`+(a+6)+`V`+(2*a-6)+`A6,6 0 0 `+r+` `+.5*i+`,`+2*a+`ZM`+2.5*i+`,`+(a+8)+`V`+(2*a-8)+`M`+4.5*i+`,`+(a+8)+`V`+(2*a-8)):(r=+(e.type===`s`),a=r?1:-1,i=t/3,`M`+i+`, `+.5*a+`A6,6 0 0 `+(r+1)%2+` `+(i+6)+`,`+6.5*a+`H`+(2*i-6)+`A6,6 0 0 `+(r+1)%2+` `+2*i+`,`+.5*a+`ZM`+(i+8)+`,`+2.5*a+`H`+(2*i-8)+`M`+(i+8)+`,`+4.5*a+`H`+(2*i-8))}_skipSelection=!1;skipSelection(e){return arguments.length?(this._skipSelection=e,this):this._skipSelection}brushMoved(){if(this._skipSelection)return;let e=[],t=this,n=(0,o.brushSelection)(this.svgBrush.node());n&&(e=this.data().filter(function(e){let r=t.dataPos(e[0]);if(t.use2dSelection()){let i=t.valuePos(e[1])+t.valueAxis.bandwidth()/2;return r>=n[0][0]&&r<=n[1][0]&&i>=n[0][1]&&i<=n[1][1]}else return r>=n[0]&&r<=n[1]})),this.selection(e)}brushMoved2(){let e=this.orientation()===`horizontal`,t=this.use2dSelection()?[]:e?[{type:`w`},{type:`e`}]:[{type:`n`},{type:`s`}],n=this.svgBrush.selectAll(`.handle--custom`).data(t),r=(0,o.d3Event)()?.selection;r==null?n.attr(`display`,`none`):e?n.attr(`display`,null).attr(`transform`,(e,t)=>`translate(`+r[t]+`,0)`):n.attr(`display`,null).attr(`transform`,(e,t)=>`translate(0, `+r[t]+`)`)}dataPos(e){return this.domainAxis.scalePos(e)}valuePos(e){return this.valueAxis.scalePos(e)}getAxisSize(e){return{width:this.xAxis?this.xAxis.width():e.xAxis.width(),height:this.yAxis?this.yAxis.height():e.yAxis.width()}}calcMargin(e,t,n){let r={top:!n&&this.selectionMode()?10:2,right:n&&(this.selectionMode()||this.xAxisFocus())?10:2,bottom:(this.xAxisFocus()?this.xAxisFocusHeight():0)+2,left:2},i=this.width()-r.left-r.right,a=this.height()-r.top-r.bottom,o=0,s=30,c=0,l=30;for(let e=0;e<10;++e){this.xAxis.width(i-l).height(0);let e=this.xAxis.calcOverflow(t),n=e.depth;this.yAxis.width(0).height(a-s);let r=this.yAxis.calcOverflow(t),u=r.depth;if(o=e.right,c=r.top,n===s&&u===l)break;s=n,l=u}return this.xAxis.x(i/2+l/2+r.left).y(a+r.top).width(i-l),this.yAxis.x(r.left).y(a/2-s/2+r.top).height(a-s),r.left+=l,r.top+=c,r.right+=o,r.bottom+=s,r}updateRegions(e,t,n){let r=this,i=this.svgRegions.selectAll(`.region`).data(this.regions());i.enter().append(`rect`).attr(`class`,`region`),n?i.attr(`x`,function(e){return r.dataPos(e.x0)}).attr(`y`,0).attr(`width`,function(e){return r.dataPos(e.x1)-r.dataPos(e.x0)}).attr(`height`,this.height()).style(`stroke`,function(e){return r._palette(e.colorID)}).style(`fill`,function(e){return(0,o.hsl)(r._palette(e.colorID)).brighter()}):i.attr(`x`,0).attr(`y`,function(e){return r.dataPos(e.x0)}).attr(`width`,this.width()).attr(`height`,function(e){return r.dataPos(e.x0)-r.dataPos(e.x1)}).style(`stroke`,function(e){return r._palette(e.colorID)}).style(`fill`,function(e){return(0,o.hsl)(r._palette(e.colorID)).brighter()}),i.exit().remove()}_prevXAxisType;update(e,t){this.selectionGlow(!this.tabNavigation()),super.update(e,t);let n=this,r=this.orientation()===`horizontal`;switch(this.updateRegions(e,t,r),this.domainAxis.orientation(r?`bottom`:`left`).title(this.xAxisTitle_exists()?this.xAxisTitle():this.columns()[0]),this.valueAxis.orientation(r?`left`:`bottom`),this.xAxis=r?this.domainAxis:this.valueAxis,this.yAxis=r?this.valueAxis:this.domainAxis,this.xAxisType()){case`ordinal`:let e=this.columns().length,t={};this.domainAxis.ordinals(this.data().map(function(r){return t[r[0]]=n.xAxisOrdinalMapping(r,r[e]),r[0]})).ordinalMappings(t);break;default:let r=this.xAxisDomainLow()?this.xAxisDomainLow():this.domainAxis.parseInvert((0,o.min)(this.parsedData(),function(e){return e[0]})),i=this.xAxisDomainHigh()?this.xAxisDomainHigh():this.domainAxis.parseInvert((0,o.max)(this.parsedData(),function(e){return e[0]}));r!==void 0&&i!==void 0&&this.domainAxis.low(r).high(i);break}let i=this.yAxisDomainLow()?this.yAxisDomainLow():this.valueAxis.parseInvert((0,o.min)(this.parsedData(),function(e){return(0,o.min)(e.filter(function(e,t){return t>0&&n.columns()[t]&&n.columns()[t].indexOf(`__`)!==0&&e!==null}),function(e){return e instanceof Array?e[0]:e})})),a=this.yAxisDomainHigh()?this.yAxisDomainHigh():this.valueAxis.parseInvert((0,o.max)(this.parsedData(),function(e){return(0,o.max)(e.filter(function(e,t){return t>0&&n.columns()[t]&&n.columns()[t].indexOf(`__`)!==0&&e!==null}),function(e){return e instanceof Array?e[1]:e})}));this.valueAxis.low(i).high(a),this.margin=this.calcMargin(e,t,r);let s=this.width()-this.margin.left-this.margin.right;s<0&&(s=0);let c=this.height()-this.margin.top-this.margin.bottom;c<0&&(c=0);let l=r?s:c,u=r?c:s;if(this.domainAxis.tickLength(this.xAxisGuideLines()?u:0).render(),this.valueAxis.tickLength(this.yAxisGuideLines()?l:0).render(),this.svgDataClipRect.attr(`width`,s).attr(`height`,c),this.svgData.transition().attr(`transform`,`translate(`+this.margin.left+`,`+this.margin.top+`)`),this.updateBrush(s,c,l,r),this.updateFocusChart(e,t,this.margin,s,c,r),this.chartsUpdate(s,c,250),this.selectionMode())return this.brushMoved()}updateBrush(e,t,n,r){let i=this.use2dSelection()?this.xyBrush:r?this.xBrush:this.yBrush,a=(0,o.brushSelection)(this.svgBrush.node());i.extent([[0,0],[e,t]]),this.svgBrush.attr(`transform`,`translate(`+this.margin.left+`, `+this.margin.top+`)`).style(`display`,this.selectionMode()?null:`none`).call(i);let s=this.use2dSelection()?[]:r?[{type:`w`},{type:`e`}]:[{type:`n`},{type:`s`}],c=this.svgBrush.selectAll(`.handle--custom`).data(s);if(c.enter().append(`path`).attr(`class`,`handle--custom`).merge(c).attr(`cursor`,r?`ew-resize`:`ns-resize`).attr(`d`,n=>this.resizeBrushHandle(n,e,t)),this.selectionMode()){if(this._prevXAxisType!==this.xAxisType()&&(this._prevXAxisType=this.xAxisType(),this._prevBrush=null),this._prevBrush){if(a){if(this._prevBrush.orientation!==this.orientation()){let e=a[0];a[0]=this._prevBrush.maxCurrExtent-a[1],a[1]=this._prevBrush.maxCurrExtent-e}let e=n/this._prevBrush.maxCurrExtent;e!==1&&this.svgBrush.transition().on(`start`,function(){i.on(`end`,null)}).call(i.move,[a[0]*e,a[1]*e]).on(`end`,()=>{i.on(`end`,()=>this.brushMoved())})}}else this.svgBrush.call(i.move,[0,n]);this._prevBrush={orientation:this.orientation(),maxCurrExtent:n}}}updateFocusChart(e,t,n,r,i,a){let o=this,s=this.svgFocus.selectAll(`#`+this.id()+`_focusChart`).data(this.xAxisFocus()?[!0]:[]);s.enter().append(`g`).attr(`id`,this.id()+`_focusChart`).attr(`class`,`focus`).each(function(){o.focusChart=new o.constructor().target(this),o.focusChart.xBrush.on(`brush.focus`,function(){o.syncAxis(r),o.chartsUpdate(r,i,0)}),o.focusChart.layers(o.layers().map(e=>new e.constructor))}).merge(s).each(function(){o.copyPropsTo(o.focusChart,[`layers`]);let e=0;for(let t of o.layers())t.copyPropsTo(o.focusChart.layers()[e]),e++;o.focusChart.xAxisFocus(!1).selectionMode(!0).skipSelection(!0).orientation(`horizontal`).xAxisGuideLines(!1).xAxisDomainLow(null).xAxisDomainHigh(null).yAxisGuideLines(!1).x(o.width()/2).y(o.height()-o.xAxisFocusHeight()/2).width(o.width()).height(o.xAxisFocusHeight()).columns(o.columns()).data(o.data()).render(),o.syncAxis(r)}),s.exit().each(function(){o.focusChart&&(o.focusChart.target(null),delete o.focusChart)}).remove()}syncAxis(e){let t=(0,o.brushSelection)(this.focusChart.svgBrush.node());if(t){if(this.focusChart.xAxisType()!==`ordinal`)this.xAxis.domain([this.focusChart.xAxis.invert(t[0]),this.focusChart.xAxis.invert(t[1])]);else{let n=(t[1]-t[0])/e;this.xAxis.range([-t[0]/n,(e-t[0])/n])}this.xAxis.rerender()}}layerColumns(e){let t=e.columns(),n=super.columns().filter(e=>e!==t[0]);return n.length?[t[0],...n]:t}layerColumnIndices(e){let t=e.columns();return this.layerColumns(e).map(e=>t.indexOf(e))}layerColumnIndex(e,t){return e.columns().indexOf(t)}layerData(e){if(arguments.length===1){let t=this.layerColumnIndices(e);return e.data().map(e=>{let n=t.map(t=>e[t]);return n.__hpcc_origRow=e,n})}throw Error(`Setting data on XYAxisLayer is not supported.`)}layerEnter(e,t,n=250){}layerUpdate(e,t,n=250){}layerExit(e,t,n=250){}chartsEnter(e,t,n=250){this.layerEnter(this,t,n);for(let e of this.layers())e.__xyAxisElement=t.append(`g`).attr(`class`,e.class()),e.target(e.__xyAxisElement.node()).layerEnter(this,t,n)}chartsUpdate(e,t,n){this.layerUpdate(this,this.svgData,n);for(let r of this.layers())r.resize({width:e,height:t}).layerUpdate(this,r.__xyAxisElement,n)}exit(e,t){this.valueAxis.target(null),this.domainAxis.target(null),super.exit(e,t)}selection(e){let t=this;this._selection.widgetElement().selectAll(`.selected,.deselected`).each(function(n){let r=e.indexOf(n.origRow)>=0;(0,o.select)(this).classed(`selected`,r).classed(`deselected`,!r).attr(`filter`,t._selection.svgGlowID()&&r?`url(#${t._selection.svgGlowID()})`:null)});let n=e.map(e=>this.rowToObj(e));setTimeout(()=>{this.click(n,``,!0)},0)}xAxisOrdinalMapping(e,t){return e[0]}click(e,t,n){}_selection};XYAxis.prototype._class+=` chart_XYAxis`,XYAxis.prototype.mixin(o.Utility.SimpleSelectionMixin),XYAxis.prototype.publish(`orientation`,`horizontal`,`set`,`Selects orientation for the axis`,[`horizontal`,`vertical`]),XYAxis.prototype.publish(`pointSizeColumn`,null,`string`,`pointSizeColumn`,null,{optional:!0}),XYAxis.prototype.publish(`minPointSize`,6,`number`,`minPointSize`),XYAxis.prototype.publish(`maxPointSize`,26,`number`,`maxPointSize`),XYAxis.prototype.publish(`use2dSelection`,!1,`boolean`,`2D Range Selector`),XYAxis.prototype.publish(`selectionMode`,!1,`boolean`,`Range Selector`),XYAxis.prototype.publishProxy(`xAxisTitle`,`domainAxis`,`title`),XYAxis.prototype.publishProxy(`xAxisTickCount`,`domainAxis`,`tickCount`),XYAxis.prototype.publishProxy(`xAxisTickFormat`,`domainAxis`,`tickFormat`),XYAxis.prototype.publishProxy(`xAxisTicks`,`domainAxis`,`ticks`),XYAxis.prototype.publishProxy(`xAxisType`,`domainAxis`,`type`),XYAxis.prototype.publishProxy(`xAxisTypeTimePattern`,`domainAxis`,`timePattern`),XYAxis.prototype.publish(`xAxisDomainLow`,null,`string`,`X-Axis Low`,null,{optional:!0,disable:e=>e.xAxisType()===`ordinal`}),XYAxis.prototype.publish(`xAxisDomainHigh`,null,`string`,`X-Axis High`,null,{optional:!0,disable:e=>e.xAxisType()===`ordinal`}),XYAxis.prototype.publishProxy(`xAxisFontSize`,`domainAxis`,`fontSize`),XYAxis.prototype.publishProxy(`xAxisFontFamily`,`domainAxis`,`fontFamily`),XYAxis.prototype.publishProxy(`xAxisOrdinalPaddingInner`,`domainAxis`,`ordinalPaddingInner`),XYAxis.prototype.publishProxy(`xAxisOrdinalPaddingOuter`,`domainAxis`,`ordinalPaddingOuter`),XYAxis.prototype.publishProxy(`xAxisOverlapMode`,`domainAxis`,`overlapMode`),XYAxis.prototype.publishProxy(`xAxisLabelRotation`,`domainAxis`,`labelRotation`),XYAxis.prototype.publishProxy(`xAxisDomainPadding`,`domainAxis`,`extend`),XYAxis.prototype.publish(`xAxisGuideLines`,!1,`boolean`,`Y-Axis Guide Lines`),XYAxis.prototype.publish(`xAxisFocus`,!1,`boolean`,`X-Axis Focus`,null,{disable:e=>e.orientation()!==`horizontal`}),XYAxis.prototype.publish(`xAxisFocusHeight`,80,`number`,`X-Axis Focus Height`,null,{disable:e=>!e.xAxisFocus()}),XYAxis.prototype.publishProxy(`xAxisHidden`,`domainAxis`,`hidden`),XYAxis.prototype.publishProxy(`yAxisFontSize`,`valueAxis`,`fontSize`),XYAxis.prototype.publishProxy(`yAxisFontFamily`,`valueAxis`,`fontFamily`),XYAxis.prototype.publishProxy(`yAxisTitle`,`valueAxis`,`title`),XYAxis.prototype.publishProxy(`yAxisTickCount`,`valueAxis`,`tickCount`),XYAxis.prototype.publishProxy(`yAxisTickFormat`,`valueAxis`,`tickFormat`),XYAxis.prototype.publishProxy(`yAxisTicks`,`valueAxis`,`ticks`),XYAxis.prototype.publishProxy(`yAxisType`,`valueAxis`,`type`),XYAxis.prototype.publishProxy(`yAxisTypeTimePattern`,`valueAxis`,`timePattern`),XYAxis.prototype.publishProxy(`yAxisTypePowExponent`,`valueAxis`,`powExponent`),XYAxis.prototype.publishProxy(`yAxisTypeLogBase`,`valueAxis`,`logBase`),XYAxis.prototype.publish(`yAxisStacked`,!1,`boolean`,`Stacked Chart`,null,{tags:[`Basic`],disable:e=>e.xAxisType()!==`ordinal`||e._class.indexOf(`chart_Column`)<0}),XYAxis.prototype.publish(`yAxisDomainLow`,null,`string`,`Y-Axis Low`,null,{optional:!0,disable:e=>e.yAxisType()===`ordinal`}),XYAxis.prototype.publish(`yAxisDomainHigh`,null,`string`,`Y-Axis High`,null,{optional:!0,disable:e=>e.yAxisType()===`ordinal`}),XYAxis.prototype.publishProxy(`yAxisDomainPadding`,`valueAxis`,`extend`),XYAxis.prototype.publish(`yAxisGuideLines`,!0,`boolean`,`Y-Axis Guide Lines`),XYAxis.prototype.publishProxy(`yAxisHidden`,`valueAxis`,`hidden`),XYAxis.prototype.publish(`regions`,[],`array`,`Regions`),XYAxis.prototype.publish(`layers`,[],`widgetArray`,`Layers`,null,{render:!1}),XYAxis.prototype.publishProxy(`xAxisPadding`,`domainAxis`,`padding`),XYAxis.prototype.publishProxy(`yAxisPadding`,`valueAxis`,`padding`),XYAxis.prototype.publish(`tabNavigation`,!1,`boolean`,`Enable or disable tab navigation`);var Scatter=class extends XYAxis{static __inputs=[{id:`label`,type:`any`},{id:`values`,type:`number`,multi:!0}];constructor(){super(),INDChart.call(this),ITooltip.call(this),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}xPos(e,t){return e.orientation()===`horizontal`?e.dataPos(t.label):e.valuePos(t.value)}yPos(e,t){return e.orientation()===`horizontal`?e.valuePos(t.value):e.dataPos(t.label)}curve(){switch(this.interpolate()){case`linear`:return linear_default$1;case`step`:return step_default;case`step-before`:return stepBefore;case`step-after`:return stepAfter;case`basis`:return basis_default;case`bundle`:return F;case`cardinal`:return I;case`catmullRom`:return L;case`natural`:return natural_default;default:return monotoneX}}getScale(){switch(this.pointSizeScale()){case`linear`:return(0,o.scaleLinear)();case`pow`:return(0,o.scalePow)().exponent(2);case`log`:return(0,o.scaleLog)();case`sqrt`:return(0,o.scaleSqrt)()}}pointColor(e,t,n,r){return this.interpolate()&&this.pointDarken()?this.strokeColor(e,t,n,r):this.fillColor(e,t,n,r)}lineColor(e,t,n,r){return this.interpolateFill()&&this.interpolateDarken()?this.strokeColor(e,t,n,r):this.fillColor(e,t,n,r)}areaColor(e,t,n,r){return this.fillColor(e,t,n,r)}layerEnter(e,t,n=250){super.layerEnter(e,t,n);let r=this;this.tooltipHTML(function(e){switch(r.tooltipStyle()){case`series-table`:return r.tooltipFormat({label:e.label,arr:r.columns().slice(1).map(function(t,n){return{label:t,color:r._palette(t),value:r.data()[e.rowIdx][n+1]}})});default:return r.tooltipFormat({label:e.label,series:e.column,value:e.value})}})}_prevPointShape;layerUpdate(e,t,n=250){super.layerUpdate(e,t);let r=e.orientation()===`horizontal`,i=r?this.height():this.width(),a=this;this.tabNavigation()&&e.parentRelativeDiv?e.parentRelativeDiv.attr(`tabindex`,`0`).attr(`role`,`group`).attr(`aria-label`,`${this.columns()[0]||`Chart`} data`):e.parentRelativeDiv&&e.parentRelativeDiv.attr(`tabindex`,null).attr(`role`,null).attr(`aria-label`,null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._prevPointShape!==this.pointShape()&&(t.selectAll(`.data`).remove(),this._prevPointShape=this.pointShape());function mapShape(e){switch(e){case`rectangle`:return`rect`;case`circle`:return`circle`;case`cross`:return`path`;default:}}let s=this.pointSizeColumn_exists(),c,l,u;s&&(c=this.columns().indexOf(this.pointSizeColumn()),l=(0,o.extent)(this.data(),e=>e[c]),u=this.getScale().domain(l));let d=this.layerColumns(e),f=this.layerData(e),p=this.flattenData(d,f).map(function(e){return e.shape=mapShape(a.pointShape()),e.column=d[e.colIdx],e.row=f[e.rowIdx],e.origRow=f[e.rowIdx].__hpcc_origRow,l?(e.size=u(e.row[c])*(a.maxPointSize()-a.minPointSize())+a.minPointSize(),e.column===a.pointSizeColumn()?!1:e):(e.size=a.pointSize(),e)}).filter(e=>e),m=t.selectAll(`.area`).data(d.filter(function(e,t){return a.interpolate()&&a.interpolateFill()&&t>0})),h=m.enter().append(`path`),g=area_default$1().curve(this.curve());r?g.x(function(t){return a.xPos(e,t)}).y0(Math.min(i,this.yPos(e,{value:0}))).y1(function(t){return a.yPos(e,t)}):g.y(function(t){return a.yPos(e,t)}).x0(Math.max(0,this.xPos(e,{value:0}))).x1(function(t){return a.xPos(e,t)}),h.merge(m).attr(`class`,e=>`area series series-`+this.cssTag(e)).each(function(e,t){(0,o.select)(this).attr(`d`,g(p.filter(function(e){return e.colIdx===t+1}))).style(`opacity`,a.interpolateFillOpacity()).style(`stroke`,`none`).style(`fill`,a.areaColor([],e,void 0,[]))}),m.exit().remove();let _=t.selectAll(`.line`).data(d.filter(function(e,t){return a.interpolate()&&t>0})),v=_.enter().append(`path`),b=line_default$1().x(function(t){return a.xPos(e,t)}).y(function(t){return a.yPos(e,t)}).curve(this.curve());v.merge(_).attr(`class`,e=>`line series series-`+this.cssTag(e)).each(function(e,t){let n=(0,o.select)(this),r=p.filter(function(e){return e.colIdx===t+1});n.attr(`d`,b(r)).style(`stroke`,a.lineColor([],e,void 0,[])).style(`fill`,`none`)}),_.exit().remove();let S=t.selectAll(`.point`).data(p,function(e,t){return e.shape+`_`+t});S.enter().append(`g`).each(function(t){let n=(0,o.select)(this);n.append(t.shape).attr(`class`,`pointShape`),n.append(`text`).attr(`class`,`pointValue`).style(`display`,`none`).attr(`text-anchor`,a.valueAnchor()).attr(`alignment-baseline`,a.valueBaseline()).attr(`fill`,function(e,t){return a.valueBaseline()===`middle`||a.valueBaseline()===`central`?a.textColor(e.row,e.column,e.value,e.origRow):null}),n.append(`circle`).attr(`class`,`pointSelection`).on(`mouseout.tooltip`,a.tooltip.hide).on(`mousemove.tooltip`,a.tooltip.show).call(e._selection.enter.bind(e._selection)).on(`click`,function(t,n){a.click(e.rowToObj(e.data()[t.rowIdx]),t.column,e._selection.selected(this))}).on(`dblclick`,function(t,n){a.dblclick(e.rowToObj(e.data()[t.rowIdx]),t.column,e._selection.selected(this))}).on(`keydown`,function(t,n){if(a.tabNavigation()){let t=(0,o.d3Event)();(t.code===`Space`||t.key===`Enter`)&&(t.preventDefault(),e._selection.click(this))}})}).merge(S).attr(`class`,e=>`point series series-`+this.cssTag(e.column)).each(function(t){(0,o.select)(this).select(`.pointValue`).attr(`x`,function(t){return a.xPos(e,t)}).attr(`y`,function(t){return a.yPos(e,t)}).style(`display`,a.showValue()?`block`:`none`).attr(`text-anchor`,a.valueAnchor()).attr(`alignment-baseline`,a.valueBaseline()).text(function(e){return e.value}),(0,o.select)(this).select(`.pointSelection`).attr(`cx`,function(t){return a.xPos(e,t)}).attr(`cy`,function(t){return a.yPos(e,t)}).attr(`r`,t.size).attr(`tabindex`,a.tabNavigation()?0:null).attr(`role`,a.tabNavigation()?`button`:null).attr(`aria-label`,a.tabNavigation()?e=>`${e.column||`Value`}: ${e.value} @ ${e.label}`:null);let n=(0,o.select)(this).select(`.pointShape`);switch(t.shape){case`rect`:n.attr(`x`,function(n){return a.xPos(e,n)-t.size/2}).attr(`y`,function(n){return a.yPos(e,n)-t.size/2}).attr(`width`,t.size).attr(`height`,t.size).style(`fill`,a.pointColor(t.row,t.column,t.value,t.origRow));break;case`circle`:n.attr(`cx`,function(t){return a.xPos(e,t)}).attr(`cy`,function(t){return a.yPos(e,t)}).attr(`r`,t.size*.9).style(`fill`,a.pointColor(t.row,t.column,t.value,t.origRow));break;case`path`:n.attr(`d`,function(n){return`M`+(a.xPos(e,n)-t.size/2)+` `+(a.yPos(e,n)-t.size/2)+` L`+(a.xPos(e,n)+t.size/2)+` `+(a.yPos(e,n)+t.size/2)+` M`+(a.xPos(e,n)-t.size/2)+` `+(a.yPos(e,n)+t.size/2)+` L`+(a.xPos(e,n)+t.size/2)+` `+(a.yPos(e,n)-t.size/2)}).style(`stroke`,a.pointColor(t.row,t.column,t.value,t.origRow));break;default:}}),S.exit().remove()}exit(e,t){super.exit(e,t)}};Scatter.prototype._class+=` chart_Scatter`,Scatter.prototype.implements(INDChart.prototype),Scatter.prototype.implements(ITooltip.prototype),Scatter.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Scatter.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Scatter.prototype.publish(`pointSizeScale`,`linear`,`set`,`pointSizeScale`,[`linear`,`pow`,`log`,`sqrt`]),Scatter.prototype.publish(`pointShape`,`cross`,`set`,`Shape of the data points`,[`circle`,`rectangle`,`cross`]),Scatter.prototype.publish(`pointSize`,6,`number`,`Point Size`,null,{range:{min:1,step:1,max:200}}),Scatter.prototype.publish(`interpolate`,``,`set`,`Interpolate Data`,[``,`linear`,`step`,`step-before`,`step-after`,`basis`,`bundle`,`cardinal`,`catmullRom`,`natural`,`monotone`]),Scatter.prototype.publish(`pointDarken`,!0,`boolean`,`If true, and interpolate is set, then points will have a slightly darker color than their assigned palette color`,null,{disable:e=>!e.interpolate()}),Scatter.prototype.publish(`interpolateDarken`,!0,`boolean`,`If true, and interpolateFill is true, then lines will have a slightly darker color than their assigned palette color`,null,{disable:e=>!e.interpolateFill()}),Scatter.prototype.publish(`interpolateFill`,!1,`boolean`,`If true, the area between the line and zero will be filled`),Scatter.prototype.publish(`interpolateFillOpacity`,.66,`number`,`Fill interpolation Opacity`,null,{range:{min:0,step:.01,max:1}}),Scatter.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Scatter.prototype.publish(`showValue`,!1,`boolean`),Scatter.prototype.publish(`valueAnchor`,`middle`,`set`,`text-anchor for shown value text`,[`start`,`middle`,`end`]),Scatter.prototype.publish(`valueBaseline`,`ideographic`,`set`,`alignment-baseline for shown value text`,[`auto`,`baseline`,`before-edge`,`text-before-edge`,`middle`,`central`,`after-edge`,`text-after-edge`,`ideographic`,`alphabetic`,`hanging`,`mathematical`,`inherit`]);var Area=class extends Scatter{constructor(){super(),this.interpolate_default(`linear`).interpolateFill_default(!0)}};Area.prototype._class+=` chart_Area`;var Column=class extends XYAxis{static __inputs=[{id:`label`,type:`string`},{id:`values`,type:`number`,multi:!0}];_linearGap;textLocal=(0,o.local)();stackedTextLocal=(0,o.local)();isHorizontal;constructor(){super(),INDChart.call(this),ITooltip.call(this),this._selection.skipBringToTop(!0),this._linearGap=25}layerEnter(e,t,n=250){super.layerEnter(e,t,n);let r=this;this.tooltipHTML(function(t){switch(r.tooltipStyle()){case`series-table`:return r.tooltipFormat({label:t.row[0],arr:r.columns().slice(1).map(function(e,n){return{label:e,color:r._palette(e),value:t.row[n+1]}})});default:let n=t.row[t.idx];return n instanceof Array&&(n=n[1]-n[0]),r.tooltipFormat({label:t.row[0],series:r.layerColumns(e)[t.idx],value:n})}})}adjustedData(e){return this.layerData(e).map(t=>{let n=0;return t.map((t,r)=>{if(r===0||r>=this.layerColumns(e).length)return t;let i=e.yAxisStacked()?[n,n+t]:t;return n+=t,i},this)},this)}layerUpdate(e,t,n=250){super.layerUpdate(e,t,n);let r=e.orientation()===`horizontal`;this.isHorizontal=r;let i=this;this.tabNavigation()&&e.parentRelativeDiv?e.parentRelativeDiv.attr(`tabindex`,`0`).attr(`role`,`group`).attr(`aria-label`,`${this.columns()[0]||`Chart`} data`):e.parentRelativeDiv&&e.parentRelativeDiv.attr(`tabindex`,null).attr(`role`,null).attr(`aria-label`,null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id()));let a=(0,o.format)(i.showValueAsPercentFormat()),s=10,c=0;switch(e.xAxisType()){case`ordinal`:s=e.bandwidth(),c=-s/2;break;case`linear`:case`time`:s=Math.max(Math.abs(e.dataPos(2)-e.dataPos(1))*(100-this._linearGap)/100,s),c=-s/2;break;default:}this.tooltip.direction(r?`n`:`e`);let l=(0,o.scaleBand)().domain(i.layerColumns(e).filter(function(e,t){return t>0})).rangeRound(r?[0,s]:[s,0]).paddingInner(Math.max(this.xAxisSeriesPaddingInner(),.05)).paddingOuter(0),u=[],d=[],f=this.columns().length,p=this.data();this.showValue()&&this.showValueAsPercent()===`series`&&p.forEach(e=>{e.filter((e,t)=>t>0&&t<f).forEach((e,t)=>{d[t+1]===void 0&&(d[t+1]=0),d[t+1]+=e})}),(this.showDomainTotal()||this.showValue()&&this.showValueAsPercent()===`domain`)&&(u=p.map(e=>e.filter((e,t)=>t>0&&t<f).reduce((e,t)=>e+t,0)));let m=t.selectAll(`.dataRow`).data(this.adjustedData(e)),h=e.data(),g=this.getAxisSize(e);m.enter().append(`g`).attr(`class`,`dataRow`).merge(m).each(function(t,p){let m=(0,o.select)(this),_=m.selectAll(`.dataCell`).data(t.filter(function(t,n){return n<i.layerColumns(e).length}).map(function(n,r){return{column:i.layerColumns(e)[r],row:t,origRow:h[p],value:n,idx:r}}).filter(function(e){return e.value!==null&&e.idx>0}),e=>e.column),v=_.enter().append(`g`).attr(`class`,`dataCell`).on(`mouseout.tooltip`,function(e){(!i.tooltipInnerTextEllipsedOnly()||e.innerTextObj&&e.innerTextObj.isTruncated)&&i.tooltip.hide.apply(i,arguments)}).on(`mousemove.tooltip`,function(e){(!i.tooltipInnerTextEllipsedOnly()||e.innerTextObj&&e.innerTextObj.isTruncated)&&i.tooltip.show.apply(i,arguments)}).call(e._selection.enter.bind(e._selection)).on(`click`,function(t){i.click(e.rowToObj(t.origRow),t.column,e._selection.selected(this))}).on(`dblclick`,function(t){i.dblclick(e.rowToObj(t.origRow),t.column,e._selection.selected(this))}).on(`keydown`,function(t,n){if(i.tabNavigation()){let t=(0,o.d3Event)();(t.code===`Space`||t.key===`Enter`)&&(t.preventDefault(),e._selection.click(this))}}).style(`opacity`,0).each(function(e){let t=(0,o.select)(this);t.append(`rect`).attr(`class`,`columnRect series series-`+i.cssTag(e.column)),t.append(`text`).attr(`class`,`columnRectText`).style(`stroke`,`transparent`)});v.transition().duration(n).style(`opacity`,1);let b=e.yAxisStacked()?s:l.bandwidth();v.merge(_).attr(`tabindex`,i.tabNavigation()?0:null).attr(`role`,i.tabNavigation()?`button`:null).attr(`aria-label`,i.tabNavigation()?e=>`${e.origRow[0]} - ${e.column}: ${e.value instanceof Array?e.value[1]-e.value[0]:e.value}`:null).each(function(s){let m=(0,o.select)(this),h=e.dataPos(t[0])+(e.yAxisStacked()?0:l(s.column))+c,_=s.value instanceof Array?s.value[1]:s.value,v=s.origRow[s.idx];if(i.showValue()){let e=i.dataMeta();switch(i.showValueAsPercent()){case`series`:let t=e.sum===void 0?d[s.idx]:e.sum;v=a(v/t);break;case`domain`:let n=e.sum===void 0?u[p]:e.sum;v=a(v/n);break;default:v=(0,o.format)(i.showValueFormat())(v);break}}let S=e.valuePos(_),C=e.valuePos(s.value instanceof Array?s.value[0]:0),w=Math.min(C,S),T=Math.abs(S-C),E=i.innerTextFontSize(),D=i.innerTextPadding_exists()?i.innerTextPadding():E/2.5,O=i.intersectRectRect({x:r?h:w,y:r?w:h,width:r?b:T,height:r?T:b},{x:0,y:0,width:g.width,height:g.height}),k=m.select(`rect`).transition().duration(n).style(`fill`,e=>i.fillColor(e.row,e.column,e.value,e.origRow));r?k.attr(`x`,h).attr(`y`,w).attr(`width`,b).attr(`height`,T):k.attr(`y`,h).attr(`x`,w).attr(`height`,b).attr(`width`,T);let A=m.select(`text`).transition().duration(n).style(`font-size`,E+`px`).style(`fill`,e=>i.textColor(e.row,e.column,e.value,e.origRow));A.style(`font-family`,i.innerTextFontFamily_exists()?i.innerTextFontFamily():null);let j=i.innerTextPadding_exists()?i.innerTextPadding():8,M=E/2.7;if(r){let e=O.y+O.height-D;A.attr(`x`,h+b/2).attr(`y`,e+M).attr(`transform`,`rotate(-90, ${h+b/2}, ${e})`)}else A.attr(`x`,O.x+j).attr(`y`,h+b/2+M);A.attr(`height`,b).attr(`width`,T),i.showInnerText()&&A.text(e=>{let t=i.innerText(e.origRow,e.origRow[f],e.idx);if(t){let n=r?O.height:O.width,a=i.calcInnerText(n,t,v);return e.innerTextObj=a,a.text}return``});let N=m.selectAll(`.dataText`).data(i.showValue()?[`${_}`]:[]);N.enter().append(`g`).attr(`class`,`dataText`).each(function(e){i.textLocal.set(this,new o.Text().target(this).colorStroke_default(`transparent`))}).merge(N).each(function(){let e={x:0,y:0},t=i.valueFontFamily(),n=i.valueFontSize(),a=i.textSize(v,t,n),o=parseFloat(v)>=0,c=i.valueAnchor()?i.valueAnchor():r?`middle`:`start`,l=O.x,u=g.width-(O.x+O.width),d=O.y,f=g.height-(O.y+O.height),p,m,_;if(s.innerTextObj){let{padding:t,valueTextWidth:i}=s.innerTextObj;m=!1,r?(c=`middle`,e.x=h+b/2,s.innerTextObj.category===4?(m=!0,e.y=w-t-n/2):e.y=w+t+n/2):(c=`start`,s.innerTextObj.category===4?(m=!0,e.x=T+w+t):e.x=T+w-i-t,e.y=h+b/2)}else r?(p=O.height<a.height,m=!i.valueCentered()||p,e.x=O.x+O.width/2,m?o?(_=d<a.height+j,_?p?e.y=O.y+O.height+a.height:(m=!1,e.y=O.y+O.height/2):e.y=O.y-a.height/2-j):(_=f<a.height,_?p?e.y=O.y-a.height/2-j:(m=!1,e.y=O.y+O.height/2):e.y=O.y+a.height+j):e.y=O.y+O.height/2):(p=O.width<a.width,m=!i.valueCentered()||p,e.y=O.y+O.height/2,m?o?(_=u<a.width+j,_?i.showInnerText()||!p?(m=!1,e.x=O.x+O.width/2):e.x=O.x-(a.width-j):e.x=O.x+O.width+a.width/2+j):(_=l<a.width,_?i.showInnerText()||!p?(m=!1,e.x=O.x+O.width/2):e.x=O.x+O.width+(a.width-j):e.x=O.x-(a.width-j)):e.x=O.x+O.width/2);let S=m?null:i.textColor(s.row,s.column,s.value,s.origRow),C=i.columns(),E=i.yAxisStacked()&&p||m&&i.yAxisStacked()&&C.indexOf(s.column)!==C.length-1;i.textLocal.get(this).pos(e).anchor(c).fontFamily(t).fontSize(n).text(`${v}`).colorFill(S).visible(i.showValue()&&!E).render()}),N.exit().each(function(e){i.textLocal.get(this).target(null)}).remove()}),_.exit().transition().duration(n).style(`opacity`,0).remove();let S=e.yAxisStacked()?u[p]:Math.max(...t.filter((e,t)=>t>0&&t<f)),C=m.selectAll(`.stackedTotalText`).data(i.showDomainTotal()?[u[p]]:[]);C.enter().append(`g`).attr(`class`,`stackedTotalText`).each(function(e){i.stackedTextLocal.set(this,new o.Text().target(this).colorStroke_default(`transparent`))}).merge(C).each(function(n){let a={x:0,y:0},o=e.dataPos(t[0]),s=e.valuePos(S),c=i.valueFontFamily(),l=i.valueFontSize(),u=i.textSize(n,c,l),d=parseFloat(n)>=0,f=`middle`;r?(a.x=o,d?a.y=s-u.height/2:a.y=s+u.height/2):(f=`start`,a.y=o,d?a.x=s+u.width/2:a.x=s-u.width/2),i.stackedTextLocal.get(this).pos(a).anchor(f).fontFamily(c).fontSize(l).text(n).render()}),C.exit().each(function(e){i.textLocal.get(this).target(null)}).remove()}),m.exit().transition().duration(n).remove()}calcInnerText(e,t,n){let r=this.innerTextFontFamily_exists()?this.innerTextFontFamily():`Verdana`,i=this.innerTextFontSize(),a=this.valueFontFamily_exists()?this.valueFontFamily():`Verdana`,o=this.valueFontSize(),s=this.innerTextPadding_exists()?this.innerTextPadding():i/2.5,c=this.isHorizontal?o:this.textSize(n,a,o).width,l=this.textSize(`...`,r,i).width,u=this.textSize(t,r,i).width,d=t,f=s*3+u+c,p=s*3+l+c,m=s*1+c,h=4;if(f<e)h=1;else if(p<e){let n=e-p,a=``;for(let e of t)if(this.textSize(a+e,r,i).width>n){t=a+`...`;break}else a+=e;h=2}else m<e?(t=``,h=3):t=``;return{text:t,isTruncated:d!==t,padding:s,category:h,valueTextWidth:c}}innerText(e,t,n){return e[0]}};Column.prototype._class+=` chart_Column`,Column.prototype.implements(INDChart.prototype),Column.prototype.implements(ITooltip.prototype),Column.prototype.publish(`valueFontFamily`,null,`string`,`Font family of value text`,null,{optional:!0}),Column.prototype.publish(`valueFontSize`,12,`number`,`Height of value text (pixels)`),Column.prototype.publish(`innerTextFontFamily`,null,`string`,`Font family of inner text`,null,{optional:!0}),Column.prototype.publish(`innerTextPadding`,8,`number`,`Offset of inner text (pixels)`,null,{optional:!0}),Column.prototype.publish(`innerTextFontSize`,12,`number`,`Height of inner text (pixels)`),Column.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,()=>Column.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Column.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Column.prototype.publish(`showValue`,!1,`boolean`,`Show Value in column`),Column.prototype.publish(`showInnerText`,!1,`boolean`,`Show Label in column`),Column.prototype.publish(`showValueFormat`,`,`,`string`,`D3 Format for Value`,null,{disable:e=>!e.showValue()||!!e.showValueAsPercent()}),Column.prototype.publish(`showValueAsPercent`,null,`set`,`If showValue is true, optionally show value as a percentage by Series or Domain`,[null,`series`,`domain`],{disable:e=>!e.showValue(),optional:!0}),Column.prototype.publish(`showValueAsPercentFormat`,`.0%`,`string`,`D3 Format for %`,null,{disable:e=>!e.showValue()||!e.showValueAsPercent()}),Column.prototype.publish(`showDomainTotal`,!1,`boolean`,`Show Total Value for Stacked Columns`,null),Column.prototype.publish(`valueCentered`,!1,`boolean`,`Show Value in center of column`),Column.prototype.publish(`valueAnchor`,`middle`,`set`,`text-anchor for shown value text`,[`start`,`middle`,`end`]),Column.prototype.publish(`xAxisSeriesPaddingInner`,0,`number`,`Determines the ratio of the range that is reserved for blank space between band (0->1)`),Column.prototype.publish(`tooltipInnerTextEllipsedOnly`,!1,`boolean`,`Show tooltip only when inner text is truncated with an ellipsis`);var Bar=class extends Column{constructor(){super(),this.orientation_default(`vertical`)}};Bar.prototype._class+=` chart_Bar`;function count(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function count_default(){return this.eachAfter(count)}__name(count_default,`default`);function each_default(e){var t=this,n,r=[t],i,a,o;do for(n=r.reverse(),r=[];t=n.pop();)if(e(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)r.push(i[a]);while(r.length);return this}__name(each_default,`default`);function eachBefore_default(e){for(var t=this,n=[t],r,i;t=n.pop();)if(e(t),r=t.children,r)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}__name(eachBefore_default,`default`);function eachAfter_default(e){for(var t=this,n=[t],r=[],i,a,o;t=n.pop();)if(r.push(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)n.push(i[a]);for(;t=r.pop();)e(t);return this}__name(eachAfter_default,`default`);function sum_default(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}__name(sum_default,`default`);function sort_default(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}__name(sort_default,`default`);function path_default$1(e){for(var t=this,n=leastCommonAncestor(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}__name(path_default$1,`default`);function leastCommonAncestor(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function ancestors_default(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}__name(ancestors_default,`default`);function descendants_default(){var e=[];return this.each(function(t){e.push(t)}),e}__name(descendants_default,`default`);function leaves_default(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}__name(leaves_default,`default`);function links_default(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}__name(links_default,`default`);function hierarchy(e,t){var n=new Node$1(e),r=+e.value&&(n.value=e.value),i,a=[n],o,s,c,l;for(t??=defaultChildren;i=a.pop();)if(r&&(i.value=+i.data.value),(s=t(i.data))&&(l=s.length))for(i.children=Array(l),c=l-1;c>=0;--c)a.push(o=i.children[c]=new Node$1(s[c])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(computeHeight)}function node_copy(){return hierarchy(this).eachBefore(copyData)}function defaultChildren(e){return e.children}function copyData(e){e.data=e.data.data}function computeHeight(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Node$1(e){this.data=e,this.depth=this.height=0,this.parent=null}__name(Node$1,`Node`),Node$1.prototype=hierarchy.prototype={constructor:Node$1,count:count_default,each:each_default,eachAfter:eachAfter_default,eachBefore:eachBefore_default,sum:sum_default,sort:sort_default,path:path_default$1,ancestors:ancestors_default,descendants:descendants_default,leaves:leaves_default,links:links_default,copy:node_copy};var ee=Array.prototype.slice;function shuffle(e){for(var t=e.length,n,r;t;)r=Math.random()*t--|0,n=e[t],e[t]=e[r],e[r]=n;return e}function enclose_default(e){for(var t=0,n=(e=shuffle(ee.call(e))).length,r=[],i,a;t<n;)i=e[t],a&&enclosesWeak(a,i)?++t:(a=encloseBasis(r=extendBasis(r,i)),t=0);return a}__name(enclose_default,`default`);function extendBasis(e,t){var n,r;if(enclosesWeakAll(t,e))return[t];for(n=0;n<e.length;++n)if(enclosesNot(t,e[n])&&enclosesWeakAll(encloseBasis2(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(enclosesNot(encloseBasis2(e[n],e[r]),t)&&enclosesNot(encloseBasis2(e[n],t),e[r])&&enclosesNot(encloseBasis2(e[r],t),e[n])&&enclosesWeakAll(encloseBasis3(e[n],e[r],t),e))return[e[n],e[r],t];throw Error()}function enclosesNot(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function enclosesWeak(e,t){var n=e.r-t.r+1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function enclosesWeakAll(e,t){for(var n=0;n<t.length;++n)if(!enclosesWeak(e,t[n]))return!1;return!0}function encloseBasis(e){switch(e.length){case 1:return encloseBasis1(e[0]);case 2:return encloseBasis2(e[0],e[1]);case 3:return encloseBasis3(e[0],e[1],e[2])}}function encloseBasis1(e){return{x:e.x,y:e.y,r:e.r}}function encloseBasis2(e,t){var n=e.x,r=e.y,i=e.r,a=t.x,o=t.y,s=t.r,c=a-n,l=o-r,u=s-i,d=Math.sqrt(c*c+l*l);return{x:(n+a+c/d*u)/2,y:(r+o+l/d*u)/2,r:(d+i+s)/2}}function encloseBasis3(e,t,n){var r=e.x,i=e.y,a=e.r,o=t.x,s=t.y,c=t.r,l=n.x,u=n.y,d=n.r,f=r-o,p=r-l,m=i-s,h=i-u,g=c-a,_=d-a,v=r*r+i*i-a*a,b=v-o*o-s*s+c*c,S=v-l*l-u*u+d*d,C=p*m-f*h,w=(m*S-h*b)/(C*2)-r,T=(h*g-m*_)/C,E=(p*b-f*S)/(C*2)-i,D=(f*_-p*g)/C,O=T*T+D*D-1,k=2*(a+w*T+E*D),A=w*w+E*E-a*a,j=-(O?(k+Math.sqrt(k*k-4*O*A))/(2*O):A/k);return{x:r+w+T*j,y:i+E+D*j,r:j}}function place(e,t,n){var r=e.x-t.x,i,a,o=e.y-t.y,s,c,l=r*r+o*o;l?(a=t.r+n.r,a*=a,c=e.r+n.r,c*=c,a>c?(i=(l+c-a)/(2*l),s=Math.sqrt(Math.max(0,c/l-i*i)),n.x=e.x-i*r-s*o,n.y=e.y-i*o+s*r):(i=(l+a-c)/(2*l),s=Math.sqrt(Math.max(0,a/l-i*i)),n.x=t.x+i*r-s*o,n.y=t.y+i*o+s*r)):(n.x=t.x+n.r,n.y=t.y)}function intersects(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function score(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function Node(e){this._=e,this.next=null,this.previous=null}function packEnclose(e){if(!(i=e.length))return 0;var t=e[0],n,r,i,a,o,s,c,l,u,d;if(t.x=0,t.y=0,!(i>1))return t.r;if(n=e[1],t.x=-n.r,n.x=t.r,n.y=0,!(i>2))return t.r+n.r;place(n,t,r=e[2]),t=new Node(t),n=new Node(n),r=new Node(r),t.next=r.previous=n,n.next=t.previous=r,r.next=n.previous=t;pack:for(s=3;s<i;++s){place(t._,n._,r=e[s]),r=new Node(r),c=n.next,l=t.previous,u=n._.r,d=t._.r;do if(u<=d){if(intersects(c._,r._)){n=c,t.next=n,n.previous=t,--s;continue pack}u+=c._.r,c=c.next}else{if(intersects(l._,r._)){t=l,t.next=n,n.previous=t,--s;continue pack}d+=l._.r,l=l.previous}while(c!==l.next);for(r.previous=t,r.next=n,t.next=n.previous=n=r,a=score(t);(r=r.next)!==n;)(o=score(r))<a&&(t=r,a=o);n=t.next}for(t=[n._],r=n;(r=r.next)!==n;)t.push(r._);for(r=enclose_default(t),s=0;s<i;++s)t=e[s],t.x-=r.x,t.y-=r.y;return r.r}function optional(e){return e==null?null:required(e)}function required(e){if(typeof e!=`function`)throw Error();return e}function constantZero(){return 0}function constant_default$2(e){return function(){return e}}__name(constant_default$2,`default`);function defaultRadius(e){return Math.sqrt(e.value)}function pack_default(){var e=null,t=1,n=1,r=constantZero;function pack(i){return i.x=t/2,i.y=n/2,e?i.eachBefore(radiusLeaf(e)).eachAfter(packChildren(r,.5)).eachBefore(translateChild(1)):i.eachBefore(radiusLeaf(defaultRadius)).eachAfter(packChildren(constantZero,1)).eachAfter(packChildren(r,i.r/Math.min(t,n))).eachBefore(translateChild(Math.min(t,n)/(2*i.r))),i}return pack.radius=function(t){return arguments.length?(e=optional(t),pack):e},pack.size=function(e){return arguments.length?(t=+e[0],n=+e[1],pack):[t,n]},pack.padding=function(e){return arguments.length?(r=typeof e==`function`?e:constant_default$2(+e),pack):r},pack}__name(pack_default,`default`);function radiusLeaf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function packChildren(e,t){return function(n){if(r=n.children){var r,i,a=r.length,o=e(n)*t||0,s;if(o)for(i=0;i<a;++i)r[i].r+=o;if(s=packEnclose(r),o)for(i=0;i<a;++i)r[i].r-=o;n.r=s+o}}}function translateChild(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}var Bubble=class extends o.SVGWidget{static __inputs=[{id:`label`,type:`string`},{id:`value`,type:`number`}];labelWidgets;d3Pack;constructor(){super(),I2DChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this),this._drawStartPos=`origin`,this.labelWidgets={},this.d3Pack=pack_default().size([this.width(),this.height()]).padding(1.5)}size(e){let t=super.size.apply(this,arguments);return arguments.length&&this.d3Pack.size([this.width(),this.height()]),t}enter(e,t){super.enter(e,t),this._selection.widgetElement(t);let n=this;this.tooltipHTML(function(e){switch(n.tooltipStyle()){case`series-table`:return n.tooltipFormat({label:e[0],arr:n.columns().slice(1).map(function(t,r){return{label:t,color:n._palette(e[0]),value:e[1]}})});default:return n.tooltipFormat({label:e.data[0],value:e.data[1]})}})}update(e,t){super.update(e,t);let n=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id()));let r=hierarchy({children:this.cloneData()}).sum(function(e){return e[1]}).sort(function(e,t){return t[1]<e[1]?-1:+(t[1]>e[1])});this.d3Pack(r);let i=t.selectAll(`.node`).data(r.children||[],e=>e.data[0]);i.enter().append(`g`).attr(`class`,(e,t)=>`node series series-`+this.cssTag(e.data[0])).attr(`opacity`,0).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n.click(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))}).on(`dblclick`,function(e){n.dblclick(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))}).each(function(e){let t=(0,o.select)(this),r={x:e.x,y:e.y};t.append(`circle`).attr(`transform`,`translate(`+r.x+`,`+r.y+`)`).attr(`r`,0).on(`mouseout.tooltip`,n.tooltip.hide).on(`mousemove.tooltip`,n.tooltip.show),e.__viz_faChar?n.labelWidgets[e.data[0]]=new o.FAChar().char(e.__viz_faChar).target(this).render():n.labelWidgets[e.data[0]]=new o.Text().text(e.data[0]).target(this).render()}).merge(i).transition().attr(`opacity`,1).each(function(e){let t=(0,o.select)(this),r={x:e.x,y:e.y};t.select(`circle`).transition().attr(`transform`,`translate(`+r.x+`,`+r.y+`)`).style(`fill`,n.fillColor(e.data,n.columns()[1],e.data[1])).attr(`r`,e.r).select(`title`).text(e.data[0]+` (`+e.data[1]+`)`),e.__viz_faChar?n.labelWidgets[e.data[0]].pos(r).render():n.labelWidgets[e.data[0]].pos(r).colorFill_default(n.textColor(e.data,n.columns()[1],e.data[1])).width(e.r*2).text(e.data[0]).render()}),i.exit().transition().style(`opacity`,0).remove()}exit(e,t){super.exit(e,t)}};Bubble.prototype._class+=` chart_Bubble`,Bubble.prototype.implements(I2DChart.prototype),Bubble.prototype.implements(ITooltip.prototype),Bubble.prototype.mixin(o.Utility.SimpleSelectionMixin),Bubble.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Bubble.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Bubble.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]});var BubbleXY=class extends Scatter{constructor(){super()}enter(e,t){this.pointSizeColumn_exists()||this.pointSizeColumn(this.columns()[this.columns().length-1]),super.enter(e,t)}};BubbleXY.prototype._class+=` chart_BubbleXY`;var W=0,G=0,te=0,ne=1e3,re,K,ie=0,ae=0,oe=0,se=typeof performance==`object`&&performance.now?performance:Date,ce=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function now(){return ae||=(ce(clearNow),se.now()+oe)}function clearNow(){ae=0}function Timer(){this._call=this._time=this._next=null}Timer.prototype=timer.prototype={constructor:Timer,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?now():+n)+(t==null?0:+t),!this._next&&K!==this&&(K?K._next=this:re=this,K=this),this._call=e,this._time=n,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}};function timer(e,t,n){var r=new Timer;return r.restart(e,t,n),r}function timerFlush(){now(),++W;for(var e=re,t;e;)(t=ae-e._time)>=0&&e._call.call(null,t),e=e._next;--W}function wake(){ae=(ie=se.now())+oe,W=G=0;try{timerFlush()}finally{W=0,nap(),ae=0}}function poke(){var e=se.now(),t=e-ie;t>ne&&(oe-=t,ie=e)}function nap(){for(var e,t=re,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:re=n);K=e,sleep(r)}function sleep(e){W||(G&&=clearTimeout(G),e-ae>24?(e<1/0&&(G=setTimeout(wake,e-se.now()-oe)),te&&=clearInterval(te)):(te||=(ie=se.now(),setInterval(poke,ne)),W=1,ce(wake)))}function bullet_default(){var e=`left`,t=!1,n=!1,r=bulvarRanges,i=bulvarMarkers,a=bulvarMeasures,s=380,c=30,l=axisLeft();function bulvar(e){e.each(function(e,u){var d=r.call(this,e,u).slice().sort(o.descending),f=i.call(this,e,u).slice().sort(o.descending),p=a.call(this,e,u).slice().sort(o.descending),m=(0,o.select)(this),h,g,_=m.select(`g.wrap`);_.empty()&&(_=m.append(`g`).attr(`class`,`wrap`)),n?(h=c,g=s,_.attr(`transform`,`rotate(90)translate(0,`+-s+`)`)):(h=s,g=c,_.attr(`transform`,null));var v=(0,o.scaleLinear)().domain([0,Math.max(d[0],f[0],p[0])]).range(t?[h,0]:[0,h]),b=this.__chart__||(0,o.scaleLinear)().domain([0,1/0]).range(v.range());this.__chart__=v;var S=bulvarWidth(b),C=bulvarWidth(v),w=_.selectAll(`rect.range`).data(d);w.enter().append(`rect`).attr(`class`,function(e,t){return`range s`+t}).attr(`width`,S).attr(`height`,g).attr(`x`,t?b:0).merge(w).transition(w).attr(`x`,t?v:0).attr(`width`,C).attr(`height`,g);var T=_.selectAll(`rect.measure`).data(p);T.enter().append(`rect`).attr(`class`,function(e,t){return`measure s`+t}).attr(`width`,S).attr(`height`,g/3).attr(`x`,t?b:0).attr(`y`,g/3).merge(T).transition(T).attr(`width`,C).attr(`height`,g/3).attr(`x`,t?v:0).attr(`y`,g/3);var E=_.selectAll(`line.marker`).data(f);E.enter().append(`line`).attr(`class`,`marker`).attr(`x1`,b).attr(`x2`,b).attr(`y1`,g/6).attr(`y2`,g*5/6).merge(E).transition(E).attr(`x1`,v).attr(`x2`,v).attr(`y1`,g/6).attr(`y2`,g*5/6);var D=m.selectAll(`g.axis`).data([0]);D.enter().append(`g`).attr(`class`,`axis`),D.attr(`transform`,n?null:`translate(0,`+g+`)`).call(l.scale(v))}),timerFlush()}return bulvar.orient=function(r){return arguments.length?(e=r+``,t=e===`right`||e===`bottom`,l.orient((n=e===`top`||e===`bottom`)?`left`:`bottom`),bulvar):e},bulvar.ranges=function(e){return arguments.length?(r=e,bulvar):r},bulvar.markers=function(e){return arguments.length?(i=e,bulvar):i},bulvar.measures=function(e){return arguments.length?(a=e,bulvar):a},bulvar.width=function(e){return arguments.length?(s=+e,bulvar):s},bulvar.height=function(e){return arguments.length?(c=+e,bulvar):c},bulvar.tickFormat=function(e){return arguments.length?(l.tickFormat(e),bulvar):l.tickFormat()},bulvar}__name(bullet_default,`default`);function bulvarRanges(e){return e.ranges}function bulvarMarkers(e){return e.markers}function bulvarMeasures(e){return e.measures}function bulvarWidth(e){var t=e(0);return function(n){return Math.abs(e(n)-t)}}var Bullet=class extends o.HTMLWidget{_hiddenColumns={};constructor(){super(),o.Utility.SimpleSelectionMixin.call(this,!0)}bulletData(){let e=this;this._hiddenColumns={};let t=this.columns();return this.data().map(function(e){return{title:valueOf(e,this.titleColumn()),subtitle:valueOf(e,this.subtitleColumn()),ranges:valueOf(e,this.rangesColumn(),`range`),measures:valueOf(e,this.measuresColumn(),`measure`),markers:valueOf(e,this.markersColumn(),`marker`),origRow:e}},this);function valueOf(n,r,i){let a=t.indexOf(r);return a>=0?n[a]instanceof Array?n[a]:[n[a]]:(i&&(e._hiddenColumns[i]=!0),[0])}}enter(e,t){super.enter(e,t),(0,o.select)(e.parentNode).style(`overflow`,`auto`),this._selection.widgetElement(t)}update(e,t){super.update(e,t);let n=this;t.selectAll(`.axis`).style(`display`,`none`),t.selectAll(`.range,.measure,.marker`).style(`display`,null);let r={left:2,top:8,right:2,bottom:8},i=this.width()-r.left-r.right,a=40-r.top-r.bottom,s=t.selectAll(`svg`).data(this.bulletData()),c=s.enter().append(`svg`).attr(`class`,`bullet`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n.click(n.rowToObj(e.origRow),n.titleColumn(),n._selection.selected(this))}).on(`dblclick`,function(e){n.dblclick(n.rowToObj(e.origRow),n.titleColumn(),n._selection.selected(this))}).each(function(){let e=(0,o.select)(this).append(`g`).attr(`class`,(e,t)=>`bulletBar series series-`+n.cssTag(n.titleColumn())).append(`g`).attr(`class`,`bulletTitle`);e.append(`text`).attr(`class`,`title`),e.append(`text`).attr(`class`,`subtitle`).attr(`dy`,`1em`)}).merge(s),l=c.select(`.bulletTitle`).style(`text-anchor`,`end`).attr(`transform`,`translate(-6,`+a/2+`)`);l.select(`.title`).text(function(e){return e.title}),l.select(`.subtitle`).text(function(e){return e.subtitle});let u=0;l.each(function(){let e=this.getBBox();e.width>u&&(u=e.width)});let d=bullet_default().width(i-u-6).height(a);c.attr(`width`,i).attr(`height`,a+r.top+r.bottom).style(`margin-left`,`${r.left}px`),c.select(`.bulletBar`).attr(`transform`,`translate(`+(u+6)+`,`+r.top+`)`).call(d),s.exit().remove(),Object.keys(this._hiddenColumns).length>0&&t.selectAll(`.${Object.keys(this._hiddenColumns).join(`,.`)}`).style(`display`,`none`)}exit(e,t){super.exit(e,t)}click(e,t,n){}dblclick(e,t,n){}_selection};Bullet.prototype._class+=` chart_Bullet`,Bullet.prototype.publish(`titleColumn`,null,`set`,`Title Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`subtitleColumn`,null,`set`,`Subtitle Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`rangesColumn`,null,`set`,`Ranges Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`measuresColumn`,null,`set`,`Measures Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`markersColumn`,null,`set`,`Markers Column`,function(){return this.columns()},{optional:!0});var le=Array.prototype.slice;function ascending_default(e,t){return e-t}__name(ascending_default,`default`);function area_default(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r}__name(area_default,`default`);function constant_default$1(e){return function(){return e}}__name(constant_default$1,`default`);function contains_default(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=ringContains(e,t[n]))return i;return 0}__name(contains_default,`default`);function ringContains(e,t){for(var n=t[0],r=t[1],i=-1,a=0,o=e.length,s=o-1;a<o;s=a++){var c=e[a],l=c[0],u=c[1],d=e[s],f=d[0],p=d[1];if(segmentContains(c,d,t))return 0;u>r!=p>r&&n<(f-l)*(r-u)/(p-u)+l&&(i=-i)}return i}function segmentContains(e,t,n){var r;return collinear(e,t,n)&&within(e[r=+(e[0]===t[0])],n[r],t[r])}function collinear(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function within(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function noop_default$1(){}__name(noop_default$1,`default`);var ue=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function contours_default(){var e=1,t=1,n=o.thresholdSturges,r=smoothLinear;function contours(e){var t=n(e);if(Array.isArray(t))t=t.slice().sort(ascending_default);else{var r=(0,o.extent)(e),i=r[0],a=r[1];t=(0,o.tickStep)(i,a,t),t=(0,o.range)(Math.floor(i/t)*t,Math.floor(a/t)*t,t)}return t.map(function(t){return contour(e,t)})}function contour(e,t){var n=[],i=[];return isorings(e,t,function(a){r(a,e,t),area_default(a)>0?n.push([a]):i.push(a)}),i.forEach(function(e){for(var t=0,r=n.length,i;t<r;++t)if(contains_default((i=n[t])[0],e)!==-1){i.push(e);return}}),{type:`MultiPolygon`,value:t,coordinates:n}}function isorings(n,r,i){var a=[],o=[],s=c=-1,c,l,u=n[0]>=r,d,f;for(ue[u<<1].forEach(stitch);++s<e-1;)l=u,u=n[s+1]>=r,ue[l|u<<1].forEach(stitch);for(ue[u<<0].forEach(stitch);++c<t-1;){for(s=-1,u=n[c*e+e]>=r,d=n[c*e]>=r,ue[u<<1|d<<2].forEach(stitch);++s<e-1;)l=u,u=n[c*e+e+s+1]>=r,f=d,d=n[c*e+s+1]>=r,ue[l|u<<1|d<<2|f<<3].forEach(stitch);ue[u|d<<3].forEach(stitch)}for(s=-1,d=n[c*e]>=r,ue[d<<2].forEach(stitch);++s<e-1;)f=d,d=n[c*e+s+1]>=r,ue[d<<2|f<<3].forEach(stitch);ue[d<<3].forEach(stitch);function stitch(e){var t=[e[0][0]+s,e[0][1]+c],n=[e[1][0]+s,e[1][1]+c],r=index(t),l=index(n),u,d;(u=o[r])?(d=a[l])?(delete o[u.end],delete a[d.start],u===d?(u.ring.push(n),i(u.ring)):a[u.start]=o[d.end]={start:u.start,end:d.end,ring:u.ring.concat(d.ring)}):(delete o[u.end],u.ring.push(n),o[u.end=l]=u):(u=a[l])?(d=o[r])?(delete a[u.start],delete o[d.end],u===d?(u.ring.push(n),i(u.ring)):a[d.start]=o[u.end]={start:d.start,end:u.end,ring:d.ring.concat(u.ring)}):(delete a[u.start],u.ring.unshift(t),a[u.start=r]=u):a[r]=o[l]={start:r,end:l,ring:[t,n]}}}function index(t){return t[0]*2+t[1]*(e+1)*4}function smoothLinear(n,r,i){n.forEach(function(n){var a=n[0],o=n[1],s=a|0,c=o|0,l,u=r[c*e+s];a>0&&a<e&&s===a&&(l=r[c*e+s-1],n[0]=a+(i-l)/(u-l)-.5),o>0&&o<t&&c===o&&(l=r[(c-1)*e+s],n[1]=o+(i-l)/(u-l)-.5)})}return contours.contour=contour,contours.size=function(n){if(!arguments.length)return[e,t];var r=Math.ceil(n[0]),i=Math.ceil(n[1]);if(!(r>0)||!(i>0))throw Error(`invalid size`);return e=r,t=i,contours},contours.thresholds=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$1(Array.isArray(e)?le.call(e):e),contours):n},contours.smooth=function(e){return arguments.length?(r=e?smoothLinear:noop_default$1,contours):r===smoothLinear},contours}__name(contours_default,`default`);function blurX(e,t,n){for(var r=e.width,i=e.height,a=(n<<1)+1,o=0;o<i;++o)for(var s=0,c=0;s<r+n;++s)s<r&&(c+=e.data[s+o*r]),s>=n&&(s>=a&&(c-=e.data[s-a+o*r]),t.data[s-n+o*r]=c/Math.min(s+1,r-1+a-s,a))}function blurY(e,t,n){for(var r=e.width,i=e.height,a=(n<<1)+1,o=0;o<r;++o)for(var s=0,c=0;s<i+n;++s)s<i&&(c+=e.data[o+s*r]),s>=n&&(s>=a&&(c-=e.data[o+(s-a)*r]),t.data[o+(s-n)*r]=c/Math.min(s+1,i-1+a-s,a))}function defaultX(e){return e[0]}function defaultY(e){return e[1]}function defaultWeight(){return 1}function density_default(){var e=defaultX,t=defaultY,n=defaultWeight,r=960,i=500,a=20,s=2,c=a*3,l=r+c*2>>s,u=i+c*2>>s,d=constant_default$1(20);function density(r){var i=new Float32Array(l*u),f=new Float32Array(l*u);r.forEach(function(r,a,o){var d=+e(r,a,o)+c>>s,f=+t(r,a,o)+c>>s,p=+n(r,a,o);d>=0&&d<l&&f>=0&&f<u&&(i[d+f*l]+=p)}),blurX({width:l,height:u,data:i},{width:l,height:u,data:f},a>>s),blurY({width:l,height:u,data:f},{width:l,height:u,data:i},a>>s),blurX({width:l,height:u,data:i},{width:l,height:u,data:f},a>>s),blurY({width:l,height:u,data:f},{width:l,height:u,data:i},a>>s),blurX({width:l,height:u,data:i},{width:l,height:u,data:f},a>>s),blurY({width:l,height:u,data:f},{width:l,height:u,data:i},a>>s);var p=d(i);if(!Array.isArray(p)){var m=(0,o.max)(i);p=(0,o.tickStep)(0,m,p),p=(0,o.range)(0,Math.floor(m/p)*p,p),p.shift()}return contours_default().thresholds(p).size([l,u])(i).map(transform)}function transform(e){return e.value*=2**(-2*s),e.coordinates.forEach(transformPolygon),e}function transformPolygon(e){e.forEach(transformRing)}function transformRing(e){e.forEach(transformPoint)}function transformPoint(e){e[0]=e[0]*2**s-c,e[1]=e[1]*2**s-c}function resize(){return c=a*3,l=r+c*2>>s,u=i+c*2>>s,density}return density.x=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$1(+t),density):e},density.y=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default$1(+e),density):t},density.weight=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$1(+e),density):n},density.size=function(e){if(!arguments.length)return[r,i];var t=Math.ceil(e[0]),n=Math.ceil(e[1]);if(!(t>=0)&&!(t>=0))throw Error(`invalid size`);return r=t,i=n,resize()},density.cellSize=function(e){if(!arguments.length)return 1<<s;if(!((e=+e)>=1))throw Error(`invalid cell size`);return s=Math.floor(Math.log(e)/Math.LN2),resize()},density.thresholds=function(e){return arguments.length?(d=typeof e==`function`?e:constant_default$1(Array.isArray(e)?le.call(e):e),density):d},density.bandwidth=function(e){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((e=+e)>=0))throw Error(`invalid bandwidth`);return a=Math.round((Math.sqrt(4*e*e+1)-1)/2),resize()},density}__name(density_default,`default`);function adder_default(){return new Adder}__name(adder_default,`default`);function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function(){this.s=this.t=0},add:function(e){add(de,e,this.t),add(this,de.s,this.s),this.s?this.t+=de.t:this.s=de.t},valueOf:function(){return this.s}};var de=new Adder;function add(e,t,n){var r=e.s=t+n,i=r-t;e.t=t-(r-i)+(n-i)}var fe=Math.PI;fe/2,fe/4;var pe=fe*2;180/fe,fe/180;var me=Math.abs,he=Math.sqrt;function noop(){}function streamGeometry(e,t){e&&_e.hasOwnProperty(e.type)&&_e[e.type](e,t)}var ge={Feature:function(e,t){streamGeometry(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)streamGeometry(n[r].geometry,t)}},_e={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){streamLine(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)streamLine(n[r],t,0)},Polygon:function(e,t){streamPolygon(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)streamPolygon(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)streamGeometry(n[r],t)}};function streamLine(e,t,n){var r=-1,i=e.length-n,a;for(t.lineStart();++r<i;)a=e[r],t.point(a[0],a[1],a[2]);t.lineEnd()}function streamPolygon(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)streamLine(e[n],t,1);t.polygonEnd()}function stream_default(e,t){e&&ge.hasOwnProperty(e.type)?ge[e.type](e,t):streamGeometry(e,t)}__name(stream_default,`default`);function identity_default(e){return e}__name(identity_default,`default`);var ve=adder_default(),ye=adder_default(),be,xe,Se,Ce,we={point:noop,lineStart:noop,lineEnd:noop,polygonStart:function(){we.lineStart=areaRingStart,we.lineEnd=areaRingEnd},polygonEnd:function(){we.lineStart=we.lineEnd=we.point=noop,ve.add(me(ye)),ye.reset()},result:function(){var e=ve/2;return ve.reset(),e}};function areaRingStart(){we.point=areaPointFirst}function areaPointFirst(e,t){we.point=areaPoint,be=Se=e,xe=Ce=t}function areaPoint(e,t){ye.add(Ce*e-Se*t),Se=e,Ce=t}function areaRingEnd(){areaPoint(be,xe)}var Te=1/0,Ee=Te,De=-Te,Oe=De,ke={point:boundsPoint,lineStart:noop,lineEnd:noop,polygonStart:noop,polygonEnd:noop,result:function(){var e=[[Te,Ee],[De,Oe]];return De=Oe=-(Ee=Te=1/0),e}};function boundsPoint(e,t){e<Te&&(Te=e),e>De&&(De=e),t<Ee&&(Ee=t),t>Oe&&(Oe=t)}var Ae=0,je=0,Me=0,Ne=0,Pe=0,Fe=0,Ie=0,Le=0,Re=0,ze,Be,q,J,Y={point:centroidPoint,lineStart:centroidLineStart,lineEnd:centroidLineEnd,polygonStart:function(){Y.lineStart=centroidRingStart,Y.lineEnd=centroidRingEnd},polygonEnd:function(){Y.point=centroidPoint,Y.lineStart=centroidLineStart,Y.lineEnd=centroidLineEnd},result:function(){var e=Re?[Ie/Re,Le/Re]:Fe?[Ne/Fe,Pe/Fe]:Me?[Ae/Me,je/Me]:[NaN,NaN];return Ae=je=Me=Ne=Pe=Fe=Ie=Le=Re=0,e}};function centroidPoint(e,t){Ae+=e,je+=t,++Me}function centroidLineStart(){Y.point=centroidPointFirstLine}function centroidPointFirstLine(e,t){Y.point=centroidPointLine,centroidPoint(q=e,J=t)}function centroidPointLine(e,t){var n=e-q,r=t-J,i=he(n*n+r*r);Ne+=i*(q+e)/2,Pe+=i*(J+t)/2,Fe+=i,centroidPoint(q=e,J=t)}function centroidLineEnd(){Y.point=centroidPoint}function centroidRingStart(){Y.point=centroidPointFirstRing}function centroidRingEnd(){centroidPointRing(ze,Be)}function centroidPointFirstRing(e,t){Y.point=centroidPointRing,centroidPoint(ze=q=e,Be=J=t)}function centroidPointRing(e,t){var n=e-q,r=t-J,i=he(n*n+r*r);Ne+=i*(q+e)/2,Pe+=i*(J+t)/2,Fe+=i,i=J*e-q*t,Ie+=i*(q+e),Le+=i*(J+t),Re+=i*3,centroidPoint(q=e,J=t)}function PathContext(e){this._context=e}PathContext.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,pe);break}},result:noop};var Ve=adder_default(),He,Ue,We,Ge,Ke,qe={point:noop,lineStart:function(){qe.point=lengthPointFirst},lineEnd:function(){He&&lengthPoint(Ue,We),qe.point=noop},polygonStart:function(){He=!0},polygonEnd:function(){He=null},result:function(){var e=+Ve;return Ve.reset(),e}};function lengthPointFirst(e,t){qe.point=lengthPoint,Ue=Ge=e,We=Ke=t}function lengthPoint(e,t){Ge-=e,Ke-=t,Ve.add(he(Ge*Ge+Ke*Ke)),Ge=e,Ke=t}function PathString(){this._string=[]}PathString.prototype={_radius:4.5,_circle:circle(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push(`Z`),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push(`M`,e,`,`,t),this._point=1;break;case 1:this._string.push(`L`,e,`,`,t);break;default:this._circle??=circle(this._radius),this._string.push(`M`,e,`,`,t,this._circle);break}},result:function(){if(this._string.length){var e=this._string.join(``);return this._string=[],e}else return null}};function circle(e){return`m0,`+e+`a`+e+`,`+e+` 0 1,1 0,`+-2*e+`a`+e+`,`+e+` 0 1,1 0,`+2*e+`z`}function path_default(e,t){var n=4.5,r,i;function path(e){return e&&(typeof n==`function`&&i.pointRadius(+n.apply(this,arguments)),stream_default(e,r(i))),i.result()}return path.area=function(e){return stream_default(e,r(we)),we.result()},path.measure=function(e){return stream_default(e,r(qe)),qe.result()},path.bounds=function(e){return stream_default(e,r(ke)),ke.result()},path.centroid=function(e){return stream_default(e,r(Y)),Y.result()},path.projection=function(t){return arguments.length?(r=t==null?(e=null,identity_default):(e=t).stream,path):e},path.context=function(e){return arguments.length?(i=e==null?(t=null,new PathString):new PathContext(t=e),typeof n!=`function`&&i.pointRadius(n),path):t},path.pointRadius=function(e){return arguments.length?(n=typeof e==`function`?e:(i.pointRadius(+e),+e),path):n},path.projection(e).context(t)}__name(path_default,`default`);var Contour=class extends XYAxis{static __inputs=[{id:`x`,type:`any`},{id:`y`,type:`number`}];_dataMinWeight;_dataMaxWeight;constructor(){super(),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default(`linear`)}xPos(e,t){return e.orientation()===`horizontal`?e.dataPos(t.label):e.valuePos(t.value)}yPos(e,t){return e.orientation()===`horizontal`?e.valuePos(t.value):e.dataPos(t.label)}layerEnter(e,t,n=250){super.layerEnter(e,t,n)}layerUpdate(e,t,n=250){super.layerUpdate(e,t,n),this._palette=this._palette.switch(this.paletteID());let r=this.flattenData(this.layerColumns(e),this.layerData(e)),i=density_default().x(t=>this.xPos(e,t)).y(t=>this.yPos(e,t)).size([this.width(),this.height()]).bandwidth(this.contourBandwidth())(r),a=i.map(e=>e.value),o=Math.min.apply(this,a),s=Math.max.apply(this,a);this._dataMinWeight=o,this._dataMaxWeight=s;let c=t.selectAll(`path`).data(i);c.enter().append(`path`).merge(c).attr(`d`,path_default()).attr(`fill`,e=>this.showContourFill()?this._palette(e.value,o,s):`none`).attr(`stroke`,this.contourStrokeColor()).attr(`stroke-linejoin`,`round`).attr(`stroke-width`,this.contourStrokeWidth()),c.exit().remove()}exit(e,t){super.exit(e,t)}};Contour.prototype._class+=` chart_Contour`,Contour.prototype.implements(I1DChart.prototype),Contour.prototype.publish(`paletteID`,`YlGnBu`,`string`,`Color palette for this widget`),Contour.prototype.publish(`useClonedPalette`,!0,`boolean`,`Enable or disable using a cloned palette`),Contour.prototype.publish(`showContourFill`,!0,`boolean`,`Show/hide the contour background colors`),Contour.prototype.publish(`showContour`,!0,`boolean`,`Show/hide the contour border lines`),Contour.prototype.publish(`contourBandwidth`,40,`number`,`Controls the sensitivity of the contour grouping algorithm`),Contour.prototype.publish(`contourStrokeColor`,`#2C3A47`,`html-color`,`Color of the contour border lines`),Contour.prototype.publish(`contourStrokeWidth`,1,`number`,`Width of the contour border lines`);var Gantt=class extends Bar{constructor(){super(),this.orientation_default(`vertical`).xAxisType_default(`ordinal`).yAxisType_default(`time`)}};Gantt.prototype._class+=` chart_Gantt`;function constant_default(e){return function constant(){return e}}__name(constant_default,`default`);var Je=Math.PI,Ye=Je/2,Xe=2*Je;function arcInnerRadius(e){return e.innerRadius}function arcOuterRadius(e){return e.outerRadius}function arcStartAngle(e){return e.startAngle}function arcEndAngle(e){return e.endAngle}function arcPadAngle(e){return e&&e.padAngle}function asin(e){return e>=1?Ye:e<=-1?-Ye:Math.asin(e)}function intersect(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=(u*(t-a)-d*(e-i))/(d*c-u*l);return[e+f*c,t+f*l]}function cornerTangents(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/Math.sqrt(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,b=h-p,S=v*v+b*b,C=i-a,w=f*h-m*p,T=(b<0?-1:1)*Math.sqrt(Math.max(0,C*C*S-w*w)),E=(w*b-v*T)/S,D=(-w*v-b*T)/S,O=(w*b+v*T)/S,k=(-w*v+b*T)/S,A=E-g,j=D-_,M=O-g,N=k-_;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-u,y01:-d,x11:E*(i/C-1),y11:D*(i/C-1)}}function arc_default(){var e=arcInnerRadius,t=arcOuterRadius,n=constant_default(0),r=null,i=arcStartAngle,a=arcEndAngle,o=arcPadAngle,s=null;function arc(){var c,l,u=+e.apply(this,arguments),d=+t.apply(this,arguments),f=i.apply(this,arguments)-Ye,p=a.apply(this,arguments)-Ye,m=Math.abs(p-f),h=p>f;if(s||=c=path(),d<u&&(l=d,d=u,u=l),!(d>1e-12))s.moveTo(0,0);else if(m>Xe-1e-12)s.moveTo(d*Math.cos(f),d*Math.sin(f)),s.arc(0,0,d,f,p,!h),u>1e-12&&(s.moveTo(u*Math.cos(p),u*Math.sin(p)),s.arc(0,0,u,p,f,h));else{var g=f,_=p,v=f,b=p,S=m,C=m,w=o.apply(this,arguments)/2,T=w>1e-12&&(r?+r.apply(this,arguments):Math.sqrt(u*u+d*d)),E=Math.min(Math.abs(d-u)/2,+n.apply(this,arguments)),D=E,O=E,k,A;if(T>1e-12){var j=asin(T/u*Math.sin(w)),M=asin(T/d*Math.sin(w));(S-=j*2)>1e-12?(j*=h?1:-1,v+=j,b-=j):(S=0,v=b=(f+p)/2),(C-=M*2)>1e-12?(M*=h?1:-1,g+=M,_-=M):(C=0,g=_=(f+p)/2)}var N=d*Math.cos(g),P=d*Math.sin(g),F=u*Math.cos(b),I=u*Math.sin(b);if(E>1e-12){var L=d*Math.cos(_),R=d*Math.sin(_),z=u*Math.cos(v),B=u*Math.sin(v);if(m<Je){var V=S>1e-12?intersect(N,P,z,B,L,R,F,I):[F,I],H=N-V[0],U=P-V[1],ee=L-V[0],W=R-V[1],G=1/Math.sin(Math.acos((H*ee+U*W)/(Math.sqrt(H*H+U*U)*Math.sqrt(ee*ee+W*W)))/2),te=Math.sqrt(V[0]*V[0]+V[1]*V[1]);D=Math.min(E,(u-te)/(G-1)),O=Math.min(E,(d-te)/(G+1))}}C>1e-12?O>1e-12?(k=cornerTangents(z,B,N,P,d,O,h),A=cornerTangents(L,R,F,I,d,O,h),s.moveTo(k.cx+k.x01,k.cy+k.y01),O<E?s.arc(k.cx,k.cy,O,Math.atan2(k.y01,k.x01),Math.atan2(A.y01,A.x01),!h):(s.arc(k.cx,k.cy,O,Math.atan2(k.y01,k.x01),Math.atan2(k.y11,k.x11),!h),s.arc(0,0,d,Math.atan2(k.cy+k.y11,k.cx+k.x11),Math.atan2(A.cy+A.y11,A.cx+A.x11),!h),s.arc(A.cx,A.cy,O,Math.atan2(A.y11,A.x11),Math.atan2(A.y01,A.x01),!h))):(s.moveTo(N,P),s.arc(0,0,d,g,_,!h)):s.moveTo(N,P),!(u>1e-12)||!(S>1e-12)?s.lineTo(F,I):D>1e-12?(k=cornerTangents(F,I,L,R,u,-D,h),A=cornerTangents(N,P,z,B,u,-D,h),s.lineTo(k.cx+k.x01,k.cy+k.y01),D<E?s.arc(k.cx,k.cy,D,Math.atan2(k.y01,k.x01),Math.atan2(A.y01,A.x01),!h):(s.arc(k.cx,k.cy,D,Math.atan2(k.y01,k.x01),Math.atan2(k.y11,k.x11),!h),s.arc(0,0,u,Math.atan2(k.cy+k.y11,k.cx+k.x11),Math.atan2(A.cy+A.y11,A.cx+A.x11),h),s.arc(A.cx,A.cy,D,Math.atan2(A.y11,A.x11),Math.atan2(A.y01,A.x01),!h))):s.arc(0,0,u,b,v,h)}if(s.closePath(),c)return s=null,c+``||null}return arc.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Je/2;return[Math.cos(r)*n,Math.sin(r)*n]},arc.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default(+t),arc):e},arc.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default(+e),arc):t},arc.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default(+e),arc):n},arc.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:constant_default(+e),arc):r},arc.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default(+e),arc):i},arc.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:constant_default(+e),arc):a},arc.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:constant_default(+e),arc):o},arc.context=function(e){return arguments.length?(s=e??null,arc):s},arc}__name(arc_default,`default`);function Linear(e){this._context=e}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function linear_default(e){return new Linear(e)}__name(linear_default,`default`);function x(e){return e[0]}function y(e){return e[1]}function line_default(){var e=x,t=y,n=constant_default(!0),r=null,i=linear_default,a=null;function line(o){var s,c=o.length,l,u=!1,d;for(r??(a=i(d=path())),s=0;s<=c;++s)!(s<c&&n(l=o[s],s,o))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(l,s,o),+t(l,s,o));if(d)return a=null,d+``||null}return line.x=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default(+t),line):e},line.y=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default(+e),line):t},line.defined=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default(!!e),line):n},line.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),line):i},line.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),line):r},line}__name(line_default,`default`),curveRadial(linear_default);function Radial(e){this._curve=e}Radial.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function curveRadial(e){function radial(t){return new Radial(e(t))}return radial._curve=e,radial}Math.sqrt(1/3)*2;var Ze=Math.sin(Je/10)/Math.sin(7*Je/10);Math.sin(Xe/10)*Ze,-Math.cos(Xe/10)*Ze,Math.sqrt(3)/2,(1/Math.sqrt(12)/2+1)*3;function noop_default(){}__name(noop_default,`default`);function point$3(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}__name(point$3,`point`);function Basis(e){this._context=e}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point$3(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:point$3(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function BasisClosed(e){this._context=e}BasisClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:point$3(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function BasisOpen(e){this._context=e}BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:point$3(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bundle(e,t){this._basis=new Basis(e),this._beta=t}Bundle.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}},(function custom(e){function bundle(t){return e===1?new Basis(t):new Bundle(t,e)}return bundle.beta=function(e){return custom(+e)},bundle})(.85);function point$2(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}__name(point$2,`point`);function Cardinal(e,t){this._context=e,this._k=(1-t)/6}Cardinal.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:point$2(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:point$2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function cardinal(t){return new Cardinal(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function CardinalClosed(e,t){this._context=e,this._k=(1-t)/6}CardinalClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:point$2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function cardinal(t){return new CardinalClosed(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function CardinalOpen(e,t){this._context=e,this._k=(1-t)/6}CardinalOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:point$2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function cardinal(t){return new CardinalOpen(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function point$1(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}__name(point$1,`point`);function CatmullRom(e,t){this._context=e,this._alpha=t}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:point$1(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Qe=(function custom(e){function catmullRom(t){return e?new CatmullRom(t,e):new Cardinal(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function CatmullRomClosed(e,t){this._context=e,this._alpha=t}CatmullRomClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:point$1(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function catmullRom(t){return e?new CatmullRomClosed(t,e):new CardinalClosed(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function CatmullRomOpen(e,t){this._context=e,this._alpha=t}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:point$1(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function catmullRom(t){return e?new CatmullRomOpen(t,e):new CardinalOpen(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function LinearClosed(e){this._context=e}LinearClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function sign(e){return e<0?-1:1}function slope3(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(sign(a)+sign(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function slope2(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function point(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function MonotoneX(e){this._context=e}MonotoneX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:point(this,this._t0,slope2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,point(this,slope2(this,n=slope3(this,e,t)),n);break;default:point(this,this._t0,n=slope3(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function MonotoneY(e){this._context=new ReflectContext(e)}(MonotoneY.prototype=Object.create(MonotoneX.prototype)).point=function(e,t){MonotoneX.prototype.point.call(this,t,e)};function ReflectContext(e){this._context=e}ReflectContext.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Natural(e){this._context=e}Natural.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=controlPoints(e),i=controlPoints(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function controlPoints(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Step$1(e,t){this._context=e,this._t=t}__name(Step$1,`Step`),Step$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}},Array.prototype.slice;var $e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},classCallCheck=function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)},et=function(){function defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),X=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tt=function get(e,t,n){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0){var i=Object.getPrototypeOf(e);return i===null?void 0:get(i,t,n)}else if(`value`in r)return r.value;else{var a=r.get;return a===void 0?void 0:a.call(n)}},inherits=function(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},possibleConstructorReturn=function(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e},toConsumableArray=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)},nt=function(){function Annotation(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.nx,o=e.ny,s=e.dy,c=s===void 0?0:s,l=e.dx,u=l===void 0?0:l,d=e.color,f=d===void 0?`grey`:d,p=e.data,m=e.type,h=e.subject,g=e.connector,_=e.note,v=e.disable,b=e.id,S=e.className;classCallCheck(this,Annotation),this._dx=a===void 0?u:a-n,this._dy=o===void 0?c:o-i,this._x=n,this._y=i,this._color=f,this.id=b,this._className=S||``,this._type=m||``,this.data=p,this.note=_||{},this.connector=g||{},this.subject=h||{},this.disable=v||[]}return et(Annotation,[{key:`updatePosition`,value:function updatePosition(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&this.type.subject.selectAll(`:not(.handle)`).nodes().length!==0&&this.type.redrawSubject())}},{key:`clearComponents`,value:function clearComponents(){this.type.clearComponents&&this.type.clearComponents()}},{key:`updateOffset`,value:function updateOffset(){this.type.setOffset&&(this.type.setOffset(),this.type.connector.selectAll(`:not(.handle)`).nodes().length!==0&&this.type.redrawConnector(),this.type.redrawNote())}},{key:`className`,get:function get$$1(){return this._className},set:function set$$1(e){this._className=e,this.type.setClassName&&this.type.setClassName()}},{key:`type`,get:function get$$1(){return this._type},set:function set$$1(e){this._type=e,this.clearComponents()}},{key:`x`,get:function get$$1(){return this._x},set:function set$$1(e){this._x=e,this.updatePosition()}},{key:`y`,get:function get$$1(){return this._y},set:function set$$1(e){this._y=e,this.updatePosition()}},{key:`color`,get:function get$$1(){return this._color},set:function set$$1(e){this._color=e,this.updatePosition()}},{key:`dx`,get:function get$$1(){return this._dx},set:function set$$1(e){this._dx=e,this.updateOffset()}},{key:`dy`,get:function get$$1(){return this._dy},set:function set$$1(e){this._dy=e,this.updateOffset()}},{key:`nx`,set:function set$$1(e){this._dx=e-this._x,this.updateOffset()}},{key:`ny`,set:function set$$1(e){this._dy=e-this._y,this.updateOffset()}},{key:`offset`,get:function get$$1(){return{x:this._dx,y:this._dy}},set:function set$$1(e){var t=e.x,n=e.y;this._dx=t,this._dy=n,this.updateOffset()}},{key:`position`,get:function get$$1(){return{x:this._x,y:this._y}},set:function set$$1(e){var t=e.x,n=e.y;this._x=t,this._y=n,this.updatePosition()}},{key:`translation`,get:function get$$1(){return{x:this._x+this._dx,y:this._y+this._dy}}},{key:`json`,get:function get$$1(){var e={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(e.data=this.data),this.type&&(e.type=this.type),this._className&&(e.className=this._className),Object.keys(this.connector).length>0&&(e.connector=this.connector),Object.keys(this.subject).length>0&&(e.subject=this.subject),Object.keys(this.note).length>0&&(e.note=this.note),e}}]),Annotation}(),rt=function(){function AnnotationCollection(e){var t=e.annotations,n=e.accessors,r=e.accessorsInverse;classCallCheck(this,AnnotationCollection),this.accessors=n,this.accessorsInverse=r,this.annotations=t}return et(AnnotationCollection,[{key:`clearTypes`,value:function clearTypes(e){this.annotations.forEach(function(t){t.type=void 0,t.subject=e&&e.subject||t.subject,t.connector=e&&e.connector||t.connector,t.note=e&&e.note||t.note})}},{key:`setPositionWithAccessors`,value:function setPositionWithAccessors(){var e=this;this.annotations.forEach(function(t){t.type.setPositionWithAccessors(e.accessors)})}},{key:`editMode`,value:function editMode(e){this.annotations.forEach(function(t){t.type&&(t.type.editMode=e,t.type.updateEditMode())})}},{key:`updateDisable`,value:function updateDisable(e){this.annotations.forEach(function(t){t.disable=e,t.type&&e.forEach(function(e){t.type[e]&&(t.type[e].remove&&t.type[e].remove(),t.type[e]=void 0)})})}},{key:`updateTextWrap`,value:function updateTextWrap(e){this.annotations.forEach(function(t){t.type&&t.type.updateTextWrap&&t.type.updateTextWrap(e)})}},{key:`updateText`,value:function updateText(){this.annotations.forEach(function(e){e.type&&e.type.drawText&&e.type.drawText()})}},{key:`updateNotePadding`,value:function updateNotePadding(e){this.annotations.forEach(function(t){t.type&&(t.type.notePadding=e)})}},{key:`json`,get:function get$$1(){var e=this;return this.annotations.map(function(t){var n=t.json;return e.accessorsInverse&&t.data&&(n.data={},Object.keys(e.accessorsInverse).forEach(function(r){n.data[r]=e.accessorsInverse[r]({x:t.x,y:t.y})})),n})}},{key:`noteNodes`,get:function get$$1(){return this.annotations.map(function(e){return X({},e.type.getNoteBBoxOffset(),{positionX:e.x,positionY:e.y})})}}]),AnnotationCollection}(),it=function pointHandle(e){var t=e.cx,n=t===void 0?0:t,r=e.cy;return{move:{x:n,y:r===void 0?0:r}}},at=function circleHandles(e){var t=e.cx,n=t===void 0?0:t,r=e.cy,i=r===void 0?0:r,a=e.r1,o=e.r2,s=e.padding,c={move:{x:n,y:i}};return a!==void 0&&(c.r1={x:n+a/Math.sqrt(2),y:i+a/Math.sqrt(2)}),o!==void 0&&(c.r2={x:n+o/Math.sqrt(2),y:i+o/Math.sqrt(2)}),s!==void 0&&(c.padding={x:n+a+s,y:i}),c},ot=function addHandles(e){var t=e.group,n=e.handles,r=e.r,i=r===void 0?10:r,a=t.selectAll(`circle.handle`).data(n);a.enter().append(`circle`).attr(`class`,`handle`).attr(`fill`,`grey`).attr(`fill-opacity`,.1).attr(`cursor`,`move`).attr(`stroke-dasharray`,5).attr(`stroke`,`grey`).call((0,o.drag)().container((0,o.select)(`g.annotations`).node()).on(`start`,function(e){return e.start&&e.start(e)}).on(`drag`,function(e){return e.drag&&e.drag(e)}).on(`end`,function(e){return e.end&&e.end(e)})),t.selectAll(`circle.handle`).attr(`cx`,function(e){return e.x}).attr(`cy`,function(e){return e.y}).attr(`r`,function(e){return e.r||i}).attr(`class`,function(e){return`handle `+(e.className||``)}),a.exit().remove()},st=function leftRightDynamic(e,t){return(e===`dynamic`||e===`left`||e===`right`)&&(e=t<0?`top`:`bottom`),e},ct=function topBottomDynamic(e,t){return(e===`dynamic`||e===`top`||e===`bottom`)&&(e=t<0?`right`:`left`),e},lt=[`topBottom`,`top`,`bottom`],ut=[`leftRight`,`left`,`right`],noteAlignment=(function(e){var t=e.padding,n=t===void 0?0:t,r=e.bbox,i=r===void 0?{x:0,y:0,width:0,height:0}:r,a=e.align,o=e.orientation,s=e.offset,c=s===void 0?{x:0,y:0}:s,l=-i.x,u=0;return lt.indexOf(o)===-1?ut.indexOf(o)!==-1&&(a=st(a,c.y),c.x<0&&o===`leftRight`||o===`left`?l-=i.width+n:l+=n,a===`middle`?u-=i.height/2:a===`top`&&(u-=i.height)):(a=ct(a,c.x),c.y<0&&o===`topBottom`||o===`top`?u-=i.height+n:u+=n,a===`middle`?l-=i.width/2:a===`right`&&(l-=i.width)),{x:l,y:u}}),Z=function lineBuilder(e){var t=e.data,n=e.curve,r=n===void 0?linear_default:n,i=e.canvasContext,a=e.className,o=e.classID,s=line_default().curve(r),c={type:`path`,className:a,classID:o,data:t};return i?(s.context(i),c.pathMethods=s):c.attrs={d:s(t)},c},dt=function arcBuilder(e){var t=e.data,n=e.canvasContext,r={type:`path`,className:e.className,classID:e.classID,data:t},i=arc_default().innerRadius(t.innerRadius||0).outerRadius(t.outerRadius||t.radius||2).startAngle(t.startAngle||0).endAngle(t.endAngle||2*Math.PI);return n?(i.context(n),r.pathMethods=lineGen):r.attrs={d:i()},r},noteVertical=(function(e){var t=e.align,n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.bbox,s=e.offset;return t=st(t,s.y),t===`top`?a-=o.height:t===`middle`&&(a-=o.height/2),{components:[Z({data:[[r,a],[r,a+o.height]],className:`note-line`})]}}),noteHorizontal=(function(e){var t=e.align,n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.offset,s=e.bbox;return t=ct(t,o.x),t===`right`?r-=s.width:t===`middle`&&(r-=s.width/2),{components:[Z({data:[[r,a],[r+s.width,a]],className:`note-line`})]}}),ft=function lineSetup(e){var t=e.type,n=e.subjectType,r=t.annotation,i=r.position,a=r.x-i.x,o=a+r.dx,s=r.y-i.y,c=s+r.dy,l=r.subject;if(n===`circle`&&(l.outerRadius||l.radius)){var u=Math.sqrt((a-o)*(a-o)+(s-c)*(s-c)),d=Math.asin(-c/u),f=l.outerRadius||l.radius+(l.radiusPadding||0);a=Math.abs(Math.cos(d)*f)*(o<0?-1:1),s=Math.abs(Math.sin(d)*f)*(c<0?-1:1)}if(n===`rect`){var p=l.width,m=l.height;(p>0&&r.dx>0||p<0&&r.dx<0)&&(a=Math.abs(p)>Math.abs(r.dx)?p/2:p),(m>0&&r.dy>0||m<0&&r.dy<0)&&(s=Math.abs(m)>Math.abs(r.dy)?m/2:m),a===p/2&&s===m/2&&(a=o,s=c)}return[[a,s],[o,c]]},connectorLine=(function(e){return{components:[Z({data:ft(e),className:`connector`})]}}),connectorElbow=(function(e){var t=e.type,n=e.subjectType,r=t.annotation,i=r.position,a=r.x-i.x,o=a+r.dx,s=r.y-i.y,c=s+r.dy,l=r.subject;if(n===`rect`){var u=l.width,d=l.height;(u>0&&r.dx>0||u<0&&r.dx<0)&&(a=Math.abs(u)>Math.abs(r.dx)?u/2:u),(d>0&&r.dy>0||d<0&&r.dy<0)&&(s=Math.abs(d)>Math.abs(r.dy)?d/2:d),a===u/2&&s===d/2&&(a=o,s=c)}var f=[[a,s],[o,c]],p=c-s,m=o-a,h=o,g=c,_=c<s&&o>a||o<a&&c>s?-1:1;if(Math.abs(m)<Math.abs(p)?(h=o,g=s+m*_):(g=c,h=a+p*_),n===`circle`&&(l.outerRadius||l.radius)){var v=(l.outerRadius||l.radius)+(l.radiusPadding||0),b=v/Math.sqrt(2);if(Math.abs(m)>b&&Math.abs(p)>b)a=b*(o<0?-1:1),s=b*(c<0?-1:1),f=[[a,s],[h,g],[o,c]];else if(Math.abs(m)>Math.abs(p)){var S=Math.asin(-c/v);a=Math.abs(Math.cos(S)*v)*(o<0?-1:1),f=[[a,c],[o,c]]}else{var C=Math.acos(o/v);s=Math.abs(Math.sin(C)*v)*(c<0?-1:1),f=[[o,s],[o,c]]}}else f=[[a,s],[h,g],[o,c]];return{components:[Z({data:f,className:`connector`})]}}),connectorCurve=(function(e){var t=e.type,n=e.connectorData,r=e.subjectType;n||={},(!n.points||typeof n.points==`number`)&&(n.points=pt(t.annotation.offset,n.points)),n.curve||=Qe;var i=[];if(t.editMode){var a=n.points.map(function(e,t){return X({},it({cx:e[0],cy:e[1]}),{index:t})}),s=function updatePoint(e){n.points[e][0]+=o.event.dx,n.points[e][1]+=o.event.dy,t.redrawConnector()};i=t.mapHandles(a.map(function(e){return X({},e.move,{drag:s.bind(t,e.index)})}))}var c=ft({type:t,subjectType:r});return c=[c[0]].concat(toConsumableArray(n.points),[c[1]]),{components:[Z({data:c,curve:n.curve,className:`connector`})],handles:i}}),pt=function createPoints(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,n={x:e.x/(t+1),y:e.y/(t+1)},r=[],i=1;i<=t;i++)r.push([n.x*i+i%2*20,n.y*i-i%2*20]);return r},connectorArrow=(function(e){var t=e.annotation,n=e.start,r=e.end,i=e.scale,a=i===void 0?1:i,o=t.position;n=n?[-r[0]+n[0],-r[1]+n[1]]:[t.dx,t.dy],r||=[t.x-o.x,t.y-o.y];var s=r[0],c=r[1],l=n[0],u=n[1],d=10*a,f=16/180*Math.PI,p=Math.atan(u/l);return l<0&&(p+=Math.PI),{components:[Z({data:[[s,c],[Math.cos(p+f)*d+s,Math.sin(p+f)*d+c],[Math.cos(p-f)*d+s,Math.sin(p-f)*d+c],[s,c]],className:`connector-end connector-arrow`,classID:`connector-end`})]}}),connectorDot=(function(e){var t=e.line,n=e.scale,r=dt({className:`connector-end connector-dot`,classID:`connector-end`,data:{radius:3*Math.sqrt(n===void 0?1:n)}});return r.attrs.transform=`translate(`+t.data[0][0]+`, `+t.data[0][1]+`)`,{components:[r]}}),subjectCircle=(function(e){var t=e.subjectData,n=e.type;!t.radius&&!t.outerRadius&&(t.radius=20);var r=[],i=dt({data:t,className:`subject`});if(n.editMode){var a=at({r1:i.data.outerRadius||i.data.radius,r2:i.data.innerRadius,padding:t.radiusPadding}),s=function updateRadius(e){t[e]=t[e]+o.event.dx*Math.sqrt(2),n.redrawSubject(),n.redrawConnector()},c=[X({},a.r1,{drag:s.bind(n,t.outerRadius===void 0?`radius`:`outerRadius`)})];t.innerRadius&&c.push(X({},a.r2,{drag:s.bind(n,`innerRadius`)})),r=n.mapHandles(c)}return i.attrs[`fill-opacity`]=0,{components:[i],handles:r}}),subjectRect=(function(e){var t=e.subjectData,n=e.type;t.width||=100,t.height||=100;var r=[],i=t.width,a=t.height,s=Z({data:[[0,0],[i,0],[i,a],[0,a],[0,0]],className:`subject`});if(n.editMode){var c=[{x:i,y:a/2,drag:function updateWidth(){t.width=o.event.x,n.redrawSubject(),n.redrawConnector()}.bind(n)},{x:i/2,y:a,drag:function updateHeight(){t.height=o.event.y,n.redrawSubject(),n.redrawConnector()}.bind(n)}];r=n.mapHandles(c)}return s.attrs[`fill-opacity`]=.1,{components:[s],handles:r}}),subjectThreshold=(function(e){var t=e.subjectData,n=e.type.annotation.position,r=(t.x1===void 0?n.x:t.x1)-n.x,i=(t.x2===void 0?n.x:t.x2)-n.x,a=(t.y1===void 0?n.y:t.y1)-n.y,o=(t.y2===void 0?n.y:t.y2)-n.y;return{components:[Z({data:[[r,a],[i,o]],className:`subject`})]}}),subjectBadge=(function(e){var t=e.subjectData,n=t===void 0?{}:t,r=e.type,i=r===void 0?{}:r,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.typeSettings&&i.typeSettings.subject;n.radius||(s&&s.radius?n.radius=s.radius:n.radius=14),n.x||s&&s.x&&(n.x=s.x),n.y||s&&s.y&&(n.y=s.y);var c=[],l=[],u=n.radius,d=u*.7,f=0,p=0,m=Math.sqrt(2)*u,h={xleftcorner:-u,xrightcorner:u,ytopcorner:-u,ybottomcorner:u,xleft:-m,xright:m,ytop:-m,ybottom:m};n.x&&!n.y?f=h[`x`+n.x]:n.y&&!n.x?p=h[`y`+n.y]:n.x&&n.y&&(f=h[`x`+n.x+`corner`],p=h[`y`+n.y+`corner`]);var g=`translate(`+f+`, `+p+`)`,_=dt({className:`subject`,data:{radius:u}});_.attrs.transform=g,_.attrs.fill=a.color,_.attrs[`stroke-linecap`]=`round`,_.attrs[`stroke-width`]=`3px`;var v=dt({className:`subject-ring`,data:{outerRadius:u,innerRadius:d}});v.attrs.transform=g,v.attrs[`stroke-width`]=`3px`,v.attrs.fill=`white`;var b=void 0;if(f&&p||!f&&!p)b=Z({className:`subject-pointer`,data:[[0,0],[f||0,0],[0,p||0],[0,0]]});else if(f||p){var S=function notCornerPointerXY(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return e&&e/Math.sqrt(2)/Math.sqrt(2)||t*u/Math.sqrt(2)};b=Z({className:`subject-pointer`,data:[[0,0],[S(f),S(p)],[S(f,-1),S(p,-1)],[0,0]]})}if(b&&(b.attrs.fill=a.color,b.attrs[`stroke-linecap`]=`round`,b.attrs[`stroke-width`]=`3px`,l.push(b)),i.editMode){var C={x:f*2,y:p*2,drag:function dragBadge(){n.x=o.event.x<-u*2?`left`:o.event.x>u*2?`right`:void 0,n.y=o.event.y<-u*2?`top`:o.event.y>u*2?`bottom`:void 0,i.redrawSubject()}.bind(i)};!C.x&&!C.y&&(C.y=-u),c=i.mapHandles([C])}var w=void 0;return n.text&&(w={type:`text`,className:`badge-text`,attrs:{fill:`white`,stroke:`none`,"font-size":`.7em`,text:n.text,"text-anchor":`middle`,dy:`.25em`,x:f,y:p}}),l.push(_),l.push(v),l.push(w),{components:l,handles:c}}),mt=function(){function Type(e){var t=e.a,n=e.annotation,r=e.editMode,i=e.dispatcher,a=e.notePadding,o=e.accessors;if(classCallCheck(this,Type),this.a=t,this.note=n.disable.indexOf(`note`)===-1&&t.select(`g.annotation-note`),this.noteContent=this.note&&t.select(`g.annotation-note-content`),this.connector=n.disable.indexOf(`connector`)===-1&&t.select(`g.annotation-connector`),this.subject=n.disable.indexOf(`subject`)===-1&&t.select(`g.annotation-subject`),this.dispatcher=i,i){var s=yt.bind(null,i,n);s({component:this.note,name:`note`}),s({component:this.connector,name:`connector`}),s({component:this.subject,name:`subject`})}this.annotation=n,this.editMode=n.editMode||r,this.notePadding=a===void 0?3:a,this.offsetCornerX=0,this.offsetCornerY=0,o&&n.data&&this.init(o)}return et(Type,[{key:`init`,value:function init(e){this.annotation.x||this.mapX(e),this.annotation.y||this.mapY(e)}},{key:`mapY`,value:function mapY(e){e.y&&(this.annotation.y=e.y(this.annotation.data))}},{key:`mapX`,value:function mapX(e){e.x&&(this.annotation.x=e.x(this.annotation.data))}},{key:`updateEditMode`,value:function updateEditMode(){this.a.selectAll(`circle.handle`).remove()}},{key:`drawOnSVG`,value:function drawOnSVG(e,t){var n=this;Array.isArray(t)||(t=[t]),t.filter(function(e){return e}).forEach(function(t){var r=t.type,i=t.className,a=t.attrs,o=t.handles,s=t.classID;if(r===`handle`)ot({group:e,r:a&&a.r,handles:o});else{Q(e,[n.annotation],r,i,s);for(var c=e.select(r+`.`+(s||i)),l=Object.keys(a),u=[],d=c.node().attributes,f=d.length-1;f>=0;f--){var p=d[f].name;l.indexOf(p)===-1&&p!==`class`&&u.push(p)}l.forEach(function(e){e===`text`?c.text(a[e]):c.attr(e,a[e])}),u.forEach(function(e){return c.attr(e,null)})}})}},{key:`getNoteBBox`,value:function getNoteBBox(){return xt(this.note,`.annotation-note-content text`)}},{key:`getNoteBBoxOffset`,value:function getNoteBBoxOffset(){var e=xt(this.note,`.annotation-note-content`),t=this.noteContent.attr(`transform`).split(/\(|\,|\)/g);return e.offsetCornerX=parseFloat(t[1])+this.annotation.dx,e.offsetCornerY=parseFloat(t[2])+this.annotation.dy,e.offsetX=this.annotation.dx,e.offsetY=this.annotation.dy,e}},{key:`drawSubject`,value:function drawSubject(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.annotation.subject,r=t.type,i={type:this,subjectData:n},a={};r===`circle`?a=subjectCircle(i):r===`rect`?a=subjectRect(i):r===`threshold`?a=subjectThreshold(i):r===`badge`&&(a=subjectBadge(i,this.annotation));var o=a,s=o.components,c=s===void 0?[]:s,l=o.handles,u=l===void 0?[]:l;return c.forEach(function(t){t&&t.attrs&&!t.attrs.stroke&&(t.attrs.stroke=e.annotation.color)}),this.editMode&&(u=u.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),c.push({type:`handle`,handles:u})),c}},{key:`drawConnector`,value:function drawConnector(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.annotation.connector,r=n.type||t.type,i={type:this,connectorData:n};i.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var a={};a=r===`curve`?connectorCurve(i):r===`elbow`?connectorElbow(i):connectorLine(i);var o=a,s=o.components,c=s===void 0?[]:s,l=o.handles,u=l===void 0?[]:l,d=c[0];d&&(d.attrs.stroke=this.annotation.color,d.attrs.fill=`none`);var f=n.end||t.end,p={};if(f===`arrow`){var m=d.data[1],h=d.data[0];Math.sqrt((m[0]-h[0])**2+(m[1]-h[1])**2)<5&&d.data[2]&&(m=d.data[2]),p=connectorArrow({annotation:this.annotation,start:m,end:h,scale:n.endScale})}else f===`dot`?p=connectorDot({line:d,scale:n.endScale}):(!f||f===`none`)&&this.connector&&this.connector.select(`.connector-end`).remove();return p.components&&(p.components.forEach(function(t){t.attrs.fill=e.annotation.color,t.attrs.stroke=e.annotation.color}),c=c.concat(p.components)),this.editMode&&u.length!==0&&c.push({type:`handle`,handles:u}),c}},{key:`drawNote`,value:function drawNote(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.annotation.note,r=n.align||t.align||`dynamic`,i={bbox:t.bbox,align:r,offset:this.annotation.offset},a=n.lineType||t.lineType,s={};a===`vertical`?s=noteVertical(i):a===`horizontal`&&(s=noteHorizontal(i));var c=s,l=c.components,u=l===void 0?[]:l,d=c.handles,f=d===void 0?[]:d;if(u.forEach(function(t){t.attrs.stroke=e.annotation.color}),this.editMode){f=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),u.push({type:`handle`,handles:f});var p=this.dragNote.bind(this),m=this.dragstarted.bind(this),h=this.dragended.bind(this);this.note.call((0,o.drag)().container((0,o.select)(`g.annotations`).node()).on(`start`,function(e){return m(e)}).on(`drag`,function(e){return p(e)}).on(`end`,function(e){return h(e)}))}else this.note.on(`mousedown.drag`,null);return u}},{key:`drawNoteContent`,value:function drawNoteContent(e){var t=this.annotation.note,n=t.padding===void 0?this.notePadding:t.padding,r=t.orientation||e.orientation||`topBottom`,i=t.lineType||e.lineType,a=t.align||e.align||`dynamic`;i===`vertical`?r=`leftRight`:i===`horizontal`&&(r=`topBottom`);var o=noteAlignment({padding:n,bbox:e.bbox,offset:this.annotation.offset,orientation:r,align:a}),s=o.x,c=o.y;return this.offsetCornerX=s+this.annotation.dx,this.offsetCornerY=c+this.annotation.dy,this.note&&this.noteContent.attr(`transform`,`translate(`+s+`, `+c+`)`),[]}},{key:`drawOnScreen`,value:function drawOnScreen(e,t){return this.drawOnSVG(e,t)}},{key:`redrawSubject`,value:function redrawSubject(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())}},{key:`redrawConnector`,value:function redrawConnector(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())}},{key:`redrawNote`,value:function redrawNote(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:e})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:e}))}},{key:`setPosition`,value:function setPosition(){var e=this.annotation.position;this.a.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`)}},{key:`clearComponents`,value:function clearComponents(){this.subject&&this.subject.select(`*`).remove(),this.connector&&this.connector.select(`*`).remove()}},{key:`setOffset`,value:function setOffset(){if(this.note){var e=this.annotation.offset;this.note.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`)}}},{key:`setPositionWithAccessors`,value:function setPositionWithAccessors(e){e&&this.annotation.data&&(this.mapX(e),this.mapY(e)),this.setPosition()}},{key:`setClassName`,value:function setClassName(){this.a.attr(`class`,`annotation `+(this.className&&this.className())+` `+(this.editMode?`editable`:``)+` `+(this.annotation.className||``))}},{key:`draw`,value:function draw(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()}},{key:`dragstarted`,value:function dragstarted(){o.event.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call(`dragstart`,this.a,this.annotation),this.a.classed(`dragging`,!0),this.a.selectAll(`circle.handle`).style(`pointer-events`,`none`)}},{key:`dragended`,value:function dragended(){this.dispatcher&&this.dispatcher.call(`dragend`,this.a,this.annotation),this.a.classed(`dragging`,!1),this.a.selectAll(`circle.handle`).style(`pointer-events`,`all`)}},{key:`dragSubject`,value:function dragSubject(){var e=this.annotation.position;e.x+=o.event.dx,e.y+=o.event.dy,this.annotation.position=e}},{key:`dragNote`,value:function dragNote(){var e=this.annotation.offset;e.x+=o.event.dx,e.y+=o.event.dy,this.annotation.offset=e}},{key:`mapHandles`,value:function mapHandles(e){var t=this;return e.map(function(e){return X({},e,{start:t.dragstarted.bind(t),end:t.dragended.bind(t)})})}}]),Type}(),ht=function customType(e,t,n){return function(e){inherits(customType,e);function customType(e){classCallCheck(this,customType);var n=possibleConstructorReturn(this,(customType.__proto__||Object.getPrototypeOf(customType)).call(this,e));return n.typeSettings=t,t.disable&&t.disable.forEach(function(e){n[e]&&n[e].remove(),n[e]=void 0,e===`note`&&(n.noteContent=void 0)}),n}return et(customType,[{key:`className`,value:function className(){return``+(t.className||tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`className`,this)&&tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`className`,this).call(this)||``)}},{key:`drawSubject`,value:function drawSubject(e){return this.typeSettings.subject=X({},t.subject,this.typeSettings.subject),tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawSubject`,this).call(this,X({},e,this.typeSettings.subject))}},{key:`drawConnector`,value:function drawConnector(e){return this.typeSettings.connector=X({},t.connector,this.typeSettings.connector),tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawConnector`,this).call(this,X({},e,t.connector,this.typeSettings.connector))}},{key:`drawNote`,value:function drawNote(e){return this.typeSettings.note=X({},t.note,this.typeSettings.note),tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawNote`,this).call(this,X({},e,t.note,this.typeSettings.note))}},{key:`drawNoteContent`,value:function drawNoteContent(e){return tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawNoteContent`,this).call(this,X({},e,t.note,this.typeSettings.note))}}],[{key:`init`,value:function init(e,t){return tt(customType.__proto__||Object.getPrototypeOf(customType),`init`,this).call(this,e,t),n&&(e=n(e,t)),e}}]),customType}(e)},gt=function(e){inherits(d3NoteText,e);function d3NoteText(e){classCallCheck(this,d3NoteText);var t=possibleConstructorReturn(this,(d3NoteText.__proto__||Object.getPrototypeOf(d3NoteText)).call(this,e));return t.textWrap=e.textWrap||120,t.drawText(),t}return et(d3NoteText,[{key:`updateTextWrap`,value:function updateTextWrap(e){this.textWrap=e,this.drawText()}},{key:`drawText`,value:function drawText(){if(this.note){Q(this.note,[this.annotation],`g`,`annotation-note-content`);var e=this.note.select(`g.annotation-note-content`);Q(e,[this.annotation],`rect`,`annotation-note-bg`),Q(e,[this.annotation],`text`,`annotation-note-label`),Q(e,[this.annotation],`text`,`annotation-note-title`);var t={height:0},n=this.a.select(`text.annotation-note-label`),r=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,i=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,a=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,o={top:0,bottom:0,left:0,right:0};if(typeof a==`number`?o={top:a,bottom:a,left:a,right:a}:a&&(a===void 0?`undefined`:$e(a))===`object`&&(o=X(o,a)),this.annotation.note.title){var s=this.a.select(`text.annotation-note-title`);s.text(this.annotation.note.title),s.attr(`fill`,this.annotation.color),s.attr(`font-weight`,`bold`),s.call(bt,r,i),t=s.node().getBBox()}n.text(this.annotation.note.label).attr(`dx`,`0`),n.call(bt,r,i),n.attr(`y`,t.height*1.1||0),n.attr(`fill`,this.annotation.color);var c=this.getNoteBBox();this.a.select(`rect.annotation-note-bg`).attr(`width`,c.width+o.left+o.right).attr(`height`,c.height+o.top+o.bottom).attr(`x`,c.x-o.left).attr(`y`,-o.top).attr(`fill`,`white`).attr(`fill-opacity`,0)}}}]),d3NoteText}(mt);ht(gt,{className:`label`,note:{align:`middle`}});var _t=ht(gt,{className:`callout`,note:{lineType:`horizontal`}}),vt=ht(_t,{className:`callout elbow`,connector:{type:`elbow`}});ht(_t,{className:`callout curve`,connector:{type:`curve`}}),ht(mt,{className:`badge`,subject:{type:`badge`},disable:[`connector`,`note`]}),ht(gt,{className:`callout circle`,subject:{type:`circle`},note:{lineType:`horizontal`},connector:{type:`elbow`}}),ht(gt,{className:`callout rect`,subject:{type:`rect`},note:{lineType:`horizontal`},connector:{type:`elbow`}}),ht(function(e){inherits(ThresholdMap,e);function ThresholdMap(){return classCallCheck(this,ThresholdMap),possibleConstructorReturn(this,(ThresholdMap.__proto__||Object.getPrototypeOf(ThresholdMap)).apply(this,arguments))}return et(ThresholdMap,[{key:`mapY`,value:function mapY(e){tt(ThresholdMap.prototype.__proto__||Object.getPrototypeOf(ThresholdMap.prototype),`mapY`,this).call(this,e);var t=this.annotation;(t.subject.x1||t.subject.x2)&&t.data&&e.y&&(t.y=e.y(t.data)),(t.subject.x1||t.subject.x2)&&!t.x&&(t.x=t.subject.x1||t.subject.x2)}},{key:`mapX`,value:function mapX(e){tt(ThresholdMap.prototype.__proto__||Object.getPrototypeOf(ThresholdMap.prototype),`mapX`,this).call(this,e);var t=this.annotation;(t.subject.y1||t.subject.y2)&&t.data&&e.x&&(t.x=e.x(t.data)),(t.subject.y1||t.subject.y2)&&!t.y&&(t.y=t.subject.y1||t.subject.y2)}}]),ThresholdMap}(_t),{className:`callout xythreshold`,subject:{type:`threshold`}});var Q=function newWithClass(e,t,n,r,i){var a=e.selectAll(n+`.`+(i||r)).data(t);return a.enter().append(n).merge(a).attr(`class`,r),a.exit().remove(),e},yt=function addHandlers(e,t,n){var r=n.component,i=n.name;r&&r.on(`mouseover.annotations`,function(){e.call(i+`over`,r,t)}).on(`mouseout.annotations`,function(){return e.call(i+`out`,r,t)}).on(`click.annotations`,function(){return e.call(i+`click`,r,t)})},bt=function wrap(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1.2;e.each(function(){for(var e=(0,o.select)(this),i=e.text().split(n||/[ \t\r\n]+/).reverse().filter(function(e){return e!==``}),a=void 0,s=[],c=e.text(null).append(`tspan`).attr(`x`,0).attr(`dy`,`0.8em`);a=i.pop();)s.push(a),c.text(s.join(` `)),c.node().getComputedTextLength()>t&&s.length>1&&(s.pop(),c.text(s.join(` `)),s=[a],c=e.append(`tspan`).attr(`x`,0).attr(`dy`,r+`em`).text(a))})},xt=function bboxWithoutHandles(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`:not(.handle)`;return e?e.selectAll(t).nodes().reduce(function(e,t){var n=t.getBBox();e.x=Math.min(e.x,n.x),e.y=Math.min(e.y,n.y),e.width=Math.max(e.width,n.width);var r=t&&t.attributes&&t.attributes.y;return e.height=Math.max(e.height,(r&&parseFloat(r.value)||0)+n.height),e},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}};function annotation(){var e=[],t=void 0,n=void 0,r=[],i={},a={},s=!1,c=void 0,l=_t,u=void 0,d=void 0,f=(0,o.dispatch)(`subjectover`,`subjectout`,`subjectclick`,`connectorover`,`connectorout`,`connectorclick`,`noteover`,`noteout`,`noteclick`,`dragend`,`dragstart`),p=void 0,m=function annotation(n){p=n,s||n.selectAll(`circle.handle`).remove();var m=e.map(function(e){return e.type||=l,e.disable||=r,new nt(e)});t||=new rt({annotations:m,accessors:i,accessorsInverse:a,ids:c}),n.selectAll(`g`).data([t]).enter().append(`g`).attr(`class`,`annotations`);var h=n.select(`g.annotations`);Q(h,t.annotations,`g`,`annotation`),h.selectAll(`g.annotation`).each(function(e){var t=(0,o.select)(this);t.attr(`class`,`annotation`),Q(t,[e],`g`,`annotation-connector`),Q(t,[e],`g`,`annotation-subject`),Q(t,[e],`g`,`annotation-note`),Q(t.select(`g.annotation-note`),[e],`g`,`annotation-note-content`),e.type=e.type.toString()===`[object Object]`?e.type:new e.type({a:t,annotation:e,textWrap:u,notePadding:d,editMode:s,dispatcher:f,accessors:i}),e.type.draw(),e.type.drawText&&e.type.drawText()})};return m.json=function(){return console.log(`Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.`,t.json),window.copy(JSON.stringify(t.json.map(function(e){return delete e.type,e}))),m},m.update=function(){return e&&t&&(e=t.annotations.map(function(e){return e.type.draw(),e})),m},m.updateText=function(){return t&&(t.updateText(u),e=t.annotations),m},m.updatedAccessors=function(){return t.setPositionWithAccessors(),e=t.annotations,m},m.disable=function(n){return arguments.length?(r=n,t&&(t.updateDisable(r),e=t.annotations),m):r},m.textWrap=function(n){return arguments.length?(u=n,t&&(t.updateTextWrap(u),e=t.annotations),m):u},m.notePadding=function(n){return arguments.length?(d=n,t&&(t.updateNotePadding(d),e=t.annotations),m):d},m.type=function(n,r){return arguments.length?(l=n,t&&(t.annotations.map(function(e){e.type.note&&e.type.note.selectAll(`*:not(.annotation-note-content)`).remove(),e.type.noteContent&&e.type.noteContent.selectAll(`*`).remove(),e.type.subject&&e.type.subject.selectAll(`*`).remove(),e.type.connector&&e.type.connector.selectAll(`*`).remove(),e.type.typeSettings={},e.type=l,e.subject=r&&r.subject||e.subject,e.connector=r&&r.connector||e.connector,e.note=r&&r.note||e.note}),e=t.annotations),m):l},m.annotations=function(n){return arguments.length?(e=n,t&&t.annotations&&(e.some(function(e){return!e.type||e.type.toString()!==`[object Object]`})?(t=null,m(p)):t.annotations=e),m):t&&t.annotations||e},m.context=function(e){return arguments.length?(n=e,m):n},m.accessors=function(e){return arguments.length?(i=e,m):i},m.accessorsInverse=function(e){return arguments.length?(a=e,m):a},m.ids=function(e){return arguments.length?(c=e,m):c},m.editMode=function(n){return arguments.length?(s=n,p&&p.selectAll(`g.annotation`).classed(`editable`,s),t&&(t.editMode(s),e=t.annotations),m):s},m.collection=function(e){return arguments.length?(t=e,m):t},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m}function value2Angle(e){return(e-.5)*.65*2*Math.PI}function pointOnArc(e,t){return{x:Math.cos(e-Math.PI/2)*t,y:Math.sin(e-Math.PI/2)*t}}function indicatorTranslate(e,t,n=!1){let r=pointOnArc(e,t),i=e*180/Math.PI+(n===!0?180:0);return`translate(${r.x}, ${r.y}) rotate(${i})`}function indicatorTween(e,t,n=!1){return function(r){let i=(0,o.interpolate)(r.angle,e);return r.angle=e,function(e){return indicatorTranslate(i(e),t,n)}}}function arcTween(e,t,n){return function(r){let i=(0,o.interpolate)(r.startAngle,e),a=(0,o.interpolate)(r.endAngle,t);return function(e){return r.startAngle=i(e),r.endAngle=a(e),n(r)}}}var $=class Gauge extends o.SVGWidget{_d3Arc=arc_default$1().innerRadius(85).outerRadius(100);_colorScale=(0,o.scaleLinear)().interpolate(o.interpolateHcl);_usageArc;_meanArc;_freeArc;_indInner;_indOuter;_centerTextG;_centerText;_bottomText;_tooltipG;_mainTooltip;constructor(){super()}tip(e){if(e===null||e.label===``)this._tooltipG.transition().style(`opacity`,0).on(`interrupt end`,()=>{this._tooltipG.selectAll(`g`).remove()});else{this._tooltipG.interrupt().style(`opacity`,1),e.w=this._centerText.datum().w+10;let t=`horizontal`,n=0,r=5,i=5;e.y>=5&&e.y<=25?(n=e.x<0?-e.w/2:e.w/2,r=12.5,i=void 0,t=`vertical`):e.y>25&&(r=25,i=0);let a=annotation().type(vt).annotations([{data:e,dx:-e.x+n,dy:-e.y+r,color:`black`,note:{label:e.label,lineType:t,padding:i,align:`middle`}}]).accessors({x:e=>e.x,y:e=>e.y});this._tooltipG.call(a)}}calcSize(e,t,n){let r=e.node().getBBox(),i=t/r.width,a=n/r.height,o=i<a?i:a;return{width:r.width,height:r.height,scale:o}}updateText(e,t,n,r,i){e.datum({x:t,y:n,w:r,h:i}).attr(`transform`,null);let a=this.calcSize(e,r,i),o=t+r/2-a.width/2*a.scale,s=n+i/2-a.height/2*a.scale;e.attr(`transform`,`translate(${o}, ${s}) scale(${a.scale})`)}calcWidth(){return Math.min(this.width(),this.height(),this.maxDiameter())}enter(e,t){super.enter(e,t),t.on(`click`,e=>{this.click(e)}),this._usageArc=t.append(`path`).datum({startAngle:value2Angle(0),endAngle:value2Angle(0)}).style(`fill`,`green`).on(`mousemove`,e=>{let[t,n]=this._d3Arc.centroid(e);this.tip({x:t,y:n,label:this.valueDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._freeArc=t.append(`path`).datum({startAngle:value2Angle(0),endAngle:value2Angle(1)}).style(`fill`,`lightGrey`),this._meanArc=t.append(`path`).datum({startAngle:value2Angle(0),endAngle:value2Angle(0)}).style(`fill`,`black`).on(`mousemove`,e=>{let[t,n]=this._d3Arc.centroid(e);this.tip({x:t,y:n,label:this.tickValueDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._mainTooltip=t.append(`title`);let n=this;function appendIndicator(){return t.append(`path`).datum({angle:value2Angle(0)}).style(`fill`,`black`).style(`stroke`,`black`).attr(`d`,`M 0 0 l -3 -3 l 6 0 z`).on(`mousemove`,e=>{let[t,r]=n._d3Arc.centroid(n._meanArc.datum());n.tip({x:t,y:r,label:n.tickValueDescription()})}).on(`mouseout`,e=>{n.tip(null)})}this._indInner=appendIndicator(),this._indOuter=appendIndicator(),this._centerText=t.append(`text`).attr(`dy`,`.66em`).style(`fill`,`green`).on(`mousemove`,e=>{this.tip({x:0,y:0,label:this.valueDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._bottomText=t.append(`text`).attr(`dy`,`.66em`).on(`mousemove`,e=>{this.tip({x:0,y:e.y,label:this.titleDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._tooltipG=t.append(`g`).attr(`class`,`annotation-tip`)}update(e,t){super.update(e,t),this._colorScale.domain(this.colorDomain()).range(this.colorRange()),t.attr(`title`,this.tooltip()).style(`cursor`,this.click===Gauge.prototype.click?null:`pointer`);let n=this.calcWidth()/3,r=this.calcWidth()/2-5;this._d3Arc.innerRadius(n).outerRadius(r);let i=this.value(),a=this.tickValue();this._usageArc.style(`fill`,this._colorScale(i)).transition().duration(750).attrTween(`d`,arcTween(value2Angle(0),value2Angle(i),this._d3Arc)),this._freeArc.style(`fill`,this.emptyColor()).transition().duration(750).attrTween(`d`,arcTween(value2Angle(i),value2Angle(1),this._d3Arc)),this._meanArc.style(`fill`,this.tickColor()).style(`visibility`,this.showTick()?`visible`:`hidden`).transition().duration(750).attrTween(`d`,arcTween(value2Angle(a-.001),value2Angle(a+.001),this._d3Arc)),this._indInner.style(`fill`,this.tickColor()).style(`stroke`,this.tickColor()).style(`visibility`,this.showTick()?`visible`:`hidden`).transition().duration(750).attrTween(`transform`,indicatorTween(value2Angle(a),n,!0)),this._indOuter.style(`fill`,this.tickColor()).style(`stroke`,this.tickColor()).style(`visibility`,this.showTick()?`visible`:`hidden`).transition().duration(750).attrTween(`transform`,indicatorTween(value2Angle(a),r)),this._centerText.style(`fill`,this._colorScale(i)).text((0,o.format)(`.0%`)(i)),this._bottomText.style(`fill`,this.click===Gauge.prototype.click?this.titleColor():this.titleClickColor()).style(`text-decoration`,this.click===Gauge.prototype.click?null:`underline`).text(this.title());let s=pointOnArc(value2Angle(1),n-8);this.updateText(this._centerText,-s.x,-s.y,2*s.x,2*s.y);let c=pointOnArc(value2Angle(1),r);c.y+=5;let l=this.calcWidth()-20,u=this.calcWidth()/2-c.y-5;this.updateText(this._bottomText,-l/2,c.y,l,u),this._mainTooltip.text(this.tooltip())}click(e){}};$.prototype._class+=` chart_Gauge`,$.prototype.publish(`title`,``,`string`,`Title`),$.prototype.publish(`titleDescription`,``,`string`,`Title Description`),$.prototype.publish(`titleColor`,`black`,`html-color`,`Color of the title text`),$.prototype.publish(`titleClickColor`,`blue`,`html-color`,`Color of the title text when clickable`),$.prototype.publish(`maxDiameter`,128,`number`,`Max Diameter`),$.prototype.publish(`value`,0,`number`,`Value`),$.prototype.publish(`valueDescription`,``,`string`,`Value Description`),$.prototype.publish(`showTick`,!1,`boolean`,`Show Tick`),$.prototype.publish(`tickValue`,0,`number`,`Tick Value`),$.prototype.publish(`tickValueDescription`,``,`string`,`Tick Value Description`),$.prototype.publish(`tooltip`,``,`string`,`Tooltip`),$.prototype.publish(`colorRange`,[`green`,`green`,`green`,`green`,`green`,`green`,`green`,`green`,`orange`,`red`,`red`],`array`,`Array of colors for the filled gauge portion. The fill color will be relative to the gauge value.`),$.prototype.publish(`colorDomain`,[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],`array`,`This array augments the mapping of the value to the fill colorRange.`),$.prototype.publish(`emptyColor`,`lightgrey`,`html-color`,`Color of the empty portion of the gauge`),$.prototype.publish(`tickColor`,`black`,`html-color`,`Color of the tick`);var sortAscending=(e,t)=>e[1]-t[1]>0?1:-1,sortDescending=(e,t)=>e[1]-t[1]>0?-1:1,Pie=class extends o.SVGWidget{static __inputs=[{id:`label`,type:`string`},{id:`value`,type:`number`}];_totalValue;d3Pie;d3Arc;d3LabelArc;_labelPositions;_smallValueLabelHeight;_labelWidthLimit;_quadIdxArr;_minLabelTop=0;_maxLabelBottom=0;_seriesValueFormatter;_seriesPercentageFormatter;constructor(){super(),I2DChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this),this.d3Pie=pie_default(),this.d3Arc=arc_default$1(),this.d3LabelArc=arc_default$1(),this.tooltipTick_default(!1).tooltipOffset_default(0)}intersection(e,t){return this.intersectCircle(this.calcOuterRadius(),e,t)}calcInnerRadius(){return this.innerRadius_exists()?this.calcOuterRadius()*this.innerRadius()/100:0}calcOuterRadius(){let e=this.textSize(this.data().map(e=>this.getLabelText({data:e},!1)),`Verdana`,12).width,t=this._size.width-(this.showLabels()?e*2:0)-20,n=this._size.height-36-(this.showLabels()?this._smallValueLabelHeight:0),r=Math.min(t,n)/2-2;return t/2-2<this.minOuterRadius()?this._labelWidthLimit=e-(this.minOuterRadius()-(t/2-2)):this._labelWidthLimit=e,r<this.minOuterRadius()?this.minOuterRadius():r}calcSmallValueLabelHeight(){let e=this.data().reduce((e,t)=>e+t[1],0),t=0;return this.data().forEach(n=>{n[1]/e<.1&&t++}),this.labelHeight()*t}calcTotalValue(){return this.data().reduce((e,t)=>e+t[1],0)}calcPadAngleRadians(){let e=this.slicePadding();return e>0?Math.min(e,.05):0}getLabelText(e,t){let n,r=e.data[0];if(this._labelWidthLimit!==void 0&&t){let e=this.textSize(r,`Verdana`,this.labelHeight()).width;this._labelWidthLimit<e&&(n=r.length*(this._labelWidthLimit/e)-3,r=n<r.length?r.slice(0,n)+`...`:r)}if(this.showSeriesValue()&&(r+=` : ${this._seriesValueFormatter(e.data[1])}`),this.showSeriesPercentage()){let t=this._totalValue,n=this.dataMeta();n.sum!==void 0&&(t=n.sum);let i=e.data[1]/t*100;r+=` : ${this._seriesPercentageFormatter(i)}%`}return r}selection(e){if(!arguments.length)try{return this._selection.selection2()[0]?.data}catch{return}let t=JSON.stringify(e);this._selection.selection2(e=>t===JSON.stringify(e.data))}selectByLabel(e){let t=this.data().filter(t=>t[0]===e)[0];t&&this.selection(t)}_slices;_labels;enter(e,t){super.enter(e,t),this._selection.widgetElement(t).skipBringToTop(!0),this._slices=t.append(`g`),this._labels=t.append(`g`);let n=this;this.tooltipHTML(function(e){switch(n.tooltipStyle()){case`series-table`:return n.tooltipFormat({label:e.data[0],arr:n.columns().slice(1).map(function(t,r){return{label:t,color:n._palette(e.data[0]),value:e.data[r+1]}})});default:return n.tooltipFormat({label:e.data[0],value:e.data[1]})}})}update(e,t){this.selectionGlow(!this.tabNavigation()),super.update(e,t);let n=this;this.updateD3Pie(),this._palette=this._palette.switch(this.paletteID()),this._seriesValueFormatter=(0,o.format)(this.seriesValueFormat()),this._seriesPercentageFormatter=(0,o.format)(this.seriesPercentageFormat()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._smallValueLabelHeight=this.calcSmallValueLabelHeight(),this._totalValue=this.calcTotalValue();let r=this.calcOuterRadius(),i=Math.max(this.calcInnerRadius(),Math.min(r/30,6)),a=r+12;this.d3Arc.innerRadius(i).padRadius(r).outerRadius(r).padAngle(this.calcPadAngleRadians()),this._quadIdxArr=[[],[],[],[]];let s=[...this.data()];switch(this.sortDataByValue()){case`ascending`:s.sort(sortAscending);break;case`descending`:s.sort(sortDescending);break}let c=this._slices.selectAll(`.arc`).data(this.d3Pie(s),e=>e.data[0]);this._labelPositions=[],c.enter().append(`g`).attr(`class`,(e,t)=>`arc series series-`+this.cssTag(e.data[0])).attr(`opacity`,0).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n.click(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))}).on(`dblclick`,function(e){n.dblclick(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))}).on(`keydown`,function(e,t){let r=(0,o.d3Event)();n.tabNavigation()&&(r.code===`Space`||r.key===`Enter`)&&(r.preventDefault(),n._selection.click(this))}).each(function(e,t){(0,o.select)(this).append(`path`).on(`mouseout.tooltip`,n.tooltip.hide).on(`mousemove.tooltip`,n.tooltip.show).on(`mouseover`,arcTween(0,0)).on(`mouseout`,arcTween(-5,150))}).merge(c).transition().attr(`opacity`,1).attr(`tabindex`,n.tabNavigation()?`0`:null).attr(`role`,n.tabNavigation()?`button`:null).attr(`aria-label`,n.tabNavigation()?e=>`${e.data[0]}: ${e.data[1]}`:null).each(function(e,t){let i=n.getQuadrant(midAngle(e));n._quadIdxArr[i].push(t),e.outerRadius=r-5,(0,o.select)(this).select(`path`).transition().attr(`d`,n.d3Arc).style(`fill`,n.fillColor(e.data,n.columns()[1],e.data[1]))}),c.exit().transition().style(`opacity`,0).remove(),this.d3LabelArc.innerRadius(a).outerRadius(a);let l=this._labels.selectAll(`text`).data(this.showLabels()?this.d3Pie(s):[],e=>e.data[0]),u=l.enter().append(`text`).on(`mouseout.tooltip`,n.tooltip.hide).on(`mousemove.tooltip`,n.tooltip.show).attr(`dy`,`.5em`).on(`click`,function(e){n._slices.selectAll(`g`).filter(function(t){e.data===t.data&&(n._selection.click(this),n.click(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this)))})}).on(`dblclick`,function(e){n._slices.selectAll(`g`).filter(function(t){e.data===t.data&&n.dblclick(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))})}).merge(l).text(e=>this.getLabelText(e,!0)).each(function(e,t){let r=n.d3LabelArc.centroid(e),i=midAngle(e);r[0]=a*(n.isLeftSide(i)?1:-1),n._labelPositions.push({top:r[1],bottom:r[1]+n.labelHeight()})});this.showLabels()&&(this.adjustForOverlap(),u.transition().style(`font-size`,this.labelHeight()+`px`).attr(`transform`,(e,t)=>{let r=n.d3LabelArc.centroid(e);return r[0]=a*(n.isLeftSide(midAngle(e))?1:-1),r[1]=n._labelPositions[t].top,`translate(`+r+`)`}).style(`text-anchor`,e=>this.isLeftSide(midAngle(e))?`start`:`end`)),l.exit().remove();let d=this._labels.selectAll(`polyline`).data(this.showLabels()?this.d3Pie(s):[],e=>this.getLabelText(e,!0));d.enter().append(`polyline`).merge(d).transition().attr(`points`,function(e,t){let r=n.d3LabelArc.centroid(e),i=n.d3Arc.centroid(e),o=[...r];return r[0]=a*(n.isLeftSide(midAngle(e))?1:-1),r[1]=n._labelPositions[t].top,[i,o,r]}),d.exit().remove(),this.showLabels()&&this.centerOnLabels();function midAngle(e){return e.startAngle+(e.endAngle-e.startAngle)/2}function arcTween(e,t){return function(){(0,o.select)(this).transition().delay(t).attrTween(`d`,function(t){let i=(0,o.interpolate)(t.outerRadius,r+e);return function(e){return t.outerRadius=i(e),n.d3Arc(t)}})}}}isLeftSide(e){return e=(0,a.normalizeRadians)(e),e>Math.PI*2?e:e<Math.PI&&e>0}getQuadrant(e){let t=0,n=(0,a.normalizeRadians)(e);return t=n<=Math.PI*1&&n>=Math.PI*.5?3:t,t=n<=Math.PI*.5&&n>=Math.PI*0?2:t,t=n<=Math.PI*0&&n>=Math.PI*-.5?1:t,t}centerOnLabels(){let e=this.pos().y,t=e*2,n=this.calcOuterRadius(),r=Math.min(this._minLabelTop,-n),i=Math.max(this._maxLabelBottom,n),a=t-(i-r),o=Math.abs(this._minLabelTop),s=0;i>e?(s=e-i+this.labelHeight()/2,s-=a/2):r<0&&o>e&&(s=o-e+this.labelHeight()/2,s+=a/2);let c=this.pos();this.pos({y:c.y+s,x:c.x})}adjustForOverlap(){let e=this.labelHeight();this._quadIdxArr.forEach((t,n)=>{this._quadIdxArr[n].sort((e,t)=>{if(n===1||n===2)return this._labelPositions[e].top>this._labelPositions[t].top?-1:1;if(n===0||n===3)return this._labelPositions[e].top>this._labelPositions[t].top?1:-1});let r;this._quadIdxArr[n].forEach((t,i)=>{if(i>0){if(n===1||n===2){if(r<this._labelPositions[t].bottom){let e=this._labelPositions[t].bottom-r;this._labelPositions[t].top-=e,this._labelPositions[t].bottom-=e}}else if((n===0||n===3)&&r+e>this._labelPositions[t].top){let n=Math.abs(this._labelPositions[t].top)-Math.abs(r+e);this._labelPositions[t].top-=n,this._labelPositions[t].bottom-=n}}r=this._labelPositions[t].top})}),this._minLabelTop=0,this._maxLabelBottom=0,this._quadIdxArr.forEach((e,t)=>{this._quadIdxArr[t].forEach((e,t)=>{this._minLabelTop>this._labelPositions[e].top&&(this._minLabelTop=this._labelPositions[e].top),this._maxLabelBottom<this._labelPositions[e].bottom&&(this._maxLabelBottom=this._labelPositions[e].bottom)})})}exit(e,t){super.exit(e,t)}updateD3Pie(){let e=(0,a.normalizeRadians)((0,a.degreesToRadians)(this.startAngle()));switch(this.sortDataByValue()){case`ascending`:this.d3Pie.sort(sortAscending);break;case`descending`:this.d3Pie.sort(sortDescending);break;default:this.d3Pie.sort(null)}this.d3Pie.padAngle(this.calcPadAngleRadians()).startAngle(e).endAngle(2*Math.PI+e).value(function(e){return e[1]})}};Pie.prototype._class+=` chart_Pie`,Pie.prototype.implements(I2DChart.prototype),Pie.prototype.implements(ITooltip.prototype),Pie.prototype.mixin(o.Utility.SimpleSelectionMixin),Pie.prototype.publish(`showLabels`,!0,`boolean`,`If true, wedge labels will display`),Pie.prototype.publish(`showSeriesValue`,!1,`boolean`,`Append data series value next to label`,null,{disable:e=>!e.showLabels()}),Pie.prototype.publish(`seriesValueFormat`,`,.0f`,`string`,`Number format used for formatting series values`,null,{disable:e=>!e.showSeriesValue()}),Pie.prototype.publish(`showSeriesPercentage`,!1,`boolean`,`Append data series percentage next to label`,null,{disable:e=>!e.showLabels()}),Pie.prototype.publish(`seriesPercentageFormat`,`,.0f`,`string`,`Number format used for formatting series percentages`,null,{disable:e=>!e.showSeriesPercentage()}),Pie.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Pie.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Pie.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Pie.prototype.publish(`innerRadius`,0,`number`,`Sets inner pie hole radius as a percentage of the radius of the pie chart`,null,{tags:[`Basic`],range:{min:0,step:1,max:100}}),Pie.prototype.publish(`minOuterRadius`,20,`number`,`Minimum outer radius (pixels)`),Pie.prototype.publish(`startAngle`,0,`number`,`Starting angle of the first (and largest) wedge (degrees)`),Pie.prototype.publish(`labelHeight`,12,`number`,`Font size of labels (pixels)`,null,{disable:e=>!e.showLabels()}),Pie.prototype.publish(`slicePadding`,.01,`number`,`Padding between pie slices (converted to pixels)`,null,{tags:[`Basic`],range:{min:0,step:.01,max:.2}}),Pie.prototype.publish(`sortDataByValue`,`descending`,`set`,`Sort data by value`,[`none`,`ascending`,`descending`]),Pie.prototype.publish(`tabNavigation`,!1,`boolean`,`Enable or disable tab navigation`);var HalfPie=class extends Pie{constructor(){super()}postUpdate(e,t){super.postUpdate(e,t);let n=this._pos.x,r=this._pos.y;this._drawStartPos===`origin`&&this._target instanceof SVGElement&&(n-=this._size.width/2,r-=this._size.height/2),r+=this._size.height/4,this._element.attr(`transform`,`translate(`+n+`,`+r+`)scale(`+this._widgetScale+`)`)}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(-Math.PI/2).endAngle(Math.PI/2)}};HalfPie.prototype._class+=` chart_HalfPie`;var Heat=class extends XYAxis{_domForeignObject;_domCanvas;_heat;constructor(){super(),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}radius(e){return this.radiusX(e),this.radiusY(e),this}layerEnter(e,t,n=250){super.layerEnter(e,t,n),this._domForeignObject=this.svg.insert(`foreignObject`,`#${this.id()+`_clippath`}`),this._domCanvas=this._domForeignObject.append(`xhtml:body`).style(`margin`,`0px`).style(`padding`,`0px`).style(`background-color`,`transparent`).append(`canvas`),this._heat=simpleheat(this._domCanvas.node())}layerUpdate(e,t,n=250){super.layerUpdate(e,t),this._palette=this._palette.switch(this.paletteID());let r=this.width()-this.margin.left-this.margin.right;r<0&&(r=0);let i=this.height()-this.margin.top-this.margin.bottom;i<0&&(i=0),this._domForeignObject.attr(`x`,this.margin.left).attr(`y`,this.margin.top).attr(`width`,r).attr(`height`,i),this._domCanvas.attr(`width`,r).attr(`height`,i);let a=e.orientation()===`horizontal`?this.data().map(t=>[e.dataPos(t[0]),e.valuePos(t[1]),t[2]]):this.data().map(t=>[e.valuePos(t[1]),e.dataPos(t[0]),t[2]]),s=this.maxWeight_exists()?this.maxWeight():(0,o.max)(a,e=>e[2]);if(this.paletteID()!=="default"){let e={},t=this.reversePalette();for(let n=0;n<8;++n)e[n/8]=this._palette((t?8-n:n)/8,0,1);this._heat.gradient(e)}else this._heat.gradient(this._heat.defaultGradient);this._heat.resize();let c=this.radiusAsPercent()?this.radiusX()*r/100:this.radiusX(),l=this.radiusAsPercent()?this.radiusY()*i/100:this.radiusY();this._heat.clear().radius(c,l,this.blur()).max(s).data(a).draw(this.minOpacity())}};Heat.prototype._class+=` chart_Heat`,Heat.prototype._palette=o.Palette.rainbow(`default`),Heat.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Heat.prototype._palette.switch(),{tags:[`Basic`]}),Heat.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Heat.prototype.publish(`reversePalette`,!1,`boolean`,`Reverse Palette Colors`,null,{disable:e=>e.paletteID()==="default"}),Heat.prototype.publish(`radiusX`,25,`number`,`Point X radius (25 by default)`),Heat.prototype.publish(`radiusY`,25,`number`,`Point Y radius (25 by default)`),Heat.prototype.publish(`radiusAsPercent`,!1,`boolean`,`Calculate RadiusX + RadiusY as % of size`),Heat.prototype.publish(`blur`,15,`number`,`Point blur radius (15 by default)`),Heat.prototype.publish(`maxWeight`,void 0,`number`,`Clamp max weight to value (optional), omitting uses max data point`,void 0,{optional:!0}),Heat.prototype.publish(`minOpacity`,.05,`number`,`Minimum point opacity (0.05 by default)`);function simpleheat(e){if(!(this instanceof simpleheat))return new simpleheat(e);this._canvas=e=typeof e==`string`?document.getElementById(e):e,this._ctx=e.getContext(`2d`),this._width=e.width,this._height=e.height,this._max=1,this._data=[]}simpleheat.prototype={defaultRadius:25,defaultGradient:{.4:`blue`,.6:`cyan`,.7:`lime`,.8:`yellow`,1:`red`},data:function(e){return this._data=e,this},max:function(e){return this._max=e,this},add:function(e){return this._data.push(e),this},clear:function(){return this._data=[],this},radius:function(e,t,n){n=n===void 0?15:n;let r=this._ellipse=this._createCanvas(),i=r.getContext(`2d`),a=this._r=e+n,o=this._r=t+n;return r.width=a*2,r.height=o*2,i.shadowOffsetX=i.shadowOffsetY=a*2,i.shadowOffsetY=i.shadowOffsetY=o*2,i.shadowBlur=n,i.shadowColor=`black`,i.beginPath(),i.ellipse(-a,-o,e,t,0,0,Math.PI*2,!0),i.closePath(),i.fill(),this},resize:function(){this._width=this._canvas.width,this._height=this._canvas.height},gradient:function(e){let t=this._createCanvas(),n=t.getContext(`2d`),r=n.createLinearGradient(0,0,0,256);t.width=1,t.height=256;for(let t in e)r.addColorStop(+t,e[t]);return n.fillStyle=r,n.fillRect(0,0,1,256),this._grad=n.getImageData(0,0,1,256).data,this},draw:function(e){this._ellipse||this.radius(this.defaultRadius,this.defaultRadius),this._grad||this.gradient(this.defaultGradient);let t=this._ctx;t.clearRect(0,0,this._width,this._height);for(let n=0,r=this._data.length,i;n<r;n++)i=this._data[n],i[2]<0?i[2]=0:i[2]>this._max&&(i[2]=this._max),t.globalAlpha=Math.max(i[2]/this._max,e===void 0?.05:e),t.drawImage(this._ellipse,i[0]-this._r,i[1]-this._r);let n=t.getImageData(0,0,this._width,this._height);return this._colorize(n.data,this._grad),t.putImageData(n,0,0),this},_colorize:function(e,t){for(let n=0,r=e.length,i;n<r;n+=4)i=e[n+3]*4,i&&(e[n]=t[i],e[n+1]=t[i+1],e[n+2]=t[i+2])},_createCanvas:function(){return typeof document<`u`?document.createElement(`canvas`):new this._canvas.constructor}};var St=Math.PI/3,Ct=[0,St,2*St,3*St,4*St,5*St];function pointX(e){return e[0]}function pointY(e){return e[1]}function hexbin_default(){var e=0,t=0,n=1,r=1,i=pointX,a=pointY,o,s,c;function hexbin(e){var t={},n=[],r,o=e.length;for(r=0;r<o;++r)if(!(isNaN(u=+i.call(null,l=e[r],r,e))||isNaN(d=+a.call(null,l,r,e)))){var l,u,d,f=Math.round(d/=c),p=Math.round(u=u/s-(f&1)/2),m=d-f;if(Math.abs(m)*3>1){var h=u-p,g=p+(u<p?-1:1)/2,_=f+(d<f?-1:1),v=u-g,b=d-_;h*h+m*m>v*v+b*b&&(p=g+(f&1?1:-1)/2,f=_)}var S=p+`-`+f,C=t[S];C?C.push(l):(n.push(C=t[S]=[l]),C.x=(p+(f&1)/2)*s,C.y=f*c)}return n}function hexagon(e){var t=0,n=0;return Ct.map(function(r){var i=Math.sin(r)*e,a=-Math.cos(r)*e,o=i-t,s=a-n;return t=i,n=a,[o,s]})}return hexbin.hexagon=function(e){return`m`+hexagon(e==null?o:+e).join(`l`)+`z`},hexbin.centers=function(){for(var i=[],a=Math.round(t/c),l=Math.round(e/s),u=a*c;u<r+o;u+=c,++a)for(var d=l*s+(a&1)*s/2;d<n+s/2;d+=s)i.push([d,u]);return i},hexbin.mesh=function(){var e=hexagon(o).slice(0,4).join(`l`);return hexbin.centers().map(function(t){return`M`+t+`m`+e}).join(``)},hexbin.x=function(e){return arguments.length?(i=e,hexbin):i},hexbin.y=function(e){return arguments.length?(a=e,hexbin):a},hexbin.radius=function(e){return arguments.length?(o=+e,s=o*2*Math.sin(St),c=o*1.5,hexbin):o},hexbin.size=function(i){return arguments.length?(e=t=0,n=+i[0],r=+i[1],hexbin):[n-e,r-t]},hexbin.extent=function(i){return arguments.length?(e=+i[0][0],t=+i[0][1],n=+i[1][0],r=+i[1][1],hexbin):[[e,t],[n,r]]},hexbin.radius(1)}__name(hexbin_default,`default`);var HexBin=class extends XYAxis{static __inputs=[{id:`x`,type:`any`},{id:`y`,type:`number`}];_hexbin;_dataMinWeight;_dataMaxWeight;constructor(){super(),I2DAggrChart.call(this),this.tooltipValueFormat_default(`,.0f`),ITooltip.call(this),this.tooltipHTML(e=>{let t=(0,o.extent)(e,e=>e.label),n=(0,o.extent)(e,e=>e.value);return this.tooltipFormat({series:t[0]===t[1]?t[0]:`${t[0]} -> ${t[1]}`,label:n[0]===n[1]?n[0]:`${n[0]} -> ${n[1]}`,value:e.length})}),this._hexbin=hexbin_default().x(e=>e.x).y(e=>e.y),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default(`linear`)}xPos(e,t){return e.orientation()===`horizontal`?e.dataPos(t.label):e.valuePos(t.value)}yPos(e,t){return e.orientation()===`horizontal`?e.valuePos(t.value):e.dataPos(t.label)}layerUpdate(e,t,n=250){super.layerUpdate(e,t,n);let r=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._hexbin.extent([0,0],[this.width(),this.height()]).radius(this.binSize());let i=this.flattenData().map(t=>({x:r.xPos(e,t),y:r.yPos(e,t),label:e.parseData(t.label),value:e.parseValue(t.value),origRow:t})),a=this._hexbin(i),s=(0,o.min)(a,function(e){return e.length}),c=(0,o.max)(a,function(e){return e.length});this._dataMinWeight=s,this._dataMaxWeight=c;let l=t.selectAll(`.hexagon`).data(a,function(e){return e.i+`_`+e.j});l.enter().append(`path`).attr(`class`,`hexagon`).call(e._selection.enter.bind(e._selection)).on(`click`,function(t){let n=r.data();r.click(t.map(t=>e.rowToObj(n[t.origRow.rowIdx])),r.columns()[1],e._selection.selected(this))}).on(`dblclick`,function(t){let n=r.data();r.dblclick(t.map(t=>e.rowToObj(n[t.origRow.rowIdx])),r.columns()[1],e._selection.selected(this))}).on(`mouseout.tooltip`,r.tooltip.hide).on(`mousemove.tooltip`,r.tooltip.show).attr(`transform`,function(e){return`translate(`+e.x+`,`+e.y+`)scale(0)`}).merge(l).transition().duration(n).attr(`d`,this._hexbin.hexagon()).attr(`transform`,function(e){return`translate(`+e.x+`,`+e.y+`)scale(1)`}).style(`fill`,function(e){return r._palette(e.length,s,c)}),l.exit().transition().duration(n).attr(`transform`,function(e){return`translate(`+e.x+`,`+e.y+`)scale(0)`}).remove()}exit(e,t){super.exit(e,t)}click(e,t,n){}dblclick(e,t,n){}};HexBin.prototype._class+=` chart_HexBin`,HexBin.prototype.implements(I2DAggrChart.prototype),HexBin.prototype.implements(ITooltip.prototype),HexBin.prototype.publish(`paletteID`,`Blues`,`set`,`Color palette for this widget`,HexBin.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),HexBin.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),HexBin.prototype.publish(`binSize`,20,`number`,`Bin radius`,null,{range:{min:1,max:300,step:1}});var Line=class extends Scatter{constructor(){super(),this.interpolate_default(`linear`)}};Line.prototype._class+=` chart_Line`;var QuarterPie=class extends Pie{constructor(){super()}postUpdate(e,t){super.postUpdate(e,t);let n=this.orientation()===`left`?0:this._size.width,r=this._size.height;this._drawStartPos===`origin`&&this._target instanceof SVGElement&&(n-=this._size.width/2,r-=this._size.height/2),this._element.attr(`transform`,`translate(`+n+`,`+r+`)scale(`+this._widgetScale+`)`)}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(this.orientation()===`left`?0:-Math.PI/2).endAngle(this.orientation()===`left`?Math.PI/2:0)}calcOuterRadius(){let e=this.textSize(this.data().map(e=>this.getLabelText({data:e})),`Verdana`,12).width;return Math.min(this._size.width-e-10,this._size.height-36)-2}};QuarterPie.prototype._class+=` chart_QuarterPie`,QuarterPie.prototype.publish(`orientation`,`left`,`set`,`Determines the placement and start/end angle.`,[`left`,`right`]);var QuartileCandlestick=class extends o.SVGWidget{_g;_leftLine;_rightLine;_midLine;_midOuterRect;_midInnerRect1;_midInnerRect2;_q0text;_q1text;_q2text;_q3text;_q4text;_q0val;_q1val;_q2val;_q3val;_q4val;constructor(){super()}enter(e,t){super.enter(e,t),this._g=t.append(`g`),this._leftLine=this._g.append(`rect`),this._rightLine=this._g.append(`rect`),this._midLine=this._g.append(`rect`),this._midOuterRect=this._g.append(`rect`),this._midInnerRect1=this._g.append(`rect`),this._midInnerRect2=this._g.append(`rect`),this._q0text=this._g.append(`text`),this._q1text=this._g.append(`text`),this._q2text=this._g.append(`text`),this._q3text=this._g.append(`text`),this._q4text=this._g.append(`text`),this._q0val=this._g.append(`text`),this._q1val=this._g.append(`text`),this._q2val=this._g.append(`text`),this._q3val=this._g.append(`text`),this._q4val=this._g.append(`text`)}update(e,t){super.update(e,t);let n=(this.orientation()===`horizontal`?this.width():this.height())-this.lineWidth(),r=this.orientation()===`horizontal`?this.height():this.width(),i=(0,o.scaleLinear)().domain([this.data()[0],this.data()[4]]).range([this.edgePadding(),n-this.edgePadding()]),a=this.candleWidth_exists()?this.candleWidth():r,s=this.lineWidth(),c=this.lineColor(),l=this.roundedCorners(),u=this.edgePadding(),d=i(this.data()[1]),f=i(this.data()[2]),p=i(this.data()[3]),m=-a/2,h=a/2,g=this.upperTextRotation(),_=this.lowerTextRotation(),v=this.textPadding(),b=this.labelFontSize(),S=this.valueFontSize(),C=Math.max(b,S),w=n-u;if(C>0){for(;d-u<C;)d+=C;for(;f-d<C;)f+=C;for(;p-f<C;)p+=C;for(;w-p<C;)p-=C;for(;p-f<C;)f-=C;for(;f-d<C;)d-=C}let T=-n/2-this.lineWidth()/2,E=0,D=0,O=1,k=`start`,A=`end`;this.orientation()===`vertical`&&(T=0,E=n/2+this.lineWidth()/2,D=-90,k=`end`,A=`start`,O=-1),this._g.style(`shape-rendering`,`crispEdges`).attr(`transform`,`translate(${T},${E})rotate(${D})scale(1)`),this._leftLine.attr(`fill`,c).attr(`height`,a).attr(`width`,s).attr(`x`,u).attr(`y`,m).attr(`rx`,l).attr(`ry`,l),this._rightLine.attr(`class`,`right-line`).attr(`fill`,c).attr(`height`,a).attr(`width`,s).attr(`x`,w).attr(`y`,m).attr(`rx`,l).attr(`ry`,l),this._midLine.attr(`fill`,c).attr(`height`,s).attr(`width`,w-u).attr(`x`,u).attr(`y`,-s/2),this._midOuterRect.attr(`fill`,c).attr(`height`,a).attr(`width`,p-d).attr(`x`,d).attr(`y`,m).attr(`rx`,l).attr(`ry`,l),this._midInnerRect1.attr(`fill`,this.innerRectColor()).attr(`height`,a-s*2).attr(`width`,f-(d+s*2)).attr(`x`,d+s).attr(`y`,s-a/2).attr(`rx`,l*.618).attr(`ry`,l*.618),this._midInnerRect2.attr(`fill`,this.innerRectColor()).attr(`height`,a-s*2).attr(`width`,p-f-s).attr(`x`,f).attr(`y`,s-a/2).attr(`rx`,l*.618).attr(`ry`,l*.618),this._q0text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${u}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`hanging`).text(this.columns()[0]),this._q1text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${d}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`middle`).text(this.columns()[1]),this._q2text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${f}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`middle`).text(this.columns()[2]),this._q3text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${p}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`middle`).text(this.columns()[3]),this._q4text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${w+s}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`baseline`).text(this.columns()[4]),this._q0val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${u}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`hanging`).text(this.data()[0]),this._q1val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${d}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`middle`).text(this.data()[1]),this._q2val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${f}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`middle`).text(this.data()[2]),this._q3val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${p}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`middle`).text(this.data()[3]),this._q4val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${w+s}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`baseline`).text(this.data()[4])}};QuartileCandlestick.prototype._class+=` chart_QuartileCandlestick`,QuartileCandlestick.prototype.publish(`textColor`,`black`,`html-color`,`Color of label and value text`),QuartileCandlestick.prototype.publish(`showLabels`,!0,`boolean`,`If true, labels will be shown`),QuartileCandlestick.prototype.publish(`showValues`,!0,`boolean`,`If true, values will be shown`),QuartileCandlestick.prototype.publish(`orientation`,`horizontal`,`set`,`Determines layout`,[`horizontal`,`vertical`]),QuartileCandlestick.prototype.publish(`valueFontSize`,12,`number`,`Font size of value text (pixels)`),QuartileCandlestick.prototype.publish(`labelFontSize`,12,`number`,`Font size of label text (pixels)`),QuartileCandlestick.prototype.publish(`roundedCorners`,8,`number`,`Radius of rounded rect corners (pixels)`),QuartileCandlestick.prototype.publish(`lineWidth`,4,`number`,`Width of lines (pixels)`),QuartileCandlestick.prototype.publish(`candleWidth`,null,`number`,`Height of outer rect (pixels)`,null,{optional:!0}),QuartileCandlestick.prototype.publish(`textPadding`,8,`number`,`Padding between outer rect and text (pixels)`),QuartileCandlestick.prototype.publish(`edgePadding`,30,`number`,`Padding between outer rect and left/right sides (pixels)`),QuartileCandlestick.prototype.publish(`lineColor`,`#333`,`html-color`,`Color of outer rect and lines`),QuartileCandlestick.prototype.publish(`innerRectColor`,`white`,`html-color`,`Color of the inner rects`),QuartileCandlestick.prototype.publish(`upperTextRotation`,-60,`number`,`Rotation of label text (degrees)`),QuartileCandlestick.prototype.publish(`lowerTextRotation`,-60,`number`,`Rotation of value text (degrees)`);var Radar=class extends o.SVGWidget{constructor(){super(),INDChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this)}mapShape(e){switch(e){case`rectangle`:return`rect`;case`circle`:return`circle`;case`cross`:return`path`;default:}}setPointAttributes(e,t,n){let r=this.mapShape(this.pointShape()),i=this;switch(r){case`rect`:e.attr(`width`,i.pointSize()).attr(`height`,i.pointSize()).style(`fill`,e=>this.strokeColor(e.data,e.column,e.value));break;case`circle`:e.attr(`r`,i.pointSize()/2).attr(`cx`,t).attr(`cy`,n).style(`fill`,e=>this.strokeColor(e.data,e.column,e.value));break;case`path`:let r=i.pointSize()/2;e.attr(`d`,function(e){return`M`+(t-r)+` `+(n-r)+` L`+(t+r)+` `+(n+r)+` M`+(t-r)+` `+(n+r)+` L`+(t+r)+` `+(n-r)}).style(`stroke`,e=>this.strokeColor(e.data,e.column,e.value));break;default:}}enter(e,t){super.enter(e,t),this._selection.widgetElement(t),this.tooltipHTML(e=>this.tooltipFormat({label:e.label,series:e.column,value:e.value}))}update(e,t){super.update(e,t),this._palette=this._palette.switch(this.paletteID());let n=this,r=this.height(),i=this.width(),a=r/2,s=i/2,c=this.columns(),l=this.data(),u=this.flattenData(c,l).map((e,t)=>(e.shape=this.mapShape(this.pointShape()),e.column=c[e.colIdx],e.row=l[t],e)),d=[],f=this.degrees2radians(360/this.data().length),p=this.fontSize(),m=0;u.filter(e=>e.colIdx===1).forEach(e=>{let t=super.textSize(e.label,`${this.fontFamily()}`,this.fontSize());m<t.width&&(m=t.width)});let h=Math.min(a-p,s-m),g=t.selectAll(`.label`).data(u.filter(e=>e.colIdx===1)),_=Math.max.apply(n,u.map(e=>e.value));g.enter().append(`text`).attr(`class`,`label`).attr(`text-anchor`,`middle`).merge(g).attr(`font-size`,this.fontSize()).attr(`font-family`,this.fontFamily()).each(function(e,t){let r=n.polar2cartesian(h,t*f-Math.PI/2);d.push(r.map(e=>e*n.labelPaddingRatio()));let i=`middle`,a=Math.round(r[0]);i=a>0?`start`:i,i=a<0?`end`:i,(0,o.select)(this).attr(`text-anchor`,i).attr(`x`,r[0]).attr(`y`,r[1])}).text(e=>e.label),g.exit().remove();let v=t.selectAll(`.domain`).data(u.filter(e=>e.colIdx===1));v.enter().append(`line`).classed(`domain`,!0).style(`stroke`,`#000`).style(`stroke-opacity`,`0.75`).style(`stroke-width`,`1px`).merge(v).attr(`x1`,0).attr(`y1`,0).attr(`x2`,(e,t)=>d[t][0]).attr(`y2`,(e,t)=>d[t][1]),v.exit().remove();let b=t.selectAll(`.value_guide`).data(this.valueGuideRatios());b.enter().append(`polygon`).classed(`value_guide`,!0).style(`stroke`,`grey`).style(`stroke-opacity`,`0.75`).style(`stroke-width`,`0.3px`).merge(b).each(function(e,t){let n=[];d.forEach((t,r)=>{n.push([t[0]*e,t[1]*e])}),(0,o.select)(this).attr(`points`,n.join(` `)).attr(`stroke`,`rgb(0, 0, 0)`).attr(`stroke-opacity`,.75).attr(`stroke-width`,.3).attr(`fill-opacity`,0)}),b.exit().remove();let S=t.selectAll(`.value_guide_text`).data(this.valueGuideRatios());S.enter().append(`text`).attr(`class`,`value_guide_text`).attr(`text-anchor`,`start`).attr(`font-size`,this.fontSize()).attr(`font-family`,this.fontFamily()).merge(S).attr(`x`,2).attr(`y`,e=>d[0][1]*e).text((e,t)=>Math.round(e*_)),b.exit().remove();let C=t.selectAll(`.area`).data(c.filter((e,t)=>t>0));C.enter().append(`polygon`).attr(`class`,`area`).style(`stroke-opacity`,`0.75`).style(`stroke-width`,`0.3px`).merge(C).style(`stroke`,e=>this.strokeColor([],e,0)).style(`fill`,e=>this.fillColor([],e,0)).style(`fill-opacity`,this.fillOpacity()).attr(`points`,(e,t)=>d.map((e,n)=>{let r=l[n][t+1],i=r===0?0:r/_;return e[0]*i+`,`+e[1]*i}).join(` `)),C.exit().remove();let w=t.selectAll(`.point`).data(u);w.enter().append(`g`).attr(`class`,`point`).on(`mouseout.tooltip`,n.tooltip.hide).on(`mousemove.tooltip`,n.tooltip.show).on(`click`,function(e,t){let r=n.data()[e.rowIdx],i=n.rowToObj(r),a=n._selection.selected(this);n.click(i,n.columns()[e.colIdx],a)}).on(`dblclick`,function(e,t){n.dblclick(n.rowToObj(n.data()[e.rowIdx]),e.column,n._selection.selected(this))}).each(function(e){let t=(0,o.select)(this);t.append(`circle`).attr(`class`,`pointSelection`).attr(`r`,n.pointSize()).call(n._selection.enter.bind(n._selection)),t.append(n.mapShape(n.pointShape())).attr(`class`,`pointShape`)}).merge(w).each(function(e){let t=(0,o.select)(this),r=e.value===0?0:e.value/_,i=d[e.rowIdx][0]*r,a=d[e.rowIdx][1]*r;t.select(`.pointSelection`).attr(`cx`,i).attr(`cy`,a);let s=t.select(`.pointShape`).style(`stroke`,n.strokeColor(e.row,e.column,e.value)).style(`fill`,n.fillColor(e.row,e.column,e.value));n.setPointAttributes(s,i,a)}),w.exit().remove()}polar2cartesian(e,t){return[e*Math.cos(t),e*Math.sin(t)]}cartesian2polar(e,t){return[Math.atan2(t,e),Math.sqrt(e*e+t*t)]}degrees2radians(e){return e/57.295779513}radians2degrees(e){return e*57.295779513}point_in_polygon(e,t){let n=e[0],r=e[1],i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e][0],s=t[e][1],c=t[a][0],l=t[a][1];s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}};Radar.prototype._class+=` chart_Radar`,Radar.prototype.implements(INDChart.prototype),Radar.prototype.implements(ITooltip.prototype),Radar.prototype.mixin(o.Utility.SimpleSelectionMixin),Radar.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Radar.prototype._palette.switch()),Radar.prototype.publish(`pointShape`,`cross`,`set`,`pointShape`,[`circle`,`rectangle`,`cross`]),Radar.prototype.publish(`pointSize`,6,`number`,`Point Size`,null,{range:{min:1,step:1,max:200}}),Radar.prototype.publish(`valueGuideRatios`,[.2,.4,.6,.8,1],`array`,`Array of values between 0 and 1 that are multiplied by the widget radius to produce guide lines`),Radar.prototype.publish(`fillOpacity`,.66,`number`,`Opacity of the data polygon(s)`),Radar.prototype.publish(`fontFamily`,``,`string`,`fontFamily`),Radar.prototype.publish(`fontSize`,16,`number`,`fontSize`),Radar.prototype.publish(`labelPaddingRatio`,.9,`number`,`labelPaddingRatio`);var RadialBar=class extends o.SVGWidget{static __inputs=[{id:`label`,type:`any`},{id:`values`,type:`number`}];_domainScale=(0,o.scaleBand)();_valueScale=(0,o.scaleLinear)();_d3Arc=arc_default$1().startAngle(0).endAngle(e=>this._valueScale(e[1]));_arcs;_axialAxis;_radialAxis;constructor(){super(),INDChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this)}enter(e,t){super.enter(e,t),this._selection.widgetElement(t),this.tooltipHTML(e=>this.tooltipFormat({label:e[0],value:e[1]})),this._radialAxis=t.append(`g`).attr(`class`,`r axis`),this._axialAxis=t.append(`g`).attr(`class`,`a axis`),this._arcs=t.append(`g`).attr(`class`,`data`)}update(e,t){super.update(e,t);let n=this,r=Math.max(this.valueDomainHigh_exists()?this.valueDomainHigh():0,...this.data().map(e=>e[1]));this._valueScale.domain([0,r]).range([0,this.radians(this.valueMaxAngle())]);let i=this._valueScale.ticks(this.tickCount()),a=this.textSize(i.map(e=>``+e),`Verdana`,12).width,s=Math.min(this.width()-(10+a)*2,this.height()-44)/2,c=this.data().map(e=>e[0]);this._domainScale.domain(c).range([0,s]).padding(this.domainPadding());let l=this._domainScale.step()*this._domainScale.padding(),u=this._radialAxis.selectAll(`circle`).data(c);u.enter().append(`circle`).attr(`fill`,`transparent`).merge(u).attr(`r`,e=>this._domainScale(e)+this._domainScale.step()-l/2),u.exit().remove();let d=this._radialAxis.selectAll(`.arc-text`).data(c);d.enter().append(`text`).attr(`class`,`arc-text`).attr(`x`,-4).attr(`alignment-baseline`,`middle`).attr(`text-anchor`,`end`).merge(d).attr(`y`,e=>-this._domainScale(e)-this._domainScale.bandwidth()/2).text(e=>e),d.exit().remove();let f=this._axialAxis.selectAll(`line`).data(i);f.enter().append(`line`).merge(f).attr(`x2`,e=>s*Math.cos(this._valueScale(e)-this.radians(90))).attr(`y2`,e=>s*Math.sin(this._valueScale(e)-this.radians(90))),f.exit().remove();let p=this._axialAxis.selectAll(`text`).data(i);p.enter().append(`text`).style(`dominant-baseline`,`central`).merge(p).attr(`x`,e=>(s+10)*Math.cos(this._valueScale(e)-this.radians(90))).attr(`y`,e=>(s+10)*Math.sin(this._valueScale(e)-this.radians(90))).style(`text-anchor`,e=>{let t=this.degrees(this._valueScale(e));return t>=0&&t<=20||t>=160&&t<=200||t>=340&&t<=360?`middle`:t>=180&&t<=360?`end`:null}).text(e=>e),p.exit().remove();let m=this.columns().length>1?this.columns()[1]:``;this._d3Arc.innerRadius(e=>this._domainScale(e[0])).outerRadius(e=>this._domainScale(e[0])+this._domainScale.bandwidth());let h=this._arcs.selectAll(`path`).data(this.data(),e=>e[0]);h.enter().append(`path`).attr(`class`,`arc`).call(this._selection.enter.bind(this._selection)).on(`mouseout.tooltip`,this.tooltip.hide).on(`mousemove.tooltip`,this.tooltip.show).on(`click`,function(e,t){n.click(n.rowToObj(e),m,n._selection.selected(this))}).on(`dblclick`,function(e,t){n.dblclick(n.rowToObj(e),m,n._selection.selected(this))}).merge(h).style(`fill`,(e,t)=>this.fillColor(e,e[0],e[1])).transition().delay((e,t)=>t*this.transitionDelay()).duration(this.transitionDuration()).attrTween(`d`,(e,t)=>{let n=(0,o.interpolate)(e._current||0,e[1]);return e._current=e[1],r=>this._d3Arc([e[0],n(r)],t)}),h.exit().remove()}degrees(e){return e*180/Math.PI}radians(e){return e*Math.PI/180}};RadialBar.prototype._class+=` chart_RadialBar`,RadialBar.prototype.implements(INDChart.prototype),RadialBar.prototype.implements(ITooltip.prototype),RadialBar.prototype.mixin(o.Utility.SimpleSelectionMixin),RadialBar.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,RadialBar.prototype._palette.switch()),RadialBar.prototype.publish(`tickCount`,10,`number`,`Number of ticks to display`),RadialBar.prototype.publish(`domainPadding`,.25,`number`,`Padding between chart edge and container edge (0..1)`),RadialBar.prototype.publish(`valueMaxAngle`,270,`number`,`Maximum angular length of a bar (degrees)`),RadialBar.prototype.publish(`valueDomainHigh`,null,`number`,`Value domain high`,void 0,{optional:!0}),RadialBar.prototype.publish(`transitionDelay`,100,`number`,`Delay between the start of each row animation (ms)`),RadialBar.prototype.publish(`transitionDuration`,750,`number`,`Duration of a row's animation (ms)`);var wt=o.Palette.rainbow(`Blues`),Tt=o.Palette.ordinal(`Quartile`,[wt(100,0,100),wt(50,0,100),wt(50,0,100),wt(75,0,100)]);Tt(`Std. Dev.`),Tt(`MinMax`),Tt(`25%`),Tt(`50%`);function myFormatter(e){let t=(0,o.format)(e);return function(e){let n=(Math.round(e*100)/100).toString();return n.length<=4?n:t(e)}}var StatChart=class extends o.HTMLWidget{_selectElement;_tickFormatter;_bellCurve=new Scatter().columns([``,`Std. Dev.`]).paletteID(`Quartile`).interpolate_default(`basis`).pointSize(0).xAxisType(`linear`).xAxisOverlapMode(`none`).xAxisTickFormat(`,`).yAxisHidden(!0).yAxisDomainLow(0).yAxisDomainHigh(110).yAxisGuideLines(!1);_candle=new QuartileCandlestick().columns([`Min`,`25%`,`50%`,`75%`,`Max`]).edgePadding(0).roundedCorners(1).lineWidth(1).upperTextRotation(-90).lowerTextRotation(-90).labelFontSize(0).valueFontSize(0).lineColor(wt(90,0,100)).innerRectColor(wt(10,0,100));constructor(){super(),this.columns([`Min`,`25%`,`50%`,`75%`,`Max`,`Mean`,`Std. Dev.`])}stdDev(e){return this.mean()+e*this.standardDeviation()}formatStdDev(e){return this._tickFormatter(this.stdDev(e))}quartile(e){return this.quartiles()[e]}formatQ(e){return this._tickFormatter(this.quartile(e))}domain(e){switch(e){case`25_75`:return[this.quartile(1),this.quartile(3)];case`normal`:return[this.stdDev(-4),this.stdDev(4)];default:return[this.quartile(0),this.quartile(4)]}}min(){return this.quartile(0)}max(){return this.quartile(4)}data(e){if(!arguments.length)return[[...this.quartiles(),this.mean(),this.standardDeviation()]];let t=e[0];return this.quartiles([t[0],t[1],t[2],t[3],t[4]]),this.mean(t[5]),this.standardDeviation(t[6]),this}enter(e,t){super.enter(e,t),this._bellCurve.target(t.append(`div`).node()),this._candle.target(t.append(`div`).node()),this._selectElement=t.append(`div`).style(`position`,`absolute`).style(`top`,`0px`).style(`right`,`0px`).append(`select`).on(`change`,()=>{this.view(this._selectElement.node().value),this.lazyRender()}),this._selectElement.append(`option`).attr(`value`,`min_max`).text(`Min / Max`),this._selectElement.append(`option`).attr(`value`,`25_75`).text(`25% / 75%`),this._selectElement.append(`option`).attr(`value`,`normal`).text(`Normal`)}bellTicks(e){let t;switch(e){case`25_75`:t=[{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)}];break;case`normal`:t=[{label:this.formatStdDev(-4),value:this.stdDev(-4)},{label:`-3σ`,value:this.stdDev(-3)},{label:`-2σ`,value:this.stdDev(-2)},{label:`-1σ`,value:this.stdDev(-1)},{label:this.formatStdDev(0),value:this.stdDev(0)},{label:`+1σ`,value:this.stdDev(1)},{label:`+2σ`,value:this.stdDev(2)},{label:`+3σ`,value:this.stdDev(3)},{label:this.formatStdDev(4),value:this.stdDev(4)}];break;default:t=[{label:this.formatQ(0),value:this.quartile(0)},{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)},{label:this.formatQ(4),value:this.quartile(4)}]}let[n,r]=this.domain(this._selectElement.node().value);return t.filter(e=>e.value>=n&&e.value<=r).map(e=>({label:e.label,value:e.value.toString()}))}updateScatter(){let e=this._selectElement.node().value,[t,n]=this.domain(e),r=(n-t)*(this.domainPadding()/100);this._bellCurve.xAxisDomainLow(t-r).xAxisDomainHigh(n+r).xAxisTicks(this.bellTicks(e)).data([[this.stdDev(-4),0],[this.stdDev(-3),.3],[this.stdDev(-2),5],[this.stdDev(-1),68],[this.stdDev(0),100],[this.stdDev(1),68],[this.stdDev(2),5],[this.stdDev(3),.3],[this.stdDev(4),0]]).resize({width:this.width(),height:this.height()-this.candleHeight()}).render()}updateCandle(){let e=this._bellCurve.dataPos(this.quartile(0)),t=this._bellCurve.dataPos(this.quartile(4))-e;this._candle.resize({width:this.width(),height:this.candleHeight()}).pos({x:e+t/2+2,y:this.candleHeight()/2}).width(t).candleWidth(this.candleHeight()).data(this.quartiles()).render()}update(e,t){super.update(e,t),this._tickFormatter=myFormatter(this.tickFormat()),this._selectElement.node().value=this.view(),this.updateScatter(),this.updateCandle()}exit(e,t){this._bellCurve.target(null),this._candle.target(null),this._selectElement.remove(),super.exit(e,t)}};StatChart.prototype._class+=` chart_StatChart`,StatChart.prototype.publish(`view`,`min_max`,`set`,`View`,[`min_max`,`25_75`,`normal`]),StatChart.prototype.publish(`tickFormat`,`.2e`,`string`,`X-Axis Tick Format`),StatChart.prototype.publish(`candleHeight`,20,`number`,`Height of candle widget (pixels)`),StatChart.prototype.publish(`domainPadding`,10,`number`,`Domain value padding`),StatChart.prototype.publish(`mean`,.5,`number`,`Mean`),StatChart.prototype.publish(`standardDeviation`,.125,`number`,`Standard Deviation (σ)`),StatChart.prototype.publish(`quartiles`,[0,.25,.5,.75,1],`object`,`Quartiles (Min, 25%, 50%, 75%, Max)`);var Step=class extends Scatter{constructor(){super(),this.interpolate_default(`step`)}};Step.prototype._class+=` chart_Step`;var Et=`text`,Dt=`html`,Summary=class extends o.HTMLWidget{_playIntervalIdx=0;_mainDiv;_headerDiv;_textDiv;constructor(){super(),this._tag=`div`,this._drawStartPos=`center`,this.playInterval(this.playInterval())}lookupFieldIdx(e,t){let n=t;if(!(this[e+`_exists`]()&&(n=this.columns().indexOf(this[e]()),n<0)))return n}lookupFieldText(e,t){return this[e+`_exists`]()?this[e]():t===void 0?``:this.columns()[t]||``}currentRow(){return this.data()[this._playIntervalIdx]}summaryData(){let e;this.hideLabel()||(e=this.lookupFieldIdx(`labelColumn`,0));let t=this.lookupFieldIdx(`iconColumn`),n=this.lookupFieldIdx(`valueColumn`,1),r,i;this.hideMore()||(r=this.lookupFieldIdx(`moreIconColumn`),i=this.lookupFieldIdx(`moreTextColumn`));let a=this.lookupFieldIdx(`colorFillColumn`),o=this.lookupFieldIdx(`colorStrokeColumn`);return this.formattedData().map(function(s){return{icon:t===void 0?this.icon():s[t],label:e===void 0?``:s[e],value:s[n],moreIcon:r===void 0?this.hideMore()?``:this.moreIcon():s[r],moreText:i===void 0?this.hideMore()?``:this.moreText():s[i],fill:a===void 0?this.colorFill():s[a],stroke:o===void 0?this.colorStroke():s[o]}},this)}enter(e,t){super.enter(e,t),this._mainDiv=t.append(`div`);let n=this;this._headerDiv=this._mainDiv.append(`h2`).on(`click`,function(){n.click(n.rowToObj(n.currentRow()),n.lookupFieldText(`valueColumn`,1),!0)}).on(`dblclick`,function(){n.dblclick(n.rowToObj(n.currentRow()),n.lookupFieldText(`valueColumn`,1),!0)}),this._textDiv=this._mainDiv.append(`div`).attr(`class`,`text`).on(`click`,function(){n.click(n.rowToObj(n.currentRow()),n.lookupFieldText(`labelColumn`,0),!0)}).on(`dblclick`,function(){n.dblclick(n.rowToObj(n.currentRow()),n.lookupFieldText(`labelColumn`,0),!0)})}update(e,t){super.update(e,t),this.data().length;let n=this.summaryData();this._playIntervalIdx>=n.length&&(this._playIntervalIdx=0);let r=this._playIntervalIdx<n.length?n[this._playIntervalIdx]:[``,``];t.style(`width`,this.fixedSize()?this.minWidth_exists()?this.minWidth()+`px`:null:`100%`).style(`height`,this.fixedSize()?this.minHeight_exists()?this.minHeight()+`px`:null:`100%`),this._mainDiv.attr(`class`,`content bgIcon `+r.icon).transition().style(`background-color`,r.fill).style(`color`,r.stroke).style(`min-width`,this.minWidth_exists()?this.minWidth()+`px`:null).style(`min-height`,this.minHeight_exists()?this.minHeight()+`px`:null).style(`font-size`,this.iconFontSize()+`px`),this._headerDiv.transition().style(`color`,r.stroke).style(`font-size`,this.headerFontSize()+`px`)[this.valueHTML()?Dt:Et](r.value),this._textDiv.style(`font-size`,this.textFontSize()+`px`)[this.labelHTML()?Dt:Et](r.label);let i=this,a=this._mainDiv.selectAll(`.more`).data([r]),s=a.enter().append(`div`).attr(`class`,`more`).on(`click`,function(e){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText(`moreTextColumn`)||`more`,!0)}).each(function(){let e=(0,o.select)(this);e.append(`i`),e.append(`span`)}).merge(a).style(`display`,this.hideMoreWrapper()?`none`:null).style(`font-size`,this.moreFontSize()+`px`).style(`height`,this.moreWrapperHeight_exists()?this.moreWrapperHeight()+`px`:null).transition().style(`background-color`,(0,o.rgb)(r.fill).darker(.75).toString());s.select(`i`).attr(`class`,function(e){return`fa `+e.moreIcon}),this.moreTextHTML()?s.select(`span`).each(function(e){this.innerHTML=e.moreText}):s.select(`span`).text(e=>e.moreText),a.exit().remove()}exit(e,t){super.exit(e,t)}};Summary.prototype._class+=` chart_Summary`,Summary.prototype.implements(I2DChart.prototype),Summary.prototype.publish(`iconColumn`,null,`set`,`Select Icon Column`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`icon`,`fa-briefcase`,`string`,`FA Char icon class`,null,{disable:e=>e.iconColumn()}),Summary.prototype.publish(`headerFontSize`,null,`number`,`headerFontSize`),Summary.prototype.publish(`textFontSize`,null,`number`,`textFontSize`),Summary.prototype.publish(`moreFontSize`,null,`number`,`moreFontSize`),Summary.prototype.publish(`iconFontSize`,null,`number`,`iconFontSize`),Summary.prototype.publish(`hideLabel`,!1,`boolean`,`Hide label column`),Summary.prototype.publish(`labelColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0,disable:e=>e.hideLabel()}),Summary.prototype.publish(`labelHTML`,!1,`boolean`,`Allow HTML`,null,{disable:e=>e.hideLabel()}),Summary.prototype.publish(`valueColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`valueHTML`,!1,`boolean`,`Allow HTML`),Summary.prototype.publish(`hideMore`,!1,`boolean`,`Hide More Information`),Summary.prototype.publish(`hideMoreWrapper`,!1,`boolean`,`Hide More Information Wrapper`),Summary.prototype.publish(`moreWrapperHeight`,null,`number`,`Height of the 'more' text wrapper (pixels)`),Summary.prototype.publish(`moreIconColumn`,null,`set`,`Select More Icon Column`,function(){return this.columns()},{optional:!0,disable:e=>e.hideMore()}),Summary.prototype.publish(`moreIcon`,`fa-info-circle`,`string`,`FA Char icon class`,null,{disable:e=>e.hideMore()||e.moreIconColumn()}),Summary.prototype.publish(`moreTextColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0,disable:e=>e.hideMore()}),Summary.prototype.publish(`moreText`,`More Info`,`string`,`More text`,null,{disable:e=>e.hideMore()||e.moreTextColumn()}),Summary.prototype.publish(`moreTextHTML`,!1,`boolean`,`Allow HTML`,null,{disable:e=>e.hideMore()}),Summary.prototype.publish(`colorFillColumn`,null,`set`,`Column for color`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`colorFill`,`#3498db`,`html-color`,`Fill Color`,null,{disable:e=>e.colorFillColumn()}),Summary.prototype.publish(`colorStrokeColumn`,null,`set`,`Column for color`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`colorStroke`,`#ffffff`,`html-color`,`Fill Color`,null,{disable:e=>e.colorStrokeColumn()}),Summary.prototype.publish(`fixedSize`,!0,`boolean`,`Fix Size to Min Width/Height`),Summary.prototype.publish(`minWidth`,225,`number`,`Minimum Width`),Summary.prototype.publish(`minHeight`,150,`number`,`Minimum Height`),Summary.prototype.publish(`playInterval`,null,`number`,`Play Interval`,null,{optional:!0});var Ot=Summary.prototype.playInterval;Summary.prototype.playInterval=function(e){let t=Ot.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);let t=this;e&&(this._playIntervalHandle=setInterval(function(){t._playIntervalIdx++,t._renderCount&&t.data().length&&t.render()},e))}return t};var SummaryC=class extends o.CanvasWidget{_playIntervalIdx=0;constructor(){super(),I2DChart.call(this),this.playInterval(this.playInterval())}currentRow(){return this.data()[this._playIntervalIdx]}enter(e,t){super.enter.apply(this,arguments);let{width:n,height:r}=this.size();e.height=r,e.width=n}update(e,t){super.update.apply(this,arguments);let n=this;this._playIntervalIdx>=this.data().length&&(this._playIntervalIdx=0);let r=this.size(),i=Math.min(r.width,r.height),a=this.fontSizeRatio(),s=this.columns().indexOf(this.labelColumn()),c=this.columns().indexOf(this.valueColumn()),l=this.columns().indexOf(this.colorFillColumn()),u=this.columns().indexOf(this.colorStrokeColumn()),d=this.columns().indexOf(this.iconColumn()),f=d===-1?this.icon():this.currentRow()[d],p=s===-1?``:this.currentRow()[s],m=c===-1?``:this.currentRow()[c],h=l===-1?this.colorFill():this.currentRow()[l],g=u===-1?this.colorStroke():this.currentRow()[u],_=r.height*(a-this.paddingSizeRatio()),v=r.height*(1-a-this.paddingSizeRatio()),b=r.height*(this.iconSizeRatio()-this.paddingSizeRatio()),S=i*this.paddingSizeRatio(),C=e.getContext(`2d`);C.clearRect(0,0,r.width,r.height);let w=n.fontFamily();C.fillStyle=h,C.fillRect(0,0,r.width,r.height),C.globalAlpha=this.iconOpacity(),drawIcon(o.Utility.faChar(f),b,n.iconAnchor()),C.globalAlpha=this.valueOpacity(),_=drawText(m,S,_,n.valueAnchor()),C.globalAlpha=this.labelOpacity(),drawText(p,_+S,v,n.labelAnchor());function drawText(e,t,n,i){C.textBaseline=`top`,C.font=`${n}px ${w}`,C.fillStyle=g;let a=C.measureText(e);if(a.width>r.width-S*2){let t=(r.width-S*2)/a.width;n*=t,C.font=`${n}px ${w}`,a=C.measureText(e)}let o=getTextOffsetX(a.width,i);return C.fillText(e,o,t),n}function drawIcon(e,t,i){if(e===void 0)return;C.textBaseline=n.iconBaseline(),C.font=`${t}px FontAwesome`,C.fillStyle=g;let a=C.measureText(e);a.width>r.width-S*2&&(C.font=`${t*((r.width-S*2)/a.width)}px FontAwesome`,a=C.measureText(e));let o=getTextOffsetX(a.width,i),s=getTextOffsetY(n.iconBaseline());C.fillText(e,o,s)}function getTextOffsetX(e,t){switch(t){case`start`:return S;case`middle`:return r.width/2-e/2;case`end`:return r.width-e-S}}function getTextOffsetY(e){switch(e){case`top`:return S;case`middle`:return r.height/2;case`bottom`:return r.height-S}}}};SummaryC.prototype._class+=` chart_SummaryC`,SummaryC.prototype.implements(I2DChart.prototype),SummaryC.prototype.publish(`iconBaseline`,`bottom`,`string`,`Text baseline for the icon`,[`top`,`middle`,`bottom`]),SummaryC.prototype.publish(`iconAnchor`,`end`,`set`,`Anchors the icon either at the start, middle, or end of the summary`,[`start`,`middle`,`end`]),SummaryC.prototype.publish(`valueAnchor`,`start`,`set`,`Anchors the value either at the start, middle, or end of the summary`,[`start`,`middle`,`end`]),SummaryC.prototype.publish(`labelAnchor`,`start`,`set`,`Anchors the label either at the start, middle, or end of the summary`,[`start`,`middle`,`end`]),SummaryC.prototype.publish(`iconColumn`,null,`set`,`Select Icon Column`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`icon`,`fa-briefcase`,`string`,`FA Char icon class`,null,{disable:e=>e.iconColumn()}),SummaryC.prototype.publish(`fontFamily`,`Arial`,`string`,`Font Family`),SummaryC.prototype.publish(`labelColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`valueColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`colorFillColumn`,null,`set`,`Column for background color`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`colorFill`,`#0097e6`,`html-color`,`Background Color`,null,{disable:e=>e.colorFillColumn()}),SummaryC.prototype.publish(`colorStrokeColumn`,null,`set`,`Column for font color`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`colorStroke`,`#2f3640`,`html-color`,`Font Color`,null,{disable:e=>e.colorStrokeColumn()}),SummaryC.prototype.publish(`fixedSize`,!0,`boolean`,`Fix Size to Min Width/Height`),SummaryC.prototype.publish(`minWidth`,225,`number`,`Minimum Width`),SummaryC.prototype.publish(`minHeight`,150,`number`,`Minimum Height`),SummaryC.prototype.publish(`playInterval`,null,`number`,`Play Interval`,null,{optional:!0}),SummaryC.prototype.publish(`fontSizeRatio`,.618,`number`,`Ratio between widget height and value font size`),SummaryC.prototype.publish(`valueOpacity`,1,`number`,`Opacity of value text (0..1)`),SummaryC.prototype.publish(`labelOpacity`,.9,`number`,`Opacity of label text (0..1)`),SummaryC.prototype.publish(`iconOpacity`,.3,`number`,`Opacity of icon text (0..1)`),SummaryC.prototype.publish(`paddingSizeRatio`,.1,`number`,`Ratio of the smallest dimension for edge padding (0..1)`),SummaryC.prototype.publish(`iconSizeRatio`,.9,`number`,`Ratio of the height for icon size (0..1)`);var kt=SummaryC.prototype.playInterval;SummaryC.prototype.playInterval=function(e){let t=kt.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);let t=this;e&&(this._playIntervalHandle=setInterval(function(){t._playIntervalIdx++,t._renderCount&&t.data().length&&t.render()},e))}return t};var At=Math.PI/180,jt=64,Mt=2048;function d3Cloud(){let e=(0,o.dispatch)(`word`,`end`),t={},n=[256,256],r=cloudText,i=cloudFont,a=cloudFontSize,s=cloudFontNormal,c=cloudFontNormal,l=cloudRotate,u=cloudPadding,d=[],f=archimedeanSpiral,p=1/0,m=null,h=Math.random,g=cloudCanvas;t.canvas=function(e){return arguments.length?(g=functor(e),t):g},t.start=function(){let o=getContext(g()),f=zeroArray((n[0]>>5)*n[1]),_=null,v=d.length,b=-1,S=[],C=d.map(function(e,t){return e.text=r.call(this,e,t),e.font=i.call(this,e,t),e.style=s.call(this,e,t),e.weight=c.call(this,e,t),e.rotate=l.call(this,e,t),e.size=~~a.call(this,e,t),e.padding=u.call(this,e,t),e}).sort(function(e,t){return t.size-e.size});return m&&clearInterval(m),m=setInterval(step,0),step(),t;function step(){let r=Date.now();for(;Date.now()-r<p&&++b<v&&m;){let r=C[b];r.x=n[0]*(h()+.5)>>1,r.y=n[1]*(h()+.5)>>1,cloudSprite(o,r,C,b),r.hasText&&place(f,r,_)&&(S.push(r),e.call(`word`,t,r),_?cloudBounds(_,r):_=[{x:r.x+r.x0,y:r.y+r.y0},{x:r.x+r.x1,y:r.y+r.y1}],r.x-=n[0]>>1,r.y-=n[1]>>1)}b>=v&&(t.stop(),e.call(`end`,t,S,_))}},t.stop=function(){return m&&=(clearInterval(m),null),t};function getContext(e){e.width=e.height=1;let t=Math.sqrt(e.getContext(`2d`).getImageData(0,0,1,1).data.length>>2);e.width=(jt<<5)/t,e.height=Mt/t;let n=e.getContext(`2d`);return n.fillStyle=n.strokeStyle=`red`,n.textAlign=`center`,{context:n,ratio:t}}function place(e,t,r){let i=t.x,a=t.y,o=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=f(n),c=h()<.5?1:-1,l=-c,u,d,p;for(;(u=s(l+=c))&&(d=~~u[0],p=~~u[1],!(Math.min(Math.abs(d),Math.abs(p))>=o));)if(t.x=i+d,t.y=a+p,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>n[0]||t.y+t.y1>n[1])&&(!r||!cloudCollide(t,e,n[0]))&&(!r||collideRects(t,r))){let r=t.sprite,i=t.width>>5,a=n[0]>>5,o=t.x-(i<<4),s=o&127,c=32-s,l=t.y1-t.y0,u=(t.y+t.y0)*a+(o>>5),d;for(let t=0;t<l;t++){d=0;for(let n=0;n<=i;n++)e[u+n]|=d<<c|(n<i?(d=r[t*i+n])>>>s:0);u+=a}return delete t.sprite,!0}return!1}return t.timeInterval=function(e){return arguments.length?(p=e??1/0,t):p},t.words=function(e){return arguments.length?(d=e,t):d},t.size=function(e){return arguments.length?(n=[+e[0],+e[1]],t):n},t.font=function(e){return arguments.length?(i=functor(e),t):i},t.fontStyle=function(e){return arguments.length?(s=functor(e),t):s},t.fontWeight=function(e){return arguments.length?(c=functor(e),t):c},t.rotate=function(e){return arguments.length?(l=functor(e),t):l},t.text=function(e){return arguments.length?(r=functor(e),t):r},t.spiral=function(e){return arguments.length?(f=Nt[e]||e,t):f},t.fontSize=function(e){return arguments.length?(a=functor(e),t):a},t.padding=function(e){return arguments.length?(u=functor(e),t):u},t.random=function(e){return arguments.length?(h=e,t):h},t.on=function(){let n=e.on.apply(e,arguments);return n===e?t:n},t}function cloudText(e){return e.text}function cloudFont(){return`serif`}function cloudFontNormal(){return`normal`}function cloudFontSize(e){return Math.sqrt(e.value)}function cloudRotate(){return(~~(Math.random()*6)-3)*30}function cloudPadding(){return 1}function cloudSprite(e,t,n,r){if(t.sprite)return;let i=e.context,a=e.ratio;i.clearRect(0,0,(jt<<5)/a,Mt/a);let o=0,s=0,c=0,l=n.length;for(--r;++r<l;){t=n[r],i.save(),i.font=t.style+` `+t.weight+` `+~~((t.size+1)/a)+`px `+t.font;let e=i.measureText(t.text+`m`).width*a,l=t.size<<1;if(t.rotate){let n=Math.sin(t.rotate*At),r=Math.cos(t.rotate*At),i=e*r,a=e*n,o=l*r,s=l*n;e=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(a+o),Math.abs(a-o))}else e=e+31>>5<<5;if(l>c&&(c=l),o+e>=jt<<5&&(o=0,s+=c,c=0),s+l>=Mt)break;i.translate((o+(e>>1))/a,(s+(l>>1))/a),t.rotate&&i.rotate(t.rotate*At),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=e,t.height=l,t.xoff=o,t.yoff=s,t.x1=e>>1,t.y1=l>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=e}let u=i.getImageData(0,0,(jt<<5)/a,Mt/a).data,d=[];for(;--r>=0;){if(t=n[r],!t.hasText)continue;let e=t.width,i=e>>5,a=t.y1-t.y0;for(let e=0;e<a*i;e++)d[e]=0;if(o=t.xoff,o==null)return;s=t.yoff;let c=0,l=-1;for(let n=0;n<a;n++){for(let t=0;t<e;t++){let e=i*n+(t>>5),r=u[(s+n)*(jt<<5)+(o+t)<<2]?1<<31-t%32:0;d[e]|=r,c|=r}c?l=n:(t.y0++,a--,n--,s++)}t.y1=t.y0+l,t.sprite=d.slice(0,(t.y1-t.y0)*i)}}function cloudCollide(e,t,n){n>>=5;let r=e.sprite,i=e.width>>5,a=e.x-(i<<4),o=a&127,s=32-o,c=e.y1-e.y0,l=(e.y+e.y0)*n+(a>>5),u;for(let e=0;e<c;e++){u=0;for(let n=0;n<=i;n++)if((u<<s|(n<i?(u=r[e*i+n])>>>o:0))&t[l+n])return!0;l+=n}return!1}function cloudBounds(e,t){let n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function collideRects(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function archimedeanSpiral(e){let t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function rectangularSpiral(e){let t=4*e[0]/e[1],n=0,r=0;return function(e){let i=e<0?-1:1;switch(Math.sqrt(1+4*i*e)-i&3){case 0:n+=t;break;case 1:r+=4;break;case 2:n-=t;break;default:r-=4;break}return[n,r]}}function zeroArray(e){let t=[],n=-1;for(;++n<e;)t[n]=0;return t}function cloudCanvas(){return document.createElement(`canvas`)}function functor(e){return typeof e==`function`?e:function(){return e}}var Nt={archimedean:archimedeanSpiral,rectangular:rectangularSpiral},WordCloud=class extends o.SVGWidget{static __inputs=[{id:`label`,type:`string`},{id:`value`,type:`number`}];_prevOffsetX;_prevOffsetY;_prevZoom;_root;_canvas;_d3Cloud;_d3Zoom;constructor(){super(),I2DChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this),this._prevOffsetX=this.offsetX(),this._prevOffsetY=this.offsetY(),this._prevZoom=this.zoom()}calcData(){return this.data().map(e=>({__viz_label:e[0],__viz_weight:e[1],__viz_row:e}))}enter(e,t){super.enter(e,t),this._selection.widgetElement(t),this._root=t.append(`g`),this._canvas=document.createElement(`canvas`);let n=this;this._d3Zoom=(0,o.zoom)().scaleExtent([.1,10]),this._d3Zoom.on(`zoom`,function(e){let t=(0,o.d3Event)();t&&t.transform&&n.zoomed(n._d3Zoom,[t.transform.x,t.transform.y],t.transform.k)}),t.call(this._d3Zoom),this.tooltipHTML(function(e){let t=n.columns(),r=t&&t.length?t[0]:`Word`;return n.tooltipFormat({label:e.__viz_label,series:r,value:e.__viz_weight})})}update(e,t){super.update(e,t),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._d3Cloud=d3Cloud().canvas(()=>this._canvas),this.zoomed(this,[this.offsetX(),this.offsetY()],this.zoom());let n=this.calcData(),r=this,i=(0,o.extent)(n,function(e){return e.__viz_weight}),a;switch(this.scaleMode()){case`log`:a=o.scaleLog;break;case`sqrt`:a=o.scaleSqrt;break;case`pow`:a=o.scalePow;break;default:a=o.scaleLinear;break}let s=a().domain(i).range([this.fontSizeFrom(),this.fontSizeTo()]),c=(0,o.scaleLinear)().domain([0,r.angleCount()-1]).range([r.angleFrom(),r.angleTo()]);this._d3Cloud.stop().size([this.width(),this.height()]).words(n).font(this.fontFamily()).padding(this.padding()).spiral(this.spiral()).text(function(e){return e.__viz_label.trim()}).fontSize(function(e){return s(e.__viz_weight)}).rotate((e,t)=>c(t%r.angleCount())).on(`word`,e=>{}).on(`end`,draw).start();function draw(e,t){let n=r._root.selectAll(`text`).data(e,function(e){return e.__viz_label?e.__viz_label.toLowerCase():``});n.enter().append(`text`).attr(`text-anchor`,`middle`).call(r._selection.enter.bind(r._selection)).text(function(e){return e.__viz_label}).on(`click`,function(e){r.click(r.rowToObj(e.__viz_row),r.columns()[1],r._selection.selected(this))}).on(`dblclick`,function(e){r.dblclick(r.rowToObj(e.__viz_row),r.columns()[1],r._selection.selected(this))}).on(`mouseout.tooltip`,r.tooltip.hide).on(`mousemove.tooltip`,r.tooltip.show).style(`opacity`,1e-6).merge(n).style(`font-size`,function(e){return s(e.__viz_weight)+`px`}).style(`font-family`,r.fontFamily()).transition().duration(1e3).attr(`transform`,function(e){return`translate(`+[e.x,e.y]+`)rotate(`+e.rotate+`)`}).style(`fill`,function(e){return r._palette(e.__viz_label?e.__viz_label.toLowerCase():``)}).style(`opacity`,1),n.exit().transition().duration(1e3).style(`opacity`,1e-4).remove()}}zoomed(e,t,n){if(t[0]!==this._prevOffsetX||t[1]!==this._prevOffsetY||n!==this._prevZoom){switch(this._root.attr(`transform`,t),e){case this:break;case this._d3Zoom:this.offsetX(t[0]),this.offsetY(t[1]),this.zoom(n);break}this._prevOffsetX=t[0],this._prevOffsetY=t[1],this._prevZoom=n}}};WordCloud.prototype._class+=` chart_WordCloud`,WordCloud.prototype.implements(I2DChart.prototype),WordCloud.prototype.implements(ITooltip.prototype),WordCloud.prototype.mixin(o.Utility.SimpleSelectionMixin),WordCloud.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,WordCloud.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),WordCloud.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),WordCloud.prototype.publish(`fontFamily`,`Impact`,`string`,`Font Name`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`fontSizeFrom`,6,`number`,`Minimum font size (pixels)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`fontSizeTo`,48,`number`,`Maximum font size (pixels)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`angleFrom`,-60,`number`,`Minimum angle (degrees)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`angleTo`,60,`number`,`Maximum angle (degrees)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`angleCount`,5,`number`,`Number of different angles`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`padding`,0,`number`,`Padding between words (pixels)`,null,{tags:[`Intermediate`]}),WordCloud.prototype.publish(`scaleMode`,`linear`,`set`,`Text scaling mode`,[`linear`,`log`,`sqrt`,`pow`],{tags:[`Intermediate`]}),WordCloud.prototype.publish(`spiral`,`archimedean`,`set`,`Text scaling mode`,[`archimedean`,`rectangular`],{tags:[`Intermediate`]}),WordCloud.prototype.publish(`offsetX`,0,`number`,`X offset`,null,{tags:[`Advanced`]}),WordCloud.prototype.publish(`offsetY`,0,`number`,`Y offset`,null,{tags:[`Advanced`]}),WordCloud.prototype.publish(`zoom`,1,`number`,`Zoom`,null,{tags:[`Advanced`]});function multiScale24Hours(){let e=(0,o.timeFormat)(`.%L`),t=(0,o.timeFormat)(`:%S`),n=(0,o.timeFormat)(`%H:%M`),r=(0,o.timeFormat)(`%H:00`),i=(0,o.timeFormat)(`%b %d`),a=(0,o.timeFormat)(`%b`),s=(0,o.timeFormat)(`%Y`);return o=>o.getMilliseconds()===0?o.getSeconds()===0?o.getMinutes()===0?o.getHours()===0?o.getDate()===1?o.getMonth()===0?s(o):a(o):i(o):r(o):n(o):t(o):e(o)}(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.chart_Axis{fill:#000;font:10px sans-serif}.chart_Axis .axis .tick>text{font:10px sans-serif}.chart_Axis .axis path.domain,.chart_Axis .axis .tick line{fill:none;stroke:#000}.chart_Axis .guide path.domain{fill:none;stroke:none}.chart_Axis .guide .tick line{fill:none;stroke:#d3d3d3;opacity:.7}.chart_Axis .guide .tick.guide-0 line{stroke:#000;stroke-width:1px;stroke-dasharray:3 5}.chart_Axis line,.chart_Axis path{shape-rendering:crispedges}.chart_XYAxis .axis{fill:#000;font:10px sans-serif}.chart_XYAxis .tick>text{font:10px sans-serif}.chart_XYAxis .focus .chart_Axis.value .tick{visibility:hidden}.chart_XYAxis .axis path,.chart_XYAxis .axis line{fill:none;stroke:#000;shape-rendering:crispedges}.chart_XYAxis .region{opacity:.33}.chart_XYAxis .brush rect.background{z-index:-999}.chart_XYAxis .brush .selection{stroke:#4682b4;stroke-opacity:1;stroke-width:1px;fill:#4682b4;fill-opacity:.125;shape-rendering:crispedges}.chart_XYAxis .brush path.handle--custom{fill:#eee;stroke:#666}.chart_Scatter .pointShape,.chart_Scatter .line,.chart_Scatter .area{pointer-events:none}.chart_Scatter .point .pointSelection{fill:none;stroke:#0000;stroke-width:2px;pointer-events:all;transition:all .2s}.chart_Scatter .point .pointSelection.selected{stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Scatter .point .pointSelection:hover{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Scatter .point .pointSelection:focus{stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Scatter .point .pointSelection.selected:focus{stroke:#6f42c1!important}.chart_Scatter .point .pointSelection:focus-visible{outline:none}.chart_Scatter .point .pointSelection:active{outline:none!important}.chart_Column .columnRect{fill:#4682b4;cursor:pointer}.chart_Column .data.axis path{display:none}.chart_Column .columnRect{stroke:#0000;border-width:2px}.chart_Column .dataCell.selected .columnRect{transition:all .2s;stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Column .dataCell:hover .columnRect{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Column .dataCell:focus .columnRect{transition:all .2s;stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Column .dataCell.selected:focus .columnRect{stroke:#6f42c1!important}.chart_Column .dataCell:focus-visible{outline:none}.chart_Column .dataCell:active{outline:none!important}.chart_Bubble circle{cursor:pointer}.chart_Bubble .selected circle{stroke:red;stroke-width:1.5px}.chart_Bubble .common_FAChar{fill:#fff;pointer-events:none}.chart_Bubble .common_Text{pointer-events:none}.chart_Bullet .domain{opacity:0}.chart_Bullet .bullet{border:1px solid #0000;font:10px sans-serif}.chart_Bullet .bullet.selected{border-color:red}.chart_Bullet .bullet.over{border-color:orange}.chart_Bullet .bullet.selected.over{border-color:red}.chart_Bullet .bullet .marker{stroke:#000;stroke-width:2px}.chart_Bullet .bullet .tick line{stroke:#666;stroke-width:.5px}.chart_Bullet .bullet .range.s0{fill:#eee}.chart_Bullet .bullet .range.s1{fill:#ddd}.chart_Bullet .bullet .range.s2{fill:#ccc}.chart_Bullet .bullet .measure.s0{fill:#b0c4de}.chart_Bullet .bullet .measure.s1{fill:#4682b4}.chart_Bullet .bullet .title{font-size:14px;font-weight:700}.chart_Bullet .bullet .subtitle{fill:#999}.chart_Pie path,.chart_Pie>g>text{cursor:pointer}.chart_Pie .arc path{stroke:#0000;stroke-width:2px}.chart_Pie .arc.selected path{transition:all .2s;stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Pie polyline{opacity:.3;stroke:#000;stroke-width:2px;fill:none}.chart_Pie .arc:hover path{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Pie .arc:focus path{transition:all .2s;stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Pie .arc.selected:focus path{stroke:#6f42c1!important}.chart_Pie .arc:focus-visible{outline:none}.chart_Pie .arc:active{outline:none!important}.chart_HexBin .hexagon{fill:none;stroke:#000;stroke-width:.5px}.chart_HexBin .hexagon.selected{stroke:red}.chart_Line .dataLine{fill:none;stroke:#4682b4;stroke-width:1.5px}.chart_Radar .pointShape,.chart_Radar .area{pointer-events:none}.chart_Radar .point .pointSelection{fill:none;stroke:none;pointer-events:all}.chart_Radar .point .pointSelection.selected{fill:none;stroke:red}.chart_RadialBar path.arc{opacity:.9;transition:opacity .5s}.chart_RadialBar path.arc.selected{stroke:red}.chart_RadialBar path.arc:hover{opacity:.7}.chart_RadialBar .axis line,.chart_RadialBar .axis circle{stroke:#ccc;stroke-width:1px}.chart_RadialBar .axis circle{fill:none}.chart_RadialBar .r.axis text{text-anchor:end}.chart_Summary{width:225px;height:150px;font-size:14px}.chart_Summary .content h2{margin-top:10px;margin-bottom:10px;margin-left:10px;font-size:3em;font-weight:700}.chart_Summary .bgIcon:before{opacity:.4;font-family:FontAwesome;font-size:5.5em;position:absolute;top:.5em;right:15px}.chart_Summary .bgIcon{position:relative}.chart_Summary .content{float:left;background-color:#efd752;width:100%;height:100%}.chart_Summary .content div{opacity:.8;margin-top:-1.1em;font-size:1.1em}.chart_Summary .content .text{padding-left:10px}.chart_Summary .content .more{width:100%;height:3em;line-height:3em;position:absolute;bottom:0}.chart_Summary .content .more i{padding-left:10px;padding-right:.5em}.other_Wordcloud text{cursor:pointer}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();var Pt=[`label`,`start`,`end`,`icon`,`color`,`series`],WUTimeline=class extends u.ReactTimelineSeries{_palette=o.Palette.ordinal(`default`);constructor(){super(),this.columns(Pt).titleColumn(`label`).iconColumn(`icon`).colorColumn(`color`).seriesColumn(`series`).timePattern(`%Y-%m-%dT%H:%M:%S.%LZ`).tickFormatFunc(multiScale24Hours()).tooltipTimeFormat(`%H:%M:%S.%L`).tooltipHTML(e=>e[Pt.length].calcTooltip())}_prevHashSum;clear(){return delete this._prevHashSum,this}fetchScopes(){let e=(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid(),request:this.request()});this._prevHashSum!==e&&(this._prevHashSum=e,n.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchDetails(this.request()).then(e=>e.filter(e=>e.Id&&e.attr(`WhenStarted`).RawValue).map(e=>{let t=e.attr(`WhenStarted`).RawValue/1e3,n=e.attr(`TimeElapsed`).RawValue/1e6;return[e.Id,new Date(t).toISOString(),n?new Date(t+n).toISOString():void 0,null,this._palette(e.ScopeType),e.ScopeName.split(`::`).join(`:`).split(`:`).slice(0,1),e]})).then(e=>{this.data(e).render()}))}enter(e,t){super.enter(e,t)}update(e,t){this.fetchScopes(),super.update(e,t)}exit(e,t){super.exit(e,t)}};WUTimeline.prototype._class+=` eclwatch_WUTimeline`,WUTimeline.prototype.publish(`baseUrl`,``,`string`,`HPCC Platform Base URL`),WUTimeline.prototype.publish(`wuid`,``,`string`,`Workunit ID`),WUTimeline.prototype.publish(`request`,{ScopeFilter:{MaxDepth:3,ScopeTypes:[`graph`,`subgraph`]},NestedFilter:{Depth:0,ScopeTypes:[]},PropertiesToReturn:{AllProperties:!1,AllStatistics:!0,AllHints:!1,Properties:[`WhenStarted`,`TimeElapsed`]},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},`object`,`WUDetails Request`),e.BUILD_VERSION=p,e.ECLArchiveViewer=ECLArchiveViewer,e.PKG_NAME=d,e.PKG_VERSION=f,e.STATUS=m,e.STATUS_ACTIVE=h,e.WUGraph=WUGraph,e.WUGraphLegend=WUGraphLegend,e.WUResult=WUResult,e.WUScopeController=WUScopeController,e.WUStatus=WUStatus,e.WUTimeline=WUTimeline});
|
|
12
|
+
`)}update(e,t){super.update(e,t),this.svg.style(`display`,this.hidden()?`none`:null);let n=this.calcOverflow(t),r=this.isHorizontal()?n.left:this.height()-n.top-n.bottom,i=this.isHorizontal()?this.width()-n.right-this.padding():0+this.padding();this.range(this.reverse()?[i,r]:[r,i]);let a=this;function doPosition(e){e.attr(`transform`,function(){switch(a.orientation()){case`left`:return`translate(`+n.depth+`, `+n.top+`)`;case`top`:return`translate(0,`+n.depth+`)`;case`right`:return`translate(`+(a.width()-n.depth)+`, `+n.top+`)`;case`bottom`:return`translate(0,`+(a.height()-n.depth)+`)`;default:}return`translate(0,0)`})}this.svg.style(`visibility`,this.type()===`none`?`hidden`:null).transition().call(doPosition),this._guideElement&&this.svgGuides.transition().call(doPosition),this.svgAxis.call(this.d3Axis),this.adjustText(this.svgAxis,n.tickOverlapModulus);let o={x:this.pos().x,width:this.width()},s=this.svgAxis.selectAll(`.axisTitle`).data(this.title()?[this.title()]:[]),c=s.enter().append(`text`).attr(`class`,`axisTitle`).merge(s).transition().attr(`dx`,null).style(`text-anchor`,`end`);switch(this.orientation()){case`left`:c.attr(`transform`,`rotate(-90)`).attr(`x`,-2).attr(`y`,2).attr(`dy`,`.71em`);break;case`right`:c.attr(`transform`,`rotate(-90)`).attr(`x`,-2).attr(`y`,4).attr(`dx`,null).attr(`dy`,`-.71em`);break;case`top`:c.attr(`transform`,`rotate(0)`).attr(`x`,o.width-2).attr(`y`,2).attr(`dx`,null).attr(`dy`,`.71em`);break;case`bottom`:c.attr(`transform`,`rotate(0)`).attr(`x`,o.width-2).attr(`y`,-2).attr(`dy`,null);break;default:}c.text(this.title_exists()?this.title():``),s.exit().remove(),this.svgGuides.call(this.d3Guides).selectAll(`.tick`).classed(`guide-0`,e=>e===0&&this.low()<0)}rerender(){this.svgAxis.call(this.d3Axis),this.svgGuides.call(this.d3Guides)}postUpdate(e,t){super.postUpdate(e,t),this._guideElement&&this._guideElement.attr(`transform`,this._element.attr(`transform`))}};Axis.prototype._class+=` chart_Axis`,Axis.prototype.publish(`type`,`linear`,`set`,`Type`,[`none`,`ordinal`,`linear`,`pow`,`log`,`time`]),Axis.prototype.publish(`timePattern`,`%Y-%m-%d`,`string`,`Time Series Pattern`,null,{disable:e=>e.type()!==`time`}),Axis.prototype.publish(`reverse`,!1,`boolean`,`Reverse`),Axis.prototype.publish(`title`,null,`string`,`Title`),Axis.prototype.publish(`orientation`,`bottom`,`set`,`Placement/orientation of the axis`,[`left`,`top`,`right`,`bottom`]),Axis.prototype.publish(`powExponent`,2,`number`,`Power exponent (disabled when type is not 'pow')`,null,{disable:e=>e.type()!==`pow`}),Axis.prototype.publish(`logBase`,10,`number`,`Logarithmic base (disabled when type is not 'log')`,null,{disable:e=>e.type()!==`log`}),Axis.prototype.publish(`ordinals`,[],`array`,`Array of ordinal values to display (disabled when type is not 'ordinal')`,null,{disable:e=>e.type()!==`ordinal`}),Axis.prototype.publish(`fontSize`,null,`number`,`Size of tick label font (pixels)`,null,{optional:!0}),Axis.prototype.publish(`fontFamily`,null,`string`,`Font family of tick labels`,null,{optional:!0}),Axis.prototype.publish(`tickCount`,null,`number`,`Number of ticks to display (disabled when type is 'ordinal')`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`tickFormat`,null,`string`,`Format rules for tick text (disabled when type is 'ordinal')`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`tickLength`,null,`number`,`Height (or width for left/right orientations) of the axis ticks (in pixels)`,null,{optional:!0}),Axis.prototype.publish(`ticks`,[],`array`,`Custom tick labels`,null,{optional:!0}),Axis.prototype.publish(`low`,null,`any`,`Minimum tick value (disabled when type is ordinal)`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`high`,null,`any`,`Maximum tick value (disabled when type is ordinal)`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`overlapMode`,`none`,`set`,`Specifies the behavior when tick labels overlap`,[`none`,`stagger`,`hide`,`rotate`,`linebreak`,`wrap`]),Axis.prototype.publish(`labelRotation`,33,`number`,`Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')`,null,{optional:!0,disable:e=>e.overlapMode()!==`rotate`}),Axis.prototype.publish(`shrinkToFit`,`both`,`set`,`shrinkToFit`,[`none`,`low`,`high`,`both`]),Axis.prototype.publish(`extend`,5,`number`,`Extend the axis range by this % beyond what is needed to display the data (disabled when type is 'ordinal')`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`hidden`,!1,`boolean`,`Hides axis when 'true'`),Axis.prototype.publish(`ordinalPaddingInner`,.1,`number`,`Determines the ratio of the range that is reserved for blank space between band (0->1)`,null,{disable:e=>e.type()!==`ordinal`}),Axis.prototype.publish(`ordinalPaddingOuter`,.1,`number`,`Determines the ratio of the range that is reserved for blank space before the first band and after the last band (0->1)`,null,{disable:e=>e.type()!==`ordinal`}),Axis.prototype.publish(`ordinalMappings`,null,`object`,`Alternative label mappings (icons)`,null,{optional:!0}),Axis.prototype.publish(`padding`,0,`number`,`Padding space at top of axis (pixels)`,null,{optional:!0}),Axis.prototype._origType=Axis.prototype.type,Axis.prototype.type=function(e){let t=Axis.prototype._origType.apply(this,arguments);return e!==void 0&&(this._type=e,this.updateScale()),t},Axis.prototype._origTimePattern=Axis.prototype.timePattern,Axis.prototype.timePattern=function(e){let t=Axis.prototype._origTimePattern.apply(this,arguments);return e!==void 0&&(this._timePattern=e,this.updateScale()),t};var XYAxis=class extends o.SVGWidget{domainAxis;valueAxis;xAxis;yAxis;xyBrush;xBrush;yBrush;margin;focusChart;constructor(){super(),o.Utility.SimpleSelectionMixin.call(this),this._drawStartPos=`origin`,this.domainAxis=new Axis().classed({domain:!0}).orientation_default(`bottom`).type(`ordinal`).overlapMode_default(`stagger`).shrinkToFit_default(`high`).extend_default(0),this.valueAxis=new Axis().classed({value:!0}).orientation_default(`left`).type(`linear`).shrinkToFit_default(`high`),this.xyBrush=(0,o.brush)().on(`end`,()=>this.brushMoved()).on(`start.handle brush.handle end.handle`,()=>this.brushMoved2()),this.xBrush=(0,o.brushX)().on(`end`,()=>this.brushMoved()).on(`start.handle brush.handle end.handle`,()=>this.brushMoved2()),this.yBrush=(0,o.brushY)().on(`end`,()=>this.brushMoved()).on(`start.handle brush.handle end.handle`,()=>this.brushMoved2())}_prevBrush;resetSelection(){return this._prevBrush=null,this}parseData(e){return this.domainAxis.parse(e)}parseValue(e){return this.valueAxis.parse(e,!0)}formatData(e){return this.domainAxis.format(e)}formatValue(e){return this.valueAxis.format(e)}parsedData(){return this.data().map(function(e){let t=0;return e.map(function(e,n){if(n===0)return this.parseData(e);if(n>=this.columns().length)return e;let r=this.yAxisStacked()?[t,t+this.parseValue(e)]:this.parseValue(e);return t+=this.parseValue(e),r},this)},this)}bandwidth(){return this.domainAxis.bandwidth()}svg;svgRegions;svgDomainGuide;svgValueGuide;svgData;svgDataClipRect;svgFocus;svgBrush;enter(e,t){super.enter(e,t),this.svg=t.append(`g`),this.svgRegions=t.append(`g`),this.svgDomainGuide=this.svg.append(`g`),this.svgValueGuide=this.svg.append(`g`),this.svgData=this.svg.append(`g`),this.svgDataClipRect=this.svg.append(`clipPath`).attr(`id`,this.id()+`_clippath`).append(`rect`).attr(`x`,0).attr(`y`,0),this.svgData=this.svg.append(`g`).attr(`clip-path`,`url(#`+this.id()+`_clippath)`),this._selection.widgetElement(this.svgData),this.svgFocus=t.append(`g`),this.domainAxis.target(this.svg.node()).guideTarget(this.svgDomainGuide.node()),this.valueAxis.target(this.svg.node()).guideTarget(this.svgValueGuide.node()),this.svgBrush=t.append(`g`).attr(`class`,`brush`),this.chartsEnter(this,this.svgData,250)}resizeBrushHandle(e,t,n){let r,i,a;return e.type===`e`||e.type===`w`?(r=+(e.type===`e`),i=r?1:-1,a=n/3,`M`+.5*i+`,`+a+`A6,6 0 0 `+r+` `+6.5*i+`,`+(a+6)+`V`+(2*a-6)+`A6,6 0 0 `+r+` `+.5*i+`,`+2*a+`ZM`+2.5*i+`,`+(a+8)+`V`+(2*a-8)+`M`+4.5*i+`,`+(a+8)+`V`+(2*a-8)):(r=+(e.type===`s`),a=r?1:-1,i=t/3,`M`+i+`, `+.5*a+`A6,6 0 0 `+(r+1)%2+` `+(i+6)+`,`+6.5*a+`H`+(2*i-6)+`A6,6 0 0 `+(r+1)%2+` `+2*i+`,`+.5*a+`ZM`+(i+8)+`,`+2.5*a+`H`+(2*i-8)+`M`+(i+8)+`,`+4.5*a+`H`+(2*i-8))}_skipSelection=!1;skipSelection(e){return arguments.length?(this._skipSelection=e,this):this._skipSelection}brushMoved(){if(this._skipSelection)return;let e=[],t=this,n=(0,o.brushSelection)(this.svgBrush.node());n&&(e=this.data().filter(function(e){let r=t.dataPos(e[0]);if(t.use2dSelection()){let i=t.valuePos(e[1])+t.valueAxis.bandwidth()/2;return r>=n[0][0]&&r<=n[1][0]&&i>=n[0][1]&&i<=n[1][1]}else return r>=n[0]&&r<=n[1]})),this.selection(e)}brushMoved2(){let e=this.orientation()===`horizontal`,t=this.use2dSelection()?[]:e?[{type:`w`},{type:`e`}]:[{type:`n`},{type:`s`}],n=this.svgBrush.selectAll(`.handle--custom`).data(t),r=(0,o.d3Event)()?.selection;r==null?n.attr(`display`,`none`):e?n.attr(`display`,null).attr(`transform`,(e,t)=>`translate(`+r[t]+`,0)`):n.attr(`display`,null).attr(`transform`,(e,t)=>`translate(0, `+r[t]+`)`)}dataPos(e){return this.domainAxis.scalePos(e)}valuePos(e){return this.valueAxis.scalePos(e)}getAxisSize(e){return{width:this.xAxis?this.xAxis.width():e.xAxis.width(),height:this.yAxis?this.yAxis.height():e.yAxis.width()}}calcMargin(e,t,n){let r={top:!n&&this.selectionMode()?10:2,right:n&&(this.selectionMode()||this.xAxisFocus())?10:2,bottom:(this.xAxisFocus()?this.xAxisFocusHeight():0)+2,left:2},i=this.width()-r.left-r.right,a=this.height()-r.top-r.bottom,o=0,s=30,c=0,l=30;for(let e=0;e<10;++e){this.xAxis.width(i-l).height(0);let e=this.xAxis.calcOverflow(t),n=e.depth;this.yAxis.width(0).height(a-s);let r=this.yAxis.calcOverflow(t),u=r.depth;if(o=e.right,c=r.top,n===s&&u===l)break;s=n,l=u}return this.xAxis.x(i/2+l/2+r.left).y(a+r.top).width(i-l),this.yAxis.x(r.left).y(a/2-s/2+r.top).height(a-s),r.left+=l,r.top+=c,r.right+=o,r.bottom+=s,r}updateRegions(e,t,n){let r=this,i=this.svgRegions.selectAll(`.region`).data(this.regions());i.enter().append(`rect`).attr(`class`,`region`),n?i.attr(`x`,function(e){return r.dataPos(e.x0)}).attr(`y`,0).attr(`width`,function(e){return r.dataPos(e.x1)-r.dataPos(e.x0)}).attr(`height`,this.height()).style(`stroke`,function(e){return r._palette(e.colorID)}).style(`fill`,function(e){return(0,o.hsl)(r._palette(e.colorID)).brighter()}):i.attr(`x`,0).attr(`y`,function(e){return r.dataPos(e.x0)}).attr(`width`,this.width()).attr(`height`,function(e){return r.dataPos(e.x0)-r.dataPos(e.x1)}).style(`stroke`,function(e){return r._palette(e.colorID)}).style(`fill`,function(e){return(0,o.hsl)(r._palette(e.colorID)).brighter()}),i.exit().remove()}_prevXAxisType;update(e,t){this.selectionGlow(!this.tabNavigation()),super.update(e,t);let n=this,r=this.orientation()===`horizontal`;switch(this.updateRegions(e,t,r),this.domainAxis.orientation(r?`bottom`:`left`).title(this.xAxisTitle_exists()?this.xAxisTitle():this.columns()[0]),this.valueAxis.orientation(r?`left`:`bottom`),this.xAxis=r?this.domainAxis:this.valueAxis,this.yAxis=r?this.valueAxis:this.domainAxis,this.xAxisType()){case`ordinal`:let e=this.columns().length,t={};this.domainAxis.ordinals(this.data().map(function(r){return t[r[0]]=n.xAxisOrdinalMapping(r,r[e]),r[0]})).ordinalMappings(t);break;default:let r=this.xAxisDomainLow()?this.xAxisDomainLow():this.domainAxis.parseInvert((0,o.min)(this.parsedData(),function(e){return e[0]})),i=this.xAxisDomainHigh()?this.xAxisDomainHigh():this.domainAxis.parseInvert((0,o.max)(this.parsedData(),function(e){return e[0]}));r!==void 0&&i!==void 0&&this.domainAxis.low(r).high(i);break}let i=this.yAxisDomainLow()?this.yAxisDomainLow():this.valueAxis.parseInvert((0,o.min)(this.parsedData(),function(e){return(0,o.min)(e.filter(function(e,t){return t>0&&n.columns()[t]&&n.columns()[t].indexOf(`__`)!==0&&e!==null}),function(e){return e instanceof Array?e[0]:e})})),a=this.yAxisDomainHigh()?this.yAxisDomainHigh():this.valueAxis.parseInvert((0,o.max)(this.parsedData(),function(e){return(0,o.max)(e.filter(function(e,t){return t>0&&n.columns()[t]&&n.columns()[t].indexOf(`__`)!==0&&e!==null}),function(e){return e instanceof Array?e[1]:e})}));this.valueAxis.low(i).high(a),this.margin=this.calcMargin(e,t,r);let s=this.width()-this.margin.left-this.margin.right;s<0&&(s=0);let c=this.height()-this.margin.top-this.margin.bottom;c<0&&(c=0);let l=r?s:c,u=r?c:s;if(this.domainAxis.tickLength(this.xAxisGuideLines()?u:0).render(),this.valueAxis.tickLength(this.yAxisGuideLines()?l:0).render(),this.svgDataClipRect.attr(`width`,s).attr(`height`,c),this.svgData.transition().attr(`transform`,`translate(`+this.margin.left+`,`+this.margin.top+`)`),this.updateBrush(s,c,l,r),this.updateFocusChart(e,t,this.margin,s,c,r),this.chartsUpdate(s,c,250),this.selectionMode())return this.brushMoved()}updateBrush(e,t,n,r){let i=this.use2dSelection()?this.xyBrush:r?this.xBrush:this.yBrush,a=(0,o.brushSelection)(this.svgBrush.node());i.extent([[0,0],[e,t]]),this.svgBrush.attr(`transform`,`translate(`+this.margin.left+`, `+this.margin.top+`)`).style(`display`,this.selectionMode()?null:`none`).call(i);let s=this.use2dSelection()?[]:r?[{type:`w`},{type:`e`}]:[{type:`n`},{type:`s`}],c=this.svgBrush.selectAll(`.handle--custom`).data(s);if(c.enter().append(`path`).attr(`class`,`handle--custom`).merge(c).attr(`cursor`,r?`ew-resize`:`ns-resize`).attr(`d`,n=>this.resizeBrushHandle(n,e,t)),this.selectionMode()){if(this._prevXAxisType!==this.xAxisType()&&(this._prevXAxisType=this.xAxisType(),this._prevBrush=null),this._prevBrush){if(a){if(this._prevBrush.orientation!==this.orientation()){let e=a[0];a[0]=this._prevBrush.maxCurrExtent-a[1],a[1]=this._prevBrush.maxCurrExtent-e}let e=n/this._prevBrush.maxCurrExtent;e!==1&&this.svgBrush.transition().on(`start`,function(){i.on(`end`,null)}).call(i.move,[a[0]*e,a[1]*e]).on(`end`,()=>{i.on(`end`,()=>this.brushMoved())})}}else this.svgBrush.call(i.move,[0,n]);this._prevBrush={orientation:this.orientation(),maxCurrExtent:n}}}updateFocusChart(e,t,n,r,i,a){let o=this,s=this.svgFocus.selectAll(`#`+this.id()+`_focusChart`).data(this.xAxisFocus()?[!0]:[]);s.enter().append(`g`).attr(`id`,this.id()+`_focusChart`).attr(`class`,`focus`).each(function(){o.focusChart=new o.constructor().target(this),o.focusChart.xBrush.on(`brush.focus`,function(){o.syncAxis(r),o.chartsUpdate(r,i,0)}),o.focusChart.layers(o.layers().map(e=>new e.constructor))}).merge(s).each(function(){o.copyPropsTo(o.focusChart,[`layers`]);let e=0;for(let t of o.layers())t.copyPropsTo(o.focusChart.layers()[e]),e++;o.focusChart.xAxisFocus(!1).selectionMode(!0).skipSelection(!0).orientation(`horizontal`).xAxisGuideLines(!1).xAxisDomainLow(null).xAxisDomainHigh(null).yAxisGuideLines(!1).x(o.width()/2).y(o.height()-o.xAxisFocusHeight()/2).width(o.width()).height(o.xAxisFocusHeight()).columns(o.columns()).data(o.data()).render(),o.syncAxis(r)}),s.exit().each(function(){o.focusChart&&(o.focusChart.target(null),delete o.focusChart)}).remove()}syncAxis(e){let t=(0,o.brushSelection)(this.focusChart.svgBrush.node());if(t){if(this.focusChart.xAxisType()!==`ordinal`)this.xAxis.domain([this.focusChart.xAxis.invert(t[0]),this.focusChart.xAxis.invert(t[1])]);else{let n=(t[1]-t[0])/e;this.xAxis.range([-t[0]/n,(e-t[0])/n])}this.xAxis.rerender()}}layerColumns(e){let t=e.columns(),n=super.columns().filter(e=>e!==t[0]);return n.length?[t[0],...n]:t}layerColumnIndices(e){let t=e.columns();return this.layerColumns(e).map(e=>t.indexOf(e))}layerColumnIndex(e,t){return e.columns().indexOf(t)}layerData(e){if(arguments.length===1){let t=this.layerColumnIndices(e);return e.data().map(e=>{let n=t.map(t=>e[t]);return n.__hpcc_origRow=e,n})}throw Error(`Setting data on XYAxisLayer is not supported.`)}layerEnter(e,t,n=250){}layerUpdate(e,t,n=250){}layerExit(e,t,n=250){}chartsEnter(e,t,n=250){this.layerEnter(this,t,n);for(let e of this.layers())e.__xyAxisElement=t.append(`g`).attr(`class`,e.class()),e.target(e.__xyAxisElement.node()).layerEnter(this,t,n)}chartsUpdate(e,t,n){this.layerUpdate(this,this.svgData,n);for(let r of this.layers())r.resize({width:e,height:t}).layerUpdate(this,r.__xyAxisElement,n)}exit(e,t){this.valueAxis.target(null),this.domainAxis.target(null),super.exit(e,t)}selection(e){let t=this;this._selection.widgetElement().selectAll(`.selected,.deselected`).each(function(n){let r=e.indexOf(n.origRow)>=0;(0,o.select)(this).classed(`selected`,r).classed(`deselected`,!r).attr(`filter`,t._selection.svgGlowID()&&r?`url(#${t._selection.svgGlowID()})`:null)});let n=e.map(e=>this.rowToObj(e));setTimeout(()=>{this.click(n,``,!0)},0)}xAxisOrdinalMapping(e,t){return e[0]}click(e,t,n){}_selection};XYAxis.prototype._class+=` chart_XYAxis`,XYAxis.prototype.mixin(o.Utility.SimpleSelectionMixin),XYAxis.prototype.publish(`orientation`,`horizontal`,`set`,`Selects orientation for the axis`,[`horizontal`,`vertical`]),XYAxis.prototype.publish(`pointSizeColumn`,null,`string`,`pointSizeColumn`,null,{optional:!0}),XYAxis.prototype.publish(`minPointSize`,6,`number`,`minPointSize`),XYAxis.prototype.publish(`maxPointSize`,26,`number`,`maxPointSize`),XYAxis.prototype.publish(`use2dSelection`,!1,`boolean`,`2D Range Selector`),XYAxis.prototype.publish(`selectionMode`,!1,`boolean`,`Range Selector`),XYAxis.prototype.publishProxy(`xAxisTitle`,`domainAxis`,`title`),XYAxis.prototype.publishProxy(`xAxisTickCount`,`domainAxis`,`tickCount`),XYAxis.prototype.publishProxy(`xAxisTickFormat`,`domainAxis`,`tickFormat`),XYAxis.prototype.publishProxy(`xAxisTicks`,`domainAxis`,`ticks`),XYAxis.prototype.publishProxy(`xAxisType`,`domainAxis`,`type`),XYAxis.prototype.publishProxy(`xAxisTypeTimePattern`,`domainAxis`,`timePattern`),XYAxis.prototype.publish(`xAxisDomainLow`,null,`string`,`X-Axis Low`,null,{optional:!0,disable:e=>e.xAxisType()===`ordinal`}),XYAxis.prototype.publish(`xAxisDomainHigh`,null,`string`,`X-Axis High`,null,{optional:!0,disable:e=>e.xAxisType()===`ordinal`}),XYAxis.prototype.publishProxy(`xAxisFontSize`,`domainAxis`,`fontSize`),XYAxis.prototype.publishProxy(`xAxisFontFamily`,`domainAxis`,`fontFamily`),XYAxis.prototype.publishProxy(`xAxisOrdinalPaddingInner`,`domainAxis`,`ordinalPaddingInner`),XYAxis.prototype.publishProxy(`xAxisOrdinalPaddingOuter`,`domainAxis`,`ordinalPaddingOuter`),XYAxis.prototype.publishProxy(`xAxisOverlapMode`,`domainAxis`,`overlapMode`),XYAxis.prototype.publishProxy(`xAxisLabelRotation`,`domainAxis`,`labelRotation`),XYAxis.prototype.publishProxy(`xAxisDomainPadding`,`domainAxis`,`extend`),XYAxis.prototype.publish(`xAxisGuideLines`,!1,`boolean`,`Y-Axis Guide Lines`),XYAxis.prototype.publish(`xAxisFocus`,!1,`boolean`,`X-Axis Focus`,null,{disable:e=>e.orientation()!==`horizontal`}),XYAxis.prototype.publish(`xAxisFocusHeight`,80,`number`,`X-Axis Focus Height`,null,{disable:e=>!e.xAxisFocus()}),XYAxis.prototype.publishProxy(`xAxisHidden`,`domainAxis`,`hidden`),XYAxis.prototype.publishProxy(`yAxisFontSize`,`valueAxis`,`fontSize`),XYAxis.prototype.publishProxy(`yAxisFontFamily`,`valueAxis`,`fontFamily`),XYAxis.prototype.publishProxy(`yAxisTitle`,`valueAxis`,`title`),XYAxis.prototype.publishProxy(`yAxisTickCount`,`valueAxis`,`tickCount`),XYAxis.prototype.publishProxy(`yAxisTickFormat`,`valueAxis`,`tickFormat`),XYAxis.prototype.publishProxy(`yAxisTicks`,`valueAxis`,`ticks`),XYAxis.prototype.publishProxy(`yAxisType`,`valueAxis`,`type`),XYAxis.prototype.publishProxy(`yAxisTypeTimePattern`,`valueAxis`,`timePattern`),XYAxis.prototype.publishProxy(`yAxisTypePowExponent`,`valueAxis`,`powExponent`),XYAxis.prototype.publishProxy(`yAxisTypeLogBase`,`valueAxis`,`logBase`),XYAxis.prototype.publish(`yAxisStacked`,!1,`boolean`,`Stacked Chart`,null,{tags:[`Basic`],disable:e=>e.xAxisType()!==`ordinal`||e._class.indexOf(`chart_Column`)<0}),XYAxis.prototype.publish(`yAxisDomainLow`,null,`string`,`Y-Axis Low`,null,{optional:!0,disable:e=>e.yAxisType()===`ordinal`}),XYAxis.prototype.publish(`yAxisDomainHigh`,null,`string`,`Y-Axis High`,null,{optional:!0,disable:e=>e.yAxisType()===`ordinal`}),XYAxis.prototype.publishProxy(`yAxisDomainPadding`,`valueAxis`,`extend`),XYAxis.prototype.publish(`yAxisGuideLines`,!0,`boolean`,`Y-Axis Guide Lines`),XYAxis.prototype.publishProxy(`yAxisHidden`,`valueAxis`,`hidden`),XYAxis.prototype.publish(`regions`,[],`array`,`Regions`),XYAxis.prototype.publish(`layers`,[],`widgetArray`,`Layers`,null,{render:!1}),XYAxis.prototype.publishProxy(`xAxisPadding`,`domainAxis`,`padding`),XYAxis.prototype.publishProxy(`yAxisPadding`,`valueAxis`,`padding`),XYAxis.prototype.publish(`tabNavigation`,!1,`boolean`,`Enable or disable tab navigation`);var Scatter=class extends XYAxis{static __inputs=[{id:`label`,type:`any`},{id:`values`,type:`number`,multi:!0}];constructor(){super(),INDChart.call(this),ITooltip.call(this),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}xPos(e,t){return e.orientation()===`horizontal`?e.dataPos(t.label):e.valuePos(t.value)}yPos(e,t){return e.orientation()===`horizontal`?e.valuePos(t.value):e.dataPos(t.label)}curve(){switch(this.interpolate()){case`linear`:return linear_default$1;case`step`:return step_default;case`step-before`:return stepBefore;case`step-after`:return stepAfter;case`basis`:return basis_default;case`bundle`:return F;case`cardinal`:return I;case`catmullRom`:return L;case`natural`:return natural_default;default:return monotoneX}}getScale(){switch(this.pointSizeScale()){case`linear`:return(0,o.scaleLinear)();case`pow`:return(0,o.scalePow)().exponent(2);case`log`:return(0,o.scaleLog)();case`sqrt`:return(0,o.scaleSqrt)()}}pointColor(e,t,n,r){return this.interpolate()&&this.pointDarken()?this.strokeColor(e,t,n,r):this.fillColor(e,t,n,r)}lineColor(e,t,n,r){return this.interpolateFill()&&this.interpolateDarken()?this.strokeColor(e,t,n,r):this.fillColor(e,t,n,r)}areaColor(e,t,n,r){return this.fillColor(e,t,n,r)}layerEnter(e,t,n=250){super.layerEnter(e,t,n);let r=this;this.tooltipHTML(function(e){switch(r.tooltipStyle()){case`series-table`:return r.tooltipFormat({label:e.label,arr:r.columns().slice(1).map(function(t,n){return{label:t,color:r._palette(t),value:r.data()[e.rowIdx][n+1]}})});default:return r.tooltipFormat({label:e.label,series:e.column,value:e.value})}})}_prevPointShape;layerUpdate(e,t,n=250){super.layerUpdate(e,t);let r=e.orientation()===`horizontal`,i=r?this.height():this.width(),a=this;this.tabNavigation()&&e.parentRelativeDiv?e.parentRelativeDiv.attr(`tabindex`,`0`).attr(`role`,`group`).attr(`aria-label`,`${this.columns()[0]||`Chart`} data`):e.parentRelativeDiv&&e.parentRelativeDiv.attr(`tabindex`,null).attr(`role`,null).attr(`aria-label`,null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._prevPointShape!==this.pointShape()&&(t.selectAll(`.data`).remove(),this._prevPointShape=this.pointShape());function mapShape(e){switch(e){case`rectangle`:return`rect`;case`circle`:return`circle`;case`cross`:return`path`;default:}}let s=this.pointSizeColumn_exists(),c,l,u;s&&(c=this.columns().indexOf(this.pointSizeColumn()),l=(0,o.extent)(this.data(),e=>e[c]),u=this.getScale().domain(l));let d=this.layerColumns(e),f=this.layerData(e),p=this.flattenData(d,f).map(function(e){return e.shape=mapShape(a.pointShape()),e.column=d[e.colIdx],e.row=f[e.rowIdx],e.origRow=f[e.rowIdx].__hpcc_origRow,l?(e.size=u(e.row[c])*(a.maxPointSize()-a.minPointSize())+a.minPointSize(),e.column!==a.pointSizeColumn()&&e):(e.size=a.pointSize(),e)}).filter(e=>e),m=t.selectAll(`.area`).data(d.filter(function(e,t){return a.interpolate()&&a.interpolateFill()&&t>0})),h=m.enter().append(`path`),g=area_default$1().curve(this.curve());r?g.x(function(t){return a.xPos(e,t)}).y0(Math.min(i,this.yPos(e,{value:0}))).y1(function(t){return a.yPos(e,t)}):g.y(function(t){return a.yPos(e,t)}).x0(Math.max(0,this.xPos(e,{value:0}))).x1(function(t){return a.xPos(e,t)}),h.merge(m).attr(`class`,e=>`area series series-`+this.cssTag(e)).each(function(e,t){(0,o.select)(this).attr(`d`,g(p.filter(function(e){return e.colIdx===t+1}))).style(`opacity`,a.interpolateFillOpacity()).style(`stroke`,`none`).style(`fill`,a.areaColor([],e,void 0,[]))}),m.exit().remove();let _=t.selectAll(`.line`).data(d.filter(function(e,t){return a.interpolate()&&t>0})),v=_.enter().append(`path`),b=line_default$1().x(function(t){return a.xPos(e,t)}).y(function(t){return a.yPos(e,t)}).curve(this.curve());v.merge(_).attr(`class`,e=>`line series series-`+this.cssTag(e)).each(function(e,t){let n=(0,o.select)(this),r=p.filter(function(e){return e.colIdx===t+1});n.attr(`d`,b(r)).style(`stroke`,a.lineColor([],e,void 0,[])).style(`fill`,`none`)}),_.exit().remove();let S=t.selectAll(`.point`).data(p,function(e,t){return e.shape+`_`+t});S.enter().append(`g`).each(function(t){let n=(0,o.select)(this);n.append(t.shape).attr(`class`,`pointShape`),n.append(`text`).attr(`class`,`pointValue`).style(`display`,`none`).attr(`text-anchor`,a.valueAnchor()).attr(`alignment-baseline`,a.valueBaseline()).attr(`fill`,function(e,t){return a.valueBaseline()===`middle`||a.valueBaseline()===`central`?a.textColor(e.row,e.column,e.value,e.origRow):null}),n.append(`circle`).attr(`class`,`pointSelection`).on(`mouseout.tooltip`,a.tooltip.hide).on(`mousemove.tooltip`,a.tooltip.show).call(e._selection.enter.bind(e._selection)).on(`click`,function(t,n){a.click(e.rowToObj(e.data()[t.rowIdx]),t.column,e._selection.selected(this))}).on(`dblclick`,function(t,n){a.dblclick(e.rowToObj(e.data()[t.rowIdx]),t.column,e._selection.selected(this))}).on(`keydown`,function(t,n){if(a.tabNavigation()){let t=(0,o.d3Event)();(t.code===`Space`||t.key===`Enter`)&&(t.preventDefault(),e._selection.click(this))}})}).merge(S).attr(`class`,e=>`point series series-`+this.cssTag(e.column)).each(function(t){(0,o.select)(this).select(`.pointValue`).attr(`x`,function(t){return a.xPos(e,t)}).attr(`y`,function(t){return a.yPos(e,t)}).style(`display`,a.showValue()?`block`:`none`).attr(`text-anchor`,a.valueAnchor()).attr(`alignment-baseline`,a.valueBaseline()).text(function(e){return e.value}),(0,o.select)(this).select(`.pointSelection`).attr(`cx`,function(t){return a.xPos(e,t)}).attr(`cy`,function(t){return a.yPos(e,t)}).attr(`r`,t.size).attr(`tabindex`,a.tabNavigation()?0:null).attr(`role`,a.tabNavigation()?`button`:null).attr(`aria-label`,a.tabNavigation()?e=>`${e.column||`Value`}: ${e.value} @ ${e.label}`:null);let n=(0,o.select)(this).select(`.pointShape`);switch(t.shape){case`rect`:n.attr(`x`,function(n){return a.xPos(e,n)-t.size/2}).attr(`y`,function(n){return a.yPos(e,n)-t.size/2}).attr(`width`,t.size).attr(`height`,t.size).style(`fill`,a.pointColor(t.row,t.column,t.value,t.origRow));break;case`circle`:n.attr(`cx`,function(t){return a.xPos(e,t)}).attr(`cy`,function(t){return a.yPos(e,t)}).attr(`r`,t.size*.9).style(`fill`,a.pointColor(t.row,t.column,t.value,t.origRow));break;case`path`:n.attr(`d`,function(n){return`M`+(a.xPos(e,n)-t.size/2)+` `+(a.yPos(e,n)-t.size/2)+` L`+(a.xPos(e,n)+t.size/2)+` `+(a.yPos(e,n)+t.size/2)+` M`+(a.xPos(e,n)-t.size/2)+` `+(a.yPos(e,n)+t.size/2)+` L`+(a.xPos(e,n)+t.size/2)+` `+(a.yPos(e,n)-t.size/2)}).style(`stroke`,a.pointColor(t.row,t.column,t.value,t.origRow));break;default:}}),S.exit().remove()}exit(e,t){super.exit(e,t)}};Scatter.prototype._class+=` chart_Scatter`,Scatter.prototype.implements(INDChart.prototype),Scatter.prototype.implements(ITooltip.prototype),Scatter.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Scatter.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Scatter.prototype.publish(`pointSizeScale`,`linear`,`set`,`pointSizeScale`,[`linear`,`pow`,`log`,`sqrt`]),Scatter.prototype.publish(`pointShape`,`cross`,`set`,`Shape of the data points`,[`circle`,`rectangle`,`cross`]),Scatter.prototype.publish(`pointSize`,6,`number`,`Point Size`,null,{range:{min:1,step:1,max:200}}),Scatter.prototype.publish(`interpolate`,``,`set`,`Interpolate Data`,[``,`linear`,`step`,`step-before`,`step-after`,`basis`,`bundle`,`cardinal`,`catmullRom`,`natural`,`monotone`]),Scatter.prototype.publish(`pointDarken`,!0,`boolean`,`If true, and interpolate is set, then points will have a slightly darker color than their assigned palette color`,null,{disable:e=>!e.interpolate()}),Scatter.prototype.publish(`interpolateDarken`,!0,`boolean`,`If true, and interpolateFill is true, then lines will have a slightly darker color than their assigned palette color`,null,{disable:e=>!e.interpolateFill()}),Scatter.prototype.publish(`interpolateFill`,!1,`boolean`,`If true, the area between the line and zero will be filled`),Scatter.prototype.publish(`interpolateFillOpacity`,.66,`number`,`Fill interpolation Opacity`,null,{range:{min:0,step:.01,max:1}}),Scatter.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Scatter.prototype.publish(`showValue`,!1,`boolean`),Scatter.prototype.publish(`valueAnchor`,`middle`,`set`,`text-anchor for shown value text`,[`start`,`middle`,`end`]),Scatter.prototype.publish(`valueBaseline`,`ideographic`,`set`,`alignment-baseline for shown value text`,[`auto`,`baseline`,`before-edge`,`text-before-edge`,`middle`,`central`,`after-edge`,`text-after-edge`,`ideographic`,`alphabetic`,`hanging`,`mathematical`,`inherit`]);var Area=class extends Scatter{constructor(){super(),this.interpolate_default(`linear`).interpolateFill_default(!0)}};Area.prototype._class+=` chart_Area`;var Column=class extends XYAxis{static __inputs=[{id:`label`,type:`string`},{id:`values`,type:`number`,multi:!0}];_linearGap;textLocal=(0,o.local)();stackedTextLocal=(0,o.local)();isHorizontal;constructor(){super(),INDChart.call(this),ITooltip.call(this),this._selection.skipBringToTop(!0),this._linearGap=25}layerEnter(e,t,n=250){super.layerEnter(e,t,n);let r=this;this.tooltipHTML(function(t){switch(r.tooltipStyle()){case`series-table`:return r.tooltipFormat({label:t.row[0],arr:r.columns().slice(1).map(function(e,n){return{label:e,color:r._palette(e),value:t.row[n+1]}})});default:let n=t.row[t.idx];return n instanceof Array&&(n=n[1]-n[0]),r.tooltipFormat({label:t.row[0],series:r.layerColumns(e)[t.idx],value:n})}})}adjustedData(e){return this.layerData(e).map(t=>{let n=0;return t.map((t,r)=>{if(r===0||r>=this.layerColumns(e).length)return t;let i=e.yAxisStacked()?[n,n+t]:t;return n+=t,i},this)},this)}layerUpdate(e,t,n=250){super.layerUpdate(e,t,n);let r=e.orientation()===`horizontal`;this.isHorizontal=r;let i=this;this.tabNavigation()&&e.parentRelativeDiv?e.parentRelativeDiv.attr(`tabindex`,`0`).attr(`role`,`group`).attr(`aria-label`,`${this.columns()[0]||`Chart`} data`):e.parentRelativeDiv&&e.parentRelativeDiv.attr(`tabindex`,null).attr(`role`,null).attr(`aria-label`,null),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id()));let a=(0,o.format)(i.showValueAsPercentFormat()),s=10,c=0;switch(e.xAxisType()){case`ordinal`:s=e.bandwidth(),c=-s/2;break;case`linear`:case`time`:s=Math.max(Math.abs(e.dataPos(2)-e.dataPos(1))*(100-this._linearGap)/100,s),c=-s/2;break;default:}this.tooltip.direction(r?`n`:`e`);let l=(0,o.scaleBand)().domain(i.layerColumns(e).filter(function(e,t){return t>0})).rangeRound(r?[0,s]:[s,0]).paddingInner(Math.max(this.xAxisSeriesPaddingInner(),.05)).paddingOuter(0),u=[],d=[],f=this.columns().length,p=this.data();this.showValue()&&this.showValueAsPercent()===`series`&&p.forEach(e=>{e.filter((e,t)=>t>0&&t<f).forEach((e,t)=>{d[t+1]===void 0&&(d[t+1]=0),d[t+1]+=e})}),(this.showDomainTotal()||this.showValue()&&this.showValueAsPercent()===`domain`)&&(u=p.map(e=>e.filter((e,t)=>t>0&&t<f).reduce((e,t)=>e+t,0)));let m=t.selectAll(`.dataRow`).data(this.adjustedData(e)),h=e.data(),g=this.getAxisSize(e);m.enter().append(`g`).attr(`class`,`dataRow`).merge(m).each(function(t,p){let m=(0,o.select)(this),_=m.selectAll(`.dataCell`).data(t.filter(function(t,n){return n<i.layerColumns(e).length}).map(function(n,r){return{column:i.layerColumns(e)[r],row:t,origRow:h[p],value:n,idx:r}}).filter(function(e){return e.value!==null&&e.idx>0}),e=>e.column),v=_.enter().append(`g`).attr(`class`,`dataCell`).on(`mouseout.tooltip`,function(e){(!i.tooltipInnerTextEllipsedOnly()||e.innerTextObj&&e.innerTextObj.isTruncated)&&i.tooltip.hide.apply(i,arguments)}).on(`mousemove.tooltip`,function(e){(!i.tooltipInnerTextEllipsedOnly()||e.innerTextObj&&e.innerTextObj.isTruncated)&&i.tooltip.show.apply(i,arguments)}).call(e._selection.enter.bind(e._selection)).on(`click`,function(t){i.click(e.rowToObj(t.origRow),t.column,e._selection.selected(this))}).on(`dblclick`,function(t){i.dblclick(e.rowToObj(t.origRow),t.column,e._selection.selected(this))}).on(`keydown`,function(t,n){if(i.tabNavigation()){let t=(0,o.d3Event)();(t.code===`Space`||t.key===`Enter`)&&(t.preventDefault(),e._selection.click(this))}}).style(`opacity`,0).each(function(e){let t=(0,o.select)(this);t.append(`rect`).attr(`class`,`columnRect series series-`+i.cssTag(e.column)),t.append(`text`).attr(`class`,`columnRectText`).style(`stroke`,`transparent`)});v.transition().duration(n).style(`opacity`,1);let b=e.yAxisStacked()?s:l.bandwidth();v.merge(_).attr(`tabindex`,i.tabNavigation()?0:null).attr(`role`,i.tabNavigation()?`button`:null).attr(`aria-label`,i.tabNavigation()?e=>`${e.origRow[0]} - ${e.column}: ${e.value instanceof Array?e.value[1]-e.value[0]:e.value}`:null).each(function(s){let m=(0,o.select)(this),h=e.dataPos(t[0])+(e.yAxisStacked()?0:l(s.column))+c,_=s.value instanceof Array?s.value[1]:s.value,v=s.origRow[s.idx];if(i.showValue()){let e=i.dataMeta();switch(i.showValueAsPercent()){case`series`:let t=e.sum===void 0?d[s.idx]:e.sum;v=a(v/t);break;case`domain`:let n=e.sum===void 0?u[p]:e.sum;v=a(v/n);break;default:v=(0,o.format)(i.showValueFormat())(v);break}}let S=e.valuePos(_),C=e.valuePos(s.value instanceof Array?s.value[0]:0),w=Math.min(C,S),T=Math.abs(S-C),E=i.innerTextFontSize(),D=i.innerTextPadding_exists()?i.innerTextPadding():E/2.5,O=i.intersectRectRect({x:r?h:w,y:r?w:h,width:r?b:T,height:r?T:b},{x:0,y:0,width:g.width,height:g.height}),k=m.select(`rect`).transition().duration(n).style(`fill`,e=>i.fillColor(e.row,e.column,e.value,e.origRow));r?k.attr(`x`,h).attr(`y`,w).attr(`width`,b).attr(`height`,T):k.attr(`y`,h).attr(`x`,w).attr(`height`,b).attr(`width`,T);let A=m.select(`text`).transition().duration(n).style(`font-size`,E+`px`).style(`fill`,e=>i.textColor(e.row,e.column,e.value,e.origRow));A.style(`font-family`,i.innerTextFontFamily_exists()?i.innerTextFontFamily():null);let j=i.innerTextPadding_exists()?i.innerTextPadding():8,M=E/2.7;if(r){let e=O.y+O.height-D;A.attr(`x`,h+b/2).attr(`y`,e+M).attr(`transform`,`rotate(-90, ${h+b/2}, ${e})`)}else A.attr(`x`,O.x+j).attr(`y`,h+b/2+M);A.attr(`height`,b).attr(`width`,T),i.showInnerText()&&A.text(e=>{let t=i.innerText(e.origRow,e.origRow[f],e.idx);if(t){let n=r?O.height:O.width,a=i.calcInnerText(n,t,v);return e.innerTextObj=a,a.text}return``});let N=m.selectAll(`.dataText`).data(i.showValue()?[`${_}`]:[]);N.enter().append(`g`).attr(`class`,`dataText`).each(function(e){i.textLocal.set(this,new o.Text().target(this).colorStroke_default(`transparent`))}).merge(N).each(function(){let e={x:0,y:0},t=i.valueFontFamily(),n=i.valueFontSize(),a=i.textSize(v,t,n),o=parseFloat(v)>=0,c=i.valueAnchor()?i.valueAnchor():r?`middle`:`start`,l=O.x,u=g.width-(O.x+O.width),d=O.y,f=g.height-(O.y+O.height),p,m,_;if(s.innerTextObj){let{padding:t,valueTextWidth:i}=s.innerTextObj;m=!1,r?(c=`middle`,e.x=h+b/2,s.innerTextObj.category===4?(m=!0,e.y=w-t-n/2):e.y=w+t+n/2):(c=`start`,s.innerTextObj.category===4?(m=!0,e.x=T+w+t):e.x=T+w-i-t,e.y=h+b/2)}else r?(p=O.height<a.height,m=!i.valueCentered()||p,e.x=O.x+O.width/2,m?o?(_=d<a.height+j,_?p?e.y=O.y+O.height+a.height:(m=!1,e.y=O.y+O.height/2):e.y=O.y-a.height/2-j):(_=f<a.height,_?p?e.y=O.y-a.height/2-j:(m=!1,e.y=O.y+O.height/2):e.y=O.y+a.height+j):e.y=O.y+O.height/2):(p=O.width<a.width,m=!i.valueCentered()||p,e.y=O.y+O.height/2,m?o?(_=u<a.width+j,_?i.showInnerText()||!p?(m=!1,e.x=O.x+O.width/2):e.x=O.x-(a.width-j):e.x=O.x+O.width+a.width/2+j):(_=l<a.width,_?i.showInnerText()||!p?(m=!1,e.x=O.x+O.width/2):e.x=O.x+O.width+(a.width-j):e.x=O.x-(a.width-j)):e.x=O.x+O.width/2);let S=m?null:i.textColor(s.row,s.column,s.value,s.origRow),C=i.columns(),E=i.yAxisStacked()&&p||m&&i.yAxisStacked()&&C.indexOf(s.column)!==C.length-1;i.textLocal.get(this).pos(e).anchor(c).fontFamily(t).fontSize(n).text(`${v}`).colorFill(S).visible(i.showValue()&&!E).render()}),N.exit().each(function(e){i.textLocal.get(this).target(null)}).remove()}),_.exit().transition().duration(n).style(`opacity`,0).remove();let S=e.yAxisStacked()?u[p]:Math.max(...t.filter((e,t)=>t>0&&t<f)),C=m.selectAll(`.stackedTotalText`).data(i.showDomainTotal()?[u[p]]:[]);C.enter().append(`g`).attr(`class`,`stackedTotalText`).each(function(e){i.stackedTextLocal.set(this,new o.Text().target(this).colorStroke_default(`transparent`))}).merge(C).each(function(n){let a={x:0,y:0},o=e.dataPos(t[0]),s=e.valuePos(S),c=i.valueFontFamily(),l=i.valueFontSize(),u=i.textSize(n,c,l),d=parseFloat(n)>=0,f=`middle`;r?(a.x=o,d?a.y=s-u.height/2:a.y=s+u.height/2):(f=`start`,a.y=o,d?a.x=s+u.width/2:a.x=s-u.width/2),i.stackedTextLocal.get(this).pos(a).anchor(f).fontFamily(c).fontSize(l).text(n).render()}),C.exit().each(function(e){i.textLocal.get(this).target(null)}).remove()}),m.exit().transition().duration(n).remove()}calcInnerText(e,t,n){let r=this.innerTextFontFamily_exists()?this.innerTextFontFamily():`Verdana`,i=this.innerTextFontSize(),a=this.valueFontFamily_exists()?this.valueFontFamily():`Verdana`,o=this.valueFontSize(),s=this.innerTextPadding_exists()?this.innerTextPadding():i/2.5,c=this.isHorizontal?o:this.textSize(n,a,o).width,l=this.textSize(`...`,r,i).width,u=this.textSize(t,r,i).width,d=t,f=s*3+u+c,p=s*3+l+c,m=s*1+c,h=4;if(f<e)h=1;else if(p<e){let n=e-p,a=``;for(let e of t)if(this.textSize(a+e,r,i).width>n){t=a+`...`;break}else a+=e;h=2}else m<e?(t=``,h=3):t=``;return{text:t,isTruncated:d!==t,padding:s,category:h,valueTextWidth:c}}innerText(e,t,n){return e[0]}};Column.prototype._class+=` chart_Column`,Column.prototype.implements(INDChart.prototype),Column.prototype.implements(ITooltip.prototype),Column.prototype.publish(`valueFontFamily`,null,`string`,`Font family of value text`,null,{optional:!0}),Column.prototype.publish(`valueFontSize`,12,`number`,`Height of value text (pixels)`),Column.prototype.publish(`innerTextFontFamily`,null,`string`,`Font family of inner text`,null,{optional:!0}),Column.prototype.publish(`innerTextPadding`,8,`number`,`Offset of inner text (pixels)`,null,{optional:!0}),Column.prototype.publish(`innerTextFontSize`,12,`number`,`Height of inner text (pixels)`),Column.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,()=>Column.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Column.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Column.prototype.publish(`showValue`,!1,`boolean`,`Show Value in column`),Column.prototype.publish(`showInnerText`,!1,`boolean`,`Show Label in column`),Column.prototype.publish(`showValueFormat`,`,`,`string`,`D3 Format for Value`,null,{disable:e=>!e.showValue()||!!e.showValueAsPercent()}),Column.prototype.publish(`showValueAsPercent`,null,`set`,`If showValue is true, optionally show value as a percentage by Series or Domain`,[null,`series`,`domain`],{disable:e=>!e.showValue(),optional:!0}),Column.prototype.publish(`showValueAsPercentFormat`,`.0%`,`string`,`D3 Format for %`,null,{disable:e=>!e.showValue()||!e.showValueAsPercent()}),Column.prototype.publish(`showDomainTotal`,!1,`boolean`,`Show Total Value for Stacked Columns`,null),Column.prototype.publish(`valueCentered`,!1,`boolean`,`Show Value in center of column`),Column.prototype.publish(`valueAnchor`,`middle`,`set`,`text-anchor for shown value text`,[`start`,`middle`,`end`]),Column.prototype.publish(`xAxisSeriesPaddingInner`,0,`number`,`Determines the ratio of the range that is reserved for blank space between band (0->1)`),Column.prototype.publish(`tooltipInnerTextEllipsedOnly`,!1,`boolean`,`Show tooltip only when inner text is truncated with an ellipsis`);var Bar=class extends Column{constructor(){super(),this.orientation_default(`vertical`)}};Bar.prototype._class+=` chart_Bar`;function count(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function count_default(){return this.eachAfter(count)}__name(count_default,`default`);function each_default(e){var t=this,n,r=[t],i,a,o;do for(n=r.reverse(),r=[];t=n.pop();)if(e(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)r.push(i[a]);while(r.length);return this}__name(each_default,`default`);function eachBefore_default(e){for(var t=this,n=[t],r,i;t=n.pop();)if(e(t),r=t.children,r)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}__name(eachBefore_default,`default`);function eachAfter_default(e){for(var t=this,n=[t],r=[],i,a,o;t=n.pop();)if(r.push(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)n.push(i[a]);for(;t=r.pop();)e(t);return this}__name(eachAfter_default,`default`);function sum_default(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}__name(sum_default,`default`);function sort_default(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}__name(sort_default,`default`);function path_default$1(e){for(var t=this,n=leastCommonAncestor(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}__name(path_default$1,`default`);function leastCommonAncestor(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function ancestors_default(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}__name(ancestors_default,`default`);function descendants_default(){var e=[];return this.each(function(t){e.push(t)}),e}__name(descendants_default,`default`);function leaves_default(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}__name(leaves_default,`default`);function links_default(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}__name(links_default,`default`);function hierarchy(e,t){var n=new Node$1(e),r=+e.value&&(n.value=e.value),i,a=[n],o,s,c,l;for(t??=defaultChildren;i=a.pop();)if(r&&(i.value=+i.data.value),(s=t(i.data))&&(l=s.length))for(i.children=Array(l),c=l-1;c>=0;--c)a.push(o=i.children[c]=new Node$1(s[c])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(computeHeight)}function node_copy(){return hierarchy(this).eachBefore(copyData)}function defaultChildren(e){return e.children}function copyData(e){e.data=e.data.data}function computeHeight(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Node$1(e){this.data=e,this.depth=this.height=0,this.parent=null}__name(Node$1,`Node`),Node$1.prototype=hierarchy.prototype={constructor:Node$1,count:count_default,each:each_default,eachAfter:eachAfter_default,eachBefore:eachBefore_default,sum:sum_default,sort:sort_default,path:path_default$1,ancestors:ancestors_default,descendants:descendants_default,leaves:leaves_default,links:links_default,copy:node_copy};var ee=Array.prototype.slice;function shuffle(e){for(var t=e.length,n,r;t;)r=Math.random()*t--|0,n=e[t],e[t]=e[r],e[r]=n;return e}function enclose_default(e){for(var t=0,n=(e=shuffle(ee.call(e))).length,r=[],i,a;t<n;)i=e[t],a&&enclosesWeak(a,i)?++t:(a=encloseBasis(r=extendBasis(r,i)),t=0);return a}__name(enclose_default,`default`);function extendBasis(e,t){var n,r;if(enclosesWeakAll(t,e))return[t];for(n=0;n<e.length;++n)if(enclosesNot(t,e[n])&&enclosesWeakAll(encloseBasis2(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(enclosesNot(encloseBasis2(e[n],e[r]),t)&&enclosesNot(encloseBasis2(e[n],t),e[r])&&enclosesNot(encloseBasis2(e[r],t),e[n])&&enclosesWeakAll(encloseBasis3(e[n],e[r],t),e))return[e[n],e[r],t];throw Error()}function enclosesNot(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function enclosesWeak(e,t){var n=e.r-t.r+1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function enclosesWeakAll(e,t){for(var n=0;n<t.length;++n)if(!enclosesWeak(e,t[n]))return!1;return!0}function encloseBasis(e){switch(e.length){case 1:return encloseBasis1(e[0]);case 2:return encloseBasis2(e[0],e[1]);case 3:return encloseBasis3(e[0],e[1],e[2])}}function encloseBasis1(e){return{x:e.x,y:e.y,r:e.r}}function encloseBasis2(e,t){var n=e.x,r=e.y,i=e.r,a=t.x,o=t.y,s=t.r,c=a-n,l=o-r,u=s-i,d=Math.sqrt(c*c+l*l);return{x:(n+a+c/d*u)/2,y:(r+o+l/d*u)/2,r:(d+i+s)/2}}function encloseBasis3(e,t,n){var r=e.x,i=e.y,a=e.r,o=t.x,s=t.y,c=t.r,l=n.x,u=n.y,d=n.r,f=r-o,p=r-l,m=i-s,h=i-u,g=c-a,_=d-a,v=r*r+i*i-a*a,b=v-o*o-s*s+c*c,S=v-l*l-u*u+d*d,C=p*m-f*h,w=(m*S-h*b)/(C*2)-r,T=(h*g-m*_)/C,E=(p*b-f*S)/(C*2)-i,D=(f*_-p*g)/C,O=T*T+D*D-1,k=2*(a+w*T+E*D),A=w*w+E*E-a*a,j=-(O?(k+Math.sqrt(k*k-4*O*A))/(2*O):A/k);return{x:r+w+T*j,y:i+E+D*j,r:j}}function place(e,t,n){var r=e.x-t.x,i,a,o=e.y-t.y,s,c,l=r*r+o*o;l?(a=t.r+n.r,a*=a,c=e.r+n.r,c*=c,a>c?(i=(l+c-a)/(2*l),s=Math.sqrt(Math.max(0,c/l-i*i)),n.x=e.x-i*r-s*o,n.y=e.y-i*o+s*r):(i=(l+a-c)/(2*l),s=Math.sqrt(Math.max(0,a/l-i*i)),n.x=t.x+i*r-s*o,n.y=t.y+i*o+s*r)):(n.x=t.x+n.r,n.y=t.y)}function intersects(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function score(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function Node(e){this._=e,this.next=null,this.previous=null}function packEnclose(e){if(!(i=e.length))return 0;var t=e[0],n,r,i,a,o,s,c,l,u,d;if(t.x=0,t.y=0,!(i>1))return t.r;if(n=e[1],t.x=-n.r,n.x=t.r,n.y=0,!(i>2))return t.r+n.r;place(n,t,r=e[2]),t=new Node(t),n=new Node(n),r=new Node(r),t.next=r.previous=n,n.next=t.previous=r,r.next=n.previous=t;pack:for(s=3;s<i;++s){place(t._,n._,r=e[s]),r=new Node(r),c=n.next,l=t.previous,u=n._.r,d=t._.r;do if(u<=d){if(intersects(c._,r._)){n=c,t.next=n,n.previous=t,--s;continue pack}u+=c._.r,c=c.next}else{if(intersects(l._,r._)){t=l,t.next=n,n.previous=t,--s;continue pack}d+=l._.r,l=l.previous}while(c!==l.next);for(r.previous=t,r.next=n,t.next=n.previous=n=r,a=score(t);(r=r.next)!==n;)(o=score(r))<a&&(t=r,a=o);n=t.next}for(t=[n._],r=n;(r=r.next)!==n;)t.push(r._);for(r=enclose_default(t),s=0;s<i;++s)t=e[s],t.x-=r.x,t.y-=r.y;return r.r}function optional(e){return e==null?null:required(e)}function required(e){if(typeof e!=`function`)throw Error();return e}function constantZero(){return 0}function constant_default$2(e){return function(){return e}}__name(constant_default$2,`default`);function defaultRadius(e){return Math.sqrt(e.value)}function pack_default(){var e=null,t=1,n=1,r=constantZero;function pack(i){return i.x=t/2,i.y=n/2,e?i.eachBefore(radiusLeaf(e)).eachAfter(packChildren(r,.5)).eachBefore(translateChild(1)):i.eachBefore(radiusLeaf(defaultRadius)).eachAfter(packChildren(constantZero,1)).eachAfter(packChildren(r,i.r/Math.min(t,n))).eachBefore(translateChild(Math.min(t,n)/(2*i.r))),i}return pack.radius=function(t){return arguments.length?(e=optional(t),pack):e},pack.size=function(e){return arguments.length?(t=+e[0],n=+e[1],pack):[t,n]},pack.padding=function(e){return arguments.length?(r=typeof e==`function`?e:constant_default$2(+e),pack):r},pack}__name(pack_default,`default`);function radiusLeaf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function packChildren(e,t){return function(n){if(r=n.children){var r,i,a=r.length,o=e(n)*t||0,s;if(o)for(i=0;i<a;++i)r[i].r+=o;if(s=packEnclose(r),o)for(i=0;i<a;++i)r[i].r-=o;n.r=s+o}}}function translateChild(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}var Bubble=class extends o.SVGWidget{static __inputs=[{id:`label`,type:`string`},{id:`value`,type:`number`}];labelWidgets;d3Pack;constructor(){super(),I2DChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this),this._drawStartPos=`origin`,this.labelWidgets={},this.d3Pack=pack_default().size([this.width(),this.height()]).padding(1.5)}size(e){let t=super.size.apply(this,arguments);return arguments.length&&this.d3Pack.size([this.width(),this.height()]),t}enter(e,t){super.enter(e,t),this._selection.widgetElement(t);let n=this;this.tooltipHTML(function(e){switch(n.tooltipStyle()){case`series-table`:return n.tooltipFormat({label:e[0],arr:n.columns().slice(1).map(function(t,r){return{label:t,color:n._palette(e[0]),value:e[1]}})});default:return n.tooltipFormat({label:e.data[0],value:e.data[1]})}})}update(e,t){super.update(e,t);let n=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id()));let r=hierarchy({children:this.cloneData()}).sum(function(e){return e[1]}).sort(function(e,t){return t[1]<e[1]?-1:+(t[1]>e[1])});this.d3Pack(r);let i=t.selectAll(`.node`).data(r.children||[],e=>e.data[0]);i.enter().append(`g`).attr(`class`,(e,t)=>`node series series-`+this.cssTag(e.data[0])).attr(`opacity`,0).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n.click(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))}).on(`dblclick`,function(e){n.dblclick(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))}).each(function(e){let t=(0,o.select)(this),r={x:e.x,y:e.y};t.append(`circle`).attr(`transform`,`translate(`+r.x+`,`+r.y+`)`).attr(`r`,0).on(`mouseout.tooltip`,n.tooltip.hide).on(`mousemove.tooltip`,n.tooltip.show),e.__viz_faChar?n.labelWidgets[e.data[0]]=new o.FAChar().char(e.__viz_faChar).target(this).render():n.labelWidgets[e.data[0]]=new o.Text().text(e.data[0]).target(this).render()}).merge(i).transition().attr(`opacity`,1).each(function(e){let t=(0,o.select)(this),r={x:e.x,y:e.y};t.select(`circle`).transition().attr(`transform`,`translate(`+r.x+`,`+r.y+`)`).style(`fill`,n.fillColor(e.data,n.columns()[1],e.data[1])).attr(`r`,e.r).select(`title`).text(e.data[0]+` (`+e.data[1]+`)`),e.__viz_faChar?n.labelWidgets[e.data[0]].pos(r).render():n.labelWidgets[e.data[0]].pos(r).colorFill_default(n.textColor(e.data,n.columns()[1],e.data[1])).width(e.r*2).text(e.data[0]).render()}),i.exit().transition().style(`opacity`,0).remove()}exit(e,t){super.exit(e,t)}};Bubble.prototype._class+=` chart_Bubble`,Bubble.prototype.implements(I2DChart.prototype),Bubble.prototype.implements(ITooltip.prototype),Bubble.prototype.mixin(o.Utility.SimpleSelectionMixin),Bubble.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Bubble.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Bubble.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]});var BubbleXY=class extends Scatter{constructor(){super()}enter(e,t){this.pointSizeColumn_exists()||this.pointSizeColumn(this.columns()[this.columns().length-1]),super.enter(e,t)}};BubbleXY.prototype._class+=` chart_BubbleXY`;var W=0,G=0,te=0,ne=1e3,re,K,ie=0,ae=0,oe=0,se=typeof performance==`object`&&performance.now?performance:Date,ce=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function now(){return ae||=(ce(clearNow),se.now()+oe)}function clearNow(){ae=0}function Timer(){this._call=this._time=this._next=null}Timer.prototype=timer.prototype={constructor:Timer,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?now():+n)+(t==null?0:+t),!this._next&&K!==this&&(K?K._next=this:re=this,K=this),this._call=e,this._time=n,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}};function timer(e,t,n){var r=new Timer;return r.restart(e,t,n),r}function timerFlush(){now(),++W;for(var e=re,t;e;)(t=ae-e._time)>=0&&e._call.call(null,t),e=e._next;--W}function wake(){ae=(ie=se.now())+oe,W=G=0;try{timerFlush()}finally{W=0,nap(),ae=0}}function poke(){var e=se.now(),t=e-ie;t>ne&&(oe-=t,ie=e)}function nap(){for(var e,t=re,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:re=n);K=e,sleep(r)}function sleep(e){W||(G&&=clearTimeout(G),e-ae>24?(e<1/0&&(G=setTimeout(wake,e-se.now()-oe)),te&&=clearInterval(te)):(te||=(ie=se.now(),setInterval(poke,ne)),W=1,ce(wake)))}function bullet_default(){var e=`left`,t=!1,n=!1,r=bulvarRanges,i=bulvarMarkers,a=bulvarMeasures,s=380,c=30,l=axisLeft();function bulvar(e){e.each(function(e,u){var d=r.call(this,e,u).slice().sort(o.descending),f=i.call(this,e,u).slice().sort(o.descending),p=a.call(this,e,u).slice().sort(o.descending),m=(0,o.select)(this),h,g,_=m.select(`g.wrap`);_.empty()&&(_=m.append(`g`).attr(`class`,`wrap`)),n?(h=c,g=s,_.attr(`transform`,`rotate(90)translate(0,`+-s+`)`)):(h=s,g=c,_.attr(`transform`,null));var v=(0,o.scaleLinear)().domain([0,Math.max(d[0],f[0],p[0])]).range(t?[h,0]:[0,h]),b=this.__chart__||(0,o.scaleLinear)().domain([0,1/0]).range(v.range());this.__chart__=v;var S=bulvarWidth(b),C=bulvarWidth(v),w=_.selectAll(`rect.range`).data(d);w.enter().append(`rect`).attr(`class`,function(e,t){return`range s`+t}).attr(`width`,S).attr(`height`,g).attr(`x`,t?b:0).merge(w).transition(w).attr(`x`,t?v:0).attr(`width`,C).attr(`height`,g);var T=_.selectAll(`rect.measure`).data(p);T.enter().append(`rect`).attr(`class`,function(e,t){return`measure s`+t}).attr(`width`,S).attr(`height`,g/3).attr(`x`,t?b:0).attr(`y`,g/3).merge(T).transition(T).attr(`width`,C).attr(`height`,g/3).attr(`x`,t?v:0).attr(`y`,g/3);var E=_.selectAll(`line.marker`).data(f);E.enter().append(`line`).attr(`class`,`marker`).attr(`x1`,b).attr(`x2`,b).attr(`y1`,g/6).attr(`y2`,g*5/6).merge(E).transition(E).attr(`x1`,v).attr(`x2`,v).attr(`y1`,g/6).attr(`y2`,g*5/6);var D=m.selectAll(`g.axis`).data([0]);D.enter().append(`g`).attr(`class`,`axis`),D.attr(`transform`,n?null:`translate(0,`+g+`)`).call(l.scale(v))}),timerFlush()}return bulvar.orient=function(r){return arguments.length?(e=r+``,t=e===`right`||e===`bottom`,l.orient((n=e===`top`||e===`bottom`)?`left`:`bottom`),bulvar):e},bulvar.ranges=function(e){return arguments.length?(r=e,bulvar):r},bulvar.markers=function(e){return arguments.length?(i=e,bulvar):i},bulvar.measures=function(e){return arguments.length?(a=e,bulvar):a},bulvar.width=function(e){return arguments.length?(s=+e,bulvar):s},bulvar.height=function(e){return arguments.length?(c=+e,bulvar):c},bulvar.tickFormat=function(e){return arguments.length?(l.tickFormat(e),bulvar):l.tickFormat()},bulvar}__name(bullet_default,`default`);function bulvarRanges(e){return e.ranges}function bulvarMarkers(e){return e.markers}function bulvarMeasures(e){return e.measures}function bulvarWidth(e){var t=e(0);return function(n){return Math.abs(e(n)-t)}}var Bullet=class extends o.HTMLWidget{_hiddenColumns={};constructor(){super(),o.Utility.SimpleSelectionMixin.call(this,!0)}bulletData(){let e=this;this._hiddenColumns={};let t=this.columns();return this.data().map(function(e){return{title:valueOf(e,this.titleColumn()),subtitle:valueOf(e,this.subtitleColumn()),ranges:valueOf(e,this.rangesColumn(),`range`),measures:valueOf(e,this.measuresColumn(),`measure`),markers:valueOf(e,this.markersColumn(),`marker`),origRow:e}},this);function valueOf(n,r,i){let a=t.indexOf(r);return a>=0?n[a]instanceof Array?n[a]:[n[a]]:(i&&(e._hiddenColumns[i]=!0),[0])}}enter(e,t){super.enter(e,t),(0,o.select)(e.parentNode).style(`overflow`,`auto`),this._selection.widgetElement(t)}update(e,t){super.update(e,t);let n=this;t.selectAll(`.axis`).style(`display`,`none`),t.selectAll(`.range,.measure,.marker`).style(`display`,null);let r={left:2,top:8,right:2,bottom:8},i=this.width()-r.left-r.right,a=40-r.top-r.bottom,s=t.selectAll(`svg`).data(this.bulletData()),c=s.enter().append(`svg`).attr(`class`,`bullet`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n.click(n.rowToObj(e.origRow),n.titleColumn(),n._selection.selected(this))}).on(`dblclick`,function(e){n.dblclick(n.rowToObj(e.origRow),n.titleColumn(),n._selection.selected(this))}).each(function(){let e=(0,o.select)(this).append(`g`).attr(`class`,(e,t)=>`bulletBar series series-`+n.cssTag(n.titleColumn())).append(`g`).attr(`class`,`bulletTitle`);e.append(`text`).attr(`class`,`title`),e.append(`text`).attr(`class`,`subtitle`).attr(`dy`,`1em`)}).merge(s),l=c.select(`.bulletTitle`).style(`text-anchor`,`end`).attr(`transform`,`translate(-6,`+a/2+`)`);l.select(`.title`).text(function(e){return e.title}),l.select(`.subtitle`).text(function(e){return e.subtitle});let u=0;l.each(function(){let e=this.getBBox();e.width>u&&(u=e.width)});let d=bullet_default().width(i-u-6).height(a);c.attr(`width`,i).attr(`height`,a+r.top+r.bottom).style(`margin-left`,`${r.left}px`),c.select(`.bulletBar`).attr(`transform`,`translate(`+(u+6)+`,`+r.top+`)`).call(d),s.exit().remove(),Object.keys(this._hiddenColumns).length>0&&t.selectAll(`.${Object.keys(this._hiddenColumns).join(`,.`)}`).style(`display`,`none`)}exit(e,t){super.exit(e,t)}click(e,t,n){}dblclick(e,t,n){}_selection};Bullet.prototype._class+=` chart_Bullet`,Bullet.prototype.publish(`titleColumn`,null,`set`,`Title Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`subtitleColumn`,null,`set`,`Subtitle Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`rangesColumn`,null,`set`,`Ranges Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`measuresColumn`,null,`set`,`Measures Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`markersColumn`,null,`set`,`Markers Column`,function(){return this.columns()},{optional:!0});var le=Array.prototype.slice;function ascending_default(e,t){return e-t}__name(ascending_default,`default`);function area_default(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r}__name(area_default,`default`);function constant_default$1(e){return function(){return e}}__name(constant_default$1,`default`);function contains_default(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=ringContains(e,t[n]))return i;return 0}__name(contains_default,`default`);function ringContains(e,t){for(var n=t[0],r=t[1],i=-1,a=0,o=e.length,s=o-1;a<o;s=a++){var c=e[a],l=c[0],u=c[1],d=e[s],f=d[0],p=d[1];if(segmentContains(c,d,t))return 0;u>r!=p>r&&n<(f-l)*(r-u)/(p-u)+l&&(i=-i)}return i}function segmentContains(e,t,n){var r;return collinear(e,t,n)&&within(e[r=+(e[0]===t[0])],n[r],t[r])}function collinear(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function within(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function noop_default$1(){}__name(noop_default$1,`default`);var ue=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function contours_default(){var e=1,t=1,n=o.thresholdSturges,r=smoothLinear;function contours(e){var t=n(e);if(Array.isArray(t))t=t.slice().sort(ascending_default);else{var r=(0,o.extent)(e),i=r[0],a=r[1];t=(0,o.tickStep)(i,a,t),t=(0,o.range)(Math.floor(i/t)*t,Math.floor(a/t)*t,t)}return t.map(function(t){return contour(e,t)})}function contour(e,t){var n=[],i=[];return isorings(e,t,function(a){r(a,e,t),area_default(a)>0?n.push([a]):i.push(a)}),i.forEach(function(e){for(var t=0,r=n.length,i;t<r;++t)if(contains_default((i=n[t])[0],e)!==-1){i.push(e);return}}),{type:`MultiPolygon`,value:t,coordinates:n}}function isorings(n,r,i){var a=[],o=[],s=c=-1,c,l,u=n[0]>=r,d,f;for(ue[u<<1].forEach(stitch);++s<e-1;)l=u,u=n[s+1]>=r,ue[l|u<<1].forEach(stitch);for(ue[u<<0].forEach(stitch);++c<t-1;){for(s=-1,u=n[c*e+e]>=r,d=n[c*e]>=r,ue[u<<1|d<<2].forEach(stitch);++s<e-1;)l=u,u=n[c*e+e+s+1]>=r,f=d,d=n[c*e+s+1]>=r,ue[l|u<<1|d<<2|f<<3].forEach(stitch);ue[u|d<<3].forEach(stitch)}for(s=-1,d=n[c*e]>=r,ue[d<<2].forEach(stitch);++s<e-1;)f=d,d=n[c*e+s+1]>=r,ue[d<<2|f<<3].forEach(stitch);ue[d<<3].forEach(stitch);function stitch(e){var t=[e[0][0]+s,e[0][1]+c],n=[e[1][0]+s,e[1][1]+c],r=index(t),l=index(n),u,d;(u=o[r])?(d=a[l])?(delete o[u.end],delete a[d.start],u===d?(u.ring.push(n),i(u.ring)):a[u.start]=o[d.end]={start:u.start,end:d.end,ring:u.ring.concat(d.ring)}):(delete o[u.end],u.ring.push(n),o[u.end=l]=u):(u=a[l])?(d=o[r])?(delete a[u.start],delete o[d.end],u===d?(u.ring.push(n),i(u.ring)):a[d.start]=o[u.end]={start:d.start,end:u.end,ring:d.ring.concat(u.ring)}):(delete a[u.start],u.ring.unshift(t),a[u.start=r]=u):a[r]=o[l]={start:r,end:l,ring:[t,n]}}}function index(t){return t[0]*2+t[1]*(e+1)*4}function smoothLinear(n,r,i){n.forEach(function(n){var a=n[0],o=n[1],s=a|0,c=o|0,l,u=r[c*e+s];a>0&&a<e&&s===a&&(l=r[c*e+s-1],n[0]=a+(i-l)/(u-l)-.5),o>0&&o<t&&c===o&&(l=r[(c-1)*e+s],n[1]=o+(i-l)/(u-l)-.5)})}return contours.contour=contour,contours.size=function(n){if(!arguments.length)return[e,t];var r=Math.ceil(n[0]),i=Math.ceil(n[1]);if(!(r>0)||!(i>0))throw Error(`invalid size`);return e=r,t=i,contours},contours.thresholds=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$1(Array.isArray(e)?le.call(e):e),contours):n},contours.smooth=function(e){return arguments.length?(r=e?smoothLinear:noop_default$1,contours):r===smoothLinear},contours}__name(contours_default,`default`);function blurX(e,t,n){for(var r=e.width,i=e.height,a=(n<<1)+1,o=0;o<i;++o)for(var s=0,c=0;s<r+n;++s)s<r&&(c+=e.data[s+o*r]),s>=n&&(s>=a&&(c-=e.data[s-a+o*r]),t.data[s-n+o*r]=c/Math.min(s+1,r-1+a-s,a))}function blurY(e,t,n){for(var r=e.width,i=e.height,a=(n<<1)+1,o=0;o<r;++o)for(var s=0,c=0;s<i+n;++s)s<i&&(c+=e.data[o+s*r]),s>=n&&(s>=a&&(c-=e.data[o+(s-a)*r]),t.data[o+(s-n)*r]=c/Math.min(s+1,i-1+a-s,a))}function defaultX(e){return e[0]}function defaultY(e){return e[1]}function defaultWeight(){return 1}function density_default(){var e=defaultX,t=defaultY,n=defaultWeight,r=960,i=500,a=20,s=2,c=a*3,l=r+c*2>>s,u=i+c*2>>s,d=constant_default$1(20);function density(r){var i=new Float32Array(l*u),f=new Float32Array(l*u);r.forEach(function(r,a,o){var d=+e(r,a,o)+c>>s,f=+t(r,a,o)+c>>s,p=+n(r,a,o);d>=0&&d<l&&f>=0&&f<u&&(i[d+f*l]+=p)}),blurX({width:l,height:u,data:i},{width:l,height:u,data:f},a>>s),blurY({width:l,height:u,data:f},{width:l,height:u,data:i},a>>s),blurX({width:l,height:u,data:i},{width:l,height:u,data:f},a>>s),blurY({width:l,height:u,data:f},{width:l,height:u,data:i},a>>s),blurX({width:l,height:u,data:i},{width:l,height:u,data:f},a>>s),blurY({width:l,height:u,data:f},{width:l,height:u,data:i},a>>s);var p=d(i);if(!Array.isArray(p)){var m=(0,o.max)(i);p=(0,o.tickStep)(0,m,p),p=(0,o.range)(0,Math.floor(m/p)*p,p),p.shift()}return contours_default().thresholds(p).size([l,u])(i).map(transform)}function transform(e){return e.value*=2**(-2*s),e.coordinates.forEach(transformPolygon),e}function transformPolygon(e){e.forEach(transformRing)}function transformRing(e){e.forEach(transformPoint)}function transformPoint(e){e[0]=e[0]*2**s-c,e[1]=e[1]*2**s-c}function resize(){return c=a*3,l=r+c*2>>s,u=i+c*2>>s,density}return density.x=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$1(+t),density):e},density.y=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default$1(+e),density):t},density.weight=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$1(+e),density):n},density.size=function(e){if(!arguments.length)return[r,i];var t=Math.ceil(e[0]),n=Math.ceil(e[1]);if(!(t>=0)&&!(t>=0))throw Error(`invalid size`);return r=t,i=n,resize()},density.cellSize=function(e){if(!arguments.length)return 1<<s;if(!((e=+e)>=1))throw Error(`invalid cell size`);return s=Math.floor(Math.log(e)/Math.LN2),resize()},density.thresholds=function(e){return arguments.length?(d=typeof e==`function`?e:constant_default$1(Array.isArray(e)?le.call(e):e),density):d},density.bandwidth=function(e){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((e=+e)>=0))throw Error(`invalid bandwidth`);return a=Math.round((Math.sqrt(4*e*e+1)-1)/2),resize()},density}__name(density_default,`default`);function adder_default(){return new Adder}__name(adder_default,`default`);function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function(){this.s=this.t=0},add:function(e){add(de,e,this.t),add(this,de.s,this.s),this.s?this.t+=de.t:this.s=de.t},valueOf:function(){return this.s}};var de=new Adder;function add(e,t,n){var r=e.s=t+n,i=r-t;e.t=t-(r-i)+(n-i)}var fe=Math.PI;fe/2,fe/4;var pe=fe*2;180/fe,fe/180;var me=Math.abs,he=Math.sqrt;function noop(){}function streamGeometry(e,t){e&&_e.hasOwnProperty(e.type)&&_e[e.type](e,t)}var ge={Feature:function(e,t){streamGeometry(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)streamGeometry(n[r].geometry,t)}},_e={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){streamLine(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)streamLine(n[r],t,0)},Polygon:function(e,t){streamPolygon(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)streamPolygon(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)streamGeometry(n[r],t)}};function streamLine(e,t,n){var r=-1,i=e.length-n,a;for(t.lineStart();++r<i;)a=e[r],t.point(a[0],a[1],a[2]);t.lineEnd()}function streamPolygon(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)streamLine(e[n],t,1);t.polygonEnd()}function stream_default(e,t){e&&ge.hasOwnProperty(e.type)?ge[e.type](e,t):streamGeometry(e,t)}__name(stream_default,`default`);function identity_default(e){return e}__name(identity_default,`default`);var ve=adder_default(),ye=adder_default(),be,xe,Se,Ce,we={point:noop,lineStart:noop,lineEnd:noop,polygonStart:function(){we.lineStart=areaRingStart,we.lineEnd=areaRingEnd},polygonEnd:function(){we.lineStart=we.lineEnd=we.point=noop,ve.add(me(ye)),ye.reset()},result:function(){var e=ve/2;return ve.reset(),e}};function areaRingStart(){we.point=areaPointFirst}function areaPointFirst(e,t){we.point=areaPoint,be=Se=e,xe=Ce=t}function areaPoint(e,t){ye.add(Ce*e-Se*t),Se=e,Ce=t}function areaRingEnd(){areaPoint(be,xe)}var Te=1/0,Ee=Te,De=-Te,Oe=De,ke={point:boundsPoint,lineStart:noop,lineEnd:noop,polygonStart:noop,polygonEnd:noop,result:function(){var e=[[Te,Ee],[De,Oe]];return De=Oe=-(Ee=Te=1/0),e}};function boundsPoint(e,t){e<Te&&(Te=e),e>De&&(De=e),t<Ee&&(Ee=t),t>Oe&&(Oe=t)}var Ae=0,je=0,Me=0,Ne=0,Pe=0,Fe=0,Ie=0,Le=0,Re=0,ze,Be,q,J,Y={point:centroidPoint,lineStart:centroidLineStart,lineEnd:centroidLineEnd,polygonStart:function(){Y.lineStart=centroidRingStart,Y.lineEnd=centroidRingEnd},polygonEnd:function(){Y.point=centroidPoint,Y.lineStart=centroidLineStart,Y.lineEnd=centroidLineEnd},result:function(){var e=Re?[Ie/Re,Le/Re]:Fe?[Ne/Fe,Pe/Fe]:Me?[Ae/Me,je/Me]:[NaN,NaN];return Ae=je=Me=Ne=Pe=Fe=Ie=Le=Re=0,e}};function centroidPoint(e,t){Ae+=e,je+=t,++Me}function centroidLineStart(){Y.point=centroidPointFirstLine}function centroidPointFirstLine(e,t){Y.point=centroidPointLine,centroidPoint(q=e,J=t)}function centroidPointLine(e,t){var n=e-q,r=t-J,i=he(n*n+r*r);Ne+=i*(q+e)/2,Pe+=i*(J+t)/2,Fe+=i,centroidPoint(q=e,J=t)}function centroidLineEnd(){Y.point=centroidPoint}function centroidRingStart(){Y.point=centroidPointFirstRing}function centroidRingEnd(){centroidPointRing(ze,Be)}function centroidPointFirstRing(e,t){Y.point=centroidPointRing,centroidPoint(ze=q=e,Be=J=t)}function centroidPointRing(e,t){var n=e-q,r=t-J,i=he(n*n+r*r);Ne+=i*(q+e)/2,Pe+=i*(J+t)/2,Fe+=i,i=J*e-q*t,Ie+=i*(q+e),Le+=i*(J+t),Re+=i*3,centroidPoint(q=e,J=t)}function PathContext(e){this._context=e}PathContext.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,pe);break}},result:noop};var Ve=adder_default(),He,Ue,We,Ge,Ke,qe={point:noop,lineStart:function(){qe.point=lengthPointFirst},lineEnd:function(){He&&lengthPoint(Ue,We),qe.point=noop},polygonStart:function(){He=!0},polygonEnd:function(){He=null},result:function(){var e=+Ve;return Ve.reset(),e}};function lengthPointFirst(e,t){qe.point=lengthPoint,Ue=Ge=e,We=Ke=t}function lengthPoint(e,t){Ge-=e,Ke-=t,Ve.add(he(Ge*Ge+Ke*Ke)),Ge=e,Ke=t}function PathString(){this._string=[]}PathString.prototype={_radius:4.5,_circle:circle(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push(`Z`),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push(`M`,e,`,`,t),this._point=1;break;case 1:this._string.push(`L`,e,`,`,t);break;default:this._circle??=circle(this._radius),this._string.push(`M`,e,`,`,t,this._circle);break}},result:function(){if(this._string.length){var e=this._string.join(``);return this._string=[],e}else return null}};function circle(e){return`m0,`+e+`a`+e+`,`+e+` 0 1,1 0,`+-2*e+`a`+e+`,`+e+` 0 1,1 0,`+2*e+`z`}function path_default(e,t){var n=4.5,r,i;function path(e){return e&&(typeof n==`function`&&i.pointRadius(+n.apply(this,arguments)),stream_default(e,r(i))),i.result()}return path.area=function(e){return stream_default(e,r(we)),we.result()},path.measure=function(e){return stream_default(e,r(qe)),qe.result()},path.bounds=function(e){return stream_default(e,r(ke)),ke.result()},path.centroid=function(e){return stream_default(e,r(Y)),Y.result()},path.projection=function(t){return arguments.length?(r=t==null?(e=null,identity_default):(e=t).stream,path):e},path.context=function(e){return arguments.length?(i=e==null?(t=null,new PathString):new PathContext(t=e),typeof n!=`function`&&i.pointRadius(n),path):t},path.pointRadius=function(e){return arguments.length?(n=typeof e==`function`?e:(i.pointRadius(+e),+e),path):n},path.projection(e).context(t)}__name(path_default,`default`);var Contour=class extends XYAxis{static __inputs=[{id:`x`,type:`any`},{id:`y`,type:`number`}];_dataMinWeight;_dataMaxWeight;constructor(){super(),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default(`linear`)}xPos(e,t){return e.orientation()===`horizontal`?e.dataPos(t.label):e.valuePos(t.value)}yPos(e,t){return e.orientation()===`horizontal`?e.valuePos(t.value):e.dataPos(t.label)}layerEnter(e,t,n=250){super.layerEnter(e,t,n)}layerUpdate(e,t,n=250){super.layerUpdate(e,t,n),this._palette=this._palette.switch(this.paletteID());let r=this.flattenData(this.layerColumns(e),this.layerData(e)),i=density_default().x(t=>this.xPos(e,t)).y(t=>this.yPos(e,t)).size([this.width(),this.height()]).bandwidth(this.contourBandwidth())(r),a=i.map(e=>e.value),o=Math.min.apply(this,a),s=Math.max.apply(this,a);this._dataMinWeight=o,this._dataMaxWeight=s;let c=t.selectAll(`path`).data(i);c.enter().append(`path`).merge(c).attr(`d`,path_default()).attr(`fill`,e=>this.showContourFill()?this._palette(e.value,o,s):`none`).attr(`stroke`,this.contourStrokeColor()).attr(`stroke-linejoin`,`round`).attr(`stroke-width`,this.contourStrokeWidth()),c.exit().remove()}exit(e,t){super.exit(e,t)}};Contour.prototype._class+=` chart_Contour`,Contour.prototype.implements(I1DChart.prototype),Contour.prototype.publish(`paletteID`,`YlGnBu`,`string`,`Color palette for this widget`),Contour.prototype.publish(`useClonedPalette`,!0,`boolean`,`Enable or disable using a cloned palette`),Contour.prototype.publish(`showContourFill`,!0,`boolean`,`Show/hide the contour background colors`),Contour.prototype.publish(`showContour`,!0,`boolean`,`Show/hide the contour border lines`),Contour.prototype.publish(`contourBandwidth`,40,`number`,`Controls the sensitivity of the contour grouping algorithm`),Contour.prototype.publish(`contourStrokeColor`,`#2C3A47`,`html-color`,`Color of the contour border lines`),Contour.prototype.publish(`contourStrokeWidth`,1,`number`,`Width of the contour border lines`);var Gantt=class extends Bar{constructor(){super(),this.orientation_default(`vertical`).xAxisType_default(`ordinal`).yAxisType_default(`time`)}};Gantt.prototype._class+=` chart_Gantt`;function constant_default(e){return function constant(){return e}}__name(constant_default,`default`);var Je=Math.PI,Ye=Je/2,Xe=2*Je;function arcInnerRadius(e){return e.innerRadius}function arcOuterRadius(e){return e.outerRadius}function arcStartAngle(e){return e.startAngle}function arcEndAngle(e){return e.endAngle}function arcPadAngle(e){return e&&e.padAngle}function asin(e){return e>=1?Ye:e<=-1?-Ye:Math.asin(e)}function intersect(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=(u*(t-a)-d*(e-i))/(d*c-u*l);return[e+f*c,t+f*l]}function cornerTangents(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/Math.sqrt(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,b=h-p,S=v*v+b*b,C=i-a,w=f*h-m*p,T=(b<0?-1:1)*Math.sqrt(Math.max(0,C*C*S-w*w)),E=(w*b-v*T)/S,D=(-w*v-b*T)/S,O=(w*b+v*T)/S,k=(-w*v+b*T)/S,A=E-g,j=D-_,M=O-g,N=k-_;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-u,y01:-d,x11:E*(i/C-1),y11:D*(i/C-1)}}function arc_default(){var e=arcInnerRadius,t=arcOuterRadius,n=constant_default(0),r=null,i=arcStartAngle,a=arcEndAngle,o=arcPadAngle,s=null;function arc(){var c,l,u=+e.apply(this,arguments),d=+t.apply(this,arguments),f=i.apply(this,arguments)-Ye,p=a.apply(this,arguments)-Ye,m=Math.abs(p-f),h=p>f;if(s||=c=path(),d<u&&(l=d,d=u,u=l),!(d>1e-12))s.moveTo(0,0);else if(m>Xe-1e-12)s.moveTo(d*Math.cos(f),d*Math.sin(f)),s.arc(0,0,d,f,p,!h),u>1e-12&&(s.moveTo(u*Math.cos(p),u*Math.sin(p)),s.arc(0,0,u,p,f,h));else{var g=f,_=p,v=f,b=p,S=m,C=m,w=o.apply(this,arguments)/2,T=w>1e-12&&(r?+r.apply(this,arguments):Math.sqrt(u*u+d*d)),E=Math.min(Math.abs(d-u)/2,+n.apply(this,arguments)),D=E,O=E,k,A;if(T>1e-12){var j=asin(T/u*Math.sin(w)),M=asin(T/d*Math.sin(w));(S-=j*2)>1e-12?(j*=h?1:-1,v+=j,b-=j):(S=0,v=b=(f+p)/2),(C-=M*2)>1e-12?(M*=h?1:-1,g+=M,_-=M):(C=0,g=_=(f+p)/2)}var N=d*Math.cos(g),P=d*Math.sin(g),F=u*Math.cos(b),I=u*Math.sin(b);if(E>1e-12){var L=d*Math.cos(_),R=d*Math.sin(_),z=u*Math.cos(v),B=u*Math.sin(v);if(m<Je){var V=S>1e-12?intersect(N,P,z,B,L,R,F,I):[F,I],H=N-V[0],U=P-V[1],ee=L-V[0],W=R-V[1],G=1/Math.sin(Math.acos((H*ee+U*W)/(Math.sqrt(H*H+U*U)*Math.sqrt(ee*ee+W*W)))/2),te=Math.sqrt(V[0]*V[0]+V[1]*V[1]);D=Math.min(E,(u-te)/(G-1)),O=Math.min(E,(d-te)/(G+1))}}C>1e-12?O>1e-12?(k=cornerTangents(z,B,N,P,d,O,h),A=cornerTangents(L,R,F,I,d,O,h),s.moveTo(k.cx+k.x01,k.cy+k.y01),O<E?s.arc(k.cx,k.cy,O,Math.atan2(k.y01,k.x01),Math.atan2(A.y01,A.x01),!h):(s.arc(k.cx,k.cy,O,Math.atan2(k.y01,k.x01),Math.atan2(k.y11,k.x11),!h),s.arc(0,0,d,Math.atan2(k.cy+k.y11,k.cx+k.x11),Math.atan2(A.cy+A.y11,A.cx+A.x11),!h),s.arc(A.cx,A.cy,O,Math.atan2(A.y11,A.x11),Math.atan2(A.y01,A.x01),!h))):(s.moveTo(N,P),s.arc(0,0,d,g,_,!h)):s.moveTo(N,P),!(u>1e-12)||!(S>1e-12)?s.lineTo(F,I):D>1e-12?(k=cornerTangents(F,I,L,R,u,-D,h),A=cornerTangents(N,P,z,B,u,-D,h),s.lineTo(k.cx+k.x01,k.cy+k.y01),D<E?s.arc(k.cx,k.cy,D,Math.atan2(k.y01,k.x01),Math.atan2(A.y01,A.x01),!h):(s.arc(k.cx,k.cy,D,Math.atan2(k.y01,k.x01),Math.atan2(k.y11,k.x11),!h),s.arc(0,0,u,Math.atan2(k.cy+k.y11,k.cx+k.x11),Math.atan2(A.cy+A.y11,A.cx+A.x11),h),s.arc(A.cx,A.cy,D,Math.atan2(A.y11,A.x11),Math.atan2(A.y01,A.x01),!h))):s.arc(0,0,u,b,v,h)}if(s.closePath(),c)return s=null,c+``||null}return arc.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Je/2;return[Math.cos(r)*n,Math.sin(r)*n]},arc.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default(+t),arc):e},arc.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default(+e),arc):t},arc.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default(+e),arc):n},arc.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:constant_default(+e),arc):r},arc.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default(+e),arc):i},arc.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:constant_default(+e),arc):a},arc.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:constant_default(+e),arc):o},arc.context=function(e){return arguments.length?(s=e??null,arc):s},arc}__name(arc_default,`default`);function Linear(e){this._context=e}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function linear_default(e){return new Linear(e)}__name(linear_default,`default`);function x(e){return e[0]}function y(e){return e[1]}function line_default(){var e=x,t=y,n=constant_default(!0),r=null,i=linear_default,a=null;function line(o){var s,c=o.length,l,u=!1,d;for(r??(a=i(d=path())),s=0;s<=c;++s)!(s<c&&n(l=o[s],s,o))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(l,s,o),+t(l,s,o));if(d)return a=null,d+``||null}return line.x=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default(+t),line):e},line.y=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default(+e),line):t},line.defined=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default(!!e),line):n},line.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),line):i},line.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),line):r},line}__name(line_default,`default`),curveRadial(linear_default);function Radial(e){this._curve=e}Radial.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function curveRadial(e){function radial(t){return new Radial(e(t))}return radial._curve=e,radial}Math.sqrt(1/3)*2;var Ze=Math.sin(Je/10)/Math.sin(7*Je/10);Math.sin(Xe/10)*Ze,-Math.cos(Xe/10)*Ze,Math.sqrt(3)/2,(1/Math.sqrt(12)/2+1)*3;function noop_default(){}__name(noop_default,`default`);function point$3(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}__name(point$3,`point`);function Basis(e){this._context=e}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point$3(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:point$3(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function BasisClosed(e){this._context=e}BasisClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:point$3(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function BasisOpen(e){this._context=e}BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:point$3(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bundle(e,t){this._basis=new Basis(e),this._beta=t}Bundle.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}},(function custom(e){function bundle(t){return e===1?new Basis(t):new Bundle(t,e)}return bundle.beta=function(e){return custom(+e)},bundle})(.85);function point$2(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}__name(point$2,`point`);function Cardinal(e,t){this._context=e,this._k=(1-t)/6}Cardinal.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:point$2(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:point$2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function cardinal(t){return new Cardinal(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function CardinalClosed(e,t){this._context=e,this._k=(1-t)/6}CardinalClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:point$2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function cardinal(t){return new CardinalClosed(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function CardinalOpen(e,t){this._context=e,this._k=(1-t)/6}CardinalOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:point$2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function cardinal(t){return new CardinalOpen(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function point$1(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}__name(point$1,`point`);function CatmullRom(e,t){this._context=e,this._alpha=t}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:point$1(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Qe=(function custom(e){function catmullRom(t){return e?new CatmullRom(t,e):new Cardinal(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function CatmullRomClosed(e,t){this._context=e,this._alpha=t}CatmullRomClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:point$1(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function catmullRom(t){return e?new CatmullRomClosed(t,e):new CardinalClosed(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function CatmullRomOpen(e,t){this._context=e,this._alpha=t}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:point$1(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function catmullRom(t){return e?new CatmullRomOpen(t,e):new CardinalOpen(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function LinearClosed(e){this._context=e}LinearClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function sign(e){return e<0?-1:1}function slope3(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(sign(a)+sign(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function slope2(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function point(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function MonotoneX(e){this._context=e}MonotoneX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:point(this,this._t0,slope2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,point(this,slope2(this,n=slope3(this,e,t)),n);break;default:point(this,this._t0,n=slope3(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function MonotoneY(e){this._context=new ReflectContext(e)}(MonotoneY.prototype=Object.create(MonotoneX.prototype)).point=function(e,t){MonotoneX.prototype.point.call(this,t,e)};function ReflectContext(e){this._context=e}ReflectContext.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Natural(e){this._context=e}Natural.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=controlPoints(e),i=controlPoints(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function controlPoints(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Step$1(e,t){this._context=e,this._t=t}__name(Step$1,`Step`),Step$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}},Array.prototype.slice;var $e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},classCallCheck=function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)},et=function(){function defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),X=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tt=function get(e,t,n){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0){var i=Object.getPrototypeOf(e);return i===null?void 0:get(i,t,n)}else if(`value`in r)return r.value;else{var a=r.get;return a===void 0?void 0:a.call(n)}},inherits=function(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},possibleConstructorReturn=function(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e},toConsumableArray=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)},nt=function(){function Annotation(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.nx,o=e.ny,s=e.dy,c=s===void 0?0:s,l=e.dx,u=l===void 0?0:l,d=e.color,f=d===void 0?`grey`:d,p=e.data,m=e.type,h=e.subject,g=e.connector,_=e.note,v=e.disable,b=e.id,S=e.className;classCallCheck(this,Annotation),this._dx=a===void 0?u:a-n,this._dy=o===void 0?c:o-i,this._x=n,this._y=i,this._color=f,this.id=b,this._className=S||``,this._type=m||``,this.data=p,this.note=_||{},this.connector=g||{},this.subject=h||{},this.disable=v||[]}return et(Annotation,[{key:`updatePosition`,value:function updatePosition(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&this.type.subject.selectAll(`:not(.handle)`).nodes().length!==0&&this.type.redrawSubject())}},{key:`clearComponents`,value:function clearComponents(){this.type.clearComponents&&this.type.clearComponents()}},{key:`updateOffset`,value:function updateOffset(){this.type.setOffset&&(this.type.setOffset(),this.type.connector.selectAll(`:not(.handle)`).nodes().length!==0&&this.type.redrawConnector(),this.type.redrawNote())}},{key:`className`,get:function get$$1(){return this._className},set:function set$$1(e){this._className=e,this.type.setClassName&&this.type.setClassName()}},{key:`type`,get:function get$$1(){return this._type},set:function set$$1(e){this._type=e,this.clearComponents()}},{key:`x`,get:function get$$1(){return this._x},set:function set$$1(e){this._x=e,this.updatePosition()}},{key:`y`,get:function get$$1(){return this._y},set:function set$$1(e){this._y=e,this.updatePosition()}},{key:`color`,get:function get$$1(){return this._color},set:function set$$1(e){this._color=e,this.updatePosition()}},{key:`dx`,get:function get$$1(){return this._dx},set:function set$$1(e){this._dx=e,this.updateOffset()}},{key:`dy`,get:function get$$1(){return this._dy},set:function set$$1(e){this._dy=e,this.updateOffset()}},{key:`nx`,set:function set$$1(e){this._dx=e-this._x,this.updateOffset()}},{key:`ny`,set:function set$$1(e){this._dy=e-this._y,this.updateOffset()}},{key:`offset`,get:function get$$1(){return{x:this._dx,y:this._dy}},set:function set$$1(e){var t=e.x,n=e.y;this._dx=t,this._dy=n,this.updateOffset()}},{key:`position`,get:function get$$1(){return{x:this._x,y:this._y}},set:function set$$1(e){var t=e.x,n=e.y;this._x=t,this._y=n,this.updatePosition()}},{key:`translation`,get:function get$$1(){return{x:this._x+this._dx,y:this._y+this._dy}}},{key:`json`,get:function get$$1(){var e={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(e.data=this.data),this.type&&(e.type=this.type),this._className&&(e.className=this._className),Object.keys(this.connector).length>0&&(e.connector=this.connector),Object.keys(this.subject).length>0&&(e.subject=this.subject),Object.keys(this.note).length>0&&(e.note=this.note),e}}]),Annotation}(),rt=function(){function AnnotationCollection(e){var t=e.annotations,n=e.accessors,r=e.accessorsInverse;classCallCheck(this,AnnotationCollection),this.accessors=n,this.accessorsInverse=r,this.annotations=t}return et(AnnotationCollection,[{key:`clearTypes`,value:function clearTypes(e){this.annotations.forEach(function(t){t.type=void 0,t.subject=e&&e.subject||t.subject,t.connector=e&&e.connector||t.connector,t.note=e&&e.note||t.note})}},{key:`setPositionWithAccessors`,value:function setPositionWithAccessors(){var e=this;this.annotations.forEach(function(t){t.type.setPositionWithAccessors(e.accessors)})}},{key:`editMode`,value:function editMode(e){this.annotations.forEach(function(t){t.type&&(t.type.editMode=e,t.type.updateEditMode())})}},{key:`updateDisable`,value:function updateDisable(e){this.annotations.forEach(function(t){t.disable=e,t.type&&e.forEach(function(e){t.type[e]&&(t.type[e].remove&&t.type[e].remove(),t.type[e]=void 0)})})}},{key:`updateTextWrap`,value:function updateTextWrap(e){this.annotations.forEach(function(t){t.type&&t.type.updateTextWrap&&t.type.updateTextWrap(e)})}},{key:`updateText`,value:function updateText(){this.annotations.forEach(function(e){e.type&&e.type.drawText&&e.type.drawText()})}},{key:`updateNotePadding`,value:function updateNotePadding(e){this.annotations.forEach(function(t){t.type&&(t.type.notePadding=e)})}},{key:`json`,get:function get$$1(){var e=this;return this.annotations.map(function(t){var n=t.json;return e.accessorsInverse&&t.data&&(n.data={},Object.keys(e.accessorsInverse).forEach(function(r){n.data[r]=e.accessorsInverse[r]({x:t.x,y:t.y})})),n})}},{key:`noteNodes`,get:function get$$1(){return this.annotations.map(function(e){return X({},e.type.getNoteBBoxOffset(),{positionX:e.x,positionY:e.y})})}}]),AnnotationCollection}(),it=function pointHandle(e){var t=e.cx,n=t===void 0?0:t,r=e.cy;return{move:{x:n,y:r===void 0?0:r}}},at=function circleHandles(e){var t=e.cx,n=t===void 0?0:t,r=e.cy,i=r===void 0?0:r,a=e.r1,o=e.r2,s=e.padding,c={move:{x:n,y:i}};return a!==void 0&&(c.r1={x:n+a/Math.sqrt(2),y:i+a/Math.sqrt(2)}),o!==void 0&&(c.r2={x:n+o/Math.sqrt(2),y:i+o/Math.sqrt(2)}),s!==void 0&&(c.padding={x:n+a+s,y:i}),c},ot=function addHandles(e){var t=e.group,n=e.handles,r=e.r,i=r===void 0?10:r,a=t.selectAll(`circle.handle`).data(n);a.enter().append(`circle`).attr(`class`,`handle`).attr(`fill`,`grey`).attr(`fill-opacity`,.1).attr(`cursor`,`move`).attr(`stroke-dasharray`,5).attr(`stroke`,`grey`).call((0,o.drag)().container((0,o.select)(`g.annotations`).node()).on(`start`,function(e){return e.start&&e.start(e)}).on(`drag`,function(e){return e.drag&&e.drag(e)}).on(`end`,function(e){return e.end&&e.end(e)})),t.selectAll(`circle.handle`).attr(`cx`,function(e){return e.x}).attr(`cy`,function(e){return e.y}).attr(`r`,function(e){return e.r||i}).attr(`class`,function(e){return`handle `+(e.className||``)}),a.exit().remove()},st=function leftRightDynamic(e,t){return(e===`dynamic`||e===`left`||e===`right`)&&(e=t<0?`top`:`bottom`),e},ct=function topBottomDynamic(e,t){return(e===`dynamic`||e===`top`||e===`bottom`)&&(e=t<0?`right`:`left`),e},lt=[`topBottom`,`top`,`bottom`],ut=[`leftRight`,`left`,`right`],noteAlignment=(function(e){var t=e.padding,n=t===void 0?0:t,r=e.bbox,i=r===void 0?{x:0,y:0,width:0,height:0}:r,a=e.align,o=e.orientation,s=e.offset,c=s===void 0?{x:0,y:0}:s,l=-i.x,u=0;return lt.indexOf(o)===-1?ut.indexOf(o)!==-1&&(a=st(a,c.y),c.x<0&&o===`leftRight`||o===`left`?l-=i.width+n:l+=n,a===`middle`?u-=i.height/2:a===`top`&&(u-=i.height)):(a=ct(a,c.x),c.y<0&&o===`topBottom`||o===`top`?u-=i.height+n:u+=n,a===`middle`?l-=i.width/2:a===`right`&&(l-=i.width)),{x:l,y:u}}),Z=function lineBuilder(e){var t=e.data,n=e.curve,r=n===void 0?linear_default:n,i=e.canvasContext,a=e.className,o=e.classID,s=line_default().curve(r),c={type:`path`,className:a,classID:o,data:t};return i?(s.context(i),c.pathMethods=s):c.attrs={d:s(t)},c},dt=function arcBuilder(e){var t=e.data,n=e.canvasContext,r={type:`path`,className:e.className,classID:e.classID,data:t},i=arc_default().innerRadius(t.innerRadius||0).outerRadius(t.outerRadius||t.radius||2).startAngle(t.startAngle||0).endAngle(t.endAngle||2*Math.PI);return n?(i.context(n),r.pathMethods=lineGen):r.attrs={d:i()},r},noteVertical=(function(e){var t=e.align,n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.bbox,s=e.offset;return t=st(t,s.y),t===`top`?a-=o.height:t===`middle`&&(a-=o.height/2),{components:[Z({data:[[r,a],[r,a+o.height]],className:`note-line`})]}}),noteHorizontal=(function(e){var t=e.align,n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.offset,s=e.bbox;return t=ct(t,o.x),t===`right`?r-=s.width:t===`middle`&&(r-=s.width/2),{components:[Z({data:[[r,a],[r+s.width,a]],className:`note-line`})]}}),ft=function lineSetup(e){var t=e.type,n=e.subjectType,r=t.annotation,i=r.position,a=r.x-i.x,o=a+r.dx,s=r.y-i.y,c=s+r.dy,l=r.subject;if(n===`circle`&&(l.outerRadius||l.radius)){var u=Math.sqrt((a-o)*(a-o)+(s-c)*(s-c)),d=Math.asin(-c/u),f=l.outerRadius||l.radius+(l.radiusPadding||0);a=Math.abs(Math.cos(d)*f)*(o<0?-1:1),s=Math.abs(Math.sin(d)*f)*(c<0?-1:1)}if(n===`rect`){var p=l.width,m=l.height;(p>0&&r.dx>0||p<0&&r.dx<0)&&(a=Math.abs(p)>Math.abs(r.dx)?p/2:p),(m>0&&r.dy>0||m<0&&r.dy<0)&&(s=Math.abs(m)>Math.abs(r.dy)?m/2:m),a===p/2&&s===m/2&&(a=o,s=c)}return[[a,s],[o,c]]},connectorLine=(function(e){return{components:[Z({data:ft(e),className:`connector`})]}}),connectorElbow=(function(e){var t=e.type,n=e.subjectType,r=t.annotation,i=r.position,a=r.x-i.x,o=a+r.dx,s=r.y-i.y,c=s+r.dy,l=r.subject;if(n===`rect`){var u=l.width,d=l.height;(u>0&&r.dx>0||u<0&&r.dx<0)&&(a=Math.abs(u)>Math.abs(r.dx)?u/2:u),(d>0&&r.dy>0||d<0&&r.dy<0)&&(s=Math.abs(d)>Math.abs(r.dy)?d/2:d),a===u/2&&s===d/2&&(a=o,s=c)}var f=[[a,s],[o,c]],p=c-s,m=o-a,h=o,g=c,_=c<s&&o>a||o<a&&c>s?-1:1;if(Math.abs(m)<Math.abs(p)?(h=o,g=s+m*_):(g=c,h=a+p*_),n===`circle`&&(l.outerRadius||l.radius)){var v=(l.outerRadius||l.radius)+(l.radiusPadding||0),b=v/Math.sqrt(2);if(Math.abs(m)>b&&Math.abs(p)>b)a=b*(o<0?-1:1),s=b*(c<0?-1:1),f=[[a,s],[h,g],[o,c]];else if(Math.abs(m)>Math.abs(p)){var S=Math.asin(-c/v);a=Math.abs(Math.cos(S)*v)*(o<0?-1:1),f=[[a,c],[o,c]]}else{var C=Math.acos(o/v);s=Math.abs(Math.sin(C)*v)*(c<0?-1:1),f=[[o,s],[o,c]]}}else f=[[a,s],[h,g],[o,c]];return{components:[Z({data:f,className:`connector`})]}}),connectorCurve=(function(e){var t=e.type,n=e.connectorData,r=e.subjectType;n||={},(!n.points||typeof n.points==`number`)&&(n.points=pt(t.annotation.offset,n.points)),n.curve||=Qe;var i=[];if(t.editMode){var a=n.points.map(function(e,t){return X({},it({cx:e[0],cy:e[1]}),{index:t})}),s=function updatePoint(e){n.points[e][0]+=o.event.dx,n.points[e][1]+=o.event.dy,t.redrawConnector()};i=t.mapHandles(a.map(function(e){return X({},e.move,{drag:s.bind(t,e.index)})}))}var c=ft({type:t,subjectType:r});return c=[c[0]].concat(toConsumableArray(n.points),[c[1]]),{components:[Z({data:c,curve:n.curve,className:`connector`})],handles:i}}),pt=function createPoints(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,n={x:e.x/(t+1),y:e.y/(t+1)},r=[],i=1;i<=t;i++)r.push([n.x*i+i%2*20,n.y*i-i%2*20]);return r},connectorArrow=(function(e){var t=e.annotation,n=e.start,r=e.end,i=e.scale,a=i===void 0?1:i,o=t.position;n=n?[-r[0]+n[0],-r[1]+n[1]]:[t.dx,t.dy],r||=[t.x-o.x,t.y-o.y];var s=r[0],c=r[1],l=n[0],u=n[1],d=10*a,f=16/180*Math.PI,p=Math.atan(u/l);return l<0&&(p+=Math.PI),{components:[Z({data:[[s,c],[Math.cos(p+f)*d+s,Math.sin(p+f)*d+c],[Math.cos(p-f)*d+s,Math.sin(p-f)*d+c],[s,c]],className:`connector-end connector-arrow`,classID:`connector-end`})]}}),connectorDot=(function(e){var t=e.line,n=e.scale,r=dt({className:`connector-end connector-dot`,classID:`connector-end`,data:{radius:3*Math.sqrt(n===void 0?1:n)}});return r.attrs.transform=`translate(`+t.data[0][0]+`, `+t.data[0][1]+`)`,{components:[r]}}),subjectCircle=(function(e){var t=e.subjectData,n=e.type;!t.radius&&!t.outerRadius&&(t.radius=20);var r=[],i=dt({data:t,className:`subject`});if(n.editMode){var a=at({r1:i.data.outerRadius||i.data.radius,r2:i.data.innerRadius,padding:t.radiusPadding}),s=function updateRadius(e){t[e]=t[e]+o.event.dx*Math.sqrt(2),n.redrawSubject(),n.redrawConnector()},c=[X({},a.r1,{drag:s.bind(n,t.outerRadius===void 0?`radius`:`outerRadius`)})];t.innerRadius&&c.push(X({},a.r2,{drag:s.bind(n,`innerRadius`)})),r=n.mapHandles(c)}return i.attrs[`fill-opacity`]=0,{components:[i],handles:r}}),subjectRect=(function(e){var t=e.subjectData,n=e.type;t.width||=100,t.height||=100;var r=[],i=t.width,a=t.height,s=Z({data:[[0,0],[i,0],[i,a],[0,a],[0,0]],className:`subject`});if(n.editMode){var c=[{x:i,y:a/2,drag:function updateWidth(){t.width=o.event.x,n.redrawSubject(),n.redrawConnector()}.bind(n)},{x:i/2,y:a,drag:function updateHeight(){t.height=o.event.y,n.redrawSubject(),n.redrawConnector()}.bind(n)}];r=n.mapHandles(c)}return s.attrs[`fill-opacity`]=.1,{components:[s],handles:r}}),subjectThreshold=(function(e){var t=e.subjectData,n=e.type.annotation.position,r=(t.x1===void 0?n.x:t.x1)-n.x,i=(t.x2===void 0?n.x:t.x2)-n.x,a=(t.y1===void 0?n.y:t.y1)-n.y,o=(t.y2===void 0?n.y:t.y2)-n.y;return{components:[Z({data:[[r,a],[i,o]],className:`subject`})]}}),subjectBadge=(function(e){var t=e.subjectData,n=t===void 0?{}:t,r=e.type,i=r===void 0?{}:r,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.typeSettings&&i.typeSettings.subject;n.radius||(s&&s.radius?n.radius=s.radius:n.radius=14),n.x||s&&s.x&&(n.x=s.x),n.y||s&&s.y&&(n.y=s.y);var c=[],l=[],u=n.radius,d=u*.7,f=0,p=0,m=Math.sqrt(2)*u,h={xleftcorner:-u,xrightcorner:u,ytopcorner:-u,ybottomcorner:u,xleft:-m,xright:m,ytop:-m,ybottom:m};n.x&&!n.y?f=h[`x`+n.x]:n.y&&!n.x?p=h[`y`+n.y]:n.x&&n.y&&(f=h[`x`+n.x+`corner`],p=h[`y`+n.y+`corner`]);var g=`translate(`+f+`, `+p+`)`,_=dt({className:`subject`,data:{radius:u}});_.attrs.transform=g,_.attrs.fill=a.color,_.attrs[`stroke-linecap`]=`round`,_.attrs[`stroke-width`]=`3px`;var v=dt({className:`subject-ring`,data:{outerRadius:u,innerRadius:d}});v.attrs.transform=g,v.attrs[`stroke-width`]=`3px`,v.attrs.fill=`white`;var b=void 0;if(f&&p||!f&&!p)b=Z({className:`subject-pointer`,data:[[0,0],[f||0,0],[0,p||0],[0,0]]});else if(f||p){var S=function notCornerPointerXY(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return e&&e/Math.sqrt(2)/Math.sqrt(2)||t*u/Math.sqrt(2)};b=Z({className:`subject-pointer`,data:[[0,0],[S(f),S(p)],[S(f,-1),S(p,-1)],[0,0]]})}if(b&&(b.attrs.fill=a.color,b.attrs[`stroke-linecap`]=`round`,b.attrs[`stroke-width`]=`3px`,l.push(b)),i.editMode){var C={x:f*2,y:p*2,drag:function dragBadge(){n.x=o.event.x<-u*2?`left`:o.event.x>u*2?`right`:void 0,n.y=o.event.y<-u*2?`top`:o.event.y>u*2?`bottom`:void 0,i.redrawSubject()}.bind(i)};!C.x&&!C.y&&(C.y=-u),c=i.mapHandles([C])}var w=void 0;return n.text&&(w={type:`text`,className:`badge-text`,attrs:{fill:`white`,stroke:`none`,"font-size":`.7em`,text:n.text,"text-anchor":`middle`,dy:`.25em`,x:f,y:p}}),l.push(_),l.push(v),l.push(w),{components:l,handles:c}}),mt=function(){function Type(e){var t=e.a,n=e.annotation,r=e.editMode,i=e.dispatcher,a=e.notePadding,o=e.accessors;if(classCallCheck(this,Type),this.a=t,this.note=n.disable.indexOf(`note`)===-1&&t.select(`g.annotation-note`),this.noteContent=this.note&&t.select(`g.annotation-note-content`),this.connector=n.disable.indexOf(`connector`)===-1&&t.select(`g.annotation-connector`),this.subject=n.disable.indexOf(`subject`)===-1&&t.select(`g.annotation-subject`),this.dispatcher=i,i){var s=yt.bind(null,i,n);s({component:this.note,name:`note`}),s({component:this.connector,name:`connector`}),s({component:this.subject,name:`subject`})}this.annotation=n,this.editMode=n.editMode||r,this.notePadding=a===void 0?3:a,this.offsetCornerX=0,this.offsetCornerY=0,o&&n.data&&this.init(o)}return et(Type,[{key:`init`,value:function init(e){this.annotation.x||this.mapX(e),this.annotation.y||this.mapY(e)}},{key:`mapY`,value:function mapY(e){e.y&&(this.annotation.y=e.y(this.annotation.data))}},{key:`mapX`,value:function mapX(e){e.x&&(this.annotation.x=e.x(this.annotation.data))}},{key:`updateEditMode`,value:function updateEditMode(){this.a.selectAll(`circle.handle`).remove()}},{key:`drawOnSVG`,value:function drawOnSVG(e,t){var n=this;Array.isArray(t)||(t=[t]),t.filter(function(e){return e}).forEach(function(t){var r=t.type,i=t.className,a=t.attrs,o=t.handles,s=t.classID;if(r===`handle`)ot({group:e,r:a&&a.r,handles:o});else{Q(e,[n.annotation],r,i,s);for(var c=e.select(r+`.`+(s||i)),l=Object.keys(a),u=[],d=c.node().attributes,f=d.length-1;f>=0;f--){var p=d[f].name;l.indexOf(p)===-1&&p!==`class`&&u.push(p)}l.forEach(function(e){e===`text`?c.text(a[e]):c.attr(e,a[e])}),u.forEach(function(e){return c.attr(e,null)})}})}},{key:`getNoteBBox`,value:function getNoteBBox(){return xt(this.note,`.annotation-note-content text`)}},{key:`getNoteBBoxOffset`,value:function getNoteBBoxOffset(){var e=xt(this.note,`.annotation-note-content`),t=this.noteContent.attr(`transform`).split(/\(|\,|\)/g);return e.offsetCornerX=parseFloat(t[1])+this.annotation.dx,e.offsetCornerY=parseFloat(t[2])+this.annotation.dy,e.offsetX=this.annotation.dx,e.offsetY=this.annotation.dy,e}},{key:`drawSubject`,value:function drawSubject(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.annotation.subject,r=t.type,i={type:this,subjectData:n},a={};r===`circle`?a=subjectCircle(i):r===`rect`?a=subjectRect(i):r===`threshold`?a=subjectThreshold(i):r===`badge`&&(a=subjectBadge(i,this.annotation));var o=a,s=o.components,c=s===void 0?[]:s,l=o.handles,u=l===void 0?[]:l;return c.forEach(function(t){t&&t.attrs&&!t.attrs.stroke&&(t.attrs.stroke=e.annotation.color)}),this.editMode&&(u=u.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),c.push({type:`handle`,handles:u})),c}},{key:`drawConnector`,value:function drawConnector(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.annotation.connector,r=n.type||t.type,i={type:this,connectorData:n};i.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var a={};a=r===`curve`?connectorCurve(i):r===`elbow`?connectorElbow(i):connectorLine(i);var o=a,s=o.components,c=s===void 0?[]:s,l=o.handles,u=l===void 0?[]:l,d=c[0];d&&(d.attrs.stroke=this.annotation.color,d.attrs.fill=`none`);var f=n.end||t.end,p={};if(f===`arrow`){var m=d.data[1],h=d.data[0];Math.sqrt((m[0]-h[0])**2+(m[1]-h[1])**2)<5&&d.data[2]&&(m=d.data[2]),p=connectorArrow({annotation:this.annotation,start:m,end:h,scale:n.endScale})}else f===`dot`?p=connectorDot({line:d,scale:n.endScale}):(!f||f===`none`)&&this.connector&&this.connector.select(`.connector-end`).remove();return p.components&&(p.components.forEach(function(t){t.attrs.fill=e.annotation.color,t.attrs.stroke=e.annotation.color}),c=c.concat(p.components)),this.editMode&&u.length!==0&&c.push({type:`handle`,handles:u}),c}},{key:`drawNote`,value:function drawNote(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.annotation.note,r=n.align||t.align||`dynamic`,i={bbox:t.bbox,align:r,offset:this.annotation.offset},a=n.lineType||t.lineType,s={};a===`vertical`?s=noteVertical(i):a===`horizontal`&&(s=noteHorizontal(i));var c=s,l=c.components,u=l===void 0?[]:l,d=c.handles,f=d===void 0?[]:d;if(u.forEach(function(t){t.attrs.stroke=e.annotation.color}),this.editMode){f=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),u.push({type:`handle`,handles:f});var p=this.dragNote.bind(this),m=this.dragstarted.bind(this),h=this.dragended.bind(this);this.note.call((0,o.drag)().container((0,o.select)(`g.annotations`).node()).on(`start`,function(e){return m(e)}).on(`drag`,function(e){return p(e)}).on(`end`,function(e){return h(e)}))}else this.note.on(`mousedown.drag`,null);return u}},{key:`drawNoteContent`,value:function drawNoteContent(e){var t=this.annotation.note,n=t.padding===void 0?this.notePadding:t.padding,r=t.orientation||e.orientation||`topBottom`,i=t.lineType||e.lineType,a=t.align||e.align||`dynamic`;i===`vertical`?r=`leftRight`:i===`horizontal`&&(r=`topBottom`);var o=noteAlignment({padding:n,bbox:e.bbox,offset:this.annotation.offset,orientation:r,align:a}),s=o.x,c=o.y;return this.offsetCornerX=s+this.annotation.dx,this.offsetCornerY=c+this.annotation.dy,this.note&&this.noteContent.attr(`transform`,`translate(`+s+`, `+c+`)`),[]}},{key:`drawOnScreen`,value:function drawOnScreen(e,t){return this.drawOnSVG(e,t)}},{key:`redrawSubject`,value:function redrawSubject(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())}},{key:`redrawConnector`,value:function redrawConnector(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())}},{key:`redrawNote`,value:function redrawNote(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:e})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:e}))}},{key:`setPosition`,value:function setPosition(){var e=this.annotation.position;this.a.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`)}},{key:`clearComponents`,value:function clearComponents(){this.subject&&this.subject.select(`*`).remove(),this.connector&&this.connector.select(`*`).remove()}},{key:`setOffset`,value:function setOffset(){if(this.note){var e=this.annotation.offset;this.note.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`)}}},{key:`setPositionWithAccessors`,value:function setPositionWithAccessors(e){e&&this.annotation.data&&(this.mapX(e),this.mapY(e)),this.setPosition()}},{key:`setClassName`,value:function setClassName(){this.a.attr(`class`,`annotation `+(this.className&&this.className())+` `+(this.editMode?`editable`:``)+` `+(this.annotation.className||``))}},{key:`draw`,value:function draw(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()}},{key:`dragstarted`,value:function dragstarted(){o.event.sourceEvent.stopPropagation(),this.dispatcher&&this.dispatcher.call(`dragstart`,this.a,this.annotation),this.a.classed(`dragging`,!0),this.a.selectAll(`circle.handle`).style(`pointer-events`,`none`)}},{key:`dragended`,value:function dragended(){this.dispatcher&&this.dispatcher.call(`dragend`,this.a,this.annotation),this.a.classed(`dragging`,!1),this.a.selectAll(`circle.handle`).style(`pointer-events`,`all`)}},{key:`dragSubject`,value:function dragSubject(){var e=this.annotation.position;e.x+=o.event.dx,e.y+=o.event.dy,this.annotation.position=e}},{key:`dragNote`,value:function dragNote(){var e=this.annotation.offset;e.x+=o.event.dx,e.y+=o.event.dy,this.annotation.offset=e}},{key:`mapHandles`,value:function mapHandles(e){var t=this;return e.map(function(e){return X({},e,{start:t.dragstarted.bind(t),end:t.dragended.bind(t)})})}}]),Type}(),ht=function customType(e,t,n){return function(e){inherits(customType,e);function customType(e){classCallCheck(this,customType);var n=possibleConstructorReturn(this,(customType.__proto__||Object.getPrototypeOf(customType)).call(this,e));return n.typeSettings=t,t.disable&&t.disable.forEach(function(e){n[e]&&n[e].remove(),n[e]=void 0,e===`note`&&(n.noteContent=void 0)}),n}return et(customType,[{key:`className`,value:function className(){return``+(t.className||tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`className`,this)&&tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`className`,this).call(this)||``)}},{key:`drawSubject`,value:function drawSubject(e){return this.typeSettings.subject=X({},t.subject,this.typeSettings.subject),tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawSubject`,this).call(this,X({},e,this.typeSettings.subject))}},{key:`drawConnector`,value:function drawConnector(e){return this.typeSettings.connector=X({},t.connector,this.typeSettings.connector),tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawConnector`,this).call(this,X({},e,t.connector,this.typeSettings.connector))}},{key:`drawNote`,value:function drawNote(e){return this.typeSettings.note=X({},t.note,this.typeSettings.note),tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawNote`,this).call(this,X({},e,t.note,this.typeSettings.note))}},{key:`drawNoteContent`,value:function drawNoteContent(e){return tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawNoteContent`,this).call(this,X({},e,t.note,this.typeSettings.note))}}],[{key:`init`,value:function init(e,t){return tt(customType.__proto__||Object.getPrototypeOf(customType),`init`,this).call(this,e,t),n&&(e=n(e,t)),e}}]),customType}(e)},gt=function(e){inherits(d3NoteText,e);function d3NoteText(e){classCallCheck(this,d3NoteText);var t=possibleConstructorReturn(this,(d3NoteText.__proto__||Object.getPrototypeOf(d3NoteText)).call(this,e));return t.textWrap=e.textWrap||120,t.drawText(),t}return et(d3NoteText,[{key:`updateTextWrap`,value:function updateTextWrap(e){this.textWrap=e,this.drawText()}},{key:`drawText`,value:function drawText(){if(this.note){Q(this.note,[this.annotation],`g`,`annotation-note-content`);var e=this.note.select(`g.annotation-note-content`);Q(e,[this.annotation],`rect`,`annotation-note-bg`),Q(e,[this.annotation],`text`,`annotation-note-label`),Q(e,[this.annotation],`text`,`annotation-note-title`);var t={height:0},n=this.a.select(`text.annotation-note-label`),r=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,i=this.annotation.note&&this.annotation.note.wrapSplitter||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrapSplitter,a=this.annotation.note&&this.annotation.note.bgPadding||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.bgPadding,o={top:0,bottom:0,left:0,right:0};if(typeof a==`number`?o={top:a,bottom:a,left:a,right:a}:a&&(a===void 0?`undefined`:$e(a))===`object`&&(o=X(o,a)),this.annotation.note.title){var s=this.a.select(`text.annotation-note-title`);s.text(this.annotation.note.title),s.attr(`fill`,this.annotation.color),s.attr(`font-weight`,`bold`),s.call(bt,r,i),t=s.node().getBBox()}n.text(this.annotation.note.label).attr(`dx`,`0`),n.call(bt,r,i),n.attr(`y`,t.height*1.1||0),n.attr(`fill`,this.annotation.color);var c=this.getNoteBBox();this.a.select(`rect.annotation-note-bg`).attr(`width`,c.width+o.left+o.right).attr(`height`,c.height+o.top+o.bottom).attr(`x`,c.x-o.left).attr(`y`,-o.top).attr(`fill`,`white`).attr(`fill-opacity`,0)}}}]),d3NoteText}(mt);ht(gt,{className:`label`,note:{align:`middle`}});var _t=ht(gt,{className:`callout`,note:{lineType:`horizontal`}}),vt=ht(_t,{className:`callout elbow`,connector:{type:`elbow`}});ht(_t,{className:`callout curve`,connector:{type:`curve`}}),ht(mt,{className:`badge`,subject:{type:`badge`},disable:[`connector`,`note`]}),ht(gt,{className:`callout circle`,subject:{type:`circle`},note:{lineType:`horizontal`},connector:{type:`elbow`}}),ht(gt,{className:`callout rect`,subject:{type:`rect`},note:{lineType:`horizontal`},connector:{type:`elbow`}}),ht(function(e){inherits(ThresholdMap,e);function ThresholdMap(){return classCallCheck(this,ThresholdMap),possibleConstructorReturn(this,(ThresholdMap.__proto__||Object.getPrototypeOf(ThresholdMap)).apply(this,arguments))}return et(ThresholdMap,[{key:`mapY`,value:function mapY(e){tt(ThresholdMap.prototype.__proto__||Object.getPrototypeOf(ThresholdMap.prototype),`mapY`,this).call(this,e);var t=this.annotation;(t.subject.x1||t.subject.x2)&&t.data&&e.y&&(t.y=e.y(t.data)),(t.subject.x1||t.subject.x2)&&!t.x&&(t.x=t.subject.x1||t.subject.x2)}},{key:`mapX`,value:function mapX(e){tt(ThresholdMap.prototype.__proto__||Object.getPrototypeOf(ThresholdMap.prototype),`mapX`,this).call(this,e);var t=this.annotation;(t.subject.y1||t.subject.y2)&&t.data&&e.x&&(t.x=e.x(t.data)),(t.subject.y1||t.subject.y2)&&!t.y&&(t.y=t.subject.y1||t.subject.y2)}}]),ThresholdMap}(_t),{className:`callout xythreshold`,subject:{type:`threshold`}});var Q=function newWithClass(e,t,n,r,i){var a=e.selectAll(n+`.`+(i||r)).data(t);return a.enter().append(n).merge(a).attr(`class`,r),a.exit().remove(),e},yt=function addHandlers(e,t,n){var r=n.component,i=n.name;r&&r.on(`mouseover.annotations`,function(){e.call(i+`over`,r,t)}).on(`mouseout.annotations`,function(){return e.call(i+`out`,r,t)}).on(`click.annotations`,function(){return e.call(i+`click`,r,t)})},bt=function wrap(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1.2;e.each(function(){for(var e=(0,o.select)(this),i=e.text().split(n||/[ \t\r\n]+/).reverse().filter(function(e){return e!==``}),a=void 0,s=[],c=e.text(null).append(`tspan`).attr(`x`,0).attr(`dy`,`0.8em`);a=i.pop();)s.push(a),c.text(s.join(` `)),c.node().getComputedTextLength()>t&&s.length>1&&(s.pop(),c.text(s.join(` `)),s=[a],c=e.append(`tspan`).attr(`x`,0).attr(`dy`,r+`em`).text(a))})},xt=function bboxWithoutHandles(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`:not(.handle)`;return e?e.selectAll(t).nodes().reduce(function(e,t){var n=t.getBBox();e.x=Math.min(e.x,n.x),e.y=Math.min(e.y,n.y),e.width=Math.max(e.width,n.width);var r=t&&t.attributes&&t.attributes.y;return e.height=Math.max(e.height,(r&&parseFloat(r.value)||0)+n.height),e},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}};function annotation(){var e=[],t=void 0,n=void 0,r=[],i={},a={},s=!1,c=void 0,l=_t,u=void 0,d=void 0,f=(0,o.dispatch)(`subjectover`,`subjectout`,`subjectclick`,`connectorover`,`connectorout`,`connectorclick`,`noteover`,`noteout`,`noteclick`,`dragend`,`dragstart`),p=void 0,m=function annotation(n){p=n,s||n.selectAll(`circle.handle`).remove();var m=e.map(function(e){return e.type||=l,e.disable||=r,new nt(e)});t||=new rt({annotations:m,accessors:i,accessorsInverse:a,ids:c}),n.selectAll(`g`).data([t]).enter().append(`g`).attr(`class`,`annotations`);var h=n.select(`g.annotations`);Q(h,t.annotations,`g`,`annotation`),h.selectAll(`g.annotation`).each(function(e){var t=(0,o.select)(this);t.attr(`class`,`annotation`),Q(t,[e],`g`,`annotation-connector`),Q(t,[e],`g`,`annotation-subject`),Q(t,[e],`g`,`annotation-note`),Q(t.select(`g.annotation-note`),[e],`g`,`annotation-note-content`),e.type=e.type.toString()===`[object Object]`?e.type:new e.type({a:t,annotation:e,textWrap:u,notePadding:d,editMode:s,dispatcher:f,accessors:i}),e.type.draw(),e.type.drawText&&e.type.drawText()})};return m.json=function(){return console.log(`Annotations JSON was copied to your clipboard. Please note the annotation type is not JSON compatible. It appears in the objects array in the console, but not in the copied JSON.`,t.json),window.copy(JSON.stringify(t.json.map(function(e){return delete e.type,e}))),m},m.update=function(){return e&&t&&(e=t.annotations.map(function(e){return e.type.draw(),e})),m},m.updateText=function(){return t&&(t.updateText(u),e=t.annotations),m},m.updatedAccessors=function(){return t.setPositionWithAccessors(),e=t.annotations,m},m.disable=function(n){return arguments.length?(r=n,t&&(t.updateDisable(r),e=t.annotations),m):r},m.textWrap=function(n){return arguments.length?(u=n,t&&(t.updateTextWrap(u),e=t.annotations),m):u},m.notePadding=function(n){return arguments.length?(d=n,t&&(t.updateNotePadding(d),e=t.annotations),m):d},m.type=function(n,r){return arguments.length?(l=n,t&&(t.annotations.map(function(e){e.type.note&&e.type.note.selectAll(`*:not(.annotation-note-content)`).remove(),e.type.noteContent&&e.type.noteContent.selectAll(`*`).remove(),e.type.subject&&e.type.subject.selectAll(`*`).remove(),e.type.connector&&e.type.connector.selectAll(`*`).remove(),e.type.typeSettings={},e.type=l,e.subject=r&&r.subject||e.subject,e.connector=r&&r.connector||e.connector,e.note=r&&r.note||e.note}),e=t.annotations),m):l},m.annotations=function(n){return arguments.length?(e=n,t&&t.annotations&&(e.some(function(e){return!e.type||e.type.toString()!==`[object Object]`})?(t=null,m(p)):t.annotations=e),m):t&&t.annotations||e},m.context=function(e){return arguments.length?(n=e,m):n},m.accessors=function(e){return arguments.length?(i=e,m):i},m.accessorsInverse=function(e){return arguments.length?(a=e,m):a},m.ids=function(e){return arguments.length?(c=e,m):c},m.editMode=function(n){return arguments.length?(s=n,p&&p.selectAll(`g.annotation`).classed(`editable`,s),t&&(t.editMode(s),e=t.annotations),m):s},m.collection=function(e){return arguments.length?(t=e,m):t},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m}function value2Angle(e){return(e-.5)*.65*2*Math.PI}function pointOnArc(e,t){return{x:Math.cos(e-Math.PI/2)*t,y:Math.sin(e-Math.PI/2)*t}}function indicatorTranslate(e,t,n=!1){let r=pointOnArc(e,t),i=e*180/Math.PI+(n===!0?180:0);return`translate(${r.x}, ${r.y}) rotate(${i})`}function indicatorTween(e,t,n=!1){return function(r){let i=(0,o.interpolate)(r.angle,e);return r.angle=e,function(e){return indicatorTranslate(i(e),t,n)}}}function arcTween(e,t,n){return function(r){let i=(0,o.interpolate)(r.startAngle,e),a=(0,o.interpolate)(r.endAngle,t);return function(e){return r.startAngle=i(e),r.endAngle=a(e),n(r)}}}var $=class Gauge extends o.SVGWidget{_d3Arc=arc_default$1().innerRadius(85).outerRadius(100);_colorScale=(0,o.scaleLinear)().interpolate(o.interpolateHcl);_usageArc;_meanArc;_freeArc;_indInner;_indOuter;_centerTextG;_centerText;_bottomText;_tooltipG;_mainTooltip;constructor(){super()}tip(e){if(e===null||e.label===``)this._tooltipG.transition().style(`opacity`,0).on(`interrupt end`,()=>{this._tooltipG.selectAll(`g`).remove()});else{this._tooltipG.interrupt().style(`opacity`,1),e.w=this._centerText.datum().w+10;let t=`horizontal`,n=0,r=5,i=5;e.y>=5&&e.y<=25?(n=e.x<0?-e.w/2:e.w/2,r=12.5,i=void 0,t=`vertical`):e.y>25&&(r=25,i=0);let a=annotation().type(vt).annotations([{data:e,dx:-e.x+n,dy:-e.y+r,color:`black`,note:{label:e.label,lineType:t,padding:i,align:`middle`}}]).accessors({x:e=>e.x,y:e=>e.y});this._tooltipG.call(a)}}calcSize(e,t,n){let r=e.node().getBBox(),i=t/r.width,a=n/r.height,o=i<a?i:a;return{width:r.width,height:r.height,scale:o}}updateText(e,t,n,r,i){e.datum({x:t,y:n,w:r,h:i}).attr(`transform`,null);let a=this.calcSize(e,r,i),o=t+r/2-a.width/2*a.scale,s=n+i/2-a.height/2*a.scale;e.attr(`transform`,`translate(${o}, ${s}) scale(${a.scale})`)}calcWidth(){return Math.min(this.width(),this.height(),this.maxDiameter())}enter(e,t){super.enter(e,t),t.on(`click`,e=>{this.click(e)}),this._usageArc=t.append(`path`).datum({startAngle:value2Angle(0),endAngle:value2Angle(0)}).style(`fill`,`green`).on(`mousemove`,e=>{let[t,n]=this._d3Arc.centroid(e);this.tip({x:t,y:n,label:this.valueDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._freeArc=t.append(`path`).datum({startAngle:value2Angle(0),endAngle:value2Angle(1)}).style(`fill`,`lightGrey`),this._meanArc=t.append(`path`).datum({startAngle:value2Angle(0),endAngle:value2Angle(0)}).style(`fill`,`black`).on(`mousemove`,e=>{let[t,n]=this._d3Arc.centroid(e);this.tip({x:t,y:n,label:this.tickValueDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._mainTooltip=t.append(`title`);let n=this;function appendIndicator(){return t.append(`path`).datum({angle:value2Angle(0)}).style(`fill`,`black`).style(`stroke`,`black`).attr(`d`,`M 0 0 l -3 -3 l 6 0 z`).on(`mousemove`,e=>{let[t,r]=n._d3Arc.centroid(n._meanArc.datum());n.tip({x:t,y:r,label:n.tickValueDescription()})}).on(`mouseout`,e=>{n.tip(null)})}this._indInner=appendIndicator(),this._indOuter=appendIndicator(),this._centerText=t.append(`text`).attr(`dy`,`.66em`).style(`fill`,`green`).on(`mousemove`,e=>{this.tip({x:0,y:0,label:this.valueDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._bottomText=t.append(`text`).attr(`dy`,`.66em`).on(`mousemove`,e=>{this.tip({x:0,y:e.y,label:this.titleDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._tooltipG=t.append(`g`).attr(`class`,`annotation-tip`)}update(e,t){super.update(e,t),this._colorScale.domain(this.colorDomain()).range(this.colorRange()),t.attr(`title`,this.tooltip()).style(`cursor`,this.click===Gauge.prototype.click?null:`pointer`);let n=this.calcWidth()/3,r=this.calcWidth()/2-5;this._d3Arc.innerRadius(n).outerRadius(r);let i=this.value(),a=this.tickValue();this._usageArc.style(`fill`,this._colorScale(i)).transition().duration(750).attrTween(`d`,arcTween(value2Angle(0),value2Angle(i),this._d3Arc)),this._freeArc.style(`fill`,this.emptyColor()).transition().duration(750).attrTween(`d`,arcTween(value2Angle(i),value2Angle(1),this._d3Arc)),this._meanArc.style(`fill`,this.tickColor()).style(`visibility`,this.showTick()?`visible`:`hidden`).transition().duration(750).attrTween(`d`,arcTween(value2Angle(a-.001),value2Angle(a+.001),this._d3Arc)),this._indInner.style(`fill`,this.tickColor()).style(`stroke`,this.tickColor()).style(`visibility`,this.showTick()?`visible`:`hidden`).transition().duration(750).attrTween(`transform`,indicatorTween(value2Angle(a),n,!0)),this._indOuter.style(`fill`,this.tickColor()).style(`stroke`,this.tickColor()).style(`visibility`,this.showTick()?`visible`:`hidden`).transition().duration(750).attrTween(`transform`,indicatorTween(value2Angle(a),r)),this._centerText.style(`fill`,this._colorScale(i)).text((0,o.format)(`.0%`)(i)),this._bottomText.style(`fill`,this.click===Gauge.prototype.click?this.titleColor():this.titleClickColor()).style(`text-decoration`,this.click===Gauge.prototype.click?null:`underline`).text(this.title());let s=pointOnArc(value2Angle(1),n-8);this.updateText(this._centerText,-s.x,-s.y,2*s.x,2*s.y);let c=pointOnArc(value2Angle(1),r);c.y+=5;let l=this.calcWidth()-20,u=this.calcWidth()/2-c.y-5;this.updateText(this._bottomText,-l/2,c.y,l,u),this._mainTooltip.text(this.tooltip())}click(e){}};$.prototype._class+=` chart_Gauge`,$.prototype.publish(`title`,``,`string`,`Title`),$.prototype.publish(`titleDescription`,``,`string`,`Title Description`),$.prototype.publish(`titleColor`,`black`,`html-color`,`Color of the title text`),$.prototype.publish(`titleClickColor`,`blue`,`html-color`,`Color of the title text when clickable`),$.prototype.publish(`maxDiameter`,128,`number`,`Max Diameter`),$.prototype.publish(`value`,0,`number`,`Value`),$.prototype.publish(`valueDescription`,``,`string`,`Value Description`),$.prototype.publish(`showTick`,!1,`boolean`,`Show Tick`),$.prototype.publish(`tickValue`,0,`number`,`Tick Value`),$.prototype.publish(`tickValueDescription`,``,`string`,`Tick Value Description`),$.prototype.publish(`tooltip`,``,`string`,`Tooltip`),$.prototype.publish(`colorRange`,[`green`,`green`,`green`,`green`,`green`,`green`,`green`,`green`,`orange`,`red`,`red`],`array`,`Array of colors for the filled gauge portion. The fill color will be relative to the gauge value.`),$.prototype.publish(`colorDomain`,[0,.1,.2,.3,.4,.5,.6,.7,.8,.9,1],`array`,`This array augments the mapping of the value to the fill colorRange.`),$.prototype.publish(`emptyColor`,`lightgrey`,`html-color`,`Color of the empty portion of the gauge`),$.prototype.publish(`tickColor`,`black`,`html-color`,`Color of the tick`);var sortAscending=(e,t)=>e[1]-t[1]>0?1:-1,sortDescending=(e,t)=>e[1]-t[1]>0?-1:1,Pie=class extends o.SVGWidget{static __inputs=[{id:`label`,type:`string`},{id:`value`,type:`number`}];_totalValue;d3Pie;d3Arc;d3LabelArc;_labelPositions;_smallValueLabelHeight;_labelWidthLimit;_quadIdxArr;_minLabelTop=0;_maxLabelBottom=0;_seriesValueFormatter;_seriesPercentageFormatter;constructor(){super(),I2DChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this),this.d3Pie=pie_default(),this.d3Arc=arc_default$1(),this.d3LabelArc=arc_default$1(),this.tooltipTick_default(!1).tooltipOffset_default(0)}intersection(e,t){return this.intersectCircle(this.calcOuterRadius(),e,t)}calcInnerRadius(){return this.innerRadius_exists()?this.calcOuterRadius()*this.innerRadius()/100:0}calcOuterRadius(){let e=this.textSize(this.data().map(e=>this.getLabelText({data:e},!1)),`Verdana`,12).width,t=this._size.width-(this.showLabels()?e*2:0)-20,n=this._size.height-36-(this.showLabels()?this._smallValueLabelHeight:0),r=Math.min(t,n)/2-2;return t/2-2<this.minOuterRadius()?this._labelWidthLimit=e-(this.minOuterRadius()-(t/2-2)):this._labelWidthLimit=e,r<this.minOuterRadius()?this.minOuterRadius():r}calcSmallValueLabelHeight(){let e=this.data().reduce((e,t)=>e+t[1],0),t=0;return this.data().forEach(n=>{n[1]/e<.1&&t++}),this.labelHeight()*t}calcTotalValue(){return this.data().reduce((e,t)=>e+t[1],0)}calcPadAngleRadians(){let e=this.slicePadding();return e>0?Math.min(e,.05):0}getLabelText(e,t){let n,r=e.data[0];if(this._labelWidthLimit!==void 0&&t){let e=this.textSize(r,`Verdana`,this.labelHeight()).width;this._labelWidthLimit<e&&(n=r.length*(this._labelWidthLimit/e)-3,r=n<r.length?r.slice(0,n)+`...`:r)}if(this.showSeriesValue()&&(r+=` : ${this._seriesValueFormatter(e.data[1])}`),this.showSeriesPercentage()){let t=this._totalValue,n=this.dataMeta();n.sum!==void 0&&(t=n.sum);let i=e.data[1]/t*100;r+=` : ${this._seriesPercentageFormatter(i)}%`}return r}selection(e){if(!arguments.length)try{return this._selection.selection2()[0]?.data}catch{return}let t=JSON.stringify(e);this._selection.selection2(e=>t===JSON.stringify(e.data))}selectByLabel(e){let t=this.data().filter(t=>t[0]===e)[0];t&&this.selection(t)}_slices;_labels;enter(e,t){super.enter(e,t),this._selection.widgetElement(t).skipBringToTop(!0),this._slices=t.append(`g`),this._labels=t.append(`g`);let n=this;this.tooltipHTML(function(e){switch(n.tooltipStyle()){case`series-table`:return n.tooltipFormat({label:e.data[0],arr:n.columns().slice(1).map(function(t,r){return{label:t,color:n._palette(e.data[0]),value:e.data[r+1]}})});default:return n.tooltipFormat({label:e.data[0],value:e.data[1]})}})}update(e,t){this.selectionGlow(!this.tabNavigation()),super.update(e,t);let n=this;this.updateD3Pie(),this._palette=this._palette.switch(this.paletteID()),this._seriesValueFormatter=(0,o.format)(this.seriesValueFormat()),this._seriesPercentageFormatter=(0,o.format)(this.seriesPercentageFormat()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._smallValueLabelHeight=this.calcSmallValueLabelHeight(),this._totalValue=this.calcTotalValue();let r=this.calcOuterRadius(),i=Math.max(this.calcInnerRadius(),Math.min(r/30,6)),a=r+12;this.d3Arc.innerRadius(i).padRadius(r).outerRadius(r).padAngle(this.calcPadAngleRadians()),this._quadIdxArr=[[],[],[],[]];let s=[...this.data()];switch(this.sortDataByValue()){case`ascending`:s.sort(sortAscending);break;case`descending`:s.sort(sortDescending);break}let c=this._slices.selectAll(`.arc`).data(this.d3Pie(s),e=>e.data[0]);this._labelPositions=[],c.enter().append(`g`).attr(`class`,(e,t)=>`arc series series-`+this.cssTag(e.data[0])).attr(`opacity`,0).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n.click(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))}).on(`dblclick`,function(e){n.dblclick(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))}).on(`keydown`,function(e,t){let r=(0,o.d3Event)();n.tabNavigation()&&(r.code===`Space`||r.key===`Enter`)&&(r.preventDefault(),n._selection.click(this))}).each(function(e,t){(0,o.select)(this).append(`path`).on(`mouseout.tooltip`,n.tooltip.hide).on(`mousemove.tooltip`,n.tooltip.show).on(`mouseover`,arcTween(0,0)).on(`mouseout`,arcTween(-5,150))}).merge(c).transition().attr(`opacity`,1).attr(`tabindex`,n.tabNavigation()?`0`:null).attr(`role`,n.tabNavigation()?`button`:null).attr(`aria-label`,n.tabNavigation()?e=>`${e.data[0]}: ${e.data[1]}`:null).each(function(e,t){let i=n.getQuadrant(midAngle(e));n._quadIdxArr[i].push(t),e.outerRadius=r-5,(0,o.select)(this).select(`path`).transition().attr(`d`,n.d3Arc).style(`fill`,n.fillColor(e.data,n.columns()[1],e.data[1]))}),c.exit().transition().style(`opacity`,0).remove(),this.d3LabelArc.innerRadius(a).outerRadius(a);let l=this._labels.selectAll(`text`).data(this.showLabels()?this.d3Pie(s):[],e=>e.data[0]),u=l.enter().append(`text`).on(`mouseout.tooltip`,n.tooltip.hide).on(`mousemove.tooltip`,n.tooltip.show).attr(`dy`,`.5em`).on(`click`,function(e){n._slices.selectAll(`g`).filter(function(t){e.data===t.data&&(n._selection.click(this),n.click(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this)))})}).on(`dblclick`,function(e){n._slices.selectAll(`g`).filter(function(t){e.data===t.data&&n.dblclick(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))})}).merge(l).text(e=>this.getLabelText(e,!0)).each(function(e,t){let r=n.d3LabelArc.centroid(e),i=midAngle(e);r[0]=a*(n.isLeftSide(i)?1:-1),n._labelPositions.push({top:r[1],bottom:r[1]+n.labelHeight()})});this.showLabels()&&(this.adjustForOverlap(),u.transition().style(`font-size`,this.labelHeight()+`px`).attr(`transform`,(e,t)=>{let r=n.d3LabelArc.centroid(e);return r[0]=a*(n.isLeftSide(midAngle(e))?1:-1),r[1]=n._labelPositions[t].top,`translate(`+r+`)`}).style(`text-anchor`,e=>this.isLeftSide(midAngle(e))?`start`:`end`)),l.exit().remove();let d=this._labels.selectAll(`polyline`).data(this.showLabels()?this.d3Pie(s):[],e=>this.getLabelText(e,!0));d.enter().append(`polyline`).merge(d).transition().attr(`points`,function(e,t){let r=n.d3LabelArc.centroid(e),i=n.d3Arc.centroid(e),o=[...r];return r[0]=a*(n.isLeftSide(midAngle(e))?1:-1),r[1]=n._labelPositions[t].top,[i,o,r]}),d.exit().remove(),this.showLabels()&&this.centerOnLabels();function midAngle(e){return e.startAngle+(e.endAngle-e.startAngle)/2}function arcTween(e,t){return function(){(0,o.select)(this).transition().delay(t).attrTween(`d`,function(t){let i=(0,o.interpolate)(t.outerRadius,r+e);return function(e){return t.outerRadius=i(e),n.d3Arc(t)}})}}}isLeftSide(e){return e=(0,a.normalizeRadians)(e),e>Math.PI*2?e:e<Math.PI&&e>0}getQuadrant(e){let t=0,n=(0,a.normalizeRadians)(e);return t=n<=Math.PI*1&&n>=Math.PI*.5?3:t,t=n<=Math.PI*.5&&n>=Math.PI*0?2:t,t=n<=Math.PI*0&&n>=Math.PI*-.5?1:t,t}centerOnLabels(){let e=this.pos().y,t=e*2,n=this.calcOuterRadius(),r=Math.min(this._minLabelTop,-n),i=Math.max(this._maxLabelBottom,n),a=t-(i-r),o=Math.abs(this._minLabelTop),s=0;i>e?(s=e-i+this.labelHeight()/2,s-=a/2):r<0&&o>e&&(s=o-e+this.labelHeight()/2,s+=a/2);let c=this.pos();this.pos({y:c.y+s,x:c.x})}adjustForOverlap(){let e=this.labelHeight();this._quadIdxArr.forEach((t,n)=>{this._quadIdxArr[n].sort((e,t)=>{if(n===1||n===2)return this._labelPositions[e].top>this._labelPositions[t].top?-1:1;if(n===0||n===3)return this._labelPositions[e].top>this._labelPositions[t].top?1:-1});let r;this._quadIdxArr[n].forEach((t,i)=>{if(i>0){if(n===1||n===2){if(r<this._labelPositions[t].bottom){let e=this._labelPositions[t].bottom-r;this._labelPositions[t].top-=e,this._labelPositions[t].bottom-=e}}else if((n===0||n===3)&&r+e>this._labelPositions[t].top){let n=Math.abs(this._labelPositions[t].top)-Math.abs(r+e);this._labelPositions[t].top-=n,this._labelPositions[t].bottom-=n}}r=this._labelPositions[t].top})}),this._minLabelTop=0,this._maxLabelBottom=0,this._quadIdxArr.forEach((e,t)=>{this._quadIdxArr[t].forEach((e,t)=>{this._minLabelTop>this._labelPositions[e].top&&(this._minLabelTop=this._labelPositions[e].top),this._maxLabelBottom<this._labelPositions[e].bottom&&(this._maxLabelBottom=this._labelPositions[e].bottom)})})}exit(e,t){super.exit(e,t)}updateD3Pie(){let e=(0,a.normalizeRadians)((0,a.degreesToRadians)(this.startAngle()));switch(this.sortDataByValue()){case`ascending`:this.d3Pie.sort(sortAscending);break;case`descending`:this.d3Pie.sort(sortDescending);break;default:this.d3Pie.sort(null)}this.d3Pie.padAngle(this.calcPadAngleRadians()).startAngle(e).endAngle(2*Math.PI+e).value(function(e){return e[1]})}};Pie.prototype._class+=` chart_Pie`,Pie.prototype.implements(I2DChart.prototype),Pie.prototype.implements(ITooltip.prototype),Pie.prototype.mixin(o.Utility.SimpleSelectionMixin),Pie.prototype.publish(`showLabels`,!0,`boolean`,`If true, wedge labels will display`),Pie.prototype.publish(`showSeriesValue`,!1,`boolean`,`Append data series value next to label`,null,{disable:e=>!e.showLabels()}),Pie.prototype.publish(`seriesValueFormat`,`,.0f`,`string`,`Number format used for formatting series values`,null,{disable:e=>!e.showSeriesValue()}),Pie.prototype.publish(`showSeriesPercentage`,!1,`boolean`,`Append data series percentage next to label`,null,{disable:e=>!e.showLabels()}),Pie.prototype.publish(`seriesPercentageFormat`,`,.0f`,`string`,`Number format used for formatting series percentages`,null,{disable:e=>!e.showSeriesPercentage()}),Pie.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Pie.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Pie.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Pie.prototype.publish(`innerRadius`,0,`number`,`Sets inner pie hole radius as a percentage of the radius of the pie chart`,null,{tags:[`Basic`],range:{min:0,step:1,max:100}}),Pie.prototype.publish(`minOuterRadius`,20,`number`,`Minimum outer radius (pixels)`),Pie.prototype.publish(`startAngle`,0,`number`,`Starting angle of the first (and largest) wedge (degrees)`),Pie.prototype.publish(`labelHeight`,12,`number`,`Font size of labels (pixels)`,null,{disable:e=>!e.showLabels()}),Pie.prototype.publish(`slicePadding`,.01,`number`,`Padding between pie slices (converted to pixels)`,null,{tags:[`Basic`],range:{min:0,step:.01,max:.2}}),Pie.prototype.publish(`sortDataByValue`,`descending`,`set`,`Sort data by value`,[`none`,`ascending`,`descending`]),Pie.prototype.publish(`tabNavigation`,!1,`boolean`,`Enable or disable tab navigation`);var HalfPie=class extends Pie{constructor(){super()}postUpdate(e,t){super.postUpdate(e,t);let n=this._pos.x,r=this._pos.y;this._drawStartPos===`origin`&&this._target instanceof SVGElement&&(n-=this._size.width/2,r-=this._size.height/2),r+=this._size.height/4,this._element.attr(`transform`,`translate(`+n+`,`+r+`)scale(`+this._widgetScale+`)`)}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(-Math.PI/2).endAngle(Math.PI/2)}};HalfPie.prototype._class+=` chart_HalfPie`;var Heat=class extends XYAxis{_domForeignObject;_domCanvas;_heat;constructor(){super(),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}radius(e){return this.radiusX(e),this.radiusY(e),this}layerEnter(e,t,n=250){super.layerEnter(e,t,n),this._domForeignObject=this.svg.insert(`foreignObject`,`#${this.id()+`_clippath`}`),this._domCanvas=this._domForeignObject.append(`xhtml:body`).style(`margin`,`0px`).style(`padding`,`0px`).style(`background-color`,`transparent`).append(`canvas`),this._heat=simpleheat(this._domCanvas.node())}layerUpdate(e,t,n=250){super.layerUpdate(e,t),this._palette=this._palette.switch(this.paletteID());let r=this.width()-this.margin.left-this.margin.right;r<0&&(r=0);let i=this.height()-this.margin.top-this.margin.bottom;i<0&&(i=0),this._domForeignObject.attr(`x`,this.margin.left).attr(`y`,this.margin.top).attr(`width`,r).attr(`height`,i),this._domCanvas.attr(`width`,r).attr(`height`,i);let a=e.orientation()===`horizontal`?this.data().map(t=>[e.dataPos(t[0]),e.valuePos(t[1]),t[2]]):this.data().map(t=>[e.valuePos(t[1]),e.dataPos(t[0]),t[2]]),s=this.maxWeight_exists()?this.maxWeight():(0,o.max)(a,e=>e[2]);if(this.paletteID()!=="default"){let e={},t=this.reversePalette();for(let n=0;n<8;++n)e[n/8]=this._palette((t?8-n:n)/8,0,1);this._heat.gradient(e)}else this._heat.gradient(this._heat.defaultGradient);this._heat.resize();let c=this.radiusAsPercent()?this.radiusX()*r/100:this.radiusX(),l=this.radiusAsPercent()?this.radiusY()*i/100:this.radiusY();this._heat.clear().radius(c,l,this.blur()).max(s).data(a).draw(this.minOpacity())}};Heat.prototype._class+=` chart_Heat`,Heat.prototype._palette=o.Palette.rainbow(`default`),Heat.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Heat.prototype._palette.switch(),{tags:[`Basic`]}),Heat.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Heat.prototype.publish(`reversePalette`,!1,`boolean`,`Reverse Palette Colors`,null,{disable:e=>e.paletteID()==="default"}),Heat.prototype.publish(`radiusX`,25,`number`,`Point X radius (25 by default)`),Heat.prototype.publish(`radiusY`,25,`number`,`Point Y radius (25 by default)`),Heat.prototype.publish(`radiusAsPercent`,!1,`boolean`,`Calculate RadiusX + RadiusY as % of size`),Heat.prototype.publish(`blur`,15,`number`,`Point blur radius (15 by default)`),Heat.prototype.publish(`maxWeight`,void 0,`number`,`Clamp max weight to value (optional), omitting uses max data point`,void 0,{optional:!0}),Heat.prototype.publish(`minOpacity`,.05,`number`,`Minimum point opacity (0.05 by default)`);function simpleheat(e){if(!(this instanceof simpleheat))return new simpleheat(e);this._canvas=e=typeof e==`string`?document.getElementById(e):e,this._ctx=e.getContext(`2d`),this._width=e.width,this._height=e.height,this._max=1,this._data=[]}simpleheat.prototype={defaultRadius:25,defaultGradient:{.4:`blue`,.6:`cyan`,.7:`lime`,.8:`yellow`,1:`red`},data:function(e){return this._data=e,this},max:function(e){return this._max=e,this},add:function(e){return this._data.push(e),this},clear:function(){return this._data=[],this},radius:function(e,t,n){n=n===void 0?15:n;let r=this._ellipse=this._createCanvas(),i=r.getContext(`2d`),a=this._r=e+n,o=this._r=t+n;return r.width=a*2,r.height=o*2,i.shadowOffsetX=i.shadowOffsetY=a*2,i.shadowOffsetY=i.shadowOffsetY=o*2,i.shadowBlur=n,i.shadowColor=`black`,i.beginPath(),i.ellipse(-a,-o,e,t,0,0,Math.PI*2,!0),i.closePath(),i.fill(),this},resize:function(){this._width=this._canvas.width,this._height=this._canvas.height},gradient:function(e){let t=this._createCanvas(),n=t.getContext(`2d`),r=n.createLinearGradient(0,0,0,256);t.width=1,t.height=256;for(let t in e)r.addColorStop(+t,e[t]);return n.fillStyle=r,n.fillRect(0,0,1,256),this._grad=n.getImageData(0,0,1,256).data,this},draw:function(e){this._ellipse||this.radius(this.defaultRadius,this.defaultRadius),this._grad||this.gradient(this.defaultGradient);let t=this._ctx;t.clearRect(0,0,this._width,this._height);for(let n=0,r=this._data.length,i;n<r;n++)i=this._data[n],i[2]<0?i[2]=0:i[2]>this._max&&(i[2]=this._max),t.globalAlpha=Math.max(i[2]/this._max,e===void 0?.05:e),t.drawImage(this._ellipse,i[0]-this._r,i[1]-this._r);let n=t.getImageData(0,0,this._width,this._height);return this._colorize(n.data,this._grad),t.putImageData(n,0,0),this},_colorize:function(e,t){for(let n=0,r=e.length,i;n<r;n+=4)i=e[n+3]*4,i&&(e[n]=t[i],e[n+1]=t[i+1],e[n+2]=t[i+2])},_createCanvas:function(){return typeof document<`u`?document.createElement(`canvas`):new this._canvas.constructor}};var St=Math.PI/3,Ct=[0,St,2*St,3*St,4*St,5*St];function pointX(e){return e[0]}function pointY(e){return e[1]}function hexbin_default(){var e=0,t=0,n=1,r=1,i=pointX,a=pointY,o,s,c;function hexbin(e){var t={},n=[],r,o=e.length;for(r=0;r<o;++r)if(!(isNaN(u=+i.call(null,l=e[r],r,e))||isNaN(d=+a.call(null,l,r,e)))){var l,u,d,f=Math.round(d/=c),p=Math.round(u=u/s-(f&1)/2),m=d-f;if(Math.abs(m)*3>1){var h=u-p,g=p+(u<p?-1:1)/2,_=f+(d<f?-1:1),v=u-g,b=d-_;h*h+m*m>v*v+b*b&&(p=g+(f&1?1:-1)/2,f=_)}var S=p+`-`+f,C=t[S];C?C.push(l):(n.push(C=t[S]=[l]),C.x=(p+(f&1)/2)*s,C.y=f*c)}return n}function hexagon(e){var t=0,n=0;return Ct.map(function(r){var i=Math.sin(r)*e,a=-Math.cos(r)*e,o=i-t,s=a-n;return t=i,n=a,[o,s]})}return hexbin.hexagon=function(e){return`m`+hexagon(e==null?o:+e).join(`l`)+`z`},hexbin.centers=function(){for(var i=[],a=Math.round(t/c),l=Math.round(e/s),u=a*c;u<r+o;u+=c,++a)for(var d=l*s+(a&1)*s/2;d<n+s/2;d+=s)i.push([d,u]);return i},hexbin.mesh=function(){var e=hexagon(o).slice(0,4).join(`l`);return hexbin.centers().map(function(t){return`M`+t+`m`+e}).join(``)},hexbin.x=function(e){return arguments.length?(i=e,hexbin):i},hexbin.y=function(e){return arguments.length?(a=e,hexbin):a},hexbin.radius=function(e){return arguments.length?(o=+e,s=o*2*Math.sin(St),c=o*1.5,hexbin):o},hexbin.size=function(i){return arguments.length?(e=t=0,n=+i[0],r=+i[1],hexbin):[n-e,r-t]},hexbin.extent=function(i){return arguments.length?(e=+i[0][0],t=+i[0][1],n=+i[1][0],r=+i[1][1],hexbin):[[e,t],[n,r]]},hexbin.radius(1)}__name(hexbin_default,`default`);var HexBin=class extends XYAxis{static __inputs=[{id:`x`,type:`any`},{id:`y`,type:`number`}];_hexbin;_dataMinWeight;_dataMaxWeight;constructor(){super(),I2DAggrChart.call(this),this.tooltipValueFormat_default(`,.0f`),ITooltip.call(this),this.tooltipHTML(e=>{let t=(0,o.extent)(e,e=>e.label),n=(0,o.extent)(e,e=>e.value);return this.tooltipFormat({series:t[0]===t[1]?t[0]:`${t[0]} -> ${t[1]}`,label:n[0]===n[1]?n[0]:`${n[0]} -> ${n[1]}`,value:e.length})}),this._hexbin=hexbin_default().x(e=>e.x).y(e=>e.y),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default(`linear`)}xPos(e,t){return e.orientation()===`horizontal`?e.dataPos(t.label):e.valuePos(t.value)}yPos(e,t){return e.orientation()===`horizontal`?e.valuePos(t.value):e.dataPos(t.label)}layerUpdate(e,t,n=250){super.layerUpdate(e,t,n);let r=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._hexbin.extent([0,0],[this.width(),this.height()]).radius(this.binSize());let i=this.flattenData().map(t=>({x:r.xPos(e,t),y:r.yPos(e,t),label:e.parseData(t.label),value:e.parseValue(t.value),origRow:t})),a=this._hexbin(i),s=(0,o.min)(a,function(e){return e.length}),c=(0,o.max)(a,function(e){return e.length});this._dataMinWeight=s,this._dataMaxWeight=c;let l=t.selectAll(`.hexagon`).data(a,function(e){return e.i+`_`+e.j});l.enter().append(`path`).attr(`class`,`hexagon`).call(e._selection.enter.bind(e._selection)).on(`click`,function(t){let n=r.data();r.click(t.map(t=>e.rowToObj(n[t.origRow.rowIdx])),r.columns()[1],e._selection.selected(this))}).on(`dblclick`,function(t){let n=r.data();r.dblclick(t.map(t=>e.rowToObj(n[t.origRow.rowIdx])),r.columns()[1],e._selection.selected(this))}).on(`mouseout.tooltip`,r.tooltip.hide).on(`mousemove.tooltip`,r.tooltip.show).attr(`transform`,function(e){return`translate(`+e.x+`,`+e.y+`)scale(0)`}).merge(l).transition().duration(n).attr(`d`,this._hexbin.hexagon()).attr(`transform`,function(e){return`translate(`+e.x+`,`+e.y+`)scale(1)`}).style(`fill`,function(e){return r._palette(e.length,s,c)}),l.exit().transition().duration(n).attr(`transform`,function(e){return`translate(`+e.x+`,`+e.y+`)scale(0)`}).remove()}exit(e,t){super.exit(e,t)}click(e,t,n){}dblclick(e,t,n){}};HexBin.prototype._class+=` chart_HexBin`,HexBin.prototype.implements(I2DAggrChart.prototype),HexBin.prototype.implements(ITooltip.prototype),HexBin.prototype.publish(`paletteID`,`Blues`,`set`,`Color palette for this widget`,HexBin.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),HexBin.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),HexBin.prototype.publish(`binSize`,20,`number`,`Bin radius`,null,{range:{min:1,max:300,step:1}});var Line=class extends Scatter{constructor(){super(),this.interpolate_default(`linear`)}};Line.prototype._class+=` chart_Line`;var QuarterPie=class extends Pie{constructor(){super()}postUpdate(e,t){super.postUpdate(e,t);let n=this.orientation()===`left`?0:this._size.width,r=this._size.height;this._drawStartPos===`origin`&&this._target instanceof SVGElement&&(n-=this._size.width/2,r-=this._size.height/2),this._element.attr(`transform`,`translate(`+n+`,`+r+`)scale(`+this._widgetScale+`)`)}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(this.orientation()===`left`?0:-Math.PI/2).endAngle(this.orientation()===`left`?Math.PI/2:0)}calcOuterRadius(){let e=this.textSize(this.data().map(e=>this.getLabelText({data:e})),`Verdana`,12).width;return Math.min(this._size.width-e-10,this._size.height-36)-2}};QuarterPie.prototype._class+=` chart_QuarterPie`,QuarterPie.prototype.publish(`orientation`,`left`,`set`,`Determines the placement and start/end angle.`,[`left`,`right`]);var QuartileCandlestick=class extends o.SVGWidget{_g;_leftLine;_rightLine;_midLine;_midOuterRect;_midInnerRect1;_midInnerRect2;_q0text;_q1text;_q2text;_q3text;_q4text;_q0val;_q1val;_q2val;_q3val;_q4val;constructor(){super()}enter(e,t){super.enter(e,t),this._g=t.append(`g`),this._leftLine=this._g.append(`rect`),this._rightLine=this._g.append(`rect`),this._midLine=this._g.append(`rect`),this._midOuterRect=this._g.append(`rect`),this._midInnerRect1=this._g.append(`rect`),this._midInnerRect2=this._g.append(`rect`),this._q0text=this._g.append(`text`),this._q1text=this._g.append(`text`),this._q2text=this._g.append(`text`),this._q3text=this._g.append(`text`),this._q4text=this._g.append(`text`),this._q0val=this._g.append(`text`),this._q1val=this._g.append(`text`),this._q2val=this._g.append(`text`),this._q3val=this._g.append(`text`),this._q4val=this._g.append(`text`)}update(e,t){super.update(e,t);let n=(this.orientation()===`horizontal`?this.width():this.height())-this.lineWidth(),r=this.orientation()===`horizontal`?this.height():this.width(),i=(0,o.scaleLinear)().domain([this.data()[0],this.data()[4]]).range([this.edgePadding(),n-this.edgePadding()]),a=this.candleWidth_exists()?this.candleWidth():r,s=this.lineWidth(),c=this.lineColor(),l=this.roundedCorners(),u=this.edgePadding(),d=i(this.data()[1]),f=i(this.data()[2]),p=i(this.data()[3]),m=-a/2,h=a/2,g=this.upperTextRotation(),_=this.lowerTextRotation(),v=this.textPadding(),b=this.labelFontSize(),S=this.valueFontSize(),C=Math.max(b,S),w=n-u;if(C>0){for(;d-u<C;)d+=C;for(;f-d<C;)f+=C;for(;p-f<C;)p+=C;for(;w-p<C;)p-=C;for(;p-f<C;)f-=C;for(;f-d<C;)d-=C}let T=-n/2-this.lineWidth()/2,E=0,D=0,O=1,k=`start`,A=`end`;this.orientation()===`vertical`&&(T=0,E=n/2+this.lineWidth()/2,D=-90,k=`end`,A=`start`,O=-1),this._g.style(`shape-rendering`,`crispEdges`).attr(`transform`,`translate(${T},${E})rotate(${D})scale(1)`),this._leftLine.attr(`fill`,c).attr(`height`,a).attr(`width`,s).attr(`x`,u).attr(`y`,m).attr(`rx`,l).attr(`ry`,l),this._rightLine.attr(`class`,`right-line`).attr(`fill`,c).attr(`height`,a).attr(`width`,s).attr(`x`,w).attr(`y`,m).attr(`rx`,l).attr(`ry`,l),this._midLine.attr(`fill`,c).attr(`height`,s).attr(`width`,w-u).attr(`x`,u).attr(`y`,-s/2),this._midOuterRect.attr(`fill`,c).attr(`height`,a).attr(`width`,p-d).attr(`x`,d).attr(`y`,m).attr(`rx`,l).attr(`ry`,l),this._midInnerRect1.attr(`fill`,this.innerRectColor()).attr(`height`,a-s*2).attr(`width`,f-(d+s*2)).attr(`x`,d+s).attr(`y`,s-a/2).attr(`rx`,l*.618).attr(`ry`,l*.618),this._midInnerRect2.attr(`fill`,this.innerRectColor()).attr(`height`,a-s*2).attr(`width`,p-f-s).attr(`x`,f).attr(`y`,s-a/2).attr(`rx`,l*.618).attr(`ry`,l*.618),this._q0text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${u}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`hanging`).text(this.columns()[0]),this._q1text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${d}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`middle`).text(this.columns()[1]),this._q2text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${f}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`middle`).text(this.columns()[2]),this._q3text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${p}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`middle`).text(this.columns()[3]),this._q4text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${w+s}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`baseline`).text(this.columns()[4]),this._q0val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${u}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`hanging`).text(this.data()[0]),this._q1val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${d}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`middle`).text(this.data()[1]),this._q2val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${f}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`middle`).text(this.data()[2]),this._q3val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${p}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`middle`).text(this.data()[3]),this._q4val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${w+s}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`baseline`).text(this.data()[4])}};QuartileCandlestick.prototype._class+=` chart_QuartileCandlestick`,QuartileCandlestick.prototype.publish(`textColor`,`black`,`html-color`,`Color of label and value text`),QuartileCandlestick.prototype.publish(`showLabels`,!0,`boolean`,`If true, labels will be shown`),QuartileCandlestick.prototype.publish(`showValues`,!0,`boolean`,`If true, values will be shown`),QuartileCandlestick.prototype.publish(`orientation`,`horizontal`,`set`,`Determines layout`,[`horizontal`,`vertical`]),QuartileCandlestick.prototype.publish(`valueFontSize`,12,`number`,`Font size of value text (pixels)`),QuartileCandlestick.prototype.publish(`labelFontSize`,12,`number`,`Font size of label text (pixels)`),QuartileCandlestick.prototype.publish(`roundedCorners`,8,`number`,`Radius of rounded rect corners (pixels)`),QuartileCandlestick.prototype.publish(`lineWidth`,4,`number`,`Width of lines (pixels)`),QuartileCandlestick.prototype.publish(`candleWidth`,null,`number`,`Height of outer rect (pixels)`,null,{optional:!0}),QuartileCandlestick.prototype.publish(`textPadding`,8,`number`,`Padding between outer rect and text (pixels)`),QuartileCandlestick.prototype.publish(`edgePadding`,30,`number`,`Padding between outer rect and left/right sides (pixels)`),QuartileCandlestick.prototype.publish(`lineColor`,`#333`,`html-color`,`Color of outer rect and lines`),QuartileCandlestick.prototype.publish(`innerRectColor`,`white`,`html-color`,`Color of the inner rects`),QuartileCandlestick.prototype.publish(`upperTextRotation`,-60,`number`,`Rotation of label text (degrees)`),QuartileCandlestick.prototype.publish(`lowerTextRotation`,-60,`number`,`Rotation of value text (degrees)`);var Radar=class extends o.SVGWidget{constructor(){super(),INDChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this)}mapShape(e){switch(e){case`rectangle`:return`rect`;case`circle`:return`circle`;case`cross`:return`path`;default:}}setPointAttributes(e,t,n){let r=this.mapShape(this.pointShape()),i=this;switch(r){case`rect`:e.attr(`width`,i.pointSize()).attr(`height`,i.pointSize()).style(`fill`,e=>this.strokeColor(e.data,e.column,e.value));break;case`circle`:e.attr(`r`,i.pointSize()/2).attr(`cx`,t).attr(`cy`,n).style(`fill`,e=>this.strokeColor(e.data,e.column,e.value));break;case`path`:let r=i.pointSize()/2;e.attr(`d`,function(e){return`M`+(t-r)+` `+(n-r)+` L`+(t+r)+` `+(n+r)+` M`+(t-r)+` `+(n+r)+` L`+(t+r)+` `+(n-r)}).style(`stroke`,e=>this.strokeColor(e.data,e.column,e.value));break;default:}}enter(e,t){super.enter(e,t),this._selection.widgetElement(t),this.tooltipHTML(e=>this.tooltipFormat({label:e.label,series:e.column,value:e.value}))}update(e,t){super.update(e,t),this._palette=this._palette.switch(this.paletteID());let n=this,r=this.height(),i=this.width(),a=r/2,s=i/2,c=this.columns(),l=this.data(),u=this.flattenData(c,l).map((e,t)=>(e.shape=this.mapShape(this.pointShape()),e.column=c[e.colIdx],e.row=l[t],e)),d=[],f=this.degrees2radians(360/this.data().length),p=this.fontSize(),m=0;u.filter(e=>e.colIdx===1).forEach(e=>{let t=super.textSize(e.label,`${this.fontFamily()}`,this.fontSize());m<t.width&&(m=t.width)});let h=Math.min(a-p,s-m),g=t.selectAll(`.label`).data(u.filter(e=>e.colIdx===1)),_=Math.max.apply(n,u.map(e=>e.value));g.enter().append(`text`).attr(`class`,`label`).attr(`text-anchor`,`middle`).merge(g).attr(`font-size`,this.fontSize()).attr(`font-family`,this.fontFamily()).each(function(e,t){let r=n.polar2cartesian(h,t*f-Math.PI/2);d.push(r.map(e=>e*n.labelPaddingRatio()));let i=`middle`,a=Math.round(r[0]);i=a>0?`start`:i,i=a<0?`end`:i,(0,o.select)(this).attr(`text-anchor`,i).attr(`x`,r[0]).attr(`y`,r[1])}).text(e=>e.label),g.exit().remove();let v=t.selectAll(`.domain`).data(u.filter(e=>e.colIdx===1));v.enter().append(`line`).classed(`domain`,!0).style(`stroke`,`#000`).style(`stroke-opacity`,`0.75`).style(`stroke-width`,`1px`).merge(v).attr(`x1`,0).attr(`y1`,0).attr(`x2`,(e,t)=>d[t][0]).attr(`y2`,(e,t)=>d[t][1]),v.exit().remove();let b=t.selectAll(`.value_guide`).data(this.valueGuideRatios());b.enter().append(`polygon`).classed(`value_guide`,!0).style(`stroke`,`grey`).style(`stroke-opacity`,`0.75`).style(`stroke-width`,`0.3px`).merge(b).each(function(e,t){let n=[];d.forEach((t,r)=>{n.push([t[0]*e,t[1]*e])}),(0,o.select)(this).attr(`points`,n.join(` `)).attr(`stroke`,`rgb(0, 0, 0)`).attr(`stroke-opacity`,.75).attr(`stroke-width`,.3).attr(`fill-opacity`,0)}),b.exit().remove();let S=t.selectAll(`.value_guide_text`).data(this.valueGuideRatios());S.enter().append(`text`).attr(`class`,`value_guide_text`).attr(`text-anchor`,`start`).attr(`font-size`,this.fontSize()).attr(`font-family`,this.fontFamily()).merge(S).attr(`x`,2).attr(`y`,e=>d[0][1]*e).text((e,t)=>Math.round(e*_)),b.exit().remove();let C=t.selectAll(`.area`).data(c.filter((e,t)=>t>0));C.enter().append(`polygon`).attr(`class`,`area`).style(`stroke-opacity`,`0.75`).style(`stroke-width`,`0.3px`).merge(C).style(`stroke`,e=>this.strokeColor([],e,0)).style(`fill`,e=>this.fillColor([],e,0)).style(`fill-opacity`,this.fillOpacity()).attr(`points`,(e,t)=>d.map((e,n)=>{let r=l[n][t+1],i=r===0?0:r/_;return e[0]*i+`,`+e[1]*i}).join(` `)),C.exit().remove();let w=t.selectAll(`.point`).data(u);w.enter().append(`g`).attr(`class`,`point`).on(`mouseout.tooltip`,n.tooltip.hide).on(`mousemove.tooltip`,n.tooltip.show).on(`click`,function(e,t){let r=n.data()[e.rowIdx],i=n.rowToObj(r),a=n._selection.selected(this);n.click(i,n.columns()[e.colIdx],a)}).on(`dblclick`,function(e,t){n.dblclick(n.rowToObj(n.data()[e.rowIdx]),e.column,n._selection.selected(this))}).each(function(e){let t=(0,o.select)(this);t.append(`circle`).attr(`class`,`pointSelection`).attr(`r`,n.pointSize()).call(n._selection.enter.bind(n._selection)),t.append(n.mapShape(n.pointShape())).attr(`class`,`pointShape`)}).merge(w).each(function(e){let t=(0,o.select)(this),r=e.value===0?0:e.value/_,i=d[e.rowIdx][0]*r,a=d[e.rowIdx][1]*r;t.select(`.pointSelection`).attr(`cx`,i).attr(`cy`,a);let s=t.select(`.pointShape`).style(`stroke`,n.strokeColor(e.row,e.column,e.value)).style(`fill`,n.fillColor(e.row,e.column,e.value));n.setPointAttributes(s,i,a)}),w.exit().remove()}polar2cartesian(e,t){return[e*Math.cos(t),e*Math.sin(t)]}cartesian2polar(e,t){return[Math.atan2(t,e),Math.sqrt(e*e+t*t)]}degrees2radians(e){return e/57.295779513}radians2degrees(e){return e*57.295779513}point_in_polygon(e,t){let n=e[0],r=e[1],i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e][0],s=t[e][1],c=t[a][0],l=t[a][1];s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}};Radar.prototype._class+=` chart_Radar`,Radar.prototype.implements(INDChart.prototype),Radar.prototype.implements(ITooltip.prototype),Radar.prototype.mixin(o.Utility.SimpleSelectionMixin),Radar.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Radar.prototype._palette.switch()),Radar.prototype.publish(`pointShape`,`cross`,`set`,`pointShape`,[`circle`,`rectangle`,`cross`]),Radar.prototype.publish(`pointSize`,6,`number`,`Point Size`,null,{range:{min:1,step:1,max:200}}),Radar.prototype.publish(`valueGuideRatios`,[.2,.4,.6,.8,1],`array`,`Array of values between 0 and 1 that are multiplied by the widget radius to produce guide lines`),Radar.prototype.publish(`fillOpacity`,.66,`number`,`Opacity of the data polygon(s)`),Radar.prototype.publish(`fontFamily`,``,`string`,`fontFamily`),Radar.prototype.publish(`fontSize`,16,`number`,`fontSize`),Radar.prototype.publish(`labelPaddingRatio`,.9,`number`,`labelPaddingRatio`);var RadialBar=class extends o.SVGWidget{static __inputs=[{id:`label`,type:`any`},{id:`values`,type:`number`}];_domainScale=(0,o.scaleBand)();_valueScale=(0,o.scaleLinear)();_d3Arc=arc_default$1().startAngle(0).endAngle(e=>this._valueScale(e[1]));_arcs;_axialAxis;_radialAxis;constructor(){super(),INDChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this)}enter(e,t){super.enter(e,t),this._selection.widgetElement(t),this.tooltipHTML(e=>this.tooltipFormat({label:e[0],value:e[1]})),this._radialAxis=t.append(`g`).attr(`class`,`r axis`),this._axialAxis=t.append(`g`).attr(`class`,`a axis`),this._arcs=t.append(`g`).attr(`class`,`data`)}update(e,t){super.update(e,t);let n=this,r=Math.max(this.valueDomainHigh_exists()?this.valueDomainHigh():0,...this.data().map(e=>e[1]));this._valueScale.domain([0,r]).range([0,this.radians(this.valueMaxAngle())]);let i=this._valueScale.ticks(this.tickCount()),a=this.textSize(i.map(e=>``+e),`Verdana`,12).width,s=Math.min(this.width()-(10+a)*2,this.height()-44)/2,c=this.data().map(e=>e[0]);this._domainScale.domain(c).range([0,s]).padding(this.domainPadding());let l=this._domainScale.step()*this._domainScale.padding(),u=this._radialAxis.selectAll(`circle`).data(c);u.enter().append(`circle`).attr(`fill`,`transparent`).merge(u).attr(`r`,e=>this._domainScale(e)+this._domainScale.step()-l/2),u.exit().remove();let d=this._radialAxis.selectAll(`.arc-text`).data(c);d.enter().append(`text`).attr(`class`,`arc-text`).attr(`x`,-4).attr(`alignment-baseline`,`middle`).attr(`text-anchor`,`end`).merge(d).attr(`y`,e=>-this._domainScale(e)-this._domainScale.bandwidth()/2).text(e=>e),d.exit().remove();let f=this._axialAxis.selectAll(`line`).data(i);f.enter().append(`line`).merge(f).attr(`x2`,e=>s*Math.cos(this._valueScale(e)-this.radians(90))).attr(`y2`,e=>s*Math.sin(this._valueScale(e)-this.radians(90))),f.exit().remove();let p=this._axialAxis.selectAll(`text`).data(i);p.enter().append(`text`).style(`dominant-baseline`,`central`).merge(p).attr(`x`,e=>(s+10)*Math.cos(this._valueScale(e)-this.radians(90))).attr(`y`,e=>(s+10)*Math.sin(this._valueScale(e)-this.radians(90))).style(`text-anchor`,e=>{let t=this.degrees(this._valueScale(e));return t>=0&&t<=20||t>=160&&t<=200||t>=340&&t<=360?`middle`:t>=180&&t<=360?`end`:null}).text(e=>e),p.exit().remove();let m=this.columns().length>1?this.columns()[1]:``;this._d3Arc.innerRadius(e=>this._domainScale(e[0])).outerRadius(e=>this._domainScale(e[0])+this._domainScale.bandwidth());let h=this._arcs.selectAll(`path`).data(this.data(),e=>e[0]);h.enter().append(`path`).attr(`class`,`arc`).call(this._selection.enter.bind(this._selection)).on(`mouseout.tooltip`,this.tooltip.hide).on(`mousemove.tooltip`,this.tooltip.show).on(`click`,function(e,t){n.click(n.rowToObj(e),m,n._selection.selected(this))}).on(`dblclick`,function(e,t){n.dblclick(n.rowToObj(e),m,n._selection.selected(this))}).merge(h).style(`fill`,(e,t)=>this.fillColor(e,e[0],e[1])).transition().delay((e,t)=>t*this.transitionDelay()).duration(this.transitionDuration()).attrTween(`d`,(e,t)=>{let n=(0,o.interpolate)(e._current||0,e[1]);return e._current=e[1],r=>this._d3Arc([e[0],n(r)],t)}),h.exit().remove()}degrees(e){return e*180/Math.PI}radians(e){return e*Math.PI/180}};RadialBar.prototype._class+=` chart_RadialBar`,RadialBar.prototype.implements(INDChart.prototype),RadialBar.prototype.implements(ITooltip.prototype),RadialBar.prototype.mixin(o.Utility.SimpleSelectionMixin),RadialBar.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,RadialBar.prototype._palette.switch()),RadialBar.prototype.publish(`tickCount`,10,`number`,`Number of ticks to display`),RadialBar.prototype.publish(`domainPadding`,.25,`number`,`Padding between chart edge and container edge (0..1)`),RadialBar.prototype.publish(`valueMaxAngle`,270,`number`,`Maximum angular length of a bar (degrees)`),RadialBar.prototype.publish(`valueDomainHigh`,null,`number`,`Value domain high`,void 0,{optional:!0}),RadialBar.prototype.publish(`transitionDelay`,100,`number`,`Delay between the start of each row animation (ms)`),RadialBar.prototype.publish(`transitionDuration`,750,`number`,`Duration of a row's animation (ms)`);var wt=o.Palette.rainbow(`Blues`),Tt=o.Palette.ordinal(`Quartile`,[wt(100,0,100),wt(50,0,100),wt(50,0,100),wt(75,0,100)]);Tt(`Std. Dev.`),Tt(`MinMax`),Tt(`25%`),Tt(`50%`);function myFormatter(e){let t=(0,o.format)(e);return function(e){let n=(Math.round(e*100)/100).toString();return n.length<=4?n:t(e)}}var StatChart=class extends o.HTMLWidget{_selectElement;_tickFormatter;_bellCurve=new Scatter().columns([``,`Std. Dev.`]).paletteID(`Quartile`).interpolate_default(`basis`).pointSize(0).xAxisType(`linear`).xAxisOverlapMode(`none`).xAxisTickFormat(`,`).yAxisHidden(!0).yAxisDomainLow(0).yAxisDomainHigh(110).yAxisGuideLines(!1);_candle=new QuartileCandlestick().columns([`Min`,`25%`,`50%`,`75%`,`Max`]).edgePadding(0).roundedCorners(1).lineWidth(1).upperTextRotation(-90).lowerTextRotation(-90).labelFontSize(0).valueFontSize(0).lineColor(wt(90,0,100)).innerRectColor(wt(10,0,100));constructor(){super(),this.columns([`Min`,`25%`,`50%`,`75%`,`Max`,`Mean`,`Std. Dev.`])}stdDev(e){return this.mean()+e*this.standardDeviation()}formatStdDev(e){return this._tickFormatter(this.stdDev(e))}quartile(e){return this.quartiles()[e]}formatQ(e){return this._tickFormatter(this.quartile(e))}domain(e){switch(e){case`25_75`:return[this.quartile(1),this.quartile(3)];case`normal`:return[this.stdDev(-4),this.stdDev(4)];default:return[this.quartile(0),this.quartile(4)]}}min(){return this.quartile(0)}max(){return this.quartile(4)}data(e){if(!arguments.length)return[[...this.quartiles(),this.mean(),this.standardDeviation()]];let t=e[0];return this.quartiles([t[0],t[1],t[2],t[3],t[4]]),this.mean(t[5]),this.standardDeviation(t[6]),this}enter(e,t){super.enter(e,t),this._bellCurve.target(t.append(`div`).node()),this._candle.target(t.append(`div`).node()),this._selectElement=t.append(`div`).style(`position`,`absolute`).style(`top`,`0px`).style(`right`,`0px`).append(`select`).on(`change`,()=>{this.view(this._selectElement.node().value),this.lazyRender()}),this._selectElement.append(`option`).attr(`value`,`min_max`).text(`Min / Max`),this._selectElement.append(`option`).attr(`value`,`25_75`).text(`25% / 75%`),this._selectElement.append(`option`).attr(`value`,`normal`).text(`Normal`)}bellTicks(e){let t;switch(e){case`25_75`:t=[{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)}];break;case`normal`:t=[{label:this.formatStdDev(-4),value:this.stdDev(-4)},{label:`-3σ`,value:this.stdDev(-3)},{label:`-2σ`,value:this.stdDev(-2)},{label:`-1σ`,value:this.stdDev(-1)},{label:this.formatStdDev(0),value:this.stdDev(0)},{label:`+1σ`,value:this.stdDev(1)},{label:`+2σ`,value:this.stdDev(2)},{label:`+3σ`,value:this.stdDev(3)},{label:this.formatStdDev(4),value:this.stdDev(4)}];break;default:t=[{label:this.formatQ(0),value:this.quartile(0)},{label:this.formatQ(1),value:this.quartile(1)},{label:this.formatQ(2),value:this.quartile(2)},{label:this.formatQ(3),value:this.quartile(3)},{label:this.formatQ(4),value:this.quartile(4)}]}let[n,r]=this.domain(this._selectElement.node().value);return t.filter(e=>e.value>=n&&e.value<=r).map(e=>({label:e.label,value:e.value.toString()}))}updateScatter(){let e=this._selectElement.node().value,[t,n]=this.domain(e),r=(n-t)*(this.domainPadding()/100);this._bellCurve.xAxisDomainLow(t-r).xAxisDomainHigh(n+r).xAxisTicks(this.bellTicks(e)).data([[this.stdDev(-4),0],[this.stdDev(-3),.3],[this.stdDev(-2),5],[this.stdDev(-1),68],[this.stdDev(0),100],[this.stdDev(1),68],[this.stdDev(2),5],[this.stdDev(3),.3],[this.stdDev(4),0]]).resize({width:this.width(),height:this.height()-this.candleHeight()}).render()}updateCandle(){let e=this._bellCurve.dataPos(this.quartile(0)),t=this._bellCurve.dataPos(this.quartile(4))-e;this._candle.resize({width:this.width(),height:this.candleHeight()}).pos({x:e+t/2+2,y:this.candleHeight()/2}).width(t).candleWidth(this.candleHeight()).data(this.quartiles()).render()}update(e,t){super.update(e,t),this._tickFormatter=myFormatter(this.tickFormat()),this._selectElement.node().value=this.view(),this.updateScatter(),this.updateCandle()}exit(e,t){this._bellCurve.target(null),this._candle.target(null),this._selectElement.remove(),super.exit(e,t)}};StatChart.prototype._class+=` chart_StatChart`,StatChart.prototype.publish(`view`,`min_max`,`set`,`View`,[`min_max`,`25_75`,`normal`]),StatChart.prototype.publish(`tickFormat`,`.2e`,`string`,`X-Axis Tick Format`),StatChart.prototype.publish(`candleHeight`,20,`number`,`Height of candle widget (pixels)`),StatChart.prototype.publish(`domainPadding`,10,`number`,`Domain value padding`),StatChart.prototype.publish(`mean`,.5,`number`,`Mean`),StatChart.prototype.publish(`standardDeviation`,.125,`number`,`Standard Deviation (σ)`),StatChart.prototype.publish(`quartiles`,[0,.25,.5,.75,1],`object`,`Quartiles (Min, 25%, 50%, 75%, Max)`);var Step=class extends Scatter{constructor(){super(),this.interpolate_default(`step`)}};Step.prototype._class+=` chart_Step`;var Et=`text`,Dt=`html`,Summary=class extends o.HTMLWidget{_playIntervalIdx=0;_mainDiv;_headerDiv;_textDiv;constructor(){super(),this._tag=`div`,this._drawStartPos=`center`,this.playInterval(this.playInterval())}lookupFieldIdx(e,t){let n=t;if(!(this[e+`_exists`]()&&(n=this.columns().indexOf(this[e]()),n<0)))return n}lookupFieldText(e,t){return this[e+`_exists`]()?this[e]():t===void 0?``:this.columns()[t]||``}currentRow(){return this.data()[this._playIntervalIdx]}summaryData(){let e;this.hideLabel()||(e=this.lookupFieldIdx(`labelColumn`,0));let t=this.lookupFieldIdx(`iconColumn`),n=this.lookupFieldIdx(`valueColumn`,1),r,i;this.hideMore()||(r=this.lookupFieldIdx(`moreIconColumn`),i=this.lookupFieldIdx(`moreTextColumn`));let a=this.lookupFieldIdx(`colorFillColumn`),o=this.lookupFieldIdx(`colorStrokeColumn`);return this.formattedData().map(function(s){return{icon:t===void 0?this.icon():s[t],label:e===void 0?``:s[e],value:s[n],moreIcon:r===void 0?this.hideMore()?``:this.moreIcon():s[r],moreText:i===void 0?this.hideMore()?``:this.moreText():s[i],fill:a===void 0?this.colorFill():s[a],stroke:o===void 0?this.colorStroke():s[o]}},this)}enter(e,t){super.enter(e,t),this._mainDiv=t.append(`div`);let n=this;this._headerDiv=this._mainDiv.append(`h2`).on(`click`,function(){n.click(n.rowToObj(n.currentRow()),n.lookupFieldText(`valueColumn`,1),!0)}).on(`dblclick`,function(){n.dblclick(n.rowToObj(n.currentRow()),n.lookupFieldText(`valueColumn`,1),!0)}),this._textDiv=this._mainDiv.append(`div`).attr(`class`,`text`).on(`click`,function(){n.click(n.rowToObj(n.currentRow()),n.lookupFieldText(`labelColumn`,0),!0)}).on(`dblclick`,function(){n.dblclick(n.rowToObj(n.currentRow()),n.lookupFieldText(`labelColumn`,0),!0)})}update(e,t){super.update(e,t),this.data().length;let n=this.summaryData();this._playIntervalIdx>=n.length&&(this._playIntervalIdx=0);let r=this._playIntervalIdx<n.length?n[this._playIntervalIdx]:[``,``];t.style(`width`,this.fixedSize()?this.minWidth_exists()?this.minWidth()+`px`:null:`100%`).style(`height`,this.fixedSize()?this.minHeight_exists()?this.minHeight()+`px`:null:`100%`),this._mainDiv.attr(`class`,`content bgIcon `+r.icon).transition().style(`background-color`,r.fill).style(`color`,r.stroke).style(`min-width`,this.minWidth_exists()?this.minWidth()+`px`:null).style(`min-height`,this.minHeight_exists()?this.minHeight()+`px`:null).style(`font-size`,this.iconFontSize()+`px`),this._headerDiv.transition().style(`color`,r.stroke).style(`font-size`,this.headerFontSize()+`px`)[this.valueHTML()?Dt:Et](r.value),this._textDiv.style(`font-size`,this.textFontSize()+`px`)[this.labelHTML()?Dt:Et](r.label);let i=this,a=this._mainDiv.selectAll(`.more`).data([r]),s=a.enter().append(`div`).attr(`class`,`more`).on(`click`,function(e){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText(`moreTextColumn`)||`more`,!0)}).each(function(){let e=(0,o.select)(this);e.append(`i`),e.append(`span`)}).merge(a).style(`display`,this.hideMoreWrapper()?`none`:null).style(`font-size`,this.moreFontSize()+`px`).style(`height`,this.moreWrapperHeight_exists()?this.moreWrapperHeight()+`px`:null).transition().style(`background-color`,(0,o.rgb)(r.fill).darker(.75).toString());s.select(`i`).attr(`class`,function(e){return`fa `+e.moreIcon}),this.moreTextHTML()?s.select(`span`).each(function(e){this.innerHTML=e.moreText}):s.select(`span`).text(e=>e.moreText),a.exit().remove()}exit(e,t){super.exit(e,t)}};Summary.prototype._class+=` chart_Summary`,Summary.prototype.implements(I2DChart.prototype),Summary.prototype.publish(`iconColumn`,null,`set`,`Select Icon Column`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`icon`,`fa-briefcase`,`string`,`FA Char icon class`,null,{disable:e=>e.iconColumn()}),Summary.prototype.publish(`headerFontSize`,null,`number`,`headerFontSize`),Summary.prototype.publish(`textFontSize`,null,`number`,`textFontSize`),Summary.prototype.publish(`moreFontSize`,null,`number`,`moreFontSize`),Summary.prototype.publish(`iconFontSize`,null,`number`,`iconFontSize`),Summary.prototype.publish(`hideLabel`,!1,`boolean`,`Hide label column`),Summary.prototype.publish(`labelColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0,disable:e=>e.hideLabel()}),Summary.prototype.publish(`labelHTML`,!1,`boolean`,`Allow HTML`,null,{disable:e=>e.hideLabel()}),Summary.prototype.publish(`valueColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`valueHTML`,!1,`boolean`,`Allow HTML`),Summary.prototype.publish(`hideMore`,!1,`boolean`,`Hide More Information`),Summary.prototype.publish(`hideMoreWrapper`,!1,`boolean`,`Hide More Information Wrapper`),Summary.prototype.publish(`moreWrapperHeight`,null,`number`,`Height of the 'more' text wrapper (pixels)`),Summary.prototype.publish(`moreIconColumn`,null,`set`,`Select More Icon Column`,function(){return this.columns()},{optional:!0,disable:e=>e.hideMore()}),Summary.prototype.publish(`moreIcon`,`fa-info-circle`,`string`,`FA Char icon class`,null,{disable:e=>e.hideMore()||e.moreIconColumn()}),Summary.prototype.publish(`moreTextColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0,disable:e=>e.hideMore()}),Summary.prototype.publish(`moreText`,`More Info`,`string`,`More text`,null,{disable:e=>e.hideMore()||e.moreTextColumn()}),Summary.prototype.publish(`moreTextHTML`,!1,`boolean`,`Allow HTML`,null,{disable:e=>e.hideMore()}),Summary.prototype.publish(`colorFillColumn`,null,`set`,`Column for color`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`colorFill`,`#3498db`,`html-color`,`Fill Color`,null,{disable:e=>e.colorFillColumn()}),Summary.prototype.publish(`colorStrokeColumn`,null,`set`,`Column for color`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`colorStroke`,`#ffffff`,`html-color`,`Fill Color`,null,{disable:e=>e.colorStrokeColumn()}),Summary.prototype.publish(`fixedSize`,!0,`boolean`,`Fix Size to Min Width/Height`),Summary.prototype.publish(`minWidth`,225,`number`,`Minimum Width`),Summary.prototype.publish(`minHeight`,150,`number`,`Minimum Height`),Summary.prototype.publish(`playInterval`,null,`number`,`Play Interval`,null,{optional:!0});var Ot=Summary.prototype.playInterval;Summary.prototype.playInterval=function(e){let t=Ot.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);let t=this;e&&(this._playIntervalHandle=setInterval(function(){t._playIntervalIdx++,t._renderCount&&t.data().length&&t.render()},e))}return t};var SummaryC=class extends o.CanvasWidget{_playIntervalIdx=0;constructor(){super(),I2DChart.call(this),this.playInterval(this.playInterval())}currentRow(){return this.data()[this._playIntervalIdx]}enter(e,t){super.enter.apply(this,arguments);let{width:n,height:r}=this.size();e.height=r,e.width=n}update(e,t){super.update.apply(this,arguments);let n=this;this._playIntervalIdx>=this.data().length&&(this._playIntervalIdx=0);let r=this.size(),i=Math.min(r.width,r.height),a=this.fontSizeRatio(),s=this.columns().indexOf(this.labelColumn()),c=this.columns().indexOf(this.valueColumn()),l=this.columns().indexOf(this.colorFillColumn()),u=this.columns().indexOf(this.colorStrokeColumn()),d=this.columns().indexOf(this.iconColumn()),f=d===-1?this.icon():this.currentRow()[d],p=s===-1?``:this.currentRow()[s],m=c===-1?``:this.currentRow()[c],h=l===-1?this.colorFill():this.currentRow()[l],g=u===-1?this.colorStroke():this.currentRow()[u],_=r.height*(a-this.paddingSizeRatio()),v=r.height*(1-a-this.paddingSizeRatio()),b=r.height*(this.iconSizeRatio()-this.paddingSizeRatio()),S=i*this.paddingSizeRatio(),C=e.getContext(`2d`);C.clearRect(0,0,r.width,r.height);let w=n.fontFamily();C.fillStyle=h,C.fillRect(0,0,r.width,r.height),C.globalAlpha=this.iconOpacity(),drawIcon(o.Utility.faChar(f),b,n.iconAnchor()),C.globalAlpha=this.valueOpacity(),_=drawText(m,S,_,n.valueAnchor()),C.globalAlpha=this.labelOpacity(),drawText(p,_+S,v,n.labelAnchor());function drawText(e,t,n,i){C.textBaseline=`top`,C.font=`${n}px ${w}`,C.fillStyle=g;let a=C.measureText(e);if(a.width>r.width-S*2){let t=(r.width-S*2)/a.width;n*=t,C.font=`${n}px ${w}`,a=C.measureText(e)}let o=getTextOffsetX(a.width,i);return C.fillText(e,o,t),n}function drawIcon(e,t,i){if(e===void 0)return;C.textBaseline=n.iconBaseline(),C.font=`${t}px FontAwesome`,C.fillStyle=g;let a=C.measureText(e);if(a.width>r.width-S*2){let n=(r.width-S*2)/a.width;C.font=`${t*n}px FontAwesome`,a=C.measureText(e)}let o=getTextOffsetX(a.width,i),s=getTextOffsetY(n.iconBaseline());C.fillText(e,o,s)}function getTextOffsetX(e,t){switch(t){case`start`:return S;case`middle`:return r.width/2-e/2;case`end`:return r.width-e-S}}function getTextOffsetY(e){switch(e){case`top`:return S;case`middle`:return r.height/2;case`bottom`:return r.height-S}}}};SummaryC.prototype._class+=` chart_SummaryC`,SummaryC.prototype.implements(I2DChart.prototype),SummaryC.prototype.publish(`iconBaseline`,`bottom`,`string`,`Text baseline for the icon`,[`top`,`middle`,`bottom`]),SummaryC.prototype.publish(`iconAnchor`,`end`,`set`,`Anchors the icon either at the start, middle, or end of the summary`,[`start`,`middle`,`end`]),SummaryC.prototype.publish(`valueAnchor`,`start`,`set`,`Anchors the value either at the start, middle, or end of the summary`,[`start`,`middle`,`end`]),SummaryC.prototype.publish(`labelAnchor`,`start`,`set`,`Anchors the label either at the start, middle, or end of the summary`,[`start`,`middle`,`end`]),SummaryC.prototype.publish(`iconColumn`,null,`set`,`Select Icon Column`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`icon`,`fa-briefcase`,`string`,`FA Char icon class`,null,{disable:e=>e.iconColumn()}),SummaryC.prototype.publish(`fontFamily`,`Arial`,`string`,`Font Family`),SummaryC.prototype.publish(`labelColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`valueColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`colorFillColumn`,null,`set`,`Column for background color`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`colorFill`,`#0097e6`,`html-color`,`Background Color`,null,{disable:e=>e.colorFillColumn()}),SummaryC.prototype.publish(`colorStrokeColumn`,null,`set`,`Column for font color`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`colorStroke`,`#2f3640`,`html-color`,`Font Color`,null,{disable:e=>e.colorStrokeColumn()}),SummaryC.prototype.publish(`fixedSize`,!0,`boolean`,`Fix Size to Min Width/Height`),SummaryC.prototype.publish(`minWidth`,225,`number`,`Minimum Width`),SummaryC.prototype.publish(`minHeight`,150,`number`,`Minimum Height`),SummaryC.prototype.publish(`playInterval`,null,`number`,`Play Interval`,null,{optional:!0}),SummaryC.prototype.publish(`fontSizeRatio`,.618,`number`,`Ratio between widget height and value font size`),SummaryC.prototype.publish(`valueOpacity`,1,`number`,`Opacity of value text (0..1)`),SummaryC.prototype.publish(`labelOpacity`,.9,`number`,`Opacity of label text (0..1)`),SummaryC.prototype.publish(`iconOpacity`,.3,`number`,`Opacity of icon text (0..1)`),SummaryC.prototype.publish(`paddingSizeRatio`,.1,`number`,`Ratio of the smallest dimension for edge padding (0..1)`),SummaryC.prototype.publish(`iconSizeRatio`,.9,`number`,`Ratio of the height for icon size (0..1)`);var kt=SummaryC.prototype.playInterval;SummaryC.prototype.playInterval=function(e){let t=kt.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);let t=this;e&&(this._playIntervalHandle=setInterval(function(){t._playIntervalIdx++,t._renderCount&&t.data().length&&t.render()},e))}return t};var At=Math.PI/180,jt=64,Mt=2048;function d3Cloud(){let e=(0,o.dispatch)(`word`,`end`),t={},n=[256,256],r=cloudText,i=cloudFont,a=cloudFontSize,s=cloudFontNormal,c=cloudFontNormal,l=cloudRotate,u=cloudPadding,d=[],f=archimedeanSpiral,p=1/0,m=null,h=Math.random,g=cloudCanvas;t.canvas=function(e){return arguments.length?(g=functor(e),t):g},t.start=function(){let o=getContext(g()),f=zeroArray((n[0]>>5)*n[1]),_=null,v=d.length,b=-1,S=[],C=d.map(function(e,t){return e.text=r.call(this,e,t),e.font=i.call(this,e,t),e.style=s.call(this,e,t),e.weight=c.call(this,e,t),e.rotate=l.call(this,e,t),e.size=~~a.call(this,e,t),e.padding=u.call(this,e,t),e}).sort(function(e,t){return t.size-e.size});return m&&clearInterval(m),m=setInterval(step,0),step(),t;function step(){let r=Date.now();for(;Date.now()-r<p&&++b<v&&m;){let r=C[b];r.x=n[0]*(h()+.5)>>1,r.y=n[1]*(h()+.5)>>1,cloudSprite(o,r,C,b),r.hasText&&place(f,r,_)&&(S.push(r),e.call(`word`,t,r),_?cloudBounds(_,r):_=[{x:r.x+r.x0,y:r.y+r.y0},{x:r.x+r.x1,y:r.y+r.y1}],r.x-=n[0]>>1,r.y-=n[1]>>1)}b>=v&&(t.stop(),e.call(`end`,t,S,_))}},t.stop=function(){return m&&=(clearInterval(m),null),t};function getContext(e){e.width=e.height=1;let t=Math.sqrt(e.getContext(`2d`).getImageData(0,0,1,1).data.length>>2);e.width=(jt<<5)/t,e.height=Mt/t;let n=e.getContext(`2d`);return n.fillStyle=n.strokeStyle=`red`,n.textAlign=`center`,{context:n,ratio:t}}function place(e,t,r){let i=t.x,a=t.y,o=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=f(n),c=h()<.5?1:-1,l=-c,u,d,p;for(;(u=s(l+=c))&&(d=~~u[0],p=~~u[1],!(Math.min(Math.abs(d),Math.abs(p))>=o));)if(t.x=i+d,t.y=a+p,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>n[0]||t.y+t.y1>n[1])&&(!r||!cloudCollide(t,e,n[0]))&&(!r||collideRects(t,r))){let r=t.sprite,i=t.width>>5,a=n[0]>>5,o=t.x-(i<<4),s=o&127,c=32-s,l=t.y1-t.y0,u=(t.y+t.y0)*a+(o>>5),d;for(let t=0;t<l;t++){d=0;for(let n=0;n<=i;n++)e[u+n]|=d<<c|(n<i?(d=r[t*i+n])>>>s:0);u+=a}return delete t.sprite,!0}return!1}return t.timeInterval=function(e){return arguments.length?(p=e??1/0,t):p},t.words=function(e){return arguments.length?(d=e,t):d},t.size=function(e){return arguments.length?(n=[+e[0],+e[1]],t):n},t.font=function(e){return arguments.length?(i=functor(e),t):i},t.fontStyle=function(e){return arguments.length?(s=functor(e),t):s},t.fontWeight=function(e){return arguments.length?(c=functor(e),t):c},t.rotate=function(e){return arguments.length?(l=functor(e),t):l},t.text=function(e){return arguments.length?(r=functor(e),t):r},t.spiral=function(e){return arguments.length?(f=Nt[e]||e,t):f},t.fontSize=function(e){return arguments.length?(a=functor(e),t):a},t.padding=function(e){return arguments.length?(u=functor(e),t):u},t.random=function(e){return arguments.length?(h=e,t):h},t.on=function(){let n=e.on.apply(e,arguments);return n===e?t:n},t}function cloudText(e){return e.text}function cloudFont(){return`serif`}function cloudFontNormal(){return`normal`}function cloudFontSize(e){return Math.sqrt(e.value)}function cloudRotate(){return(~~(Math.random()*6)-3)*30}function cloudPadding(){return 1}function cloudSprite(e,t,n,r){if(t.sprite)return;let i=e.context,a=e.ratio;i.clearRect(0,0,(jt<<5)/a,Mt/a);let o=0,s=0,c=0,l=n.length;for(--r;++r<l;){t=n[r],i.save(),i.font=t.style+` `+t.weight+` `+~~((t.size+1)/a)+`px `+t.font;let e=i.measureText(t.text+`m`).width*a,l=t.size<<1;if(t.rotate){let n=Math.sin(t.rotate*At),r=Math.cos(t.rotate*At),i=e*r,a=e*n,o=l*r,s=l*n;e=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(a+o),Math.abs(a-o))}else e=e+31>>5<<5;if(l>c&&(c=l),o+e>=jt<<5&&(o=0,s+=c,c=0),s+l>=Mt)break;i.translate((o+(e>>1))/a,(s+(l>>1))/a),t.rotate&&i.rotate(t.rotate*At),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=e,t.height=l,t.xoff=o,t.yoff=s,t.x1=e>>1,t.y1=l>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=e}let u=i.getImageData(0,0,(jt<<5)/a,Mt/a).data,d=[];for(;--r>=0;){if(t=n[r],!t.hasText)continue;let e=t.width,i=e>>5,a=t.y1-t.y0;for(let e=0;e<a*i;e++)d[e]=0;if(o=t.xoff,o==null)return;s=t.yoff;let c=0,l=-1;for(let n=0;n<a;n++){for(let t=0;t<e;t++){let e=i*n+(t>>5),r=u[(s+n)*(jt<<5)+(o+t)<<2]?1<<31-t%32:0;d[e]|=r,c|=r}c?l=n:(t.y0++,a--,n--,s++)}t.y1=t.y0+l,t.sprite=d.slice(0,(t.y1-t.y0)*i)}}function cloudCollide(e,t,n){n>>=5;let r=e.sprite,i=e.width>>5,a=e.x-(i<<4),o=a&127,s=32-o,c=e.y1-e.y0,l=(e.y+e.y0)*n+(a>>5),u;for(let e=0;e<c;e++){u=0;for(let n=0;n<=i;n++)if((u<<s|(n<i?(u=r[e*i+n])>>>o:0))&t[l+n])return!0;l+=n}return!1}function cloudBounds(e,t){let n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function collideRects(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function archimedeanSpiral(e){let t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function rectangularSpiral(e){let t=4*e[0]/e[1],n=0,r=0;return function(e){let i=e<0?-1:1;switch(Math.sqrt(1+4*i*e)-i&3){case 0:n+=t;break;case 1:r+=4;break;case 2:n-=t;break;default:r-=4;break}return[n,r]}}function zeroArray(e){let t=[],n=-1;for(;++n<e;)t[n]=0;return t}function cloudCanvas(){return document.createElement(`canvas`)}function functor(e){return typeof e==`function`?e:function(){return e}}var Nt={archimedean:archimedeanSpiral,rectangular:rectangularSpiral},WordCloud=class extends o.SVGWidget{static __inputs=[{id:`label`,type:`string`},{id:`value`,type:`number`}];_prevOffsetX;_prevOffsetY;_prevZoom;_root;_canvas;_d3Cloud;_d3Zoom;constructor(){super(),I2DChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this),this._prevOffsetX=this.offsetX(),this._prevOffsetY=this.offsetY(),this._prevZoom=this.zoom()}calcData(){return this.data().map(e=>({__viz_label:e[0],__viz_weight:e[1],__viz_row:e}))}enter(e,t){super.enter(e,t),this._selection.widgetElement(t),this._root=t.append(`g`),this._canvas=document.createElement(`canvas`);let n=this;this._d3Zoom=(0,o.zoom)().scaleExtent([.1,10]),this._d3Zoom.on(`zoom`,function(e){let t=(0,o.d3Event)();t&&t.transform&&n.zoomed(n._d3Zoom,[t.transform.x,t.transform.y],t.transform.k)}),t.call(this._d3Zoom),this.tooltipHTML(function(e){let t=n.columns(),r=t&&t.length?t[0]:`Word`;return n.tooltipFormat({label:e.__viz_label,series:r,value:e.__viz_weight})})}update(e,t){super.update(e,t),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._d3Cloud=d3Cloud().canvas(()=>this._canvas),this.zoomed(this,[this.offsetX(),this.offsetY()],this.zoom());let n=this.calcData(),r=this,i=(0,o.extent)(n,function(e){return e.__viz_weight}),a;switch(this.scaleMode()){case`log`:a=o.scaleLog;break;case`sqrt`:a=o.scaleSqrt;break;case`pow`:a=o.scalePow;break;default:a=o.scaleLinear;break}let s=a().domain(i).range([this.fontSizeFrom(),this.fontSizeTo()]),c=(0,o.scaleLinear)().domain([0,r.angleCount()-1]).range([r.angleFrom(),r.angleTo()]);this._d3Cloud.stop().size([this.width(),this.height()]).words(n).font(this.fontFamily()).padding(this.padding()).spiral(this.spiral()).text(function(e){return e.__viz_label.trim()}).fontSize(function(e){return s(e.__viz_weight)}).rotate((e,t)=>c(t%r.angleCount())).on(`word`,e=>{}).on(`end`,draw).start();function draw(e,t){let n=r._root.selectAll(`text`).data(e,function(e){return e.__viz_label?e.__viz_label.toLowerCase():``});n.enter().append(`text`).attr(`text-anchor`,`middle`).call(r._selection.enter.bind(r._selection)).text(function(e){return e.__viz_label}).on(`click`,function(e){r.click(r.rowToObj(e.__viz_row),r.columns()[1],r._selection.selected(this))}).on(`dblclick`,function(e){r.dblclick(r.rowToObj(e.__viz_row),r.columns()[1],r._selection.selected(this))}).on(`mouseout.tooltip`,r.tooltip.hide).on(`mousemove.tooltip`,r.tooltip.show).style(`opacity`,1e-6).merge(n).style(`font-size`,function(e){return s(e.__viz_weight)+`px`}).style(`font-family`,r.fontFamily()).transition().duration(1e3).attr(`transform`,function(e){return`translate(`+[e.x,e.y]+`)rotate(`+e.rotate+`)`}).style(`fill`,function(e){return r._palette(e.__viz_label?e.__viz_label.toLowerCase():``)}).style(`opacity`,1),n.exit().transition().duration(1e3).style(`opacity`,1e-4).remove()}}zoomed(e,t,n){if(t[0]!==this._prevOffsetX||t[1]!==this._prevOffsetY||n!==this._prevZoom){switch(this._root.attr(`transform`,t),e){case this:break;case this._d3Zoom:this.offsetX(t[0]),this.offsetY(t[1]),this.zoom(n);break}this._prevOffsetX=t[0],this._prevOffsetY=t[1],this._prevZoom=n}}};WordCloud.prototype._class+=` chart_WordCloud`,WordCloud.prototype.implements(I2DChart.prototype),WordCloud.prototype.implements(ITooltip.prototype),WordCloud.prototype.mixin(o.Utility.SimpleSelectionMixin),WordCloud.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,WordCloud.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),WordCloud.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),WordCloud.prototype.publish(`fontFamily`,`Impact`,`string`,`Font Name`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`fontSizeFrom`,6,`number`,`Minimum font size (pixels)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`fontSizeTo`,48,`number`,`Maximum font size (pixels)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`angleFrom`,-60,`number`,`Minimum angle (degrees)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`angleTo`,60,`number`,`Maximum angle (degrees)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`angleCount`,5,`number`,`Number of different angles`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`padding`,0,`number`,`Padding between words (pixels)`,null,{tags:[`Intermediate`]}),WordCloud.prototype.publish(`scaleMode`,`linear`,`set`,`Text scaling mode`,[`linear`,`log`,`sqrt`,`pow`],{tags:[`Intermediate`]}),WordCloud.prototype.publish(`spiral`,`archimedean`,`set`,`Text scaling mode`,[`archimedean`,`rectangular`],{tags:[`Intermediate`]}),WordCloud.prototype.publish(`offsetX`,0,`number`,`X offset`,null,{tags:[`Advanced`]}),WordCloud.prototype.publish(`offsetY`,0,`number`,`Y offset`,null,{tags:[`Advanced`]}),WordCloud.prototype.publish(`zoom`,1,`number`,`Zoom`,null,{tags:[`Advanced`]});function multiScale24Hours(){let e=(0,o.timeFormat)(`.%L`),t=(0,o.timeFormat)(`:%S`),n=(0,o.timeFormat)(`%H:%M`),r=(0,o.timeFormat)(`%H:00`),i=(0,o.timeFormat)(`%b %d`),a=(0,o.timeFormat)(`%b`),s=(0,o.timeFormat)(`%Y`);return o=>o.getMilliseconds()===0?o.getSeconds()===0?o.getMinutes()===0?o.getHours()===0?o.getDate()===1?o.getMonth()===0?s(o):a(o):i(o):r(o):n(o):t(o):e(o)}(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.chart_Axis{fill:#000;font:10px sans-serif}.chart_Axis .axis .tick>text{font:10px sans-serif}.chart_Axis .axis path.domain,.chart_Axis .axis .tick line{fill:none;stroke:#000}.chart_Axis .guide path.domain{fill:none;stroke:none}.chart_Axis .guide .tick line{fill:none;stroke:#d3d3d3;opacity:.7}.chart_Axis .guide .tick.guide-0 line{stroke:#000;stroke-width:1px;stroke-dasharray:3 5}.chart_Axis line,.chart_Axis path{shape-rendering:crispedges}.chart_XYAxis .axis{fill:#000;font:10px sans-serif}.chart_XYAxis .tick>text{font:10px sans-serif}.chart_XYAxis .focus .chart_Axis.value .tick{visibility:hidden}.chart_XYAxis .axis path,.chart_XYAxis .axis line{fill:none;stroke:#000;shape-rendering:crispedges}.chart_XYAxis .region{opacity:.33}.chart_XYAxis .brush rect.background{z-index:-999}.chart_XYAxis .brush .selection{stroke:#4682b4;stroke-opacity:1;stroke-width:1px;fill:#4682b4;fill-opacity:.125;shape-rendering:crispedges}.chart_XYAxis .brush path.handle--custom{fill:#eee;stroke:#666}.chart_Scatter .pointShape,.chart_Scatter .line,.chart_Scatter .area{pointer-events:none}.chart_Scatter .point .pointSelection{fill:none;stroke:#0000;stroke-width:2px;pointer-events:all;transition:all .2s}.chart_Scatter .point .pointSelection.selected{stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Scatter .point .pointSelection:hover{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Scatter .point .pointSelection:focus{stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Scatter .point .pointSelection.selected:focus{stroke:#6f42c1!important}.chart_Scatter .point .pointSelection:focus-visible{outline:none}.chart_Scatter .point .pointSelection:active{outline:none!important}.chart_Column .columnRect{fill:#4682b4;cursor:pointer}.chart_Column .data.axis path{display:none}.chart_Column .columnRect{stroke:#0000;border-width:2px}.chart_Column .dataCell.selected .columnRect{transition:all .2s;stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Column .dataCell:hover .columnRect{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Column .dataCell:focus .columnRect{transition:all .2s;stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Column .dataCell.selected:focus .columnRect{stroke:#6f42c1!important}.chart_Column .dataCell:focus-visible{outline:none}.chart_Column .dataCell:active{outline:none!important}.chart_Bubble circle{cursor:pointer}.chart_Bubble .selected circle{stroke:red;stroke-width:1.5px}.chart_Bubble .common_FAChar{fill:#fff;pointer-events:none}.chart_Bubble .common_Text{pointer-events:none}.chart_Bullet .domain{opacity:0}.chart_Bullet .bullet{border:1px solid #0000;font:10px sans-serif}.chart_Bullet .bullet.selected{border-color:red}.chart_Bullet .bullet.over{border-color:orange}.chart_Bullet .bullet.selected.over{border-color:red}.chart_Bullet .bullet .marker{stroke:#000;stroke-width:2px}.chart_Bullet .bullet .tick line{stroke:#666;stroke-width:.5px}.chart_Bullet .bullet .range.s0{fill:#eee}.chart_Bullet .bullet .range.s1{fill:#ddd}.chart_Bullet .bullet .range.s2{fill:#ccc}.chart_Bullet .bullet .measure.s0{fill:#b0c4de}.chart_Bullet .bullet .measure.s1{fill:#4682b4}.chart_Bullet .bullet .title{font-size:14px;font-weight:700}.chart_Bullet .bullet .subtitle{fill:#999}.chart_Pie path,.chart_Pie>g>text{cursor:pointer}.chart_Pie .arc path{stroke:#0000;stroke-width:2px}.chart_Pie .arc.selected path{transition:all .2s;stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Pie polyline{opacity:.3;stroke:#000;stroke-width:2px;fill:none}.chart_Pie .arc:hover path{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Pie .arc:focus path{transition:all .2s;stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Pie .arc.selected:focus path{stroke:#6f42c1!important}.chart_Pie .arc:focus-visible{outline:none}.chart_Pie .arc:active{outline:none!important}.chart_HexBin .hexagon{fill:none;stroke:#000;stroke-width:.5px}.chart_HexBin .hexagon.selected{stroke:red}.chart_Line .dataLine{fill:none;stroke:#4682b4;stroke-width:1.5px}.chart_Radar .pointShape,.chart_Radar .area{pointer-events:none}.chart_Radar .point .pointSelection{fill:none;stroke:none;pointer-events:all}.chart_Radar .point .pointSelection.selected{fill:none;stroke:red}.chart_RadialBar path.arc{opacity:.9;transition:opacity .5s}.chart_RadialBar path.arc.selected{stroke:red}.chart_RadialBar path.arc:hover{opacity:.7}.chart_RadialBar .axis line,.chart_RadialBar .axis circle{stroke:#ccc;stroke-width:1px}.chart_RadialBar .axis circle{fill:none}.chart_RadialBar .r.axis text{text-anchor:end}.chart_Summary{width:225px;height:150px;font-size:14px}.chart_Summary .content h2{margin-top:10px;margin-bottom:10px;margin-left:10px;font-size:3em;font-weight:700}.chart_Summary .bgIcon:before{opacity:.4;font-family:FontAwesome;font-size:5.5em;position:absolute;top:.5em;right:15px}.chart_Summary .bgIcon{position:relative}.chart_Summary .content{float:left;background-color:#efd752;width:100%;height:100%}.chart_Summary .content div{opacity:.8;margin-top:-1.1em;font-size:1.1em}.chart_Summary .content .text{padding-left:10px}.chart_Summary .content .more{width:100%;height:3em;line-height:3em;position:absolute;bottom:0}.chart_Summary .content .more i{padding-left:10px;padding-right:.5em}.other_Wordcloud text{cursor:pointer}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();var Pt=[`label`,`start`,`end`,`icon`,`color`,`series`],WUTimeline=class extends u.ReactTimelineSeries{_palette=o.Palette.ordinal(`default`);constructor(){super(),this.columns(Pt).titleColumn(`label`).iconColumn(`icon`).colorColumn(`color`).seriesColumn(`series`).timePattern(`%Y-%m-%dT%H:%M:%S.%LZ`).tickFormatFunc(multiScale24Hours()).tooltipTimeFormat(`%H:%M:%S.%L`).tooltipHTML(e=>e[Pt.length].calcTooltip())}_prevHashSum;clear(){return delete this._prevHashSum,this}fetchScopes(){let e=(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid(),request:this.request()});this._prevHashSum!==e&&(this._prevHashSum=e,n.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchDetails(this.request()).then(e=>e.filter(e=>e.Id&&e.attr(`WhenStarted`).RawValue).map(e=>{let t=e.attr(`WhenStarted`).RawValue/1e3,n=e.attr(`TimeElapsed`).RawValue/1e6;return[e.Id,new Date(t).toISOString(),n?new Date(t+n).toISOString():void 0,null,this._palette(e.ScopeType),e.ScopeName.split(`::`).join(`:`).split(`:`).slice(0,1),e]})).then(e=>{this.data(e).render()}))}enter(e,t){super.enter(e,t)}update(e,t){this.fetchScopes(),super.update(e,t)}exit(e,t){super.exit(e,t)}};WUTimeline.prototype._class+=` eclwatch_WUTimeline`,WUTimeline.prototype.publish(`baseUrl`,``,`string`,`HPCC Platform Base URL`),WUTimeline.prototype.publish(`wuid`,``,`string`,`Workunit ID`),WUTimeline.prototype.publish(`request`,{ScopeFilter:{MaxDepth:3,ScopeTypes:[`graph`,`subgraph`]},NestedFilter:{Depth:0,ScopeTypes:[]},PropertiesToReturn:{AllProperties:!1,AllStatistics:!0,AllHints:!1,Properties:[`WhenStarted`,`TimeElapsed`]},ScopeOptions:{IncludeId:!0,IncludeScope:!0,IncludeScopeType:!0},PropertyOptions:{IncludeName:!0,IncludeRawValue:!0,IncludeFormatted:!0,IncludeMeasure:!0,IncludeCreator:!1,IncludeCreatorType:!1}},`object`,`WUDetails Request`),e.BUILD_VERSION=p,e.ECLArchiveViewer=ECLArchiveViewer,e.PKG_NAME=d,e.PKG_VERSION=f,e.STATUS=m,e.STATUS_ACTIVE=h,e.WUGraph=WUGraph,e.WUGraphLegend=WUGraphLegend,e.WUResult=WUResult,e.WUScopeController=WUScopeController,e.WUStatus=WUStatus,e.WUTimeline=WUTimeline});
|
|
13
13
|
//# sourceMappingURL=index.umd.cjs.map
|
|
14
14
|
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.eclwatch_WUGraphLegend .graph_Vertex{cursor:auto}.eclwatch_WUGraphLegend .graph_Vertex .common_Icon{cursor:pointer}.eclwatch_WUGraph .graph_Vertex{cursor:auto}.eclwatch_WUGraph .marker{fill:#656565;stroke:none;stroke-width:1px}.eclwatch_WUGraph .zoom{fill:none;pointer-events:all}.eclwatch_WUGraph .selectionBrush{fill:none;stroke:#a9a9a9}.d3-tip .eclwatch_WUGraph_Tooltip h3,.d3-tip .eclwatch_WUGraph_Tooltip h4{margin:0}.d3-tip .eclwatch_WUGraph_Tooltip table{border-collapse:separate;border-spacing:5px}.d3-tip .eclwatch_WUGraph_Tooltip table .key{font-weight:700}.d3-tip .eclwatch_WUGraph_Tooltip table .value{font-weight:400}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|