# Justpy Tutorial demo basic_example 
# Basic Example       
#      
# generated by write_as_demo  at 2022-11-15T06:54:10.922989+00:00 
# 
# see https://justpy.io/blog/ag-grid_to_web_page#basic-example
import justpy as jp
import pandas as pd

# Load data showing percent of women in different majors per year
wm = pd.read_csv('https://elimintz.github.io/women_majors.csv').round(2)

def basic_example():
    """
    basic AG Grid example reading a csv file and displaying it in a grid
    """
    wp = jp.WebPage()
    wm.jp.ag_grid(a=wp)  # a=wp adds the grid to WebPage wp
    return wp

# initialize the demo
from examples.basedemo import Demo
Demo("basic_example", basic_example)
