Skip to content

Commit

Permalink
Docs rebuilt for release
Browse files Browse the repository at this point in the history
  • Loading branch information
OKaluza committed Jul 16, 2024
1 parent c0b196b commit e6eef1a
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://github.com/lavavu/LavaVu/workflows/Test/badge.svg)](https://github.com/lavavu/LavaVu/actions?query=workflow:Test)
[![Deploy Status](https://github.com/lavavu/LavaVu/workflows/Deploy/badge.svg?branch=1.7.3)](https://github.com/lavavu/LavaVu/actions?query=workflow:Deploy)
[![DOI](https://zenodo.org/badge/45163055.svg)](https://zenodo.org/badge/latestdoi/45163055)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.74)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.75)

A scientific visualisation tool with a python interface for fast and flexible visual analysis.

Expand Down
2 changes: 1 addition & 1 deletion binder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/lavavu/lavavu:1.8.74
FROM ghcr.io/lavavu/lavavu:1.8.75
2 changes: 1 addition & 1 deletion docs/src/Installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,6 @@ A base dockerfile is provided in the repository root.
You can try it out on binder

.. image:: https://mybinder.org/badge_logo.svg
:target: https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.74
:target: https://mybinder.org/v2/gh/lavavu/LavaVu/1.8.75


7 changes: 7 additions & 0 deletions lavavu/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ def _connectcode(target):
else:
return ""

def _emscriptencode(menu=False, lighttheme=True):
"""
Returns WebGL base code for an interactive visualisation window
"""
jslibs = [[], ['emscripten.js', 'LavaVu.js']]
return _webglcode('', ['emscripten.css'], jslibs, menu=menu, lighttheme=lighttheme)

def _getcss(files=["styles.css"]):
#Load stylesheets to inline tag
return _filestohtml(files, tag="style")
Expand Down
9 changes: 9 additions & 0 deletions lavavu/html/drawbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ function canvasBoxMouseMove(event, mouse) {

mouse.element.viewer.draw();

//Instant updates
if (mouse.element.viewer.alwaysdraw) {
if (mouse.element.viewer.rotating)
mouse.element.viewer.command('' + mouse.element.viewer.getRotationString());
else
mouse.element.viewer.command('' + mouse.element.viewer.getTranslationString());
}

return false;
}

Expand Down Expand Up @@ -422,6 +430,7 @@ function BoxViewer(canvas) {

//Non-persistant settings
this.mode = 'Rotate';
this.alwaysdraw = false;
if (!this.gl) return;

//Create the renderers
Expand Down
2 changes: 1 addition & 1 deletion lavavu/html/emscripten-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var Module = {
},
locateFile: function(path, prefix) {
// Source from github by default
if (path.endsWith("LavaVu.wasm") || path.endsWith("LavaVu.data")) return "https://cdn.jsdelivr.net/gh/lavavu/lavavu.github.io@LAVAVU_VERSION/" + path;
//if (path.endsWith("LavaVu.wasm") || path.endsWith("LavaVu.data")) return "https://cdn.jsdelivr.net/gh/lavavu/lavavu.github.io@LAVAVU_VERSION/" + path;
// otherwise, use the default, the prefix (JS file's dir) + the path
return prefix + path;
},
Expand Down
1 change: 1 addition & 0 deletions lavavu/html/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ function createMenu(viewer, onchange, webglmode, global) {
gui.add({"Export GLDB" : function() {window.commands.push('export');}}, 'Export GLDB');
} else if (viewer.canvas) {
//Server render
gui.add(viewer, "alwaysdraw");
var url = viewer.canvas.imgtarget.baseurl;
if (url)
gui.add({"Popup Viewer" : function() {window.open(url, "LavaVu", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=1024,height=768");}}, 'Popup Viewer');
Expand Down
2 changes: 1 addition & 1 deletion lavavu/html/webview.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<input id="fileinput" type="file" style="visibility:hidden" onchange="useFileInput(this)" />

<script async src="https://cdn.jsdelivr.net/gh/lavavu/[email protected].74/LavaVu-amalgamated.min.js"></script>
<script async src="https://cdn.jsdelivr.net/gh/lavavu/[email protected].75/LavaVu-amalgamated.min.js"></script>
<!--script src="dat.gui.min.js"></script>
<script src="OK-min.js"></script>
Expand Down
21 changes: 21 additions & 0 deletions lavavu/lavavu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3899,6 +3899,7 @@ def webview(self, resolution=(640,480)):
if not is_notebook():
#Open the file in a new browser window
import webbrowser
#TODO: this url doesn't work
webbrowser.open("/webview.html", new=1, autoraise=True)
else:
from IPython.display import display,HTML,IFrame
Expand All @@ -3916,6 +3917,26 @@ def webview(self, resolution=(640,480)):
</div>""".format(resolution[0], resolution[1], url)
display(HTML(html))

"""
#EXPERIMENTAL EMSCRIPTEN INLINE VERSION
html = control._emscriptencode(menu)
ID = str(len(self.webglviews))
template = control.emscripten_inline
#template = template.replace('---ID---', ID)
#template = template.replace('---INIT---', 'initPage(\'{0}\', {1});'.format(ID, "true" if menu else "false"))
#template = template.replace('---CONTENT---', control.hiddenhtml)
#template = template.replace('---WIDTH---', str(resolution[0]))
#template = template.replace('---HEIGHT---', str(resolution[1]))
html = template.replace('---SCRIPTS---', html)
self.webglviews.append(ID)
#Display inline in cell
#from IPython.display import IFrame
#display(IFrame(filename, width=resolution[0], height=resolution[1]))
from IPython.display import display,HTML
display(HTML(html))
"""

def webgl(self, filename=None, resolution=(640,480), browser=False, menu=True, **kwargs):
"""
Create a WebGL page with a 3D interactive view of the active model
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#Current version
#(must be of the form X.Y.Z to trigger wheel builds)
version = "1.8.74"
version = "1.8.75"

"""
To release a new verison:
Expand Down

0 comments on commit e6eef1a

Please sign in to comment.