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

Add options for retrieving/replacing **all** subplots on a layout #415

Closed
kMutagene opened this issue Sep 11, 2023 · 1 comment · Fixed by #453
Closed

Add options for retrieving/replacing **all** subplots on a layout #415

kMutagene opened this issue Sep 11, 2023 · 1 comment · Fixed by #453
Labels
Area: Core API Area: MissingAbstraction Plotly.js functionality that has to be implemented Type: Enhancement

Comments

@kMutagene
Copy link
Member

kMutagene commented Sep 11, 2023

Description

Since the member names of subplots on a layout are dynamic, e.g. a layout can have multiple scenes, scene, scene2, scene<n>, bugs can be caused by high-level APIs that retrieve and change subplot objects, for example Chart.Grid @ #413.

Repro steps

see #413

Suggested Solution

functions on Layout and their top-level equivalents on the Chart API must provide options to retrieve and replace all instances of a subplot. The concrete solution for #413 would look like this:

chart
|> ``get all scenes on the chart``
|> ``when there is more than one scene present, choose a sensible default, e.g. the first one``
|> ``style the retrieved single scene accordingly``
|> ``set the scene on the layout, removing all scenes that are there
@kMutagene
Copy link
Member Author

Further relevant info: these types of bugs (#413) do not happen on low-level API usage.

This example

[
    Trace3D.initScatter3D(Trace3DStyle.Scatter3D(X = [1], Y = [2], Z = [3])) |> GenericChart.ofTraceObject false
    Trace3D.initScatter3D(Trace3DStyle.Scatter3D(X = [1], Y = [2], Z = [3])) |> GenericChart.ofTraceObject false
    Trace3D.initScatter3D(Trace3DStyle.Scatter3D(X = [1], Y = [2], Z = [3])) |> GenericChart.ofTraceObject false
    Trace3D.initScatter3D(Trace3DStyle.Scatter3D(X = [1], Y = [2], Z = [3])) |> GenericChart.ofTraceObject false
]
|> Chart.Grid(2,2)

image

works fine, while using Chart.Point3D does not:

[
    Chart.Point3D([1,2,3], UseDefaults = false)
    Chart.Point3D([1,2,3], UseDefaults = false)
    Chart.Point3D([1,2,3], UseDefaults = false)
    Chart.Point3D([1,2,3], UseDefaults = false)
    Chart.Point3D([1,2,3], UseDefaults = false)
]
|> Chart.Grid(2,2)

image

kMutagene added a commit that referenced this issue May 21, 2024
- Add Layout API functions to retrieve all instances of a subplot (e.g. all x axes)
- fix some typos in dynamic member setters
- add various layout object/API tests
kMutagene added a commit that referenced this issue May 21, 2024
- Add Layout API functions to retrieve all instances of a subplot (e.g. all x axes)
- fix some typos in dynamic member setters
- add various layout object/API tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Core API Area: MissingAbstraction Plotly.js functionality that has to be implemented Type: Enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant