From a61710967aa31781722a2588d03d5678e4334307 Mon Sep 17 00:00:00 2001 From: Prithvi Prabhu Date: Thu, 6 Aug 2020 23:53:09 -0700 Subject: [PATCH] Release 0.1.2 --- docs/index.html | 241 ++++++++++++++++++++++++++++++++++- docs/types.html | 230 +++++++++++++++++++++++++++++++-- docs/ui.html | 99 ++++++++++++-- py/README.rst | 74 ----------- py/docs/index.md | 88 +++++++++++++ py/examples/requirements.txt | 2 +- py/setup.py | 2 +- 7 files changed, 639 insertions(+), 97 deletions(-) diff --git a/docs/index.html b/docs/index.html index 85996290b0..15a09c6d96 100644 --- a/docs/index.html +++ b/docs/index.html @@ -103,6 +103,143 @@

Cheat Sheet

TODO

Graphics

TODO

+

Change Log

+

Migration Guide

Before you begin, it is highly recommended that you download a release and run the interactive tour.py that ships with the release to get a feel for what Q programs look like in practice.

What has changed?

@@ -216,7 +353,28 @@

Breaking changes

listen('/my/app/route', main)

Removed: q.dashboard() and q.notebook().

-

Every page in Q is a dashboard page. Instead of creating a separate dashboard or notebook, simply add cards to a page and arrange it the way you want. Cards can be created by using one of the several ui.*_card() APIs. Also see the dashboard, layout and sizing examples to learn how to lay out several cards on a page.

+

Every page in Q is a dashboard page. Instead of creating a separate dashboard or notebook, simply add cards to a page and arrange it the way you want. Cards can be created by using one of the several ui.*_card() APIs. Also see the dashboard, layout and sizing examples to learn how to lay out several cards on a page.

+

If you want to display a notebook-style vertical stack of markdown, html or other content, use text() and frame() contained inside a form_card(), like this:

+

Before:

+
ui.notebook([ui.notebook_section([
+  ui.markdown_cell(content='Foo'),
+  ui.frame_cell(source=html_foo, height='200px'),
+  ui.markdown_cell(content='Bar'),
+  ui.frame_cell(source=html_bar, height='200px'),
+])])
+
+
+

After: Note the parameter name change frame_cell(source=...) to frame(content=...).

+
ui.form_cell(
+  box='1 5 2 4', 
+  items=[
+    ui.text(content='Foo'),
+    ui.frame(content=html_foo, height='200px'),
+    ui.text(content='Bar'),
+    ui.frame(content=html_bar, height='200px'),
+  ],
+)
+

Changed: buttons(), expander() and tabs() accept a list of items instead of var args *args.

Before:

ui.buttons(ui.button(...), ui.button(...), ui.button(...))
@@ -1808,6 +1966,82 @@ 

Form / File Upload

] ) +page.save() +
+

Form / Frame

+

Use a frame component in a form card to display HTML content inline.

+
from h2o_q import site, ui
+
+html = '''
+<!DOCTYPE html>
+<html>
+<body>
+  <h1>Hello World!</h1>
+</body>
+</html>
+'''
+
+page = site['/demo']
+
+page['example'] = ui.form_card(
+    box='1 1 2 2',
+    items=[
+        ui.frame(content=html, height='100px')
+    ]
+)
+
+page.save()
+
+

Form / Frame / Path

+

Use a frame component in a form card to display external web pages.

+
from h2o_q import site, ui
+
+page = site['/demo']
+
+page['example'] = ui.form_card(
+    box='1 1 6 5',
+    items=[
+        ui.frame(path='https://example.com', height='400px')
+    ]
+)
+
+page.save()
+
+

Frame

+

Use a frame card to display HTML content.

+
from h2o_q import site, ui
+
+html = '''
+<!DOCTYPE html>
+<html>
+<body>
+  <h1>Hello World!</h1>
+</body>
+</html>
+'''
+
+page = site['/demo']
+
+page['example'] = ui.frame_card(
+    box='1 1 2 2',
+    title='Example',
+    content=html,
+)
+
+page.save()
+
+

Frame / Path

+

Use a frame card to display external web pages.

+
from h2o_q import site, ui
+
+page = site['/demo']
+
+page['example'] = ui.frame_card(
+    box='1 1 6 5',
+    title='Example',
+    path='https://example.com',
+)
+
 page.save()
 

