lumen icon indicating copy to clipboard operation
lumen copied to clipboard

Standalone use of lumen components, e.g. in a notebook

Open jbednar opened this issue 4 years ago • 2 comments

Right now, the Lumen docs focus exclusively on building a complete dashboard, but Lumen also seems useful as a declarative, text-based specification for individual plots and layouts, whether to create a figure as output (HTML, PNG, SVG) or just for interactive use in a notebook. Notebooks seem useful for exploring datasets in a more flexible way than in a complete Lumen Dashboard, and seem like a good way to interactively develop new custom Lumen components. Plus we want to make it simple for people to start with some working examples (e.g. a Lumen Dashboard) and then drive them further (e.g. putting those components into a fully custom Panel app) without having to start over. (Short cuts, not dead ends!)

It looks like there is a way to construct a Source object and pass it to a View constructor to get a plot, but it would be helpful to have a documentation section explaining how to do this and possibly make it cleaner.

jbednar avatar Apr 14 '21 15:04 jbednar

I'm working on refactoring my panel app into a lumen-based app: https://github.com/Jhsmit/PyHDX/pull/188

So far I've got it mostly working. I think the biggest difference between my use case and a dashboard is that I do not have the data to be visualized before I launch the app, Instead, users upload data and input variables which then generates more data to visualize.

So I've made a couple of changes:

  • new DataFrameSource object which has (multiindex) dataframes as tables and where new dataframes can be added
  • Filters, Transforms and Sources all have an updated param
  • Transforms also have widgets
  • Filters can depend on eachother and be chained (eg filter1 filters based on some condition, then filter2 populates its widgets depending on filtered result)
  • My views use streaming, and when no data is available yet upon loading the app, they use a dataframe from their empty_df property such that the Pipe can be initialized.
  • Addition of an Opts object which can be passed to views such that opts can be controlled in the GUI via plot.apply(**self.opts)

In the end, all instances of filters, views, transforms, opts and sources are collected in dicts on my main controller object. This object binds watchers to filters.value or tranforms.updated such that it can trigger updating of view. These dicts are then also available for the side controllers which pick and choose widgets to layout in their Card, as specified by the _layout property

Its all a bit early stage and messy but it might help to see what people do/are trying to do with lumen. Also looking at the latest developments here I think some of the things I've implemented are now part of lumen, such as controlling parameters of view. Selecting which columns to plot was something I wanted to do, probably through a filter.

Jhsmit avatar Apr 19 '21 17:04 Jhsmit

Sounds interesting, but should probably be a separate issue (and PR??) from this one!

jbednar avatar Apr 20 '21 13:04 jbednar

With the addition of Pipeline objects to encapsulate data filtering and transformations and programmatic APIs to use all the components in Lumen I will consider this closed. Further documentation about this coming.

philippjfr avatar Dec 05 '22 18:12 philippjfr

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Jul 11 '23 06:07 github-actions[bot]