Giter Site home page Giter Site logo

danielfrg / jupyter-flex Goto Github PK

View Code? Open in Web Editor NEW
311.0 8.0 54.0 91.49 MB

Build dashboards using Jupyter Notebooks

Home Page: https://jupyter-flex.danielfrg.com

License: Apache License 2.0

HTML 3.18% Python 12.08% JavaScript 56.32% Shell 0.13% SCSS 13.02% Jinja 15.27%
dashboards jupyter-notebooks interactive-dashboards react jupyter python

jupyter-flex's Introduction

Documentation ยท Installation

Build dashboards using Jupyter Notebooks

  • Use Markdown headers and Jupyter Notebook cell tags to define the dashboard layout and its components
  • Flexible and easy way to specify row and column based layouts
  • Use nbconvert to create static reports
  • Use Voila to start a live Jupyter Kernel for fully dynamic applications
  • Support for Jupyter widgets

Jupyter-flex: Movie Explorer Jupyter-flex: NBA Scoring Jupyter-flex: Bokeh plots

Installation

pip install jupyter-flex

Documentation

Learn more in the jupyter-flex documentation.

Contributing

See CONTRIBUTING.md.

jupyter-flex's People

Contributors

agoose77 avatar danielfrg avatar dependabot[bot] avatar ocefpaf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jupyter-flex's Issues

jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'cards'

Hey @danielfrg !

Just tried flex for the first time. I was able to easily reproduce the Plotly example in the docs. However, when I tried applying it to an already existing notebook I got the following Jinja exception. Since you are the author of this tool, I think you can probably tell what went wrong here. Let me know if this is an easy fix as I was looking forward to applying this to an existing project, as a POC.

๐Ÿš€๐Ÿš€๐Ÿš€

$ jupyter nbconvert --to flex eda.ipynb
[NbConvertApp] Converting notebook eda.ipynb to flex
Traceback (most recent call last):
  File "/opt/miniconda3/bin/jupyter-nbconvert", line 11, in <module>
    sys.exit(main())
  File "/opt/miniconda3/lib/python3.8/site-packages/jupyter_core/application.py", line 254, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/miniconda3/lib/python3.8/site-packages/traitlets/config/application.py", line 845, in launch_instance
    app.start()
  File "/opt/miniconda3/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 350, in start
    self.convert_notebooks()
  File "/opt/miniconda3/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 524, in convert_notebooks
    self.convert_single_notebook(notebook_filename)
  File "/opt/miniconda3/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 489, in convert_single_notebook
    output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
  File "/opt/miniconda3/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 418, in export_single_notebook
    output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
  File "/opt/miniconda3/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 181, in from_filename
    return self.from_file(f, resources=resources, **kw)
  File "/opt/miniconda3/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 199, in from_file
    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
  File "/opt/miniconda3/lib/python3.8/site-packages/nbconvert/exporters/html.py", line 119, in from_notebook_node
    return super().from_notebook_node(nb, resources, **kw)
  File "/opt/miniconda3/lib/python3.8/site-packages/nbconvert/exporters/templateexporter.py", line 384, in from_notebook_node
    output = self.template.render(nb=nb_copy, resources=resources)
  File "/opt/miniconda3/lib/python3.8/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/opt/miniconda3/lib/python3.8/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/opt/miniconda3/share/jupyter/nbconvert/templates/flex/index.html.j2", line 1, in top-level template code
    {%- import "flex.j2" as flex with context -%}
  File "/opt/miniconda3/lib/python3.8/site-packages/jinja2/environment.py", line 1412, in make_module
    return TemplateModule(self, ctx)
  File "/opt/miniconda3/lib/python3.8/site-packages/jinja2/environment.py", line 1542, in __init__
    body_stream = list(template.root_render_func(context))  # type: ignore
+  File "/opt/miniconda3/share/jupyter/nbconvert/templates/flex/flex.j2", line 238, in top-level template code
+    {%- set _ = vars.current_section["cards"].append(vars.current_card) -%}
  File "/opt/miniconda3/lib/python3.8/site-packages/jinja2/environment.py", line 474, in getattr
    return getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'cards'

Installation Error

Hi, Jupyter Flex looks fantastic. I am having trouble installing it though. Could you provide any guidance on the following error? Thank you.

