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

Default layout by giving PanelData[] #194

Open
Adamatoma opened this issue Jan 29, 2023 · 0 comments
Open

Default layout by giving PanelData[] #194

Adamatoma opened this issue Jan 29, 2023 · 0 comments

Comments

@Adamatoma
Copy link

Adamatoma commented Jan 29, 2023

Hi team,

Is there a way to get default layout rather than generating LayoutData objects manually?
Manually generating LayoutData objects will be inefficient for multi panels.
It'll be great if there is a function like this:
function generateDefaultLayoutData(panels: PanelData[]): LayoutData
or
function generateDefaultLayoutData(panels: TabData[]): LayoutData

To be specific:

Requirement:
My project requires to display multiple panels (4 to 20 or more) with a single tab each.

Current Solution Found:
1 panel

{
    dockbox: {
        mode: 'horizontal',
        children: [panel1]
    }
}

2 panels

{
    dockbox: {
        mode: 'horizontal',
        children: [panel1, panel2]
    }
}

3 panels

{
    dockbox: {
        mode: 'horizontal',
        children: [
            panel1,
            {
                mode: 'vertical',
                children: [panel2, panel3]
            }
        ]
    }
}

Cheers,
Adam

@Adamatoma Adamatoma changed the title Default layout by giving TabData[] Default layout by giving PanelData[] Jan 29, 2023
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

1 participant