Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stacked-sparklines

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stacked-sparklines

SVG stacked sparklines web component

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Stacked Sparklines

A web component for creating a graph that shows a set of stacked sparklines.

Basic example

<stacked-sparklines data-data="DATA_GOES_HERE" caption="Example data" data-background="#00b7c6" data-foreground="white">
    <!-- fallback content -->
</stacked-sparklines>

Example graph showing two lines, one dropping, one rising

Installation

To install a web component you need to include the component's JavaScript file in your project. You can do this in one of two ways:

Install JS from npm

If you're already using npm or yarn to handle your project's dependencies, you can add stacked-sparklines to your project using the following command:

# If you use yarn
yarn add stacked-sparklines

# If you use npm
npm install stacked-sparklines

Then you can import the stacked-sparklines module into your project:

import "stacked-sparklines";
Install JS manually

If you prefer not to use npm, you can include the stacked-sparklines build file directly:

<!-- Load Picobel -->
<script type='text/javascript' src='https://raw.githubusercontent.com/tomhazledine/stacked-sparklines/main/build/stacked-sparklines.0.0.1.js'></script>

Use the component in your markup

Once you've included the stacked-sparklines module in your project, you can use the stacked-sparklines element in your HTML:

<stacked-sparklines>
    <!-- fallback content -->
</stacked-sparklines>

Options

-data (required)

Without any data, the component won't render anything. The data should be a nested 2D array of numbers. For example:

<stacked-sparklines data-data="[[1,2,3,4],[5,6,7,8]]"></stacked-sparklines>

FAQs

Package last updated on 18 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc