Skip to content

Commit

Permalink
added legend to charts
Browse files Browse the repository at this point in the history
  • Loading branch information
remko48 committed Apr 24, 2024
1 parent e29e311 commit 668b02e
Show file tree
Hide file tree
Showing 4 changed files with 297 additions and 122 deletions.
1 change: 1 addition & 0 deletions pwa/src/data/filters/softwareType.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const softwareTypes = [
{ label: "Standalone", value: "standalone" },
{ label: "Standalone Mobile", value: "standalone/mobile" },
{ label: "Standalone IoT", value: "standalone/iot" },
{ label: "Standalone Desktop", value: "standalone/desktop" },
Expand Down
10 changes: 9 additions & 1 deletion pwa/src/services/filtersToQueryParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export const filtersToQueryParams = (filters: any): string => {
case "developmentStatus":
value === "hideObsolete" ? (params += `&developmentStatus[ne]=obsolete`) : (params += `&${key}=${value}`);
break;
case "softwareType":
value === "standalone" ? (params += `&softwareType[regex]=${value}`) : (params += `&${key}=${value}`);
break;
case "componentsCurrentPage":
params += "";
break;
Expand All @@ -27,7 +30,12 @@ export const filtersToQueryParams = (filters: any): string => {
break;
case "ratingCommonground":
window.sessionStorage.getItem("FILTER_RATING") === "Commonground"
? (params += `&embedded.nl.embedded.commonground.rating[>%3D]=${filters.ratingCommonground}`)
? value.includes("exact")
? (params += `&embedded.nl.embedded.commonground.rating[int_compare]=${filters.ratingCommonground.replace(
"exact",
"",
)}`)
: (params += `&embedded.nl.embedded.commonground.rating[>%3D]=${filters.ratingCommonground}`)
: (params += "");
break;
case "isForked":
Expand Down
22 changes: 22 additions & 0 deletions pwa/src/templates/charts/CommongroundChartsTemplate.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,30 @@
display: grid;
grid-template-columns: 1fr 1fr 1fr;
row-gap: var(--web-app-size-xl);
column-gap: var(--web-app-size-md);
}

.chart {
text-align: center;
}

.chartLegendContainer {
display: flex;
gap: var(--web-app-size-md);
align-items: center;
}

.legendTitle {
display: block;
width: 100px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
user-select: none;
}

.legend {
display: flex;
gap: 5px;
text-align: left;
}
Loading

0 comments on commit 668b02e

Please sign in to comment.