How to use the @nearform/clinic-common/base/helpers.js.toHtml function in @nearform/clinic-common

To help you get started, we’ve selected a few @nearform/clinic-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nearform / node-clinic-flame / visualizer / tooltip.js View on Github external
updateTooltip ({ msg, d3TargetElement, targetRect, outerRect = document.body.getBoundingClientRect(), offset, pointerCoords, verticalAlign = 'bottom' }) {
    // returns if the tooltip is hidden
    if (this.isHidden) return

    const msgHtmlNode = toHtml(msg, 'tooltip-default-message')

    this.d3TooltipInner.classed('top bottom', false)
    this.d3TooltipInner.classed(verticalAlign, true)

    let {
      x,
      y,
      width,
      height
    } = targetRect || d3TargetElement.node().getBoundingClientRect()

    if (offset) {
      x += offset.x || 0
      y += offset.y || 0
      width += offset.width || 0
      height += offset.height || 0

@nearform/clinic-common

Shared parts between the Clinic.js suite

MIT
Latest version published 4 years ago

Package Health Score

42 / 100
Full package analysis

Similar packages