Exemplo n.º 1
0
def launcher(request):
    wp = jp.QuasarPage()
    wp.tailwind = True
    wp.head_html = """
    <link rel="stylesheet" href="https://unpkg.com/tailwindcss@^1.5/dist/base.min.css" />
    <link rel="stylesheet" href="https://unpkg.com/tailwindcss@^1.5/dist/components.min.css" />
    <link
    rel="stylesheet"
    href="https://unpkg.com/@tailwindcss/[email protected]/dist/typography.min.css"
    />
    <link rel="stylesheet" href="https://unpkg.com/tailwindcss@^1.5/dist/utilities.min.css" />
    """
    tlc = jp.Div(a=wp, classes="container mx-auto bg/gray/1")
    title_ = wf.dur.title_banner_("title", "Monal Insights: An advanced Imaging Solutions Company")
    title_(tlc, "")

    intro_text = """
    MonalInsights specializes in solutions and technologies for satellite and microCT images. 
    We provide end-to-end solution for ingestion, cleaning, registration, and advanced analysis of 
    images captured in industrial (oil and gas exploration, biomedical) and institutional domains (climate change, agricultural, forest). 
    """

    wf.dur.prose_("intro", intro_text, pcp=[])(tlc, "")

    key_technology_topics = ["Massive Scale Image Storage and Processing Framework", "SemiSupervised based clustering and classification"]
    #wf.fc.StackV_()
    wf.fc.StackV_("keytechpanel", [
        wf.dur.heading_("heading", "Key technologies", pcp=[mr/st/6]),
        wf.fc.StackH_("keytechbuttons", map(lambda l: wf.dur.divbutton_(l, l, l, no_action), key_technology_topics))
        ]
               )(tlc, "")
    return wp
def app():
    wp = jp.QuasarPage()
    h3z = jp.QDiv(a=wp,
                  text="Analysis of Course Reviews",
                  classes="text-h3 text-center")
    #    p1 = jp.QDiv(a=wp, text="The graphs represent review analysis")
    hc = jp.HighCharts(a=wp, options=chart_def)
    hc.options.title.text = "Average Rating by Day"
    hc.options.chart.inverted = False
    hc.options.subtitle.text = "The graphs represent review analysis"
    hc.options.xAxis.labels.format = "{value}"
    x = day_average.index
    y = day_average["Rating"]
    hc.options.xAxis.categories = list(x)
    hc.options.series[0].data = list(y)
    hc.options.xAxis.title.text = "Date"
    hc.options.yAxis.title.text = "Average Rating"
    hc.options.series[0].name = "Average Rating"
    hc.options.tooltip.pointFormat = "{point.x}: {point.y}"
    """
    x = [3, 6, 8]
    y = [4, 7, 9]
    hc.options.series[0].data = list(zip(x, y))
    hc.options.series[0].data = [[3, 4], [6, 7], [8, 9]]
    """
    return wp
def home():
    wp = jp.QuasarPage(tailwind=True)

    page = jp.Div(a=wp, classes="bg-gray-200 h-screen")

    # jp.Div(a=page, classes="bg-gray-300")
    con = jp.Div(a=page, classes="bg-purple-300 m-24 p-10 rounded")

    line = jp.Div(a=con, classes="grid grid-cols-3 gap-4")
    in_1 = jp.Input(a=line,
                    placeholder="Enter the first value",
                    classes="form-input")
    in_2 = jp.Input(a=line,
                    placeholder="Enter the second value",
                    classes="form-input")
    result = jp.Div(a=line, text="Result goes here....")
    jp.QBtn(
        a=con,
        label="Calculate",
        color='purple',
        icon="calculator",
        click=sum_up,
        in1=in_1,
        in2=in_2,
        total=result,
        classes=
        "bg-purple-600 m-2 py-1 px-4 text-gray-800 rounded hover:bg-purple-800"
    )
    jp.Div(a=con,
           text="interactive div",
           mouseenter=mouse_enter,
           mouseleave=mouse_leave)

    return wp
