-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
anh.vu2
committed
Sep 12, 2021
1 parent
f0b15b5
commit 283b749
Showing
9 changed files
with
53 additions
and
52 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
8 changes: 4 additions & 4 deletions
8
apps/components/json_viewer/component/frontend/build/asset-manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
{ | ||
"files": { | ||
"main.js": "./static/js/main.d10f9d91.chunk.js", | ||
"main.js.map": "./static/js/main.d10f9d91.chunk.js.map", | ||
"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.62c0bc516be77e6eb09560a8155d8a3b.js": "./precache-manifest.62c0bc516be77e6eb09560a8155d8a3b.js", | ||
"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.d10f9d91.chunk.js" | ||
"static/js/main.ee7180e8.chunk.js" | ||
] | ||
} |
2 changes: 1 addition & 1 deletion
2
apps/components/json_viewer/component/frontend/build/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<!doctype html><html lang="en"><head><title>Streamlit Component</title><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Streamlit Component"/><link rel="stylesheet" href="bootstrap.min.css"/></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,i,l=t[0],a=t[1],f=t[2],c=0,s=[];c<l.length;c++)i=l[c],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&s.push(o[i][0]),o[i]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(p&&p(t);s.length;)s.shift()();return u.push.apply(u,f||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,l=1;l<r.length;l++){var a=r[l];0!==o[a]&&(n=!1)}n&&(u.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={1:0},u=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="./";var l=this.webpackJsonpstreamlit_json_view=this.webpackJsonpstreamlit_json_view||[],a=l.push.bind(l);l.push=t,l=l.slice();for(var f=0;f<l.length;f++)t(l[f]);var p=a;r()}([])</script><script src="./static/js/2.5b8594be.chunk.js"></script><script src="./static/js/main.d10f9d91.chunk.js"></script></body></html> | ||
<!doctype html><html lang="en"><head><title>Streamlit Component</title><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Streamlit Component"/><link rel="stylesheet" href="bootstrap.min.css"/></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,i,l=t[0],a=t[1],f=t[2],c=0,s=[];c<l.length;c++)i=l[c],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&s.push(o[i][0]),o[i]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(p&&p(t);s.length;)s.shift()();return u.push.apply(u,f||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,l=1;l<r.length;l++){var a=r[l];0!==o[a]&&(n=!1)}n&&(u.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={1:0},u=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="./";var l=this.webpackJsonpstreamlit_json_view=this.webpackJsonpstreamlit_json_view||[],a=l.push.bind(l);l.push=t,l=l.slice();for(var f=0;f<l.length;f++)t(l[f]);var p=a;r()}([])</script><script src="./static/js/2.5b8594be.chunk.js"></script><script src="./static/js/main.ee7180e8.chunk.js"></script></body></html> |
22 changes: 0 additions & 22 deletions
22
...son_viewer/component/frontend/build/precache-manifest.62c0bc516be77e6eb09560a8155d8a3b.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
apps/components/json_viewer/component/frontend/build/static/js/main.d10f9d91.chunk.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
apps/components/json_viewer/component/frontend/build/static/js/main.d10f9d91.chunk.js.map
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters