sap.ui.define([
   'sap/ui/core/mvc/Controller',
   'sap/ui/core/ResizeHandler'
], function (Controller, ResizeHandler) {
   "use strict";

   return Controller.extend("sap.ui.jsroot.controller.Panel", {

      onBeforeRendering: function() {
         console.log("Cleanup Panel", this.getView().getId());
         if (this.object_painter) {
            this.object_painter.Cleanup();
            delete this.object_painter;
         }
      },
      
      onAfterRendering: function() {
         if (this.after_render_callback) {
            JSROOT.CallBack(this.after_render_callback);
            delete this.after_render_callback;
         }

         if (this.canvas_painter && this.canvas_painter._configured_socket_kind) {
            this.canvas_painter.SetDivId(this.getView().getDomRef(), -1);
            this.canvas_painter.OpenWebsocket(this.canvas_painter._configured_socket_kind);
            delete this.canvas_painter._configured_socket_kind;
         }
 
         if (this.panel_data) {
            var oController = this;
            
            if (oController.panel_data.object) {
               JSROOT.draw(oController.getView().getDomRef(), oController.panel_data.object, oController.panel_data.opt, function(painter) {
                  oController.object_painter = painter;
                  console.log("object painting finished");
               });
            } else if (oController.panel_data.filename) {
               JSROOT.OpenFile(oController.panel_data.filename, function(file) {
                  file.ReadObject(oController.panel_data.itemname, function(obj) {
                     oController.panel_data.object = obj; // get object from the file
                     JSROOT.draw(oController.getView().getDomRef(), obj, oController.panel_data.opt, function(painter) {
                        oController.object_painter = painter;
                       console.log("object painting finished");
                     });
                  });
               });
            }
         }
      },

       onResize: function(event) {
         // use timeout
         if (this.resize_tmout) clearTimeout(this.resize_tmout);
         this.resize_tmout = setTimeout(this.onResizeTimeout.bind(this), 300); // minimal latency
      },

      drawCanvas : function(can, opt, call_back) {
         if (this.canvas_painter) {
            this.canvas_painter.Cleanup();
            delete this.canvas_painter;
         }

         if (!this.getView().getDomRef()) return JSROOT.CallBack(call_back, null);


         var pthis = this;
         JSROOT.draw(this.getView().getDomRef(), can, opt, function(painter) {
            pthis.canvas_painter = painter;
            JSROOT.CallBack(call_back, painter);
         });
      },

      onResizeTimeout: function() {
         delete this.resize_tmout;
         if (this.canvas_painter)
            this.canvas_painter.CheckCanvasResize();
      },

      onInit: function() {
         // this.canvas_painter = JSROOT.openui5_canvas_painter;
         // delete JSROOT.openui5_canvas_painter;

         var oModel = sap.ui.getCore().getModel(this.getView().getId());
         if (oModel) {
            var oData = oModel.getData();
            console.log("Found Panel data for ", this.getView().getId());
            
            if (oData.canvas_painter) {
               this.canvas_painter = oData.canvas_painter;
               delete oData.canvas_painter;
            } else {
               this.panel_data = oData;
               console.log("data", oData);
            }
         } else {
            console.log("found no model for", this.getView().getId());
         }
         
         ResizeHandler.register(this.getView(), this.onResize.bind(this));
      },

      onExit: function() {
         if (this.canvas_painter) {
            this.canvas_painter.Cleanup();
            delete this.canvas_painter;
         }
      }
   });

});

@@ -1364,32 +1364,551 @@
             %7D);%0A
+            %7D else if (oController.panel_data.jsonfilename) %7B%0A               JSROOT.NewHttpRequest(oController.panel_data.jsonfilename, 'object', function(obj) %7B%0A                  oController.object = obj;%0A                  JSROOT.draw(oController.getView().getDomRef(), oController.panel_data.object, oController.panel_data.opt, function(painter) %7B%0A                     oController.object_painter = painter;%0A                     console.log(%22object painting finished%22);%0A                  %7D);%0A               %7D).send();%0A
             %7D el

Support jsonfile also in openui5 panel