From 6f2dd5af3f486a9e743b0884bad3573df4136271 Mon Sep 17 00:00:00 2001 From: Ben Best Date: Mon, 20 Nov 2023 10:30:08 -0500 Subject: [PATCH] =?UTF-8?q?=E2=88=86=20diagrams?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _output/sdm-process.html | 185 ++++++++++--------------- _quarto.yml | 3 +- {figures => diagrams}/mermaid-test.mmd | 0 diagrams/mosaic-hierarchy.mmd | 15 ++ {figures => diagrams}/sdm-model.mmd | 33 +++-- {figures => diagrams}/sdm-prep.mmd | 32 +++-- sdm-process.qmd | 61 +------- 7 files changed, 132 insertions(+), 197 deletions(-) rename {figures => diagrams}/mermaid-test.mmd (100%) create mode 100644 diagrams/mosaic-hierarchy.mmd rename {figures => diagrams}/sdm-model.mmd (55%) rename {figures => diagrams}/sdm-prep.mmd (52%) diff --git a/_output/sdm-process.html b/_output/sdm-process.html index 436de50..a6731f7 100644 --- a/_output/sdm-process.html +++ b/_output/sdm-process.html @@ -83,11 +83,11 @@ - + - + @@ -131,32 +131,45 @@

Table of contents

1 Data Prep

-
+
-
+
-
flowchart LR
+
flowchart LR
 
+  %% nodes
   P(presence):::in
-  A(absence):::in
+  A("pseudo-absence"):::in
   pts(obs):::out
   X[/extract/]:::fxn
   env(env):::in
-  tbl[[tbl]]:::out
-  
+  D[[data]]:::out
+
+  %% edges
   P   --> pts
   A   --> pts
   pts --> X
   env --> X
-  X   --> tbl
-  
+  X   --> D
+
+  %% Legend
+  in(input):::in
+  fxn[/process/]:::fxn
+  out(output):::out
+  subgraph Legend
+    in
+    fxn
+    out
+  end
+
+  %% styles
   classDef in  fill:lightblue
   classDef out fill:lightgreen
   classDef fxn fill:yellow
 
-
Figure 1: Diagram of SDM data preparation.
+
Figure 1: Diagram of SDM data preparation for model fitting.
@@ -181,14 +194,15 @@

3 Model

-
+
-
+
-
flowchart LR
+
flowchart LR
 
-  tbl[[tbl]]:::in
+  %% nodes
+  D[[data]]:::in
   S[/split/]:::fxn
   t1[[train]]:::out
   t2[[test]]:::out
@@ -200,25 +214,27 @@ 

@@ -349,7 +365,7 @@

## Data Prep ```{mermaid} -%%| label: fig-sdm-prep -%%| fig-cap: "Diagram of SDM data preparation." -flowchart LR - - P(presence):::in - A(absence):::in - pts(obs):::out - X[/extract/]:::fxn - env(env):::in - tbl[[tbl]]:::out - - P --> pts - A --> pts - pts --> X - env --> X - X --> tbl - - classDef in fill:lightblue - classDef out fill:lightgreen - classDef fxn fill:yellow -``` - -## definitions - -- **obs\ - **observations: occurrences from OBIS; masked by FAO regions defined by AquaMaps [@aquamapsdata] - - **presence**\ - OBIS: species occurrence - - **absence**\ - OBIS not-species, but same family -- **env\ - **environment -- **tbl**\ - table of observations (presence and absence) with environmental values - -## Model - -```{mermaid} -%%| label: fig-linux-kernel -%%| fig-cap: "Diagram of SDM Modeling processes." - -flowchart LR - - tbl[[tbl]]:::in - S[/split/]:::fxn - t1[[train]]:::out - t2[[test]]:::out - F[/fit/]:::fxn - M{{model}}:::out - E[/evaluate/]:::fxn - C[/calibrate/]:::fxn - P[/predict/]:::fxn - N[["new data"]]:::in - prd(prediction):::out - prf(performance):::out - - tbl --> S - S --> t1 - S --> t2 - t1 --> F - F --> M - t2 --> E - M --> C - C --> F - M --> P - N --> P - M --> E - P --> prd - E --> prf - - classDef in fill:lightblue - classDef out fill:lightgreen - classDef fxn fill:yellow - -%% source: https://bbest.github.io/eds232-ml/lab1d_sdm-evaluate.html -``` - -\ +%%| label: fig-prep +%%| fig-cap: "Diagram of SDM data preparation for model fitting." +%%| file: diagrams/sdm-prep.mmd +``` + +## definitions + +- **obs\ + **observations: occurrences from OBIS; masked by FAO regions defined by AquaMaps [@aquamapsdata] + - **presence**\ + OBIS: species occurrence + - **absence**\ + OBIS not-species, but same family +- **env\ + **environment +- **tbl**\ + table of observations (presence and absence) with environmental values + +## Model + +```{mermaid} +%%| label: fig-model +%%| fig-cap: "Diagram of SDM Modeling processes." +%%| file: diagrams/sdm-model.mmd +``` + +\

