This file is indexed.

/usr/share/SuperCollider/HelpSource/Classes/GridLines.schelp is in supercollider-common 1:3.8.0~repack-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
CLASS:: GridLines
summary:: given a spec and the actual data's min and max values, calculates the ideal spacing and labelling of grid lines for plotting
categories:: GUI>Accessories
related:: Reference/plot, Classes/Plotter, Classes/DrawGrid

DESCRIPTION::
GridLines is a strategy object that implements a general strategy for finding a suitable min max range for graphing and suitable intervals for grid lines and labelling.

The object that does the actual drawing on a view is DrawGrid.

A GridLines object uses a ControlSpec to define the minimum and maximum possible values.  Given a data set's actual minimum and maximum values, the GridLines object can choose a logical range for graphing that encompasses the data that will be plotted.  

Future development work will add subclasses of GridLines that can bind more tightly with the data they are representing.  For instance a FreqGridLines (not yet implemented) could apply stronger lines to octave divisions.  A DegreeGridLines could be used to draw pitch degree gridlines behind a frequency plot.

Spec has a .grid variable that points to its preferred GridLines object that should be used for graphing.

code::
\freq.asSpec.grid
::

This default implementation does not know anything about the data is displaying:

code::
DrawGrid.test( nil, \midinote.asSpec.grid );
::

A MidinoteGrid could be written that labels these correctly, shows octaves and individual notes depending on the current zoom.

Note that the GridLines does not know which axis it is to be used on and could also be used in polar plots or in 3D rendering.

CLASSMETHODS::

METHOD:: new

argument:: spec
The ControlSpec that defines the mininum and maximum values, warn and step.

returns:: a GridLines


INSTANCEMETHODS::

METHOD:: spec
get/set the spec

returns:: a ControlSpec

METHOD:: asGrid
return self.  nil.asGrid would return a BlankGridLines which is a subclass of GridLines.  So when plotting if you specify a grid of nil then you will get no lines at all.

returns:: self

METHOD:: niceNum
Based on: http://books.google.de/books?id=fvA7zLEFWZgC&pg=PA61&lpg=PA61
This rounds a value to a logical nice number.  It is mostly used to support internal calculation, though it may be useful for other applications.

argument:: val
The value.

argument:: round
Boolean. Rounding uses a specific algorithm.  This is not simple rounding to an integer value.

returns:: the nice number

METHOD:: ideals
for internal use

argument:: min
(describe argument here)

argument:: max
(describe argument here)

argument:: ntick
(describe argument here)

returns:: (returnvalue)

METHOD:: looseRange
Returns the logical minimum and maximum that will contain the data.

argument:: min
minimum value

argument:: max
maximum value.

argument:: ntick
the number of lines you would like (which usually varies by how much screen space you have and what you consider cluttered)

returns:: [ideal min, ideal max]

METHOD:: getParams
Specifically for use by DrawGrid. This returns a dictionary filled with:
'lines': an array of values where lines should be drawn
'labels': [value, formatted label] for each line 

argument:: valueMin
minimum value of the data to be plotted

argument:: valueMax
maximum value of the data to be plotted

argument:: pixelMin
If numTicks is nil: used to guess the ideal numTicks based on the graph size.

argument:: pixelMax
If numTicks is nil: used to guess the ideal numTicks based on the graph size.

argument:: numTicks
Explicit number of ticks you would like to see on the graph.

returns:: A dictionary

METHOD:: formatLabel
Round the value and append the spec's units

argument:: val
The value

argument:: numDecimalPlaces
Number of decimal places

returns:: a string