Skip to content

Commit 88e6f9c

Browse files
authored
0.7.5 (#27)
* GraphGPT input field replaced with text area. Better JSON parsing added * Additional UI data output * Dependencies updated * Sample images added. * Generator Radio toggles fix
1 parent a92099f commit 88e6f9c

16 files changed

+489
-1320
lines changed

Pipfile

-14
This file was deleted.

Pipfile.lock

-820
This file was deleted.

README.md

-8
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,5 @@ poetry update
1515
poetry run streamlit run graph_data_generator_streamlit/app.py
1616
```
1717

18-
or
19-
20-
```
21-
pipenv shell
22-
pipenv sync
23-
pipenv run streamlit run graph_data_generator_streamlit/app.py
24-
```
25-
2618
## Testing with local packages
2719
`poetry add --editable /path/to/package`

graph_data_generator_streamlit/app.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@
55
from ui.design_ui import arrows_ui, generators_ui
66
from ui.ideate_ui import ideate_ui
77
from ui.export_ui import export_ui
8+
from ui.samples_ui import samples_list
9+
from graph_data_generator import start_logging
810
import logging
911

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

17+
# Uncomment to start graph_data_generator logging
18+
# start_logging()
19+
1520
# LOAD any env
1621
neo4j_uri = st.secrets.get("NEO4J_URI", None)
1722
if "NEO4J_URI" not in st.session_state:
@@ -37,6 +42,8 @@
3742
st.session_state["ARROWS_DICT"] = None
3843
if "JSON_CONFIG" not in st.session_state:
3944
st.session_state["JSON_CONFIG"] = None
45+
if "SAMPLE_IMAGES" not in st.session_state:
46+
st.session_state["SAMPLE_IMAGES"] = []
4047

4148

4249
# Header
@@ -69,4 +76,8 @@
6976

7077
# Side bar
7178
with st.sidebar:
72-
generators_ui()
79+
tab1, tab2 = st.tabs(["Generators", "Samples"])
80+
with tab1:
81+
generators_ui()
82+
with tab2:
83+
samples_list()
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

graph_data_generator_streamlit/ui/design_ui.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,13 @@ def generators_ui():
7272
key = f'{generator.name}_{arg.label}'
7373
))
7474
if arg.type == GeneratorType.BOOL:
75+
options = ["True", "False"]
76+
default = str(arg.default)
77+
default_index = options.index(default)
7578
arg_inputs.append(st.radio(
7679
label=arg.label,
77-
index=arg.default,
80+
index=default_index,
81+
options = options,
7882
key = f'{generator.name}_{arg.label}'
7983
))
8084
if arg.type == GeneratorType.DATETIME:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import streamlit as st
2+
import os
3+
import logging
4+
from PIL import Image
5+
6+
directory = 'graph_data_generator_streamlit/images/'
7+
8+
9+
def samples_list():
10+
if len(st.session_state["SAMPLE_IMAGES"]) == 0:
11+
filenames = os.listdir(directory)
12+
filenames.sort()
13+
for filename in filenames:
14+
try:
15+
image = Image.open(os.path.join(directory, filename))
16+
st.image(image, caption=f'{filename}')
17+
st.session_state["SAMPLE_IMAGES"].append((image, filename))
18+
except Exception as e:
19+
logging.error(e)
20+
else:
21+
for image_filename in st.session_state["SAMPLE_IMAGES"]:
22+
st.image(image_filename[0], caption=image_filename[1])

poetry.lock

+444-472
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "mock-graph-data-generator-streamlit"
3-
version = "0.7.3"
3+
version = "0.7.5"
44
description = ""
55
authors = ["Jason Koo <jalakoo@gmail.com>"]
66
readme = "README.md"
@@ -9,17 +9,19 @@ packages = [{include = "graph_data_generator_streamlit"}]
99
[tool.poetry.dependencies]
1010
python = "^3.11"
1111
streamlit = ">=1.27,<2.0"
12-
neo4j-uploader = {path = "/Users/jasonkoo/neo4j/repos/neo4j-uploader", develop = true}
1312
pyclip = ">=0.7,<1.0"
14-
graph-data-generator = ">=0.3.2"
1513
neo4j = "^5.14.1"
1614
streamlit-agraph = "^0.0.45"
1715
openai = "^0.28.1"
16+
opencv-python = "^4.8.1.78"
17+
pillow = "^10.1.0"
18+
graph-data-generator = "0.4.0"
19+
neo4j-uploader = "^0.4.1"
1820

1921

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

2325
[build-system]
2426
requires = ["poetry-core"]
25-
build-backend = "poetry.core.masonry.api"
27+
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)