Skip to content

Commit 024a365

Browse files
committed
feat: Add organism group data and fix directive defaults
- Adds organism_groups.csv to the data preparation script. - The resistogram directive now correctly defaults to abx=auto and org=auto when no parameters are provided. - Updates dependencies and removes an obsolete test asset.
1 parent 0157944 commit 024a365

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

dist/remark/index.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,10 @@ function remarkResistogram(options) {
126126
const afterText = text.slice(match.index + match[0].length).trim();
127127
const paramsStr = match[1];
128128
const params = parseParams(paramsStr);
129-
const { resolved: antibioticIds, unresolved: unresolvedAbx } = resolveIds(params.abx, sharedData.allAbxIds, sharedData.abxSyn2Id, pageText);
130-
const { resolved: organismIds, unresolved: unresolvedOrg } = resolveIds(params.org, sharedData.allOrgIds, sharedData.orgSyn2Id, pageText);
129+
const abxParam = params.abx ?? "auto";
130+
const orgParam = params.org ?? "auto";
131+
const { resolved: antibioticIds, unresolved: unresolvedAbx } = resolveIds(abxParam, sharedData.allAbxIds, sharedData.abxSyn2Id, pageText);
132+
const { resolved: organismIds, unresolved: unresolvedOrg } = resolveIds(orgParam, sharedData.allOrgIds, sharedData.orgSyn2Id, pageText);
131133
const selectedSource = selectDataSource(params.source, sharedData.sources);
132134
const resistogramNode = {
133135
type: "mdxJsxFlowElement",

example/data/organism_groups.csv

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
id,name_en,name_de,synonyms_en,synonyms_de
2+
enterococci,Enterococci,Enterokokken,enterococcus spp.; enterococcus species,Enterococcus spp.; Enterococcus-Arten
3+
staphylococci,Staphylococci,Staphylokokken,staphylococcus spp.; staphylococcus species,Staphylococcus spp.; Staphylococcus-Arten
4+
cons,Coagulase-negative staphylococci,Koagulase-negative Staphylokokken,coagulase negative staphylococci; CoNS,koagulase negative Staphylokokken; CoNS
5+
staphylococcus-aureus,Staphylococcus aureus,Staphylococcus aureus,S. aureus; Staph aureus; coagulase-positive staphylococcus,S. aureus; koagulase-positiver Staphylococcus
6+
streptococci,Streptococci,Streptokokken,streptococcus spp.; streptococcus species,Streptococcus spp.; Streptococcus-Arten
7+
fermenters,Glucose-fermenting Gram-negative bacilli,Glukose-fermentierende gramnegative Stäbchen,fermenters; enterobacterales,Fermenter; Enterobakterien
8+
nonfermenters,Non-fermenting Gram-negative bacilli,Nicht-fermentierende gramnegative Stäbchen,nonfermenters; non-fermenters; NFGNB,Nicht-Fermenter; NFGNB
9+
enterobakteriaceae,Enterobakteriaceae,Enterobakteriaceae,,

example/package-lock.json

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/prepare-data.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const STATIC_FILES = [
1212
'organisms.csv',
1313
'antibiotic_classes.csv',
1414
'organism_classes.csv',
15+
'organism_groups.csv',
1516
];
1617

1718
async function downloadFile(url, dest) {

tests/01_landing_page.png

-17.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)