Published
Edited
Feb 5, 2021
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
px_to_mm(166.225) - 44
Insert cell
function mm_to_px(mm) {
const px = mm * mm_svg.getBoundingClientRect().width;
return px;
}
Insert cell
function px_to_mm(px) {
const mm = px / mm_svg.getBoundingClientRect().width;
return mm;
}
Insert cell
window.devicePixelRatio
Insert cell
mm_to_px(57)
Insert cell
mm_svg = d3
.create("svg")
.attr("width", "1mm")
.attr("height", "1mm")
.node()
Insert cell
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more