Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial camera up vector ignored #2425

Closed
KonradAdamczyk opened this issue Feb 28, 2018 · 4 comments
Closed

Initial camera up vector ignored #2425

KonradAdamczyk opened this issue Feb 28, 2018 · 4 comments
Assignees
Labels
bug something broken

Comments

@KonradAdamczyk
Copy link

default camera position of plot behaves like default value of up vector have not been overridden
clicking "reset camera .*" button fixes that
moreover split second after page load plot will move from overridden up state to default up state

more info in comment to below example

import plotly
import plotly.graph_objs as go

import pandas as pd

# Read data from a csv
z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')

data = [
    go.Surface(
        z=z_data.as_matrix()
    )
]
layout = go.Layout(
    scene=dict(
    camera=dict(center=dict(y=0, x=0, z=0),
                eye=dict(y=0.362, x=-1.213, z=1.792),
                up=dict(y=0.984, x=0.045, z=-0.168),#default position of plot behaves like default value have not been overridden
                # comment above line and initial state of plot would be the same, clicking "reset camera .*" button fixes that
                #moreover when above line is not commented plot will move from overridden up state to default up state split second after page load
                )
    )
)
fig = go.Figure(data=data, layout=layout)
plotly.offline.plot(fig, filename="filename")

@etpinard
Copy link
Contributor

Thanks for the report.

Reproducible example in JS: https://codepen.io/etpinard/pen/jZdWQG?editors=0010

@etpinard etpinard added the bug something broken label Feb 28, 2018
@etpinard
Copy link
Contributor

When setting dragmode: 'orbit', things as working as desired: https://codepen.io/etpinard/pen/RQvaEZ?editors=0010

Perhaps your center, eye and up settings are incompatible with dragmode: 'turntable'? I'll have to investigate further.

@jackparmer
Copy link
Contributor

Just encountered this also - it does seem that only dragmode: 'orbit' works with a non-default camera up vector.

@archmoj archmoj self-assigned this Nov 11, 2018
@archmoj
Copy link
Contributor

archmoj commented Nov 17, 2018

Simply another demo to better display the issue.
For non-zero Z-axis, we could enable dragmode: 'orbit'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

4 participants