Skip to content

Commit

Permalink
add SortButtons component
Browse files Browse the repository at this point in the history
used in /cv to sort repos/papers by date/title/commits/stars/author
update deps + commit hooks
fix chgnet logo in landing page recent section
  • Loading branch information
janosh committed Feb 27, 2024
1 parent c59cd12 commit 5519b7e
Show file tree
Hide file tree
Showing 15 changed files with 261 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ repos:
args: [--ignore-words-list, 'ist,yau,te,manuel', --check-filenames]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.0.0-alpha.0
rev: v9.0.0-beta.1
hooks:
- id: eslint
types: [file]
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,34 @@
"@iconify/svelte": "^3.1.6",
"@rollup/plugin-yaml": "^4.1.2",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.5.0",
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"@sveltejs/kit": "^2.5.1",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"devalue": "^4.3.2",
"elementari": "^0.2.3",
"eslint": "^8.56.0",
"eslint": "^8.57.0",
"eslint-plugin-svelte": "^2.35.1",
"hast-util-from-string": "^3.0.0",
"hast-util-select": "^6.0.2",
"hastscript": "^9.0.0",
"js-yaml": "^4.1.0",
"katex": "^0.16.9",
"mdsvex": "^0.11.0",
"prettier": "^3.2.4",
"prettier-plugin-svelte": "^3.1.2",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.1",
"rehype-autolink-headings": "^7.1.0",
"rehype-katex-svelte": "^1.2.0",
"rehype-slug": "^6.0.0",
"remark-math": "3.0.0",
"svelte": "^4.2.9",
"svelte-check": "^3.6.3",
"svelte": "^4.2.12",
"svelte-check": "^3.6.4",
"svelte-multiselect": "^10.2.0",
"svelte-preprocess": "^5.1.3",
"svelte-preprocess-import-assets": "^1.1.0",
"svelte-zoo": "^0.4.10",
"svelte2tsx": "^0.7.0",
"svelte2tsx": "^0.7.1",
"typescript": "^5.3.3",
"vite": "^5.0.12"
"vite": "^5.1.4"
}
}
2 changes: 1 addition & 1 deletion src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ declare module '*cv.yml' {
education: types.Education[]
skills: types.Skill[]
hobbies: types.Hobby[]
nationality: string[]
nationality: { title: string; icon: string }[]
languages: types.Language[]
volunteer: types.Volunteer[]
awards: types.Award[]
Expand Down
5 changes: 5 additions & 0 deletions src/lib/Footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@
border-radius: 50%;
transform: scale(1.4);
}
@media print {
:is(button, footer) {
display: none;
}
}
</style>
50 changes: 50 additions & 0 deletions src/lib/SortButtons.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<script lang="ts">
export let label: string = `Sort by`
export { className as class }
export let sort_by: string | undefined = undefined
export let sort_keys: readonly string[] = []
export let sort_order: 'asc' | 'desc' = `asc`
export let as: string = `small`
export let style: string | null = null
let className: string | null = null
</script>

