-
Notifications
You must be signed in to change notification settings - Fork 8
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
Allow individual subplot axis customization #8
Comments
The issue happens because association between axes and traces is done via string matching in JavaScript. For example, two scatter subplots with customized x-axes are created in the following way: var scatter1 = { "xaxis": "x1", "type": "scatter" ... }
var scatter2 = { "xaxis": "x2", "type": "scatter" ... }
var layout = {
"xaxis1": { /* x1 axis customization goes here */ },
"xaxis2": { /* x2 axis customization goes here */ }
} Or two polar subplots to be displayed side-by-side can be constructed like this: var barpolar1 = { "subplot": "polar1", "type": "barpolar", ... }
var barpolar2 = { "subplot": "polar2", "type": "barpolar", ... }
var layout = {
"polar1": { /* polar subplot customization goes here */ },
"polar2": { /* polar subplot customization goes here */ }
} While it's possible to create the same figure in Swift by setting the In fact, setting the trace subplot axis correspondence via string matching as described above, is not consistent with the API Design Guidelines. Allowing it is therefore not desirable because it breaks the conventions and unwritten rules Swift developers are used to. |
One idea for improvement of the Plotly.swift There are two possible ways how this could behave in code: Option A:
|
- Traces conform to additional protocol - Protocol for each subplot type
- Separate file for each category - Verifies issue #8
- Added a missing bracket for .RGB - Predefined transparent color - Lowercase CSS color names
Done! |
Currently, the
Layout
struct doesn't allow customization of subplot axes. When one creates aFigure
with multiple traces that are displayed as sub-plots, there's no way to set properties of the second and all the following axes of any type.Here's the full list of axis types that exist in the
Layout
object and can't be customized and shared between subplots:XAxis
YAxis
Scene
subplot axes:XAxis
YAxis
ZAxis
Polar
subplot axes:RadialAxis
AngularAxis
Ternary
subplot axes:AAxis
BAxis
CAxis
Geo
subplot axes:LatitudeAxis
LongitudeAxis
ColorAxis
The text was updated successfully, but these errors were encountered: