Public
Edited
Oct 28, 2021
1 fork
Insert cell
Insert cell
Insert cell
a1 = 20
Insert cell
b1 = 3
Insert cell
// Reactive Cells
a1 * b1
Insert cell
Insert cell
// Boolean
true && false
Insert cell
Insert cell
Insert cell
Insert cell
word1 + " " + word2
Insert cell
// Simple String
"I am a String"
Insert cell
// Length of a String
"012367889".length
Insert cell
// String Literal with backticks
`I am two lines
This is second line`
Insert cell
Insert cell
`I am the first word - ${word1}`
Insert cell
`I am the first word in uppercase - ${word1.toUpperCase()}`
Insert cell
md`### First Markdown Program
This is the second word - **${word2.toLowerCase()}**

And this is the calculation of numbers A1 & B1 = **${a1 * b1}**
`
Insert cell
html`<h3> The number is ${a1 * b1}</h3>`
Insert cell
Insert cell
array = [1, 2, 3, 5, 7]
Insert cell
// Length of Array
array.length
Insert cell
// Access Array Elements
array[0]
Insert cell
// Access Array Elements
array[1]
Insert cell
// Part of the Array
array.slice(1, 3)
Insert cell
Insert cell
object = ({ key: "value", anotherKey: "anotherValue" })
Insert cell
// Access particular key
object.key
Insert cell
// Access all keys
Object.keys(object)
Insert cell
// Access all values
Object.values(object)
Insert cell
Insert cell
data = [
{ Area: "North", Sales: 5, Profit: 2 },
{ Area: "East", Sales: 25, Profit: 8 },
{ Area: "West", Sales: 15, Profit: 6 },
{ Area: "South", Sales: 20, Profit: 5 },
{ Area: "Central", Sales: 10, Profit: 3 }
]
Insert cell
Insert cell
function multiply(a, b) {
return a * b;
}
Insert cell
multiply(4, 5)
Insert cell
Insert cell
Insert cell
d3 = require("d3@7")
Insert cell
url = "https://raw.githubusercontent.com/amitkaps/visdown/master/data/notes.csv"
Insert cell
notes1 = d3.csv(url, d3.autoType)
Insert cell
viewof table = Inputs.table(notes1)
Insert cell
Insert cell
// importing functions as Libraries from someone else
aq = require("arquero")
Insert cell
notes2 = aq.loadCSV(url)
Insert cell
viewof table2 = Inputs.table(notes2)
Insert cell
Insert cell
dataJson = d3.json("https://data.covid19india.org/v4/min/data.min.json")
Insert cell
Insert cell
Insert cell
wikiData = d3.csv(wikiCSV)
Insert cell
viewof table3 = Inputs.table(wikiData)
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