Clean up code snippet config

This commit is contained in:
dannyrb 2019-06-18 15:29:43 -04:00
parent 8112c569e8
commit 9af3ad414a

View File

@ -9,11 +9,11 @@ toolbar, or as complex as a new viewport capable of rendering volumes in 3D.
- [Overview](#overview) - [Overview](#overview)
- [Modules](#modules) - [Modules](#modules)
- [Commands](#commands) - [Commands](#commands)
- [Toolbar](#toolbar)
- [SOP Class Handler](#sopclasshandler)
- [Panel](#panel)
- [Hotkeys](#hotkeys) - [Hotkeys](#hotkeys)
- [Toolbar](#toolbar)
- [Panel](#panel)
- [Viewport](#viewport) - [Viewport](#viewport)
- [SOP Class Handler](#sopclasshandler)
## Overview ## Overview
@ -29,27 +29,33 @@ export default {
id: 'example-extension', id: 'example-extension',
/** /**
* * Registers one or more named commands scoped to a context. Commands are
* the primary means for...
*/ */
getCommandsModule() { getCommandsModule() {
return { return {
actions: { defaultContext: 'VIEWER'
// Store Contexts + Options actions: { ... },
exampleAction: ({ viewports, param1 }) => { definitions: { ... }
console.log(`There are ${viewports.length} viewports`);
console.log(`param1's value is: ${param1}`);
},
},
definitions: {
exampleActionDef: {
commandFn: this.actions.exampleAction,
storeContexts: ['viewports'],
options: { param1: 'hello world' },
},
},
} }
}, },
/**
* Allows you to provide toolbar definitions that will be merged with any
* existing application toolbar configuration. Used to determine which
* buttons should be visible when, their order, what happens when they're
* clicked, etc.
*/
getToolbarModule() {
return {
definitions: [ ... ],
defaultContext: 'ACTIVE_VIEWPORT::CORNERSTONE'
}
}
// Not yet used
getPanelModule: () => null,
/** /**
* Registers a ReactComponent that should be used to render data in a * Registers a ReactComponent that should be used to render data in a
* Viewport. The first registered viewport is our "default viewport". If * Viewport. The first registered viewport is our "default viewport". If
@ -58,20 +64,13 @@ export default {
*/ */
getViewportModule: () => reactViewportComponent, getViewportModule: () => reactViewportComponent,
/** React component that adds buttons/behavior to the viewer Toolbar */
getToolbarModule: () => reactToolbarComponent,
/** Provides a whitelist of SOPClassUIDs the viewport is capable of rendering. /** Provides a whitelist of SOPClassUIDs the viewport is capable of rendering.
* Can modify default behavior for methods like `getDisplaySetFromSeries` */ * Can modify default behavior for methods like `getDisplaySetFromSeries` */
getSopClassHandler: () => { getSopClassHandler: () => {
id: 'some-other-unique-id', id: 'some-other-unique-id',
type: PLUGIN_TYPES.SOP_CLASS_HANDLER, sopClassUids: [ ... ],
sopClassUids: ['string'], getDisplaySetFromSeries: (series, study, dicomWebClient, authorizationHeaders) => { ... }
getDisplaySetFromSeries: (series, study, dicomWebClient, authorizationHeaders) => ...
}, },
// Not yet used
getPanelModule: () => null;
} }
``` ```