Skip to content
This repository has been archived by the owner on Dec 21, 2018. It is now read-only.

Commit

Permalink
Resolve circular import.
Browse files Browse the repository at this point in the history
  • Loading branch information
jheer committed May 4, 2018
1 parent d50cd16 commit 1a902be
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/Handler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {domCreate} from './util/dom';
import {resolveItem} from './util/pickPath';
import resolveItem from './util/resolveItem';
import {loader} from 'vega-loader';

/**
Expand Down
21 changes: 0 additions & 21 deletions src/util/pickPath.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import marks from '../marks/index';
import point from './point';

export function pickArea(a, p) {
var v = a[0].orient === 'horizontal' ? p[1] : p[0],
z = a[0].orient === 'horizontal' ? 'y' : 'x',
Expand Down Expand Up @@ -49,21 +46,3 @@ export function pickTrail(a, p) {

return null;
}

export function resolveItem(item, event, el, origin) {
var mark = item && item.mark,
mdef, p;

if (mark && (mdef = marks[mark.marktype]).tip) {
p = point(event, el);
p[0] -= origin[0];
p[1] -= origin[1];
while (item = item.mark.group) {
p[0] -= item.x || 0;
p[1] -= item.y || 0;
}
item = mdef.tip(mark.items, p);
}

return item;
}
20 changes: 20 additions & 0 deletions src/util/resolveItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import marks from '../marks/index';
import point from './point';

export default function(item, event, el, origin) {
var mark = item && item.mark,
mdef, p;

if (mark && (mdef = marks[mark.marktype]).tip) {
p = point(event, el);
p[0] -= origin[0];
p[1] -= origin[1];
while (item = item.mark.group) {
p[0] -= item.x || 0;
p[1] -= item.y || 0;
}
item = mdef.tip(mark.items, p);
}

return item;
}

0 comments on commit 1a902be

Please sign in to comment.