Gathering detailed insights and metrics for uplot-vue
Gathering detailed insights and metrics for uplot-vue
Gathering detailed insights and metrics for uplot-vue
Gathering detailed insights and metrics for uplot-vue
npm install uplot-vue
Typescript
Module System
Min. Node Version
Node Version
NPM Version
72.5
Supply Chain
99.3
Quality
76.5
Maintenance
100
Vulnerability
100
License
TypeScript (44.25%)
JavaScript (37.18%)
Svelte (15.87%)
HTML (2.7%)
Total Downloads
40,090
Last Day
23
Last Week
242
Last Month
2,532
Last Year
20,366
95 Stars
62 Commits
13 Forks
4 Watching
1 Branches
8 Contributors
Latest Version
1.2.2
Package Id
uplot-vue@1.2.2
Unpacked Size
41.98 kB
Size
11.31 kB
File Count
8
NPM Version
9.2.0
Node Version
18.20.1
Publised On
07 Jul 2024
Cumulative downloads
Total Downloads
Last day
-75.3%
23
Compared to previous day
Last week
-54.9%
242
Compared to previous week
Last month
23.8%
2,532
Compared to previous month
Last year
61.4%
20,366
Compared to previous year
1
4
Vue.js wrapper for uPlot that allows you to work with charts declaratively inside your favorite framework.
Table of Contents
While several other uPlot wrappers already exist, all of them have one of the following limitations:
In comparison this library tries it's best not to recreate the uPlot instance once the props change. Instead of recreation it tries to use uPlot public API to keep it up to date with the props.
Install uplot-vue package with uplot dependency:
$ npm install uplot-vue uplot
$ yarn add uplot-vue uplot
You also need Vue.js to be installed inside your project tree (both 2.6 and 3.x versions are supported).
Using template
1<template> 2 <UplotVue 3 :data="data" 4 :options="options" 5 :target="target" 6 @create="onCreate" 7 @delete="onDelete" 8 /> 9 </template> 10 <script> 11 // Vue.js 2 12 import Vue from 'vue'; 13 // Vue.js 3 14 import {createApp} from 'vue'; 15 import uPlot from 'uplot'; 16 import UplotVue from 'uplot-vue'; 17 import 'uplot/dist/uPlot.min.css'; 18 19 // Vue.js 2 20 const Chart = Vue.extend({components: {uplotvue: UplotVue}}); 21 // Vue.js 3 22 const Chart = createApp({components: {uplotvue: UplotVue}}); 23 </script>
Using JSX
1// Vue.js 2 2import Vue from 'vue'; 3// Vue.js 3 4import {createApp} from 'vue'; 5import uPlot from 'uplot'; 6import UplotVue from 'uplot-vue'; 7import 'uplot/dist/uPlot.min.css'; 8 9{ 10 ..., 11 render() { 12 return ( 13 <UplotVue 14 options={options} 15 data={data} 16 target={target} 17 onDelete={(chart) => {}} 18 onCreate={(chart) => {}} 19 /> 20 ); 21 } 22}
Note: Property changes by mutation are not supported due to Vue limitation You have to create a copy of the property, i.e. replace it instead, see an example for the general idea.
See the Vue.js 2 live demo
You can also run the demo app locally:
$ git clone https://github.com/skalinichev/uplot-wrappers.git
$ cd uplot-wrappers && yarn install
Vue.js 2:
$ yarn run serveVue
Vue.js 3:
$ yarn run serveVue3
Parameter | Requirement | Description |
---|---|---|
options | required | Options for uPlot. Passed as the first argument to uPlot constructor: new uPlot(options) |
data | required | Data for uPlot. Passed as the second argument to uPlot constructor: new uPlot(options, data) |
target | optional | Target html element or init function for uPlot. Passed as the third argument to uPlot constructor: new uPlot(options, data, target) A new div target element will be created automatically if none is passed in the props |
onCreate | optional | Callback function, invoked upon uPlot instance creation or recreation |
onDelete | optional | Callback function, invoked before uPlot instance gets destroyed, either because the props has changed so much it's impossible to update the chart or because the component is about to be unmounted |
class | optional | A class name passed over to the automatically created target div element. Class name is ignored when the 'target' prop is used. |
resetScales | optional | Flag controlling whether to reset the scales on data change. Defaults to true. |
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/24 approved changesets -- score normalized to 1
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
42 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More