vitessce / vitessce-python

Python API and Jupyter widget for Vitessce
https://python-docs.vitessce.io
MIT License
40 stars 7 forks source link

Ability to use comparative views + pageMode in a Jupyter notebook #351

Open keller-mark opened 4 months ago

keller-mark commented 4 months ago

It would be useful to demonstrate the comparative visualization features, and the data processing steps that are required, if we can use them within a Jupyter notebook context. A follow-up step would then be to show them in HuBMAP workspaces

Also, need to support passing a view uid via vc.add_view() analogous to the JS:

const biomarkerSelect = vc.addView(dataset, 'biomarkerSelect', { uid: 'biomarker-select' });
PAGE_ESM = transform("""

function ensureComponent(component) {
  if(!component) {
    return () => null;
  }
  return component;
}

function createPage(utilsForPages) {
  const {
    usePageModeView,
  } = utilsForPages;
  function PageComponent(props) {
    const BiomarkerSelect = ensureComponent(usePageModeView('biomarker-select'));

    return (
      <div><BioMarkerSelect</div>
    );
  }
}
export default { createPage };
""")
vc.widget(page_mode=True, page_esm=PAGE_ESM)

TODO: