8000 Cannot update main when main is GridSpec · Issue #1741 · holoviz/panel · GitHub
[go: up one dir, main page]

Skip to content

Cannot update main when main is GridSpec #1741

@MarcSkovMadsen

Description

@MarcSkovMadsen

ALL software version info

Panel MASTER branch

Description of expected behavior and the observed behavior

When the template main is a GridSpec I would expect to be able to update the GridSpec.

For example at awesome-panel.org I was trying to prepopulate a Template across pages to get a shared look and feel. But a few pages should look different and replace one or more of the prepopulated items.

Complete, minimal, self-contained example code that reproduces the issue

from panel.template import ReactTemplate
from panel.pane import Markdown

def test_grid_spec_replace():
    template=ReactTemplate()
    first = Markdown("I was here first")
    template.main[0,0]=first
    second=Markdown("But now I take over")
    template.main[0,0]=second
    return template

test_grid_spec_replace().servable()

Stack traceback and/or browser JavaScript console output

$ 2020-11-04 06:21:39,386 Starting Bokeh server version 2.2.3 (running on Tornado 6.0.4)
2020-11-04 06:21:39,387 User authentication hooks NOT provided (default user enabled)
2020-11-04 06:21:39,390 Bokeh app running at: http://localhost:5006/script
2020-11-04 06:21:39,391 Starting Bokeh server with process id: 21168
WARNING:param.GridSpec00005: Specified region overlaps with the following existing object(s) in the grid:

    (0, 0): Markdown(str)

The following shows a view of the grid (empty: 0, occupied: 1, overlapping: 2):

[[2 0 0 0 0 0 0 0 0 0 0 0]]
2020-11-04 06:21:47,318 Specified region overlaps with the following existing object(s) in the grid:

    (0, 0): Markdown(str)

The following shows a view of the grid (empty: 0, occupied: 1, overlapping: 2):

[[2 0 0 0 0 0 0 0 0 0 0 0]]
2020-11-04 06:21:47,636 WebSocket connection opened
2020-11-04 06:21:47,637 ServerConnection created

Screenshots or screencasts of the bug in action

image

Additional Context

I simply don't understand why the changes to the different parameters of a BasicTemplate needs to trigger complicated updates. I believe instead that there should be one function to update and render the template when needed. That would be much easier. I also think the current implementation has a performance cost because there will potentially be a lot of complicated updates that could have been simplified to one.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0