<commit_before>! Copyright (C) 2016-2017 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays kernel sequences ui.gadgets ;
IN: ui.gadgets.charts

TUPLE: chart < gadget axes ;

M: chart pref-dim* drop { 300 300 } ;

! Return the x and y ranges of the visible area.
: chart-axes ( chart -- seq )
    [ dim>> ] [ axes>> ] bi [
        nip
    ] [
        [ 0 swap 2array ] map
    ] if* ;

! Return the { width height } of the visible area, in pixels.
: chart-dim ( chart -- seq ) dim>> ;

! There are several things to do to present data on the screen.
! Map the data coordinates to the screen coordinates.
! Cut off data outside the presentation window. When cutting off vertically, split the line into segments and add new points if necessary. Return an array of line segments.
! Remove redundant points from the drawing pass.
<commit_msg>ui.gadgets.charts: delete some obsolete implementation comments<commit_after>! Copyright (C) 2016-2017 <NAME>.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays kernel sequences ui.gadgets ;
IN: ui.gadgets.charts

TUPLE: chart < gadget axes ;

M: chart pref-dim* drop { 300 300 } ;

! Return the x and y ranges of the visible area.
: chart-axes ( chart -- seq )
    [ dim>> ] [ axes>> ] bi [
        nip
    ] [
        [ 0 swap 2array ] map
    ] if* ;

! Return the { width height } of the visible area, in pixels.
: chart-dim ( chart -- seq ) dim>> ;

{'fraction_non_alphanumeric': 0.10677618069815195, 'fraction_numerical': 0.02190280629705681, 'mean_word_length': 2.972826086956522, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '233372', 'n_tokens_mistral': 483, 'n_tokens_neox': 439, 'n_words': 188}