# Superset

{% hint style="warning" %}
Superset helps connect MEDomics to remote servers and databases (available from v1.7.0).
{% endhint %}

Apache Superset is an [open-source software](https://en.wikipedia.org/wiki/Open-source_software) application designed for data exploration and data visualization. If offers a wide range of features such as dashboard creation, diverse charting tools, and integration with various data sources.

Superset is now integrated into MEDomics, providing users with direct access to its powerful capabilities through a single click, eliminating the need for an external work environment (e.g. ). This integration allows users to launch and utilize Superset directly within MEDomics, enabling them to visualize data, design dashboards, export charts, and more—**all within a unified platform**.

On this page, we will provide a comprehensive guide on how to use Superset within MEDomics.

### The Superset Panel

When you launch MEDomics, you’ll notice a Superset panel located at the bottom left of the interface, as shown in the figure below. This panel provides two primary options: **Launch Superset** and **Dashboard Viewer**.

<figure><img src="https://4288370141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUO0RN9PzFLqAgLEwwaSn%2Fuploads%2FBfaKsQLN445aRHo23qRt%2FSupersetPanel.png?alt=media&#x26;token=43607eaa-55a0-4e0d-83d0-6526dc35e3d3" alt=""><figcaption><p>Superset Panel Explained</p></figcaption></figure>

### *"Launch Superset"* Button

Clicking the **Launch Superset** button initiates Superset in the background and embeds it within the MEDomics application. This feature handles all necessary configuration changes and initialization steps, such as creating a new admin user. Upon clicking the button, a progress bar will appear, indicating the status of each step in the launch process.

<figure><img src="https://4288370141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUO0RN9PzFLqAgLEwwaSn%2Fuploads%2FSuYkN1WDob73MHPiOIw6%2FSupersetInit.png?alt=media&#x26;token=4824f356-9474-45ed-9f7d-175536114922" alt=""><figcaption><p>Superset initializing...</p></figcaption></figure>

Once Superset is fully launched, you’ll be directed to the Superset login page. Use the following default credentials to log in:

* Username: **`admin`**
* Password: **`admin`**

<figure><img src="https://4288370141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUO0RN9PzFLqAgLEwwaSn%2Fuploads%2FRvJveizxm6HDXubxCZLM%2Fimage.png?alt=media&#x26;token=5b488d29-2ce5-4e58-8611-268b2ca2ea85" alt=""><figcaption><p>Superset login page</p></figcaption></figure>

After logging in, you can begin exploring Superset’s powerful data visualization and dashboard creation tools directly within MEDomics:tada:.

<figure><img src="https://4288370141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUO0RN9PzFLqAgLEwwaSn%2Fuploads%2FqxQUUao3jKAjAUF23VZZ%2Fimage.png?alt=media&#x26;token=a380b39c-0239-41aa-90d8-e423d287ac4a" alt=""><figcaption><p>Superset dashboard inside MEDomic</p></figcaption></figure>

### Superset Tools

MEDomics offers integrated tools to streamline platform management without requiring you to exit the MEDomics environment. These tools include:

* **Refreshing the page** to reload data or update dashboards.
* **Creating new users** for collaborative access.
* **Editing the Superset configuration file** to enable additional platform features.
* **Killing the Superset server** once your work is complete efficient resource management.

<figure><img src="https://4288370141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUO0RN9PzFLqAgLEwwaSn%2Fuploads%2F4c8LEipLzwYOf0AEUZIh%2Fimage.png?alt=media&#x26;token=5ea4293c-8ff5-4ae4-a5f3-9b2159df7352" alt=""><figcaption><p>Superset tools</p></figcaption></figure>

### *"Dashboard Viewer"* Button

The **Dashboard Viewer** button opens a dashboard embedder, allowing you to visualize shared dashboards using their unique **Dashboard ID**. This feature ensures secure access to specific dashboards while protecting sensitive data from unauthorized access.

Before using the Dashboard Viewer, you’ll need a Dashboard ID. Follow these steps to retrieve it:

1. Open a dashboard (e.g., World Bank’s Data).
2. Click the three dots (`...`) next to **EDIT DASHBOARD**.
3. Select **Embed Dashboard**.
4. Copy the provided Dashboard ID.
5. Add the following address to the **Allowed Domains** in Superset’s settings: `http://localhost:8888`.

These steps are illustrated in the figure below.

<figure><img src="https://4288370141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUO0RN9PzFLqAgLEwwaSn%2Fuploads%2FkMYc7MvrkyGEkBppmhxW%2FSupersetEmbed.png?alt=media&#x26;token=c0c9916e-4c6d-4137-8397-5e8c90703bf6" alt=""><figcaption><p>Steps to get a dashboard's embedding ID</p></figcaption></figure>

Once you’ve clicked the **Dashboard Viewer** button, an interface will prompt you to enter the Dashboard ID and the port of the Superset server. Since everything runs locally, Superset must also be running locally to access the dashboard. MEDomics conveniently displays the port of any active Superset instance in the background.

<figure><img src="https://4288370141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUO0RN9PzFLqAgLEwwaSn%2Fuploads%2F8E3JGse6UhQyNmr1IGNa%2Fimage.png?alt=media&#x26;token=f834cebb-e389-4e42-842b-7720ae7b52e7" alt=""><figcaption><p>Dashboard Viewer Interface</p></figcaption></figure>

After entering the required information, click **Connect** to start visualizing your dashboard. Enjoy visualizing your dashboards :clap:.

<figure><img src="https://4288370141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUO0RN9PzFLqAgLEwwaSn%2Fuploads%2FGGd9C1udnKfYjOSPW1LO%2Fimage.png?alt=media&#x26;token=6793a372-bbbb-41f0-bda6-25152824a00f" alt=""><figcaption><p>Dashboard Viewer Example</p></figcaption></figure>

### Export data to your workspace

Superset allows users to export data directly from the platform to their local storage. This functionality enables you to transfer your data to MEDomics's workspace, where it can be utilized in various other tools (e.g. [input tools](https://medomicslab.gitbook.io/medomics-docs/~/revisions/z0wFwbRqAmxlgbHR1M4e/tutorials/design/input-module) for example) for further analysis or processing. Below are the steps to export your data to the workspace:

1. **Run an SQL Query**: Start by executing a simple SQL query, such as `SELECT * FROM YOUR_DATASET`, to retrieve the data you wish to export.
2. **Download to CSV**: Once the query results are displayed, click the **DOWNLOAD TO CSV** button.
3. **Save to Workspace**: Select your MEDomics workspace as the destination and save the file.

These steps are illustrated in the figure below.

<figure><img src="https://4288370141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUO0RN9PzFLqAgLEwwaSn%2Fuploads%2FbXGjasH1wlJtCy7UJT3Q%2FSupersetExport.png?alt=media&#x26;token=959cc241-ac6e-4984-ab1a-28de2ccac273" alt=""><figcaption><p>Steps to export data from Superset to MEDomics's workspace</p></figcaption></figure>

This feature ensures that your data is readily available for use across different tools within MEDomics.

### Useful resources

* [Apache Superset Documentation](https://superset.apache.org/docs/intro)
* [Creating your first  dashboard](https://superset.apache.org/docs/using-superset/creating-your-first-dashboard/)
* <https://superset.apache.org/community/>
* [Superset *config.py* guide](https://www.restack.io/docs/superset-knowledge-apache-superset-config-guide)
