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

@so-chart/radar

v1.1.2

Published

雷达图

Readme

@so-chart/radar

雷达图组件,使用 Canvas 绘制图形,并通过 SVG 交互层支持数据区域 hover。

Hover 交互

雷达图以每个数据集的填充多边形作为 hover 命中区域。将鼠标移动到整块区域内时,该区域会高亮并展示 tooltip;tooltip 会列出当前数据集的全部维度和值。区域重叠时按绘制顺序优先命中最上层的数据集,图表 resize 后会重新计算区域坐标。

chart.setOption({
  hover: {
    opacity: 0.24,
    lineWidth: 3,
    color: '#2aaeea',
  },
  tooltip: {
    show: true,
  },
  // xAxis、yAxis、radius、datasets ...
});

hover.opacity 默认值为 0.24,会限制在 0 到 1;hover.lineWidth 默认值为 3,单位与图表内部绘制坐标一致;不传 hover.color 时会跟随当前数据集的 lineColor。null 和 undefined 在多边形几何中按 0 处理,在 tooltip 中显示为 —,以区分缺失值和真实的 0。tooltip 支持公共 tooltip 的 show、fixed、drag 和 formatter 配置;普通 hover Tooltip 与命中点保持约 12px 屏幕间距,边缘空间不足时会选择更宽裕的一侧,并按浏览器帧率合并位置更新,垂直方向切换时使用 120ms 缓动。

包入口运行时只公开默认的 getRadarChart 工厂,类型导出除外;DOM 清理函数属于内部实现,避免 UMD 产物产生 default 与 named export 混合警告。

TypeScript 类型

雷达图选项和实例类型由包入口直接导出;运行时仍只有默认图表工厂:

import getRadarChart, { type RadarOptions, type RadarInstance } from '@so-chart/radar';

示例与说明

  • 可运行示例:demo/examples
  • 配置与行为说明:demo/docs
  • 预览站和包独立 Demo 都从 demo/manifest.ts 读取示例关系;宿主接入仍以本 README、包入口和导出类型为准。