Skip to content

Commit

Permalink
v 0.0.21
Browse files Browse the repository at this point in the history
krish-adi committed Feb 18, 2022
1 parent 5f7e8f2 commit 975c9ff
Showing 4 changed files with 31 additions and 22 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -2,10 +2,9 @@

All notable changes to this project will be documented in this file.

## [0.0.20] - 2022-02-18
## [0.0.21] - 2022-02-18
- Fix lineand bar chart typing and settings.
- Add app.map method for map settings.

## [0.0.19] - 2022-02-18
- Fix reevaluate error.
- Add error modal to the frontend.

2 changes: 1 addition & 1 deletion library/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = greppo
version = 0.0.20
version = 0.0.21
author = Adithya Krishnan and Sarma Tangirala
author_email = greppomail@gmail.com
description = Build responsive web-apps for geospatial applications.
20 changes: 12 additions & 8 deletions library/src/greppo/input_types/bar_chart.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
from dataclasses import dataclass
from typing import Any
from typing import Dict
from typing import List
from typing import List, Union

num = Union[int, float]
num_list = List[num]
num_num_list = Union[num, num_list]


@dataclass
class Dataset:
data: List[num_num_list]
label: str
backgroundColor: str
data: List[Any]


@dataclass
@@ -17,24 +21,24 @@ class ChartData:
datasets: List[Dataset]


# TODO doesn't handle multiple datasets.
# TODO handle multiple datasets.
@dataclass
class BarChart:
def __init__(
self,
name: str,
description: str,
x: List,
y: List,
color: str = "#000000",
x: List[num_num_list],
y: List[num_num_list],
color: str = "#CCCCCC",
description: str = '',
input_updates: Dict[str, Any] = {},
):
self.input_name = name
self.description = description
self.input_updates = input_updates

_, label = name.split("_")
dataset = Dataset(label=label, data=y, backgroundColor=color)
dataset = Dataset(label=label, data=y,backgroundColor=color)
self.chartdata = ChartData(labels=x, datasets=[dataset])

def get_value(self):
26 changes: 16 additions & 10 deletions library/src/greppo/input_types/line_chart.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
from dataclasses import dataclass
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import List, Union

num = Union[int, float]
num_list = List[num]
num_num_list = Union[num, num_list]


@dataclass
class Dataset:
data: List[num_num_list]
label: str
backgroundColor: str
data: List[Any]
borderColor: str
fill: bool = False
pointRadius = 10


@dataclass
@@ -18,24 +24,24 @@ class ChartData:
datasets: List[Dataset]


# TODO doesn't handle multiple datasets.
# TODO handle multiple datasets.
@dataclass
class LineChart:
def __init__(
self,
name: str,
description: Optional[str],
x: List,
y: List,
color: str = "#000000",
x: List[num_num_list],
y: List[num_num_list],
color: str = "#CCCCCC",
description: str = '',
input_updates: Dict[str, Any] = {},
):
self.input_name = name
self.description = description
self.input_updates = input_updates

_, label = name.split("_")
dataset = Dataset(label=label, data=y, backgroundColor=color)
dataset = Dataset(label=label, data=y,backgroundColor=color, borderColor=color)
self.chartdata = ChartData(labels=x, datasets=[dataset])

def get_value(self):

0 comments on commit 975c9ff

Please sign in to comment.