root@8a150ab6e4a1:~# pip install jupyter-flex
Collecting jupyter-flex
  Downloading jupyter-flex-0.6.1.tar.gz (6.6 MB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 6.6 MB 14.3 MB/s
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/conda/bin/python3.7 /opt/conda/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-qdhcreck/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=42' 'setuptools_scm[toml]>=3.4' wheel
       cwd: None
  Complete output (44 lines):
  Traceback (most recent call last):
    File "/opt/conda/lib/python3.7/runpy.py", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "/opt/conda/lib/python3.7/runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "/opt/conda/lib/python3.7/site-packages/pip/__main__.py", line 26, in <module>
      sys.exit(_main())
    File "/opt/conda/lib/python3.7/site-packages/pip/_internal/cli/main.py", line 73, in main
      command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
    File "/opt/conda/lib/python3.7/site-packages/pip/_internal/commands/__init__.py", line 104, in create_command
      module = importlib.import_module(module_path)
    File "/opt/conda/lib/python3.7/importlib/__init__.py", line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
    File "<frozen importlib._bootstrap>", line 983, in _find_and_load
    File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
    File "<frozen importlib._bootstrap_external>", line 728, in exec_module
    File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
    File "/opt/conda/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 24, in <module>
      from pip._internal.cli.req_command import RequirementCommand, with_cleanup
    File "/opt/conda/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 16, in <module>
      from pip._internal.index.package_finder import PackageFinder
    File "/opt/conda/lib/python3.7/site-packages/pip/_internal/index/package_finder.py", line 21, in <module>
      from pip._internal.index.collector import parse_links
    File "/opt/conda/lib/python3.7/site-packages/pip/_internal/index/collector.py", line 14, in <module>
      from pip._vendor import html5lib, requests
    File "/opt/conda/lib/python3.7/site-packages/pip/_vendor/requests/__init__.py", line 114, in <module>
      from . import utils
    File "/opt/conda/lib/python3.7/site-packages/pip/_vendor/requests/utils.py", line 25, in <module>
      from . import certs
    File "/opt/conda/lib/python3.7/site-packages/pip/_vendor/requests/certs.py", line 15, in <module>
      from pip._vendor.certifi import where
    File "/opt/conda/lib/python3.7/site-packages/pip/_vendor/certifi/__init__.py", line 1, in <module>
      from .core import contents, where
    File "/opt/conda/lib/python3.7/site-packages/pip/_vendor/certifi/core.py", line 12, in <module>
      from importlib.resources import read_text
    File "/opt/conda/lib/python3.7/importlib/resources.py", line 11, in <module>
      from typing import Iterable, Iterator, Optional, Set, Union   # noqa: F401
    File "/opt/conda/lib/python3.7/site-packages/typing.py", line 1357, in <module>
      class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
    File "/opt/conda/lib/python3.7/site-packages/typing.py", line 1005, in __new__
      self._abc_registry = extra._abc_registry
  AttributeError: type object 'Callable' has no attribute '_abc_registry'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/conda/bin/python3.7 /opt/conda/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-qdhcreck/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=42' 'setuptools_scm[toml]>=3.4' wheel Check the logs for full command output.

Read Jupyter's magic cell

Hi,

I'm using Jupyter's magic cells to run, say a JS file.
I noticed that the magic cell is skipped and therefore not run when the nb is run through Jupyter-flex. Is there a way to work it through or a method to run it that I'm not aware of?
image
Looking forward for your answer!

Cheers,
Zaid

Jupyter-flex installation loop: "git" was not found

I attempted to install Jupyter Flex using the following command:

pip install jupyter-flex

The jupyter-flex-0.6.3.tar.gz downloads properly at 7.5 MB. "Installing build dependencies" starts and ends successfully. Requirements for building the wheel starts and ends successfully. The installation fails at "Preparing wheel metadata...error". The error is quite long and ends with "git" was not found.

error

The process starts over (loops), failing at the same location.

v0.8.0 can't be installed via pip or conda simply.

I had a problem where a notebook was rendering different on my machine compared to a colleague's. I noticed we had different versions of jupyter-flex installed. I tried to upgrade mine 0.6.2 -> 0.8.0 using pip, but 0.8.0 wasn't available that way. I tried to upgrade via conda, and it also wasn't immediately available.

Pip commands I tried:
pip install jupyter-flex
pip install --upgrade jupyter-flex
pip install jupyter-flex==0.8.0

conda commands I tried:
conda upgrade jupyter-flex
conda install jupyter-flex==0.8.0

The failed upgrade via conda said I could search for the package I wanted at conda.org, where I found a new command:
conda install -c conda-forge jupyter-flex

The new command showed a bunch of conflicts, which surprised me because I'm working from a relatively simple and new environment. See attached for the error details for the conflicts. I expected the install command to resolve the inconsistencies (maybe that was a little ambitious!).

jupyter inconsistencies

Can we not get flex html output with a ipywidget in jupyter-flex?

Hi everyone, this is not an issue as per say, but an enquiry.
I am trying to output a ipywidget inside the dashboard. I can host it using "jupyter-flex notebook.ipynb" and the widget shows up. But when I try to download as flex(HTML). It says "loading widget" and stays like that.
Is this an issue or it cannot be done in a html file? Like, we cannot add ipywidgets in the html files that can downloaded and shared?

Package versions:
jupyter 1.0.0
jupyter-client 7.1.2
jupyter-console 6.4.0
jupyter-core 4.9.1
jupyter-flex 0.8.0
jupyter-lsp 1.5.1
jupyter-server 1.13.5
jupyterlab 3.2.9
jupyterlab-lsp 3.10.0
jupyterlab-pygments 0.1.2
jupyterlab-server 2.10.3
jupyterlab-widgets 1.0.2
urllib3 1.26.8
voila 0.2.16
wcwidth 0.2.5
webencodings 0.5.1
websocket-client 1.2.3
wheel 0.37.1
widgetsnbextension 3.5.

Error with Traitlets 5.0

Would like to advise that this package appears to break with the most recent version of Traitlets (5.0.4), works with Traitlets (4.3.1) [minimum dependency w/ ipywidgets, haven't tested other versions]. Seems traitlets has a short history of not being fully backwards compatible (re: v4.1 and now v5.0)

Traitlets doesn't seem to be an explicit dependency for this package (?), but jupyter notebook breaks without it.

Console output on opening a notebook w/ jupyter-flex and traitlets 5.0.4

    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/040b_MDD-Excel.ipynb', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\traitlets\traitlets.py", line 533, in get
    KeyError: 'template_path'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\tornado\web.py", line 1703, in _execute
        result = await result
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\tornado\gen.py", line 748, in run
        yielded = self.gen.send(value)
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\notebook\notebook\handlers.py", line 101, in get
        get_frontend_exporters=get_frontend_exporters
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\notebook\base\handlers.py", line 512, in render_template
        return template.render(**ns)
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\jinja2\environment.py", line 1090, in render
        self.environment.handle_exception()
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\jinja2\environment.py", line 832, in handle_exception
        reraise(*rewrite_traceback_stack(source=source))
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\jinja2\_compat.py", line 28, in reraise
        raise value.with_traceback(tb)
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\notebook\templates\notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\notebook\templates\page.html", line 154, in top-level template code
        {% block header %}
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\notebook\templates\notebook.html", line 115, in block "header"
        {% for exporter in get_frontend_exporters() %}
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\notebook\notebook\handlers.py", line 42, in get_frontend_exporters
        exporter_instance = exporter_class()
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\jupyter_flex\exporter.py", line 94, in __init__
        self.environment.globals["dev_mode"] = DEV_MODE
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\nbconvert\exporters\templateexporter.py", line 126, in environment
        self._environment_cached = self._create_environment()
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\nbconvert\exporters\templateexporter.py", line 411, in _create_environment
        additional_paths + \
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\jupyter_flex\exporter.py", line 80, in template_path
        return super().template_path + [
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\traitlets\traitlets.py", line 573, in __get__
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\traitlets\traitlets.py", line 536, in get
      File "c:\users\chayd\documents\intertek\tempvenv\lib\site-packages\traitlets\traitlets.py", line 1572, in trait_defaults
    traitlets.traitlets.TraitError: 'template_path' is not a trait of 'FlexExporter' instances

jupyter-flex command line app not responding to ctrl-c on Windows

Minor issue, but may be troubling for some users. I noticed that on Windows if jupyter-flex is started and running on the default port, but not accessed by a browser, the command line app is not terminating when CTRL-C is sent.

If triggering an access to localhost:8866 from a browser, however, immediately the server stops.

How to deploy with Binder and voilร , and GitHub pages?

Hi!
Thanks so much for this fantastic package! I have just created my very first dashboard, and I am excited I used jupyter-flex for it as it is super easy and elegant!

Locally everything works like a charm, but I have difficulties at deploying the dashboard:

  • On Binder:
    • I have created the repository with binder, and then I have launched Voilร  (button in the top bar). The only rendering I get is the text of the notebook. Am I missing some file or some commands that tells Voilร  to use jupyter-flex?
  • On GitHub pages:
    • Is there a way to deploy the dashboard using GitHub pages?

Looking forward!

Support flex_logo and flex_favicon

Hi @danielfrg, thanks for all of the hard work here, it's a great package.

I noticed that flex_logo doesn't do anything in 0.6.1 and I assume from the source code that flex_favicon does not either. Are these planned features, or have they been removed?

Thanks!

Idea: Show source code of all the cards on the body

It would be interesting to have a button similar to the help modal that shows the code used to generate the out on a particular card.

We could also have a new source tag that includes the source but its not rendered to the card body.

Fix qgrid

I think this is broken in the latest versions of the packages.

Add option to remove source code from the cells metadata

With the new split of frontend and backend the source of the cells is included in the dashboard json. There are some cases where this could be dangerous so we need an option to remove that, probably on by default.

Should make this match Voila's strip_sources which default is False.

template not found

Hi I'm getting this error:
raise TemplateNotFound(name)
jinja2.exceptions.TemplateNotFound: index.html.j2

when I run voila --template=flex mynotebook.ipynb

nbconvert: 3rd party widgets not loading

We have the requireLoader on the HTML manager and it loads the widget from unpkg but then it cannot find the base widgets.

I am not sure how to fix this :D

Logs from a console:

Falling back to https://unpkg.com/ for jupyter-leaflet@^0.13.2
@jupyter-widgets/base.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND
18jupyter-flex-embed.js:22245 Could not instantiate widget
(anonymous) @ jupyter-flex-embed.js:22245
step @ jupyter-flex-embed.js:22016
(anonymous) @ jupyter-flex-embed.js:21997
rejected @ jupyter-flex-embed.js:21989
19require.min.js:1 Uncaught (in promise) Error: Script error for "@jupyter-widgets/base", needed by: jupyter-leaflet
https://requirejs.org/docs/errors.html#scripterror
    at makeError (require.min.js:1)
    at HTMLScriptElement.onScriptError (require.min.js:1)

generating static HTML with a specified CDN

First of all, I'd like to say thank you for the library and I found it very useful.

I was wondering if you could give me a reference on specifying alternative CDN in the jupyter nbconvert, other than https://unpkg.com, in the case that a static file is not found, please.

Thanks in advance.

Layout header-columns-footer adding tabs

I have installed the latest version of jupyter-flex (0.6.5). I'm trying to build a layout similar to the example notebook "header-columns-footer" where the second column in the body of the page uses tabs.
I tried many different configurations but what I cannot find is a way to change Sections orientation multiple times on a specific page, like this:

# Page X    ->  selected page     tags: orientation = rows 
## Section 1  -> header 

# ...... missing -> change section orientation.    tags: orientation = columns

## Section 2 -> first column 

## Section 3 -> second column with tabs.    tags: tabs 

### Card 1 -> first tab
### Card 2 -> second tab

# ...... missing -> change section orientation.    tags: orientation = rows

## Section 4 -> footer  tags: tabs  (to have multiple information separated in different tabs) 

### Footer 1
### Footer 2

Any help is appreciated. Thank you so much for this handy package. It rocks ;)

Replace chart and text tags with `body`

With the new React structure I made help and footer cells easier to use than the card body ones :D

The chart and text were mostly needed by the old system but the new one is a lot better and it would simplify experience to have a single body tag instead since now chart and text do literally the same.

The new footer and help work better because they describe location instead of type, the old ones had that information mixed, it was needed basically.

widgets not appearing via voila with 0.6.0

ipywidgets are not rendering for me with version 0.6.0, but they do with version 0.5.0.

Minimal working notebook json

I used a notebook with one section containing one card, with one ToggleButton widget in a code cell tagged with `inputs`.
{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from ipywidgets import widgets" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Columns 1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Card 1" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "tags": [ "inputs" ] }, "outputs": [], "source": [ "widgets.ToggleButton(description=\"one\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.6" } }, "nbformat": 4, "nbformat_minor": 4 }