Exemplo n.º 4
0
def draw_chart():
    wp = jp.QuasarPage()
    wp.head_html = """<script src = "https://cdn.jsdelivr.net/npm/chart.js" > </script >\n <script src = "https://raw.githubusercontent.com/sandeep-gh/justpy-chartjs/main/justpy_chartjs/components/chartjs.js" > </script >\n    <link href = "https://unpkg.com/tailwindcss/dist/tailwind.min.css" rel = "stylesheet" >"""

    panel_pltcanvas_ = cj.ChartJS_("panel_canvas", pcp=[], options=chartcfg)
    dbref_canvas = panel_pltcanvas_(wp, "")

    @wrapper
    def change_plt(dbref, msg):
        print("in chage_plt")
        print("in chage_plt", dbref)
        print("in chage_plt", msg.page)
        #dbref_canvas.c.new_chart(msg.page, my_chart_def2)
        # dbref_canvas.chartjs.new_chart(my_chart_def2)
        #dbref_canvas.cjsbc.set_cfgattr("type", "bar")
        #dbref_canvas.cjsbc.set_cfgattr("options/scales/y/title/text", "bar")

        # await msg.page.update()
        return msg.page

    dbref_btn = dur.button_("abtn", "abtn", "abtn", change_plt)(wp, "")

    def act():
        dbref_canvas.chartjs.new_chart(my_chart_def2)
        pass

    wp.act = act

    return wp
    def serve(cls, req):
        wp = jp.QuasarPage(tailwind=True)
        div = jp.Div(a=wp, classes="bg-gray-200 h-screen")
        jp.Div(a=div,
               text="Instant English Dictionary",
               classes="text-4xl m-2")
        jp.Div(a=div,
               text="Get the definition of any English word as you type.",
               classes="text-lg")

        input_div = jp.Div(a=div, classes="grid grid-cols-2")

        output_div = jp.Div(a=div, classes="m-2 p-2 text-lg border-2 h-40")

        input_box = jp.Input(
            a=input_div,
            placeholder="Type in a word here...",
            outputdiv=output_div,
            classes=
            "m-2 bg-gray-100 border-2 border-gray-200 rounded w-64 focus:bg-white "
            "focus:outline-none focus:border-purple-500")
        input_box.on("input", cls.get_definition)

        # jp.Button(a=input_div, text="Get definition",
        #           classes="border-2 border-purple-500 rounded focus:outline-none "
        #                   "focus:border-red-500", click=cls.get_definition, outputdiv=output_div, inputbox=input_box)

        return wp
Exemplo n.º 6
0
def app():
    wp = jp.QuasarPage()
    h1 = jp.QDiv(a=wp,
                 text="Analysis of Course Reviews",
                 classes="text-h3 text=center q-pa-md")
    p1 = jp.QDiv(a=wp, text="These graphs represent course review analysis")
    return wp
Exemplo n.º 7
0
def app():
    wp = jp.QuasarPage(dark=True)
    hc1 = jp.HighCharts(a=wp, options=aapl_chart)
    hc1.options.xAxis.categories = list(df_mon.index)
    hc1.options.series[0].data = list(df_mon["High"])

    return wp
    def serve(cls, req):
        wp = jp.QuasarPage(tailwind=True)

        lay = layout.DefaultLayout(a=wp)
        container = jp.QPageContainer(a=lay)

        div = jp.Div(a=container, classes="bg-gray-200 h-screen")
        jp.Div(a=div,
               text="Instant English Dictionary",
               classes="text-4xl m-2")
        jp.Div(
            a=div,
            text="Get the definition of any English word instantly as you type."
        )

        input_div = jp.Div(a=div, classes="grid grid-cols-2")

        output_div = jp.Div(a=div, classes="m-2 p-2 text-lg border-2 h-40")
        input_box = jp.Input(
            a=input_div,
            placeholder="Type in a word...",
            outputdiv=output_div,
            classes=
            "m-2 bg-gray-100 border-2 border-gray2 rounded w-64 focus:outline-none "
            "focus:border-purple-500 focus:bg-white py-2 px-4")
        input_box.on('input', cls.get_definition)
        return wp
