diff --git a/ipyvolume/pylab.py b/ipyvolume/pylab.py index ad447f1b..64f31a11 100644 --- a/ipyvolume/pylab.py +++ b/ipyvolume/pylab.py @@ -1803,11 +1803,11 @@ def light_hemisphere( def light_directional( light_color=default_color_selected, intensity=1, - position=[10, 10, 10], + position=[2, 2, 2], target=[0, 0, 0], near=0.1, - far=100, - shadow_camera_orthographic_size=10, + far=5, + shadow_camera_orthographic_size=3, cast_shadow=True): """Create a new Directional Light diff --git a/ipyvolume/server.py b/ipyvolume/server.py new file mode 100644 index 00000000..e75f2a29 --- /dev/null +++ b/ipyvolume/server.py @@ -0,0 +1,17 @@ +import sys +import os +from http.server import HTTPServer, SimpleHTTPRequestHandler +import ssl + + +def main(args=sys.argv): + os.system("openssl req -nodes -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -subj '/CN=mylocalhost'") + port = 443 + httpd = HTTPServer(('0.0.0.0', port), SimpleHTTPRequestHandler) + httpd.socket = ssl.wrap_socket(httpd.socket, keyfile='key.pem', certfile="cert.pem", server_side=True) + print(f"Server running on https://0.0.0.0:{port}") + httpd.serve_forever() + + +if __name__ == "__main__": + main() diff --git a/ipyvolume/styles.py b/ipyvolume/styles.py index c199b821..1279300d 100644 --- a/ipyvolume/styles.py +++ b/ipyvolume/styles.py @@ -3,6 +3,7 @@ Possible properies * background-color + * background-opacity * axes * color * visible @@ -31,6 +32,7 @@ styles = {} _defaults = { + 'background-opacity': 1.0, 'axes': {'visible': True, 'label': {'color': 'black'}, 'ticklabel': {'color': 'black'}}, 'box': {'visible': True}, } @@ -73,6 +75,13 @@ def create(name, properties): minimal = {'box': {'visible': False}, 'axes': {'visible': False}} nobox = create("nobox", {'box': {'visible': False}, 'axes': {'visible': True}}) +_ar = { + 'background-color': '#000001', # for some reason we cannot set it to black!?! + 'background-opacity': 0, +} +utils.dict_deep_update(_ar, minimal) +ar = create("ar", _ar) + if __name__ == "__main__": source = __file__ dest = os.path.join(os.path.dirname(source), "../js/data/style.json") diff --git a/ipyvolume/ui.py b/ipyvolume/ui.py index 0ab6799e..87ea7332 100644 --- a/ipyvolume/ui.py +++ b/ipyvolume/ui.py @@ -25,6 +25,7 @@ class Container(v.VuetifyTemplate): children = traitlets.List().tag(sync=True, **widgets.widget_serialization) models = traitlets.Any({'figure': {}}).tag(sync=True) panels = traitlets.List(traitlets.CInt(), default_value=[0, 1, 2]).tag(sync=True) + ar_supported = traitlets.Bool(False).tag(sync=True) class Popup(v.VuetifyTemplate): diff --git a/ipyvolume/vue/container.vue b/ipyvolume/vue/container.vue index f31f517f..175fbc4f 100644 --- a/ipyvolume/vue/container.vue +++ b/ipyvolume/vue/container.vue @@ -29,6 +29,12 @@ +