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

Refactor results page graph tabs data formatting strategies and add analytics call #2196

Merged
merged 5 commits into from
Aug 24, 2021

Conversation

thostetler
Copy link
Member

Adds graph-tab-active [Citations / Reads] GA interaction event for when tab is selected
Implements strategy laid out here: #2194 (comment)

Copy link
Contributor

@romanchyla romanchyla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check my comments next to the citation/reads

return;
const counts = apiResponse.get('facets.citation_count.buckets');

let finalData = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thostetler I'm not sure about this part: facet.limit=2000 will limit results returned to 2000 rows; each of which may contain values >1 -- so at max we'll have 2000 datapoints for the graph, but having less than 2000 should be also OK; padding it to be 2K will make the graph somewhat normalized, but also will shrink it somewhat -- so I'm personally inclined to say no padding is needed.

The numRecords < MAX_RECORDS is not what we should do; It's OK to display 2000 datapoints even though numRecords will grow higher -- unless I'm missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure which facet.limit=2000 I took that part from your original comment.

image

I agree with you, I thought it was unnecessary to reduce the data points, however that was how it was implemented before (

// a cut off of 2000
).
So I just did the same thing again using the new non-pivot incoming data.

I've added a commit that removes that loop and just maps the data directly from solr: 64ca10f

const record = { x: i, y: val };

// create duplicate entries to pad out the array
finalData = finalData.concat(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the same as above, with an additional comment that we should do finalData.push.... to avoid creating the array over and over which would be inefficient

as weird as it sounds, the data coming from solr can be used without modification

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think now it's perfect -- only some failing unittests (if you could please look at those). AFAIK it's in good shape and can be merged. Thanks for the analytics events too.

@thostetler thostetler merged commit f483eb0 into adsabs:master Aug 24, 2021
@thostetler thostetler deleted the update-graph-algos branch August 24, 2021 05:23
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

Successfully merging this pull request may close these issues.

None yet

2 participants