-
Notifications
You must be signed in to change notification settings - Fork 98
Contribute examples to etsdemo #751
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
Changes from all commits
6d38701
37f3fba
1ddbd95
b4c5757
d9f98dd
e7f579c
1085ce7
f7bb562
bae6661
cdefe9a
6c73f53
97112f6
6096b08
09d8d22
666598a
465747a
2a26868
4cdca8c
157500d
66d7c87
67964ed
55e42f0
0b2ec29
6cd299c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # (C) Copyright 2005-2021 Enthought, Inc., Austin, TX | ||
| # All rights reserved. | ||
| # | ||
| # This software is provided without warranty under the terms of the BSD | ||
| # license included in LICENSE.txt and may be redistributed only under | ||
| # the conditions described in the aforementioned license. The license | ||
| # is also available online at http://www.enthought.com/licenses/BSD.txt | ||
| # | ||
| # Thanks for using Enthought open source! | ||
|
|
||
| """ This module provides functions to be advertised in the distribution | ||
| entry points. | ||
| """ | ||
|
|
||
| import pkg_resources | ||
|
|
||
|
|
||
| def info(request): | ||
| """ Return a configuration for contributing examples to the | ||
| Demo application. | ||
| Parameters | ||
| ---------- | ||
| request : dict | ||
| Information provided by the demo application. | ||
| Currently this is a placeholder. | ||
| Returns | ||
| ------- | ||
| response : dict | ||
| """ | ||
| return { | ||
| "version": 1, | ||
| "name": "Chaco Examples", | ||
| "root": pkg_resources.resource_filename("chaco.examples", "demo"), | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -454,8 +454,8 @@ class TimerController(HasTraits): | |
| # The plot view which will be affected by timed animation | ||
| view = Instance(PlotUI) | ||
|
|
||
| # The ModelView instance that contains the animation options: | ||
| model_view = Instance("ModelView") | ||
| # The DemoModelView instance that contains the animation options: | ||
| model_view = Instance("DemoModelView") | ||
|
|
||
| # Whether the view is animated: | ||
| animated = DelegatesTo("model_view") | ||
|
|
@@ -556,7 +556,7 @@ def randomize(new_direction=1, color_change=False): | |
| metadata["selections"] = x, y | ||
|
|
||
|
|
||
| class ModelView(HasTraits): | ||
| class DemoModelView(HasTraits): | ||
|
|
||
| model = Instance(Model) | ||
| view = Instance(PlotUI) | ||
|
|
@@ -614,19 +614,15 @@ def _start_timer(self): | |
|
|
||
| def edit_traits(self, *args, **kws): | ||
| self._start_timer() | ||
| return super(ModelView, self).edit_traits(*args, **kws) | ||
| return super(DemoModelView, self).edit_traits(*args, **kws) | ||
|
|
||
| def configure_traits(self, *args, **kws): | ||
| self._start_timer() | ||
| return super(ModelView, self).configure_traits(*args, **kws) | ||
| return super(DemoModelView, self).configure_traits(*args, **kws) | ||
|
|
||
|
|
||
| def show_plot(**kwargs): | ||
| model = Model(**kwargs) | ||
| view = PlotUI(**kwargs) | ||
| modelview = ModelView(model=model, view=view) | ||
| modelview.configure_traits() | ||
| demo = DemoModelView(model=Model(), view=PlotUI()) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| show_plot() | ||
| demo.configure_traits() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would look / work a lot better as a popup, but that leads to very strange errors due to etsdemo internals. Doing so I get the following error: we have a trait defined as @rahulporuri any ideas on how we could resolve this? It is awkward because you need to do
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: did not solve the issue. I will leave it as a demo not a pop up for now |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,10 +3,11 @@ | |
|
|
||
| The origin parameter sets a plot's default origin to the specified corner | ||
| of the plot window. These positions has the following behavior: | ||
| * 'left' : index increases left to right | ||
| * 'right' : index increases right to left | ||
| * 'top' : index increases top to bottom | ||
| * 'bottom' : index increases bottom to top | ||
|
|
||
| * 'left' : index increases left to right | ||
| * 'right' : index increases right to left | ||
| * 'top' : index increases top to bottom | ||
| * 'bottom' : index increases bottom to top | ||
|
Comment on lines
+6
to
+10
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was previously giving an indentation warning inside the etsdemo app |
||
|
|
||
| The orientation parameter switches the x- and y-axes. Alternatively, you can | ||
| think of this as a transpose about the origin. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.