Lumen provides a framework for visual analytics, which allows users to build data-driven dashboards from a simple yaml specification

Overview

Lumen

Illuminate your data

Build Status Linux/MacOS/Windows Build Status
Coverage codecov
Latest dev release Github tag dev-site
Latest release Github release PyPI version lumen version conda-forge version defaults version
Docs gh-pages site
Support Discourse

Why Lumen?

The Lumen project provides a framework for visual analytics, which allows users to build data-driven dashboards from a simple yaml specification. The power of Lumen comes from the ability to leverage the powerful data intake, data processing and data visualization libraries available in the PyData ecosystem.

  • Data Intake: A flexible system for declaring data sources with strong integration with Intake, allows Lumen to query data from a wide range of sources including many file formats such as CSV or Parquet but also SQL and many others.
  • Data Proccessing: Internally Lumen stores data as DataFrame objects, allowing users to leverage familiar APIs for filtering and transforming data using Pandas while also providing the ability to scale these transformations out to a cluster thanks to Dask.
  • Data Visualization: Since Lumen is built on Panel all the most popular plotting libraries and many other components such as powerful datagrids and BI indicators are supported.

The core strengths of Lumen include:

  • Flexibility: The design of Lumen allows flexibly combining data intake, data processing and data visualization into a simple declarative pipeline.
  • Extensibility: Every part of Lumen is designed to be extended letting you define custom Source, Filter, Transform and View components.
  • Scalability: Lumen is designed with performance in mind and supports scalable Dask DataFrames out of the box, letting you scale to datasets larger than memory or even scale out to a cluster.
  • Security: Lumen ships with a wide range of OAuth providers out of the box, making it a breeze to add authentication to your applications.

Examples

London Bike Points
NYC Taxi
Palmer Penguins
Precipitation
Seattle Weather

Getting started

Lumen works with Python 3 and above on Linux, Windows, or Mac. The recommended way to install Lumen is using the conda command provided by Anaconda or Miniconda:

conda install -c pyviz lumen

or using PyPI:

pip install lumen

Once installed you will be able to start a Lumen server by running:

lumen serve dashboard.yaml --show

This will open a browser serving the application or dashboard declared by your yaml file in a browser window. During development it is very helpful to use the --autoreload flag, which will automatically refresh and update the application in your browser window, whenever you make an edit to the dashboard yaml specification. In this way you can quickly iterate on your dashboard.

Try it out! Click on one of the examples below, copy the yaml specification and launch your first Lumen application.

