Skip to content

Commit 4e8423c

Browse files
committed
importing tooltip files
1 parent 0c1813a commit 4e8423c

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

package-lock.json

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"acorn-jsx": "^5.0.2",
6464
"bower": "^1.8.8",
6565
"d3": "^4.13.0",
66+
"d3-tip": "^0.9.1",
6667
"immer": "^3.2.0",
6768
"jsondiffpatch": "^0.3.11",
6869
"prop-types": "^15.7.2",

src/app/components/Chart.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import React, { Component } from 'react';
66
import PropTypes from 'prop-types';
77
import * as d3 from 'd3';
8-
import '../d3tooltip.js'
8+
import * as _d3Tip from "d3-tip"
99

1010
let root = {};
1111
let duration = 750;
@@ -91,7 +91,8 @@ class Chart extends Component {
9191
.attr("r", 15)
9292

9393
//creating a d3.tip method where the html has a function that returns the data we passed into tip.show from line 120
94-
let tip = d3.tip()
94+
const d3Tip = _d3Tip.bind(d3)
95+
let tip = d3Tip()
9596
.attr("class", "d3-tip")
9697
.html(function (d) { return "State Snapshot: " + d; })
9798
//invoking tooltip for nodes

0 commit comments

Comments
 (0)