本文整理汇总了TypeScript中@bokehjs/core/hittest.create_empty_hit_test_result函数的典型用法代码示例。如果您正苦于以下问题:TypeScript create_empty_hit_test_result函数的具体用法?TypeScript create_empty_hit_test_result怎么用?TypeScript create_empty_hit_test_result使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_empty_hit_test_result函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should clear node selections if hit_test result is empty", () => {
const initial_selection = create_empty_hit_test_result()
initial_selection["1d"].indices = [0, 1]
node_source.selected = initial_selection
const hit_test_result = create_empty_hit_test_result()
const policy = new EdgesAndLinkedNodes()
policy.do_selection(hit_test_result, gr, true, false)
expect(node_source.selected.is_empty()).to.be.true
})
开发者ID:digitalsatori,项目名称:Bokeh,代码行数:11,代码来源:graph_hit_test_policy.ts
示例2: it
it("should return false and clear inspections if hit_test_result is empty", function() {
this.glyph_stub.returns(create_empty_hit_test_result())
const source = this.renderer_view.model.data_source
source.inspected.indices = [0, 1]
expect(source.inspected.is_empty()).to.be.false
const did_hit = source.selection_manager.inspect(this.renderer_view, "geometry")
expect(did_hit).to.be.false
expect(source.inspected.is_empty()).to.be.true
})
开发者ID:digitalsatori,项目名称:Bokeh,代码行数:10,代码来源:selection_manager.ts
示例3: it
import {expect} from "chai"
import {Selection} from "@bokehjs/models/selections/selection"
import * as hittest from "@bokehjs/core/hittest"
const some_1d_selection = hittest.create_hit_test_result_from_hits([[4, 1], [5, 2]])
const other_1d_selection = hittest.create_hit_test_result_from_hits([[0, 1], [1, 2]])
const some_2d_selection = hittest.create_empty_hit_test_result()
some_2d_selection.multiline_indices = {2: [2, 3]}
const other_2d_selection = hittest.create_empty_hit_test_result()
other_2d_selection.multiline_indices = {2: [0, 1]}
describe("Selection", () => {
it("should be updatable", () => {
const s = new Selection()
s.update(some_1d_selection, true, false)
expect(s.indices).to.deep.equal([4, 5])
})
it("should be updatable with append=false", () => {
const s = new Selection()
s.update(some_1d_selection, true, false)
s.update(other_1d_selection, true, false)
expect(s.indices).to.be.deep.equal([0, 1])
})
it("should be updatable with append=true", () => {
const s = new Selection()
s.update(some_1d_selection, true, true)
开发者ID:digitalsatori,项目名称:Bokeh,代码行数:31,代码来源:selection.ts
注:本文中的@bokehjs/core/hittest.create_empty_hit_test_result函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论