Open senderle opened 7 years ago
Hmm, I'm curious about this as well. Are you saying that you might want to add additional graphs to this same repository? I guess I was picturing one repo per graph, but I suppose what you are suggesting makes more sense.
If we are trying to display more than one graph in this repo, we could set this up as an actual web app that has routing, etc.
@senderle, Can you clarify what you mean by an html fragment?
So a fragment is the thing that comes after the #
symbol, if there is one. Normally to insert URL params we'd have to do routing as you suggest, but since things after the #
don't affect the route, we can use it to pass params! Some stuff about the JS is here:
http://stackoverflow.com/questions/298503/how-can-you-check-for-a-hash-in-a-url-using-javascript
Oh, lol, yeah OK. A URL fragment. Sorry!
Oh, OK. I see what you're saying. We want to be able to display separate graphs with some basic routing, but rather than having multiple json files that each contain a different graph, you want to be able to have a single json file that contains information for all graphs. Is that correct?
Pretty close -- I was actually thinking of allowing the json files to be separate, but that's the basic idea. So you could have two json files: topics.json
and books.json
. To view the topic network, you'd pass a url like
And to view the books network
And the JS would look for topics.json
in the first case, or books.json
file in the second. And maybe also topics-settings.json
? Not as sure about that...
OK, I see what you're saying. I like this idea. I found a resource for how to load multiple json
files using Queue.js.
I'm hesitant about the topics-settings.json
file that you are proposing as well. I think it's too abstract to plan for right now, and I'd need to see what we have in action before we decided to add that. Or at least, I'd need to do a bit more research.
Do you have an idea of what it would look like?
Not specifically. Right now, a couple of settings are specified in graph.json
I think -- directed
is one. (If you change directed
to false, the graph arrows disappear, and links are drawn as lines instead of arcs.)
But I agree -- we can come back to that later. Meanwhile, see #7 and #6! I wanted to test before merging but it was easiest just to use github pages. Eventually I ought to just give you direct access to the repo! But like you said, this is good practice. (I need it too!) I wonder if it's possible to do a PR into a new branch... otherwise, I'm not sure how I'm supposed to independently test code before merging?
Like the new label font styling. Feel free to fiddle with colors too -- I don't particularly like these ones but I found them legible and eventually gave up tweaking.
Since I'm pushing to your repo, you should be able to pull down my branch locally, and then test it there.
When you go to my PR, you'll see the name of the branch. Copy it, then in your terminal run git pull <name of branch>
. Run the server, and test.
If you're still unsure, let me know and I will walk you through it.
Ah, got it! I underestimated git's intelligence in such matters.
S On Thu, Feb 23, 2017 at 2:05 PM Mae Capozzi notifications@github.com wrote:
Since I'm pushing to your repo, you should be able to pull down my branch locally, and then test it there.
When you go to my PR, you'll see the name of the branch. Copy it, then in your terminal run git pull
. Run the server, and test. If you're still unsure, let me know and I will walk you through it.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/senderle/c18topics/issues/4#issuecomment-282088414, or mute the thread https://github.com/notifications/unsubscribe-auth/AED187B7uCEUxa6oCPLO5EeqNcmIF_TKks5rfdiJgaJpZM4MIbuN .
-- Jonathan Scott Enderle Digital Humanities Specialist Librarian University of Pennsylvania Libraries Van Pelt 554 | 215.898.4836 | scott.enderle@gmail.com
Right now, we just pull a static
graph.json
file. But it would be cool if instead, we could specify a data file dynamically, say, using an html fragment? That way, instead of having to create five folders to create five graphs, we could have just one folder with five different graphs.Since different graphs might have subtly different settings, we might also want to pull out a settings json file? We could also have the settings stored inside the graph json file, but that seems too tightly coupled to me.