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

Check if we can plot before calling Base.show() #115

Merged
merged 1 commit into from
May 3, 2019

Conversation

kjulian3
Copy link
Contributor

@kjulian3 kjulian3 commented May 3, 2019

This addresses #114, where Interact calls Base.show() twice initially, resulting in an error during the second call when using PGFPlots.Image. This pull request adds a function canPlot() written in the style of the cleanup function that checks if the object can be safely plotted. If the object cannot be plotted because p.filename has already been removed during a previous cleanup, then nothing is returned. As a result, if Interact initially calls Base.show() twice, nothing will be shown. However, changing any of the sliders or buttons will call Base.show again (but only once) and plots will appear. If Interact is fixed in the future to only call Base.show once initially, then this code will have no impact. This allows PGFPlots.Image to be used with Interact as is without errors.

@codecov-io
Copy link

Codecov Report

Merging #115 into master will decrease coverage by 0.94%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #115      +/-   ##
==========================================
- Coverage   51.27%   50.33%   -0.95%     
==========================================
  Files           4        4              
  Lines         589      600      +11     
==========================================
  Hits          302      302              
- Misses        287      298      +11
Impacted Files Coverage Δ
src/PGFPlots.jl 36.19% <0%> (-1.1%) ⬇️

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 4880a9c...40c5847. Read the comment docs.

@mykelk mykelk merged commit fa5ef75 into JuliaTeX:master May 3, 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.

3 participants