Skip to content

Commit

Permalink
Merge 547f9d8 into 691f104
Browse files Browse the repository at this point in the history
  • Loading branch information
jdbocarsly authored Nov 27, 2024
2 parents 691f104 + 547f9d8 commit b5b1335
Show file tree
Hide file tree
Showing 7 changed files with 260 additions and 85 deletions.
6 changes: 4 additions & 2 deletions pydatalab/src/pydatalab/routes/v0_1/graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def get_graph_cy_format(item_id: Optional[str] = None, collection_id: Optional[s
drawn_elements = set()
node_collections = set()
for document in all_documents:
for relationship in document.get("relationships", []):
# for some reason, document["relationships"] is sometimes equal to None, so we
# need this `or` statement.
for relationship in document.get("relationships") or []:
# only considering child-parent relationships
if relationship.get("type") == "collections" and not collection_id:
collection_data = flask_mongo.db.collections.find_one(
Expand Down Expand Up @@ -113,7 +115,7 @@ def get_graph_cy_format(item_id: Optional[str] = None, collection_id: Optional[s
)
continue

for relationship in document.get("relationships", []):
for relationship in document.get("relationships") or []:
# only considering child-parent relationships:
if relationship.get("relation") not in ("parent", "is_part_of"):
continue
Expand Down
3 changes: 2 additions & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
"crypto-browserify": "^3.12.0",
"cytoscape": "^3.23.0",
"cytoscape-cola": "^2.5.1",
"cytoscape-dagre": "^2.4.0",
"cytoscape-elk": "^2.1.0",
"cytoscape-euler": "^1.2.3",
"cytoscape-fcose": "^2.2.0",
"date-fns": "^2.29.3",
"highlight.js": "^11.7.0",
"markdown-it": "^13.0.1",
Expand Down
1 change: 1 addition & 0 deletions webapp/src/components/CollectionSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
multiple
label="collection_id"
:filterable="false"
placeholder="type to search..."
@search="debouncedAsyncSearch"
>
<template #no-options="{ searching }">
Expand Down
Loading

0 comments on commit b5b1335

Please sign in to comment.