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

NdLayout opts undoes cols #1738

Closed
jordansamuels opened this issue Jul 20, 2017 · 3 comments
Closed

NdLayout opts undoes cols #1738

jordansamuels opened this issue Jul 20, 2017 · 3 comments

Comments

@jordansamuels
Copy link
Contributor

It appears that calling .opts() on an NdLayout will undo the effects of .cols(). E.g.

c = hv.Curve(np.arange(3))
hv.NdLayout([(n,c) for n in range(5)]).cols(2).opts(plot=dict(title_format="> 2 columns"))

results in

image

The does not appear to be a problem with Layout.

@jlstevens
Copy link
Contributor

jlstevens commented Jul 20, 2017

I suspect NdLayout needs a clone method that preserve cols, the way Layout does it:

    def clone(self, *args, **overrides):
        """
        Clone method for Layout matches Dimensioned.clone except the
        display mode is also propagated.
        """
        clone = super(Layout, self).clone(*args, **overrides)
        clone._max_cols = self._max_cols
        clone.id = self.id
        return clone

Not sure why the id isn't propagated by the super call here but that is separate from what is important for this issue, namely transferring the value of_max_cols.

@philippjfr
Copy link
Member

Now fixed, closing.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants