Skip to content

Commit

Permalink
Merge pull request #269 from calkit/foil2
Browse files Browse the repository at this point in the history
Add support for rendering Plotly JSON and HTML figures
  • Loading branch information
petebachant authored Jan 8, 2025
2 parents 6bf8cbe + 25a8b87 commit a0bb822
Show file tree
Hide file tree
Showing 8 changed files with 2,454 additions and 187 deletions.
8 changes: 2 additions & 6 deletions backend/app/api/routes/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,12 +849,8 @@ def get_project_contents(
in_repo=os.path.isdir(os.path.join(repo.working_dir, dirname)),
)
# We're looking for a file
# Check if it exists in the repo,
# but only if it doesn't exist in the DVC outputs
if (
os.path.isfile(os.path.join(repo_dir, path))
and ck_outs.get(path) is None
):
# Check if it exists in the repo
if os.path.isfile(os.path.join(repo_dir, path)):
with open(os.path.join(repo_dir, path), "rb") as f:
content = f.read()
return ContentsItem.model_validate(
Expand Down
2 changes: 1 addition & 1 deletion backend/app/dvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def output_from_pipeline(
size: 9536
"""
stage = pipeline.get("stages", {}).get(stage_name)
stage = pipeline.get("stages", {}).get(stage_name.split("@")[0])
if stage is None:
return
wdir = stage.get("wdir", "")
Expand Down
2 changes: 1 addition & 1 deletion backend/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ class Question(SQLModel, table=True):
class Figure(SQLModel):
path: str
title: str
description: str
description: str | None = None
stage: str | None = None
dataset: str | None = None
content: str | None = None # Base64 encoded
Expand Down
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies = [
"stripe==10.11.0",
"mixpanel==4.10.1",
"gcsfs==2024.10.0",
"calkit-python>=0.10.1",
"calkit-python>=0.12.0",
]

[tool.uv]
Expand Down
18 changes: 14 additions & 4 deletions backend/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a0bb822

Please sign in to comment.