Icon

06 Switches

Exercise for creating an IF switch.

Use a switch to build one of the alternative graphs.

Exercise: SwitchesThe workflow below accesses life expectancy data for countries and regions. The bar chart shows the average life expectancy values byregions, and the choropleth world map shows the life expectancy values by countries. Your task is to build an IF switch that controls whichof the two visualizations is shown.1.1) Create a Single Selection Configuration node with two options: "Regions" and "Countries"1.2) Encode the flow variable values Regions and Countries into "top" and "bottom", respectively, with the Rule Engine Variable node1.3) Use an IF switch to separate the two workflow branches. Control the active port by the flow variable with the possible values top andbottom.1.4) Encapsulate the nodes into a component. Select Countries or Regions in the component's configuration dialog. Execute and open thecomponent's view. Do you see the right graph? Life expectancy bycountries LifeExpectancy.tableLife expectancy byregionsFilter out countriesLifeExpectancy.tableChoroplethWorld Map Table Reader Bar Chart Row Filter Component Table Reader Exercise: SwitchesThe workflow below accesses life expectancy data for countries and regions. The bar chart shows the average life expectancy values byregions, and the choropleth world map shows the life expectancy values by countries. Your task is to build an IF switch that controls whichof the two visualizations is shown.1.1) Create a Single Selection Configuration node with two options: "Regions" and "Countries"1.2) Encode the flow variable values Regions and Countries into "top" and "bottom", respectively, with the Rule Engine Variable node1.3) Use an IF switch to separate the two workflow branches. Control the active port by the flow variable with the possible values top andbottom.1.4) Encapsulate the nodes into a component. Select Countries or Regions in the component's configuration dialog. Execute and open thecomponent's view. Do you see the right graph? Life expectancy bycountries LifeExpectancy.tableLife expectancy byregionsFilter out countriesLifeExpectancy.tableChoroplethWorld Map Table Reader Bar Chart Row Filter Component Table Reader

Nodes

Extensions

Links