In the preceding recipes, we have been visualizing our flights using Databrick notebook's native visualizations (for example, bar chart, line chart, maps, and so on). But we have not yet visualized our graph as a graph. In this section, we will leverage Mike Bostock's Airports D3.js visualization (https://mbostock.github.io/d3/talk/20111116/airports.html) within our Databricks notebook.
Ensure that you have created thegraph
GraphFrame and the source deptsDelays_GEO
DataFrame from the preceding subsections.
We will be leveraging our Python Databricks notebook, but we will include the following Scala cell. At the top level here's the flow of the code:
%scala package d3a import org.apache.spark.sql._ import com.databricks.backend.daemon.driver.EnhancedRDDFunctions.displayHTML case class Edge(src: String, dest: String, count: Long) case class Node(name: String) case class Link(source: Int, target: Int, value: Long) case class Graph(nodes: Seq[Node...