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

d3-hexbin

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-hexbin - npm Package Compare versions

Comparing version 0.0.9 to 0.1.0

2

build/bundle.js

@@ -1,1 +0,1 @@

var version = "0.0.9"; export * from "../index"; export {version};
var version = "0.1.0"; export * from "../index"; export {version};
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-arrays')) :
typeof define === 'function' && define.amd ? define('d3-hexbin', ['exports', 'd3-arrays'], factory) :
factory((global.d3_hexbin = {}),global.d3_arrays);
}(this, function (exports,d3Arrays) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array')) :
typeof define === 'function' && define.amd ? define('d3-hexbin', ['exports', 'd3-array'], factory) :
factory((global.d3_hexbin = {}),global.d3_array);
}(this, function (exports,d3Array) { 'use strict';
var hexbinAngles = d3Array.range(0, 2 * Math.PI, Math.PI / 3);
var hexbinX = function(d) { return d[0]; };
var hexbinY = function(d) { return d[1]; };
function hexbin() {
var d3_hexbinAngles = d3Arrays.range(0, 2 * Math.PI, Math.PI / 3),
d3_hexbinX = function(d) { return d[0]; },
d3_hexbinY = function(d) { return d[1]; };
var width = 1,
height = 1,
r,
x = d3_hexbinX,
y = d3_hexbinY,
x = hexbinX,
y = hexbinY,
dx,

@@ -47,3 +46,3 @@ dy;

return d3.values(binsById);
return d3Array.values(binsById);
}

@@ -53,3 +52,3 @@

var x0 = 0, y0 = 0;
return d3_hexbinAngles.map(function(angle) {
return hexbinAngles.map(function(angle) {
var x1 = Math.sin(angle) * radius,

@@ -116,3 +115,3 @@ y1 = -Math.cos(angle) * radius,

var version = "0.0.9";
var version = "0.1.0";

@@ -119,0 +118,0 @@ exports.version = version;

@@ -1,1 +0,1 @@

!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("d3-arrays")):"function"==typeof define&&define.amd?define("d3-hexbin",["exports","d3-arrays"],r):r(n.d3_hexbin={},n.d3_arrays)}(this,function(n,r){"use strict";function t(){function n(r){var t={};return r.forEach(function(r,e){var i=d.call(n,r,e)/a,o=Math.round(i),f=h.call(n,r,e)/u-(1&o?.5:0),s=Math.round(f),c=i-o;if(3*Math.abs(c)>1){var l=f-s,v=s+(s>f?-1:1)/2,g=o+(o>i?-1:1),m=f-v,p=i-g;l*l+c*c>m*m+p*p&&(s=v+(1&o?1:-1)/2,o=g)}var M=s+"-"+o,x=t[M];x?x.push(r):(x=t[M]=[r],x.i=s,x.j=o,x.x=(s+(1&o?.5:0))*u,x.y=o*a)}),d3.values(t)}function t(n){var r=0,t=0;return i.map(function(e){var u=Math.sin(e)*n,a=-Math.cos(e)*n,i=u-r,o=a-t;return r=u,t=a,[i,o]})}var e,u,a,i=r.range(0,2*Math.PI,Math.PI/3),o=function(n){return n[0]},f=function(n){return n[1]},s=1,c=1,h=o,d=f;return n.x=function(r){return arguments.length?(h=r,n):h},n.y=function(r){return arguments.length?(d=r,n):d},n.hexagon=function(n){return arguments.length<1&&(n=e),"m"+t(n).join("l")+"z"},n.centers=function(){for(var n=[],r=0,t=!1,i=0;c+e>r;r+=a,t=!t,++i)for(var o=t?u/2:0,f=0;s+u/2>o;o+=u,++f){var h=[o,r];h.i=f,h.j=i,n.push(h)}return n},n.mesh=function(){var r=t(e).slice(0,4).join("l");return n.centers().map(function(n){return"M"+n+"m"+r}).join("")},n.size=function(r){return arguments.length?(s=+r[0],c=+r[1],n):[s,c]},n.radius=function(r){return arguments.length?(e=+r,u=2*e*Math.sin(Math.PI/3),a=1.5*e,n):e},n.radius(1)}var e="0.0.9";n.version=e,n.hexbin=t});
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("d3-array")):"function"==typeof define&&define.amd?define("d3-hexbin",["exports","d3-array"],r):r(n.d3_hexbin={},n.d3_array)}(this,function(n,r){"use strict";function t(){function n(t){var e={};return t.forEach(function(r,t){var u=d.call(n,r,t)/f,a=Math.round(u),i=h.call(n,r,t)/o-(1&a?.5:0),c=Math.round(i),s=u-a;if(3*Math.abs(s)>1){var l=i-c,v=c+(c>i?-1:1)/2,g=a+(a>u?-1:1),m=i-v,p=u-g;l*l+s*s>m*m+p*p&&(c=v+(1&a?1:-1)/2,a=g)}var M=c+"-"+a,x=e[M];x?x.push(r):(x=e[M]=[r],x.i=c,x.j=a,x.x=(c+(1&a?.5:0))*o,x.y=a*f)}),r.values(e)}function t(n){var r=0,t=0;return e.map(function(e){var u=Math.sin(e)*n,a=-Math.cos(e)*n,i=u-r,o=a-t;return r=u,t=a,[i,o]})}var i,o,f,c=1,s=1,h=u,d=a;return n.x=function(r){return arguments.length?(h=r,n):h},n.y=function(r){return arguments.length?(d=r,n):d},n.hexagon=function(n){return arguments.length<1&&(n=i),"m"+t(n).join("l")+"z"},n.centers=function(){for(var n=[],r=0,t=!1,e=0;s+i>r;r+=f,t=!t,++e)for(var u=t?o/2:0,a=0;c+o/2>u;u+=o,++a){var h=[u,r];h.i=a,h.j=e,n.push(h)}return n},n.mesh=function(){var r=t(i).slice(0,4).join("l");return n.centers().map(function(n){return"M"+n+"m"+r}).join("")},n.size=function(r){return arguments.length?(c=+r[0],s=+r[1],n):[c,s]},n.radius=function(r){return arguments.length?(i=+r,o=2*i*Math.sin(Math.PI/3),f=1.5*i,n):i},n.radius(1)}var e=r.range(0,2*Math.PI,Math.PI/3),u=function(n){return n[0]},a=function(n){return n[1]},i="0.1.0";n.version=i,n.hexbin=t});
{
"name": "d3-hexbin",
"version": "0.0.9",
"version": "0.1.0",
"description": "Visualize hexagonal binning",

@@ -14,12 +14,15 @@ "keywords": [

"jsnext:main": "index",
"homepage": "https://github.com/xaranke/d3-hexbin",
"homepage": "https://github.com/d3/d3-hexbin",
"repository": {
"type": "git",
"url": "https://github.com/xaranke/d3-hexbin.git"
"url": "https://github.com/d3/d3-hexbin.git"
},
"scripts": {
"pretest": "mkdir -p build && node -e 'process.stdout.write(\"var version = \\\"\" + require(\"./package.json\").version + \"\\\"; export * from \\\"../index\\\"; export {version};\");' > build/bundle.js && rollup -f umd -g d3-arrays:d3_arrays -u d3-hexbin -n d3_hexbin -o build/d3-hexbin.js -- build/bundle.js",
"pretest": "mkdir -p build && node -e 'process.stdout.write(\"var version = \\\"\" + require(\"./package.json\").version + \"\\\"; export * from \\\"../index\\\"; export {version};\");' > build/bundle.js && rollup -f umd -g d3-array:d3_array -u d3-hexbin -n d3_hexbin -o build/d3-hexbin.js -- build/bundle.js",
"test": "faucet `find test -name '*-test.js'`",
"prepublish": "npm run test && uglifyjs build/d3-hexbin.js -c -m -o build/d3-hexbin.min.js && rm -f build/d3-hexbin.zip && zip -j build/d3-hexbin.zip -- LICENSE README.md build/d3-hexbin.js build/d3-hexbin.min.js"
},
"dependencies": {
"d3-array": "~0.5.1"
},
"devDependencies": {

@@ -30,6 +33,3 @@ "faucet": "0.0",

"uglify-js": "2"
},
"dependencies": {
"d3-arrays": "^0.4.0"
}
}

@@ -1,13 +0,13 @@

import {range} from 'd3-arrays';
import {range, values} from "d3-array";
var hexbinAngles = range(0, 2 * Math.PI, Math.PI / 3),
hexbinX = function(d) { return d[0]; },
hexbinY = function(d) { return d[1]; };
export default function() {
var d3_hexbinAngles = range(0, 2 * Math.PI, Math.PI / 3),
d3_hexbinX = function(d) { return d[0]; },
d3_hexbinY = function(d) { return d[1]; };
var width = 1,
height = 1,
r,
x = d3_hexbinX,
y = d3_hexbinY,
x = hexbinX,
y = hexbinY,
dx,

@@ -43,3 +43,3 @@ dy;

return d3.values(binsById);
return values(binsById);
}

@@ -49,3 +49,3 @@

var x0 = 0, y0 = 0;
return d3_hexbinAngles.map(function(angle) {
return hexbinAngles.map(function(angle) {
var x1 = Math.sin(angle) * radius,

@@ -52,0 +52,0 @@ y1 = -Math.cos(angle) * radius,

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