-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Category dashboard with collapsible filters #934
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Staged here and left a bunch of feedback: https://technology-report-dot-httparchive.uk.r.appspot.com/reports/techreport/category?geo=ALL&rank=ALL&category=CMS
I had to patch one bug to get it to work (the fix is in one of the comment suggestions) but otherwise these are all just feature requests. Great work!
const bLatest = bSortedDate[0]; | ||
|
||
// Get the correct endpoint & metric | ||
const aMetric = aLatest[sortEndpoint].find(row => row.name === sortMetric); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting an error on this line:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'adoption')
|
||
console.log(sortMetric); | ||
if(sortMetric) { | ||
this.dataArray = this.dataArray.sort((techA, techB) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to work around the error below by filtering out empty arrays before sorting. Not sure if it's the best fix though.
this.dataArray = this.dataArray.sort((techA, techB) => { | |
this.dataArray = this.dataArray.filter(tech => tech.length).sort((techA, techB) => { |
"type": "heading" | ||
}, | ||
{ | ||
"key": "origins", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Values appear as 3222201
which can be harder to read. Could we format with commas, ie 3,222,201
? It'd also be helpful for comparing values if the text in this column is right-aligned, like a spreadsheet.
const sortKey = component.dataset.sortKey; | ||
const client = component.dataset.client; | ||
|
||
console.log(sortMetric); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(sortMetric); |
}); | ||
} | ||
|
||
this.dataArray.forEach(technology => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we talked about pagination before, but I don't remember if we talked about performance improvements to the initial API requests.
So for example if we only want to show the top 10 technologies by default and we can assume that the categories API endpoint lists the technologies in descending popularity order, we could make requests to the other API endpoints with only those first 10 technologies as request params to improve performance a bit.
"type": "heading" | ||
}, | ||
{ | ||
"key": "origins", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Sort techs by date to get the latest | ||
const aSortedDate = techA.sort((a, b) => new Date(b.date) - new Date(a.date)); | ||
const bSortedDate = techB.sort((a, b) => new Date(b.date) - new Date(a.date)); | ||
const aLatest = aSortedDate[0]; | ||
const bLatest = bSortedDate[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Latest" should be the same for all technologies. It's possible for a technology to exist at one point in the dataset and then disappear forever, but this would always compare that ancient technology against the latest versions of all other modern technologies.
For example, October CMS shows up at the top of the top 1k CMS list with 361 origins:
But in the technology drilldown it's clearer that the most recent (and only) data point is from April 2022:
The expected behavior is for it to not appear on the Category page at all since it's not part of the latest dataset. That might also be a good reason to explicitly have a label like Latest data: 2024-11-01
at the top of this report, similar to the others.
@@ -1,18 +1,18 @@ | |||
<div class="tech-selector-group" data-tech="{{ name }}"> | |||
<div class="content"> | |||
<div class="categories-selector-group"> | |||
<!-- <div class="categories-selector-group"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This HTML is commented out. Should it be removed?
<label for="categories_selector" class="tech">Category</label> | ||
<div class="tech-input-wrapper"> | ||
{% set category_selected = tech_report_page.filters.category or tech_report_config.default_category %} | ||
<select name="categories" class="tech" data-selected="{{ category_selected }}" id="categories_selector"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm finding the native<select>
hard to use for such long lists of options. Do you have any thoughts on using a datalist instead? I like having the ability to start typing what I'm looking for and it can match any position in the value, whereas typing in a <select>
only works if it's a prefix match, and the datalist also filters down the results to make it easier to find what you're looking for.
Here's a production example: https://chromestatus.com/metrics/feature/popularity
Maybe something to consider for the technologies inputs too.
{% set table = component.table %} | ||
{% include "techreport/components/table_linked.html" %} | ||
|
||
<a data-name="selected-apps" href="/reports/techreport/tech" class="cta-link">Compare technologies</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New features
/reports/techreport/category
/reports/techreport/tech
Bugfixes