visgl / visgl/deck.gl

[Bug] Error in 'PathLayer' to show z-axis

Open
#9,657 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
14.6k
Forks
2.3k
Avg merge
2d 9h
Merged PRs (30d)
42

Description

Description

Problem

When you write a code like this to visualize z-axis in 'OrbitView', only the z-axis didn't show up. No matter how you moved the viewpoint.

    axis_data = [
        # X-axis
        {"path": [[0, 0, 0], [AXIS_LENGTH, 0, 0]], "name": "X", "color": [255, 0, 0]},
        # Y-axis
        {"path": [[0, 0, 0], [0, AXIS_LENGTH, 0]], "name": "Y", "color": [0, 255, 0]},
        # Z-axis
        {"path": [[0, 0, 0], [0, 0, AXIS_LENGTH]], "name": "Z", "color": [0, 0, 255]},
    ]
    axis_layer = pdk.Layer(
        'PathLayer',
        data=axis_data,
        get_path='path',
        get_width=20,
        get_color='color',
        pickable=False
    )

Solution

However when you put a small value in y coordinates like this, it showed. So probably zero-division-error?

    axis_data = [
        # X-axis
        {"path": [[0, 0, 0], [AXIS_LENGTH, 0, 0]], "name": "X", "color": [255, 0, 0]},
        # Y-axis
        {"path": [[0, 0, 0], [0, AXIS_LENGTH, 0]], "name": "Y", "color": [0, 255, 0]},
        # Z-axis
        {"path": [[0, 0, 0], [0, 0.01, AXIS_LENGTH]], "name": "Z", "color": [0, 0, 255]},
    ]
    axis_layer = pdk.Layer(
        'PathLayer',
        data=axis_data,
        get_path='path',
        get_width=20,
        get_color='color',
        pickable=False
    )
Flavors
  • Script tag
  • React
  • Python/Jupyter notebook
  • MapboxOverlay
  • GoogleMapsOverlay
  • CARTO
  • ArcGIS
Expected Behavior

As explained above

Steps to Reproduce

As explained above

Environment
  • Framework version: deck.gl@0.9.1
  • Browser:
  • OS:
Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the example in a Python/Jupyter notebook using PathLayer and OrbitView, then trace the PathLayer rendering path for a segment whose z coordinate changes while y remains zero. Done means the z-axis renders without adding a y offset, while the existing x- and y-axis behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.