本文整理汇总了TypeScript中vega.View类的典型用法代码示例。如果您正苦于以下问题:TypeScript View类的具体用法?TypeScript View怎么用?TypeScript View使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了View类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: clear
export function clear(id: string, parent: string, shiftKey: boolean) {
const bg = document.querySelector((parent ? `g.${parent} ` : '') + 'path.background');
const el = mark(id, parent);
let [clientX, clientY] = coords(el);
clientX += 10;
clientY -= 10;
click(bg, {clientX, clientY, shiftKey});
return view.data('sel_store');
}
示例2: brush
export function brush(id0: string, id1: string, parent: string, targetBrush: boolean) {
const el0 = mark(id0, parent);
const el1 = mark(id1, parent);
const [mdX, mdY] = coords(el0);
const [muX, muY] = coords(el1);
mouseEvt('mousedown', brushOrEl(el0, parent, targetBrush), {clientX: mdX, clientY: mdY});
mouseEvt('mouseup', window, {clientX: muX, clientY: muY});
return view.data('sel_store');
}
示例3: zoom
export function zoom(id: string, delta: number, parent: string, targetBrush: boolean) {
const el = mark(id, parent);
const [clientX, clientY] = coords(el);
mouseEvt('wheel', brushOrEl(el, parent, targetBrush), {
clientX,
clientY,
deltaX: delta,
deltaY: delta,
deltaZ: delta
});
mouseEvt('wheel', brushOrEl(el, parent, targetBrush), {
clientX,
clientY,
deltaX: Math.sign(delta),
deltaY: Math.sign(delta),
deltaZ: Math.sign(delta)
});
return view.data('sel_store');
}
示例4: pt
export function pt(id: string, parent: string, shiftKey: boolean) {
const el = mark(id, parent);
const [clientX, clientY] = coords(el);
click(el, {clientX, clientY, shiftKey});
return view.data('sel_store');
}