@doe-casl/verain-view
Advanced tools
Comparing version 1.2.6 to 1.3.0
{ | ||
"name": "@doe-casl/verain-view", | ||
"version": "1.2.6", | ||
"version": "1.3.0", | ||
"description": "VeraInView is a standalone HTML file that can act as an application to visualize your VERAin XML files.", | ||
@@ -5,0 +5,0 @@ "author": "Kitware, Inc.", |
@@ -6,3 +6,3 @@ import React from 'react'; | ||
import VTKRenderer from '../widgets/VTKRenderer'; | ||
import VTKWidget from '../widgets/VTKWidget'; | ||
import ImageRenderer from '../widgets/ImageRenderer'; | ||
@@ -12,2 +12,4 @@ import ImageGenerator from '../utils/ImageGenerator'; | ||
import vtkCellVTKViewer from '../utils/CellVTKViewer'; | ||
import style from './CellEditor.mcss'; | ||
@@ -38,2 +40,4 @@ | ||
this.cellViewer = vtkCellVTKViewer.newInstance(); | ||
this.addRadius = this.addRadius.bind(this); | ||
@@ -194,2 +198,12 @@ this.onMaterialChange = this.onMaterialChange.bind(this); | ||
const colors = {}; | ||
Object.keys(materials).forEach((key) => { | ||
colors[key] = materials[key].color; | ||
}); | ||
const cellData = { | ||
pitch: this.state.pinPitch, | ||
colors, | ||
layers: items, | ||
}; | ||
return ( | ||
@@ -228,6 +242,3 @@ <div className={style.container}> | ||
<span className={style.visualizerPanelHeadline}>3D</span> | ||
<VTKRenderer | ||
nested | ||
content={items.length > 0 ? this.cell.has3D : {}} | ||
/> | ||
<VTKWidget viewer={this.cellViewer} data={cellData} /> | ||
</div> | ||
@@ -234,0 +245,0 @@ </div> |
import React from 'react'; | ||
import CellEditor from './CellEditor'; | ||
import Rod2DPreview from '../widgets/Rod2DPreview'; | ||
import RodEditor from './RodEditor'; | ||
function registerLocalEditors(Simput) { | ||
if (Simput && Simput.updateWidgetMapping) { | ||
Simput.updateWidgetMapping('RodCellEditor', (prop, viewData, onChange) => ( | ||
Simput.updateWidgetMapping('CellEditor', (prop, viewData, onChange) => ( | ||
<CellEditor | ||
@@ -17,4 +17,11 @@ key={prop.data.id} | ||
)); | ||
Simput.updateWidgetMapping('RodPreview', (prop, viewData, onChange) => ( | ||
<Rod2DPreview key={prop.data.id} /> | ||
Simput.updateWidgetMapping('RodEditor', (prop, viewData, onChange) => ( | ||
<RodEditor | ||
key={prop.data.id} | ||
data={prop.data} | ||
ui={prop.ui} | ||
viewData={viewData} | ||
show={prop.show} | ||
onChange={onChange || prop.onChange} | ||
/> | ||
)); | ||
@@ -21,0 +28,0 @@ } |
@@ -18,3 +18,7 @@ import React from 'react'; | ||
return <td key={cellKey}>{content}</td>; | ||
return ( | ||
<td className={col.classes} key={cellKey}> | ||
{content} | ||
</td> | ||
); | ||
}); | ||
@@ -21,0 +25,0 @@ |
@@ -26,3 +26,6 @@ import React from 'react'; | ||
))} | ||
<td className={style.last} /> | ||
<td | ||
className={style.last} | ||
style={{ width: `${100 * remaining / props.totalLength}%` }} | ||
/> | ||
</tr> | ||
@@ -29,0 +32,0 @@ <tr className={style.labels}> |
6213052
49
18108