Skip to content

Commit

Permalink
0.7.5 (#27)
Browse files Browse the repository at this point in the history
* GraphGPT input field replaced with text area. Better JSON parsing added

* Additional UI data output

* Dependencies updated

* Sample images added. 

* Generator Radio toggles fix
  • Loading branch information
jalakoo authored Dec 10, 2023
1 parent a92099f commit 88e6f9c
Show file tree
Hide file tree
Showing 16 changed files with 489 additions and 1,320 deletions.
14 changes: 0 additions & 14 deletions Pipfile

This file was deleted.

820 changes: 0 additions & 820 deletions Pipfile.lock

This file was deleted.

8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,5 @@ poetry update
poetry run streamlit run graph_data_generator_streamlit/app.py
```

or

```
pipenv shell
pipenv sync
pipenv run streamlit run graph_data_generator_streamlit/app.py
```

## Testing with local packages
`poetry add --editable /path/to/package`
13 changes: 12 additions & 1 deletion graph_data_generator_streamlit/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@
from ui.design_ui import arrows_ui, generators_ui
from ui.ideate_ui import ideate_ui
from ui.export_ui import export_ui
from ui.samples_ui import samples_list
from graph_data_generator import start_logging
import logging

# SETUP
st.set_page_config(layout="wide",initial_sidebar_state='collapsed')
logging.getLogger().setLevel(logging.DEBUG)
logging.info(f'App Started')

# Uncomment to start graph_data_generator logging
# start_logging()

# LOAD any env
neo4j_uri = st.secrets.get("NEO4J_URI", None)
if "NEO4J_URI" not in st.session_state:
Expand All @@ -37,6 +42,8 @@
st.session_state["ARROWS_DICT"] = None
if "JSON_CONFIG" not in st.session_state:
st.session_state["JSON_CONFIG"] = None
if "SAMPLE_IMAGES" not in st.session_state:
st.session_state["SAMPLE_IMAGES"] = []


# Header
Expand Down Expand Up @@ -69,4 +76,8 @@

# Side bar
with st.sidebar:
generators_ui()
tab1, tab2 = st.tabs(["Generators", "Samples"])
with tab1:
generators_ui()
with tab2:
samples_list()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion graph_data_generator_streamlit/ui/design_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ def generators_ui():
key = f'{generator.name}_{arg.label}'
))
if arg.type == GeneratorType.BOOL:
options = ["True", "False"]
default = str(arg.default)
default_index = options.index(default)
arg_inputs.append(st.radio(
label=arg.label,
index=arg.default,
index=default_index,
options = options,
key = f'{generator.name}_{arg.label}'
))
if arg.type == GeneratorType.DATETIME:
Expand Down
22 changes: 22 additions & 0 deletions graph_data_generator_streamlit/ui/samples_ui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import streamlit as st
import os
import logging
from PIL import Image

directory = 'graph_data_generator_streamlit/images/'


def samples_list():
if len(st.session_state["SAMPLE_IMAGES"]) == 0:
filenames = os.listdir(directory)
filenames.sort()
for filename in filenames:
try:
image = Image.open(os.path.join(directory, filename))
st.image(image, caption=f'{filename}')
st.session_state["SAMPLE_IMAGES"].append((image, filename))
except Exception as e:
logging.error(e)
else:
for image_filename in st.session_state["SAMPLE_IMAGES"]:
st.image(image_filename[0], caption=image_filename[1])
916 changes: 444 additions & 472 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mock-graph-data-generator-streamlit"
version = "0.7.3"
version = "0.7.5"
description = ""
authors = ["Jason Koo <[email protected]>"]
readme = "README.md"
Expand All @@ -9,17 +9,19 @@ packages = [{include = "graph_data_generator_streamlit"}]
[tool.poetry.dependencies]
python = "^3.11"
streamlit = ">=1.27,<2.0"
neo4j-uploader = {path = "/Users/jasonkoo/neo4j/repos/neo4j-uploader", develop = true}
pyclip = ">=0.7,<1.0"
graph-data-generator = ">=0.3.2"
neo4j = "^5.14.1"
streamlit-agraph = "^0.0.45"
openai = "^0.28.1"
opencv-python = "^4.8.1.78"
pillow = "^10.1.0"
graph-data-generator = "0.4.0"
neo4j-uploader = "^0.4.1"


[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
build-backend = "poetry.core.masonry.api"

0 comments on commit 88e6f9c

Please sign in to comment.