{ "cells": [ { "cell_type": "markdown", "metadata": { "nbsphinx": "hidden" }, "source": [ "# Vitessce Widget Tutorial" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Using an existing view config dict" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 1. Import dependencies\n", "\n", "We need to import the `VitessceConfig` class." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from vitessce import VitessceConfig" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 2. Import config of interest as a dict\n", "\n", "The Vitessce config at its lowest level is a JSON object or a Python `dict` that specifies a layout for the Vitessce components will be rendered in the widget. These components may be scatterplots, spatial plots, heatmaps, or control components. The config also describes the datasets and files that will be visualized.\n", "\n", "The `vitessce` package provides helper functions and classes to simplify the process of defining Vitessce configs. Those functions are demonstrated in the other notebooks. The helper functions are intended to make visualization of local datasets easy. However, in this case, we are importing a config that has been pre-defined in the file `example_configs.py`, in which the dataset being visualized is stored remotely in AWS S3 (rather than locally)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from example_configs import dries as dries_config" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 3. Create the Vitessce widget\n", "\n", "Create the widget by creating a new config instance using the `VitessceConfig.from_dict` static method, then calling the config's `.widget()` method.\n", "\n", "Render the widget by placing the widget variable on its own line at the end of the notebook cell." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "vc = VitessceConfig.from_dict(dries_config)\n", "vw = vc.widget()\n", "vw" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.0" } }, "nbformat": 4, "nbformat_minor": 4 }