diff --git a/_quarto.yml b/_quarto.yml index 1478244..fcd083c 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -13,8 +13,7 @@ format: mermaid: theme: neutral theme: - dark: darkly light: flatly - + dark: darkly search: false diff --git a/figures/mermaid-test.mmd b/diagrams/mermaid-test.mmd similarity index 100% rename from figures/mermaid-test.mmd rename to diagrams/mermaid-test.mmd diff --git a/diagrams/mosaic-hierarchy.mmd b/diagrams/mosaic-hierarchy.mmd new file mode 100644 index 0000000..2340990 --- /dev/null +++ b/diagrams/mosaic-hierarchy.mmd @@ -0,0 +1,15 @@ +gantt + dateFormat YYYY-MM-DD + title Adding GANTT diagram functionality to mermaid + section A section + Completed task :done, des1, 2014-01-06,2014-01-08 + Active task :active, des2, 2014-01-09, 3d + Future task : des3, after des2, 5d + Future task2 : des4, after des3, 5d + section Critical tasks + Completed task in the critical line :crit, done, 2014-01-06,24h + Implement parser and jison :crit, done, after des1, 2d + Create tests for parser :crit, active, 3d + Future task in critical line :crit, 5d + Create tests for renderer :2d + Add to mermaid :1d diff --git a/figures/sdm-model.mmd b/diagrams/sdm-model.mmd similarity index 55% rename from figures/sdm-model.mmd rename to diagrams/sdm-model.mmd index 5687e09..f23fd2b 100644 --- a/figures/sdm-model.mmd +++ b/diagrams/sdm-model.mmd @@ -1,6 +1,7 @@ flowchart LR - tbl[[tbl]]:::in + %% nodes + D[[data]]:::in S[/split/]:::fxn t1[[train]]:::out t2[[test]]:::out @@ -13,20 +14,24 @@ flowchart LR prd(prediction):::out prf(performance):::out - tbl --> S - S --> t1 - S --> t2 - t1 --> F - F --> M - t2 --> E - M --> C - C --> F - M --> P - N --> P - M --> E - P --> prd - E --> prf + %% edges + D --> S + S --> t1 + S --> t2 + t1 --> F + F --> M + t2 --> E + M --> C + C --> F + M --> P + N --> P + M --> E + P --> prd + E --> prf + %% styles classDef in fill:lightblue classDef out fill:lightgreen classDef fxn fill:yellow + +%% source: https://bbest.github.io/eds232-ml/lab1d_sdm-evaluate.html diff --git a/figures/sdm-prep.mmd b/diagrams/sdm-prep.mmd similarity index 52% rename from figures/sdm-prep.mmd rename to diagrams/sdm-prep.mmd index 36246da..80497e1 100644 --- a/figures/sdm-prep.mmd +++ b/diagrams/sdm-prep.mmd @@ -1,30 +1,32 @@ flowchart LR + %% nodes P(presence):::in - - A(absence):::in - + A("pseudo-absence"):::in pts(obs):::out - X[/extract/]:::fxn - env(env):::in + D[[data]]:::out - tbl[[tbl]]:::out - + %% edges P --> pts - A --> pts - pts --> X - env --> X - - X --> tbl - + X --> D + + %% Legend + in(input):::in + fxn[/process/]:::fxn + out(output):::out + subgraph Legend + in + fxn + out + end + + %% styles classDef in fill:lightblue - classDef out fill:lightgreen - classDef fxn fill:yellow diff --git a/sdm-process.qmd b/sdm-process.qmd index fcee3a8..2f7ea88 100644 --- a/sdm-process.qmd +++ b/sdm-process.qmd @@ -5,26 +5,9 @@ title: "SDM Process" ## Data Prep ```{mermaid} -%%| label: fig-sdm-prep -%%| fig-cap: "Diagram of SDM data preparation." -flowchart LR - - P(presence):::in - A(absence):::in - pts(obs):::out - X[/extract/]:::fxn - env(env):::in - tbl[[tbl]]:::out - - P --> pts - A --> pts - pts --> X - env --> X - X --> tbl - - classDef in fill:lightblue - classDef out fill:lightgreen - classDef fxn fill:yellow +%%| label: fig-prep +%%| fig-cap: "Diagram of SDM data preparation for model fitting." +%%| file: diagrams/sdm-prep.mmd ``` ## definitions @@ -43,43 +26,9 @@ flowchart LR ## Model ```{mermaid} -%%| label: fig-linux-kernel +%%| label: fig-model %%| fig-cap: "Diagram of SDM Modeling processes." - -flowchart LR - - tbl[[tbl]]:::in - S[/split/]:::fxn - t1[[train]]:::out - t2[[test]]:::out - F[/fit/]:::fxn - M{{model}}:::out - E[/evaluate/]:::fxn - C[/calibrate/]:::fxn - P[/predict/]:::fxn - N[["new data"]]:::in - prd(prediction):::out - prf(performance):::out - - tbl --> S - S --> t1 - S --> t2 - t1 --> F - F --> M - t2 --> E - M --> C - C --> F - M --> P - N --> P - M --> E - P --> prd - E --> prf - - classDef in fill:lightblue - classDef out fill:lightgreen - classDef fxn fill:yellow - -%% source: https://bbest.github.io/eds232-ml/lab1d_sdm-evaluate.html +%%| file: diagrams/sdm-model.mmd ``` \