當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript vega.View類代碼示例

本文整理匯總了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');
}
開發者ID:vega,項目名稱:vega-lite,代碼行數:9,代碼來源:global.ts

示例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');
}
開發者ID:vega,項目名稱:vega-lite,代碼行數:9,代碼來源:global.ts

示例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');
}
開發者ID:vega,項目名稱:vega-lite,代碼行數:19,代碼來源:global.ts

示例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');
}
開發者ID:vega,項目名稱:vega-lite,代碼行數:6,代碼來源:global.ts


注:本文中的vega.View類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。