Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make some networks showing indices, tropes, and tropes those tropes link to #22

Open
jwzimmer-zz opened this issue Nov 14, 2020 · 5 comments

Comments

@jwzimmer-zz
Copy link
Owner

For the "most important" categories of indices, potentially Narrative https://github.com/jwzimmer/tv-tropes/blob/981946c757caede5ac3a15205d5d53c751f0b116/Narrative-relatedIndicesCentral1000Tropes.gml

and the "main" indices from the website, topical, genre, media, and narrative

@jwzimmer-zz
Copy link
Owner Author

NarrativeTropes, GenreTropes, MediaTropes, TopicalTropes, looking at up to 50 of the top 10000 most central tropes (by all 4 measures) in the index-trope links and in the trope-trope links:
bigfour_all4central_top50_top50

@jwzimmer-zz
Copy link
Owner Author

BigFour_tropes_all4_top10000_top50_top20_theirtropes
The Big Four indices as nodes, plus up to the top 50 tropes they link to as links, plus up to the top 20 tropes those tropes link to as nodes, plus edges between those tropes and any other nodes already in the graph

bigfourindextheirtropestheirtropesttheiredges

@jwzimmer-zz
Copy link
Owner Author

jwzimmer-zz commented Nov 16, 2020

22c89f5
bigfourhairball3

using:

self.masterlist = self.get_json('index-list/index-list.json')
        self.indices = [x for x in self.masterlist.keys()]
        #truncated list for testing things quickly or on a subset of indices
        self.masterlist = {self.indices[i]:self.masterlist[self.indices[i]] for i in range(len(self.masterlist)) if self.indices[i] in ("MediaTropes","NarrativeTropes","TopicalTropes","GenreTropes")}
        self.centraltropes = self.get_most_central_tropes_by_all_4_metrics("top_10000_central.json")
        self.masterlisttropes = self.get_json('all-tropes-with-links.json')
        self.supercat = "BigFour_tropes_all4_top10000_top50_edges_noaddednode"

And edges between:

 def add_trope_nodes(self):
        supercat = self.supercat
        #self.G.add_node(supercat,label=supercat)
        for index in self.masterlist: #add all linked tropes as nodes
            indexlinks = []
            for x in self.masterlist[index]:
                #if x not in indexlinks:
                if x in self.centraltropes:
                    indexlinks.append(x)
                if len(indexlinks) > 50:
                    break
            self.G.add_node(index,label=index)
            for y in indexlinks:
                if y in self.G.nodes:
                    self.G.add_edge(index,y)
            #self.G.add_edge(supercat,index)
            for trope in indexlinks:
                self.G.add_node(trope,label=trope)
                self.G.add_edge(index,trope)
                tropetropelinks = [x for x in self.masterlisttropes[trope] if x in self.centraltropes]
                for tr in tropetropelinks:
                    #self.G.add_node(tr,label=tr)
                    self.G.add_edge(trope, tr)
                    trlinks = self.masterlisttropes[tr]
                    for trl in trlinks:
                        if trl in self.G.nodes:
                            self.G.add_edge(tr, trl)
        self.write_gml(self.G, supercat)
        return None

@jwzimmer-zz
Copy link
Owner Author

a66d9f3
Showing edges between tropes for the big four indices when a trope that index links to, links to another trope one of the indices links to.

@jwzimmer-zz
Copy link
Owner Author

jwzimmer-zz commented Nov 16, 2020

833e687
bigfour_alltropes
bigfour_alltropes

big four indices, showing all tropes they link directly to, and edges whenever those tropes link to each other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant