Type module
Sources
Items from Utils can be imported/included and used via following ways.
/** * -------------------------------------------------------- * Import via main package: core.ts * Access items like: am5.utils.myVariable * am5.utils.myFunction() * -------------------------------------------------------- */ import * as am5 from "@amcharts/amcharts5"; /** * -------------------------------------------------------- * Import via: Utils.ts * Access items like: $utils.myVariable * $utils.myFunction() * -------------------------------------------------------- */ import * as $utils from "@amcharts/amcharts5/Utils";
/** * -------------------------------------------------------- * Include via "index.js" * E.g.: "https://cdn.amcharts.com/lib/5/index.js" * Access items like: am5.utils.myVariable * am5.utils.myFunction() * -------------------------------------------------------- */
Variables
Utils does not have any variables.
Functions
|
addSpacing( str: ) |
Returns Adds space before each uppercase letter. |
|---|---|
|
alternativeColor( color: ) |
Returns Returns a color which contrasts more with the source |
|
brighten( rgb: ) |
Returns Returns a color that is |
|
capitalizeFirst( text: ) |
Returns |
|
contains( a: ) |
Returns Checks of element |
|
escapeForRgex( value: ) |
Returns Escapes string so it can safely be used in a Regex. |
|
get12Hours( hours: ) |
Returns Returns 12-hour representation out of the 24-hour hours. |
|
getDayFromWeek( week: ) |
Returns Returns a year day out of the given week number. |
|
getEventKey( event: ) |
Returns |
|
getEventTarget( event: ) |
Returns Gets the target of the event, works for shadow DOM too. |
|
getLightnessStep( value: ) |
Returns Gets lightness step. |
|
getMonthWeek( date: ) |
Returns Returns a week number in the month. |
|
getSafeResolution() |
Returns |
|
getShadowRoot( a: ) |
Returns Returns the shadow root of the element or null |
|
getStyle( dom: ) |
Returns |
|
getTimeZone( date: ) |
Returns Returns a string name of the time zone. |
|
getTimezoneOffset( timezone: ) |
Returns |
|
getWeek( date: ) |
Returns Returns week number for a given date. @todo Account for UTC |
|
getWeekYear( date: ) |
Returns Returns a "week year" of the given date. @since 5.3.0 |
|
getYearDay( date: ) |
Returns Returns a year day. @todo Account for UTC |
|
hslToHsv( hsl: ) |
Returns Converts HSL to HSV. https://en.wikipedia.org/wiki/HSL_and_HSV#HSL_to_HSV |
|
hslToRgb( color: ) |
Returns Converts an HSL color value to RGB. Conversion formula adapted from http://en.wikipedia.org/wiki/HSL_color_space. Assumes h, s, and l are contained in the set [0, 1] and returns r, g, and b in the set [0, 255]. Function adapted from: http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c |
|
hsvToHsl( hsv: ) |
Returns Converts HSV to HSL. https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_HSL |
|
iOS() |
Returns |
|
isLight( color: ) |
Returns Returns |
|
isLocalEvent( event: ) |
Returns Returns @since 5.2.8 |
|
isTouchEvent( ev: ) |
Returns Determines if pointer event originated from a touch pointer or mouse. |
|
lighten( rgb: ) |
Returns Returns a color that is |
|
onZoom( listener: () => ) |
Returns Function that adds an event listener which is triggered when the browser's zoom changes. |
|
padString( value: ) |
Returns Pads a string with additional characters to certain length. |
|
plainText( text: ) |
Returns Removes new lines and tags from a string. |
|
ready( f: () => ) |
Returns Execute a function when DOM is ready. @since 5.0.2 |
|
relativeToValue( percent: ) |
Returns |
|
removeElement( el: ) |
Returns Removes a DOM element. |
|
rgbToHsl( color: ) |
Returns Converts an RGB color value to HSL. Conversion formula adapted from http://en.wikipedia.org/wiki/HSL_color_space. Assumes r, g, and b are contained in the set [0, 255] and returns h, s, and l in the set [0, 1]. Function adapted from: http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c |
|
saturate( rgb: ) |
Returns Returns a new |
|
setInteractive( target: ) |
Returns Disables or enables interactivity of a DOM element. |
|
splitString( source: ) |
Returns Splits the string into separate characters. Keeps RTL words non-split. |
|
stripTags( text: ) |
Returns Strips all tags from the string. |
|
trim( text: ) |
Returns |
|
trimLeft( text: ) |
Returns |
|
trimRight( text: ) |
Returns |
|
truncateTextWithEllipsis( text: ) |
Returns |