Lists

@@ -4438,6 +4672,7 @@

Index

  • Basics
  • Cheat Sheet
  • Graphics
  • +
  • Change Log
  • Migration Guide
  • +

    Frame

    + +
  • +
  • FrameCard

    • box
    • diff --git a/docs/ui.html b/docs/ui.html index df5d35925b..bbcaa61ee5 100644 --- a/docs/ui.html +++ b/docs/ui.html @@ -1151,6 +1151,30 @@

      Module h2o_q.ui

      )) +def frame( + path: Optional[str] = None, + content: Optional[str] = None, + width: Optional[str] = None, + height: Optional[str] = None, +) -> Component: + """Create a new inline frame (an `iframe`). + + Args: + path: The path or URL of the web page, e.g. `/foo.html` or `http://example.com/foo.html` + content: The HTML content of the page. A string containing `<html>...</html>`. + width: The width of the frame, e.g. `200px`, `50%`, etc. Defaults to `100%`. + height: The height of the frame, e.g. `200px`, `50%`, etc. Defaults to `150px`. + Returns: + A `h2o_q.types.Frame` instance. + """ + return Component(frame=Frame( + path, + content, + width, + height, + )) + + def component( text: Optional[Text] = None, text_xl: Optional[TextXl] = None, @@ -1180,6 +1204,7 @@

      Module h2o_q.ui

      link: Optional[Link] = None, tabs: Optional[Tabs] = None, expander: Optional[Expander] = None, + frame: Optional[Frame] = None, ) -> Component: """Create a component. @@ -1212,6 +1237,7 @@

      Module h2o_q.ui

      link: Link. tabs: Tabs. expander: Expander. + frame: Frame Returns: A `h2o_q.types.Component` instance. """ @@ -1244,6 +1270,7 @@

      Module h2o_q.ui

      link, tabs, expander, + frame, ) @@ -1275,15 +1302,15 @@

      Module h2o_q.ui

      content: Optional[str] = None, commands: Optional[List[Command]] = None, ) -> FrameCard: - """Render a card containing a HTML page inside an inline frame (iframe). + """Render a card containing a HTML page inside an inline frame (an `iframe`). Either a path or content can be provided as arguments. Args: box: A string indicating how to place this component on the page. title: The title for this card. - path: The path or URL of the web page, e.g. '/foo.html' or 'http://example.com/foo.html' - content: The HTML content of the page. A string containing '<html>...</html>' + path: The path or URL of the web page, e.g. `/foo.html` or `http://example.com/foo.html` + content: The HTML content of the page. A string containing `<html>...</html>` commands: Contextual menu commands for this component. Returns: A `h2o_q.types.FrameCard` instance. @@ -2952,7 +2979,7 @@

      Returns

      -def component(text: Union[Text, NoneType] = None, text_xl: Union[TextXl, NoneType] = None, text_l: Union[TextL, NoneType] = None, text_m: Union[TextM, NoneType] = None, text_s: Union[TextS, NoneType] = None, text_xs: Union[TextXs, NoneType] = None, label: Union[Label, NoneType] = None, separator: Union[Separator, NoneType] = None, progress: Union[Progress, NoneType] = None, message_bar: Union[MessageBar, NoneType] = None, textbox: Union[Textbox, NoneType] = None, checkbox: Union[Checkbox, NoneType] = None, toggle: Union[Toggle, NoneType] = None, choice_group: Union[ChoiceGroup, NoneType] = None, checklist: Union[Checklist, NoneType] = None, dropdown: Union[Dropdown, NoneType] = None, combobox: Union[Combobox, NoneType] = None, slider: Union[Slider, NoneType] = None, spinbox: Union[Spinbox, NoneType] = None, date_picker: Union[DatePicker, NoneType] = None, color_picker: Union[ColorPicker, NoneType] = None, button: Union[Button, NoneType] = None, buttons: Union[Buttons, NoneType] = None, file_upload: Union[FileUpload, NoneType] = None, table: Union[Table, NoneType] = None, link: Union[Link, NoneType] = None, tabs: Union[Tabs, NoneType] = None, expander: Union[Expander, NoneType] = None) ‑> Component +def component(text: Union[Text, NoneType] = None, text_xl: Union[TextXl, NoneType] = None, text_l: Union[TextL, NoneType] = None, text_m: Union[TextM, NoneType] = None, text_s: Union[TextS, NoneType] = None, text_xs: Union[TextXs, NoneType] = None, label: Union[Label, NoneType] = None, separator: Union[Separator, NoneType] = None, progress: Union[Progress, NoneType] = None, message_bar: Union[MessageBar, NoneType] = None, textbox: Union[Textbox, NoneType] = None, checkbox: Union[Checkbox, NoneType] = None, toggle: Union[Toggle, NoneType] = None, choice_group: Union[ChoiceGroup, NoneType] = None, checklist: Union[Checklist, NoneType] = None, dropdown: Union[Dropdown, NoneType] = None, combobox: Union[Combobox, NoneType] = None, slider: Union[Slider, NoneType] = None, spinbox: Union[Spinbox, NoneType] = None, date_picker: Union[DatePicker, NoneType] = None, color_picker: Union[ColorPicker, NoneType] = None, button: Union[Button, NoneType] = None, buttons: Union[Buttons, NoneType] = None, file_upload: Union[FileUpload, NoneType] = None, table: Union[Table, NoneType] = None, link: Union[Link, NoneType] = None, tabs: Union[Tabs, NoneType] = None, expander: Union[Expander, NoneType] = None, frame: Union[Frame, NoneType] = None) ‑> Component

      Create a component.

      @@ -3014,6 +3041,8 @@

      Args

      Tabs.
      expander
      Expander.
      +
      frame
      +
      Frame

      Returns

      A Component instance.

      @@ -3050,6 +3079,7 @@

      Returns

      link: Optional[Link] = None, tabs: Optional[Tabs] = None, expander: Optional[Expander] = None, + frame: Optional[Frame] = None, ) -> Component: """Create a component. @@ -3082,6 +3112,7 @@

      Returns

      link: Link. tabs: Tabs. expander: Expander. + frame: Frame Returns: A `h2o_q.types.Component` instance. """ @@ -3114,6 +3145,7 @@

      Returns

      link, tabs, expander, + frame, )
      @@ -3495,11 +3527,57 @@

      Returns

      )
      +
      +def frame(path: Union[str, NoneType] = None, content: Union[str, NoneType] = None, width: Union[str, NoneType] = None, height: Union[str, NoneType] = None) ‑> Component +
      +
      +

      Create a new inline frame (an iframe).

      +

      Args

      +
      +
      path
      +
      The path or URL of the web page, e.g. /foo.html or http://example.com/foo.html
      +
      content
      +
      The HTML content of the page. A string containing <html>...</html>.
      +
      width
      +
      The width of the frame, e.g. 200px, 50%, etc. Defaults to 100%.
      +
      height
      +
      The height of the frame, e.g. 200px, 50%, etc. Defaults to 150px.
      +
      +

      Returns

      +

      A Frame instance.

      +
      + +Expand source code + +
      def frame(
      +        path: Optional[str] = None,
      +        content: Optional[str] = None,
      +        width: Optional[str] = None,
      +        height: Optional[str] = None,
      +) -> Component:
      +    """Create a new inline frame (an `iframe`).
      +
      +    Args:
      +        path: The path or URL of the web page, e.g. `/foo.html` or `http://example.com/foo.html`
      +        content: The HTML content of the page. A string containing `<html>...</html>`.
      +        width: The width of the frame, e.g. `200px`, `50%`, etc. Defaults to `100%`.
      +        height: The height of the frame, e.g. `200px`, `50%`, etc. Defaults to `150px`.
      +    Returns:
      +        A `h2o_q.types.Frame` instance.
      +    """
      +    return Component(frame=Frame(
      +        path,
      +        content,
      +        width,
      +        height,
      +    ))
      +
      +
      def frame_card(box: str, title: str, path: Union[str, NoneType] = None, content: Union[str, NoneType] = None, commands: Union[List[Command], NoneType] = None) ‑> FrameCard
      -

      Render a card containing a HTML page inside an inline frame (iframe).

      +

      Render a card containing a HTML page inside an inline frame (an iframe).

      Either a path or content can be provided as arguments.

      Args

      @@ -3508,9 +3586,9 @@

      Args

      title
      The title for this card.
      path
      -
      The path or URL of the web page, e.g. '/foo.html' or 'http://example.com/foo.html'
      +
      The path or URL of the web page, e.g. /foo.html or http://example.com/foo.html
      content
      -
      The HTML content of the page. A string containing '…'
      +
      The HTML content of the page. A string containing <html>...</html>
      commands
      Contextual menu commands for this component.
      @@ -3527,15 +3605,15 @@

      Returns

      content: Optional[str] = None, commands: Optional[List[Command]] = None, ) -> FrameCard: - """Render a card containing a HTML page inside an inline frame (iframe). + """Render a card containing a HTML page inside an inline frame (an `iframe`). Either a path or content can be provided as arguments. Args: box: A string indicating how to place this component on the page. title: The title for this card. - path: The path or URL of the web page, e.g. '/foo.html' or 'http://example.com/foo.html' - content: The HTML content of the page. A string containing '<html>...</html>' + path: The path or URL of the web page, e.g. `/foo.html` or `http://example.com/foo.html` + content: The HTML content of the page. A string containing `<html>...</html>` commands: Contextual menu commands for this component. Returns: A `h2o_q.types.FrameCard` instance. @@ -6611,6 +6689,7 @@

      Index

    • file_upload
    • flex_card
    • form_card
    • +
    • frame
    • frame_card
    • graphics_card
    • grid_card
    • diff --git a/py/README.rst b/py/README.rst index f5ea029f80..f46cd3a929 100644 --- a/py/README.rst +++ b/py/README.rst @@ -63,77 +63,3 @@ Links .. _pip: https://pip.pypa.io/en/stable/quickstart/ -Change Log ---------------- -* v0.1.1 - * Added - * Options for file type and size to file upload component. - * API for displaying desktop notifications. - * Buttons can now submit specific values instead of only True/False. - * Examples for layout and card sizing. - * Image card for displaying base64-encoded images. - * Example for image card. - * Vector graphics API. - * Turtle graphics based path generator. - * Examples for graphics card. - * Fixed - * Re-rendering performance improvements. -* v0.1.0 - * Added - * Example for displaying iframe content > 2MB. - * Example for plotting using matplotlib. - * Example for plotting using Altair. - * Example for plotting using Vega. - * Example for plotting using Bokeh. - * Example for plotting using custom D3.js Javascript. - * Example for live dashboard with stats cards. - * Example for master-detail user interfaces using ``ui.table()``. - * Example for authoring multi-step wizard user interfaces. - * Unload API: ``q.unload()`` to delete uploaded files. -* v0.0.7 - * Added - * Download API: ``q.download()``. - * Vega-lite support: ``ui.vega_card()``. - * Context menu support to all cards. - * ``refresh`` attribute on ``meta_card`` allows static pages to stop receiving live updates. - * Passing ``-debug`` when starting server displays site stats at ``/_d/site``. - * Drag and drop support for file upload component. - * Template expression support for markdown cards. - * All APIs and examples documented. - * All 110 examples now ship with the Sphinx documentation. - * Documentation now ships with release download. - * Changed - * API consistency: ``ui.vis()`` renamed to ``ui.plot()``. - * All stats cards now have descriptive names. - * API consistency: ``ui.mark.mark`` renamed to ``ui.mark.type``. - * API consistency: ``page.sync()`` and ``page.push()`` renamed to ``page.save()``. - * Removed - * ``ui.dashboard_card()`` and ``ui.notebook_card()``. -* v0.0.6 - * Added - * Log network traffic when logging is set to debug mode. - * Capture and display unhandled exceptions on the UI. - * Routing using location hash. - * Toolbar component. - * Tabs component. - * Nav component. - * Upload API: ``q.upload()``. - * Changed - * ``q.session`` renamed to ``q.user`` -* v0.0.5 - * Added - * Add configure() API to configure environment before launching. -* v0.0.4 - * Added - * Multi-user and multi-client support: launch apps in ``multicast`` or ``unicast`` modes in addition to ``broadcast`` mode. - * Client-specific data can now be stored and accessed via ``q.client``, similar to ``q.session`` and ``q.app``. - * Simpler page referencing: ``import site`` can be used instead of ``site = Site()``. - * Changed - * Apps now lauch in ``unicast`` mode by default instead of ``broadcast`` mode. -* v0.0.3 - * Added - * Make ``Expando`` data structure available for apps. -* v0.0.2 - * Initial version -* v0.0.1 - * Package stub diff --git a/py/docs/index.md b/py/docs/index.md index 97e575f8bc..a4513d1fc0 100644 --- a/py/docs/index.md +++ b/py/docs/index.md @@ -18,6 +18,94 @@ TODO TODO +# Change Log + +- v0.1.2 + - Added + - API for `h2o_q.core.Expando` copy, clone and item/attribute deletion. + - Migration guide. + - Example for setting browser window title. + - API and example for Header card: `h2o_q.ui.header_card()`. + - Export `h2o_q.core.Ref` from `h2o_q`. + - API and examples for inline frames inside form cards: `h2o_q.ui.frame()`. + - Changed + - Renamed env var prefix for settings to `H2O_Q_`. + - Fixed + - Plot X/Y axis transpose bug. +- v0.1.1 + - Added + - Options for file type and size to file upload component. + - API for displaying desktop notifications. + - Buttons can now submit specific values instead of only True/False. + - Examples for layout and card sizing. + - Image card for displaying base64-encoded images. + - Example for image card. + - Vector graphics API. + - Turtle graphics based path generator. + - Examples for graphics card. + - Fixed + - Re-rendering performance improvements. +- v0.1.0 + - Added + - Example for displaying iframe content > 2MB. + - Example for plotting using matplotlib. + - Example for plotting using Altair. + - Example for plotting using Vega. + - Example for plotting using Bokeh. + - Example for plotting using custom D3.js Javascript. + - Example for live dashboard with stats cards. + - Example for master-detail user interfaces using `ui.table()`. + - Example for authoring multi-step wizard user interfaces. + - Unload API: `q.unload()` to delete uploaded files. +- v0.0.7 + - Added + - Download API: `q.download()`. + - Vega-lite support: `ui.vega_card()`. + - Context menu support to all cards. + - `refresh` attribute on `meta_card` allows static pages to stop receiving live updates. + - Passing `-debug` when starting server displays site stats at `/_d/site`. + - Drag and drop support for file upload component. + - Template expression support for markdown cards. + - All APIs and examples documented. + - All 110 examples now ship with the Sphinx documentation. + - Documentation now ships with release download. + - Changed + - API consistency: `ui.vis()` renamed to `ui.plot()`. + - All stats cards now have descriptive names. + - API consistency: `ui.mark.mark` renamed to `ui.mark.type`. + - API consistency: `page.sync()` and `page.push()` renamed to `page.save()`. + - Removed + - `ui.dashboard_card()` and `ui.notebook_card()`. +- v0.0.6 + - Added + - Log network traffic when logging is set to debug mode. + - Capture and display unhandled exceptions on the UI. + - Routing using location hash. + - Toolbar component. + - Tabs component. + - Nav component. + - Upload API: `q.upload()`. + - Changed + - `q.session` renamed to `q.user` +- v0.0.5 + - Added + - Add configure() API to configure environment before launching. +- v0.0.4 + - Added + - Multi-user and multi-client support: launch apps in `multicast` or `unicast` modes in addition to `broadcast` mode. + - Client-specific data can now be stored and accessed via `q.client`, similar to `q.session` and `q.app`. + - Simpler page referencing: `import site` can be used instead of `site = Site()`. + - Changed + - Apps now lauch in `unicast` mode by default instead of `broadcast` mode. +- v0.0.3 + - Added + - Make `Expando` data structure available for apps. +- v0.0.2 + - Initial version +- v0.0.1 + - Package stub + + # Migration Guide Before you begin, it is highly recommended that you [download](https://github.com/h2oai/qd/releases) a release and run the interactive `tour.py` that ships with the release to get a feel for what Q programs look like in practice. diff --git a/py/examples/requirements.txt b/py/examples/requirements.txt index ba31281351..d467258fbd 100644 --- a/py/examples/requirements.txt +++ b/py/examples/requirements.txt @@ -6,4 +6,4 @@ bokeh matplotlib altair vega-datasets -h2o_q==0.1.1 +h2o_q==0.1.2 diff --git a/py/setup.py b/py/setup.py index 52523e6f0d..d57d4693cb 100644 --- a/py/setup.py +++ b/py/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name='h2o_q', - version='0.1.1', + version='0.1.2', author='Prithvi Prabhu', author_email='prithvi@h2o.ai', description='Python driver for H2O Q Realtime Apps',