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

@eledah/parto

v0.2.0

Published

Framework-agnostic argument map sunburst charts with light/dark themes

Readme

Parto — argument map charts

npm version

Parto (پرتو) is a framework-agnostic JavaScript library for visualizing debate argument structures as interactive sunburst charts.

  • Muted gold center (thesis), green agree (support), red disagree (attack)
  • Optional centered legend inside the chart
  • Light / dark / system themes
  • Hover tooltips and click-to-zoom
  • ESM for bundlers + CDN global bundle for plain HTML

Install

npm install @eledah/parto

Quick start

import { createArgumentMap } from '@eledah/parto';
import '@eledah/parto/styles.css';

const chart = createArgumentMap('#chart', mapData, {
  theme: 'auto',
  legend: true,
  tooltip: true,
  zoom: true,
});

The legend is shown by default. Set legend: false when the surrounding UI already explains the semantic colors.

CDN

<link rel="stylesheet" href="https://unpkg.com/@eledah/parto/dist/parto.css" />
<script src="https://unpkg.com/@eledah/parto/dist/parto.global.min.js"></script>
<script>
  Parto.createArgumentMap('#chart', mapData);
</script>

Load from JSON

Keep map data in a separate .json file and fetch it at runtime:

<link rel="stylesheet" href="https://unpkg.com/@eledah/parto/dist/parto.css" />
<div id="chart" style="height: 480px"></div>
<script src="https://unpkg.com/@eledah/parto/dist/parto.global.min.js"></script>
<script>
  const chart = Parto.createArgumentMap('#chart', null, { theme: 'auto' });
  chart.setLoading(true);

  fetch('map.json')
    .then((r) => {
      if (!r.ok) throw new Error('Failed to load map');
      return r.json();
    })
    .then((mapData) => {
      chart.setLoading(false);
      chart.setData(mapData);
    })
    .catch((err) => {
      chart.setLoading(false);
      chart.showError(err.message);
    });
</script>

The chart shows built-in loading, empty, and error overlays — no need to build your own status UI.

Mobile / touch

  • Tooltips use pointer events (not hover-only mouse events).
  • First tap on an arc shows the tooltip above your finger.
  • Second tap on the same arc zooms in (when zoom is enabled).
  • Tap outside the chart to dismiss the tooltip.

Note: fetch needs a URL (local static server or hosted file). Opening HTML via file:// will block cross-file requests in most browsers.

Validate map JSON

CLI (after install)

npx parto-validate-map my-map.json
# or multiple files
npx parto-validate-map maps/*.json

Programmatic

import { validateMapData, ValidationError } from '@eledah/parto';

try {
  const { data, warnings } = validateMapData(json);
  warnings.forEach(console.warn);
} catch (err) {
  if (err instanceof ValidationError) {
    console.error(err.issues);
  }
}

JSON Schema

A draft 2020-12 schema ships with the package:

{
  "$ref": "https://unpkg.com/@eledah/parto/schema/argument-map.schema.json"
}

Or import from npm: @eledah/parto/schema.json

Data format

{
  "new_nodes": [
    {
      "id": "1",
      "type": "thesis",
      "title": "Central claim",
      "description": "",
      "quote": "",
      "speaker": "Alice",
      "relations": []
    },
    {
      "id": "2",
      "type": "claim",
      "title": "Supporting point",
      "description": "Reasoning text",
      "quote": "",
      "speaker": "Bob",
      "relations": [
        { "target_node_id": "1", "relation_type": "support", "reasoning": "Because..." }
      ]
    }
  ]
}

API

createArgumentMap(container, data, options?) returns:

  • setData(data) — replace map data
  • setLoading(true | false) — show/hide loading overlay
  • showError(message?) — show error overlay (e.g. failed fetch)
  • setTheme('light' | 'dark' | 'auto')
  • setColors({ center, support, attack, border })
  • highlight(nodeId | null)
  • zoomTo(nodeId) / zoomToPath(ids) / zoomOut() / resetZoom()
  • getZoomPath() — breadcrumb data
  • resize() / destroy()

Development

npm install
npm test
npm run build
npm run pack:check

Examples

Live demos: eledah.ir/parto (GitHub Pages)

Local copies in examples/ (run npm run build first, or serve with any static server):

  • examples/01-basic-cdn — script tag, no build step
  • examples/02-theme-tooltip — themes and custom tooltip
  • examples/03-esm-rtl — ESM import with Persian/RTL data
  • examples/04-fetch-json — load map data from a JSON file

Publish

npm login
npm publish --access public

License

MIT