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.0 to 2.1.1

2

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

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

@@ -290,2 +290,17 @@ # d3-flame-graph

<a name="setSearchMatch" href="#setSearchMatch">#</a> flamegraph.<b>setSearchMatch</b>(<i>[function]</i>)
Replaces the built-in node search match function. Function takes two arguments,
the node data structure and the search term. It must return a boolean. Example:
```js
flamegraph.setSearchMatch(function(d, term) {
// Non-regex implementation of the search function
return d.data.name.indexOf(term) != 0;
})
```
If called with no arguments, `setSearchMatch` will return reset the search
match function.
**All API functions will return the flame graph object if no other behavior is specified in the function details.**

@@ -292,0 +307,0 @@

@@ -64,2 +64,9 @@ import { select } from 'd3-selection'

let searchMatch = (d, term) => {
const re = new RegExp(term)
const label = getName(d)
return typeof label !== 'undefined' && label && label.match(re)
}
const originalSearchMatch = searchMatch
var detailsHandler = function (d) {

@@ -260,3 +267,2 @@ if (detailsElement) {

function searchTree (d, term) {
var re = new RegExp(term)
var results = []

@@ -266,6 +272,5 @@ var sum = 0

function searchInner (d, foundParent) {
var label = getName(d)
var found = false
if (typeof label !== 'undefined' && label && label.match(re)) {
if (searchMatch(d, term)) {
d.highlight = true

@@ -819,3 +824,12 @@ found = true

chart.setSearchMatch = function (_) {
if (!arguments.length) {
searchMatch = originalSearchMatch
return chart
}
searchMatch = _
return chart
}
return chart
}

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