Topographic Wetness Index — AI-Hydro HTML Preview demo

Use the HTML Preview panel toolbar: Run Cell, Run All, Restart & Run All, Stop, Clear. Each artifact has its own Python kernel session (variables do not leak to other open previews).

return { message: "Hello from in-iframe JavaScript", twi: 6.75 }
import math
area = 120
slope_degrees = 8
slope_radians = math.radians(slope_degrees)
twi = math.log(area / math.tan(slope_radians))
print(f"TWI = {twi:.3f}")
import matplotlib.pyplot as plt
plt.figure(figsize=(4, 2))
plt.plot([1, 2, 3], [1, 4, 2])
plt.title("Demo plot")
plt.tight_layout()
raise ValueError("Intentional error for demo")
import time
print("Starting long cell…")
time.sleep(30)
print("Done (should not reach if Stop works)")