diff --git a/README.md b/README.md index a3697a1..1b768c2 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,7 @@ The TileDB-PyBabylonJS library is a geospatial data visualization Python library that interactively visualizes TileDB arrays with [Babylon.js](https://www.babylonjs.com) in a Jupyter notebook widget. -The package is under development and currently contains: - -* point cloud visualizations with the option to stream all data from a TileDB array or define a bounding box to load a slice of the array -* MBRS visualization showing the minimum bounding rectangles of the [fragments](https://docs.tiledb.com/main/background/key-concepts-and-data-format#fragments) in the sparse array containing point cloud data +The package is under development and currently contains point cloud visualizations with the option to stream all data from a TileDB array or define a bounding box to load a slice of the array ## Installation @@ -30,9 +27,7 @@ jupyter nbextension enable --py [--sys-prefix|--user|--system] pybabylonjs Create and activate a development environment: ```bash -conda install -c conda-forge mamba - -mamba create -n pybabylonjs-dev -c conda-forge nodejs yarn python=3.7.10 tree scipy 'pyarrow>2' numpy pandas tiledb-py rasterio gdal pdal python-pdal jupyter-packaging jupyterlab +conda create -n pybabylonjs-dev -c conda-forge nodejs yarn python tree scipy 'pyarrow>2' numpy pandas tiledb-py jupyter-packaging jupyterlab conda activate pybabylonjs-dev @@ -45,7 +40,7 @@ Fork or clone the repo and go to the main directory. Install the TileDB-PyBabylo pip install -e ".[test, examples]" ``` -When developing your extensions you need to manually enable your extensions with the notebook / lab frontend. For jupyter lab this is done by the command: +When developing extensions you need to manually enable the extensions with the notebook / lab frontend. For jupyter lab this is done by the command: ```bash jupyter labextension install @jupyter-widgets/jupyterlab-manager @@ -86,15 +81,16 @@ When you make a change to the Python code rebuild the package and restart the no ## Usage -### Point clouds - Jupyter notebooks are provided in the [examples folder](https://github.com/TileDB-Inc/TileDB-PyBabylonJS/tree/main/examples) for the following visualizations: -* [Slice of the Autzen point cloud](/examples/autzen_slice.ipynb) -* [Streaming the Autzen point cloud](/examples/autzen-streaming.ipynb) -* [Slice of the Boulder point cloud](/examples/point-cloud-boulder.ipynb) +* [Point cloud visualization parameters](examples/point-cloud-parameters.ipynb) contains a description of all parameters +* [Slice of the Autzen point cloud](examples/autzen-slice.ipynb) +* [Slice of the Boulder point cloud](examples/boulder-slice.ipynb) +* [Streaming the Autzen point cloud](examples/autzen-streaming.ipynb) +* [Streaming the Bristol point cloud](examples/bristol-streaming.ipynb) +* [Streaming the Santorini point cloud](examples/santorini-streaming.ipynb) -Display a point cloud visualization from a TileDB cloud sparse array by specifying the bounding box of a slice of the data: +[Sign up for a TileDB account](https://cloud.tiledb.com/auth/signup) and display a point cloud visualization from a TileDB cloud sparse array by specifying the bounding box of a slice of data: ```python from pybabylonjs import Show as show @@ -109,28 +105,80 @@ lidar_array = "autzen-classified" show.point_cloud(source="cloud", uri = "tiledb://TileDB-Inc/autzen_classified_tiledb", - token = "***", + token=token, bbox = bbox, - particle_size = 2.5, - width = 1000, - height = 900, + point_size = 3, rgb_max = 65535, - camera_radius = 700) + camera_up = 25, + camera_location = 2, + camera_zoom = [2,2,2], + point_type = 'fixed_screen_size', + width=1000, + height=600) ``` -Or stream all data from a group of arrays: +Or stream all data from a group of arrays: ```python show.point_cloud(streaming=True, - uri="***", - token="***", - max_levels=6, - particle_size = 3, - color_scheme = 'light', - width = '1200px', - height = '800px', + uri="tiledb://TileDB-Inc/bristol", + token=token, + point_size = 4, + wheel_precision = 0.2, + color_scheme = 'dark', + width = 1200, + height = 800, rgb_max = 255, - camera_radius = 800, - particle_budget = 8000000) + point_budget = 3500000, + camera_location = 8, + camera_zoom = [1, 1, 2], + camera_up = 50, + move_speed = 8, + point_type = 'fixed_world_size') ``` +### Parameters + +The following parameters can be set for a point cloud visualization: + +* `camera_location` is the location of the arcRotateCamera in relation to the centre of the point cloud. 1: south, 2: south-east, 3: east, 4: north-east, 5: north, 6: north-west, 7: west, 8: south-west and 9: looking down from above the centre of the point cloud +* `camera_up` is the height of the initial location of the freeCamera +* `camera_zoom` scales the camera position relative to the centre of the point cloud with `[1,1,1]` being in the default position and `[2,2,2]` is then twice a far away from the centre in the X, Y and Z direction +* `color_scheme` is the initial background color: `dark` (default), `light` or ` blue` +* `data` is the dictionary with the point cloud data when `source = dict`. This dictionary needs to contain values for the location `X`, `Y` and `Z` and the RGB color for each point `Red`, `Green` and `Blue` +* `height` is the height of the display window in pixels +* `point_size` is the size of the points +* `point_type` is the interactive point size type + * `fixed_screen_size` (default): each point has a constant size in pixels regardless of its distance to the camera + * `fixed_world_space`: each point has a constant size in world space. This value should be set accordingly to the spacing of the points in world space + * `adaptive_world_space`: the same as `fixed_world_space` for the below example. But when streaming point cloud data, the point size depends on the locally loaded LODs at each point. The point density across all blocks of the same LOD should be the same and the point density should double at each LOD +* `source` is the data source (`cloud` (default), `local` or `dict`) +* `use_sps=True` displays the points as 3D blocks using a [Solid Particle System](https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_intro) +* `use_shader=True` adds the EDL shading +* `edl_strength` is the strenght of the shader +* `wheel_precision` gives control over how fast to zoom with the mouse wheel +* `width` is the width of the display window in pixels + +### Navigating the point cloud + +There are two different cameras available to navigate the point cloud, the arcRotateCamera and freeCamera. Toggle between them with `c`. The initial camera is always the arcRotateCamera + +**arcRotateCamera** +* Zoom in and out with the scroll wheel +* Rotate by dragging the mouse with left button down +* The parameter `wheel_precision` gives control over how fast to zoom with the mouse wheel +* The camera location and distance from the centre of the points can be changed with `camera_location` and `camera_zoom` +* Rotate through the `camera_locations` with `v` +* Change the background color between dark and light with `b` + +**freeCamera** +* Move forward: `w` or `up` +* Move backward: `s` or `down` +* Move up: `e` +* Move down: `q` +* Move to the left: `a` or `left` +* Move to the right: `d` or `right` +* Rotate by dragging the mouse with left button down +* The initial camera position is the centre of the point cloud, the height of the location can be changed with the parameter `camera_up` +* The camera speed can be changed with the parameter `move_speed` +* Change the background color between dark and light with `b` \ No newline at end of file diff --git a/examples/autzen_slice.ipynb b/examples/autzen-slice.ipynb similarity index 67% rename from examples/autzen_slice.ipynb rename to examples/autzen-slice.ipynb index c5c1f7e..3106f00 100644 --- a/examples/autzen_slice.ipynb +++ b/examples/autzen-slice.ipynb @@ -5,13 +5,9 @@ "id": "8e320b80-f162-4dad-8f5b-17032c782daf", "metadata": {}, "source": [ - "# Point Cloud Data Visualization\n", + "# View a slice of the Autzen point cloud\n", "\n", - "* Visualize the point cloud from a\n", - " * local array\n", - " * cloud array\n", - " * dictionary\n", - "* Customize with optional parameters" + "The data used in this notebook can be [found here](https://github.com/PDAL/data/tree/master/autzen) and has a BSD license as [described here](https://pdal.io/en/latest/copyright.html#overall-pdal-license-bsd)." ] }, { @@ -21,47 +17,9 @@ "metadata": {}, "outputs": [], "source": [ - "import requests\n", - "import json\n", - "\n", "import pandas as pd\n", - "import pdal\n", - "from pybabylonjs import Show as show\n", - "import tiledb" - ] - }, - { - "cell_type": "markdown", - "id": "cc1939af-2756-4186-8622-4f30b5b26d49", - "metadata": {}, - "source": [ - "## Optional: create a sparse TileDB array from a LAZ file" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "fb1f30f8-6c05-48c2-b1af-574ae76e1252", - "metadata": {}, - "outputs": [], - "source": [ - "!wget -nc \"https://github.com/PDAL/data/blob/master/autzen/autzen-classified.laz?raw=true\" -O \"autzen-classified.laz\"" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a29673a4-798f-444c-915b-ab4bd4a2be21", - "metadata": {}, - "outputs": [], - "source": [ - "pipeline = (\n", - " pdal.Reader(\"autzen-classified.laz\") |\n", - " pdal.Filter.stats() |\n", - " pdal.Writer.tiledb(array_name=\"autzen-classified\",chunk_size=100000)\n", - ")\n", - "\n", - "count = pipeline.execute() " + "import tiledb\n", + "from pybabylonjs import Show as show" ] }, { @@ -71,12 +29,12 @@ "source": [ "## Data sources\n", "\n", - "The point cloud data can be loaded in three different ways that are specfied by the `source` parameter:\n", - "* a locally stored TileDB array (`source = \"local\"`)\n", + "A slice of a point cloud can be viewed from three different sources specified by the `source` parameter:\n", "* a TileDB Cloud array (`source = \"cloud\"`)\n", + "* a local TileDB array (`source = \"local\"`)\n", "* a dictionary (`source = \"dict\"`)\n", "\n", - "To load and display a slice of the data a bounding box with the minimum and maximum values of X, Y and Z are needed:" + "In all cases a bounding box (`bbox`) with the minimum and maximum values of X, Y and Z is needed to slice the data from the array:" ] }, { @@ -90,12 +48,6 @@ " 'X': [636800, 637200],\n", " 'Y': [852800, 853100],\n", " 'Z': [406.14, 615.26]\n", - "}\n", - "\n", - "bbox2 = {\n", - " 'X': [636800, 637800],\n", - " 'Y': [851000, 853000],\n", - " 'Z': [406.14, 615.26]\n", "}" ] }, @@ -105,10 +57,19 @@ "metadata": {}, "source": [ "### Cloud array\n", - "To display point cloud data from a TileDB cloud array a TileDB `token` is needed: \n", - "* [Sign up for a free TileDB account](https://cloud.tiledb.com/auth/signup)\n", - "* [Create a token as described here](https://docs.tiledb.com/cloud/how-to/account/create-api-tokens)\n", - "* Paste the token into the below cell (``)" + "\n", + "To view point cloud data from a TileDB cloud array a `token` is needed: \n", + "* [sign up for a TileDB account](https://cloud.tiledb.com/auth/signup)\n", + "\n", + "When running this notebook locally:\n", + "* [create a token as described here](https://docs.tiledb.com/cloud/how-to/account/create-api-tokens)\n", + "* uncomment the below cell and add your token (``)\n", + "* run the below cells\n", + "\n", + "When running this notebook on TileDB Cloud:\n", + "* the token will be automatically loaded\n", + "* remove the token from the list of parameters of `show.point_cloud`\n", + "* run the below cells" ] }, { @@ -118,7 +79,7 @@ "metadata": {}, "outputs": [], "source": [ - "token = \"\"" + "#token = \"\"" ] }, { @@ -134,12 +95,58 @@ " uri = \"tiledb://TileDB-Inc/autzen_classified_tiledb\",\n", " token=token,\n", " bbox = bbox,\n", - " point_size = 6,\n", - " width = 1000,\n", - " height = 1000,\n", + " point_size = 3,\n", " rgb_max = 65535,\n", - " camera_radius = 1000,\n", - " z_scale = 1.2)" + " camera_up = 25,\n", + " camera_location = 2,\n", + " camera_zoom = [2,2,2],\n", + " point_type = 'fixed_world_size',\n", + " width=1000,\n", + " height=600)" + ] + }, + { + "cell_type": "markdown", + "id": "cc1939af-2756-4186-8622-4f30b5b26d49", + "metadata": {}, + "source": [ + "## Optional: create and view a point cloud array from a LAZ file" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8f43beb0-5de1-4329-a4bf-f28339b8b0d8", + "metadata": {}, + "outputs": [], + "source": [ + "import pdal" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fb1f30f8-6c05-48c2-b1af-574ae76e1252", + "metadata": {}, + "outputs": [], + "source": [ + "!wget -nc \"https://github.com/PDAL/data/blob/master/autzen/autzen-classified.laz?raw=true\" -O \"autzen-classified.laz\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a29673a4-798f-444c-915b-ab4bd4a2be21", + "metadata": {}, + "outputs": [], + "source": [ + "pipeline = (\n", + " pdal.Reader(\"autzen-classified.laz\") |\n", + " pdal.Filter.stats() |\n", + " pdal.Writer.tiledb(array_name=\"autzen-classified\",chunk_size=100000)\n", + ")\n", + "\n", + "count = pipeline.execute() " ] }, { @@ -148,7 +155,7 @@ "metadata": {}, "source": [ "### Local array\n", - "Point cloud data in a local array is loaded and displayed with the below." + "The point cloud data from the newly created array can now be viewed with the below. Note that a larger slice is loaded than in the cells above." ] }, { @@ -161,6 +168,20 @@ "lidar_array = \"autzen-classified\"" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "77f078f4-a600-4fac-a180-fb3e773aa32b", + "metadata": {}, + "outputs": [], + "source": [ + "bbox2 = {\n", + " 'X': [636800, 637800],\n", + " 'Y': [851000, 853000],\n", + " 'Z': [406.14, 615.26]\n", + "}" + ] + }, { "cell_type": "code", "execution_count": null, @@ -171,13 +192,14 @@ "show.point_cloud(source=\"local\",\n", " uri=lidar_array,\n", " bbox = bbox2,\n", - " point_size = 4,\n", " width = 1000,\n", " height = 800,\n", + " point_size = 3,\n", " rgb_max = 65535,\n", - " camera_radius = 2000,\n", - " point_budget = 8000000,\n", - " zscale = 3)" + " camera_up = 25,\n", + " camera_location = 2,\n", + " camera_zoom = [2,2,2],\n", + " point_type = 'fixed_world_size')" ] }, { @@ -200,9 +222,9 @@ "source": [ "with tiledb.open(lidar_array) as arr:\n", " data = arr.query(attrs=[\"Red\", \"Green\", \"Blue\"], dims=[\"X\", \"Y\", \"Z\"])[\n", - " bbox[\"X\"][0] : bbox[\"X\"][1],\n", - " bbox[\"Y\"][0] : bbox[\"Y\"][1],\n", - " bbox[\"Z\"][0] : bbox[\"Z\"][1],\n", + " bbox2[\"X\"][0] : bbox2[\"X\"][1],\n", + " bbox2[\"Y\"][0] : bbox2[\"Y\"][1],\n", + " bbox2[\"Z\"][0] : bbox2[\"Z\"][1],\n", " ]" ] }, @@ -223,9 +245,9 @@ "source": [ "with tiledb.open(lidar_array) as arr:\n", " df = pd.DataFrame(arr[\n", - " bbox[\"X\"][0] : bbox[\"X\"][1],\n", - " bbox[\"Y\"][0] : bbox[\"Y\"][1],\n", - " bbox[\"Z\"][0] : bbox[\"Z\"][1]])" + " bbox2[\"X\"][0] : bbox2[\"X\"][1],\n", + " bbox2[\"Y\"][0] : bbox2[\"Y\"][1],\n", + " bbox2[\"Z\"][0] : bbox2[\"Z\"][1]])" ] }, { @@ -274,50 +296,14 @@ "source": [ "show.point_cloud(source=\"dict\",\n", " data=data,\n", - " bbox = bbox,\n", - " point_size = 2.5,\n", + " bbox = bbox2,\n", + " point_size = 3,\n", " width = 1000,\n", " height = 700,\n", " rgb_max = 65535,\n", - " camera_radius = 700)" - ] - }, - { - "cell_type": "markdown", - "id": "efebcc6b-af38-4988-bddc-343d551e3a54", - "metadata": {}, - "source": [ - "## Optional parameters\n", - "\n", - "There are several parameters to change the way the visualization looks:\n", - "\n", - "* `width` and `height` define the size of the display canvas (defaults are 800 and 600)\n", - "* `particle_size` sets the size of the points (default is 1)\n", - "* `color_scheme` sets the background color scheme, choose from \"dark\" (default), \"light\" and \"blue\"\n", - "* `rgb_max` is the maximum RGB value used to scale all values between 0 and 1, when not provided it will be calculated from the data\n", - "* 'camera_radius' \n", - "* `show_fraction` can be used to display a fraction of the points, showing every *nth* point from the loaded data\n", - "\n", - "An example:" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "950da2b4-359a-42ed-97ec-3873eecdebc0", - "metadata": {}, - "outputs": [], - "source": [ - "show.point_cloud(source=\"dict\",\n", - " data=data,\n", - " bbox=bbox,\n", - " width=800,\n", - " height=700,\n", - " point_size=3,\n", - " color_scheme=\"light\",\n", - " rgb_max=65535, \n", - " camera_radius = 1000,\n", - " show_fraction = 4)" + " camera_up = 25,\n", + " camera_location = 2,\n", + " camera_zoom = [2,2,2])" ] }, { diff --git a/examples/autzen-streaming.ipynb b/examples/autzen-streaming.ipynb index cfe392a..ab32560 100644 --- a/examples/autzen-streaming.ipynb +++ b/examples/autzen-streaming.ipynb @@ -2,97 +2,84 @@ "cells": [ { "cell_type": "markdown", - "id": "ea5e39c9-72ce-4032-8645-67445ab34074", + "id": "ece79f11-ab6e-447e-a843-c646d27e9a46", "metadata": {}, "source": [ - "# Stream and visualize the Autzen point cloud" + "# Stream and visualize the Autzen point cloud\n", + "\n", + "The original data used in this notebook can be [found here](https://github.com/PDAL/data/tree/master/autzen) and has a BSD license as [described here](https://pdal.io/en/latest/copyright.html#overall-pdal-license-bsd)." ] }, { "cell_type": "code", "execution_count": null, - "id": "4cbfca2f-4088-4605-843f-6de49ed74b3b", + "id": "34b3f824-b53c-4d9d-b4d2-8e900ff7252f", "metadata": {}, "outputs": [], "source": [ - "import requests\n", - "import json\n", - "\n", - "import pandas as pd\n", - "import pdal\n", - "from pybabylonjs import Show as show\n", - "import tiledb" + "from pybabylonjs import Show as show" ] }, { "cell_type": "markdown", - "id": "e9df8cc1-8f12-46f0-86bf-5af11b76959c", + "id": "5c4ec8bd-7b69-48f0-b70d-9977e07d2d7d", "metadata": {}, "source": [ - "### Cloud array\n", - "Load and display point cloud data from cloud arrays with different levels of detail (LOD)." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "f68dfda1-7582-45f7-bc1f-f993448a9a1d", - "metadata": {}, - "outputs": [], - "source": [ - "token = \"\"" + "To stream and view point cloud data from a TileDB array a `token` is needed: \n", + "* [sign up for a TileDB account](https://cloud.tiledb.com/auth/signup)\n", + "\n", + "When running this notebook locally:\n", + "* [create a token as described here](https://docs.tiledb.com/cloud/how-to/account/create-api-tokens)\n", + "* uncomment the below cell and add your token (``)\n", + "* run the below cells\n", + "\n", + "When running this notebook on TileDB Cloud:\n", + "* the token will be automatically loaded\n", + "* remove the token from the list of parameters of `show.point_cloud`\n", + "* run the below cells" ] }, { "cell_type": "code", "execution_count": null, - "id": "12fbeff2-73a2-4ff0-bc8f-bb69870948af", + "id": "6ce7f8c7-0805-444b-93ad-3b7554de8304", "metadata": {}, "outputs": [], "source": [ - "uri = \"tiledb://norman/autzen\"" + "#token = \"\"" ] }, { "cell_type": "code", "execution_count": null, - "id": "c927a1a2-0371-4af3-bf96-1ab8ed94e337", + "id": "19e3204d-d1a1-4ab8-a888-5833ed44e41d", "metadata": {}, "outputs": [], "source": [ "show.point_cloud(streaming=True,\n", - " uri=uri,\n", + " uri=\"tiledb://TileDB-Inc/autzen-classified\",\n", " token=token,\n", - " max_levels=6,\n", " point_size = 3,\n", - " color_scheme = 'light',\n", - " width = '1200px',\n", - " height = '800px',\n", - " rgb_max = 255,\n", - " camera_radius = 800,\n", - " point_budget = 8000000)" + " wheel_precision = 0.1,\n", + " color_scheme = 'dark',\n", + " width = 1200,\n", + " height = 800, \n", + " rgb_max = 65535,\n", + " point_budget = 3500000,\n", + " camera_location = 8,\n", + " camera_zoom = [1, 1, 4],\n", + " camera_up = 25, \n", + " move_speed = 4,\n", + " point_type = 'fixed_world_size')" ] }, { "cell_type": "code", "execution_count": null, - "id": "565b0786-c713-4d01-9bdf-b334db4705e3", + "id": "4df8948e-95cf-44ed-83fe-f6c5fa1271a4", "metadata": {}, "outputs": [], - "source": [ - "show.point_cloud(streaming=True,\n", - " uri=uri,\n", - " token=token,\n", - " max_levels=6,\n", - " point_size = 3,\n", - " color_scheme = 'light',\n", - " width = '1200px',\n", - " height = '800px',\n", - " rgb_max = 255,\n", - " camera_radius = 800,\n", - " point_budget = 8000000,\n", - " use_shader = True)" - ] + "source": [] } ], "metadata": { diff --git a/examples/point-cloud-boulder.ipynb b/examples/boulder-slice.ipynb similarity index 63% rename from examples/point-cloud-boulder.ipynb rename to examples/boulder-slice.ipynb index 4f0824c..5f17b1f 100644 --- a/examples/point-cloud-boulder.ipynb +++ b/examples/boulder-slice.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "71b119a2-8ded-4cf2-8082-ebda1c4043fb", + "id": "021131af-fdc5-401b-a433-2c95182570da", "metadata": {}, "source": [ "# Boulder Point Cloud Data Visualization\n", @@ -15,60 +15,61 @@ { "cell_type": "code", "execution_count": null, - "id": "d390f128-bcc0-471d-baed-2bd969da5e31", + "id": "871a6409-0a93-4a8c-bf50-40aabed6db9c", "metadata": {}, "outputs": [], "source": [ - "import numpy as np\n", - "import pandas as pd\n", - "import pdal\n", - "from mpl_toolkits.mplot3d import Axes3D\n", - "import matplotlib.pyplot as plt\n", - "\n", - "from pybabylonjs import Show as show\n", - "import tiledb" + "from pybabylonjs import Show as show" ] }, { - "cell_type": "markdown", - "id": "bf39f38e-3047-4d5a-87de-c036c64ac0dc", + "cell_type": "code", + "execution_count": null, + "id": "d98d37dc-9f34-4a4f-a730-161423a08671", "metadata": {}, + "outputs": [], "source": [ - "### Cloud array\n", - "To display point cloud data from a TileDB cloud array a TileDB `token` is needed: \n", - "* [Sign up for a free TileDB account](https://cloud.tiledb.com/auth/signup)\n", - "* [Create a token as described here](https://docs.tiledb.com/cloud/how-to/account/create-api-tokens)\n", - "* Paste the token into the below cell (`***`)\n", - "* Customize the visualization by clicking on `Customize` and then change the parameters" + "bbox = {\n", + " 'X': [475425.0, 475428.915],\n", + " 'Y': [4429710.508, 4429713.178],\n", + " 'Z': [1651.678, 1658.245]}" ] }, { - "cell_type": "code", - "execution_count": null, - "id": "6bc94b47-47ed-4547-92a8-4ebbb2f954e8", + "cell_type": "markdown", + "id": "27e291a4-a09a-436d-9c5d-64a753f739d3", "metadata": {}, - "outputs": [], "source": [ - "token = \"***\"" + "### Cloud array\n", + "\n", + "To view point cloud data from a TileDB cloud array a `token` is needed: \n", + "* [sign up for a TileDB account](https://cloud.tiledb.com/auth/signup)\n", + "\n", + "When running this notebook locally:\n", + "* [create a token as described here](https://docs.tiledb.com/cloud/how-to/account/create-api-tokens)\n", + "* uncomment the below cell and add your token (``)\n", + "* run the below cells\n", + "\n", + "When running this notebook on TileDB Cloud:\n", + "* the token will be automatically loaded\n", + "* remove the token from the list of parameters of `show.point_cloud`\n", + "* run the below cells" ] }, { "cell_type": "code", "execution_count": null, - "id": "f10e4391-3639-4a72-b59a-22b0f6e03b55", + "id": "6c157357-108a-4d8d-8a97-5f2d75fdb3a2", "metadata": {}, "outputs": [], "source": [ - "bbox = {\n", - " 'X': [475425.0, 475428.915],\n", - " 'Y': [4429710.508, 4429713.178],\n", - " 'Z': [1651.678, 1658.245]}" + "#token = \"\"" ] }, { "cell_type": "code", "execution_count": null, - "id": "2a99dd39-4a1d-474d-9bff-325cdff7c6c8", + "id": "84e968ea-c5df-4c6f-9657-b8982d60fb9b", "metadata": {}, "outputs": [], "source": [ @@ -80,14 +81,15 @@ " width = 1000,\n", " height = 500,\n", " rgb_max = 65280,\n", - " camera_radius = 20,\n", - " )" + " camera_zoom = [5, 5, 2],\n", + " camera_location = 6,\n", + " point_type = 'fixed_world_size')" ] }, { "cell_type": "code", "execution_count": null, - "id": "f92171f9-4164-4da6-8459-3007c5fea16c", + "id": "5d0731fe-e332-416a-87ee-a802b167ab95", "metadata": {}, "outputs": [], "source": [] diff --git a/examples/bristol-streaming.ipynb b/examples/bristol-streaming.ipynb new file mode 100644 index 0000000..959521b --- /dev/null +++ b/examples/bristol-streaming.ipynb @@ -0,0 +1,107 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "fcba3248-ccd2-456e-ae66-bd66f989d6cd", + "metadata": {}, + "source": [ + "# Stream and visualize the Bristol point cloud\n", + "\n", + "This notebook streams and visualizes a point cloud of the area along the river Avon in Bristol (UK). The original data files are from the [National Lidar Programme](https://environment.data.gov.uk/dataset/2e8d0733-4f43-48b4-9e51-631c25d1b0a9)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "1ca01f82-4282-4262-a016-4fd0ee70a4e9", + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "from pybabylonjs import Show as show" + ] + }, + { + "cell_type": "markdown", + "id": "c5c89a6e-3240-4e56-8c83-b091170be7c9", + "metadata": {}, + "source": [ + "To stream and view point cloud data from a TileDB array a `token` is needed: \n", + "* [sign up for a TileDB account](https://cloud.tiledb.com/auth/signup)\n", + "\n", + "When running this notebook locally:\n", + "* [create a token as described here](https://docs.tiledb.com/cloud/how-to/account/create-api-tokens)\n", + "* uncomment the below cell and add your token (``)\n", + "* run the below cells\n", + "\n", + "When running this notebook on TileDB Cloud:\n", + "* the token will be automatically loaded\n", + "* remove the token from the list of parameters of `show.point_cloud`\n", + "* run the below cells" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "08e4ec2c-c0e6-4569-a30f-546f94c39cee", + "metadata": {}, + "outputs": [], + "source": [ + "#token = \"\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "57d50a63-1a36-45c8-a6c1-b13def92cd1c", + "metadata": {}, + "outputs": [], + "source": [ + "show.point_cloud(streaming=True,\n", + " uri=\"tiledb://TileDB-Inc/bristol\",\n", + " token=token, \n", + " point_size = 4,\n", + " wheel_precision = 0.2,\n", + " color_scheme = 'dark',\n", + " width = 1200,\n", + " height = 800, \n", + " rgb_max = 255,\n", + " point_budget = 3500000,\n", + " camera_location = 8,\n", + " camera_zoom = [1, 1, 2],\n", + " camera_up = 50, \n", + " move_speed = 8,\n", + " point_type = 'fixed_world_size')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0550018b-6b97-4484-bb42-2924093d4f5b", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/examples/point-cloud-parameters.ipynb b/examples/point-cloud-parameters.ipynb new file mode 100644 index 0000000..57abde0 --- /dev/null +++ b/examples/point-cloud-parameters.ipynb @@ -0,0 +1,261 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "0998f3eb-1c73-4e34-b406-007e1d795625", + "metadata": {}, + "source": [ + "# Point cloud visualization parameters\n", + "\n", + "This notebook gives an overview of the various parameters that are available to change the appearance of the point cloud visualization and how to navigate through the points with the keyboard and mouse. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0467dca5-2eb0-4dcd-9859-3df15050842c", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from pybabylonjs import Show as show" + ] + }, + { + "cell_type": "markdown", + "id": "4a27ab65-9b45-47ba-9d10-0990da8de86a", + "metadata": {}, + "source": [ + "Create a random point cloud to visualize and explore the parameters with:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "419814fe-aabc-46e5-9865-dfdf7e63c05a", + "metadata": {}, + "outputs": [], + "source": [ + "(minx, maxx), (miny, maxy), (minz, maxz) = ((-80, 80), (-150, 150), (-5, 5))\n", + "extent = 50.\n", + "num_vals = 1000\n", + "\n", + "xs = np.random.default_rng().uniform(minx - extent, maxx + extent, num_vals)\n", + "ys = np.random.default_rng().uniform(miny - extent, maxy + extent, num_vals)\n", + "zs = np.random.default_rng().uniform(minx, maxz, num_vals)\n", + "\n", + "data = {\n", + " \"X\": xs,\n", + " \"Y\": ys,\n", + " \"Z\": zs,\n", + " \"Red\": np.random.default_rng().uniform(0., 1., num_vals),\n", + " \"Green\": np.random.default_rng().uniform(0., 1., num_vals),\n", + " \"Blue\": np.random.default_rng().uniform(0., 1., num_vals)\n", + "}" + ] + }, + { + "cell_type": "markdown", + "id": "202e301e-4be1-417d-9a77-2ae0717a6d44", + "metadata": {}, + "source": [ + "The below displays a default point cloud visualization with [BabylonJS](https://www.babylonjs.com/), where the points from `data` are used to create a [PointCloudSystem](https://doc.babylonjs.com/features/featuresDeepDive/particles/point_cloud_system). Click the menu in the top right corner to change the background color, and click the menu again to collapse the options. \n", + "\n", + "`source=\"dict\"` specifies that the data will be loaded from the `data` dictionary (`dict`) created above. This dictionary always needs to contain values for the location `X`, `Y` and `Z` and the RGB color for each point `Red`, `Green` and `Blue`, in this case scaled between 0 and 1. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a024e5d3-4198-4ba0-8c81-22ad0112f72e", + "metadata": {}, + "outputs": [], + "source": [ + "show.point_cloud(source=\"dict\",\n", + " data=data,\n", + " point_size = 10)" + ] + }, + { + "cell_type": "markdown", + "id": "f577ef0e-e3c4-430d-ac06-4b12c644a2cf", + "metadata": {}, + "source": [ + "The size of the points of defined by the `point_size`parameter. Other parameters that can be used to improve the looks of the visualization are:\n", + "\n", + "* `width` and `height` are the width and height of the display window in pixels\n", + "* `color_scheme` is the initial background color: `dark` (default), `light` or ` blue`\n", + "* `camera_zoom` scales the camera position relative to the centre of the point cloud with `[1,1,1]` being in the default position and `[2,2,6]` is then twice a far away from the centre in the X and Y direction, and 6 times as far away in the Z direction\n", + "* `camera_location` is the location of the camera in relation to the centre of the point cloud. 1: south, 2: south-east, 3: east, 4: north-east, 5: north, 6: north-west, 7: west, 8: south-west and 9: looking down from above the centre of the point cloud" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "022751de-f2c2-4e59-a12f-a33a3badbe37", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "show.point_cloud(source=\"dict\",\n", + " data=data,\n", + " point_size = 20,\n", + " width=1000,\n", + " height=600,\n", + " color_scheme=\"dark\",\n", + " camera_zoom=[2,2,6],\n", + " camera_location=2)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "e590860a-47d2-411f-ba4e-7605a5440cb1", + "metadata": {}, + "source": [ + "The size of the points can be interactively updated with the `point_type` parameter. Choose one of the below:\n", + "\n", + "* `fixed_screen_size` (default): each point has a constant size in pixels regardless of its distance to the camera\n", + "* `fixed_world_size`: each point has a constant size in world space. This value should be set accordingly to the spacing of the points in world space\n", + "* `adaptive_world_size`: the same as `fixed_world_size` for the below example. But when streaming point cloud data, the point size depends on the locally loaded LODs at each point. The point density across all blocks of the same LOD should be the same and the point density should double at each LOD" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0c41559c-9243-41c4-98db-024f3b3cb382", + "metadata": {}, + "outputs": [], + "source": [ + "show.point_cloud(source=\"dict\",\n", + " data=data,\n", + " point_size = 20,\n", + " width=1000,\n", + " height=600,\n", + " color_scheme=\"dark\",\n", + " camera_zoom=[2,2,6],\n", + " camera_location=2,\n", + " point_type = 'fixed_world_size')" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "id": "401bb0f4-1562-478d-a956-db67218b16af", + "metadata": {}, + "source": [ + "It is possible to show each point as a 3D block instead of a 2D square, but note that this is more memory intensive and might slow down the visualization for large point clouds. To see a clearer distinction between the blocks [Eye Dome Lighting (EDL)](https://www.kitware.com/eye-dome-lighting-a-non-photorealistic-shading-technique/) can be added. \n", + "\n", + "* `use_sps=True` displays the points as 3D blocks using a [Solid Particle System](https://doc.babylonjs.com/features/featuresDeepDive/particles/solid_particle_system/sps_intro)\n", + "* `use_shader=True` adds the EDL shading \n", + "* `edl_strength` is the strenght of the shader" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "28f6c561-f1bd-4409-a6d1-f5c3723dd50e", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "show.point_cloud(source=\"dict\",\n", + " data=data,\n", + " point_size = 10,\n", + " width=1000,\n", + " height=600,\n", + " camera_location=3,\n", + " camera_zoom=[4,4,6],\n", + " color_scheme=\"light\",\n", + " use_sps=True,\n", + " use_shader=True,\n", + " edl_strength=5)" + ] + }, + { + "cell_type": "markdown", + "id": "b7846c5f-a71b-40a1-94a8-f6e5c3edefca", + "metadata": { + "tags": [] + }, + "source": [ + "## Navigating the point cloud\n", + "\n", + "There are two different cameras available to navigate the point cloud, the arcRotateCamera and freeCamera. Toggle between them with `c`. The initial camera is always the arcRotateCamera\n", + "\n", + "**arcRotateCamera** \n", + "* Zoom in and out with the scroll wheel\n", + "* Rotate by dragging the mouse with left button down\n", + "* The parameter `wheel_precision` gives control over how fast to zoom with the mouse wheel\n", + "* The camera location and distance from the centre of the points can be changed with `camera_location` and `camera_zoom`\n", + "* Rotate through the `camera_locations` with `v`\n", + "* Change the background color between dark and light with `b`\n", + "\n", + "**freeCamera**\n", + "* Move forward: `w` or `up`\n", + "* Move backward: `s` or `down`\n", + "* Move up: `e`\n", + "* Move down: `q`\n", + "* Move to the left: `a` or `left`\n", + "* Move to the right: `d` or `right`\n", + "* Rotate by dragging the mouse with left button down\n", + "* The initial camera position is the centre of the point cloud, the height of the location can be changed with the parameter `camera_up`\n", + "* The camera speed can be changed with the parameter `move_speed`\n", + "* Change the background color between dark and light with `b`\n", + "\n", + "The below example shows some of these options where they are all set to move very fast:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "841bdccf-34c2-476f-a2d6-0e41823b9777", + "metadata": {}, + "outputs": [], + "source": [ + "show.point_cloud(source=\"dict\",\n", + " data=data,\n", + " point_size = 10,\n", + " width=1000,\n", + " height=600,\n", + " camera_location=6,\n", + " camera_zoom=[4,4,6],\n", + " color_scheme=\"light\",\n", + " wheel_precision=0.01,\n", + " camera_up=20,\n", + " move_speed=10)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f28cd846-a920-4e5f-8b18-e57d70005452", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/examples/santorini-streaming.ipynb b/examples/santorini-streaming.ipynb new file mode 100644 index 0000000..445d836 --- /dev/null +++ b/examples/santorini-streaming.ipynb @@ -0,0 +1,106 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "0bc65c29-e65c-4f30-b7bd-727ad123c78b", + "metadata": {}, + "source": [ + "# Stream and visualize the Santorini point cloud\n", + "\n", + "This notebook streams and visualizes a point cloud of the Kameni Islands, Santorini (Greece). The original data files were [downloaded from here](https://figshare.com/articles/dataset/2012_Santorini_LiDAR_data/1138718) and more details are in [this paper](https://www.sciencedirect.com/science/article/pii/S2214242814000047)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b80510a7-8c5c-4df1-851a-5e0a830280da", + "metadata": {}, + "outputs": [], + "source": [ + "from pybabylonjs import Show as show" + ] + }, + { + "cell_type": "markdown", + "id": "a1edabed-77d9-4729-b54b-0a8991be192d", + "metadata": {}, + "source": [ + "To stream and view point cloud data from a TileDB array a `token` is needed: \n", + "* [sign up for a TileDB account](https://cloud.tiledb.com/auth/signup)\n", + "\n", + "When running this notebook locally:\n", + "* [create a token as described here](https://docs.tiledb.com/cloud/how-to/account/create-api-tokens)\n", + "* uncomment the below cell and add your token (``)\n", + "* run the below cells\n", + "\n", + "When running this notebook on TileDB Cloud:\n", + "* the token will be automatically loaded\n", + "* remove the token from the list of parameters of `show.point_cloud`\n", + "* run the below cells" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c2b9f363-f5cb-44f7-b37a-eef820d31386", + "metadata": {}, + "outputs": [], + "source": [ + "#token = \"\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "59f6b2c2-43cc-447b-8d25-b641626445c8", + "metadata": {}, + "outputs": [], + "source": [ + "show.point_cloud(streaming=True,\n", + " uri=\"tiledb://TileDB-Inc/santorini\",\n", + " token=token,\n", + " point_size = 6,\n", + " wheel_precision = 0.2,\n", + " color_scheme = 'dark',\n", + " width = 1200,\n", + " height = 800, \n", + " rgb_max = 255,\n", + " point_budget = 3000000,\n", + " camera_location = 5,\n", + " camera_zoom = [1, 1, 4],\n", + " camera_up = 200, \n", + " move_speed = 6,\n", + " point_type = 'fixed_world_size')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "26fb01d4-8362-4a98-b835-b7f1a550c870", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/package.json b/package.json index 1adad84..30f0284 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "dependencies": { "@jupyter-widgets/base": "^1.1.10 || ^2 || ^3 || ^4", "@jupyterlab/application": "^3.4.5", - "@tiledb-inc/viz-core": "0.1.1" + "@tiledb-inc/viz-core": "1.0.0" }, "devDependencies": { "@jupyterlab/builder": "^3.1.0", diff --git a/pybabylonjs/args.py b/pybabylonjs/args.py index 4505046..71a5386 100644 --- a/pybabylonjs/args.py +++ b/pybabylonjs/args.py @@ -1,4 +1,4 @@ -# Copyright 2022 TileDB Inc. +# Copyright 2023 TileDB Inc. # Licensed under the MIT License. """Functions to format and check the data and keyword arguments for each data source and visualization mode.""" @@ -15,20 +15,14 @@ "inspector": None, "color_scheme": None, "z_scale": None, - "gltf_data": None, "topo_offset": None, "classes": {"numbers": [], "names": []}, "time_offset": None, - "distance_colors": None, - "mesh_rotation": [None, None, None], - "mesh_shift": [None, None, None], - "mesh_scale": [None, None, None], - "gltf_multi": False, - "show_fraction": None, "point_shift": [None, None, None], "rgb_max": None, "bbox": None, "name_space": None, + "group_name": None, "array_name": None, "token": None, "tiledb_env": None, @@ -37,18 +31,17 @@ "crs": None, "buffer_size": None, "streaming": None, - "max_levels": None, "point_type": None, "point_size": None, - "point_scale": None, "point_budget": None, - "camera_radius": None, + "camera_location": None, + "camera_zoom": [None, None, None], + "camera_up": None, "edl_strength": None, "edl_radius": None, "edl_neighbours": None, - "max_num_cache_blocks": None, - "fan_out": None, "use_shader": None, + "use_sps": None, "debug": False, "worker_pool_size": None, } @@ -73,10 +66,6 @@ def check_point_cloud_args(mode, point_cloud_args_in): ) if not "bbox" in point_cloud_args_in: raise ValueError("The bbox is not specified") - elif mode == "gltf": - raise ValueError("This mode will be implemented soon") - if not "gltf_data" in point_cloud_args_in: - raise ValueError("gltf_data is not specified") point_cloud_args = {} for key in POINT_CLOUD_ARGS_DEFAULTS.keys(): @@ -84,6 +73,10 @@ def check_point_cloud_args(mode, point_cloud_args_in): if key is not None: point_cloud_args[key] = point_cloud_args_in.pop(key) + if not "height" in point_cloud_args: + point_cloud_args["height"] = 600 + point_cloud_args["width"] = 800 + return point_cloud_args @@ -136,18 +129,23 @@ def check_point_cloud_data_cloud(streaming, uri, point_cloud_args): ) point_cloud_args = {**point_cloud_args, "token": token} + o = urlparse(uri) + if not streaming: if not "bbox" in point_cloud_args: raise ValueError( "The bbox for slicing data from the array is not specified" ) - - o = urlparse(uri) - - point_cloud_args = { - **point_cloud_args, - "name_space": o.netloc, - "array_name": o.path[1:], - } + point_cloud_args = { + **point_cloud_args, + "name_space": o.netloc, + "array_name": o.path[1:], + } + else: + point_cloud_args = { + **point_cloud_args, + "name_space": o.netloc, + "group_name": o.path[1:], + } return point_cloud_args diff --git a/pybabylonjs/babylonjs.py b/pybabylonjs/babylonjs.py index 4a72c16..0882bee 100644 --- a/pybabylonjs/babylonjs.py +++ b/pybabylonjs/babylonjs.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # coding: utf-8 -# Copyright 2022 TileDB Inc. +# Copyright 2023 TileDB Inc. # Licensed under the MIT License. """ diff --git a/pybabylonjs/data.py b/pybabylonjs/data.py index ecc70d6..edb87e8 100644 --- a/pybabylonjs/data.py +++ b/pybabylonjs/data.py @@ -1,4 +1,4 @@ -# Copyright 2022 TileDB Inc. +# Copyright 2023 TileDB Inc. # Licensed under the MIT License. """Functions to format data from the arrays to be used in the visualization.""" diff --git a/pybabylonjs/show.py b/pybabylonjs/show.py index d9a7dc9..078b81a 100644 --- a/pybabylonjs/show.py +++ b/pybabylonjs/show.py @@ -1,4 +1,4 @@ -# Copyright 2022 TileDB Inc. +# Copyright 2023 TileDB Inc. # Licensed under the MIT License. """Classes for setting up the visualization.""" @@ -32,20 +32,20 @@ def __init__(self): def point_cloud( self, uri: Optional[str] = None, - data: Optional[dict] = {}, - streaming: Optional[bool] = False, source: Optional[str] = "cloud", mode: Optional[str] = "default", + streaming: Optional[bool] = False, + data: Optional[dict] = {}, **kwargs, ): """ Returns a point cloud visualization widget :param uri: when source is "cloud" or "local" specify the URI for the TileDB array - :param data: when source="dict" this dictionary contains the points to be visualized: {"X", "Y", "Z", "Red", "Green", "Blue"} - :param streaming: when true all data will be streamed from the TileDB array :param source: location of the data to be visualized, one of "cloud", "local" or "dict" :param mode: sub-type of the visualization, one of "default", "time", "classes" or "topo" + :param streaming: when true all data will be streamed from the TileDB array + :param data: when source="dict" this dictionary contains the points to be visualized: {"X", "Y", "Z", "Red", "Green", "Blue"} """ diff --git a/src/widget.ts b/src/widget.ts index 58516b0..3e0d6f0 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -1,4 +1,4 @@ -// Copyright 2022 TileDB Inc. +// Copyright 2023 TileDB Inc. // Licensed under the MIT License. import { @@ -72,39 +72,31 @@ export class BabylonPointCloudView extends BabylonBaseView { colorScheme: this.values.color_scheme, data: this.values.data, zScale: this.values.z_scale, - gltfData: this.values.gltf_data, topoOffset: this.values.topo_offset, classes: this.values.classes, timeOffset: this.values.time_offset, - distanceColors: this.values.distance_colors, - meshRotation: this.values.mesh_rotation, - meshShift: this.values.mesh_shift, - meshScale: this.values.mesh_scale, - gltfMulti: this.values.gltf_multi, source: this.values.source, - showFraction: this.values.show_fraction, pointShift: this.values.point_shift, rgbMax: this.values.rgb_max, bbox: this.values.bbox, namespace: this.values.name_space, arrayName: this.values.array_name, + groupName: this.values.group_name, tiledbEnv: this.values.tiledb_env, token: this.values.token, bufferSize: this.values.buffer_size, streaming: this.values.streaming, - maxLevel: this.values.max_levels, pointType: this.values.point_type, pointSize: this.values.point_size, - pointScale: this.values.point_scale, pointBudget: this.values.point_budget, - cameraRadius: this.values.camera_radius, + cameraLocation: this.values.camera_location, + cameraZoomOut: this.values.camera_zoom, + cameraUp: this.values.camera_up, edlStrength: this.values.edl_strength, edlRadius: this.values.edl_radius, edlNeighbours: this.values.edl_neightbours, - maxNumCacheBlocks: this.values.max_num_cache_blocks, - fanOut: this.values.fan_out, useShader: this.values.use_shader, - useGUI: this.values.use_gui, + useSPS: this.values.use_sps, debug: this.values.debug, workerPoolSize: this.values.worker_pool_size }); diff --git a/yarn.lock b/yarn.lock index 1b996de..97b4346 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,54 +30,44 @@ dependencies: regenerator-runtime "^0.13.11" -"@babylonjs/core@^5.21.0": - version "5.21.0" - resolved "https://registry.yarnpkg.com/@babylonjs/core/-/core-5.21.0.tgz#6aa38a0b792bce98e7389251791ae7108806cd75" - integrity sha512-kJrjFEMMzOPlSShbh8i3c6S48+LsUFDkiQNGc6rRP92kmFBxlsL7MC3tfdAiRPpXIr4rf0agYXFf9+P29brqTA== - dependencies: - tslib "^2.4.0" - -"@babylonjs/gui-editor@^5.21.0": - version "5.21.0" - resolved "https://registry.yarnpkg.com/@babylonjs/gui-editor/-/gui-editor-5.21.0.tgz#6f3cb174332c71cadc1db5af821f9fba0ec821ca" - integrity sha512-K90nb3ONjEnYQO58/Jy+ZHKam13KUgFV07GV/y+ftvxGYkojRS4AdgkKwYYxKPF4EsW8iIff+coSRMHYeOjtFA== - -"@babylonjs/gui@^5.21.0": - version "5.21.0" - resolved "https://registry.yarnpkg.com/@babylonjs/gui/-/gui-5.21.0.tgz#adf4dae17e6c55208daa0f942ab6537ae6bad570" - integrity sha512-b0sPVwB98PbTGn3azNMGWiONtrHG2WmXOVkMjlpjJFz5DNvy5P1w6eVcWWRXjeQgc2LIaZ6susiNTgikUGcjYQ== - dependencies: - tslib "^2.4.0" - -"@babylonjs/inspector@^5.21.0": - version "5.21.0" - resolved "https://registry.yarnpkg.com/@babylonjs/inspector/-/inspector-5.21.0.tgz#cca32dff0108fbbb664c59264c59278b9f1f4b8b" - integrity sha512-BZlPpdsW8tAQRssaUCGmF6MAbd5KWci4Ll6os0WwcukCDu7rgdLQOaRTaVTQlPSNA2H2lLVDopvpXqb34/qkVg== +"@babylonjs/core@^5.42.0": + version "5.50.1" + resolved "https://registry.yarnpkg.com/@babylonjs/core/-/core-5.50.1.tgz#338c82810bb7fdf3b2848d784e33ce0fa35744c1" + integrity sha512-XlZVlDvsGZRKLqeld0nCa4rWUsiCAEGXr9CjPkkUWzZiO3k2jnLGZmAghbWMZCFS6jXdDoZMA9KiMyfvnO5D/Q== + +"@babylonjs/gui-editor@^5.42.0": + version "5.50.1" + resolved "https://registry.yarnpkg.com/@babylonjs/gui-editor/-/gui-editor-5.50.1.tgz#0def9350db351fec3ebd4b9f33d1b03185d81c16" + integrity sha512-QHRqgwze9eAyTT5YJZsUw9xzmtcU3VYCeHg7rI2FH5WGUZIXydkWvqXbqQBCfHralhws/tgsM2swK72y+/7ZDg== + +"@babylonjs/gui@^5.42.0": + version "5.50.1" + resolved "https://registry.yarnpkg.com/@babylonjs/gui/-/gui-5.50.1.tgz#ac808d5684d8a22c4487d092cc698079a9213a26" + integrity sha512-Wozfzj9Ayvhad2hTbzWOTQnv6qY82EySVrnYLonz1CsukKEsV96SJmm6p7jAN1kSMm8QUtw4itzZTQJiXCROyQ== + +"@babylonjs/inspector@^5.42.0": + version "5.50.1" + resolved "https://registry.yarnpkg.com/@babylonjs/inspector/-/inspector-5.50.1.tgz#7af333a24fab93903d123a88c13a1aa5f843a726" + integrity sha512-nydMsQKUeJtzxUBKhkRBPRHlmUgxxtJ6NF1YVPNwrcBk+C9oBxB7eyU7dDJ6MXWwbV9w3HUoachiJL/lKeVUHw== dependencies: "@fortawesome/fontawesome-svg-core" "^6.1.0" "@fortawesome/free-regular-svg-icons" "^6.0.0" "@fortawesome/free-solid-svg-icons" "^6.0.0" -"@babylonjs/loaders@^5.21.0": - version "5.21.0" - resolved "https://registry.yarnpkg.com/@babylonjs/loaders/-/loaders-5.21.0.tgz#3efee6884467673fd6770e38165b8cf07fe2b0bf" - integrity sha512-ioKlZofZ9LpD4usneyygkryLkcaw3+wMaPNnEoeKesyVDD2l65q1pNX517h7xRu88m3xJ5oy5ek8M8OkeqjVGw== - dependencies: - tslib "^2.4.0" +"@babylonjs/loaders@^5.42.0": + version "5.50.1" + resolved "https://registry.yarnpkg.com/@babylonjs/loaders/-/loaders-5.50.1.tgz#f78cc9b626ba98909ffcdc168cd7a4699f6b9062" + integrity sha512-baXJ3QYVAvs4AUHl4VnL7ASKbz+gY+rUvKgtrtAuvwE6fYCWWrgsP0w6xVDNiNEChNKL7wMvF1ZwhJJOBfBUgQ== -"@babylonjs/materials@^5.21.0": - version "5.21.0" - resolved "https://registry.yarnpkg.com/@babylonjs/materials/-/materials-5.21.0.tgz#d9d604a3a5b6a88579f7c9235290421f1b023417" - integrity sha512-EdOrf/+m7PnbP+sYVuR7YNxj99CU1Aj9kLh74MWCVVVSFyuKVQqFY5H/ickt/N2p6TpaqoDvSJ6dV/4d65fAPg== - dependencies: - tslib "^2.4.0" +"@babylonjs/materials@^5.42.0": + version "5.50.1" + resolved "https://registry.yarnpkg.com/@babylonjs/materials/-/materials-5.50.1.tgz#2153be6d6e326c6678b3fbfe21ffba96369a61bb" + integrity sha512-c6REDg6wOWVXJKFBU6CgWC8ugBpfg+gMfhAVV8GX8qn9xNwbSKcp8nndU1kwgjx6vp6TpW+U1E38svcfL80T4g== -"@babylonjs/serializers@^5.21.0": - version "5.21.0" - resolved "https://registry.yarnpkg.com/@babylonjs/serializers/-/serializers-5.21.0.tgz#eb2b367a3fba93809fa7aba7d847c634a4e06f61" - integrity sha512-+Fsh5R726HG0Kv+6UNxz7fO+DNfjw2lXxjnj+MokMS8twRWxJeza9LVoQfgKimLu7nA/iFn10fc9+mIzONVi5g== - dependencies: - tslib "^2.4.0" +"@babylonjs/serializers@^5.42.0": + version "5.50.1" + resolved "https://registry.yarnpkg.com/@babylonjs/serializers/-/serializers-5.50.1.tgz#4077210b3badd8ab7bbebe486d1337963c2ecef6" + integrity sha512-NNWHZ6fLJR8dbW05cY5uFiN5LhJRktpqH6HOUAbBeIn4n/gAPEvBwW+VtuIrTh1OppaANhq0ek5LFI5cCvIw5g== "@blueprintjs/colors@^4.0.0-alpha.3": version "4.1.10" @@ -805,10 +795,10 @@ dependencies: defer-to-connect "^1.0.1" -"@tiledb-inc/tiledb-cloud@1.0.10-alpha.7": - version "1.0.10-alpha.7" - resolved "https://registry.yarnpkg.com/@tiledb-inc/tiledb-cloud/-/tiledb-cloud-1.0.10-alpha.7.tgz#d5d86f4a00992bfef411b0b6fface50f4b2e75b6" - integrity sha512-V82JT6cSEna23L1RnqeskUrYypZ5MSpWGilAugklkufGm9b4h9//a1KYUgGbCZb8vZStUspqXpW3V7a6mRy1/Q== +"@tiledb-inc/tiledb-cloud@1.0.12-beta.1": + version "1.0.12-beta.1" + resolved "https://registry.yarnpkg.com/@tiledb-inc/tiledb-cloud/-/tiledb-cloud-1.0.12-beta.1.tgz#33d1869d8026ecce8b5f3009440b88547673d473" + integrity sha512-LiB+ZjHUIZUFCdPEvSqcxF0ASEvQMTLXZ4J3WjwjaCXZdZ97xszwu14rjrKnQdD4VupVXxK/ShB6cBSatQPj8w== dependencies: axios "^0.21.1" capnp-ts "^0.4.0" @@ -816,21 +806,21 @@ paralleljs "github:SarantopoulosKon/parallel.js#node-mode-in-web-worker" save-file "^2.3.1" -"@tiledb-inc/viz-core@0.1.1": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@tiledb-inc/viz-core/-/viz-core-0.1.1.tgz#a9835d8a64ebbc9ac6ee1cecadba969164cfbedc" - integrity sha512-g2NOMMB14H8ieWPyhxGFIZ+sBfGGMgnLfhYrJ8BZw0AFfBjCIctgi25NFf2pu3pv+LUP/VsY3J1XDGOmlvabhw== - dependencies: - "@babylonjs/core" "^5.21.0" - "@babylonjs/gui" "^5.21.0" - "@babylonjs/gui-editor" "^5.21.0" - "@babylonjs/inspector" "^5.21.0" - "@babylonjs/loaders" "^5.21.0" - "@babylonjs/materials" "^5.21.0" - "@babylonjs/serializers" "^5.21.0" - "@tiledb-inc/tiledb-cloud" "1.0.10-alpha.7" - babylonjs-gui "^4.2.2" - babylonjs-materials "^5.21.0" +"@tiledb-inc/viz-core@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@tiledb-inc/viz-core/-/viz-core-1.0.0.tgz#62bf814aeba300a2ad15b327d7b0b22aba3f9720" + integrity sha512-BPShN0I88R6O8Ca0VRK7ER0C/OkJwyEaRfgGYd6ElsdaGxRVM4t8ogQple1+073C3veRdrrAFzcmnkg3+3kGtA== + dependencies: + "@babylonjs/core" "^5.42.0" + "@babylonjs/gui" "^5.42.0" + "@babylonjs/gui-editor" "^5.42.0" + "@babylonjs/inspector" "^5.42.0" + "@babylonjs/loaders" "^5.42.0" + "@babylonjs/materials" "^5.42.0" + "@babylonjs/serializers" "^5.42.0" + "@tiledb-inc/tiledb-cloud" "1.0.12-beta.1" + babylonjs-gui "^5.42.0" + babylonjs-materials "^5.42.0" idb "^7.0.2" "@types/backbone@^1.4.1": @@ -1452,29 +1442,24 @@ axios@^0.21.1: dependencies: follow-redirects "^1.10.0" -babylonjs-gui@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/babylonjs-gui/-/babylonjs-gui-4.2.2.tgz#73ce9e2ae6caba97475557e32e4961ff4d44482a" - integrity sha512-LCjj9bZMR7TCJw5PizhS+lHRxhOWcQ6wGVEs6DjY5leT6Lb9jUD9LwqTemfd1KobZLOg5/TY89LqMzNLkDvtng== +babylonjs-gui@^5.42.0: + version "5.50.1" + resolved "https://registry.yarnpkg.com/babylonjs-gui/-/babylonjs-gui-5.50.1.tgz#25d0d13eb6babe2e79ac17f3fa17a14d90deb363" + integrity sha512-t6/tNHw3jQ6Jzj9cpAzivgEGeDgeKg1eQt8Wx2KFmWZFAyNcrzj2PnsNfCJWXpaI+/vPLHFIGWWRe9w0eLGCdw== dependencies: - babylonjs "4.2.2" + babylonjs "^5.50.1" -babylonjs-materials@^5.21.0: - version "5.21.0" - resolved "https://registry.yarnpkg.com/babylonjs-materials/-/babylonjs-materials-5.21.0.tgz#fa52700acc1a5a482e2fdbaa38010fbff0ebc416" - integrity sha512-IaX4YvxTfsq4q7pnT5Ks3bNPpDHWFNSPpXzHv51QGzDCKA4VuFBIA0PF0W6sSqGyA3j3k3ZOWG9wMWebNd97og== +babylonjs-materials@^5.42.0: + version "5.50.1" + resolved "https://registry.yarnpkg.com/babylonjs-materials/-/babylonjs-materials-5.50.1.tgz#da97a443ce982492fcf1f27556b89cd6072e870d" + integrity sha512-e/QM3I4HYr9eMo+t1PRzyoc10xOISXxpQK4EbM0G/OExlZztUDuYrXJEIWIE26A6hgxNZT9OD1xTgzfBJlvwwQ== dependencies: - babylonjs "^5.21.0" + babylonjs "^5.50.1" -babylonjs@4.2.2: - version "4.2.2" - resolved "https://registry.npmjs.org/babylonjs/-/babylonjs-4.2.2.tgz" - integrity sha512-p7mTi6+nLuWJTLbwxEJxLOh/QMHMV2KA0bviEoQSK5VtsAq1F0JghoOZYRs4aEqAZF/deFPWvMQk1vbXJ+4eEA== - -babylonjs@^5.21.0: - version "5.21.0" - resolved "https://registry.yarnpkg.com/babylonjs/-/babylonjs-5.21.0.tgz#2b7ade46a7ef55c097406e477815557be1089de7" - integrity sha512-0Gu30ReYz8VVo/JUsDrljmNGcN929refftm+v90F8M3PFbahkQgvtqBRldVxt9R86MhhmBv+43GCi/kKmj+y+Q== +babylonjs@^5.50.1: + version "5.50.1" + resolved "https://registry.yarnpkg.com/babylonjs/-/babylonjs-5.50.1.tgz#93323208701a6dd8279fd5f0f27692a0c7063ef8" + integrity sha512-X+oJ1bMTFpoS9YPjWek8wptMLpf5OG+hfaDlHVbLbiKeVUXNCZGqUJwVSA7ubN/99lT4hPC3mYqNY49zQmo+bw== backbone@1.2.3: version "1.2.3" @@ -5580,11 +5565,6 @@ tslib@^1.7.1, tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" - integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== - tslib@~2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"