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

@d3fc/d3fc-rebind

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@d3fc/d3fc-rebind

Utilities for copying methods from one d3 component to another in a configurable way

  • 5.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5K
decreased by-59.19%
Maintainers
2
Weekly downloads
 
Created
Source

d3fc-rebind

Utilities for copying methods from one d3 component to another in a configurable way

Main d3fc package

Installing

npm install d3fc-rebind

API Reference

Functions

# fc.rebind(target, source, ...names)

Provides the same functionality as d3.rebind -

Copies the methods with the specified names from source to target, and returns target. Calling one of the named methods on the target object invokes the same-named method on the source object, passing any arguments passed to the target method, and using the source object as the this context. If the source method returns the source object, the target method returns the target object (“setter” method); otherwise, the target method returns the return value of the source method (“getter” mode). The rebind operator allows inherited methods (mix-ins) to be rebound to a subclass on a different object.

# fc.rebindAll(target, source, [...transforms])

Provides the same functionality as rebind but copies all properties found on source to target. Optionally, property name transforms can be specified. These receive a source property name and return either the target property name or a falsey value to indicate the property should not be copied.

N.B. This method does not work with properties found on the source object's prototype e.g. d3.dispatch().on. If you need this functionality use rebind.

Transform functions

As well as creating transforms manually, the following may be useful (especially if you're not able to use ES2015 features) -

# fc.exclude(...names)

Exclude a set of property names. Names can be specified as a string or RegExp.

# fc.include(...names)

Include only the set of property names. Names can be specified as a string or RegExp.

# fc.includeMap(mappings)

Include only the set of properties specified by the keys of mappings using their corresponding values as the target property name e.g. { 'sourceName': 'targetName' }.

# fc.prefix(str)

Prefix all property names with str.

Keywords

FAQs

Package last updated on 21 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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