(self.webpackChunkwidget_bzvisualizer=self.webpackChunkwidget_bzvisualizer||[]).push([[261,568],{163:(e,i,t)=>{var s=t(337),o=t(439),n=t(755),a=t(741).BZVisualizer;t(73);var l=s.DOMWidgetModel.extend({defaults:o.extend(s.DOMWidgetModel.prototype.defaults(),{_model_name:"BrillouinZoneModel",_view_name:"BrillouinZoneView",_model_module:"widget-bzvisualizer",_view_module:"widget-bzvisualizer",_model_module_version:"0.1.0",_view_module_version:"0.1.0",value:"BrillouinZone World!"})}),r=s.DOMWidgetView.extend({initialize:function(){this.canvasID=o.uniqueId("BZCanvas"),this.infoID=o.uniqueId("info"),this.BZVisualizer=new a(!0,!0,!0,!1)},events:{"keypress #BZ-widget":"toggle_faceColor"},render:function(){this.model.on("change:kpts",this.kpts_changed,this),this.model.on("change:face_color",this.faceColor_changed,this),this.model.on("change:path_vectors",this.vectors_changed,this),this.model.on("change:update_structure",this.reloadBZ,this),this.height=this.model.get("height"),this.el.innerHTML='<div class="BZ-widget" id="'+this.canvasID+'" style="height:'+this.height+';"></div><div id="'+this.infoID+'"></div>';var e=this.model.get("jsondata"),i=this.model.get("face_color");that=this,n(document).ready((function(){that.BZVisualizer.loadBZ(canvasID=that.canvasID,infoID=that.infoID,e=e),that.BZVisualizer.set_visibility(i)}))},reloadBZ:function(){var e=this.model.get("jsondata"),i=this.model.get("face_color");this.BZVisualizer.loadBZ(canvasID=this.canvasID,infoID=this.infoID,e=e),this.BZVisualizer.set_visibility(i)},toggle_faceColor:function(e){if(console.log("The key press is working.********:"+e.keyCode),84==e.keyCode){const e=this.model.get("face_color");this.model.set("face_color",!e),this.touch()}},kpts_changed:function(){const e=this.model.get("kpts");this.BZVisualizer.update_kpts(e)},vectors_changed:function(){const e=this.model.get("path_vectors");this.BZVisualizer.update_pathVector(e)},faceColor_changed:function(){this.BZVisualizer.set_visibility(this.model.get("face_color"))}});e.exports={BrillouinZoneModel:l,BrillouinZoneView:r}},568:(e,i,t)=>{e.exports=t(163),e.exports.version=t(147).version},261:(e,i,t)=>{var s=t(568),o=t(337);e.exports={id:"widget-bzvisualizer:plugin",requires:[o.IJupyterWidgetRegistry],activate:function(e,i){i.registerWidget({name:"widget-bzvisualizer",version:s.version,exports:s})},autoStart:!0}},699:(e,i,t)=>{"use strict";t.d(i,{Z:()=>n});var s=t(645),o=t.n(s)()((function(e){return e[1]}));o.push([e.id,".BZ-widget {\n    width:  100%;\n    height: 450px;\n    align-items: center;\n}\n",""]);const n=o},73:(e,i,t)=>{"use strict";t.r(i),t.d(i,{default:()=>a});var s=t(379),o=t.n(s),n=t(699);o()(n.Z,{insert:"head",singleton:!1});const a=n.Z.locals||{}},147:e=>{"use strict";e.exports={version:"0.1.0"}}}]);