Skip to content

Latest commit

 

History

History
297 lines (261 loc) · 11.8 KB

File metadata and controls

297 lines (261 loc) · 11.8 KB

/** * Core space for all anychart components. * @namespace * @name anychart */ anychart;

/** * The current version of the framework. * @example anychart.VERSION * @define {string} Replaced at compile time. */ anychart.VERSION;

/** * Defines if it is developer edition. * @example anychart.DEVELOP * @define {boolean} Replaced at compile time. */ anychart.DEVELOP;

/* * Creates an element by JSON config. * @category XML/JSON * @example anychart.fromJson * @param {(Object|string)} jsonConfig Config. * @return {} Element created by config. */ anychart.fromJson;

/* * Creates an element by XML config. * @category XML/JSON * @example anychart.fromXml * @param {string|Node} xmlConfig Config. * @return {} Element created by config. */ anychart.fromXml;

/* * Adds callback for the document load event.<br/> * It is fired when the entire page loads, including its content (images, CSS, scripts, etc.). * @param {Function} func A function which is called on document load event. * @param {=} opt_scope Function call context. */ anychart.onDocumentLoad;

/* * Adds callback for the document ready event.<br/> * It is called when the DOM is ready, this can happen prior to loading images and other external content. * @example anychart.onDocumentReady * @param {Function} func A function which is called on document load event. * @param {=} opt_scope Function call context. */ anychart.onDocumentReady;

/** * Setter for AnyChart license key.<br/> * To purchase a license proceed to <a href="https://www.anychart.com/buy/">Buy AnyChart</a> page. * @example anychart.licenseKey * @param {string=} opt_key Your licence key. * @return {?string} Current license key. */ anychart.licenseKey;

/** * @ignoreDoc The doclet doesn’t look good in the API Reference. * @deprecated Use anychart.exports.server instead. * Gets an address export server script, which is used to export to an image or PDF. * @return {string} Returns the current address of the export server. * @since 7.5.1 */ anychart.server;

/** * @ignoreDoc * @deprecated Use anychart.exports.server instead. * Sets an address export server script, which is used to export to an image or PDF.<br/> * See: <li>{@link anychart.graphics.vector.Stage#saveAsPdf}</li> * <li>{@link anychart.graphics.vector.Stage#saveAsPng}</li> * <li>{@link anychart.graphics.vector.Stage#saveAsJpg}</li> * <li>{@link anychart.graphics.vector.Stage#saveAsSvg}</li> * @detailed <b>Note</b>: If it doesn’t set the address of the export server, you will get the current address * of the export server. * @param {string=} opt_address Export server script URL. * @since 7.5.1 */ anychart.server;

/** * @ignoreDoc For need developer. * Defines the default theme. * @define {string} Replaced on compile time. */ anychart.DEFAULT_THEME;

/** * Sets the theme for or gets the current theme. * {docs:Appearance_Settings/Themes}Learn more about themes.{docs} * @detailed <b>Note</b>: If it doesn’t set the theme, you will get the current theme.<br/> * <br/> * For example, to use theme name "pastel" you have to connect special theme file with the name pastel.js.<br/> * This file, as well as other files, can be found at {@link https://cdn.anychart.com/#themes}.<br/>; * After referencing the file you can use theme() method with "pastel" parameter to apply pastel theme: anychart.theme("pastel");<br/> * <br/> * To disable installed themes - pass <b>null</b>.<br/> * <br/> * Sets theme settings depending on parameter type: * <ul> * <li><b>null</b> - disable passed theme settings.</li> * <li><b>object</b> - sets theme settings.</li> * <li><b>string</b> - sets theme name.</li> * <li><b>array</b> - sets theme name and theme settings.</li> * </ul> * @example anychart.theme_set_asWines Using wines theme * @example anychart.theme_set_asPastel Using pastel theme * @example anychart.theme_set_asMorning Using morning theme * @example anychart.theme_set_asObj Using object with theme settings * @example anychart.theme_set_asArrayofStringObject Using array of string and object * @param {(string|Object|Array<string|Object>|null)=} opt_settings ['defaultTheme'] Object with theme settings or name of the theme or array of objects/names of the themes. * @return {string|Object|Array<string|Object>} Object with theme settings. * @since 7.6.0 */ anychart.theme;

/** * Append theme for anychart globally.<br/> * This method applies the theme or theme settings over the existing theme. * @example anychart.appendTheme * @param {string|Object} value An object with theme settings or the name of the theme. * @since 7.11.1 */ anychart.appendTheme;

