import Text from '../text' import Circle from '../circle' import { round, formatMm } from 'shared/utils.js' const RevealPoint = props => { const r = 15 * props.gist.scale const { x, y } = props.point const { topLeft, bottomRight } = props.part const i = Object.keys(props.gist.xray.reveal[props.partName].points).indexOf(props.pointName)%10 const classes = `stroke-sm stroke-color-${i} stroke-dashed` return ( ) } // Length for the indicators const lead = 20 // Length for the text on indicators // this is longer to prevent text from being cropped const longLead = 40 const Coord = ({id, val, pointName}) => ( {round(val)} {pointName} ) const PosX = ({ id, point, scale, pointName }) => ( ) const PosY = ({ id, point, scale, pointName }) => ( ) const ActiveXrayPoint = props => { const id = `${props.partName}_${props.pointName}_xray_point` const r = 15 * props.gist.scale const { x, y } = props.point const { topLeft, bottomRight } = props.part const i = Object.keys(props.gist.xray.parts[props.partName].points).indexOf(props.pointName)%10 const classes = `stroke-sm stroke-color-${i} stroke-dashed` const posProps = { id, point: props.point, pointName: props.pointName, scale: props.gist.scale, } return } const PassiveXrayPoint = props => ( props.unsetGist( ['xray', 'parts', props.partName, 'points', props.pointName] ) : () => props.updateGist( ['xray', 'parts', props.partName, 'points', props.pointName], 1 ) } /> ) const Point = props => { const { point, pointName, partName, gist } = props const output = [] // Passive indication for points if (gist.xray) output.push() // Active indication for points (point that have been clicked on) if (gist.xray?.parts?.[partName]?.points?.[pointName]) output.push() // Reveal (based on clicking the seach icon in sidebar if (gist.xray?.reveal?.[partName]?.points?.[pointName]) output.push() // Render text if (point.attributes && point.attributes.get('data-text')) output.push() // Render circle if (point.attributes && point.attributes.get('data-circle')) output.push() return output.length < 1 ? null : output } export default Point