Giter VIP home page Giter VIP logo

magicbox-reports's Introduction

Magicbox reports

How to create a new report

  1. Clone/Install the repo.

      git clone repo.url/magicbox-reports
      cd magicbox-reports
      source venv/bin/activate # use the virtualenv
      pip install

    If using conda instead of venv:

      conda create -n myenv python=3.8
      conda activate myenv
      pip install -r requirements.txt
  2. Create a new branch and switch to it:

      git branch report/my-report
      git checkout report/my-report
  3. Run the app

      python index.py

    Open a browser in http://localhost:8050

  4. Create a subfolder in the reports folder following this convention YYYY-MM-name-of-the-report

      cd reports
      mkdir 2020-08-10-my-report
  5. Create a file init.py in the new report folder

      cd 2020-08-10-my-report
      touch __init__.py
  6. Add a method called layout tha

    import dash_core_components as dcc
    import dash_html_components as html
    from dash.dependencies import Input, Output
    
    from app import app
    
    # Contents of the report
    def layout():
      layout = html.H3('Hello world')
      return layout
    
    ## For callbacks use @app
    # @app.callback(...)
    # def mycallback(...):  
  7. Add the metadata. Within the reports folder create the file metadata.py. This file contains the metadata of the report that is used to list it on the homepage.

  # Report title
  title = "Report 3 title "
  # Meta keywords
  keywords = "keyword1, keyword2, keyword3"
  # Meta description
  description = "description description 3"
  # Summary displayed in homepage
  summary = "Summary Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc mollis pulvinar tellus vel vulputate. Integer ac massa efficitur, sagittis turpis ullamcorper, vehicula velit. Donec placerat cursus leo eu ultrices. In porttitor varius nisl. In iaculis arcu non massa ullamcorper, ac blandit dolor pulvinar. Etiam tempus urna id sapien vulputate, a congue nunc condimentum. Proin pellen "

  # thumbnail displayed on the homepage
  thumb = 'report3.png'
  # Alt
  thumb_alt = 'description for accessibility 3'

The thumb file must be in /assets within the root folder of the project.

  1. Create a PR in github.

Deployment to test environment

   git push heroku master   

Open https://magicbox-reports.herokuapp.com

Useful links

magicbox-reports's People

Contributors

merlos avatar andre-martini 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.