 : between<=> ( value min max -- <=> )
     3dup between? [ 3drop +eq+ ] [ nip > +gt+ +lt+ ? ] if ;
 
-! Drop chunks that are out of bounds, add extra points where needed.
-: (drawable-chunks) ( chunks min max -- chunks )
-    '[ first second _ _ between? ] filter harvest ;
 
 : calc-point-y ( slope y point -- xy ) over [ calc-x ] dip 2array ;
 

        right rest-slice swap suffix
    ] if ;

! Split data into chunks to be drawn within the [ymin,ymax] limits.
! Return the (empty?) sequence of chunks, possibly with some new
! points at ymin and ymax at the gap bounds.

! Copyright (C) 2016-2017 Alexander Ilin.

USING: accessors arrays binary-search charts combinators
combinators.short-circuit fry kernel locals make math math.order
math.statistics math.vectors namespaces opengl opengl.gl
sequences specialized-arrays.instances.alien.c-types.float
splitting.monotonic ui.gadgets ui.render ;
IN: charts.lines

