Plan a Weekend Getaway
Find the largest US cities and their travel distances from Champaign, Illinois.
In[1]:=
data = Quiet[Table[{CommonName[city], QuantityMagnitude[
TravelDistance[{Entity[
"City", {"Champaign", "Illinois", "UnitedStates"}],
city}]]}, {city,
CountryData["UnitedStates", "LargestCities"]}]];
Create a word cloud from the city names paired with their travel distances, and use an inverse scale so that closer cities are more prominent.
In[2]:=
data = Cases[data, {_String, _Real}];
WordCloud[data, ImageSize -> 400, ScalingFunctions -> (1/# &),
PlotTheme -> "Marketing"]
Out[2]=