I have an angular-2-application written in typescript which works pretty well; however, I stumbled upon this Problem for which the various related answers to the $-function did not help me. I also have the library "plottable" included and this is where the problem occured: There is a tutorial for tooltips (which happens to be what i Need in my Charts). In this tutorial, the following code can be found:
// Initializing tooltip anchor
var tooltipAnchorSelection = plot.foreground().append("circle").attr({
r: 3,
opacity: 0
});
var tooltipAnchor = $(tooltipAnchorSelection.node());
tooltipAnchor.tooltip({
animation: false,
container: "body",
placement: "auto",
title: "text",
trigger: "manual"
});
What my question now is about is this line:
var tooltipAnchor = $(tooltipAnchorSelection.node());
I can't seem to find a working replacement for the $-function here. I have the following questons:
- Is this jQuery? (since i have no real knowledge about jQuery I wouldn't know, the rest of the code seems pretty much like plain JavaScript to me though)
- How can I replace this in my typescript-code to do the same as it does here?
I have tried simply removing it (would not throw any syntax-error but would not Show any tooltips either) but of course that didn't work; I also tried replacing it with document.getElementById(tooltipAnchorSelection.node())
but that didn't work either
Here is a JSFiddle showing a working Version of These tooltips; since this is written in JavaScript it works, but copying that exact same code to typescript shows me a syntax-error at the dollarsign.
Thanks for the help, I'd really appreciate it
Edit: I am not allowed to integrate jQuery in this project so just doing this can't fix my problem.
PS: I thought about naming this question something like "plottable tooltips don't work in typescript" or something but as the JSFiddle Shows they do work somehow, this really seems to be more of an issue with the $-function than with anything else