Update van der waal example#680
Conversation
rahulporuri
left a comment
There was a problem hiding this comment.
Almost LGTM - there is one minor bug and a small suggestion.
| @@ -285,24 +320,26 @@ Source Code | |||
| The final version on the program, `vanderwaals.py` :: | |||
There was a problem hiding this comment.
Let's not explicitly copy the code from the python file here - instead just use literalinclude. Also, it would be awesome if we provide a way to click on vanderwaals.py and see the example on github. I think that's possible - not sure how.
There was a problem hiding this comment.
I've tried doing both of these things. The link to github is tricky because the file doesn't exist yet, it is bing introduced in this PR. The link I used is where the file will be located, but currently it is a broken link if you try to test it on this PR...
I am not sure the best way to go about this
| self.plot.delplot(old_plot_type) | ||
| self.plot.plot( | ||
| ("x", "y"), type=new_plot_type, name=new_plot_type, color="blue" | ||
| ) |
There was a problem hiding this comment.
so when i change plot_type, i need to change some other variable before the plot is updated i.e. if i change from line to scatter, i need to change temperature before the plot changes from line plot to scatter plot.
There was a problem hiding this comment.
Ah I wasn't observing this locally. Thanks for pointing this out. I tried adding self.plot.invalidate_and_redaw(). Lmk if this fixes it for you
There was a problem hiding this comment.
FWIW I was seeing something similar to what you describe while working on the hyetograph example and invalidate_and_redraw fixed it
|
still LGTM |
part of #660
This PR updates the Van Der Waal example in the documentation. It removes the use of
ChacoPlotItemand the like withComponentEditor, replaces use ofon_trait_changewithobserve, removes development setup section, cleans up wording, and adds the code for the example inexamples/demo/vanderwaals.py.