{"id":17167,"date":"2024-04-18T09:29:51","date_gmt":"2024-04-18T09:29:51","guid":{"rendered":"https:\/\/www.anychart.com\/blog\/?p=17167"},"modified":"2024-04-19T02:38:14","modified_gmt":"2024-04-19T02:38:14","slug":"creating-network-graph","status":"publish","type":"post","link":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/","title":{"rendered":"Creating Interactive Network Graph Using JavaScript with Ease"},"content":{"rendered":"<p><a href=\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/\" target=\"_blank\"><img decoding=\"async\" class=\"alignnone size-full wp-image-17179\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min.png\" alt=\"Network Graph based on JavaScript visualizing our Solar System network for the tutorial\" width=\"100%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min.png 1792w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min-300x168.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min-768x431.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min-1024x574.png 1024w\" sizes=\"(max-width: 1792px) 100vw, 1792px\" \/><\/a>Creating a vibrant network graph in JavaScript might seem like crafting a digital cosmos: intricate, fascinating, yet entirely within reach. Whether you&#8217;re aiming to illustrate the complex interconnections within a galaxy, a social network, or the internal hierarchy of a multinational corporation, network graphs serve as a powerful tool to bring data to life, revealing hidden patterns and insights through visual representation.<\/p>\n<p>Let&#8217;s embark on a journey to demystify the process, guiding you step-by-step on how to construct your very own network graph, with the\u00a0Solar\u00a0System as our illustrative example.<\/p>\n<p><!--more Read the JS charting tutorial \u00bb--><\/p>\n<h2>Unraveling\u00a0Network Graph Cosmos<\/h2>\n<p>Network graphs are not just charts; I like thinking about them as <a href=\"https:\/\/www.anychart.com\/chartopedia\/chart-type\/network-graph\/\">stories told in dots and lines<\/a>, each node a character, and each edge a relationship.<\/p>\n<p>Imagine plotting the vast expanse of the solar system, where planets orbit the life-giving Sun and moons dance around their planets, forming a complex yet orderly network of celestial bodies. This is what network graphs excel at: turning abstract connections into\u00a0a sort of map you can visually explore.<\/p>\n<p>Before we dive into the steps, here&#8217;s a sneak peek at the network graph that will be constructed by the end of this tutorial.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-17230\" src=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/solar-system-network-graph.png\" alt=\"JS Network Graph Preview\" width=\"100%\" srcset=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/solar-system-network-graph.png 1250w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/solar-system-network-graph-300x169.png 300w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/solar-system-network-graph-768x433.png 768w, https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/solar-system-network-graph-1024x578.png 1024w\" sizes=\"(max-width: 1250px) 100vw, 1250px\" \/><\/p>\n<h2>Charting\u00a0Course: Four-Step Odyssey<\/h2>\n<p>Creating a network graph\u00a0this way involves weaving together HTML, JavaScript, and data into a cohesive visual narrative. Here&#8217;s our roadmap:<\/p>\n<ol>\n<li><strong>HTML\u00a0scaffold:<\/strong> Crafting the digital canvas.<\/li>\n<li><strong>Instrumental\u00a0magic:<\/strong> Invoking the sorcery of libraries.<\/li>\n<li><strong>Data\u00a0alchemy:<\/strong> Transforming raw data into network graph data.<\/li>\n<li><strong>JavaScript\u00a0choreography:<\/strong> Directing the dance of elements.<\/li>\n<\/ol>\n<h3>Step 1: Laying\u00a0Foundation with HTML<\/h3>\n<p>First, we set the stage for our cosmic ballet. We start with a blank HTML page, establishing\u00a0an HTML block-level element that will host\u00a0the entire universe of our\u00a0Solar\u00a0System network graph. Here\u2019s how we lay the groundwork:<\/p>\n<pre><code class=\"html\">&lt;html&gt;\r\n  &lt;head&gt;\r\n    &lt;title&gt;Network Graph in JavaScript&gt;\/title&gt;\r\n    &lt;style type=\"text\/css\"&gt; \r\n      html, body, #container { \r\n        width: 100%; height: 100%; margin: 0; padding: 0; \r\n      } \r\n    &lt;\/style&gt;\r\n  &lt;\/head&gt;\r\n  &lt;body&gt;\r\n    &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<p>As you see, we&#8217;re introducing a <code>&lt;div&gt;<\/code> element as a container for our future network graph. By setting its width and height to 100%, we ensure the visualization expansively fills the browser window, inviting viewers to immerse themselves in the data.<\/p>\n<h3>Step 2: Including JavaScript Libraries<\/h3>\n<p>Before we can summon our graph into existence, we need the right spells \u2014 or, in our case, JavaScript libraries. For example, here\u2019s how you can weave\u00a0<a href=\"https:\/\/www.anychart.com\">AnyChart JS Charts<\/a> into our HTML tapestry, positioning the scripts within the <code>&lt;head&gt;<\/code> section:<\/p>\n<pre><code class=\"html\">&lt;html&gt;\r\n  &lt;head&gt;\r\n    &lt;title&gt;Network Graph in JavaScript&gt;\/title&gt;\r\n    &lt;style type=\"text\/css\"&gt; \r\n      html, body, #container { \r\n        width: 100%; height: 100%; margin: 0; padding: 0; \r\n      } \r\n    &lt;\/style&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.1\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.1\/js\/anychart-graph.min.js\"&gt;&lt;\/script&gt;  \r\n  &lt;\/head&gt;\r\n  &lt;body&gt;\r\n    &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n  &lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<p>This setup not only loads the essential scripts but also prepares the <code>&lt;body&gt;<\/code> section for our upcoming dynamic JavaScript code, which will vividly render the network graph.<\/p>\n<h3>Step 3: Data Preparation<\/h3>\n<p>With the stage set and the scripts in place, it&#8217;s time to define the actors in our celestial drama: the nodes (planets, moons) and edges (their\u00a0relationships). We embed\u00a0the\u00a0<a href=\"https:\/\/science.nasa.gov\/solar-system\/\" target=\"_blank\" rel=\"nofollow\">Solar\u00a0System data<\/a> directly within the JavaScript, ensuring each body is represented as a node and each relationship as an edge. For simplicity, this example omits some moons, but it lays the groundwork for you to expand and explore further on your own.<\/p>\n<pre><code class=\"JavaScript\">var data = {\r\n  \"nodes\": [\r\n    { \"id\": \"Sun\", \"value\": 1392700 },\r\n    { \"id\": \"Mercury\", \"value\": 4879 },\r\n    ...\r\n  ],\r\n  \"edges\": [\r\n    { \"from\": \"Sun\", \"to\": \"Mercury\", \"distance\": 50.9 },\r\n    { \"from\": \"Sun\", \"to\": \"Venus\", \"distance\": 108.2 },\r\n    ...\r\n  ]\r\n};<\/code><\/pre>\n<p>Each node and edge carries with it the essence of our solar system, mapping the vast distances and relationships that define it.<\/p>\n<h3>Step 4: Code Network Graph Visualization in JavaScript<\/h3>\n<p>Finally, the magic happens. We breathe life into our data, transforming it into a vibrant, interactive network graph.<\/p>\n<p>The first act in our celestial choreography begins with ensuring that the script only executes once the HTML document has fully loaded. This safeguard prevents any premature interactions with the DOM, ensuring our script performs flawlessly in the browser&#8217;s universe.<\/p>\n<pre><code class=\"JavaScript\">anychart.onDocumentReady(function () {\r\n  \/\/ Our JS network graph's creation will be configured here.\r\n});<\/code><\/pre>\n<p>Within the sanctum of our initialization function, we illuminate the celestial bodies of our solar system. This line of JavaScript takes the structured data of planets and their moons and begins the process of turning these into visual elements on our graph.<\/p>\n<pre><code class=\"JavaScript\">var chart = anychart.graph(data);<\/code><\/pre>\n<p>Next, with our celestial data vividly characterized and styled, we command the graph to materialize in the designated container on our web page.<\/p>\n<pre><code class=\"JavaScript\">chart.container(\"container\");<\/code><\/pre>\n<p>Finally, our\u00a0last command enlivens our network graph, offering a visual exploration of the solar system that invites curiosity and discovery, much like a map of the stars guiding a traveler through the night sky.<\/p>\n<pre><code class=\"JavaScript\">chart.draw();<\/code><\/pre>\n<p>This spellbinding incantation channels our data through\u00a0the JavaScript charting library, materializing it as a network graph that invites exploration and discovery.<\/p>\n<h3>Result: Celestial Dance Visualized<\/h3>\n<p>With these steps complete, our network graph is now a digital cosmos, <a href=\"https:\/\/playground.anychart.com\/XSiIH5vi\" target=\"_blank\" rel=\"nofollow\">ready to be explored<\/a>. While we&#8217;ve laid the foundation, the universe of customization and exploration is as boundless as space itself, and we&#8217;ll dive into that in the next section of the tutorial. The full HTML\/CSS\/JavaScript code\u00a0of this basic chart, provided\u00a0below, serves as both your map and your spacecraft, ready to take you to the next frontier of data visualization.<\/p>\n<p><iframe loading=\"lazy\" class=\"anychart-embed anychart-embed-XSiIH5vi\" src=\"https:\/\/playground.anychart.com\/XSiIH5vi\/iframe\" width=\"300\" height=\"150\" frameborder=\"0\" sandbox=\"allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms\" allowfullscreen=\"allowfullscreen\"><br \/>\n<\/iframe><br \/>\n<script type=\"text\/javascript\">(function(){\nfunction ac_add_to_head(el){\n\tvar head = document.getElementsByTagName('head')[0];\n\thead.insertBefore(el,head.firstChild);\n}\nfunction ac_add_style(css){\n\tvar ac_style = document.createElement('style');\n\tif (ac_style.styleSheet) ac_style.styleSheet.cssText = css;\n\telse ac_style.appendChild(document.createTextNode(css));\n\tac_add_to_head(ac_style);\n}\nac_add_style(\".anychart-embed-XSiIH5vi{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<pre><code class=\"html\">&lt;html&gt;\r\n  &lt;body&gt;\r\n  &lt;head&gt;\r\n    &lt;title&gt;Network Graph in JavaScript&lt;\/title&gt;\r\n    &lt;style type=\"text\/css\"&gt; \r\n      html, body, #container { \r\n        width: 100%; height: 100%; margin: 0; padding: 0; \r\n      } \r\n    &lt;\/style&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.1\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.1\/js\/anychart-graph.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;head&gt;\r\n  &lt;body&gt;\r\n    &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n    &lt;script&gt;\r\n      anychart.onDocumentReady(function () {\r\n        \/\/ create data:\r\n        var data = {\r\n          \/\/ celestial bodies\r\n          \/\/ with their diameter in kilometers:\r\n          \"nodes\": [\r\n            { \"id\": \"Sun\", \"value\": 1392700 }, \r\n            { \"id\": \"Mercury\", \"value\": 4879 },\r\n            { \"id\": \"Venus\", \"value\": 12104 },\r\n            { \"id\": \"Earth\", \"value\": 12756 },\r\n            { \"id\": \"Moon\", \"value\": 3474 },\r\n            { \"id\": \"Mars\", \"value\": 6779 },\r\n            { \"id\": \"Phobos\", \"value\": 22 },\r\n            { \"id\": \"Deimos\", \"value\": 12 },\r\n            { \"id\": \"Jupiter\", \"value\": 142984 },\r\n            { \"id\": \"Io\", \"value\": 3643 },\r\n            { \"id\": \"Europa\", \"value\": 3122 }, \r\n            { \"id\": \"Ganymede\", \"value\": 5262 },\r\n            { \"id\": \"Callisto\", \"value\": 4821 },\r\n            { \"id\": \"Saturn\", \"value\": 116464 },\r\n            { \"id\": \"Titan\", \"value\": 5150 }, \r\n            { \"id\": \"Rhea\", \"value\": 1527 },\r\n            { \"id\": \"Uranus\", \"value\": 50724 },\r\n            { \"id\": \"Titania\", \"value\": 1578 },\r\n            { \"id\": \"Oberon\", \"value\": 1523 },\r\n            { \"id\": \"Neptune\", \"value\": 49244 },\r\n            { \"id\": \"Triton\", \"value\": 2706 }\r\n          ],\r\n          \/\/ connections between celestial bodies\r\n          \/\/ with the distance between them in million kilometers:\r\n          \"edges\": [\r\n            { \"from\": \"Sun\", \"to\": \"Mercury\", \"distance\": 50.9 },\r\n            { \"from\": \"Sun\", \"to\": \"Venus\", \"distance\": 108.2},\r\n            { \"from\": \"Sun\", \"to\": \"Earth\", \"distance\": 148.7 },\r\n            { \"from\": \"Earth\", \"to\": \"Moon\", \"distance\": 0.3877 },\r\n            { \"from\": \"Sun\", \"to\": \"Mars\", \"distance\": 207.6 },\r\n            { \"from\": \"Mars\", \"to\": \"Phobos\", \"distance\": 0.00567 },\r\n            { \"from\": \"Mars\", \"to\": \"Deimos\", \"distance\": 0.02006},\r\n            { \"from\": \"Sun\", \"to\": \"Jupiter\", \"distance\": 748.5 },\r\n            { \"from\": \"Jupiter\", \"to\": \"Io\", \"distance\": 0.3484 },\r\n            { \"from\": \"Jupiter\", \"to\": \"Europa\", \"distance\": 0.6025 },\r\n            { \"from\": \"Jupiter\", \"to\": \"Ganymede\", \"distance\": 0.9961 },\r\n            { \"from\": \"Jupiter\", \"to\": \"Callisto\", \"distance\": 1.81 },\r\n            { \"from\": \"Sun\", \"to\": \"Saturn\", \"distance\": 1450 },\r\n            { \"from\": \"Saturn\", \"to\": \"Titan\", \"distance\": 1.17 },\r\n            { \"from\": \"Saturn\", \"to\": \"Rhea\", \"distance\": 0.4667 },\r\n            { \"from\": \"Sun\", \"to\": \"Uranus\", \"distance\": 2930 },\r\n            { \"from\": \"Uranus\", \"to\": \"Titania\", \"distance\": 0.4095 },\r\n            { \"from\": \"Uranus\", \"to\": \"Oberon\", \"distance\": 0.5559 },\r\n            { \"from\": \"Sun\", \"to\": \"Neptune\", \"distance\": 4470 },\r\n            { \"from\": \"Neptune\", \"to\": \"Triton\", \"distance\": 0.3287 }\r\n          ]\r\n        };\r\n        \/\/ create a network graph and set the data:\r\n        var chart = anychart.graph(data);\r\n        \/\/ set the chart title:\r\n        chart.title(\"Solar System Network Graph\");\r\n        \/\/ set the container id:\r\n        chart.container(\"container\");\r\n        \/\/ initiate drawing the chart:\r\n        chart.draw();\r\n      });\r\n    &lt;\/script&gt;\r\n  &lt;\/body&gt;\r\n&lt;html&gt;<\/code><\/pre>\n<h2>Customizing\u00a0JavaScript Network Graph<\/h2>\n<p>As our voyage through the digital cosmos deepens, let\u2019s refine our network graph with some astute customizations, ensuring each celestial body and connection is not only seen but understood in vivid detail. These enhancements will infuse our graph with both beauty and functionality, turning it into a dynamic map of the solar system that invites further exploration.<\/p>\n<h3>Enhancing Nodes<\/h3>\n<p>With our solar system taking shape, let&#8217;s ensure that each celestial body is clearly identifiable. We achieve this by customizing their appearance, adding labels, and enhancing tooltips. This will allow stargazers to not only see the planets and moons but to also gauge their relative sizes and other key attributes at a glance.<\/p>\n<p>First, let&#8217;s infuse our JavaScript universe with a bit of cosmic artistry. The fill attribute in our data effectively showcases each planet and moon with distinct colors, subtly reflecting their unique characteristics and atmospheres. Considering the circular nature of our nodes, the height attribute alone suffices to represent the size of each celestial body, allowing us to differentiate their scales visually. This simple yet powerful combination of color and size crafts an elegant map of our solar system.<\/p>\n<pre><code class=\"JavaScript\">var data = {\r\n  \"nodes\": [\r\n    { \"id\": \"Sun\", \"value\": 1392700, \"fill\": \"#FFC107\", \"height\": 60 },\r\n    { \"id\": \"Mercury\", \"value\": 4879, \"fill\": \"#C0C0C0\", \"height\": 14 },\r\n    { \"id\": \"Venus\", \"value\": 12104, \"fill\": \"#FFDEAD\", \"height\": 20 },\r\n    \/\/ Additional nodes follow\r\n  ],\r\n  \/\/ Connections between these celestial bodies are defined elsewhere\r\n};<\/code><\/pre>\n<p>In this case, the height values for each celestial body are approximations, chosen to visually indicate relative sizes while maintaining clarity. These values are not to scale but are designed to ensure that all elements, from the massive Sun to the smaller moons, are visible and distinct within our network graph. This simplification helps keep the visualization clear and accessible, avoiding the complexities of true astronomical scales.<\/p>\n<p>Second, we enable labels for each node, making sure every celestial body in our solar system is immediately recognizable:<\/p>\n<pre><code class=\"JavaScript\">var nodes = chart.nodes();\r\nnodes.labels().enabled(true);<\/code><\/pre>\n<p>Next, we set the visual style of these labels to ensure they are clear and aesthetically pleasing:<\/p>\n<pre><code class=\"JavaScript\">nodes.labels().fontSize(15);\r\nnodes.labels().fontColor(\"black\");<\/code><\/pre>\n<p>Finally, we add tooltips that show detailed information about each celestial body when hovered over. This feature uses HTML to enhance the presentation, showing both the name and diameter of the celestial bodies:<\/p>\n<pre><code class=\"JavaScript\">nodes.tooltip().useHtml(true);\r\nnodes.tooltip().format(function(e){\r\n  const name = e.getData(\"id\");\r\n  const value = e.getData(\"value\");\r\n  return `&lt;b&gt;${name}&lt;br&gt;${diameter}&lt;\/b&gt; km in diameter`\r\n});<\/code><\/pre>\n<p>This code\u00a0dynamically assigns labels and configures tooltips to display the name and diameter of each celestial body, enriching the user&#8217;s interaction with the graph by providing immediate, contextual information.<\/p>\n<h3>Edge Customization<\/h3>\n<p>As we map the\u00a0connections within our\u00a0Solar System network, the second step focuses on the edges \u2014 those invisible forces that connect our celestial bodies. By enhancing the edges with detailed tooltips and a visually distinct style, we provide viewers with insights into the distances between these bodies, rendering the vastness of space comprehensible.<\/p>\n<p>First, we enhance the tooltips on the edges to display detailed distance information between celestial bodies:<\/p>\n<pre><code class=\"JavaScript\">var edges = chart.edges();\r\nedges.tooltip().useHtml(true);\r\nedges.tooltip().format(function(e){\r\n  const from = e.getData(\"from\");\r\n  const to = e.getData(\"to\");\r\n  const distance = e.getData(\"distance\") * 1000000;  \/\/ Converting million km to km\r\n  return `From &lt;b&gt;${from} to ${to}&lt;\/b&gt;&lt;br&gt;&lt;b&gt;${distance}&lt;\/b&gt; km`\r\n});<\/code><\/pre>\n<p>Then, we customize the appearance of these edges to make them visually distinctive, applying a light blue stroke with a specific pattern:<\/p>\n<pre><code class=\"JavaScript\">edges.stroke(\"lightblue\", 2, \"10 5\");<\/code><\/pre>\n<p>This customization not only visually differentiates the types of connections but also offers detailed information about the distances, enhancing understanding through interactive learning.<\/p>\n<h3>Setting Graph Title<\/h3>\n<p>To encapsulate our stellar journey, we crown our graph with a fitting title, summarizing our narrative in a single line:<\/p>\n<pre><code class=\"JavaScript\">chart.title(\"Solar System Network Graph\");<\/code><\/pre>\n<p>This title not only adds a professional touch to our visualization but also frames the network graph as a comprehensive schematic of solar system connections, inviting viewers to delve into a graphical exploration of celestial relationships.<\/p>\n<h3>Final Solar System Network Graph<\/h3>\n<p>Our network graph is <a href=\"https:\/\/playground.anychart.com\/m6qXYT2C\" target=\"_blank\" rel=\"nofollow\">now ready<\/a>, capturing the intricate dance of the celestial bodies within our solar system. Below is the complete HTML\/CSS\/JavaScript code snippet for our project. Use this as a foundational blueprint for your exploration into network graph visualization, or as a launchpad for creating more complex and detailed visual data representations.<\/p>\n<p><iframe loading=\"lazy\" class=\"anychart-embed anychart-embed-m6qXYT2C\" src=\"https:\/\/playground.anychart.com\/m6qXYT2C\/iframe\" width=\"300\" height=\"150\" frameborder=\"0\" sandbox=\"allow-scripts allow-pointer-lock allow-same-origin allow-popups allow-modals allow-forms\" allowfullscreen=\"allowfullscreen\"><br \/>\n<\/iframe><br \/>\n<script type=\"text\/javascript\">(function(){\nfunction ac_add_to_head(el){\n\tvar head = document.getElementsByTagName('head')[0];\n\thead.insertBefore(el,head.firstChild);\n}\nfunction ac_add_style(css){\n\tvar ac_style = document.createElement('style');\n\tif (ac_style.styleSheet) ac_style.styleSheet.cssText = css;\n\telse ac_style.appendChild(document.createTextNode(css));\n\tac_add_to_head(ac_style);\n}\nac_add_style(\".anychart-embed-m6qXYT2C{width:100%;height:600px;}\");\n})();<\/script><\/p>\n<pre><code class=\"html\">&lt;html&gt;\r\n  &lt;body&gt;\r\n  &lt;head&gt;\r\n    &lt;title&gt;Network Graph in JavaScript&lt;\/title&gt;\r\n    &lt;style type=\"text\/css\"&gt; \r\n      html, body, #container { \r\n        width: 100%; height: 100%; margin: 0; padding: 0; \r\n      } \r\n    &lt;\/style&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.1\/js\/anychart-core.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdn.anychart.com\/releases\/8.12.1\/js\/anychart-graph.min.js\"&gt;&lt;\/script&gt;\r\n  &lt;head&gt;\r\n  &lt;body&gt;\r\n    &lt;div id=\"container\"&gt;&lt;\/div&gt;\r\n    &lt;script&gt;\r\n      anychart.onDocumentReady(function () {\r\n        \/\/ create data:\r\n        var data = {\r\n          \/\/ celestial bodies\r\n          \/\/ with their diameter in kilometers:\r\n          \"nodes\": [\r\n            { \"id\": \"Sun\", \"value\": 1392700, \"fill\": \"#FFC107\", \"height\": 60 },\u00a0\r\n            { \"id\": \"Mercury\", \"value\": 4879, \"fill\": \"#C0C0C0\", \"height\": 30 },\r\n            { \"id\": \"Venus\", \"value\": 12104, \"fill\": \"#FFDEAD\", \"height\": 30 },\r\n            { \"id\": \"Earth\", \"value\": 12756, \"fill\": \"#0000FF\", \"height\": 30 },\r\n            { \"id\": \"Moon\", \"value\": 3474, \"fill\": \"#D3D3D3\", \"height\": 15 },\r\n            { \"id\": \"Mars\", \"value\": 6779, \"fill\": \"#FF0000\", \"height\": 30 },\r\n            { \"id\": \"Phobos\", \"value\": 22, \"fill\": \"#A0522D\", \"height\": 15 },\r\n            { \"id\": \"Deimos\", \"value\": 12, \"fill\": \"#A0522D\", \"height\": 15 },\r\n            { \"id\": \"Jupiter\", \"value\": 142984, \"fill\": \"#DEB887\", \"height\": 30 },\r\n            { \"id\": \"Io\", \"value\": 3643, \"fill\": \"#FFD700\", \"height\": 15 },\r\n            { \"id\": \"Europa\", \"value\": 3122, \"fill\": \"#E6E6FA\", \"height\": 15 },\u00a0\r\n            { \"id\": \"Ganymede\", \"value\": 5262, \"fill\": \"#D2B48C\", \"height\": 15 },\r\n            { \"id\": \"Callisto\", \"value\": 4821, \"fill\": \"#BDB76B\", \"height\": 15 },\r\n            { \"id\": \"Saturn\", \"value\": 116464, \"fill\": \"#FFDAB9\", \"height\": 30 },\r\n            { \"id\": \"Titan\", \"value\": 5150, \"fill\": \"#FFA07A\", \"height\": 15 },\u00a0\r\n            { \"id\": \"Rhea\", \"value\": 1527, \"fill\": \"#F0E68C\", \"height\": 15 },\r\n            { \"id\": \"Uranus\", \"value\": 50724, \"fill\": \"#ADD8E6\", \"height\": 30 },\r\n            { \"id\": \"Titania\", \"value\": 1578, \"fill\": \"#87CEEB\", \"height\": 15 },\r\n            { \"id\": \"Oberon\", \"value\": 1523, \"fill\": \"#87CEEB\", \"height\": 15 },\r\n            { \"id\": \"Neptune\", \"value\": 49244, \"fill\": \"#00008B\", \"height\": 30 },\r\n            { \"id\": \"Triton\", \"value\": 2706, \"fill\": \"#00BFFF\", \"height\": 15 }\r\n          ],\r\n          \/\/ connections between celestial bodies\r\n          \/\/ with the distance between them in million kilometers:\r\n          \"edges\": [\r\n            { \"from\": \"Sun\", \"to\": \"Mercury\", \"distance\": 50.9 },\r\n            { \"from\": \"Sun\", \"to\": \"Venus\", \"distance\": 108.2},\r\n            { \"from\": \"Sun\", \"to\": \"Earth\",\"distance\": 148.7 },\r\n            { \"from\": \"Earth\", \"to\": \"Moon\",\"distance\": 0.3877 },\r\n            { \"from\": \"Sun\", \"to\": \"Mars\", \"distance\": 207.6 },\r\n            { \"from\": \"Mars\", \"to\": \"Phobos\", \"distance\": 0.00567 },\r\n            { \"from\": \"Mars\", \"to\": \"Deimos\", \"distance\": 0.02006},\r\n            { \"from\": \"Sun\", \"to\": \"Jupiter\", \"distance\": 748.5 },\r\n            { \"from\": \"Jupiter\", \"to\": \"Io\", \"distance\": 0.3484 },\r\n            { \"from\": \"Jupiter\", \"to\": \"Europa\", \"distance\": 0.6025 },\r\n            { \"from\": \"Jupiter\", \"to\": \"Ganymede\",  \"distance\": 0.9961 },\r\n            { \"from\": \"Jupiter\", \"to\": \"Callisto\", \"distance\": 1.81 },\r\n            { \"from\": \"Sun\", \"to\": \"Saturn\", \"distance\": 1450 },\r\n            { \"from\": \"Saturn\", \"to\": \"Titan\", \"distance\": 1.17 },\r\n            { \"from\": \"Saturn\", \"to\": \"Rhea\", \"distance\": 0.4667 },\r\n            { \"from\": \"Sun\", \"to\": \"Uranus\", \"distance\": 2930 },\r\n            { \"from\": \"Uranus\", \"to\": \"Titania\", \"distance\": 0.4095 },\r\n            { \"from\": \"Uranus\", \"to\": \"Oberon\", \"distance\": 0.5559 },\r\n            { \"from\": \"Sun\", \"to\": \"Neptune\", \"distance\": 4470 },\r\n            { \"from\": \"Neptune\", \"to\": \"Triton\", \"distance\": 0.3287 }\r\n          ]\r\n        };\r\n        \/\/ create a network graph and set the data:\r\n        var chart = anychart.graph(data);\r\n        \/\/ enable node labels:\r\n        var nodes = chart.nodes();\r\n        nodes.labels().enabled(true);\r\n        \/\/ customize node labels:\r\n        nodes.labels().fontSize(15);\r\n        nodes.labels().fontColor(\"black\")\r\n        \/\/ customize node tooltips:\r\n        nodes.tooltip().useHtml(true);\r\n        nodes.tooltip().format(function(e){\r\n          const name = e.getData(\"id\");\r\n          const value = e.getData(\"value\");\r\n          return `&lt;b&gt;${name}&lt;br&gt;${value}&lt;\/b&gt; km in diameter`\r\n        });\r\n        \/\/ customize edge tooltips:\r\n        var edges = chart.edges();\r\n        edges.tooltip().useHtml(true);\r\n        edges.tooltip().format(function(e){\r\n          const from = e.getData(\"from\");\r\n          const to = e.getData(\"to\");\r\n   \t  const distance = e.getData(\"distance\") * 1000000;\r\n   \t  return `From &lt;b&gt;${from}&lt;\/b&gt; to &lt;b&gt;${to}&lt;br&gt;${distance}&lt;\/b&gt; km`\r\n        })\r\n        \/\/ customize the edge stroke:\r\n        edges.stroke(\"lightblue\", 2, \"10 5\")\r\n        \/\/ set the chart title:\r\n        chart.title(\"Solar System Network Graph\");\r\n        \/\/ set the container id:\r\n        chart.container(\"container\");\r\n        \/\/ initiate drawing the chart:\r\n        chart.draw();\r\n      });\r\n    &lt;\/script&gt;\r\n  &lt;\/body&gt;\r\n&lt;html&gt;<\/code><\/pre>\n<h2>Navigating\u00a0Space: Conclusion and Further Voyages<\/h2>\n<p>Congratulations, stargazer! You&#8217;ve not only journeyed through the process of crafting a basic\u00a0JavaScript network graph but have also ventured beyond, customizing it to unveil the rich tapestry\u00a0of the Solar System. Armed with these skills, the universe of data visualization is yours to explore.<\/p>\n<p>May this tutorial serve as your launchpad. The skills you&#8217;ve honed open a galaxy of possibilities. Venture forth, explore the vast expanse\u00a0of the <a href=\"https:\/\/docs.anychart.com\/Basic_Charts\/Network_Graph\" target=\"_blank\" rel=\"nofollow\">network graph documentation<\/a>, and draw inspiration from\u00a0more <a href=\"https:\/\/www.anychart.com\/products\/anychart\/gallery\/Network_Graph\/\">network graph examples<\/a>. Your next discovery is just beyond the horizon. Happy network graphing!<\/p>\n<hr \/>\n<p><strong><em>We&#8217;re thankful to Taylor Brooks for producing this amazing Network Graph tutorial as a guest post for our blog.<\/em><\/strong><\/p>\n<p><strong><em>Feel free to dive deeper into the creation of network graphs using JavaScript (HTML5) with another <a href=\"https:\/\/www.anychart.com\/blog\/2020\/07\/22\/network-graph-javascript\/\" target=\"_blank\">Network Graph Tutorial<\/a> on our blog, where Wayde Herman delves into visualizing the battles of &#8220;Game of Thrones.&#8221;<\/p>\n<p>Check out more <a href=\"https:\/\/www.anychart.com\/blog\/category\/javascript-chart-tutorials\/\">JavaScript charting tutorials<\/a>.<\/p>\n<p>Got a guest post idea? <a href=\"https:\/\/www.anychart.com\/support\/\">Let\u2019s make it work<\/a>!<\/em><\/strong><\/p>\n<p><!-- SyntaxHighlighter --><link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/styles\/default.min.css\"><link rel=\"stylesheet\" href=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/styles\/atom-one-light.min.css\"><script src=\"\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.12.0\/highlight.min.js\"><\/script><script>hljs.initHighlightingOnLoad();<\/script><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Creating a vibrant network graph in JavaScript might seem like crafting a digital cosmos: intricate, fascinating, yet entirely within reach. Whether you&#8217;re aiming to illustrate the complex interconnections within a galaxy, a social network, or the internal hierarchy of a multinational corporation, network graphs serve as a powerful tool to bring data to life, revealing [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,23,13,279,4],"tags":[53,3173,254,284,166,258,620,1292,880,806,3352,509,2838,54,1389,1760,2757,256,1111,350,844,1370,133,774,775,958,259,1762,2013,2014,32,55,2979,2016,167,146,433,152,2949,151,36,907,141,249,3111,81,57,1238,142,99,58,65,56,3526,957,1237,1141,1132,609,3099,172,3650,837,1524,610,3100,3494,2015,2816,1763,804,3599,3600,3406,3407],"class_list":["post-17167","post","type-post","status-publish","format-standard","hentry","category-anychart-charting-component","category-html5","category-javascript","category-javascript-chart-tutorials","category-tips-and-tricks","tag-anychart","tag-app-development","tag-chart","tag-chart-examples","tag-charting","tag-charts","tag-data-analytics-examples","tag-data-chart","tag-data-charting","tag-data-charts","tag-data-graphic","tag-data-graphics","tag-data-visualisation","tag-data-visualization","tag-data-visualization-best-pracices","tag-data-visualization-design","tag-data-visualization-development","tag-data-visualization-examples","tag-data-visualization-practice","tag-data-visualization-projects","tag-data-visualization-tutorial","tag-data-viz-examples","tag-dataviz","tag-dataviz-examples","tag-dataviz-projects","tag-graph-chart","tag-graphs","tag-guest-post","tag-html","tag-html-charts","tag-html5","tag-html5-charts","tag-information-graphics","tag-information-visualization","tag-interactive-charts","tag-interactive-data-visualization","tag-interactive-graphics","tag-interactive-infographic","tag-interactive-infographics","tag-interactive-visualizations","tag-javascript","tag-javascript-chart-tutorial","tag-javascript-charting","tag-javascript-charting-api","tag-javascript-charting-features","tag-javascript-charting-library","tag-javascript-charts","tag-javascript-graph","tag-javascript-graphics","tag-javascript-library","tag-js-chart","tag-js-charting","tag-js-charts","tag-js-library","tag-network-graph","tag-planet","tag-planets","tag-solar-system","tag-storytelling","tag-storytelling-examples","tag-tutorial","tag-visual-graphics","tag-visual-stories","tag-visual-story","tag-visual-storytelling","tag-visual-storytelling-examples","tag-web-chart","tag-web-charts","tag-web-design","tag-web-developers","tag-web-development","tag-web-page","tag-web-project","tag-website","tag-website-development","wpautop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Creating Interactive Network Graph Using JavaScript with Ease<\/title>\n<meta name=\"description\" content=\"This tutorial is a step-by-step guide on how to build an interactive Network Graph using JavaScript (HTML5), with the\u00a0Solar\u00a0System as an example. Learn now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating Interactive Network Graph Using JavaScript with Ease\" \/>\n<meta property=\"og:description\" content=\"Learn how to quickly build your very own interactive Network Graph using JavaScript (HTML5), with the\u00a0Solar\u00a0System as an illustrative data viz example.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/\" \/>\n<meta property=\"og:site_name\" content=\"AnyChart News\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/AnyCharts\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-18T09:29:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-19T02:38:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network_graph_tutorial_title_image-og-min.png\" \/>\n<meta name=\"author\" content=\"Taylor Brooks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Creating Interactive Network Graph Using JavaScript with Ease\" \/>\n<meta name=\"twitter:description\" content=\"Learn how to quickly build your very own interactive Network Graph using JavaScript (HTML5), with the\u00a0Solar\u00a0System as an illustrative data viz example.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network_graph_tutorial_title_image-og-min.png\" \/>\n<meta name=\"twitter:creator\" content=\"@AnyChart\" \/>\n<meta name=\"twitter:site\" content=\"@AnyChart\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Taylor Brooks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/\"},\"author\":{\"name\":\"Taylor Brooks\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/f86e4e643008eb1a114a0aa8335a6fc8\"},\"headline\":\"Creating Interactive Network Graph Using JavaScript with Ease\",\"datePublished\":\"2024-04-18T09:29:51+00:00\",\"dateModified\":\"2024-04-19T02:38:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/\"},\"wordCount\":1555,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min.png\",\"keywords\":[\"AnyChart\",\"app development\",\"chart\",\"chart examples\",\"charting\",\"charts\",\"data analytics examples\",\"data chart\",\"data charting\",\"data charts\",\"data graphic\",\"data graphics\",\"data visualisation\",\"Data Visualization\",\"data visualization best practices\",\"data visualization design\",\"data visualization development\",\"data visualization examples\",\"data visualization practice\",\"data visualization projects\",\"data visualization tutorial\",\"data viz examples\",\"dataviz\",\"dataviz examples\",\"dataviz projects\",\"graph chart\",\"graphs\",\"guest post\",\"HTML\",\"HTML charts\",\"HTML5\",\"html5 charts\",\"information graphics\",\"information visualization\",\"interactive charts\",\"interactive data visualization\",\"interactive graphics\",\"interactive infographic\",\"interactive infographics\",\"interactive visualizations\",\"JavaScript\",\"javascript chart tutorial\",\"javascript charting\",\"javascript charting api\",\"JavaScript charting features\",\"JavaScript charting library\",\"javascript charts\",\"javascript graph\",\"javascript graphics\",\"JavaScript library\",\"js chart\",\"js charting\",\"js charts\",\"js library\",\"network graph\",\"Planet\",\"planets\",\"Solar System\",\"storytelling\",\"storytelling examples\",\"tutorial\",\"visual graphics\",\"visual stories\",\"visual story\",\"visual storytelling\",\"visual storytelling examples\",\"web chart\",\"web charts\",\"web design\",\"web developers\",\"web development\",\"web page\",\"web project\",\"website\",\"website development\"],\"articleSection\":[\"AnyChart Charting Component\",\"HTML5\",\"JavaScript\",\"JavaScript Chart Tutorials\",\"Tips and Tricks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/\",\"url\":\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/\",\"name\":\"Creating Interactive Network Graph Using JavaScript with Ease\",\"isPartOf\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min.png\",\"datePublished\":\"2024-04-18T09:29:51+00:00\",\"dateModified\":\"2024-04-19T02:38:14+00:00\",\"author\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/f86e4e643008eb1a114a0aa8335a6fc8\"},\"description\":\"This tutorial is a step-by-step guide on how to build an interactive Network Graph using JavaScript (HTML5), with the\u00a0Solar\u00a0System as an example. Learn now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#primaryimage\",\"url\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min.png\",\"contentUrl\":\"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min.png\",\"width\":1792,\"height\":1005},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.anychart.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating Interactive Network Graph Using JavaScript with Ease\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#website\",\"url\":\"https:\/\/www.anychart.com\/blog\/\",\"name\":\"AnyChart News\",\"description\":\"AnyChart JS Charts\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.anychart.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/f86e4e643008eb1a114a0aa8335a6fc8\",\"name\":\"Taylor Brooks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fd77405633821cef0929db330d381c1109d9a1a17560196ad7c2ed0e8349234b?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fd77405633821cef0929db330d381c1109d9a1a17560196ad7c2ed0e8349234b?s=96&r=g\",\"caption\":\"Taylor Brooks\"},\"url\":\"https:\/\/www.anychart.com\/blog\/author\/tbrooks\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating Interactive Network Graph Using JavaScript with Ease","description":"This tutorial is a step-by-step guide on how to build an interactive Network Graph using JavaScript (HTML5), with the\u00a0Solar\u00a0System as an example. Learn now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/","og_locale":"en_US","og_type":"article","og_title":"Creating Interactive Network Graph Using JavaScript with Ease","og_description":"Learn how to quickly build your very own interactive Network Graph using JavaScript (HTML5), with the\u00a0Solar\u00a0System as an illustrative data viz example.","og_url":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/","og_site_name":"AnyChart News","article_publisher":"https:\/\/www.facebook.com\/AnyCharts","article_published_time":"2024-04-18T09:29:51+00:00","article_modified_time":"2024-04-19T02:38:14+00:00","og_image":[{"url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network_graph_tutorial_title_image-og-min.png","type":"","width":"","height":""}],"author":"Taylor Brooks","twitter_card":"summary_large_image","twitter_title":"Creating Interactive Network Graph Using JavaScript with Ease","twitter_description":"Learn how to quickly build your very own interactive Network Graph using JavaScript (HTML5), with the\u00a0Solar\u00a0System as an illustrative data viz example.","twitter_image":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network_graph_tutorial_title_image-og-min.png","twitter_creator":"@AnyChart","twitter_site":"@AnyChart","twitter_misc":{"Written by":"Taylor Brooks","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#article","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/"},"author":{"name":"Taylor Brooks","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/f86e4e643008eb1a114a0aa8335a6fc8"},"headline":"Creating Interactive Network Graph Using JavaScript with Ease","datePublished":"2024-04-18T09:29:51+00:00","dateModified":"2024-04-19T02:38:14+00:00","mainEntityOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/"},"wordCount":1555,"commentCount":0,"image":{"@id":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min.png","keywords":["AnyChart","app development","chart","chart examples","charting","charts","data analytics examples","data chart","data charting","data charts","data graphic","data graphics","data visualisation","Data Visualization","data visualization best practices","data visualization design","data visualization development","data visualization examples","data visualization practice","data visualization projects","data visualization tutorial","data viz examples","dataviz","dataviz examples","dataviz projects","graph chart","graphs","guest post","HTML","HTML charts","HTML5","html5 charts","information graphics","information visualization","interactive charts","interactive data visualization","interactive graphics","interactive infographic","interactive infographics","interactive visualizations","JavaScript","javascript chart tutorial","javascript charting","javascript charting api","JavaScript charting features","JavaScript charting library","javascript charts","javascript graph","javascript graphics","JavaScript library","js chart","js charting","js charts","js library","network graph","Planet","planets","Solar System","storytelling","storytelling examples","tutorial","visual graphics","visual stories","visual story","visual storytelling","visual storytelling examples","web chart","web charts","web design","web developers","web development","web page","web project","website","website development"],"articleSection":["AnyChart Charting Component","HTML5","JavaScript","JavaScript Chart Tutorials","Tips and Tricks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/","url":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/","name":"Creating Interactive Network Graph Using JavaScript with Ease","isPartOf":{"@id":"https:\/\/www.anychart.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#primaryimage"},"image":{"@id":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#primaryimage"},"thumbnailUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min.png","datePublished":"2024-04-18T09:29:51+00:00","dateModified":"2024-04-19T02:38:14+00:00","author":{"@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/f86e4e643008eb1a114a0aa8335a6fc8"},"description":"This tutorial is a step-by-step guide on how to build an interactive Network Graph using JavaScript (HTML5), with the\u00a0Solar\u00a0System as an example. Learn now!","breadcrumb":{"@id":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#primaryimage","url":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min.png","contentUrl":"https:\/\/www.anychart.com\/blog\/wp-content\/uploads\/2024\/04\/network-graph_tutorial_title_image-min.png","width":1792,"height":1005},{"@type":"BreadcrumbList","@id":"https:\/\/www.anychart.com\/blog\/2024\/04\/18\/creating-network-graph\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.anychart.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Creating Interactive Network Graph Using JavaScript with Ease"}]},{"@type":"WebSite","@id":"https:\/\/www.anychart.com\/blog\/#website","url":"https:\/\/www.anychart.com\/blog\/","name":"AnyChart News","description":"AnyChart JS Charts","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.anychart.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/f86e4e643008eb1a114a0aa8335a6fc8","name":"Taylor Brooks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.anychart.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fd77405633821cef0929db330d381c1109d9a1a17560196ad7c2ed0e8349234b?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fd77405633821cef0929db330d381c1109d9a1a17560196ad7c2ed0e8349234b?s=96&r=g","caption":"Taylor Brooks"},"url":"https:\/\/www.anychart.com\/blog\/author\/tbrooks\/"}]}},"_links":{"self":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/17167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/comments?post=17167"}],"version-history":[{"count":30,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/17167\/revisions"}],"predecessor-version":[{"id":17254,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/posts\/17167\/revisions\/17254"}],"wp:attachment":[{"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/media?parent=17167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/categories?post=17167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anychart.com\/blog\/wp-json\/wp\/v2\/tags?post=17167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}