Published
Edited
May 27, 2022
Insert cell
# D3.least Test
Insert cell
src = [
{
"Name": "Poland",
"Value": -431
},
{
"Name": "Bhutan",
"Value": -331
},
{
"Name": "India",
"Value": -487
},
{
"Name": "China",
"Value": 252
},
{
"Name": "Nepal",
"Value": -353
},
{
"Name": "Australia",
"Value": -393
},
{
"Name": "Japan",
"Value": -151
},
{
"Name": "Mongolia",
"Value": 16
},
{
"Name": "Brunei",
"Value": -7
},
{
"Name": "Cambodia",
"Value": 85
}

]
Insert cell
d3.least(src, d => d.Value)
Insert cell
d3.least(src, d => Math.abs(d.Value+100))
Insert cell
d3.least(src, d => Math.abs(d.Value-100))
Insert cell
d3.least(src, d => Math.abs(d.Value*100))
Insert cell
d3.least(src, d => Math.abs((d.Value+100)/(d.Value-100)))
Insert cell
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