【发布时间】:2018-08-25 01:09:49
【问题描述】:
我正在尝试在 SAFE 堆栈默认模板中集成使用 d3 创建的数据可视化。
作为概念证明,我正在尝试整合这个条形图:http://fable.io/fable-graphics/samples/d3/barchart/index.html
我已经能够将条形图的代码插入到 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" ] ] ]
......
但我做了一些尝试,但无法编译。
有人知道怎么做吗?
谢谢
【问题讨论】: