Skip to main content

A human-oriented visualization library with unified interface across multiple backends

Project description

fmus-viz: A Human-Oriented Visualization Library

Python 3.8+ License: MIT

fmus-viz is a human-oriented visualization library that provides a unified interface across multiple backend visualization engines. It focuses on intuitive API design, smart defaults, and a great developer experience.

Features

  • Unified Interface: A single API that works with multiple visualization backends
  • Human-Oriented Design: Intuitive and memorable function names and parameters
  • Smart Defaults: Sensible defaults that "just work" for most use cases
  • Backend Flexibility: Switch between Matplotlib, Plotly, and Seaborn seamlessly
  • Method Chaining: Fluent interface for customizing visualizations
  • Rich Visualization Types: Basic charts and statistical visualizations

Installation

# Basic installation with minimal dependencies
pip install fmus-viz

# Install with specific backend support
pip install fmus-viz[matplotlib]
pip install fmus-viz[plotly]

# Install with all backends
pip install fmus-viz[all]

Quick Start

import fmus_viz as viz
import pandas as pd
import numpy as np

# Create sample data
data = pd.DataFrame({
    'category': ['A', 'B', 'C', 'D', 'E'],
    'value': [10, 15, 7, 12, 9]
})

# Basic bar chart
viz.bar(data, x='category', y='value').show()

# Switch to Plotly backend for interactive plots
viz.set_backend('plotly')
viz.line(data, x='category', y='value').title('Category Values').show()

# Method chaining for customization
viz.scatter(data, x='category', y='value')\
   .color('blue')\
   .title('Scatter Plot Example')\
   .xlabel('Categories')\
   .ylabel('Values')\
   .show()

# Statistical visualizations
grouped_data = pd.DataFrame({
    'category': ['A', 'B', 'C'] * 100,
    'value': np.random.randn(300) * 10 + 50
})

viz.boxplot(grouped_data, x='category', y='value').show()

# Correlation matrix
corr_data = pd.DataFrame(np.random.rand(50, 4), columns=['a', 'b', 'c', 'd'])
viz.corr(corr_data, annot=True).show()

Available Backends

Matplotlib Backend (Default)

Static visualizations with high-quality output for scientific and publication-ready figures.

import fmus_viz as viz
viz.set_backend('matplotlib')
viz.bar(data, x='category', y='value')

Plotly Backend

Interactive visualizations with dynamic features like zoom, pan, and hover tooltips. Ideal for dashboards and web applications.

import fmus_viz as viz
viz.set_backend('plotly')
viz.scatter(data, x='x', y='y', title='Interactive Scatter Plot')

Seaborn Backend

Statistical visualizations with beautiful default styling built on top of Matplotlib.

import fmus_viz as viz
viz.set_backend('seaborn')
viz.boxplot(data, x='category', y='value')

Supported Chart Types

Basic Charts

  • bar() - Vertical bar chart
  • barh() - Horizontal bar chart
  • line() - Line chart
  • scatter() - Scatter plot
  • histogram() - Histogram
  • pie() - Pie chart
  • area() - Area chart

Statistical Charts

  • boxplot() - Box plot with optional grouping
  • violin() - Violin plot
  • heatmap() - 2D heatmap
  • corr() - Correlation matrix heatmap
  • density() - Kernel density estimation (1D/2D)
  • regression() - Linear regression with confidence interval

Backend Status

Backend Status Charts
Matplotlib ✅ Implemented All basic + statistical
Plotly ✅ Implemented All basic + statistical
Seaborn ✅ Implemented All basic + statistical

Planned Features

Future releases will include:

  • Geospatial: map, choropleth
  • Network: graph, tree
  • 3D: surface, scatter3d
  • Additional Backends: Bokeh, Altair

Examples

The examples/ directory contains scripts demonstrating different features:

# Run verification to test all features
python examples/verify_implementation.py

# Basic charts example
python examples/basic_charts.py

# Plotly interactive features
python examples/plotly_interactive_features.py

# Plotly example
python examples/plotly_example.py

Documentation

Full documentation is available at https://fmus-viz.readthedocs.io.

Testing

The project includes a comprehensive test suite with 180+ tests covering all functionality:

# Run all tests
pytest tests/ -v

# Run specific test modules
pytest tests/test_api/test_statistical.py -v
pytest tests/test_backends/test_matplotlib.py -v

# Run with coverage
pytest tests/ --cov=fmus_viz --cov-report=html

Verification

Run the verification script to test all features:

python examples/verify_implementation.py

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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.

fmus_viz-0.1.0-py3-none-any.whl (42.9 kB view details)

Uploaded Python 3

File details

Details for the file fmus_viz-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fmus_viz-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 42.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for fmus_viz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 123061b239c931672699f2d31c4734aacefac511b2a84b1fff469f9e34601cf5
MD5 fb273555e6657f2748a900d0402ff323
BLAKE2b-256 9d47ba60c329f87d6eb7ca9fee3c3989872b31210e4284544f463b7e9f1de086

See more details on using hashes here.

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