Exemplo n.º 9
0
def pydeck_demo(request):
    wp = jp.QuasarPage(tailwind=True, title='Uber NYC Pickups')
    wp.decks = {}
    slider_div = jp.Div(a=wp,
                        classes='flex ml-4',
                        style='width: 50%; margin-top: 20px')
    jp.Div(text='Select hour of pickup:',
           a=slider_div,
           classes='pt-3 text-xl font-bold ')
    s1 = jp.Span(classes='ml-6 mt-1', style='width: 50%', a=slider_div)
    jp.QSlider(classes='w-64',
               min=0,
               max=23,
               a=s1,
               label=True,
               label_always=True,
               markers=True,
               step=1,
               snap=True,
               color='red',
               change=slider_change)
    deck_div = jp.Div(classes='flex ml-2', a=wp)
    hour_data = data[data[DATE_TIME].dt.hour == int(0)]
    deck = map_deck(hour_data, midpoint[0], midpoint[1], zoom_level_main)
    all_div = jp.Div(a=deck_div)
    wp.all_caption = jp.Div(text='All New York City from 0:00 to 1:00',
                            a=all_div,
                            style='margin: 10px;',
                            classes='text-xl font-bold')
    wp.decks['main'] = jp.PyDeckFrame(
        a=all_div,
        deck=deck,
        style='margin: 10px; height: 400px; width: 450px',
        transition_duration=0.5)
    for airport, coords in airports.items():
        airport_deck = map_deck(hour_data, coords[0], coords[1],
                                zoom_level_airports)
        airport_div = jp.Div(a=deck_div)
        jp.Div(text=f'{airport} Airport',
               a=airport_div,
               style='margin: 10px;',
               classes='text-xl font-bold')
        wp.decks[airport] = jp.PyDeckFrame(
            a=airport_div,
            deck=airport_deck,
            style='margin: 10px; height: 400px; width: 250px',
            transition_duration=0.5)
    if _has_altair:
        chart = create_histogram(0)
        wp.histogram_caption = jp.Div(
            text='Breakdown of rides per minute between 0:00 and 1:00',
            a=wp,
            style='margin-left: 30px;',
            classes='text-xl font-bold')
        wp.histogram = jp.AltairChart(chart=chart,
                                      a=wp,
                                      style='padding: 10px; width: 100%;')
    return wp
Exemplo n.º 10
0
def app():
    wp = jp.QuasarPage()
    h1 = jp.QDiv(a=wp, text="Analysis of Course Reviews", classes="text-h4 text-center q-pa-md")
    
    hc = jp.HighCharts(a=wp, options=chart_def)
    month_crs_series = [{'name':course_name, 'data':[r for r in month_avg_crs[course_name]]} for course_name in month_avg_crs.columns]
    hc.options.xAxis.categories = list(month_avg_crs.index)
    hc.options.series = month_crs_series
    return wp
