Example #1
0
import json
from plotly.graph_objs import Layout

import utils
from app import app
from apps import rep

stub = "comp-"

tab = dcc.Tab(label="Comparison", value="comparison")

content = utils.TabContent(
    dashboard=utils.Dashboard([
        utils.ShowsElement(elt_id=stub + "shows"),
        utils.YearsElement(elt_id=stub + "years"),
        utils.RaceElement(elt_id=stub + "race")
    ]),
    panel=utils.Panel([
        html.Div(id=stub + "value", style=dict(display="none")),
        html.H4("The Bachelor/ette is less diverse than the U.S. at large"),
        dcc.Graph(id=stub + "graph"),
        html.H5([
            """
      While the Bachelor/ette has started to cast a more diverse cast,
      the franchise is still much less diverse than Americans as a population.
      """
        ]),
        html.H6(id=stub + "caption", className="caption")
    ]))
Example #2
0
def dashboard_detail(request):
    if request.method == 'GET':
        detail_ins = utils.Dashboard(request)
        res = list(detail_ins.get())
        print '-->', res
        return HttpResponse(json.dumps(res, default=json_date_handler))