{"size": 2118, "ext": "scrbl", "max_stars_repo_path": "gamble/scribblings/viz.scrbl", "max_stars_repo_name": "lambdageek/prob", "max_stars_repo_stars_event_min_datetime": "2015-02-12T00:29:59.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-03T02:36:47.000Z", "max_issues_repo_path": "gamble/scribblings/viz.scrbl", "max_issues_repo_name": "lambdageek/prob", "max_issues_repo_issues_event_min_datetime": "2015-02-05T17:43:25.000Z", "max_issues_repo_issues_event_max_datetime": "2021-04-14T15:02:32.000Z", "max_forks_repo_path": "gamble/scribblings/viz.scrbl", "max_forks_repo_name": "lambdageek/prob", "max_forks_repo_forks_event_min_datetime": "2015-02-26T18:57:13.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-14T14:56:46.000Z"}
{"max_stars_count": 35, "max_issues_count": 13, "max_forks_count": 10, "avg_line_length": 28.6216216216, "max_line_length": 71, "alphanum_fraction": 0.6718602455}
;; Copyright (c) 2014 Ryan Culpepper
;; Released under the terms of the 2-clause BSD license.
;; See the file COPYRIGHT for details.

#lang scribble/doc
@(require scribble/manual
          scribble/basic
          scribble/eval
          (for-label racket/contract
                     racket/class
                     (except-in pict table)
                     (only-in plot/pict plot)
                     (except-in plot plot density)
                     gamble
                     gamble/viz
                     gamble/viz/multi))

@(define the-eval (make-base-eval))
@(the-eval '(require gamble (only-in gamble/viz [hist-pict hist])))
@(the-eval '(random-seed 1))

@title[#:tag "viz"]{Visualization Utilities}

@defmodule[gamble/viz]

This module provides very basic utilities for visualizing data. For
more flexible and comprehensive visualization support, see the
@racketmodname[plot] library.

@defproc[(hist [vals (listof any/c)])
         @#,elem{display}]{

Plots a histogram of @racket[vals].

@examples[#:eval the-eval
(hist (list 1 2 3 1 1))
]
}

@section[#:tag "viz-multi"]{Multiple Visualizations}

@defmodule[gamble/viz/multi]

@definterface[multi-viz<%> ()]{

Interface for displays capable of showing and navigating among
multiple visualizations. Currently all visualizations must be
represented as picts (@racket[pict?]). See the
@racketmodname[pict] and @racketmodname[plot/pict] libraries for
high-level pict constructors, and see the low-level @racket[dc] pict
constructor for a way of creating a pict from a drawing procedure.

@defmethod[(add-pict [p pict?]) void?]{

Adds @racket[p] to the end of the sequence of visualizations.
}
}

@defproc[(make-multi-viz-frame [#:label label string? "Visualization"])
         (is-a?/c multi-viz<%>)]{

Creates a frame that can show multiple visualizations. Add
visualizations with the @method[multi-viz<%> add-pict] method.

@racketblock[
(require @#,(racketmodname pict) @#,(racketmodname plot/pict))
(define mv (make-multi-viz-frame))
(send mv add-pict (plot (function sin (- pi) pi)))
(send mv add-pict (circle 400))
]
}

@(close-eval the-eval)
