hms-dbmi / chromoscope

Interactive multiscale visualization for structural variation in human genomes
https://chromoscope.bio/
MIT License
64 stars 6 forks source link

Load thumbnail images on the fly #60

Closed sehilyi closed 2 years ago

sehilyi commented 2 years ago
useEffect(() => {
    if(!gosSmRef.current) return;
    console.log('here');
    setTimeout(() => {
        const { canvas } = gosSmRef.current?.api.getCanvas({ resolution: 4, transparentBackground: false });
        const url = canvas.toDataURL('image/png');
        // console.log(url);
        var image = new Image();
        image.src = url;
        document.body.appendChild(image);
    }, 1000);
}, [gosSmRef.current]);