我正在尝试从elm visualisations示例中运行力向图。
但是我无法确定SampleData
依赖来自哪个程序包。
...
import SampleData exposing (miserablesGraph)
...
我能向正确的方向指出一点吗?
[似乎是内部的东西,因为examples on the Github将此数据进行了硬编码。
我建议您在代码中也这样做。定义miserablesGraph
函数:
miserablesGraph : Graph String ()
miserablesGraph =
Graph.fromNodeLabelsAndEdgePairs
[ "Myriel"
, "Napoleon"
, "Mlle.Baptistine"
...
或创建SampleData
模块并在其中定义功能。