Skip to content
Snippets Groups Projects
pyscript.html 2.19 KiB
Newer Older
  • Learn to ignore specific revisions
  • <!DOCTYPE html>
    <html>
    
        <head>
            <meta charset="utf-8">
            <meta http-equiv="X-UA-Compatible" content="IE=edge">
            <title></title>
            <meta name="description" content="">
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
    
    nickgrifasi's avatar
    nickgrifasi committed
            <link rel="stylesheet" href="pyscript.css">
    
            <script defer src="https://pyscript.net/alpha/pyscript.js"></script>
            <py-env>
                - matplotlib
                - pandas
                - paths:
                    - ./InteractionPrototype.csv_merged_result_unannotated.csv
            </py-env>
        </head>
    
    nickgrifasi's avatar
    nickgrifasi committed
    
        <h1 id="header"> OpenDSA Visualizations Dashboard</h1>
    
    
        <body>
            <div id="matplotlib-lineplot"> </div>
            <py-script output="matplotlib-lineplot">
                # Python Code
                 #importing pandas
                import pandas
                df = pandas.read_csv('./InteractionPrototype.csv_merged_result_unannotated.csv')
                # importing the matplotlib library
                import matplotlib.pyplot as plt
                fig, ax = plt.subplots()
                # x axis
                x = ["FF Event", "Document Event", "Other Event", "Window Event"]
                # y axis
                y = [10, 5, 9, 7]
                plt.plot(x, y, marker='o', linestyle='-', color='b')
                # Naming the x-label
                plt.xlabel('Event Names')
                # Naming the y-label
                plt.ylabel('Num Events')
                # Naming the title of the plot
                plt.title('Event Name vs Num Events')
                fig
            </py-script>
    
            <div id="matplotlib-bar"></div>
            <py-script output="matplotlib-bar">
            # Python Code
            # importing the matplotlib library
            import matplotlib.pyplot as plt
            fig, ax = plt.subplots()
            # x axis
            x = ["Away Time", "Reading Time", "Other"]
            # y axis
            y = [300, 520, 60]
            plt.bar(x, y)
            # Naming the x-label
            plt.xlabel('Time Type')
            # Naming the y-label
            plt.ylabel('Score')
            # Naming the title of the plot
            plt.title('Time Type vs Time')
            fig
         </py-script>