From 74caf8df9c6d503513cf36c4c90627db2fa4a9f3 Mon Sep 17 00:00:00 2001 From: David Bau Date: Wed, 23 Mar 2022 14:53:58 -0400 Subject: [PATCH] Add comment. --- baulab/show.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/baulab/show.py b/baulab/show.py index 40f3475..b3a4870 100644 --- a/baulab/show.py +++ b/baulab/show.py @@ -1,12 +1,20 @@ # show.py # # An abbreviated way to output simple HTML layout of text and images -# into a python notebook. +# into a python notebook. You can call show(x, y, z) just like you +# call display(x, y, z) in a notebook, but there are a few differences: # -# - show a PIL image to show an inline HTML . -# - show an array of items to vertically stack them, centered in a block. -# - show an array of arrays to horizontally lay them out as inline blocks. -# - show an array of tuples to create a table. +# (1) You can display PIL images and maplotlib figures, and they are +# represented as HTML images that can be seen. +# (2) You can display lists of data, and nested lists, and they are +# displayed as layouts where the list elements are arranged either +# horizontally or vertically inside a flexbox layout, depending on +# the level of nesting. This is useful for creating layouts. +# (3) You can construct HTML that can be customized by the caller. +# For example, showing the `style(width=50)` object will customize +# the next element shown to have CSS style `width:50px`. +# The HTML widget framework uses this facility, to provide +# interactive widgets that are easy to style. import PIL.Image import base64