Published
Edited
Nov 5, 2019
1 star
Insert cell
Insert cell
Insert cell
Insert cell
d3.selectAll("p")
.attr("class", "graf")
.style("color", "red");
Insert cell
Insert cell
html`<div id="blue_canvas"/>`
Insert cell
d3.select("#blue_canvas") // return htmldivelement
Insert cell
d3.select("#blue_canvas")
.append("svg")// return svgsvgelement
Insert cell
d3.select("#blue_canvas")
.append("svg")
.attr("width", 96)
.attr("height", 50)
.append("g") // return svggelement
.attr("transform", "translate(20,20)")
Insert cell
// d3.select("body")
d3.select("#blue_canvas")
.append("svg")
.attr("width", 96)
.attr("height", 50)
.append("g")
.attr("transform", "translate(20,20)")
.append("rect") // return svgrectelement
.attr("width", 920)
.attr("height", 460)
.attr("fill", "blue");
Insert cell
Insert cell
load_d3_selection = require("d3-selection")
Insert cell
d3 = require("d3@5")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more