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

plot-schema axis regex doesn't include x1 #2519

Closed
chriddyp opened this issue Apr 3, 2018 · 4 comments
Closed

plot-schema axis regex doesn't include x1 #2519

chriddyp opened this issue Apr 3, 2018 · 4 comments

Comments

@chriddyp
Copy link
Member

chriddyp commented Apr 3, 2018

In the new plotly.py PR (plotly/plotly.py#942), we're using the plot schema for validation. The current regex for axes keys is

"layout": {
    "layoutAttributes": {
        ...
        "xaxis": {
              "anchor": {
                    ...
                    "valType": "enumerated",
                    "values": [
                        "free",
                        "/^x([2-9]|[1-9][0-9]+)?$/",
                        "/^y([2-9]|[1-9][0-9]+)?$/"
                    ]
              },
         },
    },
}

which doesn't support x1. The plotly.py library uses x1 in make_subplots and other places as an alternative to x.

@alexcjohnson
Copy link
Collaborator

x1 is not really accepted by plotly.js - it's generally converted to x, though I wouldn't say with any confidence that every place you can use an axis reference will make this conversion. Likewise (and this I can say confidently) if you pass in a layout with xaxis1 it will be renamed to xaxis.

Would it be possible for plotly.py to force x instead of x1 as well, either by automatically converting like we do here or simply not accepting x1?

@etpinard
Copy link
Contributor

etpinard commented Apr 4, 2018

Related: #2007

@etpinard
Copy link
Contributor

I wouldn't be opposed to start to officially accept 'x1' axis id and 'xaxis1' axis names in plotly.js as long as we make it clear in our docs that 'x(axis)1' refers to the same axis as 'x(axis)'.

We'll need to clear up what happens when xaxis and xaxis1 are present in the layout. I'd say ignoring xaxis1 in that case would suffice. We should also make Plotly.validate log something whenever xaxis and xaxis1 are used in the same layout.

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

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

No branches or pull requests

4 participants