Socket
Socket
Sign inDemoInstall

d3-latency-heatmap

Package Overview
Dependencies
9
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.2 to 1.2.3

2

build/d3-latencyHeatmap.v1.js

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

// https://github.com/sengelha/d3-latency-heatmap Version 1.2.2. Copyright 2018 Steven Engelhardt <sengelha@gmail.com>.
// https://github.com/sengelha/d3-latency-heatmap Version 1.2.3. Copyright 2018 Steven Engelhardt <sengelha@gmail.com>.
(function (global, factory) {

@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array'), require('d3-axis'), require('d3-collection'), require('d3-color'), require('d3-interpolate'), require('d3-scale')) :

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

// https://github.com/sengelha/d3-latency-heatmap Version 1.2.2. Copyright 2018 Steven Engelhardt <sengelha@gmail.com>.
// https://github.com/sengelha/d3-latency-heatmap Version 1.2.3. Copyright 2018 Steven Engelhardt <sengelha@gmail.com>.
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("d3-array"),require("d3-axis"),require("d3-collection"),require("d3-color"),require("d3-interpolate"),require("d3-scale")):"function"==typeof define&&define.amd?define(["exports","d3-array","d3-axis","d3-collection","d3-color","d3-interpolate","d3-scale"],e):e(t.d3=t.d3||{},t.d3,t.d3,t.d3,t.d3,t.d3,t.d3)}(this,function(t,e,n,r,l,i,a){"use strict";t.latencyHeatmap=function(){var t={top:1,right:1,bottom:11,left:1},o=600,c=400,s=void 0,u=function(t){return t[0]},f=void 0,d=function(t){return t[1]},p=void 0,g=function(t){return t[2]},h=void 0,x=[l.rgb("#FFFFFF"),l.rgb("#F03524")],y="#ddd",m="#999",v="#000",k=11;function A(l){l.each(function(A){A=A.map(function(t,e){return[u.call(A,t,e),d.call(A,t,e),g.call(A,t,e)]});var F=r.nest().key(function(t){return t[0]}).entries(A).length,b=r.nest().key(function(t){return t[1]}).entries(A).length;s?(o=s[0]*F+t.left+t.right,c=s[1]*b+t.top+t.bottom):s=[(o-t.left-t.right)/F,(c-t.top-t.bottom)/b];var z=o-t.left-t.right,q=c-t.top-t.bottom,S=e.extent(A,function(t){return t[0]}),L=e.extent(A,function(t){return t[1]}),w=e.extent(A,function(t){return t[2]}),O=a.scaleTime().domain(S).range([0,z-s[0]]),j=a.scaleLinear().domain(L).range([q,0]),E=a.scaleLinear().domain(L).range([q-s[1],0]),I=a.scaleLinear().domain(w).interpolate(i.interpolateRgb).range(x),R=l.selectAll("svg").data([A]),T=R.enter().append("svg").append("g");T.append("g").attr("class","elems"),T.append("g").attr("class","x axis"),T.append("g").attr("class","y axis"),(R=l.selectAll("svg")).attr("width",o).attr("height",c);var _=R.select(".elems").attr("class","elems").attr("transform","translate("+t.left+","+t.top+")").selectAll("rect").data(A),B=_.enter();_.exit().remove(),_.attr("x",function(t){return O(t[0])}).attr("y",function(t){return E(t[1])}).attr("fill",function(t){return I(t[2])}),h&&_.selectAll("title").html(function(t){return h(t)});var H=B.append("rect").attr("x",function(t){return O(t[0])}).attr("y",function(t){return E(t[1])}).attr("width",s[0]).attr("height",s[1]).attr("fill",function(t){return I(t[2])});h&&H.append("title").html(function(t){return h(t)});var M=n.axisBottom(O).tickSizeInner(-q).tickSizeOuter(0);f&&M.tickFormat(f);var P=T.select(".x.axis").attr("transform","translate(0,"+q+")").style("font-size",k+"px").call(M);P.selectAll("path").remove(),P.selectAll("line").style("shape-rendering","crispEdges").style("stroke",y),P.selectAll("text").style("text-anchor","start").style("fill",m);var C=n.axisLeft(j).tickSizeInner(-z).tickSizeOuter(0).ticks(1);p&&C.tickFormat(p);var D=T.select(".y.axis").style("font-size",k+"px").call(C);D.selectAll("path").remove(),D.selectAll("line").style("shape-rendering","crispEdges").style("stroke",y),D.selectAll(".tick text").attr("x",2).style("text-anchor","start").style("fill",v),D.selectAll(".tick:last-of-type text").attr("y",8),D.selectAll(".tick:first-of-type text").attr("y",-8)})}return A.width=function(t){return arguments.length?(o=t,A):o},A.height=function(t){return arguments.length?(c=t,A):c},A.rectSize=function(t){return arguments.length?(s=t,A):s},A.x=function(t){return arguments.length?(u=t,A):u},A.y=function(t){return arguments.length?(d=t,A):d},A.count=function(t){return arguments.length?(g=t,A):g},A.xFormat=function(t){return arguments.length?(f=t,A):f},A.yFormat=function(t){return arguments.length?(p=t,A):p},A.colorRange=function(t){return arguments.length?(x=t,A):x},A.tooltipText=function(t){return arguments.length?(h=t,A):h},A},Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "d3-latency-heatmap",
"version": "1.2.2",
"version": "1.2.3",
"description": "A reusable D3 latency heatmap chart.",

@@ -29,3 +29,3 @@ "keywords": [

"prepare": "npm run test && uglifyjs -b beautify=false,preamble=\"'$(preamble)'\" build/d3-latencyHeatmap.v1.js -c -m -o build/d3-latencyHeatmap.v1.min.js",
"postpublish": "git push && git push --tags && zip -j build/d3-latencyHeatmap.zip -- LICENSE README.md build/d3-latencyHeatmap.v1.js build/d3-latencyHeatmap.v1.min.js"
"postpublish": "git push && git push --tags && zip -j build/d3-latencyHeatmap.zip -- LICENSE README.md build/d3-latencyHeatmap.v1.js build/d3-latencyHeatmap.v1.min.js && echo \"Don't forget to publish to sengelha.github.io\""
},

@@ -32,0 +32,0 @@ "dependencies": {

@@ -8,3 +8,3 @@ # D3 Latency Heatmap

![Example Latency Heatmap](samples/example1.png)
![Example Latency Heatmap](samples/report-queue-latency.png)

@@ -27,3 +27,3 @@ For more on latency heatmaps, see:

<script src="//d3js.org/d3.v4.min.js"></script>
<script src="//unpkg.com/d3-latency-heatmap@1"></script>
<script src="//sengelha.github.io/d3-latency-heatmap/d3-latencyHeatmap.v1.min.js"></script>

@@ -62,6 +62,11 @@ <div id="chart"></div>

intense over time.
* See the [samples](samples/) directory for some usage examples.
* This chart's API was modelled upon Mike Bostock's
[Toward Reusable Charts](https://bost.ocks.org/mike/chart/) proposal.
## Examples
* [Report Queue Latency](samples/report-queue-latency.html)
* [Animated Heatmap](samples/animated-heatmap.html)
* [Using with Unpkg](samples/unpkg-modules.html)
## API Reference

@@ -72,3 +77,3 @@

Creates a new latency heatmap chart which may later be rendered into a
container. Returns a *chart* object.
container. Returns a *latencyHeatmap* object.

@@ -88,3 +93,3 @@ The typical pattern that the chart is rendered is by:

### *chart*.colorRange(*[minColor, maxColor]*)
### *latencyHeatmap*.colorRange(*[minColor, maxColor]*)

@@ -101,3 +106,3 @@ Defines the color range to be used when filling cells. This color

### *chart*.count(*accessor*)
### *latencyHeatmap*.count(*accessor*)

@@ -114,3 +119,3 @@ Defines an count accessor which is called for each row in `data`.

### *chart*.height(*h*)
### *latencyHeatmap*.height(*h*)

@@ -130,3 +135,3 @@ Sets the height of the rendered chart to *h*. Automatically scales

### *chart*.rectSize(*[w, h]*)
### *latencyHeatmap*.rectSize(*[w, h]*)

@@ -144,3 +149,3 @@ Sets the size of the individual rectangles used to draw the chart to

### *chart*.tooltipText(*formatter*)
### *latencyHeatmap*.tooltipText(*formatter*)

@@ -159,3 +164,3 @@ Defines an accessor which can be used to control how tooltips for

### *chart*.width(*w*)
### *latencyHeatmap*.width(*w*)

@@ -175,3 +180,3 @@ Sets the width of the rendered chart to *w*. Automatically scales

### *chart*.x(*accessor*)
### *latencyHeatmap*.x(*accessor*)

@@ -188,3 +193,3 @@ Defines an x accessor which is called for each row in `data`. Must return

### *chart*.xFormat(*formatter*)
### *latencyHeatmap*.xFormat(*formatter*)

@@ -202,3 +207,3 @@ Defines an accessor which can be used to control how tick labels on the

### *chart*.y(*accessor*)
### *latencyHeatmap*.y(*accessor*)

@@ -215,3 +220,3 @@ Defines an y accessor which is called for each row in `data`. Must return

### *chart*.yFormat(*accessor*)
### *latencyHeatmap*.yFormat(*accessor*)

@@ -218,0 +223,0 @@ Defines an accessor which can be used to control how tick labels on the

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc