README.md

From Binary Blobs to Shared Insights

This repository contains examples supporting XetHub's introductory blog post on custom views.

You can see examples like:

  • Scatter matrix on Iris dataset
  • NGL Viewer on .cif file

Scatter matrix

Watch the custom view for the Iris dataset plot a scatter matrix between all numerical features. You can duplicate this repository for the code, or use the snippet below with any CSV in your repository that has at least two numerical features:

""" Interact with data using xetview on a specific file.
    For example, reading in a CSV file's data and then
    plotting the contents using Pandas libraries.
"""
import xetview
import pandas as pd
import matplotlib.pyplot as plt
from io import StringIO

file_bytes = await xetview.get_data_file()
df = pd.read_csv(StringIO(file_bytes.decode('utf-8')))
pd.plotting.scatter_matrix(df)
plt.show()

The code is also available in the .xethub/custom_views directory in the view.py files associated with this view.

NGL Viewer

View the NGLViewer in action over a Sars-COV-2 spike protein. The file for this protein was downloaded from the RCSB Protein Data Bank (RCSB PDB).

File List Total items: 5
Name Last Commit Size Last Modified
.xethub/custom_views/3f4bbbe3-55a3-44ac-bdc7-98b64a819c25 Create 3f4bbbe3-55a3-44ac-bdc7-98b64a819c25 custom view 2 months ago
.gitattributes Initial commit 79 B 2 months ago
7jw0.cif initial commit 3.1 MiB 2 months ago
README.md Update 'README.md' 1.5 KiB 2 months ago
iris.csv initial commit 4.5 KiB 2 months ago

Repository Size

Loading repo size...

Commits 8 commits

File Types