F# 使用d3.js的安全堆栈
我试图在安全堆栈默认模板中集成使用d3创建的数据可视化 作为一个概念项目,我试图整合这个条形图: 我已经能够将条形图的代码插入client.fs:F# 使用d3.js的安全堆栈,f#,fable-f#,F#,Fable F#,我试图在安全堆栈默认模板中集成使用d3创建的数据可视化 作为一个概念项目,我试图整合这个条形图: 我已经能够将条形图的代码插入client.fs: let svg = Fable.Import.D3.Globals.select("#display") .append("svg") .attr("width", U3.Case1 width)
let svg = Fable.Import.D3.Globals.select("#display")
.append("svg")
.attr("width", U3.Case1 width)
.attr("height", U3.Case1 height)
一切编译和运行都很好,但我不知道如何使图像在生成的页面上可见
我猜它必须插入到视图中:
let view (model : Model) (dispatch : Msg -> unit) =
div []
[ Navbar.navbar [ Navbar.Color IsPrimary ]
[ Navbar.Item.div [ ]
[ Heading.h2 [ ]
[ str "SAFE Template" ] ] ]
......
但我已经做了一些尝试,无法将内容编译
有人知道怎么做吗
谢谢事实证明这其实很简单 所需要的只是将选择器从“#display”更改为保证像这样的“body”一样存在的东西
let svg = Fable.Import.D3.Globals.select("body")