Exemplo n.º 11
0
def app():
    wp = jp.QuasarPage()
    h1 = jp.QDiv(a=wp,
                 text="Analysis of Course Reviews",
                 classes="text-h1 text-right text-bold q-pa-sm")
    p1 = jp.QDiv(a=wp,
                 text="There graphs represent course reviedw analysis",
                 classes='q-mt-xl')
    return wp
    def serve(cls, req):
        # Build the web page add layout and place this page in container
        wp = jp.QuasarPage(tailwind=True)
        lay = layout.DefaultLayout(a=wp)
        container = jp.QPageContainer(a=lay)

        # classes for input boxes and labels
        input_class = "m-2 bg-gray-200 border-2 border-gray-200 rounded py-2 px-4 " \
                      "focus:outline-none focus:border-purple-500 focus:bg-white"
        label_class = "m-2 py-2 px-4"

        # create container box for the app
        con = jp.Div(a=container, classes="bg-purple-300 p-10 m-10 rounded")


        # two lines of titles
        jp.Div(a=con, text="Flatmates Bill", classes="text-4xl m-2")
        jp.Div(a=con, text="Get the amount of a bill two flatmates owe based on days in the house", classes="text-lg")

        # four lines for the input boxes and button
        l_fm1 = jp.Div(a=con, classes="grid grid-cols-4")
        l_fm2 = jp.Div(a=con, classes="grid grid-cols-4")
        l_bill = jp.Div(a=con, classes="grid grid-cols-4")
        # div for output
        output_div = jp.Div(a=con, classes="m-2 p-2 text-lg border-2 h-10")
        l_btn = jp.Div(a=con, classes="grid grid-cols-2")



        # boxes where input is typed
        jp.Div(a=l_fm1, text="1st Flatmate's name", classes=label_class)
        i_fm1_name = jp.Input(a=l_fm1, value="Martin", classes=input_class)
        jp.Div(a=l_fm1, text="days in the house", classes=label_class)
        i_fm1_days = jp.Input(a=l_fm1, value="28", classes=input_class)

        jp.Div(a=l_fm2, text="2nd Flatmate's name", classes=label_class)
        i_fm2_name = jp.Input(a=l_fm2, value="Will", classes=input_class)
        jp.Div(a=l_fm2, text="days in the house", classes=label_class)
        i_fm2_days = jp.Input(a=l_fm2, value="25", classes=input_class)

        jp.Div(a=l_bill, text="Bill amount", classes=label_class)
        i_bill_amt = jp.Input(a=l_bill, value="120", classes=input_class)
        jp.Div(a=l_bill, text="Bill period", classes=label_class)
        i_bill_period = jp.Input(a=l_bill, placeholder="e.g.: February 2021", classes=input_class)

        jp.Button(a=l_btn, text="calculate", click=cls.get_results, classes="bg-purple-700 rounded p-2 m-2",
                  fm1_name=i_fm1_name, fm2_name=i_fm2_name,
                  fm1_days=i_fm1_days, fm2_days=i_fm2_days,
                  bill_amt=i_bill_amt, bill_period=i_bill_period,
                  outputdiv=output_div)
        jp.Button(a=l_btn, text="generate PDF", click=cls.get_results, classes="bg-purple-700 rounded p-2 m-2",
                  fm1_name=i_fm1_name, fm2_name=i_fm2_name,
                  fm1_days=i_fm1_days, fm2_days=i_fm2_days,
                  bill_amt=i_bill_amt, bill_period=i_bill_period,
                  outputdiv=output_div)

        return wp
Exemplo n.º 13
0
def app():
    wp = jp.QuasarPage()
    h1 = jp.QDiv(a=wp, text="Analysis of Course Reviews", classes="text-h3 text-center q-pa-md")
 
    hc = jp.HighCharts(a=wp, options=chart_def)
    hc.options.xAxis.categories = list(weekday_average.index.get_level_values(0))
    hc.options.series[0].data = list(round(weekday_average['Rating'],2))
 
    return wp
Exemplo n.º 14
0
def app():
    wp = jp.QuasarPage()
    

    hc = jp.HighCharts(a=wp, options=chart_def)
    hc.options.xAxis.categories = list(share.index)
    hc_data = [{"name":v1, "y":v2 } for v1,v2 in zip(share.index,share)]
    hc.options.series[0].data = hc_data

    return wp
Exemplo n.º 15
0
def app():
    wp = jp.QuasarPage() # We are creating a Quasar page object instance. Will return that instance.
    h1 = jp.QDiv(a=wp, text="Analysis of the happiest day of the week", classes="text-h3 text-center q-pa-md") # H1 Element
    p1 = jp.QDiv(a=wp, text="These graphs represent which day people are the happiest", classes="text-body1") # p Element

    hc = jp.HighCharts(a=wp, options=chart_def)
    hc_data = [{"name":course, "y":ratings} for course,ratings in zip(share.index, share)]
    hc.options.series[0].data = hc_data

    return wp
