Py.Cafe

stichbury/

vizro-interactive-data-visualization

Interactive Data Visualization with Vizro

DocsPricing
  • app.py
  • requirements.txt
  • text.md
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
from vizro import Vizro
import vizro.models as vm


def read_markdown_file(file_path):
    try:
        with open(file_path, 'r', encoding='utf-8') as file:
            content = file.read()
        return content
    except FileNotFoundError:
        print(f"The file {file_path} does not exist.")
        return None
    except Exception as e:
        print(f"An error occurred: {e}")
        return None

# Read and print the content of text.md
file_path = 'text.md'
markdown_content = read_markdown_file(file_path)


first_page = vm.Page(
    title="Visualizing data science insights. Vizro by QuantumBlack Labs, AI by McKinsey",
    layout=vm.Layout(grid=[[0]]),
    components=[
        vm.Card(
            text=markdown_content
        ),
    ],
)

dashboard = vm.Dashboard(pages=[first_page])
Vizro().build(dashboard).run()