Closed dvdkouril closed 5 months ago
Using the library in computational notebook context makes me really think differently about the API: Before:
const urlTan2018 = "https://datapath"; const fileTan2018 = await fetchTsv(urlTan2018); const tab2018Model = parse3dg(fileTan2018 , { center: true, normalize: true }); //~ create a scene let chromatinScene = { chunks: [], models: [], }; const renderer = new ChromatinBasicRenderer(); renderer.addScene(chromatinScene); renderer.startDrawing(); const canvas = renderer.getCanvasElement(); return canvas;
Better:
const urlTan2018 = "https://datapath"; const fileTan2018 = await fetchTsv(urlTan2018); const tab2018Model = parse3dg(fileTan2018 , { center: true, normalize: true }); //~ create a scene let chromatinScene = { chunks: [], models: [tab2018Model], }; //~ This will go somewhere in the library const display = (scene: ChromatinScene) => { const renderer = new ChromatinBasicRenderer(); renderer.addScene(chromatinScene); renderer.startDrawing(); const canvas = renderer.getCanvasElement(); return canvas; }; return display(chromatinScene);
Better (gosling-ready):
const config = { scenes: [ { chunks: [ { url: "https://chunkurl", representation: "balls", ... }, ], models: [ { url: "https://modelpath", representation: "balls-and-stick", ... } ] }, ], camera: {...}, cuttingPlanes: {...}, }; return displayView(config);
Some aspects of this have been addressed, some don't make sense anymore.
Using the library in computational notebook context makes me really think differently about the API: Before:
Better:
Better (gosling-ready):