File tree Expand file tree Collapse file tree 2 files changed +3
-23
lines changed Expand file tree Collapse file tree 2 files changed +3
-23
lines changed Original file line number Diff line number Diff line change 11"""This example demonstrates how to open/update a Streamlit application using nipanel package."""
22
3- import itertools
4- import math
53import pathlib
64
75import nipanel
1816panel .set_value ("sample_int" , 42 )
1917panel .set_value ("sample_float" , 3.14 )
2018panel .set_value ("sample_bool" , True )
21-
22- x_values = [
23- float (x ) for x in itertools .takewhile (lambda p : p < 2 * math .pi , itertools .count (0 , 0.05 ))
24- ]
25- y_values = [math .sin (x ) for x in x_values ]
26- panel .set_value ("x_values" , x_values )
27- panel .set_value ("y_values" , y_values )
19+ panel .set_value ("float_values" , [1.1 , 2.2 , 3.3 ])
2820
2921input ("Press Enter to close the panel..." )
3022
Original file line number Diff line number Diff line change 11"""Streamlit application script for displaying values using nipanel package."""
22
3- import pandas as pd
43import streamlit as st
54
65import nipanel
1615 st .write ("Integer" )
1716 st .write ("Float" )
1817 st .write ("Boolean" )
19- st .write ("Line " )
18+ st .write ("List " )
2019
2120with col2 :
2221 st .write (panel .get_value ("sample_string" ))
2322 st .write (panel .get_value ("sample_int" ))
2423 st .write (panel .get_value ("sample_float" ))
2524 st .write (panel .get_value ("sample_bool" ))
26- st .line_chart (
27- data = pd .DataFrame (
28- {
29- "x" : panel .get_value ("x_values" ),
30- "y" : panel .get_value ("y_values" ),
31- }
32- ),
33- x = "x" ,
34- y = "y" ,
35- x_label = "x" ,
36- y_label = "sin(x)" ,
37- )
25+ st .write (panel .get_value ("float_values" ))
You can’t perform that action at this time.
0 commit comments