Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
svelte-tiny-linked-charts
Advanced tools
*Looking for a shareable component template? Go here --> [sveltejs/component-template](https://github.com/sveltejs/component-template)*
This is a library to display tiny bar charts. These charts are more so meant for graphical aids, rather than scientific representations. There's no axis labels, no extensive data visualisation, just bars.
Demo and Docs: https://mitcheljager.github.io/svelte-tiny-linked-charts/
Install using Yarn or NPM.
yarn add svelte-tiny-linked-charts
npm install --save svelte-tiny-linked-charts
Include the chart in your app.
import { LinkedChart, LinkedLabel } from "svelte-tiny-linked-charts"
<LinkedChart { data } />
<LinkedLabel />
<LinkedValue />
Supply your data in a simple key:value object:
let data = {
"2005-01-01": 25,
"2005-01-02": 20,
"2005-01-03": 18,
"2005-01-04": 17,
"2005-01-05": 21
}
<LinkedChart { data } />
Or if you prefer supply the labels and values separately:
let labels = [
"2005-01-01",
"2005-01-02",
"2005-01-03",
"2005-01-04",
"2005-01-05"
]
let values = [
25,
20,
18,
17,
21
]
<LinkedChart { labels } { values } />
For detailed documentation on every property check out: https://mitcheljager.github.io/svelte-tiny-linked-charts/
<LinkedChart />
component.
Property | Default | Description |
---|---|---|
data | {} | Data that will be displayed in the chart supplied in key:value object. |
labels | [] | Labels supplied separately, to be used together with "values" property. |
values | [] | Values supplied separately, to be used together with "labels" property. |
linked | Key to link this chart to other charts with the same key. | |
uid | Unique ID to link this chart to a LinkedValue component with the same uid. | |
height | 40 | Height of the chart in pixels. |
width | 150 | Width of the chart in pixels. |
barMinWidth | 4 | Width of the bars in the chart in pixels. |
grow | false | Whether or not the bar should grow to fill out the full width of the chart. |
align | right | The side the bars should align to when they do not completely fill out the chart. |
gap | 1 | Gap between the bars in pixels. |
fill | #ff3e00 | Color of the bars, can be any valid CSS color. |
fadeOpacity | 0.5 | The opacity the faded out bars should display in. |
hover | true | Boolean whether or not this chart can be hovered at all. |
transition | 0 | Transition the chart between different stats. Value is time in milliseconds. |
showValue | false | Boolean whether or not a value will be shown. |
valueDefault | " " | Default value when not hovering. |
valuePrepend | String to prepend the value. | |
valueAppend | String to append to the value. | |
valuePosition | static | Can be set to "floating" to follow the position of the hover. |
scaleMax | 0 | Use this to overwrite the automatic scale set to the highest value in your array. |
<LinkedLabel />
component.
Property | Default | Description |
---|---|---|
linked | Key to link this label to charts with the same key. | |
empty | | String that will be displayed when no bar is being hovered. |
<LinkedValue />
component.
Property | Default | Description |
---|---|---|
uid | Unique ID to link this value to a chart with the same uid. | |
empty | | String that will be displayed when no bar is being hovered. |
FAQs
A library to display tiny bar charts using Svelte. These charts are more so meant for graphic aids, rather than scientific representations. There's no axis labels, no extensive data visualisation, just bars.
The npm package svelte-tiny-linked-charts receives a total of 1,485 weekly downloads. As such, svelte-tiny-linked-charts popularity was classified as popular.
We found that svelte-tiny-linked-charts demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.