From 6f94c7f3aab6f14e00d64c8860843ecb7d4af87c Mon Sep 17 00:00:00 2001 From: Joe Boccanfuso Date: Wed, 29 Mar 2023 09:16:20 -0400 Subject: [PATCH] Updated the ViewportGridService docs. --- .../platform/services/ui/viewport-grid-service.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/platform/docs/docs/platform/services/ui/viewport-grid-service.md b/platform/docs/docs/platform/services/ui/viewport-grid-service.md index b6806343e2d..d523a7415a5 100644 --- a/platform/docs/docs/platform/services/ui/viewport-grid-service.md +++ b/platform/docs/docs/platform/services/ui/viewport-grid-service.md @@ -9,6 +9,15 @@ sidebar_label: Viewport Grid Service This is a new UI service, that handles the grid layout of the viewer. +## Events + +There are seven events that get publish in `ViewportGridService `: + +| Event | Description | +| ----------------------------- | --------------------------------------------------| +| ACTIVE_VIEWPORT_INDEX_CHANGED | Fires the index of the active viewport is changed | +| LAYOUT_CHANGED | Fires the layout is changed | +| GRID_STATE_CHANGED | Fires when the entire grid state is changed | ## Interface For a more detailed look on the options and return values each of these methods @@ -19,9 +28,10 @@ is expected to support, [check out it's interface in `@ohif/core`][interface] | `setActiveViewportIndex(index)` | Sets the active viewport index in the app | | `getState()` | Gets the states of the viewport (see below) | | `setDisplaySetsForViewport({ viewportIndex, displaySetInstanceUID })` | Sets displaySet for viewport based on displaySet Id | -| `setLayout({numCols, numRows, keepExtraViewports})` | Sets rows and columns. When the total number of viewports decreases, optionally keep the extra/offscreen viewports. | +| `setLayout({numCols, numRows, keepExtraViewports})` | Sets rows and columns. When the total number of viewports decreases, optionally keep the extra/offscreen viewports. | | `reset()` | Resets the default states | | `getNumViewportPanes()` | Gets the number of visible viewport panes | +| `getLayoutOptionsFromState(gridState)` | Utility method that produces a `ViewportLayoutOptions` based on the passed in state| ## Implementations