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

@oncojs/react-lolliplot

Package Overview
Dependencies
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oncojs/react-lolliplot - npm Package Compare versions

Comparing version 0.11.6 to 0.11.7

31

dist/es6/LolliplotNode.js
import invariant from 'invariant';
import ReactFauxDOM from 'react-faux-dom';
import range from 'lodash.range';
import uniq from 'lodash.uniq';
import attrs from './utils/attrs';

@@ -46,2 +47,21 @@ import { dim } from './utils/spatial';

min = Math.floor(min);
max = Math.round(max);
var length = (max - min) / numXTicks;
var uniqueXTicks = uniq(range(numXTicks - 1).map(function (x) {
return x + 1;
}).map(function (i) {
return Math.round(length * i + min);
}));
var numUniqueXTicks = uniqueXTicks.length;
var xTickInt = numUniqueXTicks.length === 1 ? 1 : uniqueXTicks[1] - uniqueXTicks[0];
// min & max are invisible ticks on the far left and right
min = uniqueXTicks[0] - xTickInt;
max = uniqueXTicks[numUniqueXTicks - 1];
d3.selection.prototype.attrs = attrs;

@@ -269,9 +289,8 @@ d3.scaleOrdinal = d3.scaleOrdinal || d3.scale.ordinal;

var length = (max - min) / numXTicks;
var olength = domainWidth / numXTicks;
var olength = domainWidth / numUniqueXTicks;
d3Root.select('.xTicks').append('g').selectAll('text').data(range(numXTicks - 1).map(function (x) {
d3Root.select('.xTicks').append('g').selectAll('text').data(range(numUniqueXTicks - 1).map(function (x) {
return x + 1;
})).enter().append('text').text(function (i) {
return Math.round(length * i + min);
return uniqueXTicks[i - 1];
}).attrs({

@@ -290,4 +309,4 @@ class: function _class(i) {

for (var i = 1; i < numXTicks; i++) {
var _length = domainWidth / numXTicks;
for (var i = 1; i < numUniqueXTicks; i++) {
var _length = domainWidth / numUniqueXTicks;

@@ -294,0 +313,0 @@ d3Root.select('.xTicks').append('line').attrs({

@@ -17,2 +17,6 @@ 'use strict';

var _lodash3 = require('lodash.uniq');
var _lodash4 = _interopRequireDefault(_lodash3);
var _attrs = require('./utils/attrs');

@@ -71,2 +75,21 @@

min = Math.floor(min);
max = Math.round(max);
var length = (max - min) / numXTicks;
var uniqueXTicks = (0, _lodash4.default)((0, _lodash2.default)(numXTicks - 1).map(function (x) {
return x + 1;
}).map(function (i) {
return Math.round(length * i + min);
}));
var numUniqueXTicks = uniqueXTicks.length;
var xTickInt = numUniqueXTicks.length === 1 ? 1 : uniqueXTicks[1] - uniqueXTicks[0];
// min & max are invisible ticks on the far left and right
min = uniqueXTicks[0] - xTickInt;
max = uniqueXTicks[numUniqueXTicks - 1];
d3.selection.prototype.attrs = _attrs2.default;

@@ -294,9 +317,8 @@ d3.scaleOrdinal = d3.scaleOrdinal || d3.scale.ordinal;

var length = (max - min) / numXTicks;
var olength = domainWidth / numXTicks;
var olength = domainWidth / numUniqueXTicks;
d3Root.select('.xTicks').append('g').selectAll('text').data((0, _lodash2.default)(numXTicks - 1).map(function (x) {
d3Root.select('.xTicks').append('g').selectAll('text').data((0, _lodash2.default)(numUniqueXTicks - 1).map(function (x) {
return x + 1;
})).enter().append('text').text(function (i) {
return Math.round(length * i + min);
return uniqueXTicks[i - 1];
}).attrs({

@@ -315,4 +337,4 @@ class: function _class(i) {

for (var i = 1; i < numXTicks; i++) {
var _length = domainWidth / numXTicks;
for (var i = 1; i < numUniqueXTicks; i++) {
var _length = domainWidth / numUniqueXTicks;

@@ -319,0 +341,0 @@ d3Root.select('.xTicks').append('line').attrs({

@@ -6,2 +6,3 @@ // @flow

import range from 'lodash.range'
import uniq from 'lodash.uniq'
import attrs from './utils/attrs'

@@ -37,2 +38,23 @@ import { dim } from './utils/spatial'

min = Math.floor(min)
max = Math.round(max)
let length = (max - min) / numXTicks
const uniqueXTicks = uniq(
range(numXTicks - 1)
.map(x => x + 1)
.map(i => Math.round(length * i + min))
)
const numUniqueXTicks = uniqueXTicks.length
const xTickInt = numUniqueXTicks.length === 1
? 1
: uniqueXTicks[1] - uniqueXTicks[0]
// min & max are invisible ticks on the far left and right
min = uniqueXTicks[0] - xTickInt
max = uniqueXTicks[numUniqueXTicks - 1]
d3.selection.prototype.attrs = attrs

@@ -273,4 +295,3 @@ d3.scaleOrdinal = d3.scaleOrdinal || d3.scale.ordinal

let length = (max - min) / numXTicks
let olength = domainWidth / numXTicks
let olength = domainWidth / numUniqueXTicks

@@ -281,6 +302,6 @@ d3Root

.selectAll(`text`)
.data(range(numXTicks - 1).map(x => x + 1))
.data(range(numUniqueXTicks - 1).map(x => x + 1))
.enter()
.append(`text`)
.text(i => Math.round(length * i + min))
.text(i => uniqueXTicks[i - 1])
.attrs({

@@ -295,4 +316,4 @@ class: i => `xTick-text-${i}`,

for (let i = 1; i < numXTicks; i++) {
let length = domainWidth / numXTicks
for (let i = 1; i < numUniqueXTicks; i++) {
let length = domainWidth / numUniqueXTicks

@@ -299,0 +320,0 @@ d3Root

41

package.json
{
"homepage": "https://github.com/oncojs/lolliplot#readme",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/oncojs/lolliplot/issues"
},
"keywords": [
"d3",
"react",
"reactjs",
"boilerplate",
"hot",
"reload",
"hmr",
"live",
"edit",
"webpack"
],
"repository": {
"type": "git",
"url": "git+https://github.com/oncojs/lolliplot.git"
},
"author": {
"name": "OncoJS",
"url": "https://github.com/oncojs/"
},
"private": false,
"name": "@oncojs/react-lolliplot",
"version": "0.11.6",
"version": "0.11.7",
"description": "A protein viewer built with d3 (React Component)",
"browser": "dist/umd/index.min.js",
"main": "dist/lib/index.js",
"dependencies": {
"d3-selection": "^1.0.3",
"invariant": "^2.2.2",
"lodash.range": "^3.2.0",
"react-faux-dom": "^3.0.1"
},
"peerDependencies": {
"react": "15"
},
"jsnext:main": "dist/es6/index.js"
"browser": true
}
let uuid = a => a
? (a ^ Math.random() * 16 >> a / 4).toString(16)
: ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, uuid)
export default uuid

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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