Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
The vis-data npm package is a data management library that provides a way to manage and manipulate data sets. It is part of the vis.js suite of visualization tools and is particularly useful for handling data in a structured and efficient manner, making it easier to integrate with visualization components.
DataSet
The DataSet class allows you to create a collection of items. You can add, update, and remove items, and retrieve them in various ways. This is useful for managing data that will be visualized or manipulated.
const { DataSet } = require('vis-data');
const data = new DataSet();
data.add({ id: 1, text: 'item 1' });
data.add({ id: 2, text: 'item 2' });
console.log(data.get());
DataView
The DataView class allows you to create a filtered or transformed view of a DataSet. This is useful for creating different perspectives on the same data without duplicating it.
const { DataSet, DataView } = require('vis-data');
const data = new DataSet([
{ id: 1, text: 'item 1', group: 'A' },
{ id: 2, text: 'item 2', group: 'B' }
]);
const view = new DataView(data, { filter: item => item.group === 'A' });
console.log(view.get());
Event Handling
The DataSet class supports event handling, allowing you to listen for changes to the data. This is useful for reacting to data changes in real-time, such as updating a visualization when the underlying data changes.
const { DataSet } = require('vis-data');
const data = new DataSet();
data.on('*', (event, properties, senderId) => {
console.log('Event:', event, 'Properties:', properties, 'SenderId:', senderId);
});
data.add({ id: 1, text: 'item 1' });
Lodash is a modern JavaScript utility library delivering modularity, performance, and extras. It provides a wide range of functions for manipulating arrays, objects, and other data structures. While it is not specifically designed for managing data sets like vis-data, it offers many similar functionalities for data manipulation.
Immutable.js provides immutable data structures, which can help you write more predictable and performant code. It offers a different approach to data management compared to vis-data by ensuring that data cannot be modified once created, which can be beneficial in certain scenarios.
RxDB is a real-time NoSQL database for JavaScript applications. It provides a way to manage and synchronize data across different clients and servers. While it offers more advanced features like real-time synchronization and offline support, it can be seen as a more complex alternative to vis-data for managing data collections.
This module is part of the visjs project
Copyright (C) 2010-2019 Almende B.V. and Contributors
Vis.js is dual licensed under both
and
Vis.js may be distributed under either license.
FAQs
Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
The npm package vis-data receives a total of 101,147 weekly downloads. As such, vis-data popularity was classified as popular.
We found that vis-data demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.