Skip to content

Commit

Permalink
Add some more todos
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrahoang686 committed Aug 2, 2023
1 parent 587e79b commit 7863b60
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 24 deletions.
29 changes: 17 additions & 12 deletions stac_ipyleaflet/widgets/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
# @NOTE: This should be an extension of the IPYLEAFLET Class. Currently it is just being passed
# in instead due to import errors


# @TODO: Fix linting errors caused by inferred inheritance and just pass in params instead


# @TODO: Break out shared logic between widgets into a utilities directory
class DrawControlWidget:
def template(self, **kwargs) -> Box(style={"max_height: 200px"}):
main = self
Expand Down Expand Up @@ -35,15 +37,16 @@ def template(self, **kwargs) -> Box(style={"max_height: 200px"}):
tabs = {}

for i in range(2):
tabs[f'child{i}'] = (main.interact_widget.children[0]
.children[i]
.children[0]
.children[0]
.children
)

point_tab_children = tabs['child0']
area_tab_children = tabs['child1']
tabs[f"child{i}"] = (
main.interact_widget.children[0]
.children[i]
.children[0]
.children[0]
.children
)

point_tab_children = tabs["child0"]
area_tab_children = tabs["child1"]

aoi_coords = area_tab_children[1]
aoi_clear_button = area_tab_children[2]
Expand All @@ -59,8 +62,10 @@ def handle_draw(self, action, geo_json, **kwargs):
main.aoi_coordinates = []
main.aoi_bbox = ()

if('Coordinates' in point_tab_children[1].value):
area_tab_children[1].value = "<code>Waiting for points of interest...</code>"
if "Coordinates" in point_tab_children[1].value:
area_tab_children[
1
].value = "<code>Waiting for points of interest...</code>"

if action == "created":
if geo_json["geometry"]:
Expand Down
30 changes: 18 additions & 12 deletions stac_ipyleaflet/widgets/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ class LayerData:

# @NOTE: This should be an extension of the IPYLEAFLET Class. Currently it is just being passed
# in instead due to import errors


# @TODO: Break out shared logic between widgets into a utilities directory
class InspectControlWidget:
def template(
self, applied_layers, interact_widget, make_get_request, titiler_endpoint
):
main = self

# @TODO-CLEANUP: Create only one DrawControl and pass in the attributes instead
draw_control = DrawControl(
edit=False,
Expand All @@ -39,15 +42,16 @@ def template(
tabs = {}

for i in range(2):
tabs[f'child{i}'] = (main.interact_widget.children[0]
.children[i]
.children[0]
.children[0]
.children
)

point_tab_children = tabs['child0']
area_tab_children = tabs['child1']
tabs[f"child{i}"] = (
main.interact_widget.children[0]
.children[i]
.children[0]
.children[0]
.children
)

point_tab_children = tabs["child0"]
area_tab_children = tabs["child1"]

point_data = point_tab_children[1]
clear_button = point_tab_children[2]
Expand Down Expand Up @@ -114,8 +118,10 @@ def handle_clear(event):
return

self.coordinates = []
if('Coordinates' in area_tab_children[1].value):
area_tab_children[1].value = "<code>Waiting for area of interest...</code>"
if "Coordinates" in area_tab_children[1].value:
area_tab_children[
1
].value = "<code>Waiting for area of interest...</code>"

if action == "created":
if geo_json["geometry"] and geo_json["geometry"]["type"] == "Point":
Expand Down

0 comments on commit 7863b60

Please sign in to comment.