Skip to main content

Professional data visualization library - Optimized for bioinformatics and scientific analyses (D3.js/Vega-Lite/Altair based)

Project description

Solvien Graph

Professional data visualization library - Optimized for bioinformatics and scientific analyses, designed to create D3.js/Vega-Lite based Altair charts.

Features

  • Professional Design: Minimalist, corporate appearance
  • Fully Interactive: D3.js/Vega-Lite based, zoom, pan, hover, export features
  • Bioinformatics Focused: Gene expression, differential analysis and genomic data visualization
  • Comprehensive Chart Types: Bar, Line, Scatter, Pie, Histogram, Heatmap, Volcano, MA Plot, Violin, Box Plot
  • Professional Themes: Scientific, Publication, Bioinformatics and more
  • Publication Quality: High resolution, optimized for scientific publications
  • Scientific Color Palettes: Viridis, Plasma, Inferno, Magma, Cividis, Coolwarm, RdBu
  • D3.js Technology: Altair with D3.js/Vega-Lite based, web standards compliant, professional charts

Installation

pip install -e .

or

pip install solvien-graph

Note: Since it's based on Altair (D3.js/Vega-Lite), all charts are automatically interactive. Opens in Jupyter Notebook or web browser. Produces output in JSON format, web standards compliant.

Quick Start

Bar Chart (Interactive)

import solvien_graph as sg

data = {
    "Python": 45,
    "JavaScript": 30,
    "Java": 20,
    "C++": 15
}

# Interactive chart - with hover, zoom, pan features (D3.js based)
chart = sg.quick_bar(data, title="Programming Languages Popularity")

# Save as HTML
chart.save("chart.html")

Line Chart (Interactive)

import numpy as np
import solvien_graph as sg

x = np.linspace(0, 10, 100)
y = np.sin(x)

# Interactive line chart - you can see values with hover (D3.js based)
chart = sg.quick_line(x, y, title="Sine Function")

# Save as HTML
chart.save("chart.html")

# Save as PNG/SVG (requires vega-cli)
chart.save("chart.png")

Scatter Plot

import numpy as np
import solvien_graph as sg

x = np.random.randn(100)
y = np.random.randn(100)

sg.quick_scatter(x, y, title="Random Distribution")

Pie Chart

import solvien_graph as sg

data = {
    "Mobile": 45,
    "Web": 30,
    "Desktop": 15,
    "Other": 10
}

sg.quick_pie(data, title="Platform Distribution")

Histogram

import numpy as np
import solvien_graph as sg

data = np.random.normal(100, 15, 1000)

sg.quick_hist(data, title="Normal Distribution", bins=30)

Themes

Solvien Graph comes with professional themes:

  • scientific: Theme optimized for scientific publications
  • publication: For high quality black and white publications
  • bioinformatics: Color palette optimized for bioinformatics analyses
  • And more...
sg.quick_bar(data)

Biograph Module - Specialized Bioinformatics Toolkit

The biograph module provides a dedicated namespace for bioinformatics visualizations. This is the recommended way to use bioinformatics functions:

Import Style

# Recommended: Import biograph as a separate module
import solvien_graph.biograph as bg

# Alternative style
from solvien_graph import biograph as bg

# Direct function import
from solvien_graph.biograph import quick_heatmap, quick_volcano

# Backward compatibility (still works)
from solvien_graph import quick_heatmap, quick_volcano

Why use biograph?

  • Clear namespace: Separates bioinformatics functions from general plotting
  • Professional workflow: import solvien_graph.biograph as bg is concise and clear
  • Specialized toolkit: All bioinformatics-specific visualizations in one place
  • Easy to remember: bg.quick_heatmap(), bg.quick_volcano(), etc.

Bioinformatics Charts

Heatmap (Gene Expression)

import numpy as np
import solvien_graph.biograph as bg

# Gene expression data
gene_data = np.random.randn(20, 10) * 2 + 5
gene_names = [f"Gene_{i+1}" for i in range(20)]
sample_names = [f"Sample_{i+1}" for i in range(10)]

bg.quick_heatmap(gene_data, 
                title="Gene Expression Heatmap",
                cmap="viridis",
                xticklabels=sample_names,
                yticklabels=gene_names,
                cbar_label="Expression Level")

Volcano Plot (Differential Expression)

import numpy as np
import solvien_graph.biograph as bg

log2fc = np.random.randn(1000) * 2
pvalues = np.random.exponential(0.1, 1000)
pvalues = np.clip(pvalues, 0, 1)

bg.quick_volcano(log2fc, pvalues,
                title="Differential Gene Expression",
                fc_threshold=1.0,
                pvalue_threshold=0.05)

MA Plot

mean_expr = np.random.lognormal(5, 1, 1000)
log2fc = np.random.randn(1000) * 1.5

bg.quick_ma_plot(mean_expr, log2fc,
                title="MA Plot - Differential Expression")

Violin Plot & Box Plot

conditions = {
    "Control": np.random.normal(5, 1, 100),
    "Treatment A": np.random.normal(6.5, 1.2, 100),
    "Treatment B": np.random.normal(4.5, 0.8, 100)
}

bg.quick_violin(conditions, title="Gene Expression - Conditions")
bg.quick_boxplot(conditions, title="Gene Expression - Box Plot")

Advanced Usage

Creating Chart Without Displaying

# Create chart but don't display
chart = sg.quick_bar(data, show=False)

# You can perform additional operations on Altair chart
chart = chart.properties(title="New Title")
chart = chart.encode(y=alt.Y('Value:Q', title="New Y Label"))

# Then display
chart.show()

Custom Colors

sg.quick_bar(data, color="#FF5733")
# or
sg.quick_bar(data, color=["#FF5733", "#33FF57", "#3357FF"])

Custom Sizes

sg.quick_bar(data, figsize=(12, 8))

Interactive Features

All charts are automatically interactive:

  • Hover: Hover to see values
  • Zoom: Zoom in/out on chart
  • Pan: Pan the chart
  • Export: Save as PNG, SVG, HTML
  • Legend: Click legend to show/hide series
# Create chart (D3.js/Vega-Lite based)
chart = sg.quick_bar(data, title="Analysis")

# Save as HTML
chart.save("analysis.html")

# Save as PNG/SVG (requires vega-cli)
chart.save("analysis.png")

# Save as JSON (Vega-Lite spec)
chart.save("analysis.json")

# Publication quality mode
chart = sg.quick_bar(data, publication_quality=True)
# Clone the repository
git clone https://github.com/Solvien-Open-Source/solvien-graph
cd solvien-graph

# Install in development mode
pip install -e .

# Run tests
python -m pytest tests/

License

MIT License

Contributing

We welcome your contributions! Please open an issue before sending a pull request.

Contact

You can open an issue for questions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solvien_graph-0.1.2-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file solvien_graph-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: solvien_graph-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for solvien_graph-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f357038fcdd73a7b2bb10010aa923c59ca098c695b069a19ee0069071197e588
MD5 e037a06d94b67133a48d3a1844c2fba3
BLAKE2b-256 dde2c259120cf3c1011cab31ce46308c2765a8d2c81c9201f518537ad898dbcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for solvien_graph-0.1.2-py3-none-any.whl:

Publisher: python-publish.yml on Solvien-Open-Source/solvien-graph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page