Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
17 changes: 17 additions & 0 deletions examples/sample/sample_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""This example demonstrates how to open/update a Streamlit application using nipanel package."""

import pathlib

import nipanel

script_path = pathlib.Path(__file__)
panel_script_path = str(script_path.with_name("sample_panel_2.py"))

panel = nipanel.StreamlitPanel(
panel_id="sample_panel_2",
streamlit_script_path=panel_script_path,
)
panel.set_value("sample_string", "Hello, World! #2")
panel.set_value("sample_int", 42)

print(f"Panel URL: {panel.panel_url}")
17 changes: 17 additions & 0 deletions examples/sample/sample_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""This example demonstrates how to open/update a Streamlit application using nipanel package."""

import pathlib

import nipanel

script_path = pathlib.Path(__file__)
panel_script_path = str(script_path.with_name("sample_panel_3.py"))

panel = nipanel.StreamlitPanel(
panel_id="sample_panel_3",
streamlit_script_path=panel_script_path,
)
panel.set_value("sample_string", "Hello, World #3!")
panel.set_value("float_values", [1.1, 2.2, 3.3])

print(f"Panel URL: {panel.panel_url}")
19 changes: 19 additions & 0 deletions examples/sample/sample_panel_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Streamlit application script for displaying values using nipanel package."""

import streamlit as st

import nipanel

panel = nipanel.initialize_panel()

st.title("Sample Panel Two")

col1, col2 = st.columns([0.4, 0.6])

with col1:
st.write("String")
st.write("Integer")

with col2:
st.write(panel.get_value("sample_string"))
st.write(panel.get_value("sample_int"))
19 changes: 19 additions & 0 deletions examples/sample/sample_panel_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Streamlit application script for displaying values using nipanel package."""

import streamlit as st

import nipanel

panel = nipanel.initialize_panel()

st.title("Sample Panel Three")

col1, col2 = st.columns([0.4, 0.6])

with col1:
st.write("String")
st.write("List")

with col2:
st.write(panel.get_value("sample_string"))
st.write(panel.get_value("float_values"))