@hpcc-js/composite
Version: 
hpcc-js - Viz Composite
2 lines • 28 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/common"),require("@hpcc-js/layout"),require("@hpcc-js/api"),require("@hpcc-js/form"),require("@hpcc-js/other")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/layout","@hpcc-js/api","@hpcc-js/form","@hpcc-js/other"],e):e((t=t||self)["@hpcc-js/composite"]={},t["@hpcc-js/common"],t["@hpcc-js/layout"],t["@hpcc-js/api"],t["@hpcc-js/form"],t["@hpcc-js/other"])}(this,function(t,e,i,o,r,a){"use strict";var s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function n(t,e){function i(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function l(t){return new Promise(function(i,o){var r=e.Utility.parseClassID(t);require&&require([r.package],function(t){var e=null;t&&t[r.widgetID]&&(e=t[r.widgetID]),i(r.memberWidgetID?e.prototype?e.prototype[r.memberWidgetID]:e[r.memberWidgetID]:e)})})}var p=Object.freeze({requireWidget:l,requireWidgets:function(t){return Promise.all(t.map(l))}}),h=function(t){function i(){var e=t.call(this)||this;return e._allCharts={},o.INDChart.call(e),o.IGraph.call(e),e._tag="div",e._allCharts={},e._allChartTypes.forEach(function(t){var e=JSON.parse(JSON.stringify(t));e.widget=null,this._allCharts[t.id]=e,this._allCharts[t.display]=e,this._allCharts[t.widgetClass]=e},e),e._chartTypeDefaults={},e._chartTypeProperties={},e}return n(i,t),i.prototype.fields=function(e){var i=t.prototype.fields.apply(this,arguments);if(this.chart()){if(!arguments.length)return this.chart().fields();this.chart().fields(e)}return i},i.prototype.columns=function(t,i){var o=e.HTMLWidget.prototype.columns.apply(this,arguments);if(this.chart()){if(!arguments.length)return this.chart().columns();this.chart().columns(t,i)}return o},i.prototype.data=function(t){var i=e.HTMLWidget.prototype.data.apply(this,arguments);if(this.chart()){if(!arguments.length)return this.chart().data();this.chart().data(t)}return i},i.prototype.hasOverlay=function(){return this.chart()&&this.chart().hasOverlay()},i.prototype.visible=function(t){return arguments.length?(this.chart()&&this.chart().visible(t),this):this.chart()&&this.chart().visible()},i.prototype.chartTypeDefaults=function(t){return arguments.length?(this._chartTypeDefaults=t,this):this._chartTypeDefaults},i.prototype.chartTypeProperties=function(t){return arguments.length?(this._chartTypeProperties=t,this):this._chartTypeProperties},i.prototype.getChartDataFamily=function(){return this._allCharts[this.chartType()].family},i.prototype.requireContent=function(t,i){var o=e.Utility.parseClassID(this._allCharts[t].widgetClass);switch(o.package){case"@hpcc-js/chart":require(["@hpcc-js/chart"],function(t){i(new t[o.widgetID])});break;case"@hpcc-js/dgrid":require(["@hpcc-js/dgrid"],function(t){i(new t[o.widgetID])});break;default:l(this._allCharts[t].widgetClass).then(function(t){i(new t)})}},i.prototype.switchChart=function(t){if(this._switchingTo!==this.chartType()){this._switchingTo&&console.log("Attempting switch to:  "+this.chartType()+", before previous switch is complete ("+this._switchingTo+")"),this._switchingTo=this.chartType();var e=this.chart(),i=this;this.requireContent(this.chartType(),function(o){if(o!==e){var r=i.size();o.fields(i.fields()).data(i.data()).size(r),i.chart(o),e&&e.size({width:1,height:1}).render()}delete i._switchingTo,t&&t(this)})}else t&&t(this)},i.prototype.update=function(e,i){t.prototype.update.call(this,e,i);var o=i.selectAll(".multiChart").data(this.chart()?[this.chart()]:[],function(t){return t._id});o.enter().append("div").attr("class","multiChart").each(function(t){t.target(this)});var r=this.chart();if(r){for(var a in this._chartTypeDefaults)if(r[a+"_default"])try{r[a+"_default"](this._chartTypeDefaults[a])}catch(t){console.log("Exception Setting Default:  "+a)}else console.log("Unknown Default:  "+a);for(var s in this._chartTypeDefaults={},this._chartTypeProperties)if(r[s])try{r[s](this._chartTypeProperties[s])}catch(t){console.log("Exception Setting Property:  "+s)}else console.log("Unknown Property:  "+s);this._chartTypeProperties={}}var n=this;o.each(function(t){t.resize(n.size())}),o.exit().transition().each(function(t){t.target(null)}).remove()},i.prototype.exit=function(e,i){this._chartMonitor&&(this._chartMonitor.remove(),delete this._chartMonitor),this.chart()&&this.chart().target(null),t.prototype.exit.call(this,e,i)},i.prototype.render=function(t){if(this.chartType()&&(!this.chart()||this.chart().classID()!==this._allCharts[this.chartType()].widgetClass)){var i=this,o=arguments;return this.switchChart(function(){e.HTMLWidget.prototype.render.apply(i,o)}),this}return e.HTMLWidget.prototype.render.apply(this,arguments)},i}(e.HTMLWidget);h.prototype._class+=" composite_MultiChart",h.prototype.implements(o.INDChart.prototype),h.prototype.implements(o.IGraph.prototype),h.prototype._otherChartTypes=[{id:"FORM",display:"Form",widgetClass:"form_FieldForm"}].map(function(t){return t.family="other",t}),h.prototype._graphChartTypes=[{id:"GRAPH",display:"Graph",widgetClass:"graph_Graph"},{id:"ADJACENCY_GRAPH",display:"Graph",widgetClass:"graph_AdjacencyGraph"},{id:"GRAPHC",display:"GraphC",widgetClass:"graph_GraphC"}].map(function(t){return t.family="GRAPH",t}),h.prototype._1DChartTypes=[].map(function(t){return t.family="1D",t}),h.prototype._2DChartTypes=[{id:"SUMMARY",display:"Summary",widgetClass:"chart_Summary"},{id:"BUBBLE",display:"Bubble",widgetClass:"chart_Bubble"},{id:"PIE",display:"Pie",widgetClass:"chart_Pie"},{id:"WORD_CLOUD",display:"Word Cloud",widgetClass:"other_WordCloud"}].map(function(t){return t.family="2D",t}),h.prototype._NDChartTypes=[{id:"COLUMN",display:"Column",widgetClass:"chart_Column"},{id:"BAR",display:"Bar",widgetClass:"chart_Bar"},{id:"LINE",display:"Line",widgetClass:"chart_Line"},{id:"AREA",display:"Area",widgetClass:"chart_Area"},{id:"STEP",display:"Step",widgetClass:"chart_Step"},{id:"SCATTER",display:"Scatter",widgetClass:"chart_Scatter"},{id:"HEXBIN",display:"Hex Bin",widgetClass:"chart_HexBin"}].map(function(t){return t.family="ND",t}),h.prototype._mapChartTypes=[{id:"CHORO_USSTATES",display:"US State Choropleth",widgetClass:"map_ChoroplethStates"},{id:"CHORO_USCOUNTIES",display:"US County Choropleth",widgetClass:"map_ChoroplethCounties"},{id:"CHORO_COUNTRIES",display:"Country Choropleth",widgetClass:"map_ChoroplethCountries"},{id:"GMAP_CHORO_USCOUNTIES",display:"Google Map US County  Choropleth",widgetClass:"map_GMapCounties"},{id:"GOOGLE_MAP",display:"Google Map",widgetClass:"map_GMapLayered"},{id:"OPENSTREET",display:"Open Street Map",widgetClass:"map_OpenStreet"}].map(function(t){return t.family="map",t}),h.prototype._anyChartTypes=[{id:"TABLE",display:"Table",widgetClass:"dgrid_Table"},{id:"TABLE_LEGACY",display:"Table (legacy)",widgetClass:"other_Table"},{id:"TABLE_NESTED",display:"Nested Table",widgetClass:"other_NestedTable"},{id:"TABLE_CALENDAR",display:"Table driven Calendar Heat Map",widgetClass:"other_CalendarHeatMap"},{id:"TABLE_BULLET",display:"Table driven bullet chart",widgetClass:"chart_Bullet"},{id:"TABLE_SELECT",display:"Table driven select",widgetClass:"other_Select"},{id:"TABLE_AUTOCOMPLETE",display:"Table driven auto complete",widgetClass:"other_AutoCompleteText"},{id:"TABLE_OPPORTUNITY",display:"Table driven opportunity widget",widgetClass:"graph_Opportunity"},{id:"TABLE_TREE",display:"Table driven tree",widgetClass:"tree_Dendrogram"},{id:"TABLE_TREEMAP",display:"Table driven Treemap",widgetClass:"tree_Treemap"},{id:"TABLE_SANKEY",display:"Table driven Sankey",widgetClass:"graph_Sankey"},{id:"TABLE_GMAP_PIN",display:"Table driven Google Map (pins)",widgetClass:"map_GMapPin"},{id:"TABLE_GMAP_PINLINE",display:"Table driven Google Map (pins/lines)",widgetClass:"map_GMapPinLine"},{id:"TABLE_XML_TREE",display:"Table driven XML Tree",widgetClass:"tree_Indented"}].map(function(t){return t.family="any",t}),h.prototype._allChartTypes=h.prototype._otherChartTypes.concat(h.prototype._graphChartTypes.concat(h.prototype._1DChartTypes.concat(h.prototype._2DChartTypes.concat(h.prototype._NDChartTypes.concat(h.prototype._mapChartTypes.concat(h.prototype._anyChartTypes)))))),h.prototype._allMap=e.map(h.prototype._allChartTypes,function(t){return t.family}),h.prototype._allFamilies=h.prototype._allMap.keys(),h.prototype._allChartTypesMap={},h.prototype._allChartTypesByClass={},h.prototype._allChartTypes.forEach(function(t){t.widgetPath=e.Utility.widgetPath(t.widgetClass),h.prototype._allChartTypesMap[t.id]=t,h.prototype._allChartTypesByClass[t.widgetClass]=t}),h.prototype.publishReset(),h.prototype.publish("chartType","BUBBLE","set","Chart Type",h.prototype._allChartTypes.map(function(t){return t.id}),{tags:["Basic"]}),h.prototype.publish("chart",null,"widget","Chart",null,{tags:["Basic"]});var c=h.prototype.chart;function d(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===i&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}h.prototype.chart=function(t){var e=c.apply(this,arguments);if(arguments.length){var i=this;this._allChartTypesByClass[t.classID()]?this.chartType(this._allChartTypesByClass[t.classID()].id):console.log("Unknown Class ID:  "+t.classID()),t.click=function(t,e,o){i.click.apply(i,arguments)},t.dblclick=function(t,e,o){i.dblclick.apply(i,arguments)},t.vertex_click=function(t,e,o,r){i.vertex_click.apply(i,arguments)},t.vertex_dblclick=function(t,e,o,r){i.vertex_dblclick.apply(i,arguments)},t.edge_click=function(t,e,o,r){i.edge_click.apply(i,arguments)},t.edge_dblclick=function(t,e,o,r){i.edge_dblclick.apply(i,arguments)},this._chartMonitor&&(this._chartMonitor.remove(),delete this._chartMonitor),this._chartMonitor=t.monitor(function(e,o,r){i.broadcast(e,o,r,t)})}return e};d(".composite_ChartPanel>.body{margin:0;padding:0;display:flex;flex-flow:row}.composite_ChartPanel>.body>article{flex:3 1 60%;order:2}.composite_ChartPanel>.body>nav{flex:1 6 20%;order:1}.composite_ChartPanel>.body>aside{margin-left:4px;flex:1 6 20%;order:3}footer,header{display:block}"),function(t){function e(){return t.call(this)||this}return n(e,t),e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),i.append("p")},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),i.select("p").text(this.text())},e}(e.HTMLWidget).prototype.publish("text","","string");var _=function(t){function e(){var e=t.call(this)||this;return e.widget((new h).chartType("COLUMN")),e}return n(e,t),e.prototype.multiChart=function(){return this._widget},e.prototype.chartType=function(t){return arguments.length?(this._widget.chartType(t),this):this._widget.chartType()},e.prototype.chart=function(t){return arguments.length?(this._widget.chart(t),this):this._widget.chart()},e.prototype.chartTypeDefaults=function(t){return arguments.length?(this._widget.chartTypeDefaults(t),this):this._widget.chartTypeDefaults()},e.prototype.chartTypeProperties=function(t){return arguments.length?(this._widget.chartTypeProperties(t),this):this._widget.chartTypeProperties()},e.prototype.update=function(e,i){t.prototype.update.call(this,e,i),this._widget instanceof h&&this._legend.dataFamily(this._widget.getChartDataFamily()),t.prototype.update.call(this,e,i)},e}(i.ChartPanel);_.prototype._class+=" composite_MultiChartPanel";d(".composite_Dermatology{background-color:#f8f8ff}.composite_Dermatology .common_Icon{background-color:red;opacity:.75}.composite_Dermatology .common_Icon .common_Shape{fill:#fff;stroke:#a9a9a9;cursor:pointer}.composite_Dermatology .common_Icon.show .common_Shape{fill:#d3d3d3}.composite_Dermatology .common_Icon .common_FAChar .common_Text{fill:#a9a9a9;cursor:pointer}.composite_Dermatology .other_PropertyEditor{font-family:sans-serif;font-size:11px}.composite_Dermatology .other_PropertyEditor input{font-family:sans-serif;font-size:11px;border:0}.composite_Dermatology .other_PropertyEditor .property-label{height:unset}");var u=function(t){function e(){var e=t.call(this)||this;return e._toolbar=(new i.Toolbar).title("Dermatology"),e._propEditor=(new a.PropertyEditor).show_settings(!0),e}return n(e,t),e.prototype.showProperties=function(t){if(!arguments.length)return this._showProperties;this._showProperties=t,this.rightPercentage(0).rightSize(this._showProperties?360:0).setContent("right",this._showProperties?this._propEditor:null);var e=this.widget();return e&&e.designMode&&e.designMode(this._showProperties),this},e.prototype.toggleProperties=function(){return this.showProperties(!this.showProperties())},e.prototype.enter=function(e,i){t.prototype.enter.call(this,e,i),this.topPercentage(0).topSize(0).setContent("top",this._toolbar),this.getCell("top").surfaceShadow(!0);var o=this;this._propsButton=(new r.OnOff).id(this.id()+"_props").value("Properties").on("click",function(){o.toggleProperties().render()}),this._toolbar.widgets([this._propsButton])},e.prototype.update=function(e,i){this.topPercentage(0).topSize(this.showToolbar()?32:0),t.prototype.update.call(this,e,i);var o=this.widget();i.style("background-color",o&&o.surfaceShadow?null:"white")},e.prototype.render=function(e){var i=this.widget();return i!==this._prevWidget&&(i&&i.surfaceShadow&&i.surfaceBackgroundColor_default("white"),this.setContent("center",i),this._propEditor.widget(i),this._prevWidget=i),t.prototype.render.call(this,e)},e}(i.Border);u.prototype._class+=" composite_Dermatology",u.prototype.publish("showToolbar",!0,"boolean","Show Toolbar"),u.prototype.publish("widget",null,"widget","Widget");d(".composite_MegaChart-Info,.composite_MegaChart-Info *,.composite_MegaChart-Maximize,.composite_MegaChart-Maximize *{font-family:FontAwesome}");var y=function(t){function o(){var o=t.call(this)||this;o._chart=new h,o._toolbar=new i.Toolbar,o._valueTitle=new e.Text,o._domainTitle=new e.Text,o._legend=new a.Legend,o._tag="div";var r=o;return o._chart.click=function(){r.click.apply(r,arguments)},o._chart.dblclick=function(){r.dblclick.apply(r,arguments)},o._chart.vertex_click=function(){r.vertex_click.apply(r,arguments)},o._chart.vertex_dblclick=function(){r.vertex_dblclick.apply(r,arguments)},o._chart.edge_click=function(){r.edge_click.apply(r,arguments)},o._chart.edge_dblclick=function(){r.edge_dblclick.apply(r,arguments)},o}return n(o,t),o.prototype.toolbarWidgets=function(t){return arguments.length?(this._toolbar.widgets(t),this):this._toolbar.widgets()},o.prototype.chartTypeDefaults=function(t){return arguments.length?(this._chart.chartTypeDefaults(t),this):this._chart.chartTypeDefaults()},o.prototype.chartTypeProperties=function(t){return arguments.length?(this._chart.chartTypeProperties(t),this):this._chart.chartTypeProperties()},o.prototype.fields=function(t){return arguments.length?(this._chart.fields(t),this):this._chart.fields()},o.prototype.columns=function(t,e){return arguments.length?(this._chart.columns(t,e),this):this._chart.columns()},o.prototype.data=function(t){return arguments.length?(this._chart.data(t),this):this._chart.data()},o.prototype.downloadCSV=function(){return e.Utility.downloadString("CSV",this._chart.export("CSV")),this},o.prototype.enter=function(i,o){t.prototype.enter.call(this,i,o);var s=this;this.topShrinkWrap(!1).topPercentage(0).topSize(30),this._dataCount=(new a.Html).classed({"composite_MegaChart-dataCount":!0}).id(this.id()+"_dataCount").html('<span class="MegaChart-dataCount-label">Count:</span> <span class="MegaChart-dataCount-value">'+(this.data()?this.data().length:"0")+"</span>").overflowX("visible").overflowY("visible"),this._csvButton=(new r.Button).classed({"composite_MegaChart-CSV":!0}).id(this.id()+"_csv").value("CSV"),this._csvButton.click=function(t){s.downloadCSV()},this._infoButton=(new r.Button).classed({"composite_MegaChart-Info":!0}).id(this.id()+"_info").value(this.infoIcon()),this._maximizeButton=(new r.Button).classed({"composite_MegaChart-Maximize":!0}).id(this.id()+"_maximize").value(""),this._maximizeButton.click=function(t){var i=s.target(),o=i,r=e.select(i).classed("__hpccisMaximized"),a=s.locateAncestor("layout_Grid");o=a?a.element().node():document.body;var n=e.select(s.target());if(r){var l=i.parentElement.getBoundingClientRect(),p=parseInt(getComputedStyle(i,null).getPropertyValue("padding-top").replace("px","")),h=parseInt(getComputedStyle(i,null).getPropertyValue("padding-left").replace("px","")),c=parseInt(getComputedStyle(i,null).getPropertyValue("padding-right").replace("px","")),d=parseInt(getComputedStyle(i,null).getPropertyValue("padding-bottom").replace("px",""));s.contentDiv.style("opacity",0).transition(100),n.transition().style("top",l.top+"px").style("left",l.left+"px").style("width",l.width-h-c+"px").style("height",l.height-p-d+"px").each("end",function(){n.style("position",i.__old_position),n.style("z-index",i.__old_zindex),n.style("background-color",i.__old_backgroundColor),n.style("box-shadow",i.__old_boxshadow),s.resize({width:l.width-h-c,height:l.height-p-d}).render(function(){s.contentDiv.transition().style("opacity",1)}),t.value("").render()})}else{i.__old_position=i.style.position,i.__old_zindex=i.style.zIndex,i.__old_boxshadow=i.style.boxShadow,i.__old_backgroundColor=s.element().style("background-color");var _=e.select(o).datum(),u=_.target(),y=_?u.getBoundingClientRect():o.getBoundingClientRect(),g=parseInt(getComputedStyle(u,null).getPropertyValue("padding-top").replace("px","")),f=parseInt(getComputedStyle(u,null).getPropertyValue("padding-left").replace("px","")),m=parseInt(getComputedStyle(u,null).getPropertyValue("padding-right").replace("px","")),C=parseInt(getComputedStyle(u,null).getPropertyValue("padding-bottom").replace("px",""));s.contentDiv.style("opacity",0).transition(100),n.style("position","fixed").style("z-index",999999).style("box-shadow","0 8px 8px 0 rgba(0,0,0,.14),0 12px 4px -8px rgba(0,0,0,.2),0 4px 20px 0 rgba(0,0,0,.12)").style("background-color",i.__old_backgroundColor).transition().style("top",y.top+g+"px").style("left",y.left+f+"px").style("width",y.width-f-m+"px").style("height",y.height-g-C+"px").each("end",function(){n.style("background-color",s.maximizedBackgroundColor()),s.resize({width:y.width-f-m,height:y.height-g-C}).render(function(){s.contentDiv.transition().style("opacity",1)}),t.value("").render()})}e.select(i).classed("__hpccisMaximized",!r)},this._legendButton=(new r.Input).classed({"composite_MegaChart-legend":!0}).id(this.id()+"_legend").type("checkbox").inlineLabel("Legend:  "),this._legendButton.click=function(t){s.render()},this._chartTypeSelect=(new r.Select).classed({"composite_MegaChart-chartType":!0}).id(this.id()+"_chartType").selectOptions(this._allChartTypes.map(function(t){return[t.id,t.display]})).value(this.chartType()),this._chartTypeSelect.change=function(t){s.chartType(t.value()).render()},this.setContent("center",this._chart),this._legend.targetWidget(this._chart).orientation(-1!==["top","bottom"].indexOf(this.legendPosition())?"horizontal":"vertical").fixedSize(!0),this._prevLegendPosition=this.legendPosition(),this.valueAxisTitle()&&this.setContent("left",this._valueTitle.rotation(-90)).leftShrinkWrap(!0),this.domainAxisTitle()&&this.setContent("bottom",this._domainTitle).bottomShrinkWrap(!0),"none"!==this.legendPosition()&&this.setContent(this.legendPosition(),this._legend)[this.legendPosition()+"ShrinkWrap"](!0)},o.prototype.update=function(e,i){function o(t,e,i){if(i&&-1===t.indexOf(e))t.push(e);else if(!i){var o=t.indexOf(e);o>=0&&t.splice(o,1)}}this._chartTypeSelect.value(this.chartType());var r=this.toolbarWidgets();o(r,this._csvButton,this.showCSV()),o(r,this._maximizeButton,this.showMaximize()),o(r,this._legendButton,this.toolbarShowLegend()),o(r,this._chartTypeSelect,this.showChartSelect()),o(r,this._infoButton,this.showInfoButton()),this.toolbarWidgets(r),this._prevShowToolbar!==this.showToolbar()&&(this.setContent("top",this.showToolbar()?this._toolbar:null),this._prevShowToolbar=this.showToolbar()),this._toolbar.fontSize(this.titleFontSize()).fontColor(this.titleFontColor()).fontFamily(this.titleFontFamily()).fontBold(this.titleFontBold()).backgroundColor(this.titleBackgroundColor()),this._chart.data(this.data()),this._chart.chartType()!==this.chartType()&&this._chart.chartType(this.chartType());var s=this.legendPosition();this.toolbarShowLegend()&&!this._legendButton.checked()&&(s="none"),this._prevLegendPosition!==s&&("none"!==this._prevLegendPosition&&this.clearContent(this._prevLegendPosition),this._prevLegendPosition=s,"none"!==s&&(this._legend=(new a.Legend).targetWidget(this.getContent("center").fixedSize(!0)),this.setContent(s,this._legend),this._legend.orientation(-1!==["top","bottom"].indexOf(s)?"horizontal":"vertical"))),this._contentClasses=this.getContentClasses(),this.valueAxisTitle()&&"common_Text"!==this._contentClasses.left&&"left"!==s&&this.setContent("left",this._valueTitle.rotation(-90)),this.domainAxisTitle()&&"common_Text"!==this._contentClasses.bottom&&"bottom"!==s&&this.setContent("bottom",this._domainTitle).bottomShrinkWrap(!0),this._legend.dataFamily(this._chart.getChartDataFamily()),t.prototype.update.call(this,e,i)},o.prototype.exit=function(e,i){t.prototype.exit.call(this,e,i)},o.prototype.getContentClasses=function(){var t={},e=this.getContent("top"),i=this.getContent("right"),o=this.getContent("bottom"),r=this.getContent("left");return t.top=null!==e?e.classID():void 0,t.right=null!==i?i.classID():void 0,t.bottom=null!==o?o.classID():void 0,t.left=null!==r?r.classID():void 0,t},o.prototype.serializeState=function(){var t={title:this.title(),data:this.data()},e=this.chart();return e&&e.serializeState&&(t.chart=e.serializeState(),delete t.chart.data),t},o.prototype.deserializeState=function(t){if(t){this.title(t.title).data(t.data);var e=this.chart();e&&t.chart&&e.serializeState&&e.deserializeState(t.chart)}return this},o.prototype.click=function(t,e,i){console.log("Click:  "+JSON.stringify(t)+", "+e+", "+i)},o.prototype.dblclick=function(t,e,i){console.log("Double click:  "+JSON.stringify(t)+", "+e+", "+i)},o.prototype.vertex_click=function(t,e,i,o){o&&o.vertex&&console.log("Vertex click: "+o.vertex.id())},o.prototype.vertex_dblclick=function(t,e,i,o){o&&o.vertex&&console.log("Vertex double click: "+o.vertex.id())},o.prototype.edge_click=function(t,e,i,o){o&&o.edge&&console.log("Edge click: "+o.edge.id())},o.prototype.edge_dblclick=function(t,e,i,o){o&&o.edge&&console.log("Edge double click: "+o.edge.id())},o}(i.Border);function g(t,i){if(i=i&&"1.14.2-dev"!==i?i:"1.18.0",!t.__version)return t;var o=e.Utility.parseVersionString(t.__version),r=e.Utility.parseVersionString(i);if(1===o.major&&14===o.minor){console.log("Upgrading old persist from "+t.__version+" to "+i);var a=JSON.stringify(t);a=a.split('"'+t.__version).join('"'+i);var s=JSON.parse(a);return s.__properties&&s.__properties.content&&s.__properties.content.forEach(function(t){JSON.stringify(t).split("graph_Graph").length>1&&r.minor>=16&&(t.__properties.widget.__id=t.__properties.widget.__properties.widget.__id,t.__properties.widget.__class="composite_MegaChart",t.__properties.widget.__properties.showCSV=!1,t.__properties.widget.__properties.chartType="GRAPH",t.__properties.widget.__properties.chart=t.__properties.widget.__properties.widget,delete t.__properties.widget.__properties.chart.__id,delete t.__properties.widget.__properties.widget),void 0===t.__properties.fields&&(t.__properties.fields=[])}),s}return t}function f(t,e){var i=[];return a.Persist.widgetPropertyWalker(t,null,function(t,o){if(t[o.id+"_reset"](),void 0!==e.__properties[o.id])switch(o.type){case"widget":var r=o.id;i.push(m(e.__properties[o.id]).then(function(e){return e._owner=t,t[r](e),e}));break;case"widgetArray":case"propertyArray":var a=o.id,s=e.__properties[o.id];if(s.length){for(var n=[],l=0,p=s;l<p.length;l++){var h=p[l];n.push(m(h).then(function(e){return e._owner=t,e}))}i.push(Promise.all(n).then(function(e){t[a](e)}))}break;default:t[o.id](e.__properties[o.id])}}),Promise.all(i).then(function(i){if(e.__data)for(var o in e.__data)if(e.__data.HasOwnProperty(o))switch(o){case"data":t.data(e.__data[o]);break;default:console.log("Unexpected __data item:  "+o),t[o](e.__data[o])}return e.__state&&(t.deserializeState?t.deserializeState(e.__state):e.__state.data&&t.data&&t.data(e.__state.data)),t})}function m(t){return"string"==typeof t&&(t=JSON.parse(t)),l((t=g(t,e.Platform.version())).__class).then(function(e){var i=new e;return t.__id&&0!==t.__id.indexOf(i._idSeed)&&0!==t.__id.indexOf("_pe")&&(i._id=t.__id),f(i,t)}).catch(function(t){console.log("Persist.create:  ***exception***"),console.log(t)})}y.prototype._class+=" composite_MegaChart",y.prototype._1DChartTypes=h.prototype._1DChartTypes,y.prototype._2DChartTypes=h.prototype._2DChartTypes,y.prototype._NDChartTypes=h.prototype._NDChartTypes,y.prototype._anyChartTypes=h.prototype._anyChartTypes,y.prototype._allChartTypes=h.prototype._allChartTypes,y.prototype.publishReset(),y.prototype.publish("showToolbar",!0,"boolean","Enable/Disable Toolbar widget",null,{tags:["Basic"]}),y.prototype.publishProxy("title","_toolbar","title"),y.prototype.publish("ddlParamsFormat","","string","DDL Param Format '{fname}, {lname}'",null,{tags:["Advanced"],optional:!0}),y.prototype.publish("titleFontSize",null,"number","Title Font Size (px)",null,{tags:["Advanced"],optional:!0}),y.prototype.publish("titleFontColor",null,"html-color","Title Font Color",null,{tags:["Advanced"],optional:!0}),y.prototype.publish("titleFontFamily",null,"string","Title Font Family",null,{tags:["Advanced"],optional:!0}),y.prototype.publish("titleFontBold",!0,"boolean","Enable Bold Title Font",null,{tags:["Advanced"],optional:!0}),y.prototype.publish("titleBackgroundColor",null,"html-color","Background Color",null,{tags:["Intermediate"],optional:!0}),y.prototype.publish("maximizedBackgroundColor","#FFFFFF","html-color","Background Color while maximized",null,{tags:["Intermediate"],optional:!0}),y.prototype.publish("showChartSelect",!0,"boolean","Show/Hide the chartType dropdown in the toolbar",null,{tags:["Basic"]}),y.prototype.publish("showCSV",!0,"boolean","Show/Hide CSV button",null,{tags:["Basic"]}),y.prototype.publish("showCount",!1,"boolean","Show/Hide Data Count",null,{tags:["Basic"]}),y.prototype.publish("showMaximize",!1,"boolean","Show/Hide Maximize button",null,{tags:["Basic"]}),y.prototype.publish("toolbarShowLegend",!1,"boolean","Show/Hide Legend button",null,{tags:["Basic"]}),y.prototype.publish("showInfoButton",!1,"boolean","Show/Hide Info button in toolbar",null,{tags:["Basic"]}),y.prototype.publish("infoIcon","","string","Help Icon",null,{tags:["Basic"]}),y.prototype.publish("legendPosition","none","set","Position of the Legend widget",["none","top","right","bottom","left"],{tags:["Basic"]}),y.prototype.publishProxy("legendFormat","_legend","rainbowFormat"),y.prototype.publishProxy("legendBins","_legend","rainbowBins"),y.prototype.publishProxy("domainAxisTitle","_domainTitle","text"),y.prototype.publishProxy("valueAxisTitle","_valueTitle","text"),y.prototype.publishProxy("chartType","_chart","chartType"),y.prototype.publishProxy("chart","_chart","chart");var C=Object.freeze({retrofit_114_serialization:g,deserializeFromObject:f,deserialize:function(t,e){"string"==typeof e&&(e=JSON.parse(e)),e.__id&&0!==e.__id.indexOf(t._idSeed)&&t._id!==e.__id&&console.log("Deserialize:  IDs do not match - "+t._id),f(t,e)},create:m,clone:function(t){m(a.Persist.serializeToObject(t,void 0,!0,!0))}});t.BUILD_VERSION="2.8.0",t.Dermatology=u,t.MegaChart=y,t.MultiChart=h,t.MultiChartPanel=_,t.PKG_NAME="@hpcc-js/composite",t.PKG_VERSION="2.4.14",t.Persist=C,t.Utility=p,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=index.min.js.map