Skip to content

Commit

Permalink
Python3.8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahAhianyo committed Apr 29, 2024
1 parent 69b3f1b commit e46cd60
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dashboard/graphs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Library of customized graphs and tables for the dashboard."""
from typing import Dict, List, Union

import reflex as rx


Expand Down Expand Up @@ -30,7 +32,7 @@ def stat_card(title: str, stat, delta) -> rx.Component:
)


def table(tabular_data: list[list]):
def table(tabular_data: List[List]):
return rx.table.root(
rx.table.header(
rx.table.row(
Expand Down Expand Up @@ -58,7 +60,7 @@ class Line(rx.Base):
stroke: str


def line_chart(data: rx.Var | list[dict], data_key: str, lines: list[Line]):
def line_chart(data: Union[rx.Var, List[dict]], data_key: str, lines: List[Line]):
return card(
rx.recharts.line_chart(
*[
Expand All @@ -74,7 +76,7 @@ def line_chart(data: rx.Var | list[dict], data_key: str, lines: list[Line]):
)


def pie_chart(data: rx.Var | list[dict], data_key: str, name_key: str):
def pie_chart(data: Union[rx.Var, List[dict]], data_key: str, name_key: str):
return card(
rx.recharts.pie_chart(
rx.recharts.pie(
Expand All @@ -97,7 +99,7 @@ class Area(rx.Base):
fill: str


def area_chart(data: rx.Var | list[dict], data_key: str, areas: list[Area]):
def area_chart(data: Union[rx.Var, List[Dict]], data_key: str, areas: List[Area]):
return card(
rx.recharts.area_chart(
*[
Expand Down

0 comments on commit e46cd60

Please sign in to comment.