File: parameter-groups.rkt

package info (click to toggle)
racket 7.9%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 178,684 kB
  • sloc: ansic: 282,112; lisp: 234,887; pascal: 70,954; sh: 27,112; asm: 16,268; makefile: 4,613; cpp: 2,715; ada: 1,681; javascript: 1,244; cs: 879; exp: 499; csh: 422; python: 274; xml: 106; perl: 104
file content (142 lines) | stat: -rw-r--r-- 4,080 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#lang racket/base

(module untyped-defs racket/base
  (require "parameters.rkt"
           "parameter-group.rkt")

  (provide (all-defined-out))

  (define-parameter-group plot-axes?
    (plot-x-axis? plot-x-far-axis?
                  plot-y-axis? plot-y-far-axis?
                  plot-z-axis? plot-z-far-axis?))

  (define-parameter-group plot-tick-labels
    (plot-x-tick-labels?
     plot-x-tick-label-anchor
     plot-x-tick-label-angle
     plot-x-far-tick-labels?
     plot-x-far-tick-label-anchor
     plot-x-far-tick-label-angle
     plot-y-tick-labels?
     plot-y-tick-label-anchor
     plot-y-tick-label-angle
     plot-y-far-tick-labels?
     plot-y-far-tick-label-anchor
     plot-y-far-tick-label-angle))

  (define-parameter-group plot-appearance
    (plot-width
     plot-height
     plot-foreground plot-foreground-alpha
     plot-background plot-background-alpha
     plot-line-width plot-tick-size
     plot-font-size plot-font-face plot-font-family
     plot-legend-font-size plot-legend-font-face plot-legend-font-family
     plot-legend-anchor plot-legend-box-alpha plot-legend-layout
     plot-axes? plot-tick-labels
     plot-decorations?
     plot-animating?
     plot-pen-color-map
     plot-brush-color-map
     arrow-head-size-or-scale
     arrow-head-angle))

  (define-parameter-group plot3d-appearance
    (plot3d-samples
     plot3d-angle
     plot3d-altitude
     plot3d-ambient-light
     plot3d-diffuse-light?
     plot3d-specular-light?))

  (define-parameter-group plot-output
    (plot-new-window? plot-jpeg-quality plot-ps/pdf-interactive? plot-ps-setup))

  (define-parameter-group plot-labels
    (plot-title
     plot-x-label plot-y-label plot-z-label
     plot-x-far-label plot-y-far-label plot-z-far-label))

  (define-parameter-group plot-x-axis (plot-x-transform plot-x-ticks plot-x-far-ticks))
  (define-parameter-group plot-y-axis (plot-y-transform plot-y-ticks plot-y-far-ticks))
  (define-parameter-group plot-z-axis (plot-z-transform plot-z-ticks plot-z-far-ticks))
  (define-parameter-group plot-axes (plot-x-axis plot-y-axis plot-z-axis plot-d-ticks plot-r-ticks))

  (define-parameter-group plot-parameters
    (plot-appearance
     plot3d-appearance
     plot-labels
     plot-output
     plot-axes))
  )

(module typed-defs typed/racket/base
  (require typed/racket/draw
           (only-in typed/pict pict)
           (submod ".." untyped-defs)
           "type-doc.rkt"
           "types.rkt"
           "axis-transform.rkt"
           "ticks.rkt")

  (provide Plot-Parameters)

  (deftype Plot-Parameters
    (List
     ;; plot-appearance
     (List
      Positive-Integer
      Positive-Integer
      Plot-Color
      Nonnegative-Real
      Plot-Color
      Nonnegative-Real
      Nonnegative-Real
      Nonnegative-Real
      Nonnegative-Real
      (U False String)
      Font-Family
      (U False Nonnegative-Real)
      (U False String)
      (U False Font-Family)
      Legend-Anchor
      Nonnegative-Real
      Legend-Layout
      (List Boolean Boolean Boolean Boolean Boolean Boolean)
      (List Boolean Anchor Real (U Boolean 'auto) Anchor Real Boolean Anchor Real (U Boolean 'auto) Anchor Real)
      Boolean
      Boolean
      (U Symbol #f)
      (U Symbol #f)
      (U (List '= Nonnegative-Real) Nonnegative-Real)
      Nonnegative-Real)
     ;;plot3d-appearance
     (List Positive-Integer Real Real Nonnegative-Real Boolean Boolean)
     ;;plot-labels
     (List
      (U False String pict)
      (U False String pict)
      (U False String pict)
      (U False String pict)
      (U False String pict)
      (U False String pict)
      (U False String pict))
     ;;plot-output
     (List Boolean Nonnegative-Integer Boolean (Instance PS-Setup%))
     ;;plot-axes
     (List
      (List Axis-Transform ticks ticks)
      (List Axis-Transform ticks ticks)
      (List Axis-Transform ticks ticks)
      ticks
      ticks)))

  (define (test) (ann (plot-parameters) Plot-Parameters)))

(require 'untyped-defs
         'typed-defs)

(provide (all-from-out
          'untyped-defs
          'typed-defs))