1 ! Copyright (C) 2016-2017 Alexander Ilin.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: accessors arrays kernel sequences ui.gadgets ;
6 TUPLE: chart < gadget axes ;
8 M: chart pref-dim* drop { 300 300 } ;
10 ! Return the x and y ranges of the visible area.
11 : chart-axes ( chart -- seq )
12 [ dim>> ] [ axes>> ] bi [
18 ! Return the { width height } of the visible area, in pixels.
19 : chart-dim ( chart -- seq ) dim>> ;