Public
Edited
May 30, 2023
2 forks
Importers
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
plausible_analytics = {
const DATA_DOMAIN = window.origin.replace("https://", "");
const DATA_API = "https://plausible.io";
var a = html`<a href="${document.baseURI.replace(
"observablehq.com",
DATA_DOMAIN
)}">`, // Fix for Observable
r = window.document,
t = localStorage, // Fix for Observable
o = r.currentScript,
s = "https://plausible.io/api/event",
l = t && t.plausible_ignore;
function p(t) {
console.warn("Ignoring Event: " + t);
}
function e(t, e) {
if (
/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(a.hostname) ||
"file:" === a.protocol
)
return p("localhost");
if (
!(
window._phantom ||
window.__nightmare ||
window.navigator.webdriver ||
window.Cypress
)
) {
if ("true" == l) return p("localStorage flag");
var i = {};
(i.n = t),
(i.u = a.href),
(i.d = DATA_DOMAIN),
(i.r = r.referrer || null),
(i.w = window.innerWidth),
e && e.meta && (i.m = JSON.stringify(e.meta)),
e && e.props && (i.p = JSON.stringify(e.props));
var n = new XMLHttpRequest();
n.open("POST", s, !0),
n.setRequestHeader("Content-Type", "text/plain"),
n.send(JSON.stringify(i)),
(n.onreadystatechange = function () {
4 == n.readyState && e && e.callback && e.callback();
});
}
}
var i = (window.plausible && window.plausible.q) || [];
window.plausible = e;
for (var n, w = 0; w < i.length; w++) e.apply(this, i[w]);
function d() {
n !== a.pathname && ((n = a.pathname), e("pageview"));
}
var u,
c = window.history;
c.pushState &&
((u = c.pushState),
(c.pushState = function () {
u.apply(this, arguments), d();
}),
window.addEventListener("popstate", d)),
"prerender" === r.visibilityState
? r.addEventListener("visibilitychange", function () {
n || "visible" !== r.visibilityState || d();
})
: d();
}
Insert cell
Insert cell
Insert cell
Insert cell
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