Results

With 0.5.0
flex-mwe_0 5 0

With 0.6.0
flex-mwe_0 6 0

Environment

I access voila as an endpoint from a jupyterhub spawned docker image via chrome. I don't see errors in the inspect console with either 0.5.0 or 0.6.0

Versions

python : 3.7.6
voila : 0.1.21
jupyter core : 4.6.3
jupyter-notebook : 6.0.3
qtconsole : not installed
ipython : 7.14.0
ipykernel : 5.2.1
jupyter client : 6.1.3
jupyter lab : 2.1.1
nbconvert : 5.6.1
ipywidgets : 7.5.1
nbformat : 5.0.6
traitlets : 4.3.3

Commit hunting

I tried to narrow the range of commits to master at which the change occurs. Widgets appeared for me with 75e444f, but not with 4ece304

Move from netlify build to Github Actions

The build of docs takes a while and I have passed my limit on free minutes on Netlify so i need to move the build to Github Actions and push to netlify the built docs.

Regression in 0.8: `jinja2.exceptions.TemplateNotFound: index.html.j2`

With these packages:

  • nbconvert 6.2.0
  • ipykernel 6.4.1
  • Jinja2 3.0.2
  • voila 0.2.16
  • jupyter-flex 0.7.3
Additionally: output of `jupyter --version`
>>> jupyter --version
Selected Jupyter core packages...
IPython          : 7.28.0
ipykernel        : 6.4.1
ipywidgets       : 7.6.5
jupyter_client   : 6.1.12
jupyter_core     : 4.8.1
jupyter_server   : 1.11.1
jupyterlab       : 3.1.18
nbclient         : 0.5.4
nbconvert        : 6.2.0
nbformat         : 5.1.3
notebook         : 6.4.4
qtconsole        : not installed
traitlets        : 5.1.0