Comments
  • Renaming Target

    Renaming Target

    With the Lumen 0.5.0 release finally coming up we've got one last chance to fix naming mistakes in Lumen. One major sticking point has always been the Target component. This name came about as a natural pair to the data Source, where data would flow from source to target. However, even then it never really made sense and since there's been quite a lot of refactoring that more cleanly separates views, filters and transforms (which used to be grouped together on a target).

    This means that now a Target is defined as a component consisting of one or more view components that consume data from a pipeline and render the views into a layout. Therefore I suggest I finally pull the trigger and simply rename Target -> Layout. Alternatively I could also consider LayoutGroup as the name of the Python class but keep the YAML key as layouts.

    I'd like to collect everyone's opinion so please chime in @Hoxbro, @maximlt, @jbednar, @droumis, @jlstevens and @eli-pinkus.

    opened by philippjfr 9
  • Allow launching UI from CLI

    Allow launching UI from CLI

    Adds a lumen builder CLI command that launches a Bokeh/Panel server running the builder.

    • [x] Add tests
    • [x] Decide on naming of builder, is it ui, gui, or builder?
    opened by philippjfr 8
  • Create how to on custom local components

    Create how to on custom local components

    • [x] import a component by its module path, e.g. you can do my_library.some_module.MyTransform

    • Also made the install page more explicit about python installation after a good talk with @Hoxbro.

    • Also included some minor fixes like syntax highlighting and a couple of links

    127 0 0 1_5500_docs__build_html_how_to_local_components html (1)

    opened by droumis 5
  • Example for how to use variables

    Example for how to use variables

    It started with an example of how to use variables but failed with a verification error. This is fixed with 488ee9c5d935788602d1de50f4f8f93032040ee5.

    Though, I still get this warning WARNING:param.Source: Resolving nested variable references currently not supported. which I think is why I get no automatic update when changing the variable input.

    Maybe I'm doing something wrong with the specification.

    variables:
      ticker:
        type: widget
        kind: TextInput
        default: https://raw.githubusercontent.com/matplotlib/sample_data/master/aapl.csv
    
    sources:
      stock_data:
        type: file
        tables:
          ticker: $variables.ticker
    
    targets:
    - title: Table
      source: stock_data
      views:
        - type: table
          table: ticker
    
    opened by Hoxbro 5
  • Added suggestion for mistyped/wrong parameters

    Added suggestion for mistyped/wrong parameters

    It can be hard to know if something is transform or transforms. I have tried to take account of this by using difflib to come up with suggestions if parameters are mistyped/wrong.

    I have chosen to raise an error when an input parameter does not match the class parameters. My reasoning for this is that the error usually will arrive later, making it harder to debug.

    I have used the following example to see if I can provoke an error by adding or removing an s.

    from lumen.pipeline import Pipeline
    
    data_url = 'https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-07-28/penguins.csv'
    
    pipeline = Pipeline.from_spec({
        'source': {
            'type': 'file',
            'table': {
                'penguins': data_url
            }
        },
        'filters': [
            {'type': 'widget', 'field': 'species'},
            {'type': 'widget', 'field': 'island'},
            {'type': 'widget', 'field': 'sex'},
            {'type': 'widget', 'field': 'year'}
        ],
        'transforms': [
            {'type': 'aggregate', 'method': 'mean', 'by': ['species', 'sex', 'year']}
        ]
    })
    

    The example will raise an error (try to find out what raises it).

    Error message

    Before:

    image

    After:

    image

    opened by Hoxbro 5
  • ModuleNotFoundError: No module named 'panel.pane.perspective' when running lumen

    ModuleNotFoundError: No module named 'panel.pane.perspective' when running lumen

    I'm having trouble with an error message "ModuleNotFoundError: No module named 'panel.pane.perspective' " when attempting to launch lumen https://lumen.holoviz.org/index.html. error panel

    I have panel 0.11.0a8 installed through conda with pyviz/label/dev. Any insights please?

    opened by eschares 5
  • Add ability to generate specification

    Add ability to generate specification

    All components currently implement .from_spec methods which instantiate the component from the declarative specification. We want to be able to do the reverse and construct a specification from component instances by implementing .to_spec methods.

    For all the basic component types this should be fairly straightforward, e.g. a Source, View or Filter simply has to serialize it's parameters and its type. It becomes a little more difficult if we are dealing with references and variables because View.pipeline should generally not inline and serialize the entire Pipeline specification.

    def to_spec(self, allow_refs=True):
        """
        Converts the component to a declarative specification that can be serialized to YAML.
        Whether sub-component definitions are inlined depends on the type of component,
        e.g. Filter and Transform components will be inlined on a Pipeline but a Pipeline will
        not be inlined on a View.
    
        Arguments
        -----------
        allow_refs: boolean
          Whether to allow exporting references or to inline the materialized values.
    
        Returns
        --------
        Declarative specification containing the definition of this component.
        """
    

    Goals

    • We can serialize all component types individually but also a whole Dashboard or Pipeline definition.
    • We can handle references and variables
    • The exported specification faithfully roundtrips to an identical instance, i.e. we can go from instance -> specification -> instance and end up with an identical copy.
    opened by philippjfr 4
  • Various improvements to the DateFilter widget

    Various improvements to the DateFilter widget

    Includes various fixes to the DateFilter:

    • On picker mode cast start/end/value to datetime.date
    • Override the value Parameter by a CalendarDate or DateRange Parameters (let me know if there's a better way, that looks hacky!)
    • Bidirectionally link the widget to the value Parameter, this allows URL query parameter changes to be synced back to the widget.

    This is work in progress and requires other changes both in Param and Panel. I've also noticed accumulating calls in get_data on picker mode so there's something wrong there.

    opened by maximlt 4
  • Display selected custom view parameters as widgets

    Display selected custom view parameters as widgets

    This issue summarizes some discussion I've had with @philippjfr and @jbednar about how best to generate widgets for custom view parameters. Here are the three options we talked about:

    1. Use param precedence according to the usual panel semantics when converting parameters to widgets.
    2. Declaring constant=True for the parameters that shouldn't be shown as widgets.
    3. Explicitly list which parameters should become widgets (by name) in the yaml declaration.

    Personally, I like option 3 the most as it is the most explicit and lets you easily set the widget order in the yaml. Then I like option 1 as it is consistent with how panel displays widgets for parameters and I like option 3 the least.

    opened by jlstevens 4
  • Gracefully Handle Multiple Extensions or Assert an Error Message

    Gracefully Handle Multiple Extensions or Assert an Error Message

    If different views are used (for example Perspective with Holoviews), the dashboard doesn’t build, as two separate extensions are needed.

    It would be nice if the various extensions could be gracefully handled, if not an assertion error on crossing multiple extensions would be nice for users to understand the error instead of the dashboard not displaying anything.

    opened by tlmille2 4
  • Add functionality to manually apply updates

    Add functionality to manually apply updates

    Adds a manual_update option to the global config, each Target and Pipeline to be able to manually update the data using a button click. This is useful when applying a filter or transform is very slow.

    apply_update

    • [x] Add tests
    • [x] Decide on naming of manual_update parameter
    opened by philippjfr 3
  • Make

    Make "non-standard" keywords in methods keyword-only arguments

    Some methods in Lumen need different inputs depending on the class it is called from. An example of this could be from_spec, the example below. I would like to see these non-standard keywords being keyword-only arguments, so passing in the wrong arguments is impossible.

    https://github.com/holoviz/lumen/blob/95809959b18eb31d069c084f4fabdefbc2cfb05e/lumen/views/base.py#L267-L269

    https://github.com/holoviz/lumen/blob/95809959b18eb31d069c084f4fabdefbc2cfb05e/lumen/dashboard.py#L299

    opened by Hoxbro 0
  • Host CSV dataset ourself

    Host CSV dataset ourself

    Currently, the penguins' dataset (https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-07-28/penguins.csv) is used extensively in the new documentation.

    It should be added to this repo or an S3 (which we control).

    opened by Hoxbro 2
  • Added threadpool to WebsiteSource

    Added threadpool to WebsiteSource

    I just thought it made a lot of sense to check the websites asynchronously.

    I have set a 10 seconds timeout, which could be removed again or given as a parameter.

    opened by Hoxbro 1
  • Make it possible to programmatically unselect/reset widget filter in a Notebook Pipeline

    Make it possible to programmatically unselect/reset widget filter in a Notebook Pipeline

    Once a widget filter has been selected in a Lumen Pipeline within a notebook, there is no way to programmatically unselect or reset the filter.

    ALL software version info

    lumen: 0.5.0a64

    Description of expected behavior and the observed behavior

    A way to programmatically unselect options in a widget filter. @Hoxbro suggested: pipeline.reset_filters()

    Complete, minimal, self-contained example code that reproduces the issue

    import lumen
    from lumen.views import Table
    from lumen.pipeline import Pipeline
    import panel as pn
    
    pn.extension('tabulator', template='fast')
    
    data_url = 'https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-07-28/penguins.csv'
    
    pipeline = Pipeline.from_spec({
        'source': {
            'type': 'file',
            'tables': {
                'penguins': data_url
            }
        },
        'filters': [
            {'type': 'widget', 'field': 'species'},
            {'type': 'widget', 'field': 'island'},
            {'type': 'widget', 'field': 'sex'},
            {'type': 'widget', 'field': 'year'}
        ],
        'transforms': [
            {'type': 'aggregate', 'method': 'mean', 'by': ['sex', 'year']}
        ]
    })
    
    pn.Row(pipeline.control_panel, Table(pipeline=pipeline, pagination='remote'))
    

    Screenshots or screencasts of the bug in action

    Screenshot 2022-09-21 at 17 33 02 enhancement 
    opened by droumis 4
  • Add more Sources tests

    Add more Sources tests

    Changes addressed in this PR:

    • split catalog to different files to test IntakeSource and IntakeSQLSource separately
    • move tests for FileSource to a new file
    • add tests to JSONSource
    • add tests to JoinedSource
    • move common testing logics to a utils file
    • test Source.from_spec when loading from source in state.sources

    Bug fixes:

    • JSONSource._resolve_template_vars(): convert template to string to make sure re.findall(template) work properly. Currently, a local file path will be read as a pathlib.PosixPath object: https://github.com/holoviz/lumen/blob/master/lumen/sources/base.py#L528
    opened by thuydotm 1
Releases(v0.5.0)
  • v0.4.1(Apr 23, 2021)

  • v0.4.0(Apr 23, 2021)

    (Relatively) major release:

    New features:

    • Handle errors while rendering dashboard (#131)
    • Defer rendering of dashboard contents until page is rendered (#123)
    • Add Melt transform (#122)
    • Implement DerivedSource with ability to filter and transform existing sources (#121)
    • Add caching to DerivedSource
    • Use Datetime pickers (#119)

    Bugfixes and minor improvements:

    • Clear original source cache on DerivedSource
    • Allow providing custom Download labels (#130)
    • Fix handling of range filters (#129)
    • Unpack panes correctly on Views (#128)
    • Fixed dask kwarg on JSONSource (#127)
    • Pin python3.8 in conda build env
    • Ensure None on widget filter is handled (#120)
    • Improve docs (#112)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.2(Apr 23, 2021)

  • v0.3.1(Apr 23, 2021)

    Minor release:

    • Updated dependencies
    • Add Download options to targets (#110)
    • Make editable a configurable option (#109)
    • Improve docs (#107, #108)
    • Gracefully handle missing dask and parquet libraries (#105)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Mar 17, 2021)

  • v0.1.0(Oct 15, 2020)

    This is the first public release of the Lumen project, which provides a framework to build dashboards from a simple yaml specification. It is designed to query information from any source, filter it in various ways and then provide views of that information, which can be anything from a simply indicator to a table or plot.

    For now the Lumen project is available only from conda and can be installed with conda install -c pyviz/label/dev lumen.

    Source code(tar.gz)
    Source code(zip)
Owner
HoloViz
High-level tools to simplify visualization in Python
HoloViz
Quickly and accurately render even the largest data.

Turn even the largest data into images, accurately Build Status Coverage Latest dev release Latest release Docs Support What is it? Datashader is a da

HoloViz 2.9k Dec 28, 2022
Some problems of SSLC ( High School ) before outputs and after outputs

Some problems of SSLC ( High School ) before outputs and after outputs 1] A Python program and its output (output1) while running the program is given

Fayas Noushad 3 Dec 01, 2021
Minimalistic tool to visualize how the routes to a given target domain change over time, feat. Python 3.10 & mermaid.js

Minimalistic tool to visualize how the routes to a given target domain change over time, feat. Python 3.10 & mermaid.js

Péter Ferenc Gyarmati 1 Jan 17, 2022
Runtime analysis of code with plotting

Runtime analysis of code with plotting A quick comparison among Python, Cython, and the C languages A Programming Assignment regarding the Programming

Cena Ashoori 2 Dec 24, 2021
Create charts with Python in a very similar way to creating charts using Chart.js

Create charts with Python in a very similar way to creating charts using Chart.js. The charts created are fully configurable, interactive and modular and are displayed directly in the output of the t

Nicolas H 68 Dec 08, 2022
Complex heatmaps are efficient to visualize associations between different sources of data sets and reveal potential patterns.

Make Complex Heatmaps Complex heatmaps are efficient to visualize associations between different sources of data sets and reveal potential patterns. H

Zuguang Gu 973 Jan 09, 2023
Sentiment Analysis application created with Python and Dash, hosted at socialsentiment.net

Social Sentiment Dash Application Live-streaming sentiment analysis application created with Python and Dash, hosted at SocialSentiment.net. Dash Tuto

Harrison 456 Dec 25, 2022
Joyplots in Python with matplotlib & pandas :chart_with_upwards_trend:

JoyPy JoyPy is a one-function Python package based on matplotlib + pandas with a single purpose: drawing joyplots (a.k.a. ridgeline plots). The code f

Leonardo Taccari 462 Jan 02, 2023
Geospatial Data Visualization using PyGMT

Example script to visualize topographic data, earthquake data, and tomographic data on a map

Utpal Kumar 2 Jul 30, 2022
Small U-Net for vehicle detection

Small U-Net for vehicle detection Vivek Yadav, PhD Overview In this repository , we will go over using U-net for detecting vehicles in a video stream

Vivek Yadav 91 Nov 03, 2022
A streamlit component for bi-directional communication with bokeh plots.

Streamlit Bokeh Events A streamlit component for bi-directional communication with bokeh plots. Its just a workaround till streamlit team releases sup

Ashish Shukla 123 Dec 25, 2022
Graphical visualizer for spectralyze by Lauchmelder23

spectralyze visualizer Graphical visualizer for spectralyze by Lauchmelder23 Install Install matplotlib and ffmpeg. Put ffmpeg.exe in same folder as v

Matthew 1 Dec 21, 2021
Python ts2vg package provides high-performance algorithm implementations to build visibility graphs from time series data.

ts2vg: Time series to visibility graphs The Python ts2vg package provides high-performance algorithm implementations to build visibility graphs from t

Carlos Bergillos 26 Dec 17, 2022
2D maze path solver visualizer implemented with python

2D maze path solver visualizer implemented with python

SS 14 Dec 21, 2022
Package managers visualization

Software Galaxies This repository combines visualizations of major software package managers. All visualizations are available here: http://anvaka.git

Andrei Kashcha 1.4k Dec 22, 2022
coordinate to draw the nimbus logo on the graffitiwall

This is a community effort to draw the nimbus logo on beaconcha.in's graffitiwall. get started clone repo with git clone https://github.com/tennisbowl

4 Apr 04, 2022
Turn a STAC catalog into a dask-based xarray

StackSTAC Turn a list of STAC items into a 4D xarray DataArray (dims: time, band, y, x), including reprojection to a common grid. The array is a lazy

Gabe Joseph 148 Dec 19, 2022
Visualize the bitcoin blockchain from your local node

Project Overview A new feature in Bitcoin Core 0.20 allows users to dump the state of the blockchain (the UTXO set) using the command dumptxoutset. I'

18 Sep 11, 2022
An animation engine for explanatory math videos

Powered By: An animation engine for explanatory math videos Hi there, I'm Zheer 👋 I'm a Software Engineer and student!! 🌱 I’m currently learning eve

Zaheer ud Din Faiz 2 Nov 04, 2021
An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden.

sweden-rent-dashboard An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden. The dashboard/web

Rory Crean 5 Dec 19, 2021