Skip to content

Commit

Permalink
changed quick start and gif
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoelles committed Jul 15, 2021
1 parent 37eef95 commit ca5212f
Show file tree
Hide file tree
Showing 5 changed files with 245,250 additions and 8 deletions.
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ Quickstart
dataset = Dataset.from_file(Path("test.bag"), topic="/os1_cloud_node/points", keep_zeros=False)
pointcloud = dataset[1]
pointcloud2 = PointCloud.from_file(Path("test_tree.las"))
tree = PointCloud.from_file(Path("test_tree.las"))
tree.plot("x", hover_data=True)
This produces the plot form the animation above.

* Read the `html documentation`_.
* Have a look at the `tutorial notebooks`_ in the documentation folder
Expand Down
Binary file modified images/plot_3d.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/plot_3d_old.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 12 additions & 4 deletions pointcloudset/pointcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@

from pointcloudset.diff import ALL_DIFFS
from pointcloudset.filter import ALL_FILTERS
from pointcloudset.io import (POINTCLOUD_FROM_FILE, POINTCLOUD_FROM_INSTANCE,
POINTCLOUD_TO_FILE, POINTCLOUD_TO_INSTANCE)
from pointcloudset.io import (
POINTCLOUD_FROM_FILE,
POINTCLOUD_FROM_INSTANCE,
POINTCLOUD_TO_FILE,
POINTCLOUD_TO_INSTANCE,
)
from pointcloudset.plot.pointcloud import plot_overlay
from pointcloudset.pointcloud_core import PointCloudCore

Expand Down Expand Up @@ -205,7 +209,7 @@ def plot(
overlay: dict = {},
point_size: float = 2,
prepend_id: str = "",
hover_data: List[str] = None,
hover_data: Union(List[str], bool) = None,
**kwargs,
) -> plotly.graph_objs.Figure:
"""Plot a PointCloud as a 3D scatter plot with `Plotly <https://plotly.com/>`_.
Expand All @@ -226,7 +230,8 @@ def plot(
point_size (float, optional): Size of each point. Defaults to 2.
prepend_id (str, optional): String before point id to display in hover.
Defaults to empty.
hover_data (list(str), optional): Data columns to display in hover.
hover_data (list(str) or True, optional): Data columns to display in hover. If True
then all the columns are are show in the hover.
Defaults to None.
**kwargs: Keyword arguments to pass to func.
Expand All @@ -245,6 +250,9 @@ def plot(
show_hover = True
if hover_data is None:
show_hover = False
if hover_data:
show_hover = True
hover_data = list(self.data.columns)
elif isinstance(hover_data, list) & len(hover_data) > 0:
if self.has_original_id:
default = ["original_id"]
Expand Down
245,236 changes: 245,233 additions & 3 deletions tests/notebooks/test_readme.ipynb

Large diffs are not rendered by default.

0 comments on commit ca5212f

Please sign in to comment.