A Power BI custom visual that allows users to visualize molecular structure data using the 3Dmol.js viewer.
- Multiple format support: Load structures in PDB, CIF, MOL2, SDF, XYZ, or Cube format
- File path support: Load structures from URLs or file paths
- Small Multiples Support: Display multiple structures in a grid layout with configurable title positions
- Multiple visualization styles: Choose from Cartoon, Stick, Line, Cross, Sphere, and Surface representations
- Flexible coloring schemes: Color by Chain, Residue, Spectrum, Secondary Structure, or use default colors
- Custom chain colors: Define specific colors for chains A thru F directly in Display Settings
- Surface overlay: Add translucent molecular surfaces with independent color control including custom colors
- Customizable display: Adjust background color, enable auto-rotation, and configure grid layout
- Automatic format detection: Automatically detects structure format (PDB, CIF, etc.)
- Download the latest
.pbivizfile from thedist/directory - In Power BI Desktop, go to Visualizations pane
- Click the ... (More options) button and select Import a visual from a file
- Select the downloaded
.pbivizfile - The 3Dmol Protein Viewer will appear in your visualizations pane
The visual expects a column containing molecular structure data as text strings OR file paths/URLs to structure files. The visual automatically detects whether the value is a URL or structure data. Multiple rows will be displayed as a grid of structures.
- Add the visual to your report canvas
- Drag a field containing structure data (string or URL) to the Structure Data data role
- Optionally, drag a field containing molecule names to the Title data role
- The structure(s) will be rendered automatically in a grid layout
- PDB - Protein Data Bank format
- CIF - Crystallographic Information File (mmCIF)
- MOL2 - Tripos MOL2 format
- SDF - Structure Data File
- XYZ - XYZ coordinate format
- Cube - Gaussian Cube format
Access these settings in the Format pane:
- Protein Style: Choose how the structure is rendered (Cartoon, Stick, Line, Cross, Sphere, Surface)
- Color Scheme: Select coloring method (By Chain, By Residue, Spectrum, Secondary Structure, Default)
- Background Color: Set the viewer background color
- Auto Rotate: Enable/disable automatic rotation of the structure
- Use Custom Chain Colors: Enable custom coloring for individual chains
- Chain A/B/C/D/E/F Color: Color pickers to set specific colors for each chain
- Columns: Number of columns in the grid (set to 0 for automatic layout based on the number of structures)
- Show Titles: Enable/disable display of molecule titles
- Title Position: Choose where titles appear in each cell (Top Left, Top Center, Top Right, Bottom Left, Bottom Center, Bottom Right)
- Show Surface: Toggle to overlay a translucent molecular surface on the structure
- Surface Opacity: Adjust the transparency of the surface (0-100%)
- Surface Color Scheme: Select coloring method for the surface (By Chain, By Residue, Spectrum, Secondary Structure, Custom Color, Default)
- Surface Color: Custom color picker for the surface (when Color Scheme is Custom)
- Node.js (v12 or higher)
- npm
- Power BI Visual Tools:
npm install -g powerbi-visuals-tools
# Install dependencies
npm install
# Start development server
npm start
# Package the visual
npm run packageThe packaged visual will be available in the dist/ directory.
- 3Dmol.js - Molecular visualization library
- Power BI Visuals API
