"use strict";(self.webpackChunkjupyterlab_plotly=self.webpackChunkjupyterlab_plotly||[]).push([[855],{855:(e,t,a)=>{a.r(t),a.d(t,{FigureModel:()=>d,FigureView:()=>y,MODULE_NAME:()=>n.o,MODULE_VERSION:()=>n.Y});var s=a(900),l=a(431),i=a.n(l),r=a(478),o=a.n(r),n=a(657);window.PlotlyConfig={MathJaxConfig:"local"};const _="^"+n.Y;class d extends s.DOMWidgetModel{defaults(){return Object.assign(Object.assign({},super.defaults()),{_model_name:d.model_name,_model_module:d.model_module,_model_module_version:d.model_module_version,_view_name:d.view_name,_view_module:d.view_module,_view_module_version:d.view_module_version,_data:[],_layout:{},_config:{},_py2js_addTraces:null,_py2js_deleteTraces:null,_py2js_moveTraces:null,_py2js_restyle:null,_py2js_relayout:null,_py2js_update:null,_py2js_animate:null,_py2js_removeLayoutProps:null,_py2js_removeTraceProps:null,_js2py_restyle:null,_js2py_relayout:null,_js2py_update:null,_js2py_layoutDelta:null,_js2py_traceDeltas:null,_js2py_pointsCallback:null,_last_layout_edit_id:0,_last_trace_edit_id:0})}initialize(){super.initialize.apply(this,arguments),this.on("change:_data",this.do_data,this),this.on("change:_layout",this.do_layout,this),this.on("change:_py2js_addTraces",this.do_addTraces,this),this.on("change:_py2js_deleteTraces",this.do_deleteTraces,this),this.on("change:_py2js_moveTraces",this.do_moveTraces,this),this.on("change:_py2js_restyle",this.do_restyle,this),this.on("change:_py2js_relayout",this.do_relayout,this),this.on("change:_py2js_update",this.do_update,this),this.on("change:_py2js_animate",this.do_animate,this),this.on("change:_py2js_removeLayoutProps",this.do_removeLayoutProps,this),this.on("change:_py2js_removeTraceProps",this.do_removeTraceProps,this)}_normalize_trace_indexes(e){if(null==e){var t=this.get("_data").length;e=i().range(t)}return Array.isArray(e)||(e=[e]),e}do_data(){}do_layout(){}do_addTraces(){var e=this.get("_py2js_addTraces");if(null!==e){var t=this.get("_data"),a=e.trace_data;i().forEach(a,(function(e){t.push(e)}))}}do_deleteTraces(){var e=this.get("_py2js_deleteTraces");if(null!==e){var t=e.delete_inds,a=this.get("_data");t.slice().reverse().forEach((function(e){a.splice(e,1)}))}}do_moveTraces(){var e=this.get("_py2js_moveTraces");null!==e&&function(e,t,a){for(var s=[],l=t.length-1;l>=0;l--)s.splice(0,0,e[t[l]]),e.splice(t[l],1);var r=i()(a).zip(s).sortBy(0).unzip().value();a=r[0],s=r[1];for(var o=0;o{this.autosizeFigure()},window.addEventListener("resize",this.resizeEventListener);break;case"after-attach":this.perform_render();break;case"after-show":case"resize":this.autosizeFigure()}}processPhosphorMessage(e){this._processLuminoMessage(e,super.processPhosphorMessage)}processLuminoMessage(e){this._processLuminoMessage(e,super.processLuminoMessage)}autosizeFigure(){var e=this,t=e.model.get("_layout");(i().isNil(t)||i().isNil(t.width))&&o().Plots.resize(e.el).then((function(){var t=e.model.get("_last_layout_edit_id");e._sendLayoutDelta(t)}))}remove(){super.remove(),o().purge(this.el),window.removeEventListener("resize",this.resizeEventListener)}getFullData(){return i().mergeWith({},this.el._fullData,this.el.data,p)}getFullLayout(){return i().mergeWith({},this.el._fullLayout,this.el.layout,p)}buildPointsObject(e){var t;if(e.hasOwnProperty("points")){var a=e.points,s=a.length,l=!0;for(let e=0;e0&&"object"==typeof l[0]){a[s]=new Array(l.length);for(var r=0;r0&&(a[s]=o)}else"object"!=typeof l||Array.isArray(l)?void 0!==l&&"function"!=typeof l&&(a[s]=l):a[s]=g(l,{})}return a}function j(e,t,a,s){if(a||(a=16),void 0===t&&(t=24),t<=0)return"0";var l,i,r=Math.log(Math.pow(2,t))/Math.log(a),o="";for(l=2;r===1/0;l*=2)r=Math.log(Math.pow(2,t/l))/Math.log(a)*l;var n=r-Math.floor(r);for(l=0;l=Math.pow(2,t)?s>10?(console.warn("randstr failed uniqueness"),o):j(e,t,a,(s||0)+1):o}}}]);