Skip to content

Commit 6b0d334

Browse files
committed
add potential-triangle.typ and saddle-point.typ converted from LaTeX
fix site build by commenting out CmdPalette in +layout.svelte
1 parent af7ef2e commit 6b0d334

File tree

5 files changed

+76
-4
lines changed

5 files changed

+76
-4
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#import "@preview/cetz:0.3.4": canvas, draw
2+
#import draw: circle, content, line
3+
4+
#set page(width: auto, height: auto, margin: 8pt)
5+
#set text(size: 10pt)
6+
7+
#canvas({
8+
let node_radius = 0.8
9+
let colors = (
10+
"enthalpy": rgb("#FFA500"),
11+
"free-energy": rgb("#008080"),
12+
"entropy": rgb("#00008B").darken(40%),
13+
)
14+
15+
for (name, label, pos) in (
16+
("enthalpy", [$H$\ Enthalpy], (2, 0)),
17+
("free-energy", [$G$\ Free\ Energy], (-2, 0)),
18+
("entropy", [$S$\ Entropy], (0, -3)),
19+
) {
20+
let fill = colors.at(name)
21+
circle(pos, radius: node_radius, fill: fill, name: name, stroke: none)
22+
content(pos, align(center, text(fill: white, label)))
23+
}
24+
25+
for (start, end, name, dir) in (
26+
("enthalpy", "free-energy", "h-g", rtl),
27+
("entropy", "enthalpy", "s-h", btt),
28+
("free-energy", "entropy", "g-s", ltr),
29+
) {
30+
let stroke = 3pt + gradient.linear(dir: dir, colors.at(start), colors.at(end))
31+
line(start, end, stroke: stroke, name: name)
32+
}
33+
34+
for (name, label, anchor) in (
35+
("h-g", [reactivity], "south"),
36+
("s-h", [heat], "west"),
37+
("g-s", [disorder], "east"),
38+
) {
39+
content(name, align(center, label), anchor: anchor, padding: 4pt)
40+
}
41+
})

assets/saddle-point/saddle-point.pdf

96.1 KB
Binary file not shown.

assets/saddle-point/saddle-point.typ

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#import "@preview/plotsy-3d:0.1.0": plot-3d-surface
2+
3+
#set page(width: auto, height: auto)
4+
5+
#let saddle_func(x, y) = x * x - y * y
6+
7+
// Define a color function for the surface
8+
#let color_func(x, y, z, x_lo, x_hi, y_lo, y_hi, z_lo, z_hi) = {
9+
return rgb("#00008B").transparentize(50%)
10+
}
11+
12+
// Define domain and scaling
13+
#let domain_size = 2
14+
#let scale_factor = 0.2
15+
#let (x_scale, y_scale, z_scale) = (0.5, 0.3, 0.15)
16+
#let scale_dim = (x_scale * scale_factor, y_scale * scale_factor, z_scale * scale_factor)
17+
18+
// Plot the 3D surface
19+
#plot-3d-surface(
20+
saddle_func,
21+
color-func: color_func,
22+
subdivisions: 8,
23+
xdomain: (-domain_size, domain_size),
24+
ydomain: (-domain_size, domain_size),
25+
// axis-labels: ($V$, $T$, $F(T,V)$), // Compiler error: Unexpected argument
26+
// axis-step: (1, 1, 2), // Adjust axis steps if needed
27+
// axis-label-size: 1.2em, // Adjust label size if needed
28+
// rotation-matrix: ((-2, 2, 4), (0, -1, 0)), // Optional: Adjust view angle
29+
)

site/deno.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"dev": "deno run -A --node-modules-dir npm:vite dev",
44
"build": "deno run -A --node-modules-dir npm:vite build",
55
"preview": "deno run -A --node-modules-dir npm:vite preview",
6+
"serve": "deno task build && deno task preview",
67
"lint": "deno lint",
78
"fmt": "deno fmt"
89
},

site/src/routes/+layout.svelte

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
import { diagrams } from '$lib'
44
import { repository } from '$root/package.json'
55
import Icon from '@iconify/svelte'
6-
import { CmdPalette } from 'svelte-multiselect'
6+
// import { CmdPalette } from 'svelte-multiselect'
77
import { GitHubCorner } from 'svelte-zoo'
88
import '../app.css'
9+
import type { Snippet } from 'svelte'
10+
911
interface Props {
10-
children?: import('svelte').Snippet
12+
children?: Snippet<[]>
1113
}
12-
1314
let { children }: Props = $props()
1415
1516
let actions = $derived(
@@ -19,7 +20,7 @@
1920
)
2021
</script>
2122

22-
<CmdPalette {actions} placeholder="Go to..." />
23+
<!-- <CmdPalette {actions} placeholder="Go to..." /> -->
2324

2425
<GitHubCorner
2526
href={repository}

0 commit comments

Comments
 (0)