running voila --template=flex Reproducer.ipynb on this simple notebook runs without a hitch. With jupyter-flex 0.8.0 (all other versions the same), however, I get:

[Voila] Using /tmp to store connection files
[Voila] Storing connection files in /tmp/voila_5x_t0xgi.
[Voila] Serving static files from /home/dominik/.local/lib/python3.9/site-packages/voila/static.
[Voila] Voilร  is running at:
http://localhost:8866/
[Voila] WARNING | Notebook Reproducer.ipynb is not trusted
ERROR:tornado.application:Uncaught exception GET / (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:8866', method='GET', uri='/', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/tornado/web.py", line 1704, in _execute
    result = await result
  File "/home/dominik/.local/lib/python3.9/site-packages/voila/handler.py", line 163, in get
    async for html_snippet, resources in self.exporter.generate_from_notebook_node(notebook, resources=resources, extra_context=extra_context):
  File "/home/dominik/.local/lib/python3.9/site-packages/voila/exporter.py", line 100, in generate_from_notebook_node
    async for output in self.template.generate_async(nb=nb_copy, resources=resources, **extra_context, static_url=self.static_url):
  File "/home/dominik/.local/lib/python3.9/site-packages/nbconvert/exporters/templateexporter.py", line 148, in template
    self._template_cached = self._load_template()
  File "/home/dominik/.local/lib/python3.9/site-packages/nbconvert/exporters/templateexporter.py", line 359, in _load_template
    return self.environment.get_template(template_file)
  File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 997, in get_template
    return self._load_template(name, globals)
  File "/usr/lib/python3.9/site-packages/jinja2/environment.py", line 958, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
  File "/usr/lib/python3.9/site-packages/jinja2/loaders.py", line 558, in load
    raise TemplateNotFound(name)
jinja2.exceptions.TemplateNotFound: index.html.j2
ERROR:tornado.access:500 GET / (127.0.0.1) 597.95ms

Just thought I should probably report this! I'd be happy to help with reproducing/debugging in any way possible.

widgets not rendering when using Voilร  and flex template

Using jupyter-flex with Voilร  (--template flex) doesn't render any widget. I'm using "iris-clustering.ipynb". Removing the request for the flex template solves the problem but, of course, makes it useless to adopt jupyter-flex.

Running notebooks without proper widgets ("nba-scoring.ipynb") goes smoothly.

I tried starting from a clean environment (created with conda - python 3.8) without success. The same result starting from a development installation of jupyter-flex using its configuration (followed step-by-step in one case and using "make env" alone in another attempt).

Running voilร  in debug mode doesn't show any particular error.

Checking html output shows this error:

Schermata 2021-04-26 alle 16 45 19

Exporting the notebook in "flex" format doesn't solve the problem.

I'm running mac-os Big Sur (11.2.3)

Any help is appreciated. Thanks.

Test output:

Schermata 2021-04-26 alle 17 12 32

Voila Gallery

This is a cool project!

What do you think about adding it to the Voila Gallery? So it can be showcased as an example.

The example could be the Movie Explorer, using this Binder link: https://mybinder.org/v2/gh/danielfrg/jupyter-flex/b202af9ea05029a39e667be9da1f72257a6a82b3?urlpath=%2Fvoila%2Frender%2Fexamples%2Fmovie-explorer.ipynb

We would need to add the following snippet to _data/gallery.yaml in https://github.com/voila-gallery/voila-gallery.github.io:

- title: jupyter-flex
  description: Easy interactive dashboards for Jupyter
  url: voila/render/examples/movie-explorer.ipynb
  ref: b202af9ea05029a39e667be9da1f72257a6a82b3
  repo_url: https://github.com/danielfrg/jupyter-flex
  image_url: https://jupyter-flex.extrapolations.dev/assets/img/screenshots/movie-explorer.png

Tabs must be loaded in order to load correctly

I built a dashboard with tabs and using plotly. I noticed that if I click on the different tabs in order, everything loads smoothly.

However, if I load one of the last tabs before the previous ones, the tab appears blank.

Attached is a simple notebook where the problem is reproduced.

plotly-tabs.ipynb.zip

Hide/show Sidebar?

First of all, thank you for the fantastic package!

I have created a dashboard that uses a sidebar for various inputs. However, it is useful screen real estate that it takes up, so I was wondering if there would be any way to have the sidebar appear/disappear either with a button or based on mouse location?

I think this would be a useful future for many. I'm, of course, open to suggestions on alternatives.

Thanks!

Unable to nbconvert or save jupyter notebook as flex dashboard html

I'm running jupyter notebook with python=3.9,pandas=1.2.5 (in a separate conda environment)
I installed nbconvert, jupyter-flex using pip install as given in jupyter-flex-getting-started within the conda environment
I could add page, section & card elements with the cell tags; but not getting the save-as option as referred in: save-as-flex-dashboard

Also tried to run jupyter nbconvert --to flex dashboard_prototype_with_charts_data.ipynb --execute but --to flex is not being recognized as valid format
not sure if I'm missing any other base settings, pls help.

Dynamically adjust card/section sizes?

Hi, thank you again for the package!

In the dashboard I have created, it would be useful to be able to change card/section sizes after the dashboard as loaded. I looked into editing the metadata (i.e. the tags) from the Python code, but I think it would require refreshing the whole page each time, which would not be workable solution.

There are two types of size changes I would imagine to be useful: (1) being able to create buttons, etc., that are used to control the size of a card/section size (e.g. a button that would change the sizes of two adjacent cards from 500/500 to 1000/0 or 0/1000); (2) dragging the dividers between cards to adjust the sizes.

I think it would be great if either one is possible. I welcome suggestions on alternatives to obtain similar results.

Thanks!

Installation fails

Hi all,
I have problems with installing jupyter-flex on a windows computer. The machine contains two installations. An older one (python 3.6.5), which is also in $PATH, and a newer one (python 3.8.7). I use the py launcher to switch between these installations.
Furthermore, I want to use a virtual environment.

What I did:

py -3.8 -m venv d:\playground_jan\virt_env_test
d:\playground_jan\virt_env_test\Scripts\activate.bat

The command line then changed to: (virt_env_test) C:\Users\jan>

Then updated pip and setuptools (<ip-address> is a company proxy):

python -m pip --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --proxy=http://<ip-address>:8080/ install --upgrade pip setuptools

The output is:

Collecting pip
  Downloading pip-21.0.1-py3-none-any.whl (1.5 MB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 1.5 MB 384 kB/s
Collecting setuptools
  Downloading setuptools-53.0.0-py3-none-any.whl (784 kB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 784 kB 731 kB/s
Installing collected packages: pip, setuptools
  Attempting uninstall: pip
    Found existing installation: pip 20.2.3
    Uninstalling pip-20.2.3:
      Successfully uninstalled pip-20.2.3
  Attempting uninstall: setuptools
    Found existing installation: setuptools 49.2.1
    Uninstalling setuptools-49.2.1:
      Successfully uninstalled setuptools-49.2.1
Successfully installed pip-21.0.1 setuptools-53.0.0

Now, tried to install jupyter-flex:

python -m pip --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org --proxy=http://<ip-address>:8080/ install -v jupyter-flex

And now the error occurs:

Using pip 21.0.1 from d:\playground_jan\virt_env_test\lib\site-packages\pip (python 3.8)
Non-user install because user site-packages disabled
Created temporary directory: C:\Users\jan\AppData\Local\Temp\9\pip-ephem-wheel-cache-pwwcux3a
Created temporary directory: C:\Users\jan\AppData\Local\Temp\9\pip-req-tracker-8qx77tku
Initialized build tracking at C:\Users\jan\AppData\Local\Temp\9\pip-req-tracker-8qx77tku
Created build tracker: C:\Users\jan\AppData\Local\Temp\9\pip-req-tracker-8qx77tku
Entered build tracker: C:\Users\jan\AppData\Local\Temp\9\pip-req-tracker-8qx77tku
Created temporary directory: C:\Users\jan\AppData\Local\Temp\9\pip-install-ddty4194
1 location(s) to search for versions of jupyter-flex:
* https://pypi.org/simple/jupyter-flex/
Fetching project page and analyzing links: https://pypi.org/simple/jupyter-flex/
Getting page https://pypi.org/simple/jupyter-flex/
Found index url https://pypi.org/simple
Looking up "https://pypi.org/simple/jupyter-flex/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/jupyter-flex/ HTTP/1.1" 200 1202
Updating cache with response from "https://pypi.org/simple/jupyter-flex/"
Caching due to etag
  Found link https://files.pythonhosted.org/packages/dc/26/525cbb6efae075b072d6324a1210b8347337d25274276b12bdccb9086d36/jupyter-flex-0.1.0.tar.gz#sha256=c296c85f7dff5d2dbe46b3c2f41709f449e9767493f1f222690e36d0c6f0f662 (from https://pypi.org/simple/jupyter-flex/) (requires-python:>=3.0,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*), version: 0.1.0
  Found link https://files.pythonhosted.org/packages/d5/a8/093d3b23426f2f72e68d785ced5463840f8a0367c7832a99e8dafdce6e16/jupyter-flex-0.2.0.tar.gz#sha256=5f6f64a40832b635d0e16a61e021af7987e8ff9ea679ec8172855fec8244e9f5 (from https://pypi.org/simple/jupyter-flex/) (requires-python:>=3.0,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*), version: 0.2.0
  Found link https://files.pythonhosted.org/packages/65/3b/00a249d42dbfcb90f289369330dca8b8b223acfcf49bba1e39d09694cbbf/jupyter-flex-0.3.0.tar.gz#sha256=71d1dc50bd8221156e84831768d48538b58da7c310cc7ea85f7f9c9bd4a7c9ac (from https://pypi.org/simple/jupyter-flex/) (requires-python:>=3.0,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*), version: 0.3.0
  Found link https://files.pythonhosted.org/packages/f5/46/4cf1cd02db1184b886632cb711fec6a636d4b8bf56d3719f8857df0f7b40/jupyter-flex-0.4.0.tar.gz#sha256=de5e9a746e82eb53f883e59d0c107aec0124df7fd6f3de753b5f683777012085 (from https://pypi.org/simple/jupyter-flex/) (requires-python:>=3.0,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*), version: 0.4.0
  Found link https://files.pythonhosted.org/packages/d9/76/50e5ff39965e49e5469d086fdcc0777b75d9f170d8e99a91b129802ac500/jupyter-flex-0.5.0.tar.gz#sha256=415a14422d6c10a96a634db7c1402b21482bbf0e461d048ef700c16833bb60ff (from https://pypi.org/simple/jupyter-flex/) (requires-python:>=3.0,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*), version: 0.5.0
  Found link https://files.pythonhosted.org/packages/fb/39/32d556b78b012621f695579bf9899b8d808af90517fd351f4174f8b12903/jupyter-flex-0.6.0.tar.gz#sha256=9eb8ab489c61a10ef32b6aab14688b6822dedfa9356e57834fe8511059b03ad0 (from https://pypi.org/simple/jupyter-flex/) (requires-python:>=3.6), version: 0.6.0
  Found link https://files.pythonhosted.org/packages/dc/be/c9241e8bf960939697e793dffe82aecc826d9beee4214c27572c7c8c4ccb/jupyter-flex-0.6.1.tar.gz#sha256=1fb88394a582b95cb72e57614d22356fbf12ccd116b06182bac5ae97da0bb058 (from https://pypi.org/simple/jupyter-flex/) (requires-python:>=3.6), version: 0.6.1
  Found link https://files.pythonhosted.org/packages/21/5b/2e01c57f16214e33dfaafb592b278cbd1248dbec8a36419fa074f2299350/jupyter-flex-0.6.2.tar.gz#sha256=30018c3c7373541f051808541acc6a825317ec98fe59f4dadd88c96a25379a94 (from https://pypi.org/simple/jupyter-flex/) (requires-python:>=3.6), version: 0.6.2
  Found link https://files.pythonhosted.org/packages/c4/da/24e4fa44378f68d2747159e247d30746e5ceb1c36ee4b1e54fea80054e07/jupyter-flex-0.6.3.tar.gz#sha256=cdd048ccab85942be49c23cec4c8849103788f81692f622b335ce0c18e5f6fa6 (from https://pypi.org/simple/jupyter-flex/) (requires-python:>=3.7), version: 0.6.3
  Found link https://files.pythonhosted.org/packages/aa/36/306855209777a72cbe47de4ff833ffe529b0f0d58b8179015432668664fa/jupyter-flex-0.6.4.tar.gz#sha256=727856f0c49ca0145899267f01ff493a7886dd6a73b90ff16bc404f02c34e93c (from https://pypi.org/simple/jupyter-flex/) (requires-python:>=3.7), version: 0.6.4
Given no hashes to check 10 links for project 'jupyter-flex': discarding no candidates
Collecting jupyter-flex
  Created temporary directory: C:\Users\jan\AppData\Local\Temp\9\pip-unpack-6uwbqpse
  Looking up "https://files.pythonhosted.org/packages/aa/36/306855209777a72cbe47de4ff833ffe529b0f0d58b8179015432668664fa/jupyter-flex-0.6.4.tar.gz" in the cache
  No cache entry available
  Starting new HTTPS connection (1): files.pythonhosted.org:443
  https://files.pythonhosted.org:443 "GET /packages/aa/36/306855209777a72cbe47de4ff833ffe529b0f0d58b8179015432668664fa/jupyter-flex-0.6.4.tar.gz HTTP/1.1" 200 7104044
  Downloading jupyter-flex-0.6.4.tar.gz (7.1 MB)
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 7.1 MB 939 kB/s eta 0:00:01  Ignoring unknown cache-control directive: immutable
  Updating cache with response from "https://files.pythonhosted.org/packages/aa/36/306855209777a72cbe47de4ff833ffe529b0f0d58b8179015432668664fa/jupyter-flex-0.6.4.tar.gz"
  Caching due to etag
     |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 7.1 MB 939 kB/s
  Added jupyter-flex from https://files.pythonhosted.org/packages/aa/36/306855209777a72cbe47de4ff833ffe529b0f0d58b8179015432668664fa/jupyter-flex-0.6.4.tar.gz#sha256=727856f0c49ca0145899267f01ff493a7886dd6a73b90ff16bc404f02c34e93c to build tracker 'C:\\Users\\jan\\AppData\\Local\\Temp\\9\\pip-req-tracker-8qx77tku'
  Created temporary directory: C:\Users\jan\AppData\Local\Temp\9\pip-build-env-l6byyas2
  Running command 'd:\playground_jan\virt_env_test\Scripts\python.exe' 'd:\playground_jan\virt_env_test\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\jan\AppData\Local\Temp\9\pip-build-env-l6byyas2\overlay' --no-warn-script-location -v --no-binary :none: --only-binary :none: -i https://pypi.org/simple --trusted-host pypi.python.org --trusted-host pypi.org --trusted-host files.pythonhosted.org -- 'setuptools>=42' 'setuptools_scm[toml]>=3.4' wheel
  Using pip 21.0.1 from d:\playground_jan\virt_env_test\lib\site-packages\pip (python 3.8)
  Non-user install by explicit request
  Created temporary directory: C:\Users\jan\AppData\Local\Temp\9\pip-ephem-wheel-cache-7x0sim3g
  Created build tracker: C:\Users\jan\AppData\Local\Temp\9\pip-req-tracker-8qx77tku
  Entered build tracker: C:\Users\jan\AppData\Local\Temp\9\pip-req-tracker-8qx77tku
  Created temporary directory: C:\Users\jan\AppData\Local\Temp\9\pip-install-zvxisa35
  1 location(s) to search for versions of setuptools:
  * https://pypi.org/simple/setuptools/
  Fetching project page and analyzing links: https://pypi.org/simple/setuptools/
  Getting page https://pypi.org/simple/setuptools/
  Found index url https://pypi.org/simple
  Looking up "https://pypi.org/simple/setuptools/" in the cache
  Request header has "max_age" as 0, cache bypassed
  Starting new HTTPS connection (1): pypi.org:443
  Incremented Retry for (url='/simple/setuptools/'): Retry(total=4, connect=None, read=None, redirect=None, status=None)
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001AAA5AF2040>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/setuptools/

I also tried without the virtual environment, with py -3.8 -m pip ... or pip ... alone. It's always the same problem.

It is a company server with limited access to the internet. But the installation of other packages works.

Any suggestion to solve this problem is highly appreciated.

Thank!
Jan

Print Specific Cards Output to PDF

First of all: This thing is great! Good job!

I have a dashboard built with multiple pages, pages have cards with tabs. I have charts located on the tabs. I want to incorporate a "button" that will produce a report PDF with some of the tab charts.

Do you have any idea how this can be done?

  1. I was thinking about adding another page where I would duplicate all the charts I want to put onto the report. Is it possible to allow for the vertical scroll on just a single page? Parameter flex_vertical_layout
  2. I was thinking about other modules like nbconvert which can remove cells based on tag. But will additional tags mess the jupter-flex dashboard?

LaTeX symbols not displaying

Hello everyone,
I am having some problems to display LaTeX symbols in Ipywidgets labels. Here is a screenshot.

flex

In Jupyter it is displayed correctly.

Webkit flex rows render with 0 height

I'm not exactly sure of why this happens, but this CSS fixes the problem for me:

/*  Begin fix for WebKit */
.card.card-row {
  flex-basis: auto !important;
}

.section.section-row {
  flex-basis: auto !important;
}
/*  End fix for WebKit */

I can replicate the bug in Safari and Evolution browsers.

nbconvert only renders first page of widgets

nbconvert is only rendering the first page of widgets, changing pages will not render new ones as it does with Voila.

This is expected since we should be using @jupyter-widgets/HtmlManager similar to how we use the voila HtmlManager, right now we do nothing ๐Ÿ™ˆ

ipyleaflet maps renders twice within a jupyter-flex card

Hi,

I report something that may or may not be issue, but hopefully also a solution or what seems to be a workaround at least.

I have a multi-page / multicard dashboard, I noticed within a card a map rendered twice, vertically. Rendered through the standard jupyterlab, it displays as expected, once.

The problem may not be apparent at first display but seems to happen when switching to another jupyterflex "page".

It seems to happen if if the map is rendered from a notebook cell with e.g.:

m = ipyleaflet.Map(et_caetera)
m

However if rendered via a container widget such as a VBox, the map is rendered as expected. It may also work equally with an Output widget; have not tested yet.

m = ipyleaflet.Map(et_caetera)
ipywidget.VBox([m])

small notebook illustrating the issue at repro.zip

Design: support CSS flex/grid layouts?

Hi @danielfrg,

Do you think that it is in the scope of this package to support CSS responsive layouts e.g. flex or grid? I see that it currently uses flex, but there is no support for wrapping as far as I am aware.

This is not a feature request per se, more of a discussion point.

Documenting possible causes for TypeError: t.tags is undefined

I got a "Something went wrong while building the dashboard" error with TypeError: t.tags is undefined while developing a dashboard.

Located the cause after a bit of sleuthing.

For the record if someone else bumps in the same error message.

I am using jupytext to synchronise a notebook with a plain text version; that helped me locate a cell with a "body" tag before any card/page being defined via a markdown cell. That happened after a refactor splitting and moving cells.

# %% tags=["body"]

So if you get that error do check the tags in each cells.

There may be a way to improve error messages also.

jupyter-flex uncaught exception

Jupyter-flex works great on windows, but when I try to deploy it in a linux server (using voila) I get the following error on the console and the application stays on the "loading widget" spinner forever.

Uncaught (in promise) TypeError: Cannot read property 'kernelChanged' of undefined
    at new so (voila.js:455)
    at new Ys (voila.js:469)
    at index.js:90

looking at the network tab of DevTools indicates that everything is loading fine. The dashboard loads fine using the lab template. Perhaps some race condition when loading stuff?

Could really use some help on this!

here's my environment:

anyio==2.2.0
argon2-cffi==20.1.0
async-generator==1.10
attrs==20.3.0
backcall==0.2.0
bleach==3.3.0
cffi==1.14.5
cycler==0.10.0
decorator==5.0.7
defusedxml==0.7.1
entrypoints==0.3
idna==3.1
ipykernel==5.5.3
ipysheet==0.4.4
ipython==7.22.0
ipython-genutils==0.2.0
ipywidgets==7.6.3
jedi==0.18.0
Jinja2==2.11.3
jsonschema==3.2.0
jupyter-client==6.1.12
jupyter-core==4.7.1
jupyter-flex==0.6.4
jupyter-server==1.6.1
jupyterlab-pygments==0.1.2
jupyterlab-widgets==1.0.0
kiwisolver==1.3.1
MarkupSafe==1.1.1
matplotlib==3.4.1
mistune==0.8.4
nbclient==0.5.3
nbconvert==6.0.7
nbformat==5.1.3
nest-asyncio==1.5.1
notebook==6.3.0
numpy==1.20.2
packaging==20.9
pandas==1.2.4
pandocfilters==1.4.3
parso==0.8.2
patsy==0.5.1
pexpect==4.8.0
pickleshare==0.7.5
Pillow==8.2.0
prometheus-client==0.10.1
prompt-toolkit==3.0.18
ptyprocess==0.7.0
pycparser==2.20
Pygments==2.8.1
pyparsing==2.4.7
pyrsistent==0.17.3
python-dateutil==2.8.1
pytz==2021.1
pyzmq==22.0.3
scipy==1.6.2
seaborn==0.11.1
Send2Trash==1.5.0
six==1.15.0
sniffio==1.2.0
statsmodels==0.12.2
terminado==0.9.4
testpath==0.4.4
tornado==6.1
traitlets==5.0.5
voila==0.2.9
voila-gridstack==0.2.0
wcwidth==0.2.5
webencodings==0.5.1
widgetsnbextension==3.5.1

Dashboard creation doesn't render charts -- sometimes

I'm not sure what causes the issue, but I've got a fairly large notebook and use jupyter-flex to generate a dashboard that has quite a few charts and tables. About 50% of the time, the dashboard doesn't contain any rendered charts. The dashboard file is always generated. The tables render ok. And there is space in the dashboard for the charts -- its just that the charts themselves don't render.

The only way I seem to be able to resolve the issue is to restart the kernel, rerun the notebook, and regenerate the dashboard file. This solves the problem every time.

See the screen grab to see missing charts - though it isn't very pretty!

missing charts

Change navbar color

Hi,
I'm really enjoying your work. It really makes it easier to quickly create a dynamic notebook, wonderful package!

I was wondering if it is possible to change the color of the nav bar located on the very top of the dashboard?

image

Looking forward for your answer!

Cheers,
Zaid

Bokeh renders app plots twice in voila moda

The runScript for JS types is being called on render, we should just call it on componentDidMount I think.

voila mode renders twice because we set the state when voila is ready.

Rendering narrative text

Does jupyter-flex support rendering of text/narrative in markdown cells, or only through code cells?

The layouts documentation page says "markdown cells tagged with text " can be used to provide narrative text in the dashboard, but the example provided shows a code cell containing a string, tagged with body. I suspect the text tag reference is a holdover from prior to 0.6.0, but I wonder if the reference to "markdown cell" is also incorrect.

In 0.6.0, I've found that text in a markdown cell is not rendered (via voila) when tagged with either text or body, but I am able to render code cells containing strings when they are tagged with body.

Minimal Working Example Notebook JSON

The notebook includes both a markdown cell and a code cell tagged with `body`.
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Page 1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Columns 1" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Card 1" ] }, { "cell_type": "markdown", "metadata": { "tags": [ "body" ] }, "source": [ "A markdown cell tagged with \"body\"" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "tags": [ "body" ] }, "outputs": [ { "data": { "text/plain": [ "\"A code cell tagged wtih 'body'\"" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "\"A code cell tagged with 'body'\"" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.6" } }, "nbformat": 4, "nbformat_minor": 4 }

flex-narrative-mwe

P.S. Step 4 on the layouts documentation page has a typo of "fotter" instead of "footer"

Issue with section-tabs

Firstly, thank you for the work you've put into this project. I loved Flexdashboard and am happy to see a python instalment.

The issue:
Section Tabs are failing to work for me as done in 'examples/layouts/pages.ipynb' and 'examples/layouts/section-tabs-rows.ipynb'.
When clicking on a section tab (tabs tag on ## header) the page goes blank with no selectable options in the body - Page selection still remains as an option.

To take pages.ipynb as an example:
The starting URL is [main_url]#/

  1. Clicking the 'Page 2' tab brings me to [main_url]#/page-2 yielding expected behaviour.
  2. Clicking on 'Page 2' then onto 'Page 2 - Row 1 - Tab 2' tab brings me to [main_url]#/page-2-row-1-tab-2 with blank content yielding unexpected behaviour. This link might rather be something like [main_url]#/page-2/page-2-row-1-tab-2?
  3. Clicking on 'Page 1' then onto 'Col 2 - Tab 2' brings me to [main_url]#/col-2-tab-2 with blank content yielding unexpected behaviour.

This behaviour only occurs on Flex Dashboard HTML (behaves as expected with voila).

Tangentially I get errors in the Flex Dashboard HTML regardless of whether the page is producing expected behaviour or not:
image
(Voila produces no such errors)

First thoughts are I'm missing some external dependency somewhere?

Pip list with minimum packages to reproduce (i.e pip install jupyter jupter-flex traitlets==4.3.2):

Package             Version
------------------- -------
argon2-cffi         20.1.0
async-generator     1.10
attrs               20.2.0
backcall            0.2.0
bleach              3.2.1
cffi                1.14.3
colorama            0.4.3
decorator           4.4.2
defusedxml          0.6.0
entrypoints         0.3
importlib-metadata  2.0.0
ipykernel           5.3.4
ipython             7.18.1
ipython-genutils    0.2.0
ipywidgets          7.5.1
jedi                0.17.2
Jinja2              2.11.2
jsonschema          3.2.0
jupyter             1.0.0
jupyter-client      6.1.7
jupyter-console     6.2.0
jupyter-core        4.6.3
jupyter-flex        0.6.2
jupyter-server      0.1.1
jupyterlab-pygments 0.1.2
MarkupSafe          1.1.1
mistune             0.8.4
nbclient            0.5.0
nbconvert           5.6.1
nbformat            5.0.7
nest-asyncio        1.4.1
notebook            6.1.4
packaging           20.4
pandocfilters       1.4.2
parso               0.7.1
pickleshare         0.7.5
pip                 19.2.3
prometheus-client   0.8.0
prompt-toolkit      3.0.7
pycparser           2.20
Pygments            2.7.1
pyparsing           2.4.7
pyrsistent          0.17.3
python-dateutil     2.8.1
pywin32             228
pywinpty            0.5.7
pyzmq               19.0.2
qtconsole           4.7.7
QtPy                1.9.0
Send2Trash          1.5.0
setuptools          41.2.0
six                 1.15.0
terminado           0.9.1
testpath            0.4.4
tornado             6.0.4
traitlets           4.3.2
voila               0.1.23
wcwidth             0.2.5
webencodings        0.5.1
widgetsnbextension  3.5.1
zipp                3.2.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.