npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@d3-timeline/astro

v0.0.1

Published

An Astro component wrapper for the D3-based Timeline visualization component. It seamlessly integrates the framework-agnostic D3 timeline logic with Astro's template engine and slot mechanisms.

Downloads

100

Readme

@d3-timeline/astro

An Astro component wrapper for the D3-based Timeline visualization component. It seamlessly integrates the framework-agnostic D3 timeline logic with Astro's template engine and slot mechanisms.

Installation

npm install @d3-timeline/astro @d3-timeline/core

Basic Usage

Import the Timeline and TimelineItem components into your .astro page. Then, pass your array of event objects as well as a configuration object. The timeline elements will initialize correctly on the client side when the page loads.

---
import Timeline from '@d3-timeline/astro';
import TimelineItem from '@d3-timeline/astro/TimelineItem.astro';

const events = [
  { id: "1", date: new Date("2023-01-15"), title: "Project Kickoff", description: "Initial team meeting." },
  { id: "2", date: new Date("2023-05-10"), title: "Alpha Release", description: "First working version." }
];

const config = {
  orientation: 'horizontal' // 'horizontal' or 'vertical'
};
---

<div style="height: 400px; position: relative;">
  <Timeline data={events} config={config}>
    {events.map((item) => (
      <TimelineItem id={item.id}>
        <div class="custom-event-card">
          <h3>{item.title}</h3>
          <p>{item.description}</p>
          <small>{item.date.toDateString()}</small>
        </div>
      </TimelineItem>
    ))}
  </Timeline>
</div>

<style>
.custom-event-card {
  background: white;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 4px;
}
</style>

Props (<Timeline>)

  • data: An array of data objects. Each object must contain a valid date property (JavaScript Date object).
  • config: A configuration object passed down to the core engine. You can configure orientation, custom collisionPriority, etc.

Props (<TimelineItem>)

  • id: A unique identifier (string or number) matching the id from your data array element. This is required for the timeline core to pair your rendered DOM nodes with their exact temporal placement.

Client-side Events

Because Astro is primarily a static HTML builder, reactivity requires interacting with standard DOM events. The timeline container element emits a timeline-selected Custom Event when an item is clicked.

<script>
  document.addEventListener('timeline-selected', (e) => {
    console.log('User selected:', e.detail);
  });
</script>