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

chrt-markers

v0.0.23

Published

Markers for XY charts component for Chrt

Readme

chrt-markers

Component for creating markers in chrt charts. Markers are visual elements (typically circles) used to highlight significant points in a chart, making data points more visible or emphasizing specific values. Markers can be added to any chart component (lines, bars, columns) and can be customized in size, color, and appearance.

Observable Examples and Documentation:

Installing

For use with Webpack, Rollup, or other Node-based bundlers, chrt-markers can be installed as a standalone module via a package manager such as Yarn or npm.

npm install chrt-markers chrt-core

chrt-markers can be used as part of the chrt package:

npm install chrt

Usage

ES6 / Bundlers (Webpack, Rollup, etc.)

import Chrt from "chrt-core";
import { chrtMarkers } from "chrt-markers";

// Add markers to a line chart
Chrt().add(chrt.line().data(data).add(chrtMarkers()));

API Reference

Creation

chrtMarkers()

Creates a new markers component that can be added to any chart element.

// Basic markers
chrt.line().add(chrtMarkers());

// Customized markers
chrt.line().add(chrtMarkers().size(5).fill("#ff0000"));

Styling

.size([value]) / .radius([value])

Sets the size (radius) of markers. Both methods are aliases.

chrtMarkers().size(5); // 5 pixel radius

// Size based on data
chrtMarkers().size((d, i) => d.importance * 2);

.fill([color]) / .fillOpacity([value])

Sets the fill color and opacity of markers.

chrtMarkers().fill("#ff0000").fillOpacity(0.5);

// Color based on data
chrtMarkers().fill((d) => (d.value > 100 ? "#ff0000" : "#0000ff"));

.stroke([color]) / .strokeWidth([value]) / .strokeOpacity([value])

Sets the stroke (border) properties of markers.

chrtMarkers().stroke("#000000").strokeWidth(2).strokeOpacity(0.8);

Filtering

.showMarkers([filter]) / .filter([filter])

Controls which markers are displayed. Both methods are aliases.

// Show specific markers
chrtMarkers().showMarkers((d) => d.value > 100);

// Show only even indices
chrtMarkers().filter((d, i) => i % 2 === 0);

// Show specific values
chrtMarkers().filter([10, 20, 30]);

.hideMarkers([filter])

Hides markers based on a filter condition (inverse of showMarkers).

// Hide markers below threshold
chrtMarkers().hideMarkers((d) => d.value < 100);

.firstMarker([show]) / .lastMarker([show])

Shows or hides first/last markers.

// Show only first marker
chrtMarkers().firstMarker();

// Show only last marker
chrtMarkers().lastMarker();

.firstAndLastMarkers([show])

Shows or hides both first and last markers.

// Show only first and last markers
chrtMarkers().firstAndLastMarkers();

Examples

Basic Markers on Line Chart

Chrt()
  .data(data)
  .add(chrt.line().add(chrtMarkers().size(3).fill("#ff0000")));

Customized Markers

Chrt().add(
  chrt
    .line()
    .data(data)
    .add(
      chrtMarkers()
        .fill("#ff0000")
        .fillOpacity(0.5)
        .size(10)
        .stroke("#0000ff")
        .strokeWidth(3)
        .strokeOpacity(0.5),
    ),
);

Markers on Bar Charts

Chrt().add(
  chrt
    .chrtBars()
    .data(data)
    .add(
      chrtMarkers()
        .size(5)
        .filter((d) => d.value > threshold),
    ),
);

Filtered Markers

Chrt().add(
  chrt.line().data(data).add(
    chrtMarkers()
      .firstAndLastMarkers() // Show only first and last points
      .size(8)
      .fill("#ff0000"),
  ),
);