holoviz / holoviz/param

Please add edit_readonly function similar to edit_constant

Open
#379 0 comments 2 reactions 0 assignees View on GitHub
component: type/value stuff type-feature
Dominant language
Python
Stars
521
Forks
86
Avg merge
1d 13h
Merged PRs (30d)
35

Description

#### My Pain

I'm trying to contribute a new Location widget to panel. Some of the parameters on this widget should be readonly but still be updated when the value of the corresponding Bokeh typescript model changes it value.

In order to enable this i need to set the parameters in code on the python side but this raises a `TypeError`.

If I change the parameters from `readonly` to `constant` then i can use the `param.edit_constant` contextmanager.

But the parameters should really be readonly.

#### Solution

Add a `param.edit_readonly` manager similar to the `param.edit_constant` manager.

Alternatively change `param.edit_constant` to a `param.edit_constant_or_readonly` manager.

#### Additional Context

For now I can just solve my problem in my own code by using an adjusted version of the below code.

![image](https://user-images.githubusercontent.com/42288570/75217598-c0876b80-5797-11ea-963b-b1df2be938a2.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.