fix(docs): Added docs for multimonitor and local linking (#5247)
This commit is contained in:
parent
b77b2f3fa0
commit
83ea0ad93e
@ -11,3 +11,42 @@ Local linking allows you to develop and test a library in the context of an appl
|
||||
a bug that you suspect is related to a library. With Yarn, this can be achieved through the yarn link command.
|
||||
|
||||
You can take a look at the Cornerstonejs tutorial for linking https://www.cornerstonejs.org/docs/contribute/linking
|
||||
|
||||
## Linking with `bun`
|
||||
|
||||
The [instructions](#introduction) above describe how to use `yarn` for local linking. Some use `bun` for day-to-day
|
||||
code linking and execution. The method to link locally using `bun` differs slightly.
|
||||
|
||||
:::tip
|
||||
|
||||
Linking locally with `bun` provides for running the [playwright tests](./playwright-testing.md) locally so as to include (and test) local changes from Cornerstone3D!
|
||||
|
||||
:::
|
||||
|
||||
In the local Cornerstone3D, simply replace `yarn` with `bun` for each of the commands. For example, in `cornerstone/packages/core` the following would be done.
|
||||
|
||||
```
|
||||
# In cornerstone/packages/core
|
||||
bun unlink
|
||||
bun link
|
||||
bun dev
|
||||
```
|
||||
|
||||
In OHIF, edit the root `package.json` file to include the cornerstone3D packages to link and add them to the `resolutions`.
|
||||
|
||||
For example here is a snippet of the `package.json` file linking cornerstone core and tools locally. Add whichever
|
||||
cornerstone packages to link locally in the `resolutions`.
|
||||
|
||||
```
|
||||
...
|
||||
"resolutions": {
|
||||
"commander": "8.3.0",
|
||||
"path-to-regexp": "0.1.12",
|
||||
"@cornerstonejs/core": "link:@cornerstonejs/core",
|
||||
"@cornerstonejs/tools": "link:@cornerstonejs/tools",
|
||||
...
|
||||
},
|
||||
...
|
||||
```
|
||||
|
||||
In OHIF, run `bun install -f` and then run OHIF using either `bun dev` or `bun dev:fast`.
|
||||
|
||||
@ -57,6 +57,96 @@ The service supports two predefined configurations:
|
||||
|
||||
---
|
||||
|
||||
## Configuration File Setting
|
||||
|
||||
The `multimonitor` configuration setting in the
|
||||
[configuration file](../../../configuration/configurationFiles.md) specifies various
|
||||
properties for each of the OHIF windows opened when multimonitor is launched. The setting is
|
||||
an array of properties for each [configuration](#configurations) defined.
|
||||
Each entry in the array is an object with the following properties.
|
||||
|
||||
- `id`: The id for the array item. Typically it corresponds to one of the
|
||||
[configurations](#configurations) (e.g. `split` or `2`)
|
||||
- `test`: A function that takes a single object argument containing the property
|
||||
`multimontior` (i.e. the [configuration](#configurations)). The function should return `true`
|
||||
if this array entry should be applied to the [configuration](#configurations).
|
||||
- `screens`: An array of objects that define each of the OHIF screens to be opened
|
||||
|
||||
Each `screen` array entry above has the following properties.
|
||||
|
||||
- `id`: The unique screen identifier (e.g. `ohif0` or `radScreen0`)
|
||||
- `screen`: The index of the physical screen. For the `split` configuration this can
|
||||
be `null` because there is no specific physical screen for it.
|
||||
- `location`: The normalized top, left position and size of the window
|
||||
(i.e. `x`, `y`, `width`, `height`) relative to the physical screen for the window
|
||||
- `options` Standard comma delimited string of popup
|
||||
[window options](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#windowfeatures).
|
||||
|
||||
Below is a snippet from a configuration file for multimonitor.
|
||||
```
|
||||
...
|
||||
multimonitor: [
|
||||
{
|
||||
id: 'split',
|
||||
test: ({ multimonitor }) => multimonitor === 'split', // applies to the split multimonitor configuration
|
||||
screens: [
|
||||
{
|
||||
id: 'ohif0',
|
||||
screen: null,
|
||||
location: {
|
||||
width: 0.5,
|
||||
height: 1,
|
||||
left: 0,
|
||||
top: 0,
|
||||
},
|
||||
options: 'location=no,menubar=no,scrollbars=no,status=no,titlebar=no',
|
||||
},
|
||||
{
|
||||
id: 'ohif1',
|
||||
screen: null,
|
||||
location: {
|
||||
width: 0.5,
|
||||
height: 1,
|
||||
left: 0.5,
|
||||
top: 0,
|
||||
},
|
||||
options: 'location=no,menubar=no,scrollbars=no,status=no,titlebar=no',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
id: '2',
|
||||
test: ({ multimonitor }) => multimonitor === '2', // applies to the `2` multimonitor configuration
|
||||
screens: [
|
||||
{
|
||||
id: 'ohif0',
|
||||
screen: 0,
|
||||
location: {
|
||||
width: 1,
|
||||
height: 1,
|
||||
left: 0,
|
||||
top: 0,
|
||||
},
|
||||
options: 'fullscreen=yes,location=no,menubar=no,scrollbars=no,status=no,titlebar=no',
|
||||
},
|
||||
{
|
||||
id: 'ohif1',
|
||||
screen: 1,
|
||||
location: {
|
||||
width: 1,
|
||||
height: 1,
|
||||
left: 0,
|
||||
top: 0,
|
||||
},
|
||||
options: 'fullscreen=yes,location=no,menubar=no,scrollbars=no,status=no,titlebar=no',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
...
|
||||
```
|
||||
|
||||
## Behavior
|
||||
|
||||
### Refresh, Close and Open
|
||||
|
||||
Loading…
Reference in New Issue
Block a user