Cone tips do not point at the correct positions
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 18.3k
- Fork
- 2k
- Merge medio
- 2g 12h
- PR unite (30g)
- 28
Descrizione
In the following, each of two vectors ends at the start of the next one. Tweaking the length of the cones in any way suited to examining them visually, they clearly do not point at the base of their successor cone as (naively?) expected. At least if we expect that the bases of the cones are centered to the start point of the vector it is representing.
import plotly.graph_objs as go
from numpy import array
points = [
[array([-0.03620968, 0.24876811, 5.51279187]), array([1.39049627, 0.57429448, 4.67921793])],
[array([1.39049627, 0.57429448, 4.67921793]), array([2.02424265, -0.15235655, 2.63707954])],
[array([ 2.02424265, -0.15235655, 2.63707954]), array([ 3.68335955, -1.14431782, 1.09909298])]
]
cone_traces = []
for pair in points:
start_point = pair[0]
end_point = pair[1]
vector = end_point - start_point
# a partial workaround to scale the vectors more or less to their actual length, which
# plottly does not allow fully controlling: https://github.com/plotly/plotly.js/issues/3613
scaled_vector = vector * 1.5
start_x, start_y, start_z = start_point[0], start_point[1], start_point[2]
end_x, end_y, end_z = end_point[0], end_point[1], end_point[2]
trace = go.Cone(
x=[start_x],
y=[start_y],
z=[start_z],
u=[scaled_vector[0]],
v=[scaled_vector[1]],
w=[scaled_vector[2]])
cone_traces.append(trace)
layout = go.Layout(
scene=dict(
camera=dict(
# set the virtual point of view to point to the origin
center=dict(x=0, y=0, z=0),
# set the virtual point of view to be positioned parallel to the depth axis, at a distance
# sufficently away from the vectors to see them all; although plotly won't fully respect the
# angle this eye position should make, https://stackoverflow.com/q/76q921229/1509695,
# it will be very very close to that, and the chart user can nudge the tilt to
# perfect the viewing angle.
eye=dict(x=0, y=0, z=-3))))
fig = go.Figure(data=cone_traces, layout=layout)
fig.show()
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci l’esempio Python go.Cone fornito, variando la lunghezza del cono e le impostazioni della fotocamera per confermare la discrepanza posizionale. Traccia il comportamento corrispondente del rendering dei coni 3D di plotly.js e aggiungi un controllo di regressione per verificare che le basi dei coni siano allineate con i punti iniziali dei vettori forniti; il lavoro è completato quando i coni puntano alle posizioni successive previste.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, python
- Ambito
- data-visualization
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100