Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Property 'tip' does not exist on type 'typeof @types/d3/index"'

I can not use the the d3 tip.

import * as d3 from "d3";
import  "d3-tip";

var tool_tip = d3.tip()

I receive a such error.

Property 'tip' does not exist on type 'typeof "/home/viktor/projects/internet_trading_platform/client/node_modules/@types/d3/index"'.

I have imported the d3 tip modules have to augment the d3 module. But it does not. According to https://www.typescriptlang.org/docs/handbook/declaration-merging.html

Regards.

The d3-tip declaration is located here https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/d3-tip/index.d.ts

like image 866
Victor Shelepen Avatar asked Oct 28 '22 23:10

Victor Shelepen


1 Answers

try this.

import d3Tip from "d3-tip"

const tip = d3Tip();

tip.attr("class", "d3-tip")
   .html(d => { return "html"})
like image 92
Krishalsinh Raj Avatar answered Dec 06 '22 06:12

Krishalsinh Raj