def app():
    # QDiv is another component of JustPy.
    wp = jp.QuasarPage(
    )  # We are creating a Quasar page object instance. Will return that instance.
    h1 = jp.QDiv(a=wp,
                 text="Analysis of Course Reviews",
                 classes="text-h3 text-center q-pa-md")  # H1 Element
    p1 = jp.QDiv(a=wp,
                 text="These graphs represent course review analysis",
                 classes="text-body1")  # p Element
    return wp
def app():
    wp = jp.QuasarPage()
    hc = jp.HighCharts(a=wp, options=contents)
    hc.options.xAxis.categories = list(month_average_courses.index)
    hc.options.series = []
    for i in range(len(month_average_courses["Rating"].columns)):
        hc.options.series.append({})
        hc.options.series[i]["name"] = month_average_courses.columns[i]
        hc.options.series[i]["data"] = list(month_average_courses["Rating"].iloc[:, i])
    hc.options.legend.floating = False
    return wp
Exemplo n.º 18
0
def app():
    wp = jp.QuasarPage()
    h1 = jp.QDiv(a=wp,
                 text="Analysis of Course Reviews",
                 classes="text-h3 text-center q-pa-md")
    p1 = jp.QDiv(a=wp, text="These graphs represent course review analysis")

    hc = jp.HighCharts(a=wp, options=chart_def)
    hc_data = [{"name": v1, "y": v2} for v1, v2 in zip(share.index, share)]
    hc.options.series[0].data = hc_data
    return wp
Exemplo n.º 19
0
def app():
    wp = jp.QuasarPage()
    h1 = jp.QDiv(a=wp, text="Analysis of Course Reviews", classes="text-h3 text-center q-pa-md")
    p1 = jp.QDiv(a=wp, text="These graphs represent course review analysis")
    hc = jp.HighCharts(a=wp, options=chart_def)
    hc.options.title.text = "Average Rating by Day"

    hc.options.xAxis.categories = list(day_average.index)
    hc.options.series[0].data = list(day_average['Rating'])

    return wp
Exemplo n.º 20
0
def app():
    wp = jp.QuasarPage()
    

    hc = jp.HighCharts(a=wp, options=chart_def)
    hc.options.xAxis.categories = list(month_average_crs.index)

    hc_data = [{'name': v1, 'data': [v2 for v2 in month_average_crs[v1]]}
               for v1 in month_average_crs.columns]
    hc.options.series = hc_data

    return wp
Exemplo n.º 21
0
def not_found_404(request):
    wp = jp.QuasarPage()

    banner = jp.parse_html('''
        <q-banner class="bg-warning text-white">
            <div class="text-h6">Impossible de trouver la page</div>
            <div class="text-subtitle2">Erreur 404 : la page demandée n'existe pas</div>
        </q-banner>
    ''',
                           a=wp)

    return wp
Exemplo n.º 22
0
def app():
    wp = jp.QuasarPage()
    h1 = jp.QDiv(a=wp,
                 text="Happiness across Weekdays",
                 classes="text-h4 text-center q-pa-md")

    hc = jp.HighCharts(a=wp, options=chart_def)
    x = [avg_rating_weekday.index[i][1] for i in range(7)]
    print(x)
    y = list(avg_rating_weekday['Rating'])
    print(y)
    hc.options.xAxis.categories = x
    hc.options.series[0].name = "all courses"
    hc.options.series[0].data = y
    return wp
Exemplo n.º 23
0
def app():

    wp = jp.QuasarPage()
    h1 = jp.QDiv(a=wp, text="Analysis of Course Reviews", classes="text-h3 text-center q-pa-md") # H1 Element
    p1 = jp.QDiv(a=wp, text="These graphs represent course review analysis", classes="text-body1") # p Element

    hc = jp.HighCharts(a=wp, options=chart_def)

    hc.options.xAxis.categories = list(month_average_crs.index)

    hc_data = [ {"name": course, "data": [rating for rating in month_average_crs[course]]} for course in month_average_crs.columns ]

    hc.options.series = hc_data

    return wp
    def serve(cls, req):
        wp = jp.QuasarPage(tailwind=True)

        lay = xp.DefaultLayout(a=wp, view="hHh lpR fFf")

        page_container = jp.QPageContainer(a=lay)

        div = jp.Div(a=page_container, classes="bg-gray-200 h-screen p-2")
        jp.Div(a=div, text="This is the Home page!", classes="text-4xl m-2")
        jp.Div(a=div,
               text="""
        afdgdfglk ;lsdfgldkfl; ;fmdfsjg;ij; kjsdoiugfjdsfdk
        """,
               classes="text-lg")
        return wp
