0.11.0 • Published 9 months ago

@redsift/d3-rs-tip v0.11.0

Weekly downloads
811
License
MIT
Repository
github
Last release
9 months ago

d3-rs-tip

d3-rs-tip is a component for adding tooltips in charts made with D3, an extension of Justin Palmer's d3-tip. This component is dependent on D3 v4 (Alpha).

Builds

Circle CI

UMD from //static.redsift.io/reusable/d3-rs-tip/latest/d3-rs-tip.umd-es2015.min.js

Usage

ES6

  import { body as tip } from "@redsift/d3-rs-tip";
  
  var rtip = tip()
      .html(d => d.text)
  elmS.call(rtip);

  node.on('mouseover', rtip.show)
    .on('mouseout', rtip.hide)
  ...

If using rollup.js for a browser target, ensure d3-rs-tip is part of the global map.

Require

  var d3Tip = require("@redsift/d3-rs-tip");
  var eml = d3Tip.body();
  ...
  

Parameters

NameDescriptionExpected Value
attrSets or gets attribute valuesame as d3 e.g. attr('key',value|function)
styleSets or gets a style valuesame as d3 e.g. style('key',value|function)
directionSets or gets direction of the tooltipone of n,s,e,w,nw,sw,ne,se
styleSets or gets the CSS wrapped with the componentstring of CSS properties
parentSets or gets the parent element the tip will be appended toDOM Node (default: body)
transitionCauses the tip to fade in boolean|number. If a number, the value is set at the time for the fade