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

@markbattistella/docsify-charty

v3.0.0

Published

Add charts and graphs to your docsify website

Downloads

834

Readme

docsify.js charty

This plugin enhances your Docsify documentation by adding SVG charts to your website. It allows you to add in multiple types of charts, including pie, doughnut, sectional, radar, area, scatter, line, and bar types. By utilising this plugin, you can easily show your data in a beautiful interface.

Installation

Update index.html file

Assuming you have a working docsify framework set up, it is easy to use the plugin.

  1. Add the following script and stylesheet to your index.html via either CDN or downloading it and using it locally:

    <!-- unpkg.com -->
    <script src="https://unpkg.com/@markbattistella/docsify-charty@latest/dist/docsify-charty.min.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/@markbattistella/docsify-charty@latest/dist/docsify-charty.min.css">
    
    <!-- jsDelivr -->
    <script src="https://cdn.jsdelivr.net/npm/@markbattistella/docsify-charty@latest"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@markbattistella/docsify-charty@latest/dist/docsify-charty.min.css">
    
    <!-- locally -->
    <script src="docsify-charty.min.js"></script>
    <link rel="stylesheet" href="docsify-charty.min.css">
  2. In docsify setup, configure the plugin:

    <script>
    window.$docsify = {
      charty: {
    
        // Global theme for chart colours in HEX
        theme: '.',
    
        // Accepts "dark" or "light"
        mode: "light",
    
        // Boolean to enable or disable debug messages
        debug: false
      }
    };
    </script>

Configuration

There are several options available for the docsify-charty plugin:

Example: index.html

| Name | Type | Example | Description | |---------|-----------|-----------|-------------------------------------------| | theme | String | "#EE5599" | Global theme for chart colours in HEX | | mode | String | "light" | Accepts "dark" or "light" | | debug | Boolean | false | Console logs if charts aren't loading |

Per chart settings

| Name | Accepts | Description | |-------------------|---------------|------------------------------------------| | title | String | The title of the chart, displayed at the top. Leave blank if you want to hide it | | caption | String | The sub-text of the chart, displayed under the title. Leave blank to hide it | | type | String | The type of charty you want to display | | options.theme | String | Set an individual theme to this chart. It will override the global theme | | options.legend | Boolean | Show the legend. Default true | | options.labels | Boolean | Show the chart labels. Default true | | options.numbers | Boolean | Show the chart numbers. Default true | | data.label | String | Graphed data point label | | data.value | Int / Array | Graphed value that puts it on the render | | data.colour | String | Override the global and theme with a specific colour |

Markdown code

```charty
{
  "title":   '',
  "caption": '',
  "type":    '',
  "options": {
    "theme":   '',
    "legend":  '',
    "labels":  '',
    "numbers": ''
  },
  "data": [
    {
      "label": '',
      "value": '',
      "colour": ''
    }
  ]
}
\`\`\`

Types of charts

Circular

Pie chart

docsify-charty: pie

Donut / Doughnut chart

docsify-charty: donut

Section / Sectional chart

docsify-charty: section

Rings chart

docsify-charty: rings

Area

Radar chart

docsify-charty: radar

Area chart

docsify-charty: area

Plot

Scatter chart

docsify-charty: scatter

Bubble chart

docsify-charty: bubble

Line chart

docsify-charty: line docsify-charty: line

Bar / Column

Bar / Bar-stack chart

docsify-charty: line docsify-charty: line

Column / Column-stack chart

docsify-charty: line docsify-charty: line

Rating

docsify-charty: line

Contributing

  1. Clone the repo: git clone https://github.com/markbattistella/docsify-charty.git

  2. Create your feature branch: git checkout -b my-feature

  3. Commit your changes: git commit -am 'Add some feature'

  4. Push to the branch: git push origin my-new-feature

  5. Submit the pull request