Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Register for the upcoming Live Community Q&A Session - and don't forget to submit your questions for @DeanS regarding the future role of analytics here.

Visualization from Python

Highlighted
5 - Atom

Hi All.

 

Have you ever one day, thought that you want to visualize your Python Graph into Alteryx, but suddenly remember Alteryx.write() need your output in the shape of data frames? Have you ever wondered that it will be nice if we can output Python beautiful data graph into Alteryx as one of report output like using AlteryxGraph function at R tools?

 

Since Alteryx.write() only accepts pandas data frames, we can not send image data from Python Tool to another tools such as Browse tool to display the image data. But as we know that Python graph visualizations are needed as alternative data visualization to complement Alteryx native visualization.

 

Our technical team realizes this is an opportunity to gain integration between Alteryx and Python, so we decided to try the method of using base64 lib with Python and the Blob Convert Tool on Alteryx to send and display image data so that it can be further visualized using the browse tool on Alteryx or saved using the Render Tool. This method also use io library in Python so it didn't need to create physical image file so you didn't have to worry about duplicate files.

muhammadiqbal_0-1587048935591.png

 

The script for plotting that we used for sample is pretty simple. Using Alteryx.read(), we read the the input data as dataframe and then we plot the data using matplotlib library. The plot figures are converted to base64 string by first changing the figure into object type using io library. The base64 strings are writed as output of the Python Tool.

 

Python Code.png

 

In Blob Convert, select conversion mode as Convert To a Blob and select the field that contains base64 strings. After using the Image Tool for converting the blob field, the image are displayed in Browse tool as seen in the following image.

 

blob.png 

 

result.png

 

Here is we attached sample workflow to demonstrate the propose method. Thank you!

 

 

 

 

Highlighted
Alteryx
Alteryx

I like that application of the blob convert tool, thank you for sharing this!

Highlighted
13 - Pulsar

This is amazing! I love it and will definitely use this in future projects. Thanks a lot for sharing it!

Highlighted
6 - Meteoroid

Hi Muhammadiqbal.

 

I was able to pull out the graph from my python code into the browse but it did not work for the wordcloud.

 

Any idea what can i do to pull that into the browse?

 

Regards,

Pramil Mittal

Highlighted
5 - Atom

Hi,

 

Thank you for sharing the same, However I tried to do the same in our environment and successfully written to an output anchor. I used the Blob convert tool and followed the options you described. But No luck. The browse tool said "Chart not available for this data type". Any suggestions.

 

Regards,

Tapan

Highlighted
5 - Atom

You are welcome! I am glad for sharing this application of blob convert tools too.

Labels