Public
Edited
May 19, 2023
1 fork
21 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
cartesian = new Coordinate({
width: rectWidth,
height: rectHeight,
transformations:[['cartesian']]
})
Insert cell
visualizeCoordinate(cartesian, auxiliaryLines(cartesian));
Insert cell
visualizeCoordinate(cartesian, bars());
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
translate = cartesian
.clone()
.transform('translate', tx, ty);
Insert cell
visualizeCoordinate(translate, bars());
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
scale = {
// move to center to scale
const [cx, cy] = cartesian.getCenter();
return cartesian
.clone()
.transform("translate", cx, cy)
.transform("scale", sx, sy)
.transform("translate", cx, cy);
}
Insert cell
visualizeCoordinate(scale, bars());
Insert cell
Insert cell
Insert cell
Insert cell
rotate = {
// move to center to rotate
const [cx, cy] = cartesian.getCenter();
return cartesian
.clone()
.transform('translate', cx, cy)
.transform('rotate', theta)
.transform('scale', 0.5, 0.5)
.transform('translate', -cx, -cy);
}
Insert cell
visualizeCoordinate(rotate, bars());
Insert cell
Insert cell
Insert cell
shearX = cartesian
.clone()
.transform('scale', 0.5, 0.5)
.transform('shear.x', Math.PI / 3)
Insert cell
visualizeCoordinate(shearX, bars());
Insert cell
Insert cell
Insert cell
shearY = cartesian
.clone()
.transform('scale', 0.5, 0.5)
.transform('shear.y', Math.PI / 2.5)
Insert cell
visualizeCoordinate(shearY, bars());
Insert cell
Insert cell
Insert cell
shear = cartesian
.clone()
.transform('scale', sx, sy)
.transform('shear.x', Math.PI / 3)
.transform('shear.y', Math.PI / 2.5)
Insert cell
visualizeCoordinate(shear, bars());
Insert cell
Insert cell
Insert cell
reflectX = {
// move to center to reflect
const [cx, cy] = cartesian.getCenter();
return cartesian
.clone()
.transform('translate', cx, cy)
.transform('reflect.x')
.transform('translate', -cx, -cy);
}
Insert cell
visualizeCoordinate(reflectX, bars());
Insert cell
Insert cell
Insert cell
reflectY = {
// move to center to reflect
const [cx, cy] = cartesian.getCenter();
return cartesian
.clone()
.transform('translate', cx, cy)
.transform('reflect.y')
.transform('translate', -cx, -cy);
}
Insert cell
visualizeCoordinate(reflectY, bars());
Insert cell
Insert cell
Insert cell
reflect = {
// move to center to reflect
const [cx, cy] = cartesian.getCenter();
return cartesian
.clone()
.transform('translate', cx, cy)
.transform('reflect')
.transform('translate', -cx, -cy);
}
Insert cell
visualizeCoordinate(reflect, bars());
Insert cell
Insert cell
Insert cell
transpose = {
const transpose = new Coordinate({
width: rectWidth,
height: rectHeight
});
const [cx, cy] = transpose.getCenter();
return (
transpose
.transform("transpose")
// .transform("translate", 0.5, 0.5)
// .transform("reflect.x")
// .transform("translate", -0.5, -0.5)
.transform("cartesian")
);
}
Insert cell
visualizeCoordinate(transpose, bars());
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
polar = new Coordinate({
width: circleSize,
height: circleSize,
transformations:[
['polar', startAngle, endAngle, innerRadius, outerRadius],
['cartesian']
]
})
Insert cell
visualizeCoordinate(polar, auxiliaryLines(polar, 10));
Insert cell
Insert cell
Insert cell
rose = {
const rose = new Coordinate({
width: circleSize,
height: circleSize
});
return (
rose
// .transform("translate", 0.5, 0.5)
// .transform("reflect.y")
// .transform("translate", -0.5, -0.5)
// .transform("polar", 0, Math.PI * 2, 0, 1)
.transform("cartesian")
);
}
Insert cell
visualizeCoordinate(rose, bars(20));
Insert cell
Insert cell
Insert cell
visualizeCoordinate(cartesian, bars(1, true));
Insert cell
visualizeCoordinate(rose, bars(30, true));
Insert cell
Insert cell
Insert cell
donut = {
const donut = new Coordinate({
width: circleSize,
height: circleSize
});
donut
.transform("transpose")
.transform("translate", 0.5, 0.5)
.transform("reflect.x")
.transform("translate", -0.5, -0.5)
.transform("polar", 0, Math.PI, 0, 1)
.transform("translate", 0, -0.5)
.transform("cartesian");
console.log(111, donut.getCenter());
return donut;
}
Insert cell
visualizeCoordinate(donut, bars(50, true));
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
helix = new Coordinate({
width: 500,
height: 500,
transformations: [
["helix", startAngle1, endAngle1, innerRadius1, outerRadius1],
["cartesian"]
]
})
Insert cell
visualizeCoordinate(helix, auxiliaryLines(helix, 10));
Insert cell
helixCenter = {
// move to center
const helixCenter = new Coordinate({
width: 500,
height: 500
})
return helixCenter
.transform('translate', 0.5, 0.5)
.transform('reflect.y')
.transform('translate', -0.5, -0.5)
.transform('helix', startAngle1, endAngle1, innerRadius1, outerRadius1)
.transform('cartesian');
}
Insert cell
visualizeCoordinate(helixCenter, bars(30));
Insert cell
helixTranspose = {
// transpose
const helixTranspose = new Coordinate({
width: 500,
height: 500
});
return helixTranspose
.transform('transpose')
.transform('translate', 0.5, 0.5)
.transform('reflect.x')
.transform('translate', -0.5, -0.5)
.transform('helix', startAngle1, endAngle1, innerRadius1, outerRadius1)
.transform('cartesian');
}
Insert cell
visualizeCoordinate(helixTranspose, bars(100));
Insert cell
visualizeCoordinate(helixCenter, bars(30, true));
Insert cell
visualizeCoordinate(helixTranspose, bars(100, true));
Insert cell
Insert cell
Insert cell
parallel = new Coordinate({
width: 800,
height: 320,
transformations: [
['parallel', 0, 1, 0, 1],
['cartesian']
]
})
Insert cell
visualizeCoordinate(parallel, highPoints());
Insert cell
Insert cell
radar = new Coordinate({
width: 400,
height: 400,
transformations: [
['parallel', 0, 1, 0, 1],
['translate', 0.5, 0.5],
['reflect.y'],
['translate', -0.5, -0.5],
['polar', 0, Math.PI * 2, 0, 1],
['cartesian']
]
})
Insert cell
visualizeCoordinate(radar, highPoints())
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
fisheyeCartesian = cartesian
.clone()
.transform('fisheye', 400, 100, distortionX, distortionY);
Insert cell
visualizeCoordinate(fisheyeCartesian, auxiliaryLines(fisheyeCartesian));
Insert cell
fisheyePolar = polar
.clone()
.transform('fisheye', 200, 200, 2, 2)
Insert cell
visualizeCoordinate(fisheyePolar, auxiliaryLines(fisheyePolar, 10));
Insert cell
visualizeCoordinate(fisheyeCartesian, bars());
Insert cell
fisheyeParallel = parallel
.clone()
.transform('fisheye', 200, 200, 2, 2)
Insert cell
visualizeCoordinate(fisheyeParallel, highPoints())
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
fisheyeCircularCartesian = cartesian
.clone()
.transform('fisheye.circular', 400, 160, distortionRadius, distortion);
Insert cell
visualizeCoordinate(fisheyeCircularCartesian, auxiliaryLines(fisheyeCircularCartesian, 15));
Insert cell
fisheyeCircularParallel = parallel
.clone()
.transform('fisheye.circular', 400, 100, 100, 2);
Insert cell
fisheyeCircularPolar = polar
.clone()
.transform('fisheye.circular', 200, 200, 80, 2);
Insert cell
visualizeCoordinate(fisheyeCircularPolar, auxiliaryLines(fisheyeCircularPolar, 10));
Insert cell
visualizeCoordinate(fisheyeCircularParallel, highPoints());
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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