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

vis-util

Package Overview
Dependencies
Maintainers
4
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vis-util

utilitie collection for visjs

  • 5.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created

What is vis-util?

The vis-util npm package provides utility functions that are commonly used in the vis.js library, which is a dynamic, browser-based visualization library. These utilities include functions for data manipulation, DOM manipulation, and other helper functions that facilitate the creation and management of visualizations.

What are vis-util's main functionalities?

Data Manipulation

This feature allows you to manipulate data arrays easily. In this example, the `map` function is used to double the values in the data array.

const util = require('vis-util');

const data = [
  { id: 1, value: 10 },
  { id: 2, value: 20 },
  { id: 3, value: 30 }
];

const mappedData = util.map(data, item => item.value * 2);
console.log(mappedData); // [20, 40, 60]

DOM Manipulation

This feature provides utility functions for DOM manipulation. In this example, the `addClassName` function is used to add a class to a DOM element.

const util = require('vis-util');

const div = document.createElement('div');
div.id = 'myDiv';
document.body.appendChild(div);

util.addClassName(div, 'myClass');
console.log(div.className); // 'myClass'

Deep Object Cloning

This feature allows for deep cloning of objects. In this example, the `deepExtend` function is used to create a deep copy of an object.

const util = require('vis-util');

const obj = { a: 1, b: { c: 2 } };
const clonedObj = util.deepExtend({}, obj);
console.log(clonedObj); // { a: 1, b: { c: 2 } }

Other packages similar to vis-util

Keywords

FAQs

Package last updated on 20 Nov 2023

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