[Bug] Error in 'PathLayer' to show z-axis
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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