Begin d3 v4 update

This commit is contained in:
Tom MacWright
2016-08-12 10:29:00 -04:00
parent 36a90b4f86
commit cdb533fa84
137 changed files with 842 additions and 6691 deletions
+10 -7
View File
@@ -1,3 +1,6 @@
import { rebind } from '../util/rebind';
import { d3keybinding } from '../../js/lib/d3.keybinding.js';
import * as d3 from 'd3';
import { Entity } from '../core/index';
/*
The hover behavior adds the `.hover` class on mouseover to all elements to which
@@ -15,8 +18,8 @@ export function Hover() {
target;
function keydown() {
if (altDisables && d3.event.keyCode === d3.keybinding.modifierCodes.alt) {
dispatch.hover(null);
if (altDisables && d3.event.keyCode === d3keybinding.modifierCodes.alt) {
dispatch.call("hover", this, null);
selection.selectAll('.hover')
.classed('hover-suppressed', true)
.classed('hover', false);
@@ -24,8 +27,8 @@ export function Hover() {
}
function keyup() {
if (altDisables && d3.event.keyCode === d3.keybinding.modifierCodes.alt) {
dispatch.hover(target ? target.id : null);
if (altDisables && d3.event.keyCode === d3keybinding.modifierCodes.alt) {
dispatch.call("hover", this, target ? target.id : null);
selection.selectAll('.hover-suppressed')
.classed('hover-suppressed', false)
.classed('hover', true);
@@ -59,9 +62,9 @@ export function Hover() {
selection.selectAll(selector)
.classed(suppressed ? 'hover-suppressed' : 'hover', true);
dispatch.hover(target.id);
dispatch.call("hover", this, target.id);
} else {
dispatch.hover(null);
dispatch.call("hover", this, null);
}
}
@@ -124,5 +127,5 @@ export function Hover() {
return hover;
};
return d3.rebind(hover, dispatch, 'on');
return rebind(hover, dispatch, 'on');
}