Published
Edited
Dec 18, 2021
4 forks
Importers
95 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
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
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
function getColorDemo(percentage) {
const start = startHue2
const end = endHue2
const distance = end - start
const hue =
percentage < 0.5
? start + distance * percentage * 2
: end - distance * (percentage - 0.5) * 2
return `hsl(${hue}, ${saturation2}%, ${lightness2}%)`
}
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
Insert cell
style = html`
<style>
@keyframes in {
0% {
transform: translate(0 , calc(-1 * var(--offset))) scale(0);
}
100% {
transform: translate(0, 0) scale(1);
}
}

@keyframes out {
0% {
transform: translate(0, 0) scale(1);
}
100% {
transform: translate(0 , calc(var(--offset))) scale(0);
}
}

svg {
--duration: 1000ms;
--delay-factor: 0.5;
}

g {
transform-origin: center;
}
.result circle {
mix-blend-mode: darken;
transform-origin: var(--x) var(--y);
}

.in > circle {
--easing: cubic-bezier(0, 0, 0, 1);
--delay: calc(var(--duration) * 0.75 + var(--random) * var(--duration) * var(--delay-factor));
animation: in var(--duration) var(--delay) var(--easing) both;
}

.out > circle {
--easing: cubic-bezier(1, 0, 1, 1);
--delay: calc(var(--random) * var(--duration) * var(--delay-factor));
animation: out var(--duration) var(--delay) var(--easing) both;
}
</style>
`
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