Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overridable filter function, isNodeExcluded #28

Merged
merged 1 commit into from
Nov 22, 2018

Conversation

AlanSl
Copy link
Contributor

@AlanSl AlanSl commented Nov 20, 2018

Allows the default filter logic to be overridden. Currently, d3-fg excludes based on whether the node data has a property, type, that is in the filterTypes array (generated from the exclude iterable).

This allows that check to be overridden so that third parties can implement their own filter logic, checking against other (or multiple) properties.

As with other such overridable functions, the default function is used if no option is passed in, and the feature is disabled if null is passed instead of a function (which in this case shows everything).

@@ -53,7 +53,9 @@ Pass in options as an object, including optional overrides for the following bui
- `colorHash` - Applying calculated colours using a built-in orange-to-red scale based on time spent at stack top
- `renderTooltip` - Creating and updating a tooltip giving basic frame information
- `renderLabel` - Writing frame information on the frames themselves in Canvas
- `renderStackFrameBox` - Drawing the frame rectangles in Canvas, including redrawing on hover
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this spurious?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, it's one of the functions that can be passed in. It was added before this PR, but it should be included in the list. Maybe I should have included it in a separate commit for clarity.

Looking back, it looks like I missed this section of the readme in my last PR ( #24 6.10.0)

Copy link
Contributor

@goto-bus-stop goto-bus-stop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clean, i like it

@mcollina mcollina merged commit 0206628 into davidmarkclements:master Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants