npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

d3plus-tooltip

v1.1.1

Published

A javascript-only tooltip.

Downloads

3,246

Readme

d3plus-tooltip

NPM Release Build Status Dependency Status Gitter

A javascript-only tooltip.

Installing

If you use NPM, npm install d3plus-tooltip. Otherwise, download the latest release. You can also load d3plus-tooltip as a standalone library or as part of D3plus. ES modules, AMD, CommonJS, and vanilla environments are supported. In vanilla, a d3plus global is exported:

<script src="https://cdn.jsdelivr.net/npm/d3plus-tooltip@1"></script>
<script>
  console.log(d3plus);
</script>

API Reference


Tooltip <>

This is a global class, and extends all of the methods and functionality of BaseClass.

# new Tooltip()

Creates HTML tooltips in the body of a webpage.

# Tooltip.arrow([value]) <>

Sets the inner HTML content of the arrow element, which by default is empty.

This is a static method of Tooltip. default accessor

   function value(d) {
  return d.arrow || "";
}

# Tooltip.arrowStyle([value]) <>

If value is specified, sets the arrow styles to the specified values and returns this generator. If value is not specified, returns the current arrow styles.

This is a static method of Tooltip. default styles

   {
     "content": "",
     "border-width": "10px",
     "border-style": "solid",
     "border-color": "rgba(255, 255, 255, 0.75) transparent transparent transparent",
     "position": "absolute"
   }

# Tooltip.background([value]) <>

If value is specified, sets the background accessor to the specified function or string and returns this generator. If value is not specified, returns the current background accessor.

This is a static method of Tooltip.

# Tooltip.body([value]) <>

If value is specified, sets the body accessor to the specified function or string and returns this generator. If value is not specified, returns the current body accessor.

This is a static method of Tooltip. default accessor

function value(d) {
  return d.body || "";
}

# Tooltip.bodyStyle([value]) <>

If value is specified, sets the body styles to the specified values and returns this generator. If value is not specified, returns the current body styles.

This is a static method of Tooltip. default styles

{
  "font-family": "'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif",
  "font-size": "12px",
  "font-weight": "400"
}

# Tooltip.border([value]) <>

If value is specified, sets the border accessor to the specified function or string and returns this generator. If value is not specified, returns the current border accessor.

This is a static method of Tooltip.

# Tooltip.borderRadius([value]) <>

If value is specified, sets the border-radius accessor to the specified function or string and returns this generator. If value is not specified, returns the current border-radius accessor.

This is a static method of Tooltip.

# Tooltip.className([value]) <>

If value is specified, sets the class name to the specified string and returns this generator. If value is not specified, returns the current class name.

This is a static method of Tooltip.

# Tooltip.data([data]) <>

If data is specified, sets the data array to the specified array and returns this generator. If data is not specified, returns the current data array.

This is a static method of Tooltip.

# Tooltip.footer([value]) <>

If value is specified, sets the footer accessor to the specified function or string and returns this generator. If value is not specified, returns the current footer accessor.

This is a static method of Tooltip. default accessor

function value(d) {
  return d.footer || "";
}

# Tooltip.footerStyle([value]) <>

If value is specified, sets the footer styles to the specified values and returns this generator. If value is not specified, returns the current footer styles.

This is a static method of Tooltip. default styles

{
  "font-family": "'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif",
  "font-size": "12px",
  "font-weight": "400"
}

# Tooltip.height([value]) <>

If value is specified, sets the height accessor to the specified function or string and returns this generator. If value is not specified, returns the current height accessor.

This is a static method of Tooltip.

# Tooltip.id([value]) <>

If value is specified, sets the id accessor to the specified function or string and returns this generator. If value is not specified, returns the current id accessor.

This is a static method of Tooltip. default accessor

function value(d, i) {
  return d.id || "" + i;
}

# Tooltip.offset([value]) <>

If value is specified, sets the offset accessor to the specified function or number and returns this generator. If value is not specified, returns the current offset accessor.

This is a static method of Tooltip.

# Tooltip.padding([value]) <>

If value is specified, sets the padding accessor to the specified function or string and returns this generator. If value is not specified, returns the current padding accessor.

This is a static method of Tooltip.

# Tooltip.pointerEvents([value]) <>

If value is specified, sets the pointer-events accessor to the specified function or string and returns this generator. If value is not specified, returns the current pointer-events accessor.

This is a static method of Tooltip.

# Tooltip.position([value]) <>

If value is specified, sets the position accessor to the specified function or array and returns this generator. If value is not specified, returns the current position accessor. If value is an HTMLElement, anchors the Tooltip to that HTMLElement. If value is a selection string, anchors the Tooltip to the HTMLElement selected by that string. Otherwise, coordinate points must be in reference to the client viewport, not the overall page.

This is a static method of Tooltip. default accessor

   function value(d) {
    return [d.x, d.y];
  }

# Tooltip.tableStyle([value]) <>

If value is specified, sets the table styles to the specified values and returns this generator. If value is not specified, returns the current table styles.

This is a static method of Tooltip. default styles

{
  "border-collapse": "collapse",
  "border-spacing": "0",
  "width": "100%"
}

# Tooltip.tbody([value]) <>

If value is specified, sets the contents of the table body to the specified array of functions or strings and returns this generator. If value is not specified, returns the current table body data.

This is a static method of Tooltip.

# Tooltip.tbodyStyle([value]) <>

If value is specified, sets the table body styles to the specified values and returns this generator. If value is not specified, returns the current table body styles.

This is a static method of Tooltip. default styles

{
  "font-family": "'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif",
  "font-size": "12px",
  "font-weight": "600",
  "text-align": "center"
}

# Tooltip.thead([value]) <>

If value is specified, sets the contents of the table head to the specified array of functions or strings and returns this generator. If value is not specified, returns the current table head data.

This is a static method of Tooltip.

# Tooltip.theadStyle([value]) <>

If value is specified, sets the table head styles to the specified values and returns this generator. If value is not specified, returns the current table head styles.

This is a static method of Tooltip. default styles

{
  "font-family": "'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif",
  "font-size": "12px",
  "font-weight": "600",
  "text-align": "center"
}

# Tooltip.title([value]) <>

If value is specified, sets the title accessor to the specified function or string and returns this generator. If value is not specified, returns the current title accessor.

This is a static method of Tooltip. default accessor

function value(d) {
  return d.title || "";
}

# Tooltip.titleStyle([value]) <>

If value is specified, sets the title styles to the specified values and returns this generator. If value is not specified, returns the current title styles.

This is a static method of Tooltip. default styles

{
  "font-family": "'Roboto', 'Helvetica Neue', 'HelveticaNeue', 'Helvetica', 'Arial', sans-serif",
  "font-size": "14px",
  "font-weight": "600",
  "padding-bottom": "5px"
}

# Tooltip.trStyle([value]) <>

An object with CSS keys and values to be applied to all elements inside of each .

This is a static method of Tooltip. default styles

  {
    "border-top": "1px solid rgba(0, 0, 0, 0.1)"
  }

# Tooltip.tdStyle([value]) <>

An object with CSS keys and values to be applied to all elements inside of each .

This is a static method of Tooltip.

# Tooltip.width([value]) <>

If value is specified, sets the width accessor to the specified function or string and returns this generator. If value is not specified, returns the current width accessor.

This is a static method of Tooltip.


d3plus.generateReference(position) <>

Creates a reference element for popper.

This is a global function. Prrivate:


Documentation generated on Tue, 26 Mar 2024 15:43:44 GMT