new CrossoverBand(optionsopt)
- Source:
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
lower |
String | function |
<optional> |
"lowpass3"
|
The type of filter for the range below cutoff frequency. See EqBand for more information. |
upper |
String | function |
<optional> |
"highpass3"
|
The type of filter for the range above cutoff frequency. See EqBand for more information. |
format_label |
function |
<optional> |
function (t, x, y, z) { return sprintf("%.2f Hz", x); }
|
The function formatting the handles label. |
options.type |
String | function |
<optional> |
"parametric"
|
The type of the filter.
Possible values are |
options.freq |
Number | Frequency setting. This is an alias for the option |
||
options.gain |
Number | Gain setting. This is an alias for the option |
||
options.q |
Number | Quality setting. This is an alias for the option |
||
options.active |
Boolean |
<optional> |
true
|
Set to |
options.label |
String | The name of the handle. (Defined in ChartHandle) |
||
options.range_x |
function | Object | Callback returning a Range
for the x-axis or an object with options for a Range. This is usually
the |
||
options.range_y |
function | Object | Callback returning a Range
for the y-axis or an object with options for a Range. This is usually
the |
||
options.range_z |
function | Object | Callback returning a Range for the z-axis or an object with options for a Range. (Defined in ChartHandle) |
||
options.mode |
String |
<optional> |
"circular"
|
Type of the handle. Can be one of
|
options.x |
Number |
<optional> |
Value of the x-coordinate. (Defined in ChartHandle) |
|
options.y |
Number |
<optional> |
Value of the y-coordinate. (Defined in ChartHandle) |
|
options.z |
Number |
<optional> |
Value of the z-coordinate. (Defined in ChartHandle) |
|
options.min_size |
Number |
<optional> |
24
|
Minimum size of the handle in px. (Defined in ChartHandle) |
options.max_size |
Number |
<optional> |
100
|
Maximum size of the handle in px. (Defined in ChartHandle) |
options.format_label |
function | Boolean | Label formatting function. Arguments are
|
||
options.preferences |
Array.<String> |
<optional> |
["left", "top", "right", "bottom"]
|
Possible label
positions by order of preference. Depending on the selected |
options.margin |
Number |
<optional> |
3
|
Margin in px between the handle and the label. (Defined in ChartHandle) |
options.z_handle |
Boolean | String |
<optional> |
false
|
If not false, a small handle is drawn at the given position ( |
options.z_handle_size |
Number |
<optional> |
6
|
Size in px of the z-handle. (Defined in ChartHandle) |
options.z_handle_centered |
Number |
<optional> |
0.1
|
Size of the z-handle in center positions. If this options is between 0 and 1, it is interpreted as a ratio, otherwise as a px size. (Defined in ChartHandle) |
options.z_handle_below |
Number |
<optional> |
false
|
Render the z-handle below the normal handle in the DOM. SVG doesn't know CSS attribute z-index, so this workaround is needed from time to time. (Defined in ChartHandle) |
options.x_min |
Number |
<optional> |
Minimum value of the x-coordinate. (Defined in ChartHandle) |
|
options.x_max |
Number |
<optional> |
Maximum value of the x-coordinate. (Defined in ChartHandle) |
|
options.y_min |
Number |
<optional> |
Minimum value of the y-coordinate. (Defined in ChartHandle) |
|
options.y_max |
Number |
<optional> |
Maximum value of the y-coordinate. (Defined in ChartHandle) |
|
options.z_min |
Number |
<optional> |
Minimum value of the z-coordinate. (Defined in ChartHandle) |
|
options.z_max |
Number |
<optional> |
Maximum value of the z-coordinate. (Defined in ChartHandle) |
|
options.show_axis |
Boolean |
<optional> |
false
|
If set to true, additional lines are drawn at the coordinate values. (Defined in ChartHandle) |
options.title |
String |
<optional> |
""
|
A string to be set as title attribute on the main element to be displayed as tooltip. (Defined in Widget) |
options.disabled |
Boolean |
<optional> |
false
|
Toggles the class |
options.visible |
Boolean |
<optional> |
Toggles the class |
|
options.needs_resize |
Boolean |
<optional> |
true
|
Set to true if the resize function shall be called before the next redraw. (Defined in Widget) |
options.dblclick |
Boolean |
<optional> |
400
|
Set a time in milliseconds for triggering double click event. If 0, no double click events are fired. (Defined in Widget) |
options.preset |
String |
<optional> |
Set a preset. This string
gets set as class attribute |
|
options.presets |
Object |
<optional> |
{}
|
An object with available preset
specific options. Refer to |
options.notransitions_duration |
number |
<optional> |
500
|
A time in milliseconds until transitions are activated. (Defined in Widget) |
CrossoverBand is a EqBand with an additional filter.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
Object |
<optional> |
{ }
|
An object containing additional options. |
Extends
Members
_handle :SVGCircular
- Source:
- Inherited From:
The main handle.
Has class .aux-handle
.
Type:
- SVGCircular
_label :SVGText
- Source:
- Inherited From:
The label. Has class .aux-label
.
Type:
- SVGText
_line1 :SVGPath
- Source:
- Inherited From:
The first line. Has class .aux-line .aux-line1
.
Type:
- SVGPath
_line2 :SVGPath
- Source:
- Inherited From:
The second line. Has class .aux-line .aux-line2
.
Type:
- SVGPath
_zhandle :SVGCircular
- Source:
- Inherited From:
The handle for manipulating z axis.
Has class .aux-zhandle
.
Type:
- SVGCircular
element :HTMLDivElement
- Source:
- Overrides:
The main SVG group.
Has class .aux-crossoverband
.
Type:
- HTMLDivElement
filter :Filter
- Source:
- Inherited From:
The filter providing the graphical calculations.
Type:
lower :Filter
- Source:
The filter providing the graphical calculations for the lower graph.
Type:
range_x :Range
- Source:
- Inherited From:
The Range for the x axis.
Type:
range_y :Range
- Source:
- Inherited From:
The Range for the y axis.
Type:
range_z :Range
- Source:
- Inherited From:
The Range for the z axis.
Type:
upper :Filter
- Source:
The filter providing the graphical calculations for the upper graph.
Type:
Methods
addChild(child)
- Source:
- Inherited From:
- See:
Registers a widget as a child widget. This method is used to build up the widget tree. It does not modify the DOM tree.
Parameters:
Name | Type | Description |
---|---|---|
child |
Widget | The child to add. |
Fires:
- Widget#event:child_added
addChildren(a)
- Source:
- Inherited From:
Registers an array of widgets as children.
Parameters:
Name | Type | Description |
---|---|---|
a |
Array.<Widget> | An array of Widgets. |
addEventListener(event, func)
- Source:
- Inherited From:
Register an event handler.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The event descriptor. |
func |
function | The function to call when the event happens. |
allChildren()
- Source:
- Inherited From:
Returns an array of all children.
appendChild(child)
- Source:
- Inherited From:
Appends child.element
to the widget element and
registers child
as a child widget.
Parameters:
Name | Type | Description |
---|---|---|
child |
Widget | The child widget to append. |
appendChildren(children)
- Source:
- Inherited From:
Calls Widget#appendChild for an array of widgets.
Parameters:
Name | Type | Description |
---|---|---|
children |
Array.<Widget> | The child widgets to append. |
delegateEvents(element) → {HTMLElement}
- Source:
- Inherited From:
Delegates all occuring DOM events of a specific DOM node to the widget. This way the widget fires e.g. a click event if someone clicks on the given DOM node.
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLElement | The element all native events of the widget should be bound to. |
Fires:
Returns:
The element
- Type
- HTMLElement
destroy()
- Source:
- Inherited From:
Destroys all event handlers and the options object.
disableTansitions()
- Source:
- Inherited From:
Disable CSS transitions.
dispatchEvent(event, …args)
- Source:
- Inherited From:
Fires an event.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
event |
string | The event descriptor. |
|
args |
* |
<repeatable> |
Event arguments. |
enableDraw()
- Source:
- Inherited From:
Schedules this widget for drawing.
Fires:
enableDrawChildren()
- Source:
- Inherited From:
Enables rendering for all children of this widget.
enableTransitions()
- Source:
- Inherited From:
Enable CSS transitions.
forceHide()
- Source:
- Inherited From:
Hide the widget immediately by applying the class aux-hide
.
Does not call disableDraw().
forceShow()
- Source:
- Inherited From:
Show the widget immediately by applying the class aux-show
.
Does not call enableDraw().
frequencyToGain(freq) → {number}
- Source:
- Inherited From:
Calculate the gain for a given frequency in Hz.
Parameters:
Name | Type | Description |
---|---|---|
freq |
number | The frequency. |
Returns:
The gain at the given frequency.
- Type
- number
get(key)
- Source:
- Inherited From:
Get the value of an option.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The option name. |
getDefault()
- Source:
- Inherited From:
Returns the default value of a given option. If the option does not exist, an exception is thrown.
getOptionType()
- Source:
- Inherited From:
Returns the type of an option. If the given option does not exist, 'undefined' is returned.
getStyle()
- Source:
- Inherited From:
Returns the computed style of this widget's DOM element.
hasEventListeners(event) → {boolean}
- Source:
- Inherited From:
Test if the event descriptor has some handler functions in the queue.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The event desriptor. |
Returns:
True if the event has some handler functions in the queue, false if not.
- Type
- boolean
hidden()
- Source:
- Inherited From:
Returns the current hidden status.
hide()
- Source:
- Inherited From:
Hide the widget. This will result in the class aux-hide
being applied to this widget in the next rendering step.
off(event, fun)
- Source:
- Inherited From:
Removes the given function from the event queue. If it is a native DOM event, it removes the DOM event listener as well.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The event descriptor. |
fun |
function | The function to remove. |
removeChild(child)
- Source:
- Inherited From:
Removes a child widget. Note that this method only modifies the widget tree and does not change the DOM.
Parameters:
Name | Type | Description |
---|---|---|
child |
Widget | The child to remove. |
Fires:
- Widget#event:child_removed
removeChildren(a)
- Source:
- Inherited From:
Removes an array of children.
Parameters:
Name | Type | Description |
---|---|---|
a |
Array.<Widget> | An array of Widgets. |
reset(key)
- Source:
- Inherited From:
Resets an option to its default value.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The option name. |
set(key, value)
- Source:
- Inherited From:
Sets an option.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The option name. |
value |
The option value. |
setOptions(optionsopt)
- Source:
- Inherited From:
Merges a new options object into the existing one, including deep copies of objects. If an option key begins with the string "on" it is considered an event handler. In this case the value should be the handler function for the event with the corresponding name without the first "on" characters.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
Object |
<optional> |
{ }
|
An object containing initial options. |
setStyle()
- Source:
- Inherited From:
Sets a CSS style property in this widget's DOM element.
show()
- Source:
- Inherited From:
Make the widget visible. This will apply the class aux-show
during the next rendering step.
toFront()
- Source:
- Inherited From:
Moves the handle to the front, i.e. add as last element to the containing SVG group element.
toggleHidden()
- Source:
- Inherited From:
Toggle the hidden status. This is equivalent to calling hide() or show(), depending on the current hidden status of this widget.
update(key, value)
- Source:
- Inherited From:
Conditionally sets an option unless it already has the requested value.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The name of the option. |
value |
mixed | The value of the option. |
Fires:
userset(key, value)
- Source:
- Inherited From:
Sets an option by user interaction. Emits the userset
event. The userset
event can be cancelled (if an event handler
returns false
), in which case the option is not set.
Returns true
if the option was set, false
otherwise. If the option was set, it will emit a useraction
event.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The name of the option. |
value |
mixed | The value of the option. |
Fires:
- Base#event:userset
- Base#event:useraction
visibleChildren()
- Source:
- Inherited From:
Returns an array of all visible children.
Events
delegated
- Source:
- Inherited From:
Is fired when an element is delegated.
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLElement | Array | The element which receives all native DOM events. |
old_element |
HTMLElement | Array | The element which previously received all native DOM events. |
destroy
- Source:
- Inherited From:
Is fired when a widget is destroyed.
doubleclick
- Source:
- Inherited From:
Is fired after a double click appeared. Set dblclick
to 0 to
disable click event handling.
Parameters:
Name | Type | Description |
---|---|---|
event |
string | The browsers |
GenericDOMEvents
- Source:
- Inherited From:
Generic DOM events. Please refer to W3Schools for further details.
handlegrabbed
- Source:
- Inherited From:
Is fired when the main handle is grabbed by the user. The argument is an object with the following members:
- x: the actual value on the x axis
- y: the actual value on the y axis
- pos_x: the position in pixels on the x axis
- pos_y: the position in pixels on the y axis
Parameters:
Name | Type | Description |
---|---|---|
positions |
Object | An object containing all relevant positions of the pointer. |
handlereleased
- Source:
- Inherited From:
Is fired when the user releases the main handle. The argument is an object with the following members:
- x: the actual value on the x axis
- y: the actual value on the y axis
- pos_x: the position in pixels on the x axis
- pos_y: the position in pixels on the y axis
Parameters:
Name | Type | Description |
---|---|---|
positions |
Object | An object containing all relevant positions of the pointer. |
hide
- Source:
- Inherited From:
The hide
event is emitted when a widget is hidden and is not rendered anymore.
This happens both with browser visibility changes and also internally when using layout widgets
such as Pager.
initialized
- Source:
- Inherited From:
Is fired when a widget is initialized.
redraw
- Source:
- Inherited From:
The redraw
event is emitted when a widget is redrawn. This can be used
to do additional DOM modifications to a Widget.
resize
- Source:
- Inherited From:
The resize
event is emitted whenever a widget is being resized. This event can
be used to e.g. measure its new size. Note that some widgets do internal adjustments after
the resize
event. If that is relevant, the Widget#resized event can
be used instead.
resized
- Source:
- Inherited From:
The resized
event is emitted after each rendering frame, which was triggered by
a resize event.
set
- Source:
- Inherited From:
The set
event is emitted when an option was set using the Widget#set
method. The arguments are the option name and its new value.
Note that this happens both for user interaction and programmatical option changes.
set_[option]
- Source:
- Inherited From:
Is fired when an option is set.
Parameters:
Name | Type | Description |
---|---|---|
value |
mixed | The value of the option. |
show
- Source:
- Inherited From:
The show
event is emitted when a widget is shown and is being rendered. This is the
counterpart to Widget#hide.
useraction
- Source:
- Inherited From:
- Mixes In:
The useraction
event is emitted when a widget gets modified by user interaction.
The event is emitted for the options x
, y
and z
.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the option which was changed due to the users action. |
value |
mixed | The new value of the option. |
visibility
- Source:
- Inherited From:
Is fired when the visibility state changes. The first argument
is the visibility state, which is either true
or false
.
zchangeended
- Source:
- Inherited From:
Is fired when the user releases the z-handle. The argument is the actual z value.
Parameters:
Name | Type | Description |
---|---|---|
z |
number | The z value. |
zchangestarted
- Source:
- Inherited From:
Is fired when the user grabs the z-handle. The argument is the actual z value.
Parameters:
Name | Type | Description |
---|---|---|
z |
number | The z value. |