         flip-y-axis
         chart chart-dim first2 [ chart chart-axes first2 ] dip swap
         scale-chunks
-        [ [ draw-line ] each ] unless-empty
+        [ draw-line ] each
     ] [ 2drop ] if ;

!    ] if ; inline

: scale-chunks ( chunks xwidth xmin,xmax yheight ymin,ymax -- chunks' )
    scale-mapper [ scale-mapper ] dip swap
    '[ [ first2 @ swap @ swap 2array ] map ] map ;

PRIVATE>

: draw-line ( seq -- )
    dup [ 1 head-slice* ] over length odd? [ dip ] [ call ] if
    1 tail-slice append
    [ (line-vertices) gl-vertex-pointer GL_LINES 0 ] keep
    length glDrawArrays ;


        dupd [ first ] dip clip-by-first
        dup empty? [ nip ] [
            [ second ] dip [ second-in-bounds? ] keep swap
            [ drop { } ] unless
        ] if
    ] if ;

