package hardcaml_waveterm
A terminal based digital waveform viewer for Hardcaml
Install
Dune Dependency
Authors
Maintainers
Sources
v0.17.0.tar.gz
sha256=a6780e4310f46cd71ff8a3cdf12bb51afdf0eaea5e84645a148a4ecd0f02920b
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 28
open Base open Hardcaml_waveterm_kernel.Expert 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)"
>