Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
F# 使用d3.js的安全堆栈_F#_Fable F# - Fatal编程技术网

F# 使用d3.js的安全堆栈

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)

我试图在安全堆栈默认模板中集成使用d3创建的数据可视化

作为一个概念项目,我试图整合这个条形图:

我已经能够将条形图的代码插入client.fs:

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")