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

Group location API #389

Open
scottaxcell opened this issue Nov 10, 2023 · 2 comments
Open

Group location API #389

scottaxcell opened this issue Nov 10, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@scottaxcell
Copy link

How can I get the location of a group in a Dockview? I do see a number of functions related to this in the source but have not been able to figure how to gain access to them via the API.

I'm implementing a feature that creates new group by splitting out the active panel and would like to be able to obtain the locations of the current groups. Additionally, I'm creating a feature that would rotate groups in either the horizontal or vertical directions based on the current split direction. This too would benefit from being able to identify the location of the groups.

Here is a CodeSandbox fork of the introduction example from the Dockview documentation, https://codesandbox.io/s/admiring-surf-clxr6g. The example iterates through the groups and prints the objects to the console. I'd like to be able to get the location of the group.

Sorry if I missed this in the documentation. Thanks in advance!

@scottaxcell
Copy link
Author

I'm dumb, I figured out to import the function directly. Sorry for the noise.

import { getGridLocation } from "dockview"

@mathuo mathuo reopened this Nov 14, 2023
@mathuo
Copy link
Owner

mathuo commented Nov 14, 2023

I will re-open this as an issue because I think such method should probably be exposed through the api object and there will also be edge-cases with this function. For example if you call getGridLocation on a floating panel it will throw an exception because getGridLocation relies on it being in the main grid and not floating.

If you have any examples of you using this function to achieve something cool I would be interested to see how you are using it too.

@mathuo mathuo added this to the v1.9.1 milestone Jan 10, 2024
@mathuo mathuo added the enhancement New feature or request label Jan 10, 2024
@mathuo mathuo modified the milestones: v1.9.1, v1.9.2 Jan 19, 2024
@mathuo mathuo modified the milestones: v1.9.2, v1.9.3 Jan 23, 2024
@mathuo mathuo modified the milestones: v1.9.3, v1.10.1 Feb 8, 2024
@mathuo mathuo removed this from the v1.10.1 milestone Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants