Skip to content

problem with tooltips #2

@alexmc6

Description

@alexmc6

Hello,

Thanks for the great example of using D3V4. I have gotten it responding to buttons so that the force changes the location of the bubbles.

However, I am having trouble with the tooltip.js and I wonder if you have seen this problem before. I can see that you don't seem to have the same problem as me so it is presumably something in my setup.

Everything seems to work fine except that when I hover over a circle the tooltip code gets as far as to showTooltip and even updatePosition but when it reaches

function updatePosition(event) {
var xOffset = 20;
var yOffset = 10;
var ttw = tt.style('width');

I get
Uncaught TypeError: Cannot read property 'ownerDocument' of null
at window (d3.self-f933ecc….js?body=1:1297)
at Selection.selection_style [as style] (d3.self-f933ecc….js?body=1:1329)
at updatePosition (tooltip.self-6c84d32….js?body=1:54)
at Object.showTooltip (tooltip.self-6c84d32….js?body=1:36)
at SVGCircleElement.showDetail (bubble_chart.self-b057718….js?body=1:288)
at SVGCircleElement. (d3.self-f933ecc….js?body=1:821)

From debugging this I can see that tt exists - and seems to have a node() but the error says whatever node() returns doesn't have an ownerDocument. And that confuses the heck out of me.

Now I am using your example inside a Rails app which has its own javascript pipeline - not the same one you used. I was worried that the tooltip object was being created too early - BUT it seems to be created at the same time as the rest of the chart - and that is being displayed fine for me.

If you have any ideas I would much appreciate it.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions