Help with data in a force-directed graph

I’m trying to finish up a knowledge graph that some of my students had been working on: Emerson Knowledge Graph / bcwrit / Observable. The issue is that a good portion of the data we are feeding to the graph is not being visualized, either in the top level graph (“Select All”) or when they are picked individually. Each essay is assigned an index number in a dictionary at the bottom, and I have confirmed that those numbers exist in the dataset (coocs1.json). However, essays such as “A Letter” (35) do not appear in the top-level graph or produce an graph at all when selected individually.

We had some notion as my students were transitioning off the project that observable was maybe not able to handle all the data, but it seems weird to me that whole essays are missing rather than some here and there as the system is overwhelmed, especially given how the data is formatted. Anyway, I’m running pretty far behind on the article this supports, so any help is greatly appreciated. Thanks!

I added a date to the dataset and it then worked.
So I guess it needs a date. One way to fix the unknown dates would be maybe add 1800s

Adding "" to the dates and "" to the dictionary fixes it.

viewof years = Inputs.checkbox(["Select All", "1835", "1836", "1837", "1838", "1841", "1842", "1844", "1850", "1852", "1855", "1856", "1859", "1860","1862", "1865", "1867","1869",  "1870", "1875", "1878", "1890",''], {label: "Select Years to View", value: ["Select All"]})
dictionary = {
  var dict = {
    0: ["Samuel Hoar",''],
    1: ["Eloquence","1870"],
    2: ["Clubs","1870"],
    3: ["Greatness", "1875"],
    4: ["The Superlative",''],
    5: ["Prayers",''],
    6: ["Nature", "1844"],
    7: ["Ezra Ripley, D.D.".''],
    8: ["Circles", "1841"],
    9: ["Politics","1844"],
    10: ["The Man of Letters"],

Awesome: that worked with about half of them, but I was still having trouble with a few others. I found a spot where they had made a var yearsPlaceHolders, which did not include all the years. After putting all the years in, it works for everything. Thanks for the help: I’d probably never have found this!

1 Like