Skip to content

Commit 6c03bae

Browse files
authored
CLEANUP: Tweak theory names, descriptions, and groups. (#249)
1 parent 636cccd commit 6c03bae

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

packages/frontend/src/document/theory_selector.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
cursor: pointer;
3939
}
4040

41-
& .division {
41+
& .group {
4242
display: flex;
4343
flex-direction: column;
4444
gap: 5px;
4545
}
4646

47-
& .division-name {
47+
& .group-name {
4848
font-weight: 600;
4949
padding-bottom: 1px;
5050
opacity: 35%;

packages/frontend/src/document/theory_selector.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,21 @@ export function TheorySelectorDialog(
4949
export function TheorySelector(props: TheorySelectorProps) {
5050
const groupedTheories = createMemo(() => {
5151
const grouped = new Map<string, TheoryMeta[]>();
52-
5352
for (const theory of props.theories.metadata()) {
54-
const category = theory.divisionCategory ?? "Other";
55-
const group = grouped.get(category) || [];
53+
const groupName = theory.group ?? "Other";
54+
const group = grouped.get(groupName) || [];
5655
group.push(theory);
57-
grouped.set(category, group);
56+
grouped.set(groupName, group);
5857
}
59-
60-
return Array.from(grouped.entries()).sort((a, b) => a[0].localeCompare(b[0]));
58+
return Array.from(grouped.entries());
6159
});
6260

6361
return (
6462
<div class="theory-selector">
6563
<For each={groupedTheories()}>
66-
{([category, theories]) => (
67-
<div class="division">
68-
<h4 class="division-name">{category}</h4>
64+
{([group, theories]) => (
65+
<div class="group">
66+
<h4 class="group-name">{group}</h4>
6967
<For each={theories}>
7068
{(meta) => (
7169
<div class="theory">

packages/frontend/src/stdlib/theories.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ stdTheories.add(
2020
id: "simple-olog",
2121
name: "Olog",
2222
description: "Ontology log, a simple conceptual model",
23-
divisionCategory: "Knowledge and Data",
23+
group: "Knowledge and Data",
2424
},
2525
(meta) => {
2626
const thCategory = new catlog.ThCategory();
@@ -61,10 +61,10 @@ stdTheories.add(
6161

6262
stdTheories.add(
6363
{
64-
id: "schema",
64+
id: "simple-schema",
6565
name: "Schema",
6666
description: "Schema for a categorical database",
67-
divisionCategory: "Knowledge and Data",
67+
group: "Knowledge and Data",
6868
},
6969
(meta) => {
7070
const thSchema = new catlog.ThSchema();
@@ -134,8 +134,8 @@ stdTheories.add(
134134
{
135135
id: "reg-net",
136136
name: "Regulatory network",
137-
description: "Signed graphs to model networks",
138-
divisionCategory: "Life Sciences",
137+
description: "Biochemical species that promote or inhibit each other",
138+
group: "Biology",
139139
},
140140
(meta) => {
141141
const thSignedCategory = new catlog.ThSignedCategory();
@@ -202,8 +202,8 @@ stdTheories.add(
202202
{
203203
id: "causal-loop",
204204
name: "Causal loop diagram",
205-
description: "Model cause-and-effect relationships",
206-
divisionCategory: "System Dynamics",
205+
description: "Positive and negative causal relationships",
206+
group: "System Dynamics",
207207
},
208208
(meta) => {
209209
const thSignedCategory = new catlog.ThSignedCategory();
@@ -270,8 +270,10 @@ stdTheories.add(
270270

271271
stdTheories.add(
272272
{
273-
id: "nullable-causal-loop",
274-
name: "Causal loops with indeterminates",
273+
id: "indeterminate-causal-loop",
274+
name: "Causal loop diagram with indeterminates",
275+
description: "Positive, negative, and indeterminate causal relationships",
276+
group: "System Dynamics",
275277
},
276278
(meta) => {
277279
const thNullableSignedCategory = new catlog.ThNullableSignedCategory();
@@ -331,10 +333,10 @@ stdTheories.add(
331333

332334
stdTheories.add(
333335
{
334-
id: "stock-flow",
336+
id: "primitive-stock-flow",
335337
name: "Stock and flow",
336338
description: "Model accumulation (stocks) and change (flows)",
337-
divisionCategory: "System Dynamics",
339+
group: "System Dynamics",
338340
},
339341
(meta) => {
340342
const thCategoryLinks = new catlog.ThCategoryLinks();

packages/frontend/src/stdlib/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ export type TheoryMeta = {
1515
/** Short description of models of theory. */
1616
description?: string;
1717

18-
/** division Category */
19-
divisionCategory?: string;
18+
/** Group to which the theory belongs */
19+
group?: string;
2020
};
2121

2222
/** Library of double theories configured for the frontend.

0 commit comments

Comments
 (0)