diff --git a/py/examples/background.py b/py/examples/background.py index b73c5f7346..e85a31830d 100644 --- a/py/examples/background.py +++ b/py/examples/background.py @@ -15,7 +15,7 @@ def blocking_function(secs) -> str: @app('/demo') async def serve(q: Q): if q.args.start: - q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.progress('Running...')]) + q.page['form'] = ui.form_card(box='1 1 6 2', items=[ui.progress('Running...')]) await q.page.save() seconds = random.randint(1, 6) @@ -27,8 +27,8 @@ async def serve(q: Q): # Do this instead: message = await q.run(blocking_function, seconds) - q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.message_bar('info', message)]) + q.page['form'] = ui.form_card(box='1 1 6 1', items=[ui.message_bar('info', message)]) await q.page.save() else: - q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.button(name='start', label='Start')]) + q.page['form'] = ui.form_card(box='1 1 2 1', items=[ui.button(name='start', label='Start')]) await q.page.save() diff --git a/py/examples/background_executor.py b/py/examples/background_executor.py index b1cea29e47..c831f2cde2 100644 --- a/py/examples/background_executor.py +++ b/py/examples/background_executor.py @@ -16,7 +16,7 @@ def blocking_function(secs) -> str: @app('/demo') async def serve(q: Q): if q.args.start: - q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.progress('Running...')]) + q.page['form'] = ui.form_card(box='1 1 6 2', items=[ui.progress('Running...')]) await q.page.save() seconds = random.randint(1, 6) @@ -33,8 +33,8 @@ async def serve(q: Q): # with concurrent.futures.ProcessPoolExecutor() as pool: # message = await q.exec(pool, blocking_function, seconds) - q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.message_bar('info', message)]) + q.page['form'] = ui.form_card(box='1 1 6 1', items=[ui.message_bar('info', message)]) await q.page.save() else: - q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.button(name='start', label='Start')]) + q.page['form'] = ui.form_card(box='1 1 2 1', items=[ui.button(name='start', label='Start')]) await q.page.save() diff --git a/py/examples/background_progress.py b/py/examples/background_progress.py index 544f2f85b1..f418828ca4 100644 --- a/py/examples/background_progress.py +++ b/py/examples/background_progress.py @@ -51,5 +51,5 @@ async def serve(q: Q): form.items = [ui.message_bar('info', message)] await q.page.save() else: - q.page['form'] = ui.form_card(box='1 1 12 10', items=[ui.button(name='start', label='Start')]) + q.page['form'] = ui.form_card(box='1 1 2 2', items=[ui.button(name='start', label='Start')]) await q.page.save() diff --git a/py/examples/button.py b/py/examples/button.py index 73bd8b51e4..d5ad4f7d62 100644 --- a/py/examples/button.py +++ b/py/examples/button.py @@ -25,7 +25,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 8', items=[ ui.button(name='basic_button', label='Basic'), ui.button(name='primary_button', label='Primary', primary=True), ui.button(name='link_button', label='Link', link=True), diff --git a/py/examples/buttons.py b/py/examples/buttons.py index 252d82c9f1..9c4411d94d 100644 --- a/py/examples/buttons.py +++ b/py/examples/buttons.py @@ -15,7 +15,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 5', items=[ ui.buttons([ ui.button(name='primary_button', label='Primary', primary=True), ui.button(name='standard_button', label='Standard'), diff --git a/py/examples/checkbox.py b/py/examples/checkbox.py index 2e6f568b5c..f632437747 100644 --- a/py/examples/checkbox.py +++ b/py/examples/checkbox.py @@ -18,7 +18,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.checkbox(name='checkbox_unchecked', label='Not checked'), ui.checkbox(name='checkbox_checked', label='Checked', value=True), ui.checkbox(name='checkbox_indeterminate', label='Indeterminate', indeterminate=True), diff --git a/py/examples/checklist.py b/py/examples/checklist.py index d14c55e836..f17822594c 100644 --- a/py/examples/checklist.py +++ b/py/examples/checklist.py @@ -13,7 +13,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.checklist(name='checklist', label='Choices', choices=[ui.choice(name=x, label=x) for x in ['Egg', 'Bacon', 'Spam']]), ui.button(name='show_inputs', label='Submit', primary=True), diff --git a/py/examples/choice_group.py b/py/examples/choice_group.py index 71feeacdfe..cb300ed0c9 100644 --- a/py/examples/choice_group.py +++ b/py/examples/choice_group.py @@ -20,7 +20,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.choice_group(name='choice_group', label='Pick one', value='B', required=True, choices=choices), ui.button(name='show_inputs', label='Submit', primary=True), ]) diff --git a/py/examples/color_picker.py b/py/examples/color_picker.py index 2d12ecac3b..3a1d9e3784 100644 --- a/py/examples/color_picker.py +++ b/py/examples/color_picker.py @@ -13,7 +13,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.color_picker(name='color', label='Pick a color', value='#F25F5C'), ui.button(name='show_inputs', label='Submit', primary=True), ]) diff --git a/py/examples/combobox.py b/py/examples/combobox.py index f6035462a0..d9f59208e0 100644 --- a/py/examples/combobox.py +++ b/py/examples/combobox.py @@ -19,7 +19,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.combobox(name='combobox', label='Enter or choose a color', placeholder='Color...', value='Blue', choices=combobox_choices), ui.combobox(name='combobox_required', label='Enter or choose a color', placeholder='Color...', value='Blue', diff --git a/py/examples/counter_broadcast.py b/py/examples/counter_broadcast.py index 0cbffc44b8..240bf36b4f 100644 --- a/py/examples/counter_broadcast.py +++ b/py/examples/counter_broadcast.py @@ -18,6 +18,6 @@ async def serve(q: Q): form = q.page['example'] form.items = items else: - q.page['example'] = ui.form_card(box='1 1 12 10', items=items) + q.page['example'] = ui.form_card(box='1 1 2 1', items=items) await q.page.save() diff --git a/py/examples/counter_global.py b/py/examples/counter_global.py index 6643bd8dbc..c56ee16491 100644 --- a/py/examples/counter_global.py +++ b/py/examples/counter_global.py @@ -20,6 +20,6 @@ async def serve(q: Q): form = q.page['example'] form.items = items else: - q.page['example'] = ui.form_card(box='1 1 12 10', items=items) + q.page['example'] = ui.form_card(box='1 1 2 1', items=items) await q.page.save() diff --git a/py/examples/counter_multicast.py b/py/examples/counter_multicast.py index db0bf72a36..9e63750240 100644 --- a/py/examples/counter_multicast.py +++ b/py/examples/counter_multicast.py @@ -18,6 +18,6 @@ async def serve(q: Q): form = q.page['example'] form.items = items else: - q.page['example'] = ui.form_card(box='1 1 12 10', items=items) + q.page['example'] = ui.form_card(box='1 1 2 1', items=items) await q.page.save() diff --git a/py/examples/counter_unicast.py b/py/examples/counter_unicast.py index e53d417085..c337481915 100644 --- a/py/examples/counter_unicast.py +++ b/py/examples/counter_unicast.py @@ -9,7 +9,7 @@ async def serve(q: Q): count = q.client.count or 0 if not q.client.initialized: - q.page['example'] = ui.form_card(box='1 1 12 10', items=[ + q.page['example'] = ui.form_card(box='1 1 2 1', items=[ ui.button(name='increment', label=f'Count={count}') ]) q.client.initialized = True diff --git a/py/examples/date_picker.py b/py/examples/date_picker.py index 95522f4a3a..1ebccc29ed 100644 --- a/py/examples/date_picker.py +++ b/py/examples/date_picker.py @@ -16,7 +16,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.date_picker(name='date', label='Standard date picker', value='2017-10-19'), ui.date_picker(name='date_placeholder', label='Date picker with placeholder', placeholder='Pick a date'), ui.date_picker(name='date_disabled', label='Disabled date picker', value='2017-10-19', disabled=True), diff --git a/py/examples/date_picker_trigger.py b/py/examples/date_picker_trigger.py index 7d0eeb005f..923fe1e79c 100644 --- a/py/examples/date_picker_trigger.py +++ b/py/examples/date_picker_trigger.py @@ -16,7 +16,7 @@ def get_form_items(value: Optional[str]): @app('/demo') async def serve(q: Q): if not q.client.initialized: - q.page['example'] = ui.form_card(box='1 1 4 10', items=get_form_items(None)) + q.page['example'] = ui.form_card(box='1 1 4 5', items=get_form_items(None)) q.client.initialized = True else: q.page['example'].items = get_form_items(q.args.date_trigger) diff --git a/py/examples/dropdown.py b/py/examples/dropdown.py index 3b0fe0bc53..4a150c6da4 100644 --- a/py/examples/dropdown.py +++ b/py/examples/dropdown.py @@ -27,7 +27,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.dropdown(name='dropdown', label='Pick one', value='B', required=True, choices=choices), ui.dropdown(name='dropdown_multi', label='Pick multiple', values=['B', 'D'], required=True, choices=choices), diff --git a/py/examples/file_upload.py b/py/examples/file_upload.py index 0e608efa30..b116d67e51 100644 --- a/py/examples/file_upload.py +++ b/py/examples/file_upload.py @@ -14,7 +14,7 @@ async def serve(q: Q): ]) else: q.page['example'] = ui.form_card( - box='1 1 4 10', + box='1 1 4 7', items=[ ui.file_upload(name='file_upload', label='Upload!', multiple=True, file_extensions=['csv', 'gz'], max_file_size=10, max_size=15) diff --git a/py/examples/file_upload_compact.py b/py/examples/file_upload_compact.py index 15f8342be7..7090652ecb 100644 --- a/py/examples/file_upload_compact.py +++ b/py/examples/file_upload_compact.py @@ -14,7 +14,7 @@ async def serve(q: Q): ]) else: q.page['example'] = ui.form_card( - box='1 1 4 10', + box='1 1 4 7', items=[ ui.file_upload(name='file_upload', label='Select one or more files to upload', compact=True, multiple=True, file_extensions=['jpg', 'png'], max_file_size=1, max_size=15), diff --git a/py/examples/form.py b/py/examples/form.py index aeabdf82a2..eeabb695de 100644 --- a/py/examples/form.py +++ b/py/examples/form.py @@ -40,7 +40,7 @@ def rnd(): @app('/demo') async def serve(q: Q): - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 -1 -1', items=[ ui.text_xl(content='Extra-large text, for headings.'), ui.text_l(content='Large text, for sub-headings.'), ui.text_m(content='Body text, for paragraphs and other content.'), diff --git a/py/examples/form_frame_path.py b/py/examples/form_frame_path.py index 6698c7bdd9..85b8632a46 100644 --- a/py/examples/form_frame_path.py +++ b/py/examples/form_frame_path.py @@ -6,9 +6,9 @@ page = site['/demo'] page['example'] = ui.form_card( - box='1 1 6 5', + box='1 1 -1 -1', items=[ - ui.frame(path='https://example.com', height='400px') + ui.frame(path='https://example.com', height='450px') ] ) diff --git a/py/examples/form_visibility.py b/py/examples/form_visibility.py index a72fd37327..d3148f35d7 100644 --- a/py/examples/form_visibility.py +++ b/py/examples/form_visibility.py @@ -7,7 +7,7 @@ @app('/demo') async def serve(q: Q): if not q.client.initialized: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.text_xl(content='First text'), ui.text_l(content='Second text'), ui.text_m(content='Third text'), diff --git a/py/examples/frame_path.py b/py/examples/frame_path.py index 6ea8c6a556..c4a0fbd30c 100644 --- a/py/examples/frame_path.py +++ b/py/examples/frame_path.py @@ -6,7 +6,7 @@ page = site['/demo'] page['example'] = ui.frame_card( - box='1 1 6 5', + box='1 1 -1 -1', title='Example', path='https://example.com', ) diff --git a/py/examples/image.py b/py/examples/image.py index 2d0887a36b..ac582ef21b 100644 --- a/py/examples/image.py +++ b/py/examples/image.py @@ -41,7 +41,7 @@ page = site['/demo'] page['example1'] = ui.image_card( - box='1 1 3 5', + box='1 1 2 4', title='An image', type='png', image=image, @@ -51,7 +51,7 @@ # The example below constructs the data URL from the base64-encoded # used in the previous example. page['example2'] = ui.image_card( - box='1 6 3 5', + box='3 1 2 4', title='An image', path=f"data:image/png;base64,{image}", ) diff --git a/py/examples/image_annotator.py b/py/examples/image_annotator.py index a27d91afd4..b452c568c6 100644 --- a/py/examples/image_annotator.py +++ b/py/examples/image_annotator.py @@ -13,12 +13,12 @@ async def serve(q: Q): ui.button(name='back', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 9 -1', items=[ + q.page['example'] = ui.form_card(box='1 1 -1 -1', items=[ ui.image_annotator( name='annotator', title='Drag to annotate', image='https://images.pexels.com/photos/2696064/pexels-photo-2696064.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1', - image_height='700px', + image_height='280px', tags=[ ui.image_annotator_tag(name='p', label='Person', color='$cyan'), ui.image_annotator_tag(name='f', label='Food', color='$blue'), diff --git a/py/examples/issue_tracker.py b/py/examples/issue_tracker.py index f3ab42c867..21c5703bda 100644 --- a/py/examples/issue_tracker.py +++ b/py/examples/issue_tracker.py @@ -44,7 +44,7 @@ def make_issue_table(allow_multiple_selection=False): async def edit_multiple(q: Q): q.page['form'] = ui.form_card( - box='1 1 4 10', + box='1 1 6 7', items=[ make_issue_table(allow_multiple_selection=True), # This time, allow multiple selections ui.buttons([ @@ -59,7 +59,7 @@ async def edit_multiple(q: Q): async def show_issues(q: Q): q.page['form'] = ui.form_card( - box='1 1 4 10', + box='1 1 4 7', items=[ make_issue_table(), ui.buttons([ui.button(name='edit_multiple', label='Edit Multiple...', primary=True)]), @@ -75,7 +75,7 @@ async def show_issue(q: Q, issue_id: str): q.client.active_issue_id = issue_id q.page['form'] = ui.form_card( - box='1 1 4 10', + box='1 1 4 4', items=[ ui.text_xl(f'Issue {issue.id}'), ui.text(issue.text), diff --git a/py/examples/label.py b/py/examples/label.py index db56fa71c4..77e80ce46f 100644 --- a/py/examples/label.py +++ b/py/examples/label.py @@ -7,7 +7,7 @@ page = site['/demo'] page['example'] = ui.form_card( - box='1 1 4 10', + box='1 1 4 7', items=[ ui.label(label='Standard Label'), ui.label(label='Required Label', required=True), diff --git a/py/examples/link.py b/py/examples/link.py index 0d71e48063..6293a7fd3e 100644 --- a/py/examples/link.py +++ b/py/examples/link.py @@ -7,7 +7,7 @@ page = site['/demo'] page['example'] = ui.form_card( - box='1 1 4 10', + box='1 1 4 7', items=[ ui.link(label='Internal link', path='/starred'), ui.link(label='Internal link, new tab', path='/starred', target=''), diff --git a/py/examples/markdown_table.py b/py/examples/markdown_table.py index 036eb38629..3c514b555e 100644 --- a/py/examples/markdown_table.py +++ b/py/examples/markdown_table.py @@ -35,7 +35,7 @@ def make_markdown_table(fields, rows): page = site['/demo'] v = page.add('example', ui.form_card( - box='1 1 4 5', + box='1 1 4 8', items=[ ui.text(make_markdown_table( fields=air_passengers_fields, diff --git a/py/examples/message_bar.py b/py/examples/message_bar.py index 237db27049..963b025ba9 100644 --- a/py/examples/message_bar.py +++ b/py/examples/message_bar.py @@ -7,7 +7,7 @@ page = site['/demo'] page['example'] = ui.form_card( - box='1 1 3 10', + box='1 1 3 7', items=[ ui.message_bar(type='blocked', text='This action is blocked.'), ui.message_bar(type='error', text='This is an error message'), diff --git a/py/examples/meta_dialog.py b/py/examples/meta_dialog.py index f8fb618417..298f9afa01 100644 --- a/py/examples/meta_dialog.py +++ b/py/examples/meta_dialog.py @@ -8,7 +8,7 @@ async def serve(q: Q): if not q.client.initialized: q.page['meta'] = ui.meta_card(box='') - q.page['example'] = ui.form_card(box='1 1 12 10', items=[ + q.page['example'] = ui.form_card(box='1 1 2 1', items=[ ui.button(name='show_dialog', label='Order donuts', primary=True) ]) q.client.initialized = True diff --git a/py/examples/meta_script.py b/py/examples/meta_script.py index 621022752b..cde010d492 100644 --- a/py/examples/meta_script.py +++ b/py/examples/meta_script.py @@ -50,7 +50,7 @@ # Add a placeholder for the animation. page['example'] = ui.markup_card( - box='1 1 10 8', + box='1 1 6 8', title='Animation', content=html, ) diff --git a/py/examples/meta_side_panel.py b/py/examples/meta_side_panel.py index c059a426f3..7c551f5cda 100644 --- a/py/examples/meta_side_panel.py +++ b/py/examples/meta_side_panel.py @@ -8,7 +8,7 @@ async def serve(q: Q): if not q.client.initialized: q.page['meta'] = ui.meta_card(box='') - q.page['example'] = ui.form_card(box='1 1 11 10', items=[ + q.page['example'] = ui.form_card(box='1 1 2 1', items=[ ui.button(name='show_side_panel', label='Order donuts', primary=True) ]) q.client.initialized = True diff --git a/py/examples/meta_side_panel_closable.py b/py/examples/meta_side_panel_closable.py index 353785135b..35540693c5 100644 --- a/py/examples/meta_side_panel_closable.py +++ b/py/examples/meta_side_panel_closable.py @@ -10,7 +10,7 @@ async def serve(q: Q): # Create an empty meta_card to hold the side panel q.page['meta'] = ui.meta_card(box='') # Display a button to show the side panel - q.page['example'] = ui.form_card(box='1 1 11 10', items=[ + q.page['example'] = ui.form_card(box='1 1 2 1', items=[ ui.button(name='show_side_panel', label='Open side panel', primary=True) ]) q.client.initialized = True diff --git a/py/examples/meta_tracking.py b/py/examples/meta_tracking.py index 7a6fd8e1a2..3fa4450fb1 100644 --- a/py/examples/meta_tracking.py +++ b/py/examples/meta_tracking.py @@ -15,7 +15,7 @@ async def serve(q: Q): # That's all you need to do - set up a tracker. # The rest of this example does not do anything special related to tracking. - q.page['example'] = ui.form_card(box='1 1 12 10', items=[ + q.page['example'] = ui.form_card(box='1 1 2 1', items=[ ui.button(name='increment', label=f'Count={count}') ]) q.client.initialized = True diff --git a/py/examples/picker.py b/py/examples/picker.py index bf6453880d..4dbe2c2a41 100644 --- a/py/examples/picker.py +++ b/py/examples/picker.py @@ -13,7 +13,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 5', items=[ ui.picker(name='picker', label='Place an order (try Spam, Eggs or Ham):', choices=[ ui.choice(name='spam', label='Spam'), ui.choice(name='eggs', label='Eggs'), diff --git a/py/examples/picker_selection.py b/py/examples/picker_selection.py index 7eabf4d9c7..0999eaf707 100644 --- a/py/examples/picker_selection.py +++ b/py/examples/picker_selection.py @@ -13,7 +13,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 5', items=[ ui.picker(name='picker', label='Picker with initial values', choices=[ ui.choice(name='spam', label='Spam'), ui.choice(name='eggs', label='Eggs'), diff --git a/py/examples/plot_bokeh.py b/py/examples/plot_bokeh.py index d066eaa282..f421637032 100644 --- a/py/examples/plot_bokeh.py +++ b/py/examples/plot_bokeh.py @@ -33,7 +33,7 @@ page = site['/demo'] page['example'] = ui.frame_card( - box='1 1 5 8', + box='1 1 -1 -1', title='Hexbin for 500 points', content=html, ) diff --git a/py/examples/plot_bokeh_callbacks.py b/py/examples/plot_bokeh_callbacks.py index ffacaac072..492797c70e 100644 --- a/py/examples/plot_bokeh_callbacks.py +++ b/py/examples/plot_bokeh_callbacks.py @@ -24,11 +24,11 @@ async def serve(q: Q): y = [random() for y in range(500)] s1 = ColumnDataSource(data=dict(x=x, y=y)) - p1 = figure(plot_width=400, plot_height=400, tools="lasso_select", title="Select Here") + p1 = figure(plot_width=250, plot_height=300, tools="lasso_select", title="Select Here") p1.circle('x', 'y', source=s1, alpha=0.6) s2 = ColumnDataSource(data=dict(x=[], y=[])) - p2 = figure(plot_width=400, plot_height=400, x_range=(0, 1), y_range=(0, 1), tools="", title="Watch Here") + p2 = figure(plot_width=250, plot_height=300, x_range=(0, 1), y_range=(0, 1), tools="", title="Watch Here") p2.circle('x', 'y', source=s2, alpha=0.6) s1.selected.js_on_change( @@ -93,12 +93,12 @@ async def serve(q: Q): ), ) q.page['plot'] = ui.markup_card( - box='1 1 6 6', + box='1 1 4 4', title='', content=f'
', ) q.page['details'] = ui.markdown_card( - box='1 7 6 2', + box='1 5 4 1', title='Selected Marks', content='Nothing selected.', ) diff --git a/py/examples/plot_form.py b/py/examples/plot_form.py index a44ea59d98..b7b5acef81 100644 --- a/py/examples/plot_form.py +++ b/py/examples/plot_form.py @@ -6,7 +6,7 @@ page = site['/demo'] page.add('example', ui.form_card( - box='1 1 4 5', + box='1 1 -1 8', items=[ ui.text_xl('This year'), ui.visualization( diff --git a/py/examples/plot_pandas.py b/py/examples/plot_pandas.py index 3be698d83f..290010912d 100644 --- a/py/examples/plot_pandas.py +++ b/py/examples/plot_pandas.py @@ -16,7 +16,7 @@ # Plot two numeric columns by each other and color based on a third, categorical column page['scatter'] = ui.plot_card( - box='1 1 4 5', + box='1 1 -1 4', title='Scatter Plot from Dataframe', data=data( fields=df.columns.tolist(), @@ -34,7 +34,7 @@ # Aggregate the data in pandas and plot a bar chart of the average value of one column by some other column df_agg = df.groupby(['data_type']).mean().reset_index() page['bar'] = ui.plot_card( - box='1 6 4 5', + box='1 5 -1 4', title='Bar Plot from Aggregated Dataframe', data=data( fields=df_agg.columns.tolist(), diff --git a/py/examples/plot_schema.py b/py/examples/plot_schema.py index 10acd701cd..5abc960969 100644 --- a/py/examples/plot_schema.py +++ b/py/examples/plot_schema.py @@ -6,7 +6,7 @@ page = site['/demo'] page.add('example', ui.plot_card( - box='1 1 6 5', + box='1 1 -1 -1', title='Box plot', data=data( fields=['region', 'low', 'q1', 'q2', 'q3', 'high'], diff --git a/py/examples/plot_vegalite_flex.py b/py/examples/plot_vegalite_flex.py index 24dd4b23b8..49082b6969 100644 --- a/py/examples/plot_vegalite_flex.py +++ b/py/examples/plot_vegalite_flex.py @@ -11,11 +11,11 @@ breakpoint='xs', width='100%', zones=[ - ui.zone('top', size='300px', direction=ui.ZoneDirection.ROW, zones=[ + ui.zone('top', size='350px', direction=ui.ZoneDirection.ROW, zones=[ ui.zone('top_left', size='75%'), ui.zone('top_right', size='1'), ]), - ui.zone('bottom', size='500px', direction=ui.ZoneDirection.ROW, zones=[ + ui.zone('bottom', size='350px', direction=ui.ZoneDirection.ROW, zones=[ ui.zone('bottom_left', size='1'), ui.zone('bottom_center', size='2'), ui.zone('bottom_right', size='3'), diff --git a/py/examples/plot_vegalite_form.py b/py/examples/plot_vegalite_form.py index 9a4fcb63cc..414b2c9d19 100644 --- a/py/examples/plot_vegalite_form.py +++ b/py/examples/plot_vegalite_form.py @@ -35,7 +35,7 @@ def rnd(): page['example'] = ui.form_card( - box='1 1 2 10', + box='1 1 -1 -1', items=[ ui.text_xl('Example 1'), ui.vega_visualization( diff --git a/py/examples/progress.py b/py/examples/progress.py index 3263f5b154..37a0758689 100644 --- a/py/examples/progress.py +++ b/py/examples/progress.py @@ -7,7 +7,7 @@ page = site['/demo'] page['example'] = ui.form_card( - box='1 1 4 10', + box='1 1 4 7', items=[ ui.progress(label='Indeterminate Progress', caption='Goes on forever'), ui.progress(label='Standard Progress', caption='Downloading the interwebs...', value=0.25), diff --git a/py/examples/progress_update.py b/py/examples/progress_update.py index d4b1ce8527..7ceb4f22f8 100644 --- a/py/examples/progress_update.py +++ b/py/examples/progress_update.py @@ -9,7 +9,7 @@ page = site['/demo'] page['example'] = ui.form_card( - box='1 1 4 10', + box='1 1 4 7', items=[ ui.progress(label='Basic Progress'), ] diff --git a/py/examples/range_slider.py b/py/examples/range_slider.py index d0d56449e9..e38304e1da 100644 --- a/py/examples/range_slider.py +++ b/py/examples/range_slider.py @@ -15,7 +15,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 5', items=[ ui.range_slider(name='range_slider', label='Default slider'), ui.range_slider(name='range_slider_step', label='Step slider', min=0, max=1000, step=100, min_value=0, max_value=100), diff --git a/py/examples/site_async.py b/py/examples/site_async.py index 2159363c47..29326465c5 100644 --- a/py/examples/site_async.py +++ b/py/examples/site_async.py @@ -43,7 +43,7 @@ async def serve(q: Q): await stats_page.save() # Set up this app's UI - q.page['form'] = ui.form_card(box='1 1 12 10', items=[ + q.page['form'] = ui.form_card(box='1 1 6 5', items=[ ui.frame(path='/stats', height='110px'), ui.button(name='toggle', label='Start updates', primary=True), ]) diff --git a/py/examples/slider.py b/py/examples/slider.py index 3ec7123668..fdc00a544f 100644 --- a/py/examples/slider.py +++ b/py/examples/slider.py @@ -15,7 +15,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 5', items=[ ui.slider(name='slider', label='Standard slider', min=0, max=100, step=10, value=30), ui.slider(name='slider_zero', label='Origin from zero', min=-10, max=10, step=1, value=-3), ui.slider(name='slider_disabled', label='Disabled slider', min=0, max=100, step=10, value=30, diff --git a/py/examples/spinbox.py b/py/examples/spinbox.py index d01d434032..765807dacd 100644 --- a/py/examples/spinbox.py +++ b/py/examples/spinbox.py @@ -14,7 +14,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 5', items=[ ui.spinbox(name='spinbox', label='Standard spinbox', min=0, max=100, step=10, value=30), ui.spinbox(name='spinbox_disabled', label='Disabled spinbox', min=0, max=100, step=10, value=30, disabled=True), diff --git a/py/examples/stat_table.py b/py/examples/stat_table.py index 850251cacf..74e1634283 100644 --- a/py/examples/stat_table.py +++ b/py/examples/stat_table.py @@ -12,7 +12,7 @@ page = site['/demo'] page.add('example', ui.stat_table_card( - box='1 1 4 7', + box='1 1 4 8', title='Contacts', subtitle=f'Last updated: {fake.date()}', columns=['Name', 'Job', 'City'], diff --git a/py/examples/swatch_picker.py b/py/examples/swatch_picker.py index ed842ea6bb..8abea05a72 100644 --- a/py/examples/swatch_picker.py +++ b/py/examples/swatch_picker.py @@ -13,7 +13,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 5', items=[ ui.color_picker( name='swatch', label='Pick a swatch', diff --git a/py/examples/table.py b/py/examples/table.py index 505d12b347..aabe6d3ae0 100644 --- a/py/examples/table.py +++ b/py/examples/table.py @@ -57,12 +57,12 @@ def __init__(self, text: str, status: str, progress: float, icon: str, state: st @app('/demo') async def serve(q: Q): if q.args.issues: - q.page['form'] = ui.form_card(box='1 1 -1 10', items=[ + q.page['form'] = ui.form_card(box='1 1 -1 -1', items=[ ui.text(f'You clicked on: {q.args.issues}'), ui.button(name='back', label='Back'), ]) else: - q.page['form'] = ui.form_card(box='1 1 -1 10', items=[ + q.page['form'] = ui.form_card(box='1 1 -1 -1', items=[ ui.table( name='issues', columns=columns, @@ -74,7 +74,7 @@ async def serve(q: Q): groupable=True, downloadable=True, resettable=True, - height='800px' + height='600px' ) ]) diff --git a/py/examples/table_download.py b/py/examples/table_download.py index 53dcaea957..a2797a925f 100644 --- a/py/examples/table_download.py +++ b/py/examples/table_download.py @@ -47,7 +47,7 @@ def __init__(self, text: str, status: str, progress: float, icon: str, notificat @app('/demo') async def serve(q: Q): - q.page['form'] = ui.form_card(box='1 1 -1 11', items=[ + q.page['form'] = ui.form_card(box='1 1 -1 7', items=[ ui.table( name='issues', columns=columns, diff --git a/py/examples/table_filter.py b/py/examples/table_filter.py index 09a5aebb8c..817dacdaaf 100644 --- a/py/examples/table_filter.py +++ b/py/examples/table_filter.py @@ -47,7 +47,7 @@ def __init__(self, text: str, status: str, progress: float, icon: str, notificat @app('/demo') async def serve(q: Q): - q.page['form'] = ui.form_card(box='1 1 -1 11', items=[ + q.page['form'] = ui.form_card(box='1 1 -1 7', items=[ ui.table( name='issues', columns=columns, diff --git a/py/examples/table_filter_backend.py b/py/examples/table_filter_backend.py index 9748dee8b2..0127105dc6 100644 --- a/py/examples/table_filter_backend.py +++ b/py/examples/table_filter_backend.py @@ -35,7 +35,7 @@ def search_df(df: pd.DataFrame, term: str): @app('/demo') async def serve(q: Q): if not q.client.initialized: - q.page['form'] = ui.form_card(box='1 1 -1 9', items=[ + q.page['form'] = ui.form_card(box='1 1 -1 7', items=[ ui.textbox(name='search', label='Search address', placeholder='Enter a keyword...', trigger=True), ui.table( name='issues', diff --git a/py/examples/table_groupby.py b/py/examples/table_groupby.py index 1172fe8c23..4a8c8f8063 100644 --- a/py/examples/table_groupby.py +++ b/py/examples/table_groupby.py @@ -47,7 +47,7 @@ def __init__(self, text: str, status: str, progress: float, icon: str, notificat @app('/demo') async def serve(q: Q): - q.page['form'] = ui.form_card(box='1 1 -1 11', items=[ + q.page['form'] = ui.form_card(box='1 1 -1 7', items=[ ui.table( name='issues', columns=columns, diff --git a/py/examples/table_search.py b/py/examples/table_search.py index 94851b0598..6bd037371a 100644 --- a/py/examples/table_search.py +++ b/py/examples/table_search.py @@ -46,7 +46,7 @@ def __init__(self, text: str, status: str, progress: float, icon: str, notificat @app('/demo') async def serve(q: Q): - q.page['form'] = ui.form_card(box='1 1 -1 11', items=[ + q.page['form'] = ui.form_card(box='1 1 -1 7', items=[ ui.table( name='issues', columns=columns, diff --git a/py/examples/table_select.py b/py/examples/table_select.py index 2479b61f54..1e694de441 100644 --- a/py/examples/table_select.py +++ b/py/examples/table_select.py @@ -32,7 +32,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 -1 11', items=[ + q.page['example'] = ui.form_card(box='1 1 -1 7', items=[ ui.table( name='issues', columns=columns, diff --git a/py/examples/table_sort.py b/py/examples/table_sort.py index 88ecba604e..42074549d8 100644 --- a/py/examples/table_sort.py +++ b/py/examples/table_sort.py @@ -46,7 +46,7 @@ def __init__(self, text: str, status: str, progress: float, icon: str, notificat @app('/demo') async def serve(q: Q): - q.page['form'] = ui.form_card(box='1 1 -1 11', items=[ + q.page['form'] = ui.form_card(box='1 1 -1 7', items=[ ui.table( name='issues', columns=columns, diff --git a/py/examples/table_tags.py b/py/examples/table_tags.py index ac219f029e..775cdb2267 100644 --- a/py/examples/table_tags.py +++ b/py/examples/table_tags.py @@ -33,7 +33,7 @@ def __init__(self, text: str, tag: str): @app('/demo') async def serve(q: Q): - q.page['example'] = ui.form_card(box='1 1 6 7', items=[ + q.page['example'] = ui.form_card(box='1 1 -1 -1', items=[ ui.table( name='issues', columns=columns, diff --git a/py/examples/tabs.py b/py/examples/tabs.py index 8d3904999c..8edfd8f835 100644 --- a/py/examples/tabs.py +++ b/py/examples/tabs.py @@ -19,7 +19,7 @@ async def serve(q: Q): get_tab_content(q.args.menu), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.tabs(name='menu', value='email', items=tabs), get_tab_content('email'), ]) diff --git a/py/examples/text_annotator.py b/py/examples/text_annotator.py index 4fe0b3b577..16383f4179 100644 --- a/py/examples/text_annotator.py +++ b/py/examples/text_annotator.py @@ -13,7 +13,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.text_annotator( name='annotator', title='Select text to annotate', diff --git a/py/examples/text_sizes.py b/py/examples/text_sizes.py index 5c34fbe51f..2fbc1a69ce 100644 --- a/py/examples/text_sizes.py +++ b/py/examples/text_sizes.py @@ -7,7 +7,7 @@ page = site['/demo'] page['example'] = ui.form_card( - box='1 1 4 10', + box='1 1 4 7', items=[ ui.separator('Separator'), ui.text_xl('Extra large text'), diff --git a/py/examples/textbox.py b/py/examples/textbox.py index 0ede863d19..39c29bdee3 100644 --- a/py/examples/textbox.py +++ b/py/examples/textbox.py @@ -25,7 +25,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 -1 -1', items=[ ui.textbox(name='textbox', label='Standard'), ui.textbox(name='textbox_disabled', label='Disabled', value='I am disabled', disabled=True), ui.textbox(name='textbox_readonly', label='Read-only', value='I am read-only', readonly=True), diff --git a/py/examples/textbox_trigger.py b/py/examples/textbox_trigger.py index 5b00cedabf..47c7f1eba7 100644 --- a/py/examples/textbox_trigger.py +++ b/py/examples/textbox_trigger.py @@ -33,7 +33,7 @@ def get_form_items(txt: Optional[str]): @app('/demo') async def serve(q: Q): if not q.client.initialized: - q.page['example'] = ui.form_card(box='1 1 4 10', items=get_form_items(None)) + q.page['example'] = ui.form_card(box='1 1 4 7', items=get_form_items(None)) q.client.initialized = True if q.args.text is not None: q.page['example'].items = get_form_items(q.args.text) diff --git a/py/examples/time_picker.py b/py/examples/time_picker.py index db30b257fd..c91436214a 100644 --- a/py/examples/time_picker.py +++ b/py/examples/time_picker.py @@ -19,7 +19,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 8', items=[ ui.time_picker(name='timepicker', label="Standard time picker"), ui.time_picker(name='timepicker_required', label="Time picker - required", required=True), ui.time_picker(name='timepicker_disabled', label="Disabled time picker", value='11:15', disabled=True), diff --git a/py/examples/todo.py b/py/examples/todo.py index ee31172250..fbe323dcde 100644 --- a/py/examples/todo.py +++ b/py/examples/todo.py @@ -45,7 +45,7 @@ async def show_todos(q: Q): not_done = [ui.checkbox(name=todo.id, label=todo.label, trigger=True) for todo in todos if not todo.done] # Display list - q.page['form'] = ui.form_card(box='1 1 4 10', items=[ + q.page['form'] = ui.form_card(box='1 1 4 3', items=[ ui.text_l('To Do'), ui.button(name='new_todo', label='Add To Do...', primary=True), *not_done, @@ -65,7 +65,7 @@ async def add_todo(q: Q): async def new_todo(q: Q): # Display an input form - q.page['form'] = ui.form_card(box='1 1 4 10', items=[ + q.page['form'] = ui.form_card(box='1 1 4 3', items=[ ui.text_l('Add To Do'), ui.textbox(name='label', label='What needs to be done?', multiline=True), ui.buttons([ diff --git a/py/examples/toggle.py b/py/examples/toggle.py index 146f9fba88..376f2d9ab8 100644 --- a/py/examples/toggle.py +++ b/py/examples/toggle.py @@ -16,7 +16,7 @@ async def serve(q: Q): ui.button(name='show_form', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 5', items=[ ui.toggle(name='toggle_unchecked', label='Not checked'), ui.toggle(name='toggle_checked', label='Checked', value=True), ui.toggle(name='toggle_unchecked_disabled', label='Not checked (Disabled)', disabled=True), diff --git a/py/examples/upload_async.py b/py/examples/upload_async.py index bf65f4aef9..b4e14cfd09 100644 --- a/py/examples/upload_async.py +++ b/py/examples/upload_async.py @@ -31,7 +31,7 @@ async def serve(q: Q): ] else: # Accept a row count from the user - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.text_xl('Square Generator'), ui.slider(name='row_count', label='Squares to generate', min=0, max=100, step=10, value=30), ui.button(name='generate_csv', label='Generate', primary=True), diff --git a/py/examples/upload_download.py b/py/examples/upload_download.py index d21f69628a..3cfa96ee82 100644 --- a/py/examples/upload_download.py +++ b/py/examples/upload_download.py @@ -29,7 +29,7 @@ async def serve(q: Q): items.append(ui.button(name='back', label='Back', primary=True)) q.page['example'].items = items else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.text_xl('Upload some files'), ui.file_upload(name='user_files', label='Upload', multiple=True), ]) diff --git a/py/examples/upload_ui.py b/py/examples/upload_ui.py index 756219bd47..345c3822f8 100644 --- a/py/examples/upload_ui.py +++ b/py/examples/upload_ui.py @@ -23,7 +23,7 @@ async def serve(q: Q): ui.button(name='back', label='Back', primary=True), ] else: - q.page['example'] = ui.form_card(box='1 1 4 10', items=[ + q.page['example'] = ui.form_card(box='1 1 4 7', items=[ ui.text_xl('Upload some files'), ui.file_upload(name='user_files', label='Upload', multiple=True), ]) diff --git a/py/examples/wide_article_preview.py b/py/examples/wide_article_preview.py index 89c4f7a52a..f088536e53 100644 --- a/py/examples/wide_article_preview.py +++ b/py/examples/wide_article_preview.py @@ -7,13 +7,13 @@ @app('/demo') async def serve(q: Q): if q.args.wide_article_preview: - q.page['example'] = ui.form_card(box='1 1 4 6', items=[ + q.page['example'] = ui.form_card(box='1 1 -1 -1', items=[ ui.button(name='back', label='Go back', primary=True), ]) else: persona_pic = 'https://images.pexels.com/photos/415829/pexels-photo-415829.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=100&w=100' q.page['example'] = ui.wide_article_preview_card( - box='1 1 6 5', + box='1 1 -1 -1', name='wide_article_preview', persona=ui.persona(title='Jasmine Grand', subtitle='Marketing Executive', image=persona_pic, caption='caption'), diff --git a/py/examples/wide_plot.py b/py/examples/wide_plot.py index f5f2b261d6..131e378470 100644 --- a/py/examples/wide_plot.py +++ b/py/examples/wide_plot.py @@ -6,7 +6,7 @@ page = site['/demo'] page.add('example', ui.wide_plot_card( - box='1 1 6 4', + box='1 1 5 5', title='Wide Plot Card', caption=''' Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quia aliquam maxime quos facere