File tree Expand file tree Collapse file tree
bindings/pyroot/pythonizations/python/ROOT/_jupyroot/helpers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8989
9090_jsCode = """
9191{jsDivHtml}
92- </div>
9392<script>
9493 function process_{jsDivId}() {{
9594 function execCode(Core) {{
119118</script>
120119"""
121120
122-
123- _jsFileCode = """
124- <div style="width: 100%; height: {jsCanvasHeight}px; position: relative">
125- <div id="{jsDivId}">
126- </div>
127- </div>
128- <script>
129- function process_{jsDivId}() {{
130- function showFile(Core) {{
131- Core.settings.HandleKeys = false;
132- const binaryString = atob('{fileBase64}');
133- const bytes = new Uint8Array(binaryString.length);
134- for (let i = 0; i < binaryString.length; i++)
135- bytes[i] = binaryString.charCodeAt(i);
136- Core.buildGUI('{jsDivId}','notebook').then(h => h.openRootFile(bytes.buffer));
137- }}
138- const servers = ['/static/', 'https://root.cern/js/7.11.0/', 'https://jsroot.gsi.de/7.11.0/' ],
139- path = 'build/jsroot';
140- if (typeof JSROOT !== 'undefined')
141- showFile(JSROOT);
142- else if (typeof requirejs !== 'undefined') {{
143- servers.forEach((s,i) => {{ servers[i] = s + path; }});
144- requirejs.config({{ paths: {{ 'jsroot' : servers }} }})(['jsroot'], showFile);
145- }} else {{
146- const config = document.getElementById('jupyter-config-data');
147- if (config)
148- servers[0] = (JSON.parse(config.innerHTML || '{{}}')?.baseUrl || '/') + 'static/';
149- else
150- servers.shift();
151- function loadJsroot() {{
152- return !servers.length ? 0 : import(servers.shift() + path + '.js').catch(loadJsroot).then(() => showFile(JSROOT));
153- }}
154- loadJsroot();
155- }}
156- }}
157- process_{jsDivId}();
158- </script>
159- """
160-
161-
162-
163121TBufferJSONErrorMessage = "The TBufferJSON class is necessary for JS visualisation to work and cannot be found. Did you enable the http module (-D http=ON for CMake)?"
164122
165123
You can’t perform that action at this time.
0 commit comments