PyWorkflowApp / visual-programming

A Python Visual Programming Workspace for Data Science
MIT License
31 stars 12 forks source link

Bonus features: Copy/paste text Node; simple graphical visualization Node with options #80

Closed reelmatt closed 4 years ago

reelmatt commented 4 years ago

This PR adds two new Node to support some of the nice-to-have features brought up in our last customer meeting. Not much has changed on the back-end besides the inclusion of two new Node classes. The front-end adds support for a 'textarea' <SimpleInput> component and adds to the existing <GraphView> to render a <VegaLite> component.

Table Creator Node

Screen Shot 2020-05-02 at 1 56 07 PM

This switches the file input from the Read CSV node, into a text area TextParameter. This is the same as a StringParameter but with a different type to tell the front-end to render a larger space. Same CSV options for sep and header exist.

Graph Node

Screen Shot 2020-05-02 at 1 55 53 PM

This uses the Altair package to generate a JSON spec on the back-end from an incoming pandas DataFrame. The front-end uses a loadGraph function that calls the same retrieveData endpoint, but without processing for tabular display. The <VegaLite> component then handles all the rendering from the JSON file.

This uses the same simple parameters that exist like String and IntegerParameter. The graph_type option could be modified to use a new SelectParameter with a list of supported options (right now area, bar, line, and point graphs are supported). This might conflict with @reddigari's #78 work on form elements, so I kept the customization to a minimum here. It may also make sense to fork the old functionality into a component and keep the new visual/chart display in the <GraphView> component, but provided as-is for now.

reddigari commented 4 years ago

Absolutely tremendous, worked out of the box for me on the football data.

I actually have a SelectInput ready to go --- do you mind if I push it to this branch and adjust the graph type to use it?

reelmatt commented 4 years ago

Go for it!