Skip to main content

mcda-viz

Visualization library for the MCDA Python ecosystem. Provides interactive Dash dashboards and Plotly plots for exploring and presenting MCDA results.

Built on mcda-core, maintained by the SMG research group at ULB.

Installation

pip install mcda-viz

Method-specific dashboards require the corresponding library as an extra:

pip install mcda-viz[promethee]   # PrometheeDashboard — adds mcda-promethee

Future extras will follow the same pattern as new method libraries are added to the ecosystem.

Python ≥ 3.9.

Quick start

PROMETHEE dashboard

from mcda_core import PerformanceTable
from promethee import PrometheeII
from promethee.preferences.parameters import ParametersPromethee
from mcda_viz import PrometheeDashboard

table = PerformanceTable(...)
params = ParametersPromethee(...)
result = PrometheeII(table, params)
PrometheeDashboard(result, title="My analysis").run(debug=True)

MAUT dashboard

from mcda_methods import MAUT
from mcda_viz import MAUTAnalysisDashboard

maut = MAUT(table, params)
MAUTAnalysisDashboard(maut, title="MAUT Analysis").run(debug=True)

See example_dashboards/ for complete runnable examples with real datasets.

What's included

Dashboards

class description
PrometheeDashboard GAIA plane + net flows parallel coordinates plot; live recomputation when weights or preference functions change
MAUTAnalysisDashboard Parallel coordinates in evaluation and utility space; criterion-wise A vs B comparison; utility function plots

Both dashboards include:

  • Alternative filter / ranking checklist (doubles as a selection panel)
  • Highlight panel — assign any CSS colour to any alternative
  • Weight sliders with automatic normalisation

Plots

Standalone Plotly figure builders — usable outside of a dashboard:

class / function description
GaiaPlanePlot Biplot of PROMETHEE GAIA projected coordinates
ParallelPlot Parallel coordinates for raw performance tables or utility space
MAUTComparisonPlot Criterion-wise weighted utility difference between two alternatives
build_maut_utility_plots List of piecewise-linear utility function curves, one per criterion

All plot classes expose a build_figure() method returning a plotly.graph_objects.Figure.

from mcda_viz import GaiaPlanePlot
from promethee import PrometheeGAIA

gaia = PrometheeGAIA(performance_table=table, parameters=params)

fig = GaiaPlanePlot(
    gaia,
    visible_alternatives=["A", "B", "C"],   # optional subset
    highlight={"A": "red"},                  # optional colour map
).build_figure()   # plotly Figure — display in notebook or export

Components (building blocks for custom dashboards)

Each panel inside the built-in dashboards is a standalone DashboardComponent subclass. You can assemble them freely to build your own dashboard:

component description
AlternativeSelectorComponent A / B dropdown for pairwise comparison
AlternativeFilterComponent Text-based alternative filter
ComparisonDescriptionComponent Textual summary of A vs B weighted utility difference
CriterionPlotsComponent Scrollable row of criterion utility function plots
GaiaPlanePlotComponent GAIA plane wrapped as a Dash component
HighlightComponent Colour picker — assign colours to alternatives
LegendComponent Colour legend panel
ParallelPlotComponent Parallel coordinates wrapped as a Dash component
ParametersComponent Weight sliders and preference function selectors (PROMETHEE)
RankingChecklistComponent Ranked list with checkboxes for filtering
RankingComponent Read-only ranked list
StoreComponent Invisible dcc.Store for shared dashboard state

Architecture

src/mcda_viz/
├── dashboards/
│   ├── core/          # BaseDashboard, DashboardComponent, DashboardState, shared IDs
│   ├── components/    # Reusable Dash components
│   ├── maut_analysis_dashboard.py
│   └── promethee_dashboard.py
├── plots/             # Pure Plotly figure builders
└── base/              # Shared plot utilities

DashboardState is a lightweight container (alternative names, criterion names, and optionally scores and ranking) instantiated once per dashboard and injected into every component that needs it.

BaseDashboard provides shared callbacks (highlight apply/reset, weight normalisation) and a Dash app factory. Subclass it to build a custom dashboard:

import dash_bootstrap_components as dbc
from dash import html
from mcda_viz import BaseDashboard, DashboardState, HighlightComponent, StoreComponent

class MyDashboard(BaseDashboard):
    def __init__(self, alternative_names, criteria_names):
        self.state = DashboardState(
            alternative_names=alternative_names,
            criteria_names=criteria_names,
        )
        self.app = self._create_app("My Dashboard")
        self.store_component = StoreComponent()
        self.highlight_component = HighlightComponent(self.state)
        self.app.layout = dbc.Container([
            self.store_component.layout(),
            self._header_row(),
            self.highlight_component.layout(),
        ])
        self._register_highlight_callback(self.app)

    def run(self, **kwargs):
        self.app.run(**kwargs)

Ecosystem

Part of the modular MCDA Python ecosystem built on mcda-core. See mcda-core for the full list of compatible libraries.

License

MIT — see LICENSE.

Metadata

Release files for mcda-viz 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcda-viz 0.3.0
File Size Uploaded Provenance Actions
mcda_viz-0.3.0.tar.gz 40.4 kB Without provenance Details for mcda_viz-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcda-viz 0.3.0
File Interpreter ABI Platform Actions
mcda_viz-0.3.0-py3-none-any.whl Python 3 none any Details for mcda_viz-0.3.0-py3-none-any.whl

Total release size: 90.2 kB

Release files / mcda_viz-0.3.0.tar.gz

Download URL mcda_viz-0.3.0.tar.gz
Size 40.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a5c471bea774b67f05b87d0a038f2f489c8c39341e0b6d8fc08ace25cf60c2ff
BLAKE2b-256 checksum
How to use checksums
60d8c1bad4ca9114e4aa59d66fcf3afd56b5ea714a05f68f837fdf0615e038ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.20

Release files / mcda_viz-0.3.0-py3-none-any.whl

Download URL mcda_viz-0.3.0-py3-none-any.whl
Size 49.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b82028fab9f2aa2e1d108d45470c02c67ce0b59f16b7de5914cead355c3d5c5
BLAKE2b-256 checksum
How to use checksums
675a7df2ea6f80863c898ffe948680439919b765c937a07040ab4031c00a8d24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.20

Security for mcda-viz 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page