Skip to content

Commit

Permalink
$mol_view_tree2 refactor, hyoo-ru/mam_mol#646
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkalica committed Dec 3, 2023
1 parent 4459fe1 commit 5fb0ca9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion life.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ $hyoo_life $mol_page
title @ \the Life Game
plugins /
<= Theme $mol_theme_auto
speed? 0
head /
<= Title
<= Step $mol_button_minor
sub / <= Step_icon $mol_icon_step_forward
click <= step
<= Time $mol_switch
value?val <=> speed?val 0
value? <=> speed_str? \
options *
5 <= Normal $mol_icon_play
1000 <= Fast $mol_icon_fast_forward
Expand Down
4 changes: 4 additions & 0 deletions life.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ namespace $.$$ {
snapshot() {
return this.$.$mol_state_arg.value( 'snapshot' ) ?? super.snapshot()
}

speed_str(next?: string) {
return String(this.speed(next === undefined ? next : Number(next)))
}

step() {
this.speed(0)
Expand Down
3 changes: 2 additions & 1 deletion map/map.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ $hyoo_life_map $mol_plot_pane
gap_vert 0
-
zoom?val 16
scale $mol_vector_2d /
scale $mol_vector_2d<number> /
<= zoom
<= zoom
-
step null
style *
^
backgroundSize <= grid_size \
Expand Down

0 comments on commit 5fb0ca9

Please sign in to comment.