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 🙏

© 2025 – Pkg Stats / Ryan Hefner

sci-glyph

v2.0.0

Published

基于D3的常用可视化图标库

Downloads

2

Readme

在搭建论文中的可视化系统时,发现有诸多可视化图标设计可以被复用,故基于D3.js封装了一个sciGlyph库。

图标展示


用法


Step1: 首先下载npm包: npm i sci-glyph

Step2: 引入方法: import {instrumentPanelGlyph, radialAreaGlyph, spatialDistribution} from 'sci-glyph'

Step3: 每个方法调用需要传入两个参数:

  • canvasD3画布实例。
  • option图形的配置项对象。每个图形的配置项如下面所述。

instrumentPanelGlyph

| 配置项 | 含义 | 值类型 | | :----: | :----: | :----: | | smallCircleSize | 外围小圆所表示的数据 | Array | | pointerMax | 指针所表示数据的最大值 | Number | | pointerMean | 指针数值 | Number | | innerArcMax | 内圆弧最大值 | Number | | innerArcMean | 内圆弧数值 | Number | | upperArcMax | 上圆弧最大值 | Number | | upperArcMean | 上圆弧数值 | Number | | lowerArcMax | 下圆弧最大值 | Number | | lowerArcMean | 下圆弧数值 | Number | | centerRadius | 中心圆半径 | Number | | outerRadius | 外圆半径 | Number | | themeStyle | 主题颜色 | String | | pointerFontSize | 字体大小 | String |

radialAreaGlyph

| 配置项 | 含义 | 值类型 | | :----: | :----: | :----: | | histogramData | 外围柱状图数据 | Array | | radialAreaData | 径向面积图数据 | Array | | axisData | 径向轴文本标记数据 | Array | | themeStyle | 主题颜色 | String | | centerText | 圆心文本 | String | | opacityOfInnerRing | 内圆环透明度 | Number | | innerRadius | 内圆半径 | Number | | middleRadius | 中间圆半径 | Number | | centerTextFontSize | 中心文本字体大小 | String | | axisFontSize | 标记文本字体大小 | String |

spatialDistribution

| 配置项 | 含义 | 值类型 | | :----: | :----: | :----: | | smallCircleSize | 内层小圆所表示的数据 | Array | | outerRadius | 外圆半径 | Number | | innerRadius | 内圆半径 | Number | | outerArcData | 外围圆弧数据 | Array | | innerArcData | 内层圆弧数据 | Array | | points | 地图中的点数据 | Array | | chinaMap | 地图Geojson数据 | Geojson | | colors | 类别颜色数组 | Array | | smallCircleMarkColors | 内层小圆颜色 | Array | | themeStyle | 主题颜色 | String | | mapScale | 地图缩放 | Number | | innerArcWidth | 内层圆弧宽度 | Number | | pointsColors | 地图中点的颜色数组 | Object | | pointR | 地图中的点的半径 | Number |

示例

import {instrumentPanelGlyph, radialAreaGlyph, spatialDistribution} from 'sci-glyph';

let canvas = d3.select(`#${containerId}`)
    .append('svg')
    .attr('width', 200)
    .attr('height', 210);

instrumentPanelGlyph(canvas, {
    smallCircleSize: [11,8,45,21,2,34,79,50,25,0],
    pointerMax: 56.0204081632653,
    pointerMean: 26.506147994187383,
    innerArcMax: 100,
    innerArcMean: 58,
    upperArcMax: 100,
    upperArcMean: 60,
    lowerArcMax: 100,
    lowerArcMean: 45,
    centerRadius: 15,
    outerRadius: 50,
    themeStyle: '#5B9BD5',
    pointerFontSize: '16px'
});