holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.69k stars 402 forks source link

Support for KPIs, metrics, statistics, indicators, etc. #4363

Open jbednar opened 4 years ago

jbednar commented 4 years ago

I think most people think of HoloViews as a plotting library, primarily generating graphical outputs, but in many cases people also want single numbers or small sets of numbers displayed alongside or even instead of a plot. At some point even complex datasets get distilled down into a few key performance indicators (KPIs), metric values, statistics, or other indicators, and it would be convenient to be able to integrate those easily into a HoloViews layout, as is commonly done in business-intelligence dashboards:

image imageimageimageimage image

The above examples typically focus on targets or expectations, highlighting values not matching those expectations or targets, but similar displays are also useful for purely informative or scientific purposes, reporting custom metrics or standard statistics like mean, variance, range, etc., often alongside a plot or set of plots.

Features like this could be added at the dashboarding level, in a tool like Panel, but there's also an argument for putting them into HoloViews. Specifically, it would be really useful to show indicators alongside plots that respect the new HoloViews support for Python-based linked brushing. The indicator would report the metric/KPI/statistic for the full dataset by default, but if that component is linked to others with link_selections, it would respect the selection and instead report values for the selected area. This support would make it very simple to interactively explore the properties of datasets, iteratively selecting datapoints of interest and seeing how they compare to each other and to the full dataset along various measures.

I would favor adding a couple of new Element types to HoloViews that can display such statistics or metrics, preferably driven by replayable pipelines so that they can be integrated easily into link_selections layouts. I'm not sure how the various representations above would map onto different Element types or simply different plot options; there may be just one main Element with a single length-one value dimension, but then additional optional dimensions that specify various ranges that could then map onto speedometers, traffic lights, etc. depending on plot options. I'm not sure how target values or target value ranges would be supplied, i.e. whether those are additional value dimensions or plot option values. But it seems like this basic functionality could be wrapped up nicely in a way that integrates well with the rest of HoloViews and makes it much easier to add detailed numerics to HoloViews layouts.

MarcSkovMadsen commented 4 years ago

There is a user request here https://discourse.holoviz.org/t/how-to-create-a-semi-pie-chart-with-percentage/840/2

image

philippjfr commented 4 years ago

I've started work on this and should have a PR with a number of basic indicators by next week.