New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lightning-client-utils

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightning-client-utils - npm Package Compare versions

Comparing version 0.3.1 to 0.3.3

pressed-keys.js

33

index.js
var _ = require('lodash');
var request = require('superagent');
var d3 = require('d3');
var r;

@@ -41,2 +42,34 @@

getColorFromData: function(data) {
// retrieve an array of colors from 'label' or 'color' fields of object data
// returns an list of lists in the form [[r,g,b],[r,g,b]...]
if(data.hasOwnProperty('label')) {
// get bounds and number of labels
label = data.label
var mn = d3.min(label, function(d) {return d; });
var mx = d3.max(label, function(d) {return d; });
var n = mx - mn + 1
var colors = this.getColors(n)
// get an array of d3 colors
retColor = label.map(function(d) {return d3.rgb(colors[d - mn])});
} else if (data.hasOwnProperty('color')) {
// get an array of d3 colors directly from r,g,b values
color = data.color
retColor = color.map(function(d) {return d3.rgb(d[0], d[1], d[2])})
} else {
// otherwise return empty
retColor = []
}
return retColor
},
trackTransforms: function(ctx){

@@ -43,0 +76,0 @@

5

package.json
{
"name": "lightning-client-utils",
"version": "0.3.1",
"version": "0.3.3",
"description": "utilities for lightning visualizations to be used in the browser",

@@ -19,4 +19,5 @@ "main": "index.js",

"lodash": "^2.4.1",
"superagent": "^0.21.0"
"superagent": "^0.21.0",
"d3": "~3.4.9"
}
}
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