GithubHelp home page GithubHelp logo

harisyammnv / slapdash Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ned2/slapdash

0.0 2.0 0.0 593 KB

Boilerplate for bootstrapping scalable multi-page Dash applications

License: MIT License

Python 91.91% CSS 8.09%

slapdash's Introduction

Slapdash

Boilerplate for bootstrapping multi-page Dash applications

Note: This is a work in progress, but it's probably at a point where it's more useful than not.

Dash is a Python framework for building analytical web applications. Slapdash provides a template for quickly building out a multi-page Dash application. It includes pre-built layouts based on Bootstrap, which can be extended or swapped out for layouts constructed using your own CSS.

Also included is dash_skeleton.py, a template for bootstrapping smaller single-file applications.

Usage

  1. In slapdash.py, select the main layout you want from layouts.py.
  2. Create your callbacks in callbacks.py.
  3. Create your pages in pages.py.
  4. Add your pages to the urls attribute in router.py.
  5. Add desired pages to NAV_ITEMS (if using a navbar) in settings.py.
  6. Add additional CSS to static/custom.css.
  7. Modify any additional settings in settings.py as desired. (The only other one you will likely definitely need to change is TITLE).
  8. Run the app either with python run_flask.py (--debug) or by targeting a WSGI server at wsgi.py.

Note that this project is intended for bootstrapping initial Dash applications, as opposed to being a library that you import. You probably shouldn't assume that its internal structure and interfaces will be stable, as they will likely change.

Boilerplate Overview

  • slapdash.py Entry point into the app. Imports other modules in correct order.
  • server.py Creates both the Flask server and Dash app instances used for the app.
  • wsgi.py Contains application attribute suitable for pointing WSGI servers at.
  • settings.py Configurable settings for the application.
  • router.py Contains the application routes in url and initialises the router callback.
  • exceptions.py Exceptions used by the app are defined here.
  • layouts.py Possible values for the layout attribute of the Dash instance are defined here.
  • components.py Convenience pseudo-components defined here, such as Row and Col for an easy experience creating Bootstrap rows and columns..
  • utils.py Utility things defined here.
  • callbacks.py Custom callbacks go here.
  • pages.py Custom pages go here.
  • static Location for static assets that will be exposed to the web server.

Included Libraries

Slapdash includes a few plugins for getting fully functional applications off the ground faster. These currently include:

dash_skeleton.py

For simple applications that with a single view, the full Slapdash codebase is probably overkill. dash_skeleton.py is a Dash single-file Dash template that you can pull down and start hacking on with minimal overhead.

Useful References

  1. The Dash User Guide

  2. Plotly Python client figure reference Documents the contents of plotly.graph_objs, which contains the different types of charts available, as well the Layout class, for customising the appearance of charts.

  3. The Dash Community Forum

  4. Dash Show and Tell Community Thread

  5. The Dash GitHub Repository

slapdash's People

Contributors

ned2 avatar

Watchers

 avatar  avatar

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.