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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@xintao1105/basic-bar

v1.0.2

Published

```bash npm install @xintao1105/basic-bar ```

Downloads

2

Readme

安装

npm install @xintao1105/basic-bar

or

yarn add @xintao1105/basic-bar

示例代码

import { BasicBar } from "@xintao1105/basic-bar";
import type {
  initProps,
  Axis,
  xAxisProps,
  yAxisProps,
  zAxisProps,
  seriesProps,
  markLineProps,
  labelProps,
} from "@xintao1105/basic-bar";
import "@xintao1105/basic-bar/dist/style.css";
<BasicBar {...initProps} />;

参数类型

export interface interProps {
  /**
   * 全局
   */
  chart?: {
    /**
     * 宽度
     * @default 420
     */
    width?: number;
    /**
     * 高度
     * @default 210
     */
    height?: number;
    /**
     * 边距
     * @description 数据顺序[上,右,下,左]
     * @default [30,25,25,45]
     */
    margin?: number[];
    /**
     * 柱状样式
     */
    bar?: {
      /**
       * 柱状类型
       * @description "方形" | "子弹头"
       * @default "select"
       */
      style?: "square" | "arc";
      /**
       * 系列间距
       * @description 范围0-1
       * @default 0.4
       */
      seriesIntervalWidth?: number;
      /**
       * 柱宽
       * @default 12
       */
      barWidth?: number;
      /**
       * 柱子背景
       * @default "rgba(255, 255, 255, 0)"
       */
      background?: string;
    };
    /**
     * 数据动画
     */
    dataAnimation?: {
      /**
       * @description: 是否启用
       * @default show = true
       */
      show?: boolean;
      /**
       * 动画时长(s)
       * @default 1
       */
      duration?: number;
    };
    /**
     * 定时渲染
     */
    timedRendering?: {
      /**
       * @description: 是否启用
       * @default show = false
       */
      show?: boolean;
      /**
       * 时间(s)
       * @default 10
       */
      time?: number;
    };
  };

  /**
   * 图例
   */
  legend?: legendProps;
  /**
   * 坐标轴
   */
  axes?: {
    xAxis?: xAxisProps;
    yAxis?: yAxisProps;
    zAxis?: zAxisProps;
  };
  /**
   * 系列
   */
  series?: seriesProps[];
  /**
   * 提示框
   */
  tooltip?: tooltipProps;
  /**
   * 数据
   */
  data?: Array<dataType> | [];
  /**
   * 主题名称
   */
  theme?: string;
  /**
   * 根据json文件注册自定义主题
   */
  themeJsonUrl?: string;
  /**
   * the opts of echarts. object, will be used when initial echarts instance by echarts.init
   */
  opts?: Opts;
  /**
   * the style of echarts div. object, default is {height: '300px'}
   */
  style?: CSSProperties;
  /**
   * the class of echarts div. you can setting the css style of charts by class name
   */
  className?: string;
  /**
   * when after chart reander, do the callback widht echarts instance
   */
  onChartReady?: (instance: any) => void;
  /**
   * binding the echarts event, will callback with the echarts event object, and the echart object as it's paramters.
   * https://echarts.apache.org/zh/api.html#echartsInstance.on
   * const onEvents = {
   *   'click': this.onChartClick,
   *   'legendselectchanged': this.onChartLegendselectchanged
   * }
   */
  onEvents?: Record<string, (e: any, instance: any) => void>;
}