///
import { Eventer } from '@arction/eventer';
import { Record as Record_2 } from 'immutable';
import { Token } from '@arction/eventer';
/**
* Event handler for mouse event that is 'abrupt'.
* Meaning that the event can be triggered as a side-effect of something totally unrelated, without an actual mouse-event.
* ( Designed for making sure that mouse-leave is handled when hovered entity is disposed )
* @param obj - Object
* @param event - Browser MouseEvent that triggered the event of undefined if event is abrupt
* @public
*/
export declare type AbruptMouseEventHandler = (obj: T, event?: MouseEvent) => void;
/**
* @public
*/
declare interface AbstractAxisStrategy {
}
/**
* @public
* @privateRemarks Ideally internal but not feasible; has to be public so it is included in typings but the actual name is still obfuscated in docs and types.
*/
declare class _AbstractAxisTick implements Disposable {
/**
* **Permanently** destroy the component.
*
* To fully allow Garbage-Collection to free the resources used by the component, make sure to remove **any references**
* **to the component and its children** in application code.
* ```javascript
* let chart = ...ChartXY()
* let axisX = chart.getDefaultAxisX()
* // Dispose Chart, and remove all references so that they can be garbage-collected.
* chart.dispose()
* chart = undefined
* axisX = undefined
* ```
* @returns Object itself for fluent interface
* @public
*/
dispose(): this;
}
/**
* End user managed Tick. Custom ticks are just like default ticks, except they can be completely controlled by the end user.
*
* For example, their position, text, text fill style, gridline style, etc. everything can be customized.
* They can be created whenever and destroyed whenever.
*
* This definition of Custom Tick is abstract, meaning that it is not tied to any specific chart type.
* See specific implementations:
*
* - {@link CustomTick}
* - {@link CustomTick3D}
*
* @public
*/
export declare interface AbstractCustomTick extends Disposable, DisposableEvents, Hideable, HideableEvents {
/**
* Set location of custom tick on its Axis.
*
* ```ts
* // Example usage
* CustomTick.setValue(5)
* ```
*
* @param value - Location on axis.
* @returns Object itself
* @public
*/
setValue(value: number): this;
/**
* Get location of custom tick on its Axis.
* @returns Location on axis.
* @public
*/
getValue(): number;
/**
* Set style of custom ticks tickline.
* This line connects the text to its Axis, generally a very short line (6 pixels, or so).
*
* ```ts
* // Example syntax, specify LineStyle
* CustomTick.setTickStyle(new SolidLine({
* thickness: 2,
* fillStyle: new SolidFill({ color: ColorHEX('#F00') })
* }))
* ```
*
* ```ts
* // Example syntax, change thickness only
* CustomTick.setTickStyle((stroke) => new SolidLine({ ...stroke, thickness: 5 }))
* ```
*
* ```ts
* // Example syntax, disable stroke
* CustomTick.setTickStyle(emptyLine)
* ```
*
* @param value - LineStyle or function which returns a LineStyle based on previous value.
* @returns Object itself.
* @public
*/
setTickStyle(value: LineStyle | ImmutableMutator): this;
/**
* Get style of custom ticks tickline.
* @returns LineStyle
* @public
*/
getTickStyle(): LineStyle;
/**
* Set tickline length as pixels.
*
* ```ts
* // Example usage
* CustomTick.setTickLength(5)
* ```
*
* @param length - Tickline length as pixels
* @returns Object itself
* @public
*/
setTickLength(length: number): this;
/**
* Get tickline length as pixels.
* @returns Tickline length as pixels.
* @public
*/
getTickLength(): number;
/**
* Set style of custom ticks gridline.
* This line highlights the tick location under the series area.
*
* ```ts
* // Example syntax, specify LineStyle
* CustomTick.setGridStrokeStyle(new SolidLine({
* thickness: 2,
* fillStyle: new SolidFill({ color: ColorHEX('#F00') })
* }))
* ```
*
* ```ts
* // Example syntax, change thickness only
* CustomTick.setGridStrokeStyle((stroke) => new SolidLine({ ...stroke, thickness: 5 }))
* ```
*
* ```ts
* // Example syntax, disable stroke
* CustomTick.setGridStrokeStyle(emptyLine)
* ```
*
* @param value - LineStyle or function which returns a LineStyle based on previous value.
* @returns Object itself.
* @public
*/
setGridStrokeStyle(value: LineStyle | ImmutableMutator): this;
/**
* Get style of custom ticks gridline.
* @returns LineStyle
* @public
*/
getGridStrokeStyle(): LineStyle;
/**
* Set padding between CustomTick tickline and text.
*
* ```ts
* // Example usage
* CustomTick.setTextPadding(5)
* ```
*
* @param padding - Padding as pixels
* @returns Object itself
* @public
*/
setTextPadding(padding: number): this;
/**
* Get padding between CustomTick tickline and text.
* @returns Padding as pixels
* @public
*/
getTextPadding(): number;
/**
* Set custom tick text rotation as degrees.
*
* ```ts
* // Example usage
* CustomTick.setTextRotation(90)
* ```
*
* @param value - Rotation as degrees.
* @returns Object itself
* @public
*/
setTextRotation(value: number): this;
/**
* Get custom tick text rotation as degrees.
* @returns Rotation as degrees.
* @public
*/
getTextRotation(): number;
/**
* Set fill style of custom ticks text.
*
* ```ts
* // Example syntax, red fill
* CustomTick.setTextFillStyle(new SolidFill({ color: ColorRGBA(255, 0, 0) }))
* ```
*
* ```ts
* // Example syntax, disable fill
* CustomTick.setTextFillStyle(emptyFill)
* ```
*
* @param value - FillStyle or function which returns a FillStyle based on previous value.
* @returns Object itself.
* @public
*/
setTextFillStyle(value: FillStyle | ImmutableMutator): this;
/**
* Get fill style of custom ticks text.
* @returns FillStyle
* @public
*/
getTextFillStyle(): FillStyle;
/**
* Set font of custom ticks text.
*
* ```ts
* // Example syntax, specify FontSettings
* CustomTick.setTextFont(new FontSettings({
* size: 14,
* family: 'Arial',
* weight: 'normal',
* }))
* ```
*
* ```ts
* // Example syntax, change to italic
* CustomTick.setTextFont(font => font.setStyle('italic'))
* ```
*
* To remove custom tick text, use {@link setTextFillStyle}
*
* @param value - FontSettings or function which returns a FontSettings based on previous value.
* @returns Object itself.
* @public
*/
setTextFont(value: FontSettings | ImmutableMutator): this;
/**
* Get font of custom ticks text.
* @returns FontSettings
* @public
*/
getTextFont(): FontSettings;
/**
* Set text formatting of custom tick as a callback function.
*
* ```ts
* // Example usage
* CustomTick.setTextFormatter((value) => `Custom tick at ${value.toFixed(1)}`)
* ```
*
* The supplied callback function is called with the current axis location of the custom tick.
* To provide hard defined text, just ignore the `value`.
*
* ```ts
* // Example, hard defined custom tick text.
* CustomTick.setTextFormatter(() => `My tick text`)
* ```
*
* @param textFormatter - Callback function which returns custom tick text as string.
* @returns Object itself
* @public
*/
setTextFormatter(textFormatter: (value: number) => string): this;
/**
* Subscribe to value change event.
* This event is triggered when {@link setValue} is called.
*
* **Example usage:**
*
*```javascript
* // Set onValueChange event
* CustomTick.onValueChange((_, num) => {
* console.log(num)
* })
*
* // Set customTick value
* CustomTick.setValue(20)
*
* ```
* @param handler - Function that is called when event is triggered.
* @param value - Position of CustomTick.
* @returns Token that can be used to unsubscribe from the event.
* @public
*/
onValueChange(handler: (customTick: this, value: number) => unknown): Token;
/**
* Unsubscribe from value change event.
*
* This event is called whenever the position of the *CustomTick* is changed via **CustomTick.setValue**.
* @param token - Token that was received when the subscription was created.
* @returns True if unsubscription was successful.
* @public
*/
offValueChange(token: Token): boolean;
}
/**
* An abstract event subscription interface.
*
* Can be used just like Eventer, but without the need to specify the event identifier. This is useful, when
* the event interface is injected into a component, and the component doesn't really need to know about the implementation specifics.
* @public
*/
declare interface AbstractEventInterface {
/**
* Subscribe to the abstract event.
* @param listener - Callback function that is called when the event is triggered.
* @returns Token that can be used to unsubscribe from the event.
*/
on: (listener: (args: T) => void) => Token;
/**
* Unsubscribe from the abstract event.
* @param token - Token that was received when **on()** was called.
* @returns True if the listener is successfully removed and false if it is not found.
*/
off: (token: Token) => boolean;
}
/**
* Abstract base class for Point Series 3D implementations.
*
* Implements full series logic except for Point Style API and segment length.
* @public
*/
declare abstract class AbstractPointSeries3D