<svelte:element this={as} class="sort-buttons {className}" {style}>
{label}
{#each sort_keys as key}
<button on:click={() => (sort_by = key)} class:active={sort_by === key}>
{key}
</button>
{/each}
<button on:click={() => (sort_order = sort_order === `asc` ? `desc` : `asc`)}>
{sort_order === `asc` ? `↑` : `↓`}
</button>
</svelte:element>

<style>
.sort-buttons {
display: flex;
gap: 2pt;
position: absolute;
right: 0;
bottom: 4pt;
font-weight: 100;
font-size: 9pt;
}
.sort-buttons button {
font-size: 9pt;
padding: 1pt 2pt;
border: none;
color: gray;
background-color: #f0f0f0;
}
.sort-buttons button.active {
background-color: #e0e0e0;
}
@media print {
.sort-buttons {
display: none;
}
}
</style>
1 change: 1 addition & 0 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export { default as DocsGrid } from './DocsGrid.svelte'
export { default as Footer } from './Footer.svelte'
export { default as Nav } from './Nav.svelte'
export { default as SortButtons } from './SortButtons.svelte'

export type * from './types'
44 changes: 23 additions & 21 deletions src/lib/oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ projects:
- Python
- Cython
- Jupyter Notebook
stars: 1257
commits: 931
stars: 1266
commits: 948
- name: Matbench Discovery
url: https://matbench-discovery.materialsproject.org
logo: https://janosh.github.io/matbench-discovery/favicon.svg
img_style: 'filter: invert(1);'
repo: https://github.com/janosh/matbench-discovery
paper: riebesell_matbench_2023
Expand All @@ -24,11 +25,12 @@ projects:
- TypeScript
- JavaScript
- HTML
stars: 52
commits: 308
stars: 57
commits: 315
- name: CHGNet
url: https://chgnet.lbl.gov
repo: https://github.com/CederGroupHub/chgnet
logo: https://chgnet.lbl.gov/favicon.svg
role: Maintainer
paper: deng_chgnet_2023
description: Pretrained universal neural network potential for charge-informed atomistic modeling published on the Sep 2023 cover of NMI.
Expand All @@ -41,16 +43,16 @@ projects:
- HTML
- JavaScript
- TypeScript
stars: 164
commits: 167
stars: 174
commits: 169
- name: MACE
url: https://mace-docs.readthedocs.io
repo: https://github.com/ACEsuit/mace
role: Contributor
paper: riebesell_foundation_2023
description: Fast and accurate machine learning interatomic potentials with higher order equivariant message passing.
logo: https://avatars.githubusercontent.com/u/68508620
stars: 296
stars: 313
commits: 21
languages:
- Python
Expand All @@ -66,7 +68,7 @@ projects:
- Python
- JavaScript
- HTML
stars: 109
stars: 113
commits: 174
- name: pymatviz
url: https://pymatviz.janosh.dev
Expand All @@ -80,8 +82,8 @@ projects:
- TypeScript
- HTML
- JavaScript
stars: 101
commits: 235
stars: 104
commits: 237
- name: Tensorboard Reducer
repo: https://github.com/janosh/tensorboard-reducer
logo: https://raw.githubusercontent.com/janosh/tensorboard-reducer/main/assets/tensorboard-reducer-square.svg
Expand All @@ -98,7 +100,7 @@ projects:
description: Curated list of resources for learning and using normalizing flows, a powerful tool in ML for modeling probability distributions.
languages:
- Python
stars: 1252
stars: 1265
commits: 72
- name: atomate2
repo: https://github.com/materialsproject/atomate2
Expand All @@ -110,8 +112,8 @@ projects:
potential-powered structure relaxation workflows.
languages:
- Python
stars: 113
commits: 349
stars: 116
commits: 353
- name: jobflow
repo: https://github.com/materialsproject/jobflow
role: Maintainer
Expand All @@ -122,7 +124,7 @@ projects:
languages:
- Python
- TeX
stars: 77
stars: 81
commits: 100
- name: Aviary
repo: https://github.com/CompRhys/aviary
Expand All @@ -132,8 +134,8 @@ projects:
pypi: https://pypi.org/project/tensorboard-reducer
languages:
- Python
stars: 36
commits: 233
stars: 38
commits: 234
- name: MatCalc
url: https://materialsvirtuallab.github.io/matcalc
logo: https://github.com/materialsvirtuallab/matcalc/assets/30958850/89486f2f-73fb-40fb-803a-dfafe510eb6d
Expand All @@ -142,8 +144,8 @@ projects:
description: A Python library for calculating materials properties from ML force field potential energy surfaces.
languages:
- Python
stars: 37
commits: 66
stars: 40
commits: 68
- name: TikZ
url: https://tikz.janosh.dev
repo: https://github.com/janosh/tikz
Expand All @@ -165,7 +167,7 @@ projects:
description: Pushing the Pareto front of band gap and permittivity with ML-guided dielectrics discovery incl. experimental synthesis.
logo: https://github.com/janosh/tikz/raw/main/assets/plate-capacitor/plate-capacitor.svg
paper: riebesell_pushing_2024
stars: 6
stars: 7
commits: 12
languages:
- Python
Expand All @@ -181,5 +183,5 @@ projects:
- CSS
- HTML
- JavaScript
stars: 247
commits: 269
stars: 253
commits: 270
2 changes: 1 addition & 1 deletion src/lib/papers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ references:
publisher: arXiv
source: arXiv.org
title: >-
Matbench Discovery -- An evaluation framework for machine learning crystal
Matbench Discovery - An evaluation framework for machine learning crystal
stability prediction
URL: http://arxiv.org/abs/2308.14920

Expand Down
1 change: 1 addition & 0 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,5 @@ export type Membership = {
export type Language = {
name: string
level: string
icon: string
}
15 changes: 11 additions & 4 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const parts = filename.split(`/`).filter((part) => !part.startsWith(`(`)) // remove hidden route segments
const route = `/${parts.slice(1, -1).join(`/`)}`
return { label: route, action: () => goto(route) }
}
},
)
afterNavigate(() => {
Expand All @@ -34,16 +34,18 @@
<CmdPalette {actions} placeholder="Go to..." />

{#if $page.url.pathname !== `/`}
<a href="/" aria-label="Back to index page">&laquo; home</a>
<a href="/" aria-label="Back to index page">&larr; home</a>
{/if}

<slot />

<Footer />
{#if $page.url.pathname !== `/cv`}
<Footer />
{/if}

<style>
a[href='/'] {
font-size: 15pt;
font-size: 14pt;
position: absolute;
top: 2em;
left: 2em;
Expand All @@ -52,4 +54,9 @@
border-radius: 3pt;
transition: 0.2s;
}
@media print {
a[href='/'] {
display: none;
}
}
</style>
12 changes: 6 additions & 6 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
</address>

<p style="max-width: min(40em, 80vw); margin: auto;">
I work on
<a href={mbd?.repo}>πŸ”Ž computational materials discovery</a>,
<a href="https://arxiv.org/abs/2401.00096v1">πŸ€– machine learning</a>,
<a href={pmg?.repo}>πŸ’» software engineering</a>, &
<a href={pmv?.repo}>πŸ“Š data</a> <a href={elementari?.repo}>visualization</a>.<br />
Interested in<br />
<a href={mbd?.repo}>πŸ”Ž computational materials discovery&emsp;</a>
<a href="https://arxiv.org/abs/2401.00096v1">πŸ€– machine learning</a><br />
<a href={pmg?.repo}>πŸ’» software engineering&emsp;</a>
<a href={pmv?.repo}>πŸ“Š data</a> <a href={elementari?.repo}>visualization</a>.
<!-- Outside of work, I enjoy hiking πŸ§— and cycling 🚲. The rougher the terrain, the better! ⛰️ -->
</p>

Expand All @@ -64,7 +64,7 @@
<li>
<h3>
<a href={repo}>
<img src={logo ?? `${mbd?.url}/favicon.svg`} alt={name} />
<img src={logo} alt={name} />
{name}
</a>
<small>[<a href={paper?.URL}>Paper</a>]</small>
Expand Down
Loading

0 comments on commit 5519b7e

Please sign in to comment.