Icon

Example Python View using Plotly Express and Kaleido

Read Source Data Transform Data: Total Weekly Deaths by Health Board (ignoring Cause and Location of Death) KNIME Conda Environment Example Workflow using Python View to display and save plots usingPlotly Express and KaleidoFor demo purposes the Python View node is configured to generate aStacked Area Chart in the following formats:- Interactive HTML plot launched automatically in your default browser(note: it takes a bit of time to launch the browser)- Save interactive HTML plot as a web page (in the Images folder)- Save static jpeg, pdf, png and svg images (in the Images folder)- Generate static image bytes string (png format) to use as the KNIMEoutput_image for the node (right click on the Python View node and selectImage).To use this worklfow you first need to set up KNIME Python Integration(https://docs.knime.com/2018-12/python_installation_guide/index.html)Enviorment setup:- Within KNIME (Preferences - KNIME - Python) create a new Python 3.6environment.- Then use Anaconda-Navigator to install the Plotly and Plotly Expressmodules into the new environment.- Then from a terminal window, activate the new conda environment and doa PIP INSTALL of KaleidoNote: if you try to install Kaleido from Anaconda Navigator it will not workbecause it it unable to find the Kaleido executable folder for some reason.Final conda environment: A YAML file is provided in the Conda folder withinthis workflow.Source public data: National Records of Scotlandhttps://www.nrscotland.gov.uk/statistics-and-data/statistics/statistics-by-theme/vital-events/general-publications/weekly-and-monthly-data-on-births-and-deaths/deaths-involving-coronavirus-covid-19-in-scotland Generate Plotly Express and Kaleido images COVID19 Datafrom NR ScotlandIgnore Causeand Locationof DeathWeekly Deathsby Health BoardTotal Weekly Deathsby Health BoardTotal Weekly Deathsby Health BoardStacked Area Chartusing Plotly Expresspy36_knime_mjh_updateTotal Weekly Deathsby Health BoardTotal Weekly Deathsby Health BoardSet to zero Excel Reader Column Filter Pivoting Table Writer Table Reader Python View Conda EnvironmentPropagation Excel Writer Excel Reader Missing Value Read Source Data Transform Data: Total Weekly Deaths by Health Board (ignoring Cause and Location of Death) KNIME Conda Environment Example Workflow using Python View to display and save plots usingPlotly Express and KaleidoFor demo purposes the Python View node is configured to generate aStacked Area Chart in the following formats:- Interactive HTML plot launched automatically in your default browser(note: it takes a bit of time to launch the browser)- Save interactive HTML plot as a web page (in the Images folder)- Save static jpeg, pdf, png and svg images (in the Images folder)- Generate static image bytes string (png format) to use as the KNIMEoutput_image for the node (right click on the Python View node and selectImage).To use this worklfow you first need to set up KNIME Python Integration(https://docs.knime.com/2018-12/python_installation_guide/index.html)Enviorment setup:- Within KNIME (Preferences - KNIME - Python) create a new Python 3.6environment.- Then use Anaconda-Navigator to install the Plotly and Plotly Expressmodules into the new environment.- Then from a terminal window, activate the new conda environment and doa PIP INSTALL of KaleidoNote: if you try to install Kaleido from Anaconda Navigator it will not workbecause it it unable to find the Kaleido executable folder for some reason.Final conda environment: A YAML file is provided in the Conda folder withinthis workflow.Source public data: National Records of Scotlandhttps://www.nrscotland.gov.uk/statistics-and-data/statistics/statistics-by-theme/vital-events/general-publications/weekly-and-monthly-data-on-births-and-deaths/deaths-involving-coronavirus-covid-19-in-scotland Generate Plotly Express and Kaleido images COVID19 Datafrom NR ScotlandIgnore Causeand Locationof DeathWeekly Deathsby Health BoardTotal Weekly Deathsby Health BoardTotal Weekly Deathsby Health BoardStacked Area Chartusing Plotly Expresspy36_knime_mjh_updateTotal Weekly Deathsby Health BoardTotal Weekly Deathsby Health BoardSet to zeroExcel Reader Column Filter Pivoting Table Writer Table Reader Python View Conda EnvironmentPropagation Excel Writer Excel Reader Missing Value

Nodes

Extensions

Links