Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-485: update dictionary app #490

Merged
merged 2 commits into from
Sep 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions apps/col_add_entry.py

This file was deleted.

45 changes: 45 additions & 0 deletions apps/col_dictionary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import os
from os.path import join

import streamlit as st
import streamlit.components.v1 as components

st.set_page_config(
page_title="Dictionary App",
layout="wide",
)

json_viewer_build_dir = join(
os.path.dirname(os.path.abspath(__file__)),
"components", "json_viewer", "component", "frontend", "build"
)
json_viewer = components.declare_component(
"json_viewer",
path=json_viewer_build_dir
)

# SIDEBAR
add_selectbox = st.sidebar.text_input('Word', value="gà")

# MAIN
st.write('# Dictionary')
st.text_input('Word', key=1, value="gà")
data = [
{
"description": "(Động vật học) Loài chim nuôi (gia cầm) để lấy thịt và trứng, bay kém, mỏ cứng, con trống có cựa và biết gáy.",
"tag": "noun",
"examples": [
"Bán gà ngày gió, bán chó ngày mưa. (tục ngữ)",
"Gà người gáy, gà nhà ta sáng. (tục ngữ)"
]
},
{
"description": "Đánh cuộc riêng trong một ván bài tổ tôm hay tài bàn ngoài số tiền góp chính",
"tag": "verb",
"examples": [
"Gà lần nào cũng thua thì đánh làm gì."
]
}
]

output_data = json_viewer(json_object=data, label=0)
2 changes: 1 addition & 1 deletion apps/components/json_viewer/component/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import streamlit.components.v1 as components
import streamlit as st

_RELEASE = False
_RELEASE = True

if _RELEASE:
root_dir = os.path.dirname(os.path.abspath(__file__))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"files": {
"main.js": "./static/js/main.ee7180e8.chunk.js",
"main.js.map": "./static/js/main.ee7180e8.chunk.js.map",
"runtime-main.js": "./static/js/runtime-main.723788a6.js",
"runtime-main.js.map": "./static/js/runtime-main.723788a6.js.map",
"static/js/2.5b8594be.chunk.js": "./static/js/2.5b8594be.chunk.js",
"static/js/2.5b8594be.chunk.js.map": "./static/js/2.5b8594be.chunk.js.map",
"index.html": "./index.html",
"precache-manifest.98ae7f8f21e9dfea38c2aa5dcc10e9eb.js": "./precache-manifest.98ae7f8f21e9dfea38c2aa5dcc10e9eb.js",
"service-worker.js": "./service-worker.js",
"static/js/2.5b8594be.chunk.js.LICENSE.txt": "./static/js/2.5b8594be.chunk.js.LICENSE.txt"
},
"entrypoints": [
"static/js/runtime-main.723788a6.js",
"static/js/2.5b8594be.chunk.js",
"static/js/main.ee7180e8.chunk.js"
]
}
Loading