Py.Cafe

lokesh.jain/

mantine-base-setup

Product Trend Analysis with Dash

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# check out https://dash.plotly.com/ for documentation
# And check out https://py.cafe/maartenbreddels for more examples
from dash import Dash, Input, Output, callback, dcc, html

import dash_mantine_components as dmc
from dash_iconify import DashIconify

app = Dash(__name__)
md = """
# Dash demo

See [The dash examples index](https://dash-example-index.herokuapp.com/) for more examples.
"""

app.layout = dmc.MantineProvider(
    html.Div(
        style={"background":"gray"},
        children=[
            dcc.Markdown(children=md, link_target="_blank"),
            dcc.Dropdown(id="dropdown", options=["red", "green", "blue", "orange"]),
            dcc.Markdown(id="markdown", children=["## Hello World"]),
            dmc.Box(
                bg="white",
                w="280",
                p="sm",
            children=[
                dmc.Text("This was change by Lokesh", c="dimmed"),
                dmc.Stack(
                    gap="sm",
                    mt="md",
                    children=[
                    dmc.Group(
                        [
                            dmc.Text("Product", fw=600),
                            dmc.Text("p232434")
                        ],
                        justify="space-between"
                    ),
                    dmc.Box(
                        dmc.Group([
                        DashIconify(icon="ph:arrow-down"),
                        dmc.Text(
                        "Change log: changes by 20% ",
                        size="xs",
                        fw=500,
                        )
                    ]),
                    bg="gray.1",
                    p="sm"
                        
                    ),
                    dmc.Group(
                        children=[
                            dmc.Text(243434,  px="xs", bg="gray.1"),
                            DashIconify(icon="ph:arrow-right"),
                            dmc.Text(243434,  px="xs", bg="gray.1"),
                        ]
                    ),
            ]),
            ])
        ]

    )
)


@callback(
    Output("markdown", "style"),
    Input("dropdown", "value"),
)
def update_markdown_style(color):
    return {"color": color}