Skip to content

Commit

Permalink
Merge pull request #18 from nbonfils/work-nodes
Browse files Browse the repository at this point in the history
Add works as metadata nodes
  • Loading branch information
nbonfils committed Dec 17, 2023
2 parents 4e01426 + af013f7 commit a5930c6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,12 @@ <h2>Filters</h2>
<h4 x-text="field"></h4>
<div>
Keep the <strong x-text="filter.counts[filter.value]"></strong>
<span x-text="field"></span> occurring in at
least <strong x-text="filter.lowerBounds[filter.value]"></strong> records
<span x-text="field"></span>
<span x-show="field !== 'works'">occurring in at least</span>
<span x-show="field === 'works'">with at least</span>
<strong x-text="filter.lowerBounds[filter.value]"></strong>
<span x-show="field !== 'works'">records</span>
<span x-show="field === 'works'">citations</span>
</div>
<div>
<span style="float: left">0</span>
Expand Down
1 change: 1 addition & 0 deletions src/lib/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import forceAtlas2 from 'graphology-layout-forceatlas2';

export const fieldColors = {
refs: '#ebebeb',
works: '#202020',
authors: '#ffe915',
sources: '#a7d30d',
concepts: '#9dabf5',
Expand Down
3 changes: 3 additions & 0 deletions src/lib/processing.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export const processWorks = (works) => {
data.sets[field][work.id] = new Set();
}

data.works[`work-${work.id}`] = {count: work.cited_by_count, label: work.title};
data.sets.works[work.id].add(`work-${work.id}`);

work.referenced_works.forEach((ref) => {
incOrCreate(data.refs, ref, 'count');
data.refs[ref].label = ref;
Expand Down

0 comments on commit a5930c6

Please sign in to comment.