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 2.1.3 to 2.1.4

examples/flamegraph.html

2

package.json
{
"name": "d3-flame-graph",
"version": "2.1.3",
"version": "2.1.4",
"description": "A d3.js library to produce flame graphs.",

@@ -5,0 +5,0 @@ "main": "dist/d3-flamegraph.js",

@@ -30,2 +30,4 @@ import { select } from 'd3-selection'

var maxDelta = 0
var resetHeightOnZoom = false
var scrollOnZoom = false

@@ -260,3 +262,13 @@ var getName = function (d) {

fadeAncestors(d)
update({ resetHeight: true })
update()
if (scrollOnZoom) {
let chartOffset = svg._groups[0][0].parentNode.offsetTop
let maxFrames = (window.innerHeight - chartOffset) / c
let frameOffset = (d.height - maxFrames + 10) * c
window.scrollTo({
top: chartOffset + frameOffset,
left: 0,
behavior: 'smooth'
})
}
if (typeof clickHandler === 'function') {

@@ -343,4 +355,3 @@ clickHandler(d)

function update (options) {
options = options || {}
function update () {
selection.each(function (root) {

@@ -365,3 +376,3 @@ var x = scaleLinear().range([0, w])

// if height is not set: set height on first update, after nodes were filtered by minFrameSize
if (!h || options.resetHeight) {
if (!h || resetHeightOnZoom) {
var maxDepth = Math.max.apply(null, descendants.map(function (n) { return n.depth }))

@@ -375,3 +386,3 @@ h = (maxDepth + 2) * c

.ease(transitionEase)
.attr('transform', function (d) { return 'translate(' + x(d.x0) + ',' + (inverted ? y(d.depth) : (h - y(d.depth) - c)) + ')' })
.attr('transform', function (d) { return 'translate(' + x(d.x0) + ',' + (inverted ? y(d.depth) : (h - y(d.depth))) + ')' })

@@ -386,3 +397,3 @@ g.select('rect')

.append('svg:g')
.attr('transform', function (d) { return 'translate(' + x(d.x0) + ',' + (inverted ? y(d.depth) : (h - y(d.depth) - c)) + ')' })
.attr('transform', function (d) { return 'translate(' + x(d.x0) + ',' + (inverted ? y(d.depth) : (h - y(d.depth))) + ')' })

@@ -804,2 +815,14 @@ node.append('svg:rect')

chart.resetHeightOnZoom = function (_) {
if (!arguments.length) { return resetHeightOnZoom }
resetHeightOnZoom = _
return chart
}
chart.scrollOnZoom = function (_) {
if (!arguments.length) { return scrollOnZoom }
scrollOnZoom = _
return chart
}
chart.getName = function (_) {

@@ -806,0 +829,0 @@ if (!arguments.length) { return getName }

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

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

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