• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript edit_tool.BkEv类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中models/tools/edit/edit_tool.BkEv的典型用法代码示例。如果您正苦于以下问题:TypeScript BkEv类的具体用法?TypeScript BkEv怎么用?TypeScript BkEv使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了BkEv类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: it

    it("should drag selected on pan", function(): void {
      const testcase = make_testcase();
      const hit_test_stub = sinon.stub(testcase.glyph_view, "hit_test");

      hit_test_stub.returns(create_1d_hit_test_result([[1, 0]]));
      const tap_event = make_event(300, 300);
      testcase.draw_tool_view._tap(tap_event);

      let drag_event = make_event(300, 300);
      testcase.draw_tool_view._pan_start(drag_event);
      expect(testcase.draw_tool_view._basepoint).to.be.deep.equal([300, 300]);

      drag_event = make_event(200, 200);
      testcase.draw_tool_view._pan(drag_event);
      expect(testcase.draw_tool_view._basepoint).to.be.deep.equal([200, 200]);

      drag_event = make_event(200, 200);
      testcase.draw_tool_view._pan_end(drag_event);
      expect(testcase.draw_tool_view._basepoint).to.be.equal(null);
      expect(testcase.data_source.data['x']).to.be.deep.equal([0, 0.14601769911504425, 1]);
      expect(testcase.data_source.data['y']).to.be.deep.equal([0, 0.8389830508474576, 1]);
      expect(testcase.data_source.data['width']).to.be.deep.equal([0.1, 0.2, 0.3]);
      expect(testcase.data_source.data['height']).to.be.deep.equal([0.3, 0.2, 0.1]);
      expect(testcase.data_source.data['z']).to.be.deep.equal([null, null, null]);
    })
开发者ID:FourtekIT-incubator,项目名称:bokeh,代码行数:25,代码来源:box_edit_tool.ts


示例2: it

    it("should add vertex on tap after doubletap ", function(): void {
      const testcase = make_testcase();
      const hit_test_stub = sinon.stub(testcase.glyph_view, "hit_test");
      const vertex_hit_test_stub = sinon.stub(testcase.vertex_glyph_view, "hit_test");

      hit_test_stub.returns(create_1d_hit_test_result([[1, 0]]));
      vertex_hit_test_stub.returns(null);
      const tap_event = make_event(300, 300);
      testcase.draw_tool_view._doubletap(tap_event); // Poly selected
      vertex_hit_test_stub.returns(create_1d_hit_test_result([[1, 0]]));
      testcase.vertex_renderer.view.compute_indices();
      testcase.draw_tool_view._doubletap(tap_event); // Vertex selected
      vertex_hit_test_stub.returns(create_1d_hit_test_result([[2, 0]]));
      const key_event = make_event(290, 290, false, Keys.Esc);
      testcase.draw_tool_view._tap(key_event); // Add new vertex
      testcase.draw_tool_view._move_enter(key_event);
      testcase.draw_tool_view._keyup(key_event); // Stop editing

      const xs = [0, 0.5, 0.008849557522123894, 1];
      const ys = [0, -0.5, 0.03389830508474576, -1];
      expect(testcase.vertex_source.selected['1d'].indices).to.be.deep.equal([]);
      expect(testcase.vertex_source.data.x).to.be.deep.equal(xs);
      expect(testcase.vertex_source.data.y).to.be.deep.equal(ys);
      expect(testcase.data_source.data.xs).to.be.deep.equal([[0, 0.5, 1], xs]);
      expect(testcase.data_source.data.ys).to.be.deep.equal([[0, -0.5, -1], ys]);
      expect(testcase.data_source.data.z).to.be.deep.equal([null, null]);
    });
开发者ID:FourtekIT-incubator,项目名称:bokeh,代码行数:27,代码来源:poly_edit_tool.ts


示例3: it

    it("should drag all selected points on pan", function(): void {
      const testcase = make_testcase()
      const hit_test_stub = sinon.stub(testcase.glyph_view, "hit_test");

      hit_test_stub.returns(create_1d_hit_test_result([[1, 0]]));
      const tap_event = make_event(300, 300);
      testcase.draw_tool_view._tap(tap_event);

      hit_test_stub.returns(create_1d_hit_test_result([[2, 0]]));
      let drag_event = make_event(300, 300, true);
      testcase.draw_tool_view._pan_start(drag_event);
      expect(testcase.draw_tool_view._basepoint).to.be.deep.equal([300, 300]);

      drag_event = make_event(200, 200);
      testcase.draw_tool_view._pan(drag_event);
      expect(testcase.draw_tool_view._basepoint).to.be.deep.equal([200, 200]);

      drag_event = make_event(200, 200);
      testcase.draw_tool_view._pan_end(drag_event);
      expect(testcase.draw_tool_view._basepoint).to.be.equal(null);
      expect(testcase.data_source.selected['1d'].indices).to.be.deep.equal([]);
      expect(testcase.data_source.data['x']).to.be.deep.equal([0, 0.14601769911504425, 0.6460176991150443]);
      expect(testcase.data_source.data['y']).to.be.deep.equal([0, 0.8389830508474576, 1.3389830508474576]);
      expect(testcase.data_source.data['z']).to.be.deep.equal([null, null, null]);
    });
开发者ID:FourtekIT-incubator,项目名称:bokeh,代码行数:25,代码来源:point_draw_tool.ts


示例4: it

    it("should select multiple patches on shift-tap", function() {
      const testcase = make_testcase();
      const hit_test_stub = sinon.stub(testcase.glyph_view, "hit_test");
      hit_test_stub.returns(create_1d_hit_test_result([[1, 0]]));

      let tap_event = make_event(300, 300);
      testcase.draw_tool_view._tap(tap_event);
      hit_test_stub.returns(create_1d_hit_test_result([[0, 0]]));
      tap_event = make_event(560, 560, true);
      testcase.draw_tool_view._tap(tap_event);

      expect(testcase.data_source.selected['1d'].indices).to.be.deep.equal([1, 0]);
    });
开发者ID:FourtekIT-incubator,项目名称:bokeh,代码行数:13,代码来源:poly_draw_tool.ts



注:本文中的models/tools/edit/edit_tool.BkEv类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript range_tool.RangeTool类代码示例发布时间:2022-05-25
下一篇:
TypeScript tms_tile_source.TMSTileSource类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap