Icon

Challenge 28 - Funnel Plotting with Plotly

Funnel Plotting with Plotly

Funnel Plotting with Plotly

In this challenge you're playing the role of data analyst trying to create a Stacked Funnel Plot from Plotly: https://plotly.com/python/funnel-charts/

You notice that while KNIME has many Plotly Plots via the KNIME Plotly Extension, you could not find a funnel plot. So in this challenge you will use the Python View node to see if you can create a funnel plot and show it off in KNIME.

Challenge Level: Medium

Hints:
1. In the KNIME Analytics Platform 4.7.1., Plotly is bundled into the KNIME Python Integration which you will need to access the Python View node. Once that extension is installed, you can verify it by checking: KNIME > Preferences > Python > Bundled. Or if you'd like you can use a Conda environment with Plotly installed.
If you prefer that route, here is how to install plotly via the terminal: conda install -c plotly plotly=5.13.0

2. Simply copy the code from the plotly link above (I prefer the "Stacked Funnel Plot with go.Funnel" plot) into the Python View node.

3. Be sure to add this line after copy-pasting from the plotly site:
import knime.scripting.io as knio

4. Be sure to remove the line
fig.show()

5. And finally be sure to add this line to the very end of your code
knio.output_view = knio.view(fig)

6. If you are not passing a table into your Python View node, right click the node > Remove port > Input Table

If you'd like to take this challenge from medium to hard, try implementing a table creator node and passing your own data to at least 1 of the x and y variables.

Nodes

Extensions

Links