SampleData elm package?

Viewed 71

I'm trying to run the force directed graph from the elm visualisations examples.

However I can't identify what package the SampleData dependency is from.

...
import SampleData exposing (miserablesGraph)
...

Could I get a point in the right direction?

1 Answers

It seems to be something internal because examples on the Github have this data hardcoded.

I'd suggest doing the same in your code. Either define miserablesGraph function:

miserablesGraph : Graph String ()
miserablesGraph =
    Graph.fromNodeLabelsAndEdgePairs
        [ "Myriel"
        , "Napoleon"
        , "Mlle.Baptistine"
...

or create SampleData module and define the function there.

module SampleData exposing (miserablesGraph)

miserablesGraph : Graph String ()
miserablesGraph =
    Graph.fromNodeLabelsAndEdgePairs
        [ "Myriel"
        , "Napoleon"
        , "Mlle.Baptistine"
...
Related