Commit ed5f417c authored by Mohammad Nakhaee's avatar Mohammad Nakhaee
Browse files

preview for Matrices

parent a7c2f43f
Pipeline #134320 passed with stages
in 41 minutes and 38 seconds
......@@ -28,6 +28,7 @@ import {SectionPlots} from '../../archive/ArchiveBrowser'
import Quantity, {QuantityCell, QuantityRow, QuantityTable} from '../../Quantity'
import {Editor} from '@tinymce/tinymce-react'
import { pluralize } from '../../../utils'
import {Matrix} from '../../archive/visualizations'
const useStyles = makeStyles(theme => ({
subSection: {
......@@ -112,8 +113,20 @@ const PropertyPreview = React.memo(({quantityDef, section}) => {
</Quantity>
</QuantityCell>
} else {
console.log('Unsupported quantity shape ', shape)
return ''
return <Box textAlign="center">
<Matrix
values={section[quantityDef.name]}
shape={shape}
invert={false}
type={quantityDef.type.type_data}
key={`matrix:${quantityDef.name}`}
/>
<Typography noWrap variant="caption">
({quantityDef.shape.map((dimension, index) => <span key={index}>
{index > 0 && <span>&nbsp;&times;&nbsp;</span>}{String(dimension)}
</span>)}&nbsp;)
</Typography>
</Box>
}
})
PropertyPreview.propTypes = {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment