Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GridBox ncols not honored when rendering from a callable #1329

Closed
sdc50 opened this issue May 8, 2020 · 0 comments · Fixed by #1349
Closed

GridBox ncols not honored when rendering from a callable #1329

sdc50 opened this issue May 8, 2020 · 0 comments · Fixed by #1349
Milestone

Comments

@sdc50
Copy link
Contributor

sdc50 commented May 8, 2020

#297 ## ALL software version info

In [3]: param.__version__                                                                                                                                                                                                                                                                                                                                               
Out[3]: '1.10.0a2'

In [4]: pn.__version__                                                                                                                                                                                                                                                                                                                                                  
Out[4]: '0.10.0a2'

Description of expected behavior and the observed behavior

When a GridBox is first rendered dynamically (from a callable) then it first renders with only one column. After updating then the ncols parameter is respected.

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

import random
import param
import panel as pn
pn.extension()

class Test(param.Parameterized):
    ncols = param.Integer(default=6)
    
    @param.depends('ncols')
    def grid(self):
        rcolor = lambda: "#%06x" % random.randint(0, 0xFFFFFF)
        return pn.GridBox(*[pn.pane.HTML(background=rcolor(), width=50, height=50) for i in range(24)], ncols=self.ncols)
    
    def panel(self):
        return pn.Column(
            self.param.ncols,
            self.grid,
        )
t = Test()
t.panel()

Screenshots or screencasts of the bug in action

GridBox_ncols

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants