charts.lines: add fix-left-chunk and fix-right-chunk
parent
48304ce5b5
commit
5c0fa9c94e
|
@ -130,6 +130,36 @@ ALIAS: y second
|
||||||
left-point y right-point y > [ swap ] when 2array
|
left-point y right-point y > [ swap ] when 2array
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
|
:: fix-left-chunk ( left right ymin ymax -- left' )
|
||||||
|
left last :> left-point right first :> right-point
|
||||||
|
left-point y { [ ymin = ] [ ymax = ] } 1|| [
|
||||||
|
left
|
||||||
|
] [
|
||||||
|
left-point y right-point y < ymin ymax ? :> y-coord
|
||||||
|
left-point x right-point x = [
|
||||||
|
left-point x y-coord 2array
|
||||||
|
] [
|
||||||
|
left-point right-point calc-line-slope
|
||||||
|
y-coord left-point calc-point-y
|
||||||
|
] if
|
||||||
|
left but-last-slice swap suffix
|
||||||
|
] if ;
|
||||||
|
|
||||||
|
:: fix-right-chunk ( left right ymin ymax -- right' )
|
||||||
|
left last :> left-point right first :> right-point
|
||||||
|
right-point y { [ ymin = ] [ ymax = ] } 1|| [
|
||||||
|
right
|
||||||
|
] [
|
||||||
|
left-point y right-point y < ymin ymax ? :> y-coord
|
||||||
|
left-point x right-point x = [
|
||||||
|
right-point x y-coord 2array
|
||||||
|
] [
|
||||||
|
left-point right-point calc-line-slope
|
||||||
|
y-coord left-point calc-point-y
|
||||||
|
] if
|
||||||
|
right rest-slice swap suffix
|
||||||
|
] if ;
|
||||||
|
|
||||||
! Split data into chunks to be drawn within the [ymin,ymax] limits.
|
! Split data into chunks to be drawn within the [ymin,ymax] limits.
|
||||||
! Return the (empty?) sequence of chunks, possibly with some new
|
! Return the (empty?) sequence of chunks, possibly with some new
|
||||||
! points at ymin and ymax at the gap bounds.
|
! points at ymin and ymax at the gap bounds.
|
||||||
|
|
Loading…
Reference in New Issue