- createPolarPlot()
Factory method which returns a polar plot component.
- d3callback :
function
Factory method which returns a polar plot component.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
args.center | Array.<number> |
Screen position of plot originin [x,y] order | |
[args.radius] | number |
250 |
radius of plot in pixels |
[args.maxRange] | number |
256 |
Maximum input range |
- createPolarPlot()
- ~plot()
- .drawBlips()
- .drawGrid(n, m)
- .drawCrosshairs()
- .click(callback) ⇒
plot
- .move(callback) ⇒
plot
- .screen2polar(screen) ⇒
Array.<number>
- .polar2screen(polar) ⇒
Array.<number>
- .center(point) ⇒
plot
- .addBlip(classy, range, angle, power) ⇒
plot
- ~plot()
Creates/updates both the blips and grid of the polar plot
Kind: inner method of createPolarPlot
- ~plot()
- .drawBlips()
- .drawGrid(n, m)
- .drawCrosshairs()
- .click(callback) ⇒
plot
- .move(callback) ⇒
plot
- .screen2polar(screen) ⇒
Array.<number>
- .polar2screen(polar) ⇒
Array.<number>
- .center(point) ⇒
plot
- .addBlip(classy, range, angle, power) ⇒
plot
Creates/updates blips on the polar plot.
Kind: static method of plot
Draws a polar grid
Kind: static method of plot
Param | Type | Description |
---|---|---|
n | Integer |
Number of range graduations |
m | Integer |
Number of angle graduations |
Draws polar crosshairs if the range is within the configured maxRange, otherwise clears the crosshairs.
Kind: static method of plot
Sets the callback for handling blips being clicked, and returns the plot object for chaining.
Kind: static method of plot
Param | Type | Description |
---|---|---|
callback | d3callback |
a D3 style event handler |
Sets the callback for handling mouse movement, and returns the plot object for chaining.
Kind: static method of plot
Param | Type | Description |
---|---|---|
callback | function |
A no-argument function to be called. use d3.mouse(this) to obtain the current screen coordinates |
Convert screen coordinates into the coordinates of the input.
Kind: static method of plot
Param | Type | Description |
---|---|---|
screen | Array.<number> |
a two element array holding screen coordinates in [x, y] order |
Convert polar coordinates to screen coordinates.
Kind: static method of plot
Param | Type | Description |
---|---|---|
polar | Array.<number> |
A two element array holding polar coordinates in [a, r] order. Units are the same as the configured input units. |
Sets the screen coordinates of the center of the polar plot and returns the plot object for chaining.
Kind: static method of plot
Param | Type | Description |
---|---|---|
point | Array.<number> |
a point in screen coordinates in [x,y] order. |
Adds a blip to the display using only the required fields.
Kind: static method of plot
Param | Type | Description |
---|---|---|
classy | string |
the CSS class to apply to the blip |
range | number |
the range as a number between 0 and args.maxRange |
angle | number |
the angle as a number between 0 and args.turn |
power | number |
the blips power determines is visual size on the display |
Kind: global typedef
Param | Type | Description |
---|---|---|
data | Object |
the data object |
index | number |
the index of the data |
selection | Object |
the D3 selection |