|
|
|
|
@ -11,6 +11,7 @@ export default function Graph({results}){ |
|
|
|
|
|
|
|
|
|
const [points, setPoints]=useState(); |
|
|
|
|
const [lines, setLines]=useState(); |
|
|
|
|
const [drawLines, setDrawLines]=useState(false); |
|
|
|
|
|
|
|
|
|
const [showContent, setShowContent]=useState(false); |
|
|
|
|
const bounds = useBounds(); |
|
|
|
|
@ -57,6 +58,10 @@ export default function Graph({results}){ |
|
|
|
|
<input type="checkbox" id="toggle-content" className='self-end mr-2' defaultChecked={showContent} |
|
|
|
|
onChange={(e)=>setShowContent(e.target.checked)} /> |
|
|
|
|
<label htmlFor="toggle-content" className='self-end text-xs mr-4'>Show Content</label> |
|
|
|
|
|
|
|
|
|
<input type="checkbox" id="toggle-content" className='self-end mr-2' defaultChecked={drawLines} |
|
|
|
|
onChange={(e)=>setDrawLines(e.target.checked)} /> |
|
|
|
|
<label htmlFor="toggle-content" className='self-end text-xs mr-4'>Draw line</label> |
|
|
|
|
</div> |
|
|
|
|
<Canvas className='w-full aspect-[16/9] border border-gray-300'> |
|
|
|
|
<color attach="background" args={['#000000']} /> |
|
|
|
|
@ -74,7 +79,7 @@ export default function Graph({results}){ |
|
|
|
|
</group> |
|
|
|
|
|
|
|
|
|
<group> |
|
|
|
|
{Array.isArray(lines) && lines?.map((line, index)=>( |
|
|
|
|
{drawLines && Array.isArray(lines) && lines?.map((line, index)=>( |
|
|
|
|
<Line |
|
|
|
|
key={index} |
|
|
|
|
points={line} // Array of [x, y, z] or Three.Vector3 |
|
|
|
|
|