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

Added general support for linking Panel objects #199

Merged
merged 23 commits into from Jan 24, 2019
Merged

Added general support for linking Panel objects #199

merged 23 commits into from Jan 24, 2019

Conversation

xavArtley
Copy link
Collaborator

@xavArtley xavArtley commented Jan 6, 2019

Following PR #191
It focus only on the Links between widgets and Hv bokeh plots

I removed AxesLink which was a link between Hv bokeh plots
I removed dependencies to holoviews (duplicate code of the Link class of holoviews)
I will create another PR with some refactor of the links between Hv Plots to decorrelate Links from holoviews and links developed in Panel.

@xavArtley xavArtley requested a review from philippjfr Jan 6, 2019
@xavArtley xavArtley force-pushed the widget_links branch 2 times, most recently from ccbab6e to ff62eb4 Compare Jan 6, 2019
@codecov-io
Copy link

@codecov-io codecov-io commented Jan 6, 2019

Codecov Report

Merging #199 into master will decrease coverage by 0.03%.
The diff coverage is 89.45%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #199      +/-   ##
==========================================
- Coverage   90.12%   90.08%   -0.04%     
==========================================
  Files          31       33       +2     
  Lines        4942     5176     +234     
==========================================
+ Hits         4454     4663     +209     
- Misses        488      513      +25
Impacted Files Coverage Δ
panel/__init__.py 52.17% <100%> (+1.06%) ⬆️
panel/widgets.py 95.82% <100%> (+0.02%) ⬆️
panel/viewable.py 70.4% <100%> (ø) ⬆️
panel/holoviews.py 84.18% <100%> (+0.94%) ⬆️
panel/links.py 83.68% <83.68%> (ø)
panel/tests/test_links.py 97.43% <97.43%> (ø)

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 9421adb...aafc175. Read the comment docs.

@xavArtley
Copy link
Collaborator Author

@xavArtley xavArtley commented Jan 7, 2019

Now it is possible to link directly bokeh widgets or panel widgets to bokeh models
image

image

@xavArtley xavArtley added the status: paused label Jan 7, 2019
@xavArtley xavArtley changed the title Enable Widget links with Hv Bokeh plots Enable Widget links Jan 7, 2019
@philippjfr
Copy link
Member

@philippjfr philippjfr commented Jan 9, 2019

@xavArtley I've started generalizing the LinkCallback a bit so we can eventually apply arbitrary linking. Next I'll be adding a simpler API to specify widget links. Please let me know if you disagree with any of my changes so far.

Copy link
Collaborator Author

@xavArtley xavArtley left a comment

panel/links.py Outdated Show resolved Hide resolved
panel/links.py Show resolved Hide resolved
panel/links.py Outdated Show resolved Hide resolved
@philippjfr philippjfr changed the title Enable Widget links Added general support for linking Panel objects Jan 23, 2019
@philippjfr
Copy link
Member

@philippjfr philippjfr commented Jan 23, 2019

@xavArtley I've once again refactored the code in order to make linking a completely general concept which can be applied both in Python and in JS. Have a look at the updated Links.ipynb to see what you think.

@jbednar When you get a minute I'd appreciate it if you could review and edit that notebook as well to see what you think.

@philippjfr philippjfr removed the status: paused label Jan 23, 2019
@xavArtley
Copy link
Collaborator Author

@xavArtley xavArtley commented Jan 23, 2019

@philippjfr Great work it's very intuitive.

@jbednar
Copy link
Member

@jbednar jbednar commented Jan 24, 2019

@philippjfr, that looks great! I've reworked that a bit:

  • I changed the descriptions to clarify that there are three distinct ways to make links (.link, .param.watch, and .jslink); before the section structure made it seem like there were more.
  • Added a hint at the top that we are building up to direct, pure HTML+JS links for plots (which is the most exciting reason to be reading this material)
  • Changed the examples to work both line by line as before, but also as a web page where the entire notebook has been run at once. (Previously, starting at the top to read a Run-All-ed notebook would be very confusing, as the results from later cells not yet reached by the reader were affecting cells reached sooner by the reader.)
  • Where possible, removed values initializing various widgets and instead forced a callback before the widgets were shown, to ensure that the values displayed were always consistent. (Before, changing a value then changing it back wouldn't necessarily result in the same display as at first; now it's always consistent where feasible.)
  • Changed the last text box to a selector to make it simpler for users to change colors without encountering error conditions.

@jbednar
Copy link
Member

@jbednar jbednar commented Jan 24, 2019

@philippjfr, that looks great! I've reworked the Links.ipynb notebook a bit:

  • I changed the descriptions to clarify that there are three distinct ways to make links (.link, .param.watch, and .jslink); before the section structure made it seem like there were more.
  • Added a hint at the top that we are building up to direct, pure HTML+JS links for plots (which is the most exciting reason to be reading this material)
  • Changed the examples to work both line by line as before, but also as a web page where the entire notebook has been run at once. (Previously, starting at the top to read a Run-All-ed notebook would be very confusing, as the results from later cells not yet reached by the reader were affecting cells reached sooner by the reader.)
  • Where possible, removed values initializing various widgets and instead forced a callback before the widgets were shown, to ensure that the values displayed were always consistent. (Before, changing a value then changing it back wouldn't necessarily result in the same display as at first; now it's always consistent where feasible.)
  • Changed the last text box to a selector to make it simpler for users to change colors without encountering error conditions.

@jbednar
Copy link
Member

@jbednar jbednar commented Jan 24, 2019

If those changes look ok to you, I'm happy to merge it!

examples/user_guide/Links.ipynb Outdated Show resolved Hide resolved
xavArtley
Copy link
Collaborator

@xavArtley xavArtley commented on 88983c7 Jan 24, 2019

Choose a reason for hiding this comment

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

parameter/propery missing 't'
a little extra space

xavArtley
Copy link
Collaborator

@xavArtley xavArtley commented on 88983c7 Jan 24, 2019

Choose a reason for hiding this comment

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

corrresponding extra r

examples/user_guide/Links.ipynb Outdated Show resolved Hide resolved
@philippjfr
Copy link
Member

@philippjfr philippjfr commented Jan 24, 2019

@xavArtley If you're around could you apply the suggestions? Only the PR author can do it.

jbednar and others added 2 commits Jan 24, 2019
Co-Authored-By: xavArtley <xavart2011@gmail.com>
Co-Authored-By: xavArtley <xavart2011@gmail.com>
@philippjfr
Copy link
Member

@philippjfr philippjfr commented Jan 24, 2019

Thanks @xavArtley at working out the initial cut of this and thanks @jbednar for tidying up the docs.

@philippjfr philippjfr merged commit 6594f9d into master Jan 24, 2019
2 of 4 checks passed
@philippjfr philippjfr deleted the widget_links branch Mar 6, 2019
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

4 participants