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

wx-gauge

v1.2.0

Published

simple gaguge component with canvas for wechat miniprogram

Readme

微信小程序仪表盘组件

基于canvas开发,功能不断叠加

如何使用

第一步:在需要使用该组件地方的配置文件中加入

{
  "usingComponents":{
    "gauge":"../../components/gauge" // 组件地址
  }
}

或者使用官方的npm支持文档中方案 https://developers.weixin.qq.com/miniprogram/dev/devtools/npm.html

第二步:在需要引用该组件的地方引入如下所示代码

  <gauge 
      height="750" 
      r="135" 
      bgWidth="13"
      gaugeid="g1"
      animateMsec="700" 
      scaleTextStyle="{{scaleTextStyle}}" 
      indicatorTextStyle='{{indicatorTextStyle}}'
      indicatorValueStyle='{{indicatorValueStyle}}'
      indicatorCircleStyle='{{indicatorCircleStyle}}'
      min="0"
      max="1000"
      value="900"
  />

备注:数据刻度暂时定位人工分段,后期采用自动分割尺度

API

名称 类型 默认值 备注

| 名称 | 类型 | 默认值 | 备注 | 必填 | | -------------------- | -------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | | width | Number | 750 | 表盘容器宽度,单位为rpx | 否 | | height | Number | 450 | 表盘容器高度单位为rpx | 否 | | gaugeid | String | 'gauge' + Math.random() | 表盘容器组件id,即canvasid | 否 | | r | Number | 95 | 表盘半径,单位为px | 否 | | startAngle | Number | 80 / 90 * Math.PI | 表盘开角,角度制 | 否 | | endAngle | Number | 10 / 90 * Math.PI | 表盘闭角,角度制 | 否 | | bgColor | String | #f0f0f0 | 表盘底色 | 否 | | indicatorBgColor | Array / String | 默认为数组,即渐变色,渐变色格式[{progress:0,value:'#fff'},{progress:1,value:'red'}],详情参见源码 | 指示器颜色 | 否 | | bgWidth | Number | 15 | 表盘宽度 | 否 | | min | Number | 0 | 最小值 | 否 | | max | Number | 1000 | 最大值 | 否 | | value | Number | 700 | 指示器值 | 否 | | animateMsec | Number | 0 | 动画时长(毫秒),0表示无动画 | 否 | | indicatorText | String | - | 指示器文本 | 否 | | scale | Array | [0,200,400,600,800,1000] | 指示器标尺刻度 | 否 | | indicatorTextStyle | Object | {show:false,size:12,color:'#666',text:''} | 指示器文本样式 | 否 | | indicatorValueStyle | Object | {show:false,size:18,color:'#4575e8'} | 指示器值样式 | 否 | | indicatorCircleStyle | Object | {show:false,bgColor:'#00b800',r:9,borderRadius:3,borderColor:'#fff'} | borderColor可以为数组,当为数组时采用径向渐变,数组格式同indicatorBgColor | 否 | | scaleTextStyle | Object | {show:fasle,size:16,color:#f0f0f0} | 指示器标尺样式 | 否 |