-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add filter information to readme and metadata (#4229)
When using the download API, add information about active filters to the metadata and readme.
- Loading branch information
Showing
8 changed files
with
71 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { pick } from "@ourworldindata/utils" | ||
import { GRAPHER_QUERY_PARAM_KEYS } from "@ourworldindata/types" | ||
|
||
export function getGrapherFilters( | ||
searchParams: URLSearchParams | ||
): Record<string, string> | undefined { | ||
const params = searchParams.size | ||
? Object.fromEntries(searchParams) | ||
: undefined | ||
if (!params) return undefined | ||
// delete url query params that the download api uses but that are not related to grapher | ||
delete params.v1 | ||
delete params.csvType | ||
delete params.useColumnShortNames | ||
return pick(params, GRAPHER_QUERY_PARAM_KEYS) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
{ | ||
"name": "owid-functions", | ||
"type": "module", | ||
"dependencies": { | ||
"@ourworldindata/grapher": "workspace:^", | ||
"@ourworldindata/utils": "workspace:^", | ||
"itty-router": "^5.0.17", | ||
"littlezipper": "^0.1.4", | ||
"stripe": "^14.20.0", | ||
"svg2png-wasm": "^1.4.1" | ||
}, | ||
"devDependencies": { | ||
"@cloudflare/workers-types": "^4.20240919.0" | ||
} | ||
"name": "owid-functions", | ||
"type": "module", | ||
"dependencies": { | ||
"@ourworldindata/grapher": "workspace:^", | ||
"@ourworldindata/types": "workspace:^", | ||
"@ourworldindata/utils": "workspace:^", | ||
"itty-router": "^5.0.17", | ||
"littlezipper": "^0.1.4", | ||
"stripe": "^14.20.0", | ||
"svg2png-wasm": "^1.4.1" | ||
}, | ||
"devDependencies": { | ||
"@cloudflare/workers-types": "^4.20240919.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters