How to Insert an Observablehq Graph into a HTML Page

How to Insert an Observablehq Graph into a HTML Page

instructions for Inserting Observablehq Graphs into HTML Pages

Observablehq is a very popular notebook to write code exploiting the D3.js library. Thanks to the many examples and tutorials available on the Web, you can fork already built notebooks and customise them for your needs.

However, once built a graph, it is not immediately easy to embed into another Web site.

In this tutorial, I propose two strategies to embed a graph into a Web site:

  • through iframe
  • producing the Javascript of the graph.

In both cases, firstly, you must to publish your notebook, by clicking the publish button.

In addition, in both cases, you should follow the following steps:

  • download the embedding code from Observable
  • insert the code into your HTML page.

In this tutorial I use the example graph available at this link.


The first solution is quite simple and it is also used for other Web sites. It is based on the use of iframes. In practice, an iframe is a HTML document embedded within another HTML document.

d3js data-visualization html observablehq

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Your Data Architecture: Simple Best Practices for Your Data Strategy

Your Data Architecture: Simple Best Practices for Your Data Strategy. Don't miss this helpful article.

How To Blend Data in Google Data Studio For Better Data Analysis

Google Data Studio helps us understand the meaning behind data, enabling us to build beautiful visualizations and dashboards that transform data into stories.

Visual Analytics and Advanced Data Visualization

Visual Analytics and Advanced Data Visualization - How CanvasJS help enterprises in creating custom Interactive and Analytical Dashboards for advanced visual analytics for data visualization

Getting Started With Data Lakes

In this post, we'll learn Getting Started With Data Lakes.<br><br> This Refcard dives into how a data lake helps tackle these challenges at both ends — from its enhanced architecture that's designed for efficient data ingestion, storage, and management to its advanced analytics functionality and performance flexibility. You'll also explore key benefits and common use cases.

Analyzing Data From U.S. Road Accidents With Data Visualization

In this article, we would be analyzing data related to US road accidents, which can be utilized to study accident-prone locations and influential factors.