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

d3-flame-graph

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-flame-graph - npm Package Compare versions

Comparing version 4.0.4 to 4.0.5

24

dist/d3-flamegraph-colorMapper.js

@@ -141,4 +141,4 @@ (function webpackUniversalModuleDefinition(root, factory) {

function allocationColorMapper (d) {
if (d.highlight) return 'rgb(230, 0, 230)'
function allocationColorMapper (d, originalColor) {
if (d.highlight) return originalColor

@@ -152,4 +152,4 @@ const self = d.data.value

function offCpuColorMapper (d) {
if (d.highlight) return '#E600E6'
function offCpuColorMapper (d, originalColor) {
if (d.highlight) return originalColor

@@ -206,4 +206,4 @@ let name = d.data.n || d.data.name

function differentialColorMapper (d) {
if (d.highlight) return '#E600E6'
function differentialColorMapper (d, originalColor) {
if (d.highlight) return originalColor

@@ -222,15 +222,13 @@ let r = 220

// likely a new frame, color orange
r = 190 + Math.round(65 * vector)
g = 90 + Math.round(65 * vector)
r = Math.round(235 * (1 - vector))
g = Math.round(135 * (1 - vector))
b = 0
} else if (delta > 0) {
// an increase, color red
r = 200 + Math.round(55 * vector)
g = 50 + Math.round(80 * vector)
b = g
b = Math.round(235 * (1 - vector))
g = b
} else if (delta < 0) {
// a decrease, color blue
r = 50 + Math.round(80 * vector)
r = Math.round(235 * (1 - vector))
g = r
b = 200 + Math.round(55 * vector)
}

@@ -237,0 +235,0 @@

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["colorMapper.min"]=e():(t.flamegraph=t.flamegraph||{},t.flamegraph["colorMapper.min"]=e())}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}({6:function(t,e,r){"use strict";function n(t){if(t.highlight)return"rgb(230, 0, 230)";return`rgb(${function(t,e,r){const n=r,o=1-n;return[Math.round(t[0]*n+e[0]*o),Math.round(t[1]*n+e[1]*o),Math.round(t[2]*n+e[2]*o)]}([0,255,40],[196,245,233],t.data.value/t.value).join()})`}function o(t){if(t.highlight)return"#E600E6";let e=t.data.n||t.data.name,r=0;const n=e.split("`");return n.length>1&&(e=n[n.length-1]),e=e.split("(")[0],r=function(t){var e=0,r=0,n=1;if(t){for(var o=0;o<t.length&&!(o>6);o++)e+=n*(t.charCodeAt(o)%10),r+=9*n,n*=.7;r>0&&(e/=r)}return e}(e),"rgb("+(0+Math.round(55*(1-r)))+","+(0+Math.round(230*(1-r)))+","+(200+Math.round(55*r))+")"}function u(t,e){let r=e;const{v8_jit:n,javascript:o,optimized:u}=t.data.extras||{};if(n&&!o&&(r="#dadada"),o){let e=(u||0)/t.value,n=255,o=0,a=0;e<.4?(e*=2.5,n=240-200*e):e<.9?(e=2*(e-.4),n=0,a=200-200*e,o=100*e):(e=10*(e-.9),n=0,a=0,o=100+150*e),r=`rgb(${n} , ${o}, ${a})`}return r}function a(t){if(t.highlight)return"#E600E6";let e=220,r=220,n=220;const o=t.delta||t.data.d||t.data.delta,u=Math.abs(o);let a=t.value||t.data.v||t.data.value;a<=u&&(a=u);const i=u/a;return o===a?(e=190+Math.round(65*i),r=90+Math.round(65*i),n=0):o>0?(e=200+Math.round(55*i),r=50+Math.round(80*i),n=r):o<0&&(e=50+Math.round(80*i),r=e,n=200+Math.round(55*i)),"rgb("+e+","+r+","+n+")"}r.r(e),r.d(e,"allocationColorMapper",(function(){return n})),r.d(e,"offCpuColorMapper",(function(){return o})),r.d(e,"nodeJsColorMapper",(function(){return u})),r.d(e,"differentialColorMapper",(function(){return a}))}})}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["colorMapper.min"]=e():(t.flamegraph=t.flamegraph||{},t.flamegraph["colorMapper.min"]=e())}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}({6:function(t,e,r){"use strict";function n(t,e){if(t.highlight)return e;return`rgb(${function(t,e,r){const n=r,o=1-n;return[Math.round(t[0]*n+e[0]*o),Math.round(t[1]*n+e[1]*o),Math.round(t[2]*n+e[2]*o)]}([0,255,40],[196,245,233],t.data.value/t.value).join()})`}function o(t,e){if(t.highlight)return e;let r=t.data.n||t.data.name,n=0;const o=r.split("`");return o.length>1&&(r=o[o.length-1]),r=r.split("(")[0],n=function(t){var e=0,r=0,n=1;if(t){for(var o=0;o<t.length&&!(o>6);o++)e+=n*(t.charCodeAt(o)%10),r+=9*n,n*=.7;r>0&&(e/=r)}return e}(r),"rgb("+(0+Math.round(55*(1-n)))+","+(0+Math.round(230*(1-n)))+","+(200+Math.round(55*n))+")"}function u(t,e){let r=e;const{v8_jit:n,javascript:o,optimized:u}=t.data.extras||{};if(n&&!o&&(r="#dadada"),o){let e=(u||0)/t.value,n=255,o=0,a=0;e<.4?(e*=2.5,n=240-200*e):e<.9?(e=2*(e-.4),n=0,a=200-200*e,o=100*e):(e=10*(e-.9),n=0,a=0,o=100+150*e),r=`rgb(${n} , ${o}, ${a})`}return r}function a(t,e){if(t.highlight)return e;let r=220,n=220,o=220;const u=t.delta||t.data.d||t.data.delta,a=Math.abs(u);let i=t.value||t.data.v||t.data.value;i<=a&&(i=a);const f=a/i;return u===i?(r=Math.round(235*(1-f)),n=Math.round(135*(1-f)),o=0):u>0?(o=Math.round(235*(1-f)),n=o):u<0&&(r=Math.round(235*(1-f)),n=r),"rgb("+r+","+n+","+o+")"}r.r(e),r.d(e,"allocationColorMapper",(function(){return n})),r.d(e,"offCpuColorMapper",(function(){return o})),r.d(e,"nodeJsColorMapper",(function(){return u})),r.d(e,"differentialColorMapper",(function(){return a}))}})}));
{
"name": "d3-flame-graph",
"version": "4.0.4",
"version": "4.0.5",
"description": "A d3.js library to produce flame graphs.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -34,4 +34,4 @@ function pickHex (color1, color2, weight) {

export function allocationColorMapper (d) {
if (d.highlight) return 'rgb(230, 0, 230)'
export function allocationColorMapper (d, originalColor) {
if (d.highlight) return originalColor

@@ -45,4 +45,4 @@ const self = d.data.value

export function offCpuColorMapper (d) {
if (d.highlight) return '#E600E6'
export function offCpuColorMapper (d, originalColor) {
if (d.highlight) return originalColor

@@ -99,4 +99,4 @@ let name = d.data.n || d.data.name

export function differentialColorMapper (d) {
if (d.highlight) return '#E600E6'
export function differentialColorMapper (d, originalColor) {
if (d.highlight) return originalColor

@@ -115,15 +115,13 @@ let r = 220

// likely a new frame, color orange
r = 190 + Math.round(65 * vector)
g = 90 + Math.round(65 * vector)
r = Math.round(235 * (1 - vector))
g = Math.round(135 * (1 - vector))
b = 0
} else if (delta > 0) {
// an increase, color red
r = 200 + Math.round(55 * vector)
g = 50 + Math.round(80 * vector)
b = g
b = Math.round(235 * (1 - vector))
g = b
} else if (delta < 0) {
// a decrease, color blue
r = 50 + Math.round(80 * vector)
r = Math.round(235 * (1 - vector))
g = r
b = 200 + Math.round(55 * vector)
}

@@ -130,0 +128,0 @@

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