fix: remove docz + node version fix on docker (#2743)

* fix: docz uses too outdated packages and current documentation hasnt being updated oftenly. removing it

* fix: node docker version to prevent node req "^12.13.0 || ^14.15.0 || >=16" issue
This commit is contained in:
ladeirarodolfo authored and GitHub committed 2022-03-14 17:18:26 +01:00
1 parent 383a0ef167
commit 7164d1a654
66 files changed
+266 -7682

No files matched your search

@@ -1,42 +0,0 @@
---
name: Checkbox
menu: Elements
route: /components/checkbox
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { Checkbox } from './../index'
import NameSpace from '../../../__docs__/NameSpace'
# Checkbox
## Basic usage
<Playground>
<State
initial={{
checked : false,
label : 'Sample check'
}}
>
{({ state, setState }) => (
<React.Fragment>
<div>
<pre>{JSON.stringify(state, null, 2)}</pre>
</div>
<div style={{ maxWidth: '300px', margin: '0 auto' }}>
<Checkbox {...state} />
</div>
</React.Fragment>
)}
</State>
</Playground>
## API
<Props of={Checkbox} />
## Translation Namespace
<NameSpace name="Checkbox" />
@@ -1,57 +0,0 @@
---
name: CINE Dialog
menu: Components
route: /components/cine-dialog
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { CineDialog } from './../index'
import NameSpace from '../../../__docs__/NameSpace'
# CINE Dialog
## Basic usage
<Playground>
<State
initial={{
isPlaying: false,
cineFrameRate: 24,
isLoopEnabled: true,
lastChange: '',
}}
>
{({ state, setState }) => (
<React.Fragment>
<div>
<pre>{JSON.stringify(state, null, 2)}</pre>
</div>
<div style={{ maxWidth: '300px', margin: '0 auto' }}>
<CineDialog
{...state}
onClickSkipToStart={() =>
setState({ lastChange: 'Clicked SkipToStart' })
}
onClickSkipToEnd={() =>
setState({ lastChange: 'Clicked SkipToEnd' })
}
onClickNextButton={() => setState({ lastChange: 'Clicked Next' })}
onClickBackButton={() => setState({ lastChange: 'Clicked Back' })}
onLoopChanged={value => setState({ isLoopEnabled: value })}
onFrameRateChanged={value => setState({ cineFrameRate: value })}
onPlayPauseChanged={() => setState({ isPlaying: !state.isPlaying })}
/>
</div>
</React.Fragment>
)}
</State>
</Playground>
## API
<Props of={CineDialog} />
## Translation Namespace
<NameSpace name="CineDialog" />
@@ -1,42 +0,0 @@
---
name: About Modal
menu: Components
route: /components/about-modal
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { AboutContent } from './../index.js'
# About Modal
## Basic usage
<Playground>
<State initial={{
isOpen: false
}}>
{({ state, setState }) => (
<React.Fragment>
<button
className="btn btn-primary"
type="button"
onClick={ () => setState({ isOpen: true }) }
>
Open about modal
</button>
<AboutContent
{...state}
onCancel={() => setState({ isOpen: false })}
/>
</React.Fragment>
)}
</State>
</Playground>
## API
<Props of={AboutContent} />
@@ -1,39 +0,0 @@
---
name: Viewport Download Form
menu: Components
route: /components/viewport-download-form
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { ViewportDownloadForm } from './../index'
import NameSpace from '../../../__docs__/NameSpace'
# Viewport Download Form
## Basic usage
<Playground>
<State
initial={{}}
>
{({ state, setState }) => (
<React.Fragment>
<div>
<pre>{JSON.stringify(state, null, 2)}</pre>
</div>
<div style={{ maxWidth: '400px', margin: '0 auto' }}>
<ViewportDownloadForm />
</div>
</React.Fragment>
)}
</State>
</Playground>
## API
<Props of={ViewportDownloadForm} />
## Translation Namespace
<NameSpace name="ViewportDownloadForm" />
@@ -1,10 +0,0 @@
.LayoutExample {
background-color: var(--primary-background-color);
width: 160px;
height: 160px;
}
.GridLayout td {
padding: 5px;
border: 1px solid black;
}
@@ -1,49 +0,0 @@
---
name: Layout Button
menu: Components
route: /components/layout-button
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { LayoutButton } from './../index.js'
import './layoutButton.css'
import NameSpace from '../../../__docs__/NameSpace'
# Layout Button
## Basic usage
<Playground>
<State initial={{
selectedCell: {
className: 'hover',
col: 1,
row: 1
},
}}>
{({ state, setState }) => (
<React.Fragment>
{/* STATE */}
<div><pre>{JSON.stringify(state, null, 2) }</pre></div>
{/* COMPONENT */}
<div className="LayoutExample">
<LayoutButton
{...state}
onChange={cell => setState({ selectedCell: cell })}
/>
</div>
</React.Fragment>
)}
</State>
</Playground>
## API
<Props of={LayoutButton} />
## Translation Namespace
<NameSpace name="Buttons" />
@@ -1,49 +0,0 @@
---
name: Measurement Table
menu: Components
route: /components/measurement-table
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { MeasurementTable } from './../index.js'
import NameSpace from '../../../__docs__/NameSpace'
//
import measurements from './measurements.js'
import timepoints from './timepoints.js'
import warnings from './warnings.js'
# Measurement Table
## Basic usage
<Playground>
<State
initial={{
// Spelling error: overwallWarnings
overwallWarnings: warnings,
timepoints,
measurementCollection: measurements,
}}
>
{({ state, setState }) => (
<div style={{ height: '340px' }}>
<MeasurementTable
{...state}
onItemClick={() => alert('onItemClick')}
onRelabelClick={() => alert('onRelabelClick')}
onDeleteClick={() => alert('onDeleteClick')}
onEditDescriptionClick={() => alert('onEditDescriptionClick')}
/>
</div>
)}
</State>
</Playground>
## API
<Props of={MeasurementTable} />
## Translation Namespace
<NameSpace name="MeasurementTable" />
@@ -1,93 +0,0 @@
export default [
{
maxMeasurements: 5,
groupName: 'Targets',
measurements: [
{
measurementId: '123',
measurementNumber: '123',
itemNumber: 1,
label: 'Chest Wall Posterior',
hasWarnings: true,
warningTitle: 'Criteria nonconformities',
isSplitLesion: false,
warningList: [
'All measurements should have a location',
'Nodal lesions must be >= 15mm short axis AND >= double the acquisition slice thickness by CT and MR',
],
data: [
{
displayText: '25.7 x 12.9',
},
{
displayText: '24.7 x 11.5',
},
{},
],
},
{
measurementId: '124',
measurementNumber: '124',
itemNumber: 2,
label: 'Bone Extremity',
data: [
{
displayText: '24.7 x 11.1',
},
{
displayText: '21.2 x 10.9',
},
{},
],
},
],
},
{
maxMeasurements: 3,
groupName: 'NonTargets',
measurements: [
{
measurementId: '125',
measurementNumber: '125',
itemNumber: 1,
label: 'Chest Wall Single Site',
data: [
{
displayText: 'MD',
},
{
displayText: 'NM',
},
{},
],
},
{
measurementId: '126',
measurementNumber: '126',
itemNumber: 2,
label: 'Extremity Multiple Sites',
data: [
{
displayText: 'CR',
},
{},
{},
],
},
{
measurementId: '127',
measurementNumber: '127',
label: 'Extremity Site',
data: [
{
displayText: 'CR',
},
{},
{
displayText: 'NM',
},
],
},
],
},
];
@@ -1,14 +0,0 @@
export default [
{
label: 'Follow-up 2',
date: '20-Dec-18',
},
{
label: 'Follow-up 1',
date: '15-Jun-18',
},
{
label: 'Baseline',
date: '10-Apr-18',
},
];
@@ -1,6 +0,0 @@
export default {
warningList: [
'All measurements should have a location',
'Nodal lesions must be >= 15mm short axis AND >= double the acquisition slice thickness by CT and MR',
],
};
@@ -1,39 +0,0 @@
---
name: OHIFModal
menu: Components
route: /components/ohif-modal
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { OHIFModal } from './../index'
import NameSpace from '../../../__docs__/NameSpace'
# OHIF Modal
## Basic usage
<Playground>
<State
initial={{}}
>
{({ state, setState }) => (
<React.Fragment>
<div>
<pre>{JSON.stringify(state, null, 2)}</pre>
</div>
<div style={{ maxWidth: '400px', margin: '0 auto' }}>
<OHIFModal />
</div>
</React.Fragment>
)}
</State>
</Playground>
## API
<Props of={OHIFModal} />
## Translation Namespace
<NameSpace name="OHIFModal" />
@@ -1,84 +0,0 @@
---
name: Overlay Trigger
menu: Components
route: /components/overlay-trigger
---
import { Playground, Props } from 'docz'
import { Tooltip } from './../../tooltip'
import { OverlayTrigger } from './../index.js'
# Overlay Trigger
## Basic usage
### On Hover
<Playground>
<div style={{
display: 'flex',
justifyContent: 'space-between'
}}>
{
['right', 'left', 'bottom', 'top'].map((placement) => {
return (
<React.Fragment key={`example-${placement}`}>
<OverlayTrigger
key={`example-${placement}`}
placement={placement}
overlay={
<Tooltip
placement={placement}
className='in'
id={`tooltip-${placement}`}
>
Here I am!
</Tooltip>
}
>
<button> Tooltip on {placement}</button>
</OverlayTrigger>
</React.Fragment>
)
})
}
</div>
</Playground>
### On Click
<Playground>
<div
style={{
display: 'flex',
justifyContent: 'space-between',
}}
>
{['right', 'left', 'bottom', 'top'].map(placement => {
return (
<OverlayTrigger
key={`example-${placement}`}
placement={placement}
trigger="click"
overlay={
<Tooltip
placement={placement}
className="in"
id={`tooltip-${placement}`}
>
Here I am!
</Tooltip>
}
>
<button> Tooltip on {placement}</button>
</OverlayTrigger>
)
})}
</div>
</Playground>
## API
<Props of={OverlayTrigger} />
@@ -1,61 +0,0 @@
---
name: Quick Switch
menu: Components
route: /components/quick-switch
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { QuickSwitch } from './../index.js'
//
import studies from './studies.js'
# Quick Switch
## Basic usage
<Playground>
<State initial={{
studyListData: studies,
}}>
{({ state, setState }) => (
<QuickSwitch
studyListData={state.studyListData}
// If this is always activeStudy's thumbnails,
// Why do we need to specify this?
seriesData={
state.studyListData.find((study) => {
return !!study.active;
}).thumbnails}
onSeriesSelected={(selectedSeries) => {
const { studyListData } = state;
const selectedId = selectedSeries.displaySetInstanceUID;
studyListData.forEach(study => {
study.thumbnails.forEach(series => {
series.active = series.displaySetInstanceUID === selectedId;
})
});
setState({ studyListData });
}}
onStudySelected={(selectedStudy) => {
const { studyListData } = state;
const selectedId = selectedStudy.StudyInstanceUID;
studyListData.forEach(study => {
study.active = study.StudyInstanceUID === selectedId;
});
setState({ studyListData });
}}
/>
)}
</State>
</Playground>
## API
<Props of={QuickSwitch} />
@@ -1,76 +0,0 @@
export default [
{
StudyInstanceUID: '10001',
StudyDescription: 'Anti-PD-1',
modalities: 'CT',
StudyDate: '18-nov-2018',
active: false,
thumbnails: [
{
imageSrc:
'https://raw.githubusercontent.com/crowds-cure/cancer/master/public/screenshots/Anti-PD-1_Lung.jpg',
SeriesDescription: 'Anti-PD-1_Lung',
SeriesNumber: '2',
numImageFrames: 512,
displaySetInstanceUID: '10001-1',
stackPercentComplete: 30,
},
{
imageSrc:
'https://raw.githubusercontent.com/crowds-cure/cancer/master/public/screenshots/Anti-PD-1_MELANOMA.jpg',
SeriesDescription: 'Anti-PD-1_MELANOMA',
SeriesNumber: '2',
InstanceNumber: '1',
numImageFrames: 256,
displaySetInstanceUID: '10001-2',
stackPercentComplete: 70,
},
],
},
{
StudyInstanceUID: '10002',
StudyDescription: 'CPTAC',
modalities: 'CT',
StudyDate: '16-aug-2017',
active: true,
thumbnails: [
{
imageSrc:
'https://raw.githubusercontent.com/crowds-cure/cancer/master/public/screenshots/CPTAC-GBM.jpg',
SeriesDescription: 'CPTAC-GBM',
active: true,
SeriesNumber: '2',
numImageFrames: 512,
displaySetInstanceUID: '10002-1',
stackPercentComplete: 100,
},
{
imageSrc:
'https://raw.githubusercontent.com/crowds-cure/cancer/master/public/screenshots/CPTAC-CM.jpg',
SeriesDescription: 'CPTAC-CM',
SeriesNumber: '2',
InstanceNumber: '1',
displaySetInstanceUID: '10002-2',
numImageFrames: 256,
},
{
imageSrc:
'https://raw.githubusercontent.com/crowds-cure/cancer/master/public/screenshots/CPTAC-HNSCC.jpg',
SeriesDescription: 'CPTAC-HNSCC',
SeriesNumber: '2',
InstanceNumber: '1',
displaySetInstanceUID: '10002-3',
numImageFrames: 256,
},
{
imageSrc:
'https://raw.githubusercontent.com/crowds-cure/cancer/master/public/screenshots/CPTAC-LSCC.jpg',
SeriesDescription: 'CPTAC-LSCC',
SeriesNumber: '2',
InstanceNumber: '1',
displaySetInstanceUID: '10002-4',
numImageFrames: 256,
},
],
},
];
@@ -1,74 +0,0 @@
---
name: Radio Button List
menu: Elements
route: /components/radio-button-list
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { RadioButtonList } from './../index'
import NameSpace from '../../../__docs__/NameSpace'
#Radio Button List
## Basic usage
<Playground>
<State
initial={{
description : [
{
'label' : 'Button 1',
'id' : 'button1',
'checked' : false
},
{
'label' : 'Button 2',
'id' : 'button2',
'checked' : false,
},
{
'label' : 'Button 3',
'id' : 'button3',
'checked' : true,
}
]
}}
>
{({ state, setState }) => (
<React.Fragment>
<div>
<pre>{JSON.stringify(state, null, 2)}</pre>
</div>
<div style={{ maxWidth: '300px', margin: '0 auto' }}>
<RadioButtonList description={[
{
'label' : 'Button 1',
'id' : 'button1',
'checked' : false
},
{
'label' : 'Button 2',
'id' : 'button2',
'checked' : false,
},
{
'label' : 'Button 3',
'id' : 'coolButton3',
'checked' : true,
}
]}/>
</div>
</React.Fragment>
)}
</State>
</Playground>
## API
<Props of={RadioButtonList} />
## Translation Namespace
<NameSpace name="RadioButtonList" />
@@ -1,51 +0,0 @@
---
name: Rounded Button Group
menu: Components
route: /components/rounded-button-group
---
import { Playground, Props } from 'docz';
import { State } from 'react-powerplug';
import { RoundedButtonGroup } from './../index.js';
# Rounded Button Group
A basic styled toggle switch
## Basic usage
<Playground>
<State
initial={{
value: null,
options: [
{
value: 'studies',
icon: 'th',
bottomLabel: 'Series',
},
{
value: 'measurements',
icon: 'th-list',
bottomLabel: 'Measurements',
},
],
}}
>
{({ state, setState }) => (
<React.Fragment>
<div>
<pre>value: {JSON.stringify(state.value, null, 2)}</pre>
</div>
<RoundedButtonGroup
{...state}
onValueChanged={value => setState({ value })}
/>
</React.Fragment>
)}
</State>
</Playground>
## API
<Props of={RoundedButtonGroup} />
@@ -1,42 +0,0 @@
---
name: Select Tree
menu: Components
route: /components/select-tree
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { SelectTree } from './../index.js'
import selectTreeItems from './selectTreeItems.js'
# SelectTree
## Basic usage
<Playground>
<State initial={{
items: selectTreeItems,
}}>
{({ state, setState }) => (
<React.Fragment>
<pre style={{ maxHeight: '135px', overflowX: 'auto' }}>
{JSON.stringify(state.items, null, 2)}
</pre>
<SelectTree
items={state.items}
onSelected={(event, item) => setState({ itemLabelSelected: item.label }) }
selectTreeFirstTitle="Select Tree Example Header"
autoFocus={false}
/>
</React.Fragment>
)}
</State>
</Playground>
## API
<Props of={SelectTree} />
@@ -1,30 +0,0 @@
export default [
{
label: 'A',
value: 'A',
items: [
{
label: 'Abdominal Wall',
value: 'AbdominalWall',
},
{
label: 'Adrenal Left',
value: 'AdrenalLeft',
},
],
},
{
label: 'B',
value: 'B',
items: [
{
label: 'Brain',
value: 'Brain',
},
{
label: 'Breast',
value: 'Breast',
},
],
},
];
@@ -1,83 +0,0 @@
---
name: Simple Dialog
menu: Components
route: /components/simple-dialog
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { SimpleDialog } from './../index.js'
# Simple Dialog
Its similar to a modal but we can pass its style as props and manipulate it as
we want. Initially used to display tool data changes in our Viewport.
## Basic usage
<Playground>
<State initial={{
isDialogOpen: false,
inputValue: '',
selectValue: '',
dialogStyle: {
top: '50px',
left: '100px',
position: 'absolute'
}
}}>
{({ state, setState }) => (
<React.Fragment>
<div><pre>{JSON.stringify(state, null, 2) }</pre></div>
{/* Toggle Dialog */}
<button onClick={() => setState({ isDialogOpen: !state.isDialogOpen})}>
{state.isDialogOpen ? 'Close Dialog' : 'Open Dialog'}
</button>
<SimpleDialog
isOpen={state.isDialogOpen}
headerTitle='Example Dialog Header'
onClose={() => setState({ isDialogOpen: false })}
onConfirm={() => setState({
isDialogOpen: false,
// If you don't want to update external state until complete,
// This is where you could grab current field values and update parent
// With setState
//
// inputValue: this.input.value,
// selectValue: this.select.value
})}
componentStyle={state.dialogStyle}
onValueChanged={(value) => setState({value}) }
>
<label htmlFor='input' className='simpleDialogLabelFor'>Input Example</label>
<input
id='input'
type='text'
className='simpleDialogInput'
autoComplete='off'
onChange={(e) => setState({inputValue: e.target.value})}
/>
<label htmlFor='select' className='simpleDialogLabelFor'>SelectExample</label>
<select
name='select'
id='select'
className='simpleDialogSelect'
onChange={(e) => setState({selectValue: e.target.value})}
>
<option value='Option1'>Option1</option>
<option value='Option2'>Option2</option>
<option value='Option3'>Option3</option>
<option value='Option4'>Option4</option>
</select>
</SimpleDialog>
</React.Fragment>
)}
</State>
</Playground>
## API
<Props of={SimpleDialog} />
@@ -1,30 +0,0 @@
.ExampleDropTarget {
display: flex;
justify-content: center;
flex-direction: column;
min-height: 100px;
border: 2px dashed black;
padding: 20px;
transition: 0.2s all ease;
}
.ExampleDropTarget h4,
.ExampleDropTarger p {
text-align: center;
word-break: break-word;
}
.ExampleDropTarget.can-drop {
border: 2px dashed #20a5d6;
background-color: #fafafa;
color: black;
}
.ExampleDropTarget.hovered {
border: 2px dashed #20a5d6;
background-color: black;
color: #91b9cd;
cursor: copy;
}
@@ -1,84 +0,0 @@
import React, { Component } from 'react';
import { DropTarget } from 'react-dnd';
import PropTypes from 'prop-types';
import './ExampleDropTarget.css';
// Drag sources and drop targets only interact
// if they have the same string type.
const Types = {
THUMBNAIL: 'thumbnail',
};
const divTarget = {
drop(props, monitor, component) {
// Note: For this example we use setState, but in
// OHIF we will update the redux store instead
const item = monitor.getItem();
component.setState({
item: {
id: item.id,
SeriesDescription: item.SeriesDescription,
},
});
return { id: 'ExampleDropTarget' };
},
};
// TODO: Find out why we can't move this into the Example app instead.
// It looks like the context isn't properly shared.
class CustomDropTarget extends Component {
static className = 'ExampleDropTarget';
state = {
item: null,
};
static defaultProps = {
isOver: false,
};
static propTypes = {
connectDropTarget: PropTypes.func.isRequired,
canDrop: PropTypes.bool.isRequired,
isOver: PropTypes.bool.isRequired,
};
render() {
const { canDrop, isOver, connectDropTarget } = this.props;
const isActive = canDrop && isOver;
let className = ExampleDropTarget.className;
if (isActive) {
className += ' hovered';
} else if (canDrop) {
className += ' can-drop';
}
return connectDropTarget(
<div className={className}>
<h4>
{isActive
? 'Release to drop'
: 'Drag / Drop something from the Study Browser here'}
</h4>
<p className="study-drop-results">
{this.state.item && JSON.stringify(this.state.item)}
</p>
</div>
);
}
}
const collect = (connect, monitor) => ({
connectDropTarget: connect.dropTarget(),
isOver: monitor.isOver(),
canDrop: monitor.canDrop(),
});
const ExampleDropTarget = DropTarget(Types.THUMBNAIL, divTarget, collect)(
CustomDropTarget
);
export { ExampleDropTarget };
@@ -1,75 +0,0 @@
export const studies = [
{
thumbnails: [
{
imageSrc:
'https://raw.githubusercontent.com/crowds-cure/cancer/master/public/screenshots/Anti-PD-1_Lung.jpg',
SeriesDescription: 'Anti-PD-1_Lung',
active: true,
SeriesNumber: '2',
numImageFrames: 512,
stackPercentComplete: 30,
},
{
imageSrc:
'https://raw.githubusercontent.com/crowds-cure/cancer/master/public/screenshots/Anti-PD-1_MELANOMA.jpg',
SeriesDescription: 'Anti-PD-1_MELANOMA',
SeriesNumber: '2',
InstanceNumber: '1',
numImageFrames: 256,
stackPercentComplete: 70,
},
{
altImageText: 'SR',
SeriesDescription: 'Imaging Measurement Report',
SeriesNumber: '3',
stackPercentComplete: 100,
},
],
},
{
thumbnails: [
{
imageSrc:
'https://raw.githubusercontent.com/crowds-cure/cancer/master/public/screenshots/CPTAC-GBM.jpg',
SeriesDescription: 'CPTAC-GBM',
active: true,
SeriesNumber: '2',
numImageFrames: 512,
stackPercentComplete: 100,
},
{
imageSrc:
'https://raw.githubusercontent.com/crowds-cure/cancer/master/public/screenshots/CPTAC-CM.jpg',
SeriesDescription: 'CPTAC-CM',
SeriesNumber: '2',
InstanceNumber: '1',
numImageFrames: 256,
},
{
imageSrc:
'https://raw.githubusercontent.com/crowds-cure/cancer/master/public/screenshots/CPTAC-HNSCC.jpg',
SeriesDescription: 'CPTAC-HNSCC',
SeriesNumber: '2',
InstanceNumber: '1',
numImageFrames: 256,
},
{
imageSrc:
'https://raw.githubusercontent.com/crowds-cure/cancer/master/public/screenshots/CPTAC-LSCC.jpg',
SeriesDescription: 'CPTAC-LSCC',
SeriesNumber: '2',
InstanceNumber: '1',
numImageFrames: 256,
},
],
},
];
export function onThumbnailClick() {
console.warn('onThumbnailClick');
}
export function onThumbnailDoubleClick() {
console.warn('onThumbnailDoubleClick');
}
@@ -1,22 +0,0 @@
---
name: Study Browser
menu: Components
route: /components/study-browser
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { WrappedStudyBrowser } from './wrappedStudyBrowser.js'
import { StudyBrowser } from './../index.js'
# Study Browser
## Basic usage
<Playground>
<WrappedStudyBrowser />
</Playground>
## API
<Props of={StudyBrowser} />
@@ -1,41 +0,0 @@
import React, { Component } from 'react';
import { DragDropContext } from 'react-dnd';
import TouchBackend from 'react-dnd-touch-backend';
//
import {
studies,
onThumbnailClick,
onThumbnailDoubleClick,
} from './exampleStudies.js';
import ExampleDropTarget from './ExampleDropTarget.js';
import { StudyBrowser } from './../index.js';
class StudyBrowserContainer extends Component {
render() {
//const viewportData = [null, null, null, null];
return (
<React.Fragment>
<ExampleDropTarget />
<StudyBrowser
studies={studies}
onThumbnailClick={onThumbnailClick}
onThumbnailDoubleClick={onThumbnailDoubleClick}
/>
</React.Fragment>
);
}
}
// Note:
// Normally, the top level APP component is wrapped with the DragDropContext
// We wrap this component to create a simple/local example.
const WrappedStudyBrowser = DragDropContext(
TouchBackend({ enableMouseEvents: true }),
null,
true
)(StudyBrowserContainer);
// http://react-dnd.github.io/react-dnd/docs/api/drag-drop-context
export { WrappedStudyBrowser };
@@ -1,72 +0,0 @@
import moment from 'moment';
export default function(searchData) {
this.setState({ searchData });
const filter = (key, searchData, study) => {
if (key === 'studyDateFrom' && searchData[key] && study['StudyDate']) {
const StudyDate = moment(study['StudyDate'], 'YYYYMMDD');
return StudyDate.isBetween(
searchData['studyDateFrom'],
searchData['studyDateTo'],
'days',
'[]'
);
} else if (searchData[key] && !study[key].includes(searchData[key])) {
return false;
} else {
return true;
}
};
const { field, order } = searchData.sortData;
// just a example of local filtering
let filteredStudies = this.defaultStudies
.filter(function(study) {
const all = [
'PatientName',
'PatientID',
'AccessionNumber',
'modalities',
'StudyDescription',
'studyDateFrom',
].every(key => {
return filter(key, searchData, study);
});
return all;
})
.sort(function(a, b) {
if (order === 'desc') {
if (a[field] < b[field]) {
return -1;
}
if (a[field] > b[field]) {
return 1;
}
return 0;
} else {
if (a[field] > b[field]) {
return -1;
}
if (a[field] < b[field]) {
return 1;
}
return 0;
}
});
// User can notice the loading icon
return new Promise(resolve => {
setTimeout(() => {
const first = searchData.currentPage * searchData.rowsPerPage;
let last =
searchData.currentPage * searchData.rowsPerPage +
searchData.rowsPerPage;
last = last >= filteredStudies.length ? filteredStudies.length : last;
this.setState({ studies: filteredStudies.slice(first, last) });
resolve();
}, 500);
});
}
@@ -1,87 +0,0 @@
import moment from 'moment';
const studies = [
{
StudyInstanceUID: '11111.111111.111111.11111',
PatientName: 'John Doe',
PatientID: '1',
AccessionNumber: '1234567',
StudyDate: '19930201',
modalities: 'MR',
StudyDescription: 'BRAIN',
},
{
StudyInstanceUID: '2222.222222.22222.22222',
PatientName: 'José Silva',
PatientID: '2',
AccessionNumber: '7654321',
StudyDate: moment().format('YYYYMMDD'),
modalities: 'CT',
StudyDescription: 'PET CT STANDARD',
},
{
StudyInstanceUID: '3333.333333.33333.33333',
PatientName: 'Antônio Jefferson',
PatientID: '3',
AccessionNumber: '732311',
StudyDate: moment()
.subtract(14, 'days')
.format('YYYYMMDD'),
modalities: 'US',
StudyDescription: '0',
},
{
StudyInstanceUID: '444444.44444.44444.4444',
PatientName: 'Antonio da Silva',
PatientID: '4',
AccessionNumber: '732311',
StudyDate: moment()
.subtract(1, 'months')
.format('YYYYMMDD'),
modalities: 'US',
StudyDescription: '0',
},
{
StudyInstanceUID: '55555.55555.55555.55555',
PatientName: 'Bezerra Souza',
PatientID: '5',
AccessionNumber: '5134543',
StudyDate: moment()
.subtract(6, 'days')
.format('YYYYMMDD'),
modalities: 'US',
StudyDescription: '0',
},
{
StudyInstanceUID: '66666.66666.66666.6666',
PatientName: 'Geraldo Roger',
PatientID: '6',
AccessionNumber: '5315135',
StudyDate: moment()
.subtract(7, 'days')
.format('YYYYMMDD'),
modalities: 'US',
StudyDescription: 'US',
},
{
StudyInstanceUID: '77777.77777.77777.77777',
PatientName: '',
PatientID: '7',
AccessionNumber: '5315136',
StudyDate: moment()
.subtract(5, 'days')
.format('YYYYMMDD'),
modalities: 'US',
StudyDescription: 'US',
},
].sort(function(a, b) {
if (a.PatientName < b.PatientName) {
return -1;
}
if (a.PatientName > b.PatientName) {
return 1;
}
return 0;
});
export default studies;
@@ -1,53 +0,0 @@
---
name: Study List
menu: Components
route: /components/study-list
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { StudyList } from './../index.js'
// Data
import defaultStudies from './studies.js'
import onSearch from './onSearch.js'
import moment from 'moment'
# Study List
## Basic usage
<Playground>
<State initial={{
searchData: {},
studies: defaultStudies.filter(study => {
const StudyDate = moment(study['StudyDate'], 'YYYYMMDD');
const startDate = moment().subtract(5, 'days');
const endDate = moment();
return StudyDate.isBetween(startDate, endDate, 'days', '[]');
}).slice(0, 5)
}}>
{({ state, setState }) => (
<div className="row" style={{ backgroundColor: '#000', height: '600px' }}>
<div className="col-xs-12" style={{ padding: 0 }}>
<StudyList
studies={state.studies}
pageOptions={[1, 2, 3, 5, 10, 15, 20, 25, 50, 100]}
studyListFunctionsEnabled={true}
onImport={(e) => alert('Import study mock ' + e)}
onSelectItem={(StudyInstanceUID) => { alert(StudyInstanceUID + ' has selected! Now you can open your study.'); }}
rowsPerPage={5}
defaultSort={{ field: 'PatientName', order: 'desc', }}
studyListDateFilterNumDays={7}
onSearch={onSearch.bind({ setState, defaultStudies })}
/>
</div>
</div>
)}
</State>
</Playground>
## API
<Props of={StudyList} />
@@ -1,27 +0,0 @@
---
name: Tab Components
menu: Components
route: /components/tab-components
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { TabComponents } from './../index.js'
// Data
import tabs from './tabs.js'
# Tab Components
## Basic usage
<Playground>
<TabComponents
tabs={tabs}
customProps={}
/>
</Playground>
## API
<Props of={TabComponents} />
@@ -1,26 +0,0 @@
export default tabs = [
{
name: 'tabName1',
Component: () => {
return <div>tab 1 Content</div>;
},
customProps: {},
hidden: false,
},
{
name: 'tabName2',
Component: () => {
return <div>tab 2 Content</div>;
},
customProps: {},
hidden: false,
},
{
name: 'tabName3',
Component: () => {
return <div>tab 3 Content</div>;
},
customProps: {},
hidden: true,
},
];
@@ -1,48 +0,0 @@
---
name: Table List
menu: Components
route: /components/table-list
---
import { Playground, Props } from 'docz'
import { State } from 'react-powerplug'
import { TableList, TableListItem } from './../index.js'
# Table List
## Basic usage
<Playground>
<State initial={{
selectedIndex: null,
listItems: [
{ label: 'Brain Left' },
{ label: 'Brain Right' },
{ label: 'Heart Left' },
{ label: 'Heart Right' }
]
}}>
{({ state, setState }) => (
<TableList headerTitle='Example Table List Header'>
{state.listItems.map( (item, index) => {
return (
<TableListItem
key={`item_${index}`}
itemClass={state.selectedIndex === index ? 'selected' : ''}
itemIndex={index}
onItemClick={() => alert('item clicked')}
>
<label>{item.label}</label>
</TableListItem>
)}
)}
</TableList>
)}
</State>
</Playground>
## API
<Props of={TableList} />
@@ -1,41 +0,0 @@
export default [
{
id: 'Pan',
label: 'Pan',
icon: 'arrows',
},
{
label: 'Zoom',
icon: 'search',
},
{
label: 'Bidirectional',
icon: 'measure-target',
},
{
label: 'Stack Scroll',
icon: 'bars',
},
{
label: 'Reset',
icon: 'reset',
},
{
label: 'Manual',
icon: 'level',
},
{
label: 'More',
icon: 'ellipse-circle',
buttons: [
{
label: 'Reset 2',
icon: 'reset',
},
{
label: 'Manual 2',
icon: 'adjust',
},
],
},
];
@@ -1,39 +0,0 @@
---
name: Toolbar Section
menu: Components
route: /components/toolbar-section
---
import { Playground, Props } from 'docz';
import { State } from 'react-powerplug';
import { ToolbarSection } from './../index.js';
import exampleButtons from './exampleButtons.js';
import NameSpace from '../../../__docs__/NameSpace';
# ToolbarSection
A basic row of buttons for a toolbar. Active command is `WwwcTool`
## Basic usage
<Playground>
<State
initial={{
buttons: exampleButtons,
activeButtons: ['Pan'],
setToolActive: () => {
alert('pressed');
},
}}
>
{({ state, setState }) => <ToolbarSection {...state} />}
</State>
</Playground>
## API
<Props of={ToolbarSection} />
## Translation Namespace
<NameSpace name="Buttons" />
@@ -1,20 +0,0 @@
---
name: Tooltip
menu: Components
route: /components/tooltip
---
import { Playground, Props } from 'docz'
import { Tooltip } from './../index.js'
# Tooltip
## Basic usage
<Playground>
<Tooltip />
</Playground>
## API
<Props of={Tooltip} />