wip(lab): Work on xray
This commit is contained in:
parent
542f0d74fe
commit
3f01f67087
3 changed files with 43 additions and 8 deletions
|
@ -1,9 +1,13 @@
|
||||||
import { Chevron } from 'shared/components/navigation/primary.js'
|
import { Chevron } from 'shared/components/navigation/primary.js'
|
||||||
import ClearIcon from 'shared/components/icons/clear.js'
|
import ClearIcon from 'shared/components/icons/clear.js'
|
||||||
import { Ul, Li, Details, Summary, SumDiv, Deg } from 'shared/components/workbench/menu'
|
import { Ul, Li, Details, Summary, SumDiv, Deg } from 'shared/components/workbench/menu'
|
||||||
|
import Path from './path.js'
|
||||||
|
import Point from './point.js'
|
||||||
|
|
||||||
|
const types = {
|
||||||
const Path = props => <p>{props.pathName}</p>
|
paths: Path,
|
||||||
|
points: Point
|
||||||
|
}
|
||||||
|
|
||||||
const XrayList = props => {
|
const XrayList = props => {
|
||||||
|
|
||||||
|
@ -27,22 +31,35 @@ const XrayList = props => {
|
||||||
</button>
|
</button>
|
||||||
<Chevron w={6} m={3}/>
|
<Chevron w={6} m={3}/>
|
||||||
</Summary>
|
</Summary>
|
||||||
{props.gist.xray.parts[props.partName].paths && (
|
{Object.keys(types).map(type => props.gist.xray.parts[props.partName][type] && (
|
||||||
<Ul>
|
<Ul>
|
||||||
<Li>
|
<Li>
|
||||||
<Details>
|
<Details>
|
||||||
<Summary>
|
<Summary>
|
||||||
<SumDiv>
|
<SumDiv>
|
||||||
<span>Paths</span>
|
<span className="capitalize">{type}</span>
|
||||||
</SumDiv>
|
</SumDiv>
|
||||||
</Summary>
|
</Summary>
|
||||||
{Object.keys(props.gist.xray.parts[props.partName].paths)
|
{Object.keys(props.gist.xray.parts[props.partName][type])
|
||||||
.map(pathName => <Path {...props} pathName={pathName} />)
|
.map(id => (
|
||||||
|
<Li>
|
||||||
|
<Details>
|
||||||
|
<Summary>
|
||||||
|
<SumDiv>
|
||||||
|
<Deg />
|
||||||
|
<span>{id}</span>
|
||||||
|
</SumDiv>
|
||||||
|
<Chevron />
|
||||||
|
</Summary>
|
||||||
|
{types[type]({...props, id})}
|
||||||
|
</Details>
|
||||||
|
</Li>
|
||||||
|
))
|
||||||
}
|
}
|
||||||
</Details>
|
</Details>
|
||||||
</Li>
|
</Li>
|
||||||
</Ul>
|
</Ul>
|
||||||
)}
|
))}
|
||||||
</Details>
|
</Details>
|
||||||
</Li>
|
</Li>
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
const XrayPath = props => {
|
/*
|
||||||
|
* Things to add
|
||||||
|
*
|
||||||
|
* attributes
|
||||||
|
* ops
|
||||||
|
* render
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
const XrayPath = props => {
|
||||||
|
return <pre>{JSON.stringify(props.gist.xray.parts[props.partName].paths[props.id], null ,2)}</pre>
|
||||||
}
|
}
|
||||||
|
|
||||||
export default XrayPath
|
export default XrayPath
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { Ul, Li, Details, Summary, SumDiv, Deg } from 'shared/components/workbench/menu'
|
||||||
|
|
||||||
|
const XrayPoint = props => [
|
||||||
|
<Li key='x'>x: {props.x}</Li>,
|
||||||
|
<Li key='y'>x: {props.y}</Li>,
|
||||||
|
<Li key='attributes'>Attributes: {props.y}</Li>,
|
||||||
|
]
|
||||||
|
|
||||||
|
export default XrayPoint
|
Loading…
Add table
Add a link
Reference in a new issue