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

Location component #1150

Merged
merged 28 commits into from
Apr 15, 2020
Merged

Location component #1150

merged 28 commits into from
Apr 15, 2020

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Mar 13, 2020

Massive redesign of the original Location component written by @MarcSkovMadsen. The problem is that it's not really a Viewable component and therefore should not be a widget. It's also weird adding it to a layout if it doesn't actually display anything. Therefore I introduced non-viewable baseclasses for Panel components and the location is automatically added as a Document root and then made accessible via pn.state.location.

In order to make the Location component work without also being a Viewable objects the baseclasses are now organized as such:

  • Layoutable(Parameterized): Defines parameters concerned with layout and style
  • ServableMixin(): Mixin class that defines methods to serve object on a server
  • Renderable(Parameterized): Defines methods that allow the object to rendered to a bokeh model
  • Viewable(Renderable, Layoutable, ServableMixin): Defines methods that make the object viewable in a notebook, save it and serve it
  • Syncable(Renderable): Defines methods that allow parameters to be synced with bokeh model properties
  • Reactive(Viewable, Syncable): A syncable viewable that defines various methods to link it to other objects.

Supersedes #1101

@philippjfr philippjfr mentioned this pull request Mar 13, 2020
@philippjfr
Copy link
Member Author

Was hoping to get this into 0.9.0 after all but it touches too many internals for me to safely include it.

Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I wonder if the panel/viewable.py changes ought to be in a separate PR that explains the class hierarchy changes on their own, to be merged before this one.

.gitignore Show resolved Hide resolved
examples/user_guide/Deploy_and_Export.ipynb Show resolved Hide resolved
examples/user_guide/Deploy_and_Export.ipynb Show resolved Hide resolved
examples/user_guide/Deploy_and_Export.ipynb Show resolved Hide resolved
examples/user_guide/Deploy_and_Export.ipynb Show resolved Hide resolved
panel/io/state.py Show resolved Hide resolved
panel/models/location.py Show resolved Hide resolved
panel/models/location.py Show resolved Hide resolved
panel/viewable.py Show resolved Hide resolved
panel/viewable.py Outdated Show resolved Hide resolved
@philippjfr philippjfr added this to the v0.10.0 milestone Apr 2, 2020
@codecov
Copy link

codecov bot commented Apr 15, 2020

Codecov Report

Merging #1150 into master will increase coverage by 0.06%.
The diff coverage is 88.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1150      +/-   ##
==========================================
+ Coverage   87.53%   87.59%   +0.06%     
==========================================
  Files         117      124       +7     
  Lines       12952    13192     +240     
==========================================
+ Hits        11337    11555     +218     
- Misses       1615     1637      +22     
Impacted Files Coverage Δ
panel/io/state.py 80.32% <46.15%> (-9.87%) ⬇️
panel/io/notebook.py 58.64% <50.00%> (-0.48%) ⬇️
panel/io/server.py 37.65% <60.00%> (ø)
panel/viewable.py 68.69% <80.48%> (-8.69%) ⬇️
panel/util.py 85.94% <85.29%> (-0.15%) ⬇️
panel/reactive.py 85.40% <85.40%> (ø)
panel/io/location.py 96.77% <96.77%> (ø)
panel/io/embed.py 85.99% <100.00%> (ø)
panel/layout/base.py 93.47% <100.00%> (ø)
panel/layout/spacer.py 74.07% <100.00%> (ø)
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dcfa4c6...ce93bf0. Read the comment docs.

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 this pull request may close these issues.

None yet

2 participants