Gizmo creator/builder app Idea

35 views
Skip to first unread message

Jacob Fullerton

unread,
Jul 1, 2016, 2:58:03 PM7/1/16
to Tethys Platform
As I've been working on this tethysplatform for the first time, I've noticed that there are a lot of useful gizmos, but they are terribly difficult to edit. What's more, I've noticed that where features do not exist on tethys that people end up coding up their own version of what could be a gizmo, but exists only on their code, which is frequently copied over to other apps (the instructions modal for instance).

What if we had a web-based browser application that could create/edit gizmos on a local version of tethys? Then, when new features are needed by a user, they can use the builder to create a button or a widget and the web application could spit out the necessary files in html, css, js, and python and save them to the correct file locations. The gizmos could then be tested in the local tethys, and when needed brought back into the editor to make whatever changes the user might want. If the gizmo is useful enough to be added as a default option, the gizmo could be added to the next update. Another idea is to start a separate branch for test gizmos that improve the functionality of tethys which could be downloaded and installed on local tethys machines and tested by individual users.

swainn

unread,
Jul 5, 2016, 1:18:52 PM7/5/16
to Tethys Platform
It is OK for people to develop whatever features they want in their apps beyond the scope of the gizmos provided. If a developer finds that they frequently copy code across apps, they have a couple of options:

1. If the code is fairly specific to her apps (e.g.: ground water level viewer), the developer could extract that code and add it to a custom Python module that is shared by all of her apps.
2. If the code applies to a broader range of applications (e.g.: d3 grid viewer), the developer can extract the code and contribute it back to the Tethys Platform (as a gizmo if appropriate).

In the case that a developer wants contribute a new gizmo based on something she developed in an app, the developer will need to generalize and extract the appropriate code and add it to Tethys Platform using the "fork-pull" workflow (https://github.com/tethysplatform/tethys/wiki/Contributing).

Unfortunately, the process of extracting "the necessary files" and putting them in the "correct file locations" is highly dependent on the gizmo being added and would be difficult to automate. There is a pattern for developing Gizmos that we covered in Tethys scrum a few weeks ago. I'll add some docs on the wiki that explains the process of adding gizmos better. There is an established pattern and it isn't terribly difficult.

Jacob Fullerton

unread,
Jul 6, 2016, 10:24:00 AM7/6/16
to Tethys Platform
I don't know how the mechanics would work exactly, it was more of an idea. The reason I thought of this tool in the first place is that as an engineer with coding background I have an idea of what an app can do, but I have found myself pushing the boundaries of what Tethys can do. As a for instance, I have an app that I draw some features with, but if I want to delete those features I need to do either of the following:

1.     Modify the Tethys_Map_View gizmo so that an extra control is made which allows me to delete features by clicking on the button and then the features I want to delete.
2.     I can import a new library and make it so that when a user makes a right click they can have a custom menu come up instead of the default browser context menu. This custom context window then allows me to interact with the map and delete features where they exist. (In the end this option ends up messing with the MVDraw gizmos where I need to specify which type of click is to be the listener, requiring a gizmo modification or a modification to the imported library)

Even if we just had a tool that could modify existing gizmos in a GUI, it would be extremely helpful for someone like me. On the other hand, I understand that Tethys was not necessarily made for someone like me, I just wanted to illustrate a little more clearly where my idea came from. I totally understand if this idea does not fit the long-term mission of Tethys. I'll look forward to seeing the docs on adding gizmos.

swainn

unread,
Jul 6, 2016, 11:59:55 AM7/6/16
to Tethys Platform
Thank you for posting your idea and clarifying. I definitely understand your motivation for GUI gizmo creator and I don't want to discourage anyone from posting ideas. Gizmos have a lot of limitations and they can be improved in many ways and we encourage developers to contribute back to the project. That is how open source projects work--it is very much a community effort. And I can see that streamlining the process with a GUI would probably result in a lot more contributions to Gizmos, which would be awesome. However, here are a few considerations I thought of while pondering this idea:

It is easy to visualize and design what a GUI editor would look like for specific cases: like a drag and drop tool for creating new controls on the map gizmo. But what if I want to modify the select box gizmo? or the plot gizmo? or the button gizmo? These gizmos are really nothing like a map gizmo so then the question becomes how do we generalize and approach that would work for any gizmo. Potentially I could create custom GUI editors for each Gizmo, but then what do we do when we want to create a new gizmo that we haven't anticipated? 

Ironically, developing the GUI for editing Gizmos would probably mean creating much more code than would be necessary to programmatically edit and modify the Gizmos. All the GUI code would need to be maintained and we would need to manage updates and feature requests for the GUI editor (and someday someone may propose a GUI editor for the GUI editor... lol). None of these are necessarily show stopping questions, but all of these design questions and more would need to be addressed and I think there would require a great deal of effort. Furthermore, I think once you learn how to modify and create gizmos programmatically, you would find that  a GUI for this process would probably become more of a hindrance than a help. It is an intriguing idea, and perhaps we should add it to the Tethys wishlist, but I think developing such a tool would be quite involved and beyond our developer resources at the moment (though if anyone wants to volunteer to take it on I won't stop them...). 

An easy thing we can do that would help with Gizmo development is formalized instructions for how to modify and create gizmos. I have a task for myself to post some formal instructions, but I probably won't get to it until next week. In the mean time, I'd be happy to do a web meeting with you to give you the overview (setup with email off the forum).

In terms of your specific case of adding a control to the Tethys Map View gizmo (or adding any feature to an existing gizmo), I would recommend the approach you described in option 1 and use the "fork-pull" workflow.

Jacob Fullerton

unread,
Jul 6, 2016, 1:34:13 PM7/6/16
to Tethys Platform
I'll keep thinking about it for now, maybe after I make a couple of gizmos I'll have a better idea of how the GUI could possibly work and whether it's worthwhile or not. I agree with you on the problem that we'll face with the versatility of such a GUI and the amount of code required to make it useful, it would need a great deal more code than might be required to simply edit the gizmo to add whatever functionality we might need.
Reply all
Reply to author
Forward
0 new messages