无法将BokehJS与Angular8一起使用



请在浏览器中找到以下错误日志:

AppComponent.html:1 错误类型错误:FlatBush 不是构造函数 在新的空间索引(供应商.js:90501( at AnnularWedgeView.push../node_modules/bokehjs/build/js/lib/models/glyphs/xy_glyph.js.XYGlyphView._index_data (vendor.js:104504( at AnnularWedgeView.push../node_modules/bokehjs/build/js/lib/models/glyphs/glyph.js.GlyphView.index_data (vendor.js:100363( at AnnularWedgeView.push../node_modules/bokehjs/build/js/lib/models/glyphs/glyph.js.GlyphView.set_data (vendor.js:100359( at GlyphRendererView.push../node_modules/bokehjs/build/js/lib/models/renderers/glyph_renderer.js.GlyphRendererView.set_data (vendor.js:109490( at GlyphRendererView.push../node_modules/bokehjs/build/js/lib/models/renderers/glyph_renderer.js.GlyphRendererView.initialize (vendor.js:109443( at GlyphRendererView.View [作为构造函数] (vendor.js:91313( at GlyphRendererView.DOMView [作为构造函数] (vendor.js:84742( at GlyphRendererView.RendererView [as constructor] (vendor.js:109915( at GlyphRendererView.DataRendererView [as constructor] (vendor.js:109336(

(在这里添加一些额外的信息,我是Bokehjs的新手(

我遇到了同样的问题,将反应与 webpack 一起使用。

import * as Bokeh from 'bokehjs'
// ...
Bokeh.embed.embed_item(data_from_backend)

错误:

ERROR TypeError: FlatBush is not a constructor at new SpatialIndex

做一些调试..

node_modules/bokehjs/build/js/lib/core/util/spatial.js,将this.index = new FlatBush(points.length);改为this.index = new FlatBush.default(points.length);使Bokehjs有效。

据此,我想这是一个模块导出问题。

最新更新