package hardcaml_waveterm
A terminal based digital waveform viewer for Hardcaml
Install
Dune Dependency
Authors
Maintainers
Sources
hardcaml_waveterm-v0.14.0.tar.gz
sha256=6651b37191cfb0f7744be383a79f5906415cb9ca77b6809c4fce075964bfda6d
md5=f43ed06620989b92f4a5a4a2024c1866
doc/src/hardcaml_waveterm.interactive/draw_notty.ml.html
Source file draw_notty.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
open! Import include Draw.In_memory let to_colour = function | Draw.Style.Black -> Notty.A.black | Red -> Notty.A.red | Green -> Notty.A.green | Yellow -> Notty.A.yellow | Blue -> Notty.A.blue | Magenta -> Notty.A.magenta | Cyan -> Notty.A.cyan | White -> Notty.A.white ;; let styling (st : Draw.Style.t) = let bg' = to_colour st.bg in let fg' = to_colour st.fg in if st.bold then Notty.A.(bg bg' ++ fg fg' ++ st bold) else Notty.A.(bg bg' ++ fg fg') ;; let to_image ctx = let cols, rows = cols ctx, rows ctx in let bounds = { Draw.r = 0; c = 0; w = cols; h = rows } in Notty.I.tabulate cols rows (fun c r -> let p, st = get ~ctx ~bounds ~r ~c in Notty.I.uchar (styling st) (Uchar.of_scalar_exn p) 1 1) ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>