dockview
dockview copied to clipboard
Group location API
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!
I'm dumb, I figured out to import the function directly. Sorry for the noise.
import { getGridLocation } from "dockview"
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.