/** * Getter for the state of the high-contrast mode. * {docs:Common_Settings/Accessibility/Settings#high_contrast}Learn more about the high-contrast mode.{docs} * @shortDescription High-contrast mode of the page. * @since 9.0.0 * @example anychart.a11yHighContrast * @listing See listing * var enabled = anychart.a11yHighContrast(); * @return {boolean} Whether the high-contrast mode is on. */ anychart.a11yHighContrast;

/** * Setter for the high-contrast mode. * @detailed * <ul> * <li><b>Default:</b> off.</li> * <li><b>Switching on</b> applies the built-in <b>contrast</b> theme: the default theme with its palette darkened so that every series color reaches a contrast ratio of at least 3:1 against the white background. The theme file is loaded on demand, so the call returns a Promise that resolves to <b>true</b> when the theme is applied, and rejects (leaving the mode off) if the file cannot be loaded.</li> * <li><b>Switching off</b> restores the theme that was active before the mode was switched on. It is immediate and returns <b>false</b>.</li> * <li><b>Scope:</b> like any theme, the high-contrast palette is used by the charts created after the switch; a chart drawn earlier keeps its colors until it is created again.</li> * <li><b>Repeated calls:</b> passing the state the mode already has changes nothing.</li> * </ul> * See {@link anychart.theme} for the theme that is restored. * @since 9.0.0 * @example anychart.a11yHighContrast * @param {boolean} enable Whether to switch the high-contrast mode on. * @listing See listing * anychart.a11yHighContrast(true).then(function () { * // create the chart here * }); * @return {(boolean|Promise<boolean>)} <b>false</b> when switching off; a Promise resolving to <b>true</b> when switching on. */ anychart.a11yHighContrast;

/** * @ignoreDoc It doesn’t need for user. It need for the build with flag -pm. * @define {boolean} Replaced on compile time. */ anychart.PERFORMANCE_MONITORING;

/** * Creates Chart Editor.<br/> * Chart Editor allows to create and work with Anychart JavaScript Charts.<br> * <br> * <i>To work with the Chart Editor you need to reference the extension file from AnyChart CDN * (example for the versioned file: https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-editor.min.js)</i>; * @listing Sample for the editor function. * <pre> // Create the chart editor. * var editor = anychart.editor(); * * editor.render(document.getElementById('container'));</pre> * * See sample at {@link https://www.anychart.com/features/chart_editor/demo.html} * @return {anychart.editor.Editor} Chart editor. * @since 8.3.0 */ anychart.editor;

/** * Returns tracking chart by it’s id. * @example anychart.getChartById * @param {!string} id Chart id to set. * @return {anychart.core.Chart} Returns chart. */ anychart.getChartById;

/** * Loads an optional module by name, without a script tag. * {docs:Quick_Start/Modules}Learn more about modules.{docs} * @shortDescription Loads an optional module by name. * @detailed The returned Promise resolves once the script has loaded <b>and</b> the module has registered itself, so anything the module provides is ready to use inside <b>then</b>. A module that is already loaded resolves immediately, and a failed load can be retried.<br/>Modules are resolved through the release manifest, so the name is the one in the file name without the <b>anychart-</b> prefix and the <b>.min.js</b> suffix. * @listing See listing * anychart.loadModule('boost-webgl').then(function () { * chart.boostEnabled(true); * chart.draw(); * }); * * @param {string} name Module name, for example <b>'boost-webgl'</b>, <b>'data-sheet'</b> or <b>'theme-coffee'</b>. * @param {Object=} opt_options Loader options: <b>cdnBase</b> to load from somewhere other than the default CDN, <b>sri</b> to pin an integrity hash, <b>unsafe</b> to skip the integrity check. * @return {!Promise} Promise resolved when the module is loaded and registered. * @since 9.0.0 */ anychart.loadModule;

/** * Starts loading an optional module without waiting for the result. * @shortDescription Warms up an optional module. * @detailed Same as {@link anychart.loadModule}, but fire-and-forget: nothing is returned and a failure is only reported to the console. Use it to warm a module up ahead of the moment it is needed. * @listing See listing * anychart.preload('boost-webgl'); * * @param {string} name Module name, for example <b>'boost-webgl'</b>. * @param {Object=} opt_options Loader options, as in {@link anychart.loadModule}. * @since 9.0.0 */ anychart.preload;