Skip to content

Feature request: add multiple scenes support for Layout, required for supporting multiple Scatter3D sub-plots in figures #36

@janpfeifer

Description

@janpfeifer

I'm surprised these where not generated automatically, but ...

Plots can be associated to different "Scene" objects. In Plotly Javascript one usually sets layout.scene, layout.scene2, ... for that.

In particular to support subplots with Scatter3D, the only way is by associating each Scatter3D object to a different scene. See "3D Subplots in JavaScript" example (plotly.com).

Extra: I know that go-plotly has been following the key naming for arrays like Xaxis, Xaxis2, etc. But for the Go user, it's much better if this was implemented as a slice, otherwise if we are looping over an index and want to set the value of an element of the sequence, we need to write these giant switch cases. Or include a helper setter method. E.g.:

func (l *Layout) SetScene(sceneIdx idx, scene *LayoutScene) {
  switch sceneIdx {
    case 0: l.Scene = scene
    case 1: l.Scene2 = scene
    case 2: l.Scene3 = scene
    ...
}

What do you think ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions