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

hexo-tag-echarts-new

v1.1.0

Published

A hexo plugin for inserting echarts in your blog.

Downloads

18

Readme

警告:请尽量在同一个页面中使用同一个版本的同一个类型的 echarts js,否则可能会有意想不到的错误发生!

简体中文 | English

安装

npm install hexo-tag-echarts-new --save

使用

{% echarts width height [version] [type] [...other args] %}
echarts options
{% endecharts %}

width

图表的宽度,必填,可填数字或百分比

height

图表的高度,必填,可填数字或百分比

version

图表的版本,选填,默认 5.5.1

type

图表 js 的类型,选填,默认不填,即为 echarts.min.js
可填类型 simple,代表 echarts.simple.min.js

其他参数

其他参数将会附加在插入的 script 标签上。例如,你可以插入 data-pjax 等属性

echarts options

tag 内部填入图表的 option 对象

例如:

{% echarts 85% 400 5.4.0 simple data-pjax %}
{
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [150, 230, 224, 218, 135, 147, 260],
      type: 'line'
    }
  ]
}
{% endecharts %}

将会生成类似于:

<div id="echarts2562" style="width: 85%;height:400px;margin: 0 auto"></div>
<script
  src="https://unpkg.com/echarts@$5.4.0/dist/echarts.simple.min.js"
  data-pjax
></script>
<script data-pjax>
  var eChart2562 = echarts.init(document.getElementById("echarts2562"));
  var option2562 = {
    xAxis: {
      type: "category",
      data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
    },
    yAxis: {
      type: "value",
    },
    series: [
      {
        data: [150, 230, 224, 218, 135, 147, 260],
        type: "line",
      },
    ],
  };
  eChart2562.setOption(option2562);
  if (window.eChart2562ResizeHandler) {
    window.removeEventListener("resize", eChart2562ResizeHandler);
  }
  var eCharttestResizeHandler = function() {
    eChart2562.resize();
  };
  window.addEventListener("resize", eChart2562ResizeHandler);
</script>

示例

Demo