Skip to content

Commit

Permalink
fix: various typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonestla committed Oct 24, 2023
1 parent 2f21fbb commit e72848a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/src/pages/home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default function Home() {
)}
</Row>
{formDatasource === 'openalex'
&& formType != 'structure'
&& formType !== 'structure'
&& (isCountriesFetching ? (
<Container>
<PageSpinner />
Expand Down
6 changes: 3 additions & 3 deletions client/src/utils/graphUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export const graphEncodeToJson = (data) => {
data.nodes.forEach((node) => {
items.push({
id: node.key,
label: node.attributes?.label,
label: node.attributes?.name,
cluster: (node.attributes?.community ?? 0) + 1,
weights: { Works: node.attributes?.weight, Topics: node?.attributes?.topics.length },
scores: { 'Topics/work ': (node.attributes?.topics.length ?? 0) / (node.attributes?.weight || 1) },
weights: { Publications: node.attributes?.weight, Coauthors: node?.attributes?.degree },
scores: { 'Coauthors/publication ': (node.attributes?.degree ?? 0) / (node.attributes?.weight || 1) },
});
});

Expand Down
4 changes: 1 addition & 3 deletions client/src/utils/publicationUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export function publicationsGetTopicsCount(publications, publicationsIds, limit

// Count topics
publicationsIds.forEach((publicationId) => (
publications[publicationId]?.topics.forEach(({ label }) => {
publications[publicationId]?.topics?.forEach(({ label }) => {
topics[label] = topics[label] + 1 || 1;
})));

Expand All @@ -12,8 +12,6 @@ export function publicationsGetTopicsCount(publications, publicationsIds, limit

if (numberOfTopics === 0) return [];

console.log('topics: ', topics);

// Get max topics
const endSlice = limit > 0 ? limit : numberOfTopics;
const topTopics = Object.assign(
Expand Down

0 comments on commit e72848a

Please sign in to comment.