Skip to content

Commit

Permalink
Version 0.47.2 (streamlit#212)
Browse files Browse the repository at this point in the history
* Restore correct vertical spacing for report elements.

* Break Block.tsx into more functions.

* Tiny refactors in Block.tsx

* Add "key" property to element in DocString, to avoid warnings.

* Fix streamlit#1230: OSError not caught when writing cache to disk

* Don't show hashing warning when user imports a module inside a cached function.

* Fix streamlit#6: report should loads element by element (was broken since Sidebar PR)

* Try to fix CircleCI issue: Method 'renderElementWithErrorBoundary' expected no return value

* Add typing to function.

* Remove unecessary dockerfiles

* Fix a bunch of examples

* Fix color of syntax error code in modal dialog.

* Remove old style copyright from conftest.py

* Remove st.warning when hashing a class.

* Add astor to Python requirements

* Update widget API in some e2e tests

* Clean up st.foo_widget() signatures in st.help()

* Lint docs/getting_started.md

* Clean up widget examples in docstrings.

* Add comment to slider examples in docs.

* Tweak Streamlit's description in setup.py

* Sort pipfile modules

* Re-add scripts and Makefile rules to publish packages to conda.

* Fix update_version.py to support new conda location and remove old docker folder.

* Make `streamlit config show` pipeable to a file.

* Update docs/ site

* Remove /docs/api invalidation from Makefile

* Improve docstring for st.slider

* Remove st.Cache (capital C) from __init__ while we figure out what to call it.

* Up version to 0.45.0

* Turn off tests for st.Cache (capital C)

* Try turning off tests again

* [docs] Add analytics; redirect /secret/docs; fix compilation problem (streamlit#149)

* Restore correct vertical spacing for report elements.

* Break Block.tsx into more functions.

* Tiny refactors in Block.tsx

* Add "key" property to element in DocString, to avoid warnings.

* Fix streamlit#1230: OSError not caught when writing cache to disk

* Don't show hashing warning when user imports a module inside a cached function.

* Fix streamlit#6: report should loads element by element (was broken since Sidebar PR)

* Try to fix CircleCI issue: Method 'renderElementWithErrorBoundary' expected no return value

* Add typing to function.

* Remove unecessary dockerfiles

* Fix a bunch of examples

* Fix color of syntax error code in modal dialog.

* Remove old style copyright from conftest.py

* Remove st.warning when hashing a class.

* Add astor to Python requirements

* Update widget API in some e2e tests

* Clean up st.foo_widget() signatures in st.help()

* Lint docs/getting_started.md

* Clean up widget examples in docstrings.

* Add comment to slider examples in docs.

* Tweak Streamlit's description in setup.py

* Sort pipfile modules

* Re-add scripts and Makefile rules to publish packages to conda.

* Fix update_version.py to support new conda location and remove old docker folder.

* Make `streamlit config show` pipeable to a file.

* Update docs/ site

* Remove /docs/api invalidation from Makefile

* Improve docstring for st.slider

* Remove st.Cache (capital C) from __init__ while we figure out what to call it.

* Up version to 0.45.0

* Turn off tests for st.Cache (capital C)

* Try turning off tests again

* Publish docs to both /docs and /secret/docs, until we deprecate /secret/docs in January.

* Improve docs site: add analytics, redirect from secret/docs/, fix DeltaGenerator docs bug

* Fix publish-docs in Makefile

* Fix hashing error message that printed as a tuple.

Also made other error messages use textwrap.dedent for clarity.

* Hide legend from native charts when data has only 1 column.

* Beautify sidebar, make it usable on mobile, and improve colors in general. (streamlit#209)

* Visual pass on sidebar (including toggle for mobile)

* Update doc in server.port to mention liveSave.

* Update bootstrap alert boxes

* Improve sidebar icons.

* Update .info color

* Fix Matplotlib crash on OS X (streamlit#190)

* Fix matplotlib

* Test

* Add matplotlib to dev Pipfile since our unit tests now depend on it.

* Make Python-2.7.16 lockfile install matplotlib.

* no-op

* Fix MPLBACKEND in "base" integration tests

* Only set matplotlib backend on darwin.

* Fix bootstrap_test.py

* Reset Widget State (streamlit#45)

* A solution

* Button, Checkbox, Radio, TextInput

* Selectbox

* TextArea

* Time Input

* Date Input

* Slider

* Make ESLint happy

* Make pytest happy

* Solution using React keys

* Copypasta

* Better description of widget id

* Disable multiselect default value for now

* Resolve merge conflicts

* Fix DeltaGenerator

* Remove rws example

* RWS using _do_widget_boilerplate

* Refactor _do_widget_boilerplate

* Fix ScriptRunner tests

* Resolve merge conflicts

* Forgot to clean the log

* Now it works

* Fix streamlit#173 - ChunkLoadError alert (streamlit#192)

* ChunkLoadError alert

* Adding F5 to the message

* Adding F5 to the message

* New error message

* Delete vega_lite_chart snapshot

* Creating vega_lite_chart snapshot

* add_rows compatibility with python 2 and unit tests (streamlit#202)

* add_rows compatibility with python 2 and unit tests

* dataframe_visuals snapshot

* Multiselect default value (streamlit#201)

* initial code

* linter

* unit tests

* linter

* removing unused code

* e2e wip

* use strings in default

* darwin snapshot and test update

* linux snapshots

* comparing to string type in a way python2 likes

* new snapshot

* new snapshots

* trying to fix e2e test

* trying to fix e2e test agaon

* Remove unnecessary wrapper classed "streamlit-container"

* Fix bug where widgets caused scripts to run twice

* Fix e2e tests since reports have different width now

* Add missing snapshots

* Make altair a prod dependency

* Update screenshots

* Fix run_e2e_tests.sh

* Improve hello.py

* Unset bootstrap styles for styletron.

* Improve progress bar CSS in sidebar

* Support line_chart add_rows with non-Range index

* Improve a couple examples/

* Improve titles of error dialogs in App.js

* Make "make with Streamlit" a little lighter.

* Fix add_rows crash

* Improve hello.py text

* Make <pre> in <alert> have transparent background

* Fix empty dataframe breakage, introduced with aa0dd56

* Update markdown e2e test to make it less flaky

* Fix refenrence.py add_rows.

* Fix scrollability with arrow keys.

* Version 0.47.0

* Small hello.py tweaks

* Make hello.py work with emojis in Py2

* Update snapshots.

* Fix z-index of Vega Lite FAB

* Fix add_rows bug in JS, when orig line_chart as empty

* Replace add_rows assert with exception

* Make pop-up menu text darker in user widgets

* Fix add_rows test

* Update NOTICES

* Update snapshots

* Improve documentation for Streamlit launch (streamlit#197)

* Simplification of the get started materials.

* Fixed RST link in the GSG. There are still two placeholder links in that doc. Also, added mock for the advanced concepts. Still incomplete. Will fill in content based on what Amanda sends over.

* Removing list of text commands from the get started guide. Updating advanced concepts

* Fixing index toc.

* Changing from interactive app to data explorer app.

* Adding the link to GitHub.

* Addressing comments from @jrhone.

* Updating text on GSG page.

* Adding sidebar to GSG.

* Adding main concepts. Removing core mechanics. Fixing links.

* Fixing broken anchor links. Adding updated image from TC.

* Updated image from TC.

* Increase version-check probability to 10%

* Fix Vega-Lite cropped bottom axis bug.

* Set minimum altair version in Pipfile so we can pass numpy arrays to line_chart.

* Improve docs

* Version 0.47.1

* Fix link in docs.

* Add YouTube video to docs.

* Fix streamlit#222: import urllib in hello.py

* Version 0.47.2

* [docs] Update changelog, add py2 warning about magic, remove conda, fix links

* [docs] Remove outdated reference to old streamlit hello

* [docs] Fix "getting_stated" code about progress()

* Add forgotten item to changelog.

* Fix Vega Lite tests

* Update snapshots
  • Loading branch information
tvst authored Oct 3, 2019
1 parent 0295ef0 commit 2096181
Show file tree
Hide file tree
Showing 66 changed files with 587 additions and 452 deletions.
26 changes: 13 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand Down
214 changes: 80 additions & 134 deletions NOTICES

Large diffs are not rendered by default.

60 changes: 41 additions & 19 deletions docs/advanced_concepts.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,60 @@
# Advanced concepts

Now that you've mastered Streamlit's main concepts, let's take a look at some advanced functionality, like styling data, adjusting the order of elements in a report, and adding animations.
Now that you've mastered Streamlit's main concepts, let's take a look at some
advanced functionality, like styling data, adjusting the order of elements in a
report, and adding animations.

```eval_rst
.. note::
We're adding these sections as quickly as we can, but please let us know what's important to you. Ping us in the `community forum <https://discuss.streamlit.io/>`_.
We're adding these sections as quickly as we can, but please let us know
what's important to you. Ping us in the `community forum
<https://discuss.streamlit.io/>`_.
```

## Display and style data

There are a few ways to display data (tables, arrays, data frames) in Streamlit apps. In [getting started](getting_started.md), you were introduced to *magic* and [`st.write()`](api.html#streamlit.write), which can be used to write anything from text to tables. Now let's take a look at methods designed specifically for visualizing data.
There are a few ways to display data (tables, arrays, data frames) in Streamlit
apps. In [getting started](getting_started.md), you were introduced to _magic_
and [`st.write()`](api.html#streamlit.write), which can be used to write
anything from text to tables. Now let's take a look at methods designed
specifically for visualizing data.

You might be asking yourself, "why wouldn't I always use st.write()?" There are
a few reasons:

1. *Magic* and [`st.write()`](api.html#streamlit.write) inspect the type of data that you've passed in, and then decide how to best render it in the app. Sometimes you want to draw it another way. For example, instead of drawing a dataframe as an interactive table, you may want to draw it as a static table by using st.table(df).
2. The second reason is that other methods return an object that can be used and modified, either by adding data to it or replacing it.
3. Finally, if you use a more specific Streamlit method you can pass additional arguments to customize its behavior.

For example, let's create a data frame and change its formatting with a Pandas `Styler` object. In this example, you'll use Numpy to generate a random sample, and the [`st.dataframe()`](api.html#streamlit.dataframe) method to draw an interactive table.
1. _Magic_ and [`st.write()`](api.html#streamlit.write) inspect the type of
data that you've passed in, and then decide how to best render it in the
app. Sometimes you want to draw it another way. For example, instead of
drawing a dataframe as an interactive table, you may want to draw it as a
static table by using st.table(df).
2. The second reason is that other methods return an object that can be used
and modified, either by adding data to it or replacing it.
3. Finally, if you use a more specific Streamlit method you can pass additional
arguments to customize its behavior.

For example, let's create a data frame and change its formatting with a Pandas
`Styler` object. In this example, you'll use Numpy to generate a random sample,
and the [`st.dataframe()`](api.html#streamlit.dataframe) method to draw an
interactive table.

```eval_rst
.. note::
This example uses Numpy to generate a random sample, but you can use Pandas DataFrames, Numpy arrays, or plain Python arrays.
This example uses Numpy to generate a random sample, but you can use Pandas
DataFrames, Numpy arrays, or plain Python arrays.
```

```Python
dataframe = numpy.random.randn(10, 20)
st.dataframe(dataframe)
```

Let's expand on the first example using the Pandas `Styler` object to highlight some elements in the interactive table.
Let's expand on the first example using the Pandas `Styler` object to highlight
some elements in the interactive table.

```eval_rst
.. note::
If you used PIP to install Streamlit, you'll need to install Jinja2 to use the Styler object. To install Jinja2, run: pip install jinja2.
If you used PIP to install Streamlit, you'll need to install Jinja2 to use
the Styler object. To install Jinja2, run: pip install jinja2.
```

```Python
Expand All @@ -44,7 +65,8 @@ dataframe = pandas.DataFrame(
st.dataframe(dataframe.style.highlight_max(axis=0))
```

Streamlit also has a method for static table generation: [`st.table()`](api.html#streamlit.table).
Streamlit also has a method for static table generation:
[`st.table()`](api.html#streamlit.table).

```Python
dataframe = pandas.DataFrame(
Expand Down Expand Up @@ -108,11 +130,6 @@ status_text.text('Done!')
st.balloons()
```

```eval_rst
.. tip::
You can see this example live. Just run `streamlit hello` from the command line.
```

## Append data to a table or chart

In Streamlit, you can not only replace entire elements in your app, but also
Expand Down Expand Up @@ -140,8 +157,13 @@ chart.add_rows(data2)

## Return the value of a Streamlit call

Coming soon! Ping us in the [community forum](https://discuss.streamlit.io/) if you just can't wait and have to have this info immediately.
Coming soon! Ping us in the [community forum](https://discuss.streamlit.io/) if
you just can't wait and have to have this info immediately.

## Advanced caching

Coming soon! Ping us in the [community forum](https://discuss.streamlit.io/) if you just can't wait and have to have this info immediately.
Coming soon! Ping us in the [community forum](https://discuss.streamlit.io/) if
you just can't wait and have to have this info immediately.

Meanwhile, for an intro to caching in Streamlit, see the [data explorer
tutorial](tutorial/create_a_data_explorer_app.md).
5 changes: 5 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ magic off in your `~/.streamlit/config.toml` with the following setting:
magicEnabled = false
```

```eval_rst
.. important:: Right now, Magic only works on Python 3.
```

## Display text

Streamlit apps usually start with a call to `st.title` to set the
Expand Down Expand Up @@ -124,6 +128,7 @@ With widgets, Streamlit allows you to bake interactivity directly into your apps
.. autofunction:: streamlit.checkbox
.. autofunction:: streamlit.radio
.. autofunction:: streamlit.selectbox
.. autofunction:: streamlit.multiselect
.. autofunction:: streamlit.slider
.. autofunction:: streamlit.text_input
.. autofunction:: streamlit.text_area
Expand Down
19 changes: 19 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@ See highlights, bug fixes, and known issues for Streamlit releases:
$ pip install --upgrade streamlit
```

## Version 0.47.0

_Release date: October 1, 2019_

**Highlights:**

- 🌄 New hello.py showing off 4 glorious Streamlit apps. Try it out!
- 🔄 Streamlit now automatically selects an unused port when 8501 is already in use.
- 🎁 Sidebar support is now out of beta! Just start any command with `st.sidebar.` instead of `st.`
- ⚡ Performance improvements: we added a cache to our websocket layer so we no longer re-send data to the browser when it hasn't changed between runs
- 📈 Our "native" charts `st.line_chart`, `st.area_chart` and `st.bar_chart` now use Altair behind the scenes
- 🔫 Improved widgets: custom st.slider labels; default values in multiselect
- 🕵️‍♀️ The filesystem watcher now ignores hidden folders and virtual environments
- 💅 Plus lots of polish around caching and widget state management

**Breaking change:**

- 🛡️ We have temporarily disabled support for sharing static "snapshots" of Streamlit apps. Now that we're no longer in a limited-access beta, we need to make sure sharing is well thought through and abides by laws like the DMCA. But we're working on a solution!

## Version 0.46.0

_Release date: September 19, 2019_
Expand Down
98 changes: 63 additions & 35 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ Use the links below to jump to a specific section:
Before you get started, you're going to need a few things:

- Your favorite IDE or text editor
- [Python 2.7.0 or later / Python 3.6.x or later](https://www.python.org/downloads/)
- [Python 2.7.0 or later / Python 3.6.x or
later](https://www.python.org/downloads/)
- [PIP](https://pip.pypa.io/en/stable/installing/)
- [Streamlit](index.md) - This one's kind of important, so don't forget to install.
- [Streamlit](index.md) — This one's kind of important, so don't forget to
install.

If you haven't already, take a few minutes to read through [Main concepts](main_concepts.md) to
understand Streamlit's data flow model.
If you haven't already, take a few minutes to read through [Main
concepts](main_concepts.md) to understand Streamlit's data flow model.

## Set up your virtual environment

Expand Down Expand Up @@ -82,12 +84,14 @@ st.title('My first app')
```

That's it! Your report has a title. You can use specific text functions to add
content to your report, or you can use [`st.write()`](api.html#streamlit.write) and add your own markdown.
content to your report, or you can use [`st.write()`](api.html#streamlit.write)
and add your own markdown.

### Write a data frame

Along with [magic commands](api.html#magic-commands), [`st.write()`](api.html#streamlit.write)
is Streamlit's "Swiss Army knife". You can pass almost anything to [`st.write()`](api.html#streamlit.write):
Along with [magic commands](api.html#magic-commands),
[`st.write()`](api.html#streamlit.write) is Streamlit's "Swiss Army knife". You
can pass almost anything to [`st.write()`](api.html#streamlit.write):
text, data, Matplotlib figures, Altair charts, and more. Don't worry, Streamlit
will figure it out and render things the right way.

Expand All @@ -99,21 +103,28 @@ st.write(pandas.DataFrame({
}))
```

There are other data specific functions like [`st.dataframe()`](api.html#streamlit.dataframe) and [`st.table()`](api.html#streamlit.table)
that you can also use for displaying data. Check our advanced guides on
displaying data to understand when to use these features and how to add colors
and styling to your data frames.
There are other data specific functions like
[`st.dataframe()`](api.html#streamlit.dataframe) and
[`st.table()`](api.html#streamlit.table) that you can also use for displaying
data. Check our advanced guides on displaying data to understand when to use
these features and how to add colors and styling to your data frames.

```eval_rst
.. tip::
For this guide we're using small amounts of data so that we can move quickly. You can check out our `Tutorial on creating a data explorer <tutorial/create_a_data_explorer_app.html>`_ to see an example of how to load data from an API and use `@st.cache <api.html#streamlit.cache>`_ to cache it.
For this guide we're using small amounts of data so that we can move
quickly. You can check out our `Tutorial on creating a data explorer
<tutorial/create_a_data_explorer_app.html>`_ to see an example of how to
load data from an API and use `@st.cache <api.html#streamlit.cache>`_ to
cache it.
```

## Use magic

You can also write to your app without calling any Streamlit
methods. Streamlit supports "[magic commands](api.html#magic-commands)," which means you don't have to
use [`st.write()`](api.html#streamlit.write) at all! Try replacing the code above with this snippet:
If you're using Python 3, you can also write to your app without calling any
Streamlit methods. Streamlit supports "[magic
commands](api.html#magic-commands)," which means you don't have to use
[`st.write()`](api.html#streamlit.write) at all! Try replacing the code above
with this snippet:

```Python
"""
Expand All @@ -129,16 +140,22 @@ df = pandas.DataFrame({
df
```

How it works is simple. Any time that Streamlit sees a variable or a literal value on its own line, it automatically writes that to your app using [`st.write()`](api.html#streamlit.write). For more information, refer to the documentation on [magic commands](api.html#magic-commands).
How it works is simple. Any time that Streamlit sees a variable or a literal
value on its own line, it automatically writes that to your app using
[`st.write()`](api.html#streamlit.write). For more information, refer to the
documentation on [magic commands](api.html#magic-commands).

## Draw charts and maps

Streamlit supports several popular data charting libraries like [Matplotlib, Altair, Deck.Gl, and more](api.html#display-charts). In this section, you'll add a bar chart, line chart, and a map to your app.
Streamlit supports several popular data charting libraries like [Matplotlib,
Altair, Deck.Gl, and more](api.html#display-charts). In this section, you'll
add a bar chart, line chart, and a map to your app.

### Draw a line chart

You can easily add a line chart to your app with [`st.line_chart()`](api.html#streamlit.line_chart).
We'll generate a random sample using Numpy and then chart it.
You can easily add a line chart to your app with
[`st.line_chart()`](api.html#streamlit.line_chart). We'll generate a random
sample using Numpy and then chart it.

```Python
chart_data = pandas.DataFrame(
Expand All @@ -165,15 +182,14 @@ st.map(map_data)
## Add interactivity with widgets

With widgets, Streamlit allows you to bake interactivity directly into your
apps with checkboxes, buttons, sliders, and more. Check out our [API reference](api.md)
for a full list of interactive widgets.

apps with checkboxes, buttons, sliders, and more. Check out our [API
reference](api.md) for a full list of interactive widgets.

### Use checkboxes to show/hide data

One use case for checkboxes is to hide or show a specific chart or section in
an app. [`st.checkbox()`](api.html#streamlit.checkbox) takes a single argument, which
is the widget label. In this sample, the checkbox is used to toggle a
an app. [`st.checkbox()`](api.html#streamlit.checkbox) takes a single argument,
which is the widget label. In this sample, the checkbox is used to toggle a
conditional statement.

```Python
Expand All @@ -187,8 +203,10 @@ if st.checkbox('Show dataframe'):

### Use a selectbox for options

Use [`st.selectbox`](api.html#streamlit.selectbox) to choose from a series. You can
write in the options you want, or pass through an array or data frame column.
Use [`st.selectbox`](api.html#streamlit.selectbox) to choose from a series. You
can write in the options you want, or pass through an array or data frame
column.

Let's use the `df` data frame we created earlier.

```Python
Expand All @@ -201,7 +219,9 @@ option = st.selectbox(

### Put widgets in a sidebar

For a cleaner look, you can move your widgets into a sidebar. This keeps your app central, while widgets are pinned to the left. Let's take a look at how you can use [`st.sidebar()`](api.html#streamlit.sidebar) in your app.
For a cleaner look, you can move your widgets into a sidebar. This keeps your
app central, while widgets are pinned to the left. Let's take a look at how you
can use [`st.sidebar()`](api.html#streamlit.sidebar) in your app.

```Python
option = st.sidebar.selectbox(
Expand All @@ -211,10 +231,16 @@ option = st.sidebar.selectbox(
'You selected:', option
```

Most of the elements you can put into the main part of your app with an
`st.something()` call can also be put into a sidebar with
`st.sidebar.something()`. The only exceptions right now are `st.write` (you
should use `st.sidebar.markdown()` instead), `st.echo`, and `st.spinner`. Rest
assured, though, we're currently working on adding support for those too!

## Show progress

When adding long running computations to an app, you can use [`st.progess()`](api.html#streamlit.progress)
to display status in real time.
When adding long running computations to an app, you can use
[`st.progess()`](api.html#streamlit.progress) to display status in real time.

First, let's import time. We're going to use the `time.sleep()` method to
simulate a long running computation:
Expand Down Expand Up @@ -246,9 +272,11 @@ for i in range(100):
That's it for getting started, now you can go and build your own apps! If you
run into difficulties here are a few things you can do.

* Check out our [community forum](https://discuss.streamlit.io/) and post a question
* Quick help from command line with `$ streamlit --help`
* Read more documentation! Check out:
* [Tutorials](tutorial/index.md) to make an app
* [Advanced concepts](advanced_concepts.md) for things like caching and inserting elements out of order
* [API reference](api.md) for examples of every Streamlit command
- Check out our [community forum](https://discuss.streamlit.io/) and post a
question
- Quick help from command line with `$ streamlit --help`
- Read more documentation! Check out:
- [Tutorials](tutorial/index.md) to make an app
- [Advanced concepts](advanced_concepts.md) for things like caching and
inserting elements out of order
- [API reference](api.md) for examples of every Streamlit command
Loading

0 comments on commit 2096181

Please sign in to comment.