Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
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-2018 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 120,710 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.