Simple interactive visualization of 3D point clouds
Project description
cloudglancer
Simple interactive visualization of 3D point clouds using Plotly.
Features
- Interactive 3D scatter plots with pan, zoom, and rotation
- Support for categorical and continuous color mapping
- Combine multiple plots into subplot grids
- Easy-to-use API with sensible defaults
- Type hints for better IDE support
Installation
pip install cloudglancer
Quick Start
import numpy as np
import cloudglancer
# Generate random 3D points
points = np.random.randn(500, 3)
# Create and display the plot
fig = cloudglancer.plot(points, title="My Point Cloud", size=2.0)
fig.show()
More examples are in the examples folder.
Development Installation
Clone the repository and install in editable mode:
git clone https://github.com/yourusername/cloudglancer.git
cd cloudglancer
python -m venv venv
source venv/bin/activate
pip install -e .
Install with Development Dependencies
pip install -e ".[dev]"
Requirements
- Python >= 3.9
- plotly >= 5.0.0
- pandas >= 2.0.0
- numpy >= 1.24.0
API Reference
cloudglancer.plot()
Create an interactive 3D scatter plot.
Parameters:
points(np.ndarray): Array of shape (n_points, 3) containing 3D coordinates.labels(np.ndarray, optional): Array of labels for color grouping.label_map(dict, optional): Maps label values to display names. Enables discrete color mapping.color_map(list or float, optional):- With
label_map: List of color strings for discrete coloring - Without
label_map: Float specifying the continuous color scale midpoint
- With
size(float, optional): Size of scatter plot markers. Default is 1.5.title(str, optional): Title of the plot.
Returns:
plotly.graph_objects.Figure: Interactive 3D scatter plot.
Raises:
ValueError: If points array is not of shape (n_points, 3).
cloudglancer.combine_plots()
Combine multiple 3D plots into a single figure with subplots.
Parameters:
figs(list): List of Plotly figures to combine.rows(int, optional): Number of rows in the subplot grid. Default is 1.cols(int, optional): Number of columns in the subplot grid. Default is 2.
Returns:
plotly.graph_objects.Figure: Combined figure with all plots arranged in a grid.
Raises:
ValueError: If the number of figures doesn't match rows * cols.
Examples
See the examples/ directory for more detailed usage examples.
Run the examples:
python examples/basic_usage.py
Development
Running Tests
pytest tests/ -v
Code Formatting
black cloudglancer tests examples
ruff check cloudglancer tests examples
Building the Package
pip install build
python -m build
This will create both wheel and source distributions in the dist/ directory.
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cloudglancer-0.1.0.tar.gz.
File metadata
- Download URL: cloudglancer-0.1.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7172f603df6006f51ab8e0eb2e2f34efa049902a80a9495d633ac52fb4e80b81
|
|
| MD5 |
3d1a48652e6ee0ce601c91e7a0917b7f
|
|
| BLAKE2b-256 |
9b041257279e1c79c1682001263d87f59fe4a3022b10b7bb592808f921b3c8ca
|
File details
Details for the file cloudglancer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cloudglancer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2025e65917967a17f65f1e65df43b783c13151063909eced7ecebd6c5fa84252
|
|
| MD5 |
b4882548e027f2cb758539dca4a7c027
|
|
| BLAKE2b-256 |
7c77afa868bae13ec5eaed74d0645b5f438d90964df015c884365ee76e9ac7b4
|