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 @@
TODO
TODO
+Expando
copy, clone and item/attribute deletion.header_card()
.Ref
from h2o_q
.frame()
.H2O_Q_
.table()
.q.unload()
to delete uploaded files.q.download()
.vega_card()
.refresh
attribute on meta_card
allows static pages to stop receiving live updates.-debug
when starting server displays site stats at /_d/site
.ui.vis()
renamed to plot()
.ui.mark.mark
renamed to ui.mark.type
.page.sync()
and page.push()
renamed to page.save()
.ui.dashboard_card()
and ui.notebook_card()
.q.upload()
.q.session
renamed to q.user
multicast
or unicast
modes in addition to broadcast
mode.q.client
, similar to q.session
and q.app
.import site
can be used instead of site = Site()
.unicast
mode by default instead of broadcast
mode.Expando
data structure available for apps.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.
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()
+
+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()
+
+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()
+
+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()
+
+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()
h2o_q.types
h2o_q.types
h2o_q.types
h2o_q.types
h2o_q.types
h2o_q.types
h2o_q.types
h2o_q.types
h2o_q.types
class 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)
+(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)
Create a component.
File upload.
var frame
Frame
var label
Label.
+class Frame
+(path: Union[str, NoneType] = None, content: Union[str, NoneType] = None, width: Union[str, NoneType] = None, height: Union[str, NoneType] = None)
+
Create a new inline frame (an iframe
).
class Frame:
+ """Create a new inline frame (an `iframe`).
+ """
+ def __init__(
+ self,
+ path: Optional[str] = None,
+ content: Optional[str] = None,
+ width: Optional[str] = None,
+ height: Optional[str] = None,
+ ):
+ self.path = path
+ """The path or URL of the web page, e.g. `/foo.html` or `http://example.com/foo.html`"""
+ self.content = content
+ """The HTML content of the page. A string containing `<html>...</html>`."""
+ self.width = width
+ """The width of the frame, e.g. `200px`, `50%`, etc. Defaults to `100%`."""
+ self.height = height
+ """The height of the frame, e.g. `200px`, `50%`, etc. Defaults to `150px`."""
+
+ def dump(self) -> Dict:
+ """Returns the contents of this object as a dict."""
+ return _dump(
+ path=self.path,
+ content=self.content,
+ width=self.width,
+ height=self.height,
+ )
+
+ @staticmethod
+ def load(__d: Dict) -> 'Frame':
+ """Creates an instance of this class using the contents of a dict."""
+ __d_path: Any = __d.get('path')
+ __d_content: Any = __d.get('content')
+ __d_width: Any = __d.get('width')
+ __d_height: Any = __d.get('height')
+ path: Optional[str] = __d_path
+ content: Optional[str] = __d_content
+ width: Optional[str] = __d_width
+ height: Optional[str] = __d_height
+ return Frame(
+ path,
+ content,
+ width,
+ height,
+ )
+
+def load(_Frame__d: Dict) ‑> Frame
+
Creates an instance of this class using the contents of a dict.
@staticmethod
+def load(__d: Dict) -> 'Frame':
+ """Creates an instance of this class using the contents of a dict."""
+ __d_path: Any = __d.get('path')
+ __d_content: Any = __d.get('content')
+ __d_width: Any = __d.get('width')
+ __d_height: Any = __d.get('height')
+ path: Optional[str] = __d_path
+ content: Optional[str] = __d_content
+ width: Optional[str] = __d_width
+ height: Optional[str] = __d_height
+ return Frame(
+ path,
+ content,
+ width,
+ height,
+ )
+var content
The HTML content of the page. A string containing <html>...</html>
.
var height
The height of the frame, e.g. 200px
, 50%
, etc. Defaults to 150px
.
var path
The path or URL of the web page, e.g. /foo.html
or http://example.com/foo.html
var width
The width of the frame, e.g. 200px
, 50%
, etc. Defaults to 100%
.
+def dump(self) ‑> Dict
+
Returns the contents of this object as a dict.
def dump(self) -> Dict:
+ """Returns the contents of this object as a dict."""
+ return _dump(
+ path=self.path,
+ content=self.content,
+ width=self.width,
+ height=self.height,
+ )
+
class FrameCard
(box: str, title: str, path: Union[str, NoneType] = None, content: Union[str, NoneType] = None, commands: Union[List[Command], NoneType] = None)
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.
class 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.
"""
@@ -8388,9 +8586,9 @@ Methods
self.title = title
"""The title for this card."""
self.path = 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`"""
self.content = content
- """The HTML content of the page. A string containing '<html>...</html>'"""
+ """The HTML content of the page. A string containing `<html>...</html>`"""
self.commands = commands
"""Contextual menu commands for this component."""
@@ -8484,11 +8682,11 @@ Instance variables
var content
-
-
The HTML content of the page. A string containing '…'
+The HTML content of the page. A string containing <html>...</html>
var 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
var title
-
@@ -18062,6 +18260,7 @@
Compone
dump
expander
file_upload
+frame
label
link
load
@@ -18164,6 +18363,17 @@ FormCard<
-
+
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 @@expander
frame
A Component
instance.
+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
).
path
/foo.html
or http://example.com/foo.html
content
<html>...</html>
.width
200px
, 50%
, etc. Defaults to 100%
.height
200px
, 50%
, etc. Defaults to 150px
.A Frame
instance.
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.
title
path
/foo.html
or http://example.com/foo.html
content
<html>...</html>
commands
file_upload
flex_card
form_card
frame
frame_card
graphics_card
grid_card