Exemplo n.º 25
0
    def serve(cls, req):
        wp = jp.QuasarPage(tailwind=True)

        lay = layout.DefaultLayout(a=wp)
        container = jp.QPageContainer(a=lay)

        con = jp.Div(a=container, classes="bg-purple-300 m-24 p-10 rounded")
        jp.Div(a=con, text="This is the home page", classes="text-4xl m-2")
        jp.Div(a=con,
               text="""
        This website was created by Martin Slater, 18th February 2021
        using JustPy and Tailwind CSS
        """,
               classes="text-lg")
        return wp
Exemplo n.º 26
0
def app():
    wp = jp.QuasarPage()
    h1 = jp.QDiv(a=wp,
                 text="Analysis of Course Reviews",
                 classes="text-h4 text-center q-pa-md")

    hc = jp.HighCharts(a=wp, options=chart_def)
    hc.options.xAxis.categories = list(week_average.index)
    hc.options.series[0].data = list(week_average['Rating'])

    hc2 = jp.HighCharts(a=wp, options=chart_def2)
    hc2.options.xAxis.categories = list(month_average.index)
    hc2.options.series[0].data = list(month_average['Rating'])

    return wp
Exemplo n.º 27
0
def hint_test():
    wp = jp.QuasarPage()
    d = jp.Div(classes="q-pa-md q-gutter-lg", style="max-width: 300px", a=wp)
    input1 = jp.QInput(a=d, label='My Field', hint="This is my hint.")
    s1 = jp.QSelect(
        label='Select Company',
        a=d,
        color='orange',
        clearable=True,
        standout=True,
        bottom_slots=True,
        counter=True,
        hint='My hint',
        options=['Google', 'Facebook', 'Twitter', 'Apple', 'Oracle'])
    return wp
Exemplo n.º 28
0
def app():
    wp = jp.QuasarPage()
    h1 = jp.QDiv(a=wp,
                 text="Analysis of Course Reviews",
                 classes="text-h1 text-right text-bold q-pa-sm")
    p1 = jp.QDiv(a=wp,
                 text="There graphs represent course reviedw analysis",
                 classes='q-mt-xl')

    hc = jp.HighCharts(a=wp, options=chart_def)
    hc.options.title.text = "Average Rating by Day"
    hc.options.xAxis.categories = list(week_average.index)
    hc.options.series[0].data = list(week_average['Rating'])

    return wp
def app():

    wp = jp.QuasarPage()
    h1 = jp.QDiv(a=wp,
                 text="Analysis of Course Reviews",
                 classes="text-h3 text-center q-pa-md")  # H1 Element
    p1 = jp.QDiv(a=wp,
                 text="These graphs represent course review analysis",
                 classes="text-body1")  # p Element

    hc = jp.HighCharts(a=wp, options=chart_def)

    hc.options.xAxis.categories = list(month_average.index)
    hc.options.series[0].data = list(month_average['Rating'])

    return wp
Exemplo n.º 30
0
def app():
    wp = jp.QuasarPage()
    hc = jp.HighCharts(a=wp, options=contents)
    total = 0
    for i in share:
        total += i
    percent = []
    for i in range(len(share)):
        percent.append(share[i] * 100 / total)
    hc.options.series[0].data = []
    names = share.index
    for i in range(len(percent)):
        d = {"name": names[i], "y": percent[i]}
        hc.options.series[0].data.append(d)
    hc.options.title.text = "Percent ratings for each course"
    return wp