mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
+3932
-3760
File diff suppressed because it is too large
Load Diff
@@ -313,6 +313,18 @@ When `dts-gen` is used to scaffold a scoped package, the `paths` property has to
|
||||
|
||||
GitHub doesn't [support](http://stackoverflow.com/questions/5646174/how-to-make-github-follow-directory-history-after-renames) file history for renamed files. Use [`git log --follow`](https://www.git-scm.com/docs/git-log) instead.
|
||||
|
||||
#### Should I add an empty namespace to a package that doesn't export a module to use ES6 style imports?
|
||||
|
||||
Some packages, like [chai-http](https://github.com/chaijs/chai-http), export a function.
|
||||
|
||||
Importing this module with an ES6 style import in the form `import * as foo from "foo";` leads to the error:
|
||||
|
||||
> error TS2497: Module 'foo' resolves to a non-module entity and cannot be imported using this construct
|
||||
|
||||
This error can be suppressed by merging the function declaration with an empty namespace of the same name, but this practice is discouraged.
|
||||
This is a commonly cited [Stack Overflow answer](https://stackoverflow.com/questions/39415661/what-does-resolves-to-a-non-module-entity-and-cannot-be-imported-using-this) regarding this matter.
|
||||
|
||||
It is more appropriate to import the module using the `import foo = require("foo");` syntax, or to use a default import like `import foo from "foo";` if using the `--allowSyntheticDefaultImports` flag if your module runtime supports an interop scheme for non-ECMAScript modules as such.
|
||||
|
||||
## License
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Vendored
+6
-5
@@ -1,13 +1,14 @@
|
||||
// Type definitions for accepts 1.3
|
||||
// Project: https://github.com/jshttp/accepts
|
||||
// Definitions by: Stefan Reichel <https://github.com/bomret>
|
||||
// Brice BERNARD <https://github.com/brikou>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace accepts {
|
||||
interface Headers {
|
||||
[key: string]: string | string[];
|
||||
}
|
||||
/// <reference types="node" />
|
||||
|
||||
import { IncomingMessage } from "http";
|
||||
|
||||
declare namespace accepts {
|
||||
interface Accepts {
|
||||
/**
|
||||
* Return the first accepted charset. If nothing in `charsets` is accepted, then `false` is returned.
|
||||
@@ -55,6 +56,6 @@ declare namespace accepts {
|
||||
}
|
||||
}
|
||||
|
||||
declare function accepts(req: { headers: accepts.Headers }): accepts.Accepts;
|
||||
declare function accepts(req: IncomingMessage): accepts.Accepts;
|
||||
|
||||
export = accepts;
|
||||
|
||||
+31
-19
@@ -224,18 +224,24 @@ export class ActionsSdkApp extends AssistantApp {
|
||||
getSelectedOption(): string;
|
||||
|
||||
/**
|
||||
* Asks to collect user's input; all user's queries need to be sent to
|
||||
* the app.
|
||||
* {@link https://developers.google.com/actions/policies/general-policies#user_experience|The guidelines when prompting the user for a response must be followed at all times}.
|
||||
* Asks to collect user's input; all user's queries need to be sent to the app.
|
||||
* {@link https://developers.google.com/actions/policies/general-policies#user_experience|
|
||||
* The guidelines when prompting the user for a response must be followed at all times}.
|
||||
*
|
||||
* @example
|
||||
* const app = new ActionsSdkApp({request: request, response: response});
|
||||
*
|
||||
* const noInputs = [
|
||||
* `I didn't hear a number`,
|
||||
* `If you're still there, what's the number?`,
|
||||
* 'What is the number?'
|
||||
* ];
|
||||
*
|
||||
* function mainIntent (app) {
|
||||
* const inputPrompt = app.buildInputPrompt(true, '<speak>Hi! <break time="1"/> ' +
|
||||
* 'I can read out an ordinal like ' +
|
||||
* '<say-as interpret-as="ordinal">123</say-as>. Say a number.</speak>',
|
||||
* ['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']);
|
||||
* const ssml = '<speak>Hi! <break time="1"/> ' +
|
||||
* 'I can read out an ordinal like ' +
|
||||
* '<say-as interpret-as="ordinal">123</say-as>. Say a number.</speak>';
|
||||
* const inputPrompt = app.buildInputPrompt(true, ssml, noInputs);
|
||||
* app.ask(inputPrompt);
|
||||
* }
|
||||
*
|
||||
@@ -243,9 +249,9 @@ export class ActionsSdkApp extends AssistantApp {
|
||||
* if (app.getRawInput() === 'bye') {
|
||||
* app.tell('Goodbye!');
|
||||
* } else {
|
||||
* const inputPrompt = app.buildInputPrompt(true, '<speak>You said, <say-as interpret-as="ordinal">' +
|
||||
* app.getRawInput() + '</say-as></speak>',
|
||||
* ['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']);
|
||||
* const ssml = '<speak>You said, <say-as interpret-as="ordinal">' +
|
||||
* app.getRawInput() + '</say-as></speak>';
|
||||
* const inputPrompt = app.buildInputPrompt(true, ssml, noInputs);
|
||||
* app.ask(inputPrompt);
|
||||
* }
|
||||
* }
|
||||
@@ -272,7 +278,7 @@ export class ActionsSdkApp extends AssistantApp {
|
||||
* const app = new ActionsSdkApp({request, response});
|
||||
*
|
||||
* function welcomeIntent (app) {
|
||||
* app.askWithlist('Which of these looks good?',
|
||||
* app.askWithList('Which of these looks good?',
|
||||
* app.buildList('List title')
|
||||
* .addItems([
|
||||
* app.buildOptionItem(SELECTION_KEY_ONE,
|
||||
@@ -356,11 +362,17 @@ export class ActionsSdkApp extends AssistantApp {
|
||||
* @example
|
||||
* const app = new ActionsSdkApp({request: request, response: response});
|
||||
*
|
||||
* const noInputs = [
|
||||
* `I didn't hear a number`,
|
||||
* `If you're still there, what's the number?`,
|
||||
* 'What is the number?'
|
||||
* ];
|
||||
*
|
||||
* function mainIntent (app) {
|
||||
* const inputPrompt = app.buildInputPrompt(true, '<speak>Hi! <break time="1"/> ' +
|
||||
* 'I can read out an ordinal like ' +
|
||||
* '<say-as interpret-as="ordinal">123</say-as>. Say a number.</speak>',
|
||||
* ['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']);
|
||||
* const ssml = '<speak>Hi! <break time="1"/> ' +
|
||||
* 'I can read out an ordinal like ' +
|
||||
* '<say-as interpret-as="ordinal">123</say-as>. Say a number.</speak>';
|
||||
* const inputPrompt = app.buildInputPrompt(true, ssml, noInputs);
|
||||
* app.ask(inputPrompt);
|
||||
* }
|
||||
*
|
||||
@@ -368,9 +380,9 @@ export class ActionsSdkApp extends AssistantApp {
|
||||
* if (app.getRawInput() === 'bye') {
|
||||
* app.tell('Goodbye!');
|
||||
* } else {
|
||||
* const inputPrompt = app.buildInputPrompt(true, '<speak>You said, <say-as interpret-as="ordinal">' +
|
||||
* app.getRawInput() + '</say-as></speak>',
|
||||
* ['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']);
|
||||
* const ssml = '<speak>You said, <say-as interpret-as="ordinal">' +
|
||||
* app.getRawInput() + '</say-as></speak>';
|
||||
* const inputPrompt = app.buildInputPrompt(true, ssml, noInputs);
|
||||
* app.ask(inputPrompt);
|
||||
* }
|
||||
* }
|
||||
@@ -390,7 +402,7 @@ export class ActionsSdkApp extends AssistantApp {
|
||||
|
||||
/**
|
||||
* Builds the {@link https://developers.google.com/actions/reference/conversation#InputPrompt|InputPrompt object}
|
||||
* from initial prompt and no-input prompts.
|
||||
* from initial prompt and no-input prompts.
|
||||
*
|
||||
* The App needs one initial prompt to start the conversation. If there is no user response,
|
||||
* the App re-opens the mic and renders the no-input prompts three times
|
||||
|
||||
+125
-55
@@ -1,9 +1,15 @@
|
||||
import * as express from 'express';
|
||||
|
||||
import { BasicCard, Carousel, List, OptionItem, RichResponse } from './response-builder';
|
||||
import { BasicCard, Carousel, ImageDisplays, List, OptionItem, RichResponse } from './response-builder';
|
||||
import { ActionPaymentTransactionConfig, Cart, GooglePaymentTransactionConfig, LineItem,
|
||||
Location, Order, OrderUpdate, TransactionDecision, TransactionValues } from './transactions';
|
||||
|
||||
//
|
||||
// Note: These enums are exported due to limitations with Typescript and this
|
||||
// library. If you try to import and access them they'll end up null at runtime.
|
||||
// Either access them through an AssistantApp instance or AssistantApp.prototype.
|
||||
//
|
||||
|
||||
/**
|
||||
* List of standard intents that the app provides.
|
||||
* @actionssdk
|
||||
@@ -36,9 +42,9 @@ export enum StandardIntents {
|
||||
CANCEL,
|
||||
/** App fires NEW_SURFACE intent when requesting handoff to a new surface from user. */
|
||||
NEW_SURFACE,
|
||||
/** App fires REGISTER_UPDATE intent when requesting the user to register for proactive updates. */
|
||||
/** App fires REGISTER_UPDATE intent when requesting user to register for proactive updates. */
|
||||
REGISTER_UPDATE,
|
||||
/** App receives CONFIGURE_UPDATES intent to indicate a custom REGISTER_UPDATE intent should be sent. */
|
||||
/** App receives CONFIGURE_UPDATES intent to indicate a REGISTER_UPDATE intent should be sent. */
|
||||
CONFIGURE_UPDATES
|
||||
}
|
||||
|
||||
@@ -273,7 +279,10 @@ export interface DeviceLocation {
|
||||
export interface User {
|
||||
/** Random string ID for Google user. */
|
||||
userId: string;
|
||||
/** User name information. Null if not requested with {@link AssistantApp#askForPermission|askForPermission(SupportedPermissions.NAME)}. */
|
||||
/**
|
||||
* User name information. Null if not requested with
|
||||
* {@link AssistantApp#askForPermission|askForPermission(SupportedPermissions.NAME)}.
|
||||
*/
|
||||
userName: UserName;
|
||||
/** Unique Oauth2 token. Only available with account linking. */
|
||||
accessToken: string;
|
||||
@@ -303,7 +312,7 @@ export interface Surface {
|
||||
*/
|
||||
export interface Capability {
|
||||
/** Name of the capability. */
|
||||
name: string;
|
||||
name: SurfaceCapabilities;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -408,6 +417,11 @@ export class AssistantApp {
|
||||
*/
|
||||
readonly SignInStatus: typeof SignInStatus;
|
||||
|
||||
/**
|
||||
* Values related to supporting {@link ImageDisplays}.
|
||||
*/
|
||||
readonly ImageDisplays: typeof ImageDisplays;
|
||||
|
||||
/**
|
||||
* Values related to supporting {@link Transactions}.
|
||||
*/
|
||||
@@ -430,11 +444,17 @@ export class AssistantApp {
|
||||
* // Actions SDK
|
||||
* const app = new ActionsSdkApp({request: request, response: response});
|
||||
*
|
||||
* const noInputs = [
|
||||
* `I didn't hear a number`,
|
||||
* `If you're still there, what's the number?`,
|
||||
* 'What is the number?'
|
||||
* ];
|
||||
*
|
||||
* function mainIntent (app) {
|
||||
* const inputPrompt = app.buildInputPrompt(true, '<speak>Hi! <break time="1"/> ' +
|
||||
* 'I can read out an ordinal like ' +
|
||||
* '<say-as interpret-as="ordinal">123</say-as>. Say a number.</speak>',
|
||||
* ['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']);
|
||||
* const ssml = '<speak>Hi! <break time="1"/> ' +
|
||||
* 'I can read out an ordinal like ' +
|
||||
* '<say-as interpret-as="ordinal">123</say-as>. Say a number.</speak>';
|
||||
* const inputPrompt = app.buildInputPrompt(true, ssml, noInputs);
|
||||
* app.ask(inputPrompt);
|
||||
* }
|
||||
*
|
||||
@@ -442,9 +462,9 @@ export class AssistantApp {
|
||||
* if (app.getRawInput() === 'bye') {
|
||||
* app.tell('Goodbye!');
|
||||
* } else {
|
||||
* const inputPrompt = app.buildInputPrompt(true, '<speak>You said, <say-as interpret-as="ordinal">' +
|
||||
* app.getRawInput() + '</say-as></speak>',
|
||||
* ['I didn\'t hear a number', 'If you\'re still there, what\'s the number?', 'What is the number?']);
|
||||
* const ssml = '<speak>You said, <say-as interpret-as="ordinal">' +
|
||||
* app.getRawInput() + '</say-as></speak>';
|
||||
* const inputPrompt = app.buildInputPrompt(true, ssml, noInputs);
|
||||
* app.ask(inputPrompt);
|
||||
* }
|
||||
* }
|
||||
@@ -479,6 +499,87 @@ export class AssistantApp {
|
||||
*/
|
||||
handleRequest(handler: ((app: AssistantApp) => any) | (Map<string, (app: AssistantApp) => any>)): void;
|
||||
|
||||
/**
|
||||
* Asynchronously handles the incoming Assistant request using a handler or Map of handlers.
|
||||
* Each handler can be a function callback or Promise.
|
||||
*
|
||||
* @example
|
||||
* // Actions SDK
|
||||
* const app = new ActionsSdkApp({request: request, response: response});
|
||||
*
|
||||
* const noInputs = [
|
||||
* `I didn't hear a number`,
|
||||
* `If you're still there, what's the number?`,
|
||||
* 'What is the number?'
|
||||
* ];
|
||||
*
|
||||
* function mainIntent (app) {
|
||||
* const ssml = '<speak>Hi! <break time="1"/> ' +
|
||||
* 'I can read out an ordinal like ' +
|
||||
* '<say-as interpret-as="ordinal">123</say-as>. Say a number.</speak>';
|
||||
* const inputPrompt = app.buildInputPrompt(true, ssml, noInputs);
|
||||
* app.ask(inputPrompt);
|
||||
* }
|
||||
*
|
||||
* function rawInput (app) {
|
||||
* if (app.getRawInput() === 'bye') {
|
||||
* app.tell('Goodbye!');
|
||||
* } else {
|
||||
* const ssml = '<speak>You said, <say-as interpret-as="ordinal">' +
|
||||
* app.getRawInput() + '</say-as></speak>';
|
||||
* const inputPrompt = app.buildInputPrompt(true, ssml, noInputs);
|
||||
* app.ask(inputPrompt);
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* const actionMap = new Map();
|
||||
* actionMap.set(app.StandardIntents.MAIN, mainIntent);
|
||||
* actionMap.set(app.StandardIntents.TEXT, rawInput);
|
||||
*
|
||||
* app.handleRequestAsync(actionMap)
|
||||
* .then(
|
||||
* (result) => {
|
||||
* // handle the result
|
||||
* })
|
||||
* .catch(
|
||||
* (reason) => {
|
||||
* // handle an error
|
||||
* });
|
||||
*
|
||||
* // Dialogflow
|
||||
* const app = new DialogflowApp({request: req, response: res});
|
||||
* const NAME_ACTION = 'make_name';
|
||||
* const COLOR_ARGUMENT = 'color';
|
||||
* const NUMBER_ARGUMENT = 'number';
|
||||
*
|
||||
* function makeName (app) {
|
||||
* const number = app.getArgument(NUMBER_ARGUMENT);
|
||||
* const color = app.getArgument(COLOR_ARGUMENT);
|
||||
* app.tell('Alright, your silly name is ' +
|
||||
* color + ' ' + number +
|
||||
* '! I hope you like it. See you next time.');
|
||||
* }
|
||||
*
|
||||
* const actionMap = new Map();
|
||||
* actionMap.set(NAME_ACTION, makeName);
|
||||
*
|
||||
* app.handleRequestAsync(actionMap)
|
||||
* .then(
|
||||
* (result) => {
|
||||
* // handle the result
|
||||
* })
|
||||
* .catch(
|
||||
* (reason) => {
|
||||
* // handle an error
|
||||
* });
|
||||
*
|
||||
* @param handler The handler (or Map of handlers) for the request.
|
||||
* @return Promise to resolve the result of the handler that was invoked.
|
||||
* @actionssdk
|
||||
* @dialogflow
|
||||
*/
|
||||
handleRequestAsync(handler: ((app: AssistantApp) => any) | (Map<string, (app: AssistantApp) => any>)): Promise<any>;
|
||||
|
||||
/**
|
||||
* Equivalent to {@link AssistantApp#askForPermission|askForPermission},
|
||||
* but allows you to prompt the user for more than one permission at once.
|
||||
@@ -528,8 +629,8 @@ export class AssistantApp {
|
||||
* which comes from AssistantApp.SupportedPermissions.
|
||||
* @param dialogState JSON object the app uses to hold dialog state that
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkApp}.
|
||||
* @return A response is sent to Assistant to ask for the user's permission; for any
|
||||
* invalid input, we return null.
|
||||
* @return A response is sent to Assistant to ask for the user's permission.
|
||||
* For any invalid input, we return null.
|
||||
* @actionssdk
|
||||
* @dialogflow
|
||||
*/
|
||||
@@ -580,8 +681,8 @@ export class AssistantApp {
|
||||
* {@link AssistantApp#getArgument}.
|
||||
* @param dialogState JSON object the app uses to hold dialog state that
|
||||
* will be circulated back by Assistant. Used in {@link ActionsSdkApp}.
|
||||
* @return A response is sent to Assistant to ask for the user's permission; for any
|
||||
* invalid input, we return null.
|
||||
* @return A response is sent to Assistant to ask for the user's permission.
|
||||
* For any invalid input, we return null.
|
||||
* @actionssdk
|
||||
* @dialogflow
|
||||
*/
|
||||
@@ -679,13 +780,15 @@ export class AssistantApp {
|
||||
* I'll just need to get your name from Google, is that OK?'.
|
||||
*
|
||||
* Once the user accepts or denies the request, the Assistant will fire another intent:
|
||||
* assistant.intent.action.PERMISSION with a boolean argument: AssistantApp.BuiltInArgNames.PERMISSION_GRANTED
|
||||
* app.StandardIntents.PERMISSION with a boolean argument: app.BuiltInArgNames.PERMISSION_GRANTED
|
||||
* and, if granted, the information that you requested.
|
||||
*
|
||||
* Read more:
|
||||
*
|
||||
* * {@link https://developers.google.com/actions/reference/conversation#ExpectedIntent|Supported Permissions}
|
||||
* * Check if the permission has been granted with {@link AssistantApp#isPermissionGranted|isPermissionsGranted}
|
||||
* * {@link https://developers.google.com/actions/reference/conversation#ExpectedIntent|
|
||||
* Supported Permissions}
|
||||
* * Check if the permission has been granted with
|
||||
* {@link AssistantApp#isPermissionGranted|isPermissionsGranted}
|
||||
* * {@link AssistantApp#getDeviceLocation|getDeviceLocation}
|
||||
* * {@link AssistantApp#getUserName|getUserName}
|
||||
*
|
||||
@@ -896,6 +999,7 @@ export class AssistantApp {
|
||||
* are set in the {@link https://console.actions.google.com|Actions Console}.
|
||||
* Retrieve the access token in subsequent intents using
|
||||
* app.getUser().accessToken.
|
||||
* Works only for en-* locales.
|
||||
*
|
||||
* @example
|
||||
* const app = new DialogflowApp({ request, response });
|
||||
@@ -930,6 +1034,7 @@ export class AssistantApp {
|
||||
|
||||
/**
|
||||
* Requests the user to switch to another surface during the conversation.
|
||||
* Works only for en-* locales.
|
||||
*
|
||||
* @example
|
||||
* const app = new DialogflowApp({ request, response });
|
||||
@@ -1126,41 +1231,6 @@ export class AssistantApp {
|
||||
*/
|
||||
getInputType(): number | string;
|
||||
|
||||
/**
|
||||
* Get the argument value by name from the current intent.
|
||||
* If the argument is included in originalRequest, and is not a text argument,
|
||||
* the entire argument object is returned.
|
||||
*
|
||||
* Note: If incoming request is using an API version under 2 (e.g. 'v1'),
|
||||
* the argument object will be in Proto2 format (snake_case, etc).
|
||||
*
|
||||
* @example
|
||||
* const app = new DialogflowApp({request: request, response: response});
|
||||
* const WELCOME_INTENT = 'input.welcome';
|
||||
* const NUMBER_INTENT = 'input.number';
|
||||
*
|
||||
* function welcomeIntent (app) {
|
||||
* app.ask('Welcome to action snippets! Say a number.');
|
||||
* }
|
||||
*
|
||||
* function numberIntent (app) {
|
||||
* const number = app.getArgument(NUMBER_ARGUMENT);
|
||||
* app.tell('You said ' + number);
|
||||
* }
|
||||
*
|
||||
* const actionMap = new Map();
|
||||
* actionMap.set(WELCOME_INTENT, welcomeIntent);
|
||||
* actionMap.set(NUMBER_INTENT, numberIntent);
|
||||
* app.handleRequest(actionMap);
|
||||
*
|
||||
* @param argName Name of the argument.
|
||||
* @return Argument value matching argName
|
||||
* or null if no matching argument.
|
||||
* @dialogflow
|
||||
* @actionssdk
|
||||
*/
|
||||
getArgumentCommon(argName: string): object;
|
||||
|
||||
/**
|
||||
* Gets transactability of user. Only use after calling
|
||||
* askForTransactionRequirements. Null if no result given.
|
||||
@@ -1258,7 +1328,7 @@ export class AssistantApp {
|
||||
* @dialogflow
|
||||
* @actionssdk
|
||||
*/
|
||||
getSurfaceCapabilities(): string[];
|
||||
getSurfaceCapabilities(): SurfaceCapabilities[];
|
||||
|
||||
/**
|
||||
* Returns the set of other available surfaces for the user.
|
||||
|
||||
+2
-1
@@ -36,7 +36,8 @@ export interface DialogflowAppOptions {
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the class that handles the communication with Dialogflow's fulfillment API.
|
||||
* This is the class that handles the communication with Dialogflow's fulfillment API v1.
|
||||
* Doesn't currently support Dialogflow's fulfillment API v2.
|
||||
*/
|
||||
export class DialogflowApp extends AssistantApp {
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for actions-on-google 1.6
|
||||
// Type definitions for actions-on-google 1.7
|
||||
// Project: https://github.com/actions-on-google/actions-on-google-nodejs
|
||||
// Definitions by: Joel Hegg <https://github.com/joelhegg>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
+44
-5
@@ -4,6 +4,27 @@
|
||||
|
||||
import { OrderUpdate } from './transactions';
|
||||
|
||||
/**
|
||||
* List of possible options to display the image in a BasicCard.
|
||||
* When the aspect ratio of an image is not the same as the surface,
|
||||
* this attribute changes how the image is displayed in the card.
|
||||
*/
|
||||
export enum ImageDisplays {
|
||||
/**
|
||||
* Pads the gaps between the image and image frame with a blurred copy of the
|
||||
* same image.
|
||||
*/
|
||||
DEFAULT,
|
||||
/**
|
||||
* Fill the gap between the image and image container with white bars.
|
||||
*/
|
||||
WHITE,
|
||||
/**
|
||||
* Image is centered and resized so the image fits perfectly in the container.
|
||||
*/
|
||||
CROPPED
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple Response type.
|
||||
*/
|
||||
@@ -74,19 +95,19 @@ export interface StructuredResponse {
|
||||
orderUpdate: OrderUpdate;
|
||||
}
|
||||
|
||||
export interface RichResponseItemBasicCard {
|
||||
export interface ItemBasicCard {
|
||||
basicCard: BasicCard;
|
||||
}
|
||||
|
||||
export interface RichResponseItemSimpleResponse {
|
||||
export interface ItemSimpleResponse {
|
||||
simpleResponse: SimpleResponse;
|
||||
}
|
||||
|
||||
export interface RichResponseItemStructuredResponse {
|
||||
export interface ItemStructuredResponse {
|
||||
structuredResponse: StructuredResponse;
|
||||
}
|
||||
|
||||
export type RichResponseItem = RichResponseItemBasicCard | RichResponseItemSimpleResponse | RichResponseItemStructuredResponse;
|
||||
export type RichResponseItem = ItemBasicCard | ItemSimpleResponse | ItemStructuredResponse;
|
||||
|
||||
/**
|
||||
* Class for initializing and constructing Rich Responses with chainable interface.
|
||||
@@ -150,7 +171,8 @@ export class RichResponse {
|
||||
isValidSuggestionText(suggestionText: string): boolean;
|
||||
|
||||
/**
|
||||
* Sets the suggestion link for this rich response.
|
||||
* Sets the suggestion link for this rich response. The destination site must be verified
|
||||
* (https://developers.google.com/actions/console/brand-verification).
|
||||
*
|
||||
* @param destinationName Name of the link out destination.
|
||||
* @param suggestionUrl - String URL to open when suggestion is used.
|
||||
@@ -240,6 +262,16 @@ export class BasicCard {
|
||||
*/
|
||||
setImage(url: string, accessibilityText: string, width?: number, height?: number): BasicCard;
|
||||
|
||||
/**
|
||||
* Sets the display options for the image in this Basic Card.
|
||||
* Use one of the image display constants. If none is chosen,
|
||||
* ImageDisplays.DEFAULT will be enforced.
|
||||
*
|
||||
* @param option The option for displaying the image.
|
||||
* @return Returns current constructed BasicCard.
|
||||
*/
|
||||
setImageDisplay(option: ImageDisplays): BasicCard;
|
||||
|
||||
/**
|
||||
* Adds a button below card.
|
||||
*
|
||||
@@ -402,3 +434,10 @@ export class OptionItem {
|
||||
* @return True if text contains SSML, false otherwise.
|
||||
*/
|
||||
export function isSsml(text: string): boolean;
|
||||
|
||||
/**
|
||||
* Check if given text contains SSML, allowing for whitespace padding.
|
||||
* @param text Text to check.
|
||||
* @return True if text contains possibly whitespace padded SSML, false otherwise.
|
||||
*/
|
||||
export function isPaddedSsml(text: string): boolean;
|
||||
|
||||
+425
-475
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,84 @@
|
||||
import AuthenticationContext, {
|
||||
AuthenticationContextOptions,
|
||||
TokenCallback,
|
||||
UserCallback
|
||||
} from "adal-angular";
|
||||
|
||||
const onLogin: TokenCallback = (errorDescription, idToken, error) => {
|
||||
if (error) {
|
||||
console.error(errorDescription, error);
|
||||
return;
|
||||
}
|
||||
if (config.popUp) {
|
||||
authenticationContext.getUser(onUser);
|
||||
}
|
||||
};
|
||||
|
||||
const onToken: TokenCallback = (errorDesc, token, error) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
return;
|
||||
}
|
||||
console.log('Making request with token:', token);
|
||||
};
|
||||
|
||||
const onUser: UserCallback = (error, user) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
return;
|
||||
}
|
||||
acquireAnAccessToken();
|
||||
};
|
||||
|
||||
const acquireAnAccessToken = () => {
|
||||
const resourceId = "https://graph.microsoft.net";
|
||||
authenticationContext.acquireToken(
|
||||
resourceId,
|
||||
(errorDesc, token, error) => {
|
||||
if (error) {
|
||||
if (config.popUp) {
|
||||
authenticationContext.acquireTokenPopup(
|
||||
resourceId,
|
||||
null,
|
||||
null,
|
||||
onToken
|
||||
);
|
||||
} else {
|
||||
authenticationContext.acquireTokenRedirect(
|
||||
resourceId,
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
} else {
|
||||
onToken(errorDesc, token, error);
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const config: AuthenticationContextOptions = {
|
||||
clientId: "7cee0f68-5051-41f6-9e45-80463d21d65d",
|
||||
redirectUri: "http://localhost:16969/",
|
||||
instance: "https://login.microsoftonline.com/",
|
||||
tenant: "contoso.onmicrosoft.com",
|
||||
extraQueryParameter: "nux=1",
|
||||
correlationId: "123",
|
||||
popUp: true,
|
||||
cacheLocation: "localStorage",
|
||||
callback: onLogin
|
||||
};
|
||||
|
||||
const authenticationContext = new AuthenticationContext(config);
|
||||
|
||||
if (authenticationContext.isCallback(window.location.hash)) {
|
||||
authenticationContext.handleWindowCallback();
|
||||
} else if (authenticationContext.getCachedUser() == null) {
|
||||
authenticationContext.login();
|
||||
} else {
|
||||
acquireAnAccessToken();
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
authenticationContext.logOut();
|
||||
}, 60000);
|
||||
Vendored
+277
@@ -0,0 +1,277 @@
|
||||
// Type definitions for adal-angular 1.0
|
||||
// Project: https://github.com/AzureAD/azure-activedirectory-library-for-js#readme
|
||||
// Definitions by: Daniel Perez Alvarez <https://github.com/unindented>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export enum LoggingLevel {
|
||||
ERROR = 0,
|
||||
WARNING = 1,
|
||||
INFO = 2,
|
||||
VERBOSE = 3
|
||||
}
|
||||
|
||||
export type RequestType = "LOGIN" | "RENEW_TOKEN" | "UNKNOWN";
|
||||
|
||||
export type ResponseType = "id_token token" | "token";
|
||||
|
||||
export interface RequestInfo {
|
||||
/**
|
||||
* Object comprising of fields such as id_token/error, session_state, state, e.t.c.
|
||||
*/
|
||||
parameters: any;
|
||||
/**
|
||||
* Request type.
|
||||
*/
|
||||
requestType: RequestType;
|
||||
/**
|
||||
* Whether state is valid.
|
||||
*/
|
||||
stateMatch: boolean;
|
||||
/**
|
||||
* Unique guid used to match the response with the request.
|
||||
*/
|
||||
stateResponse: string;
|
||||
/**
|
||||
* Whether `requestType` contains `id_token`, `access_token` or error.
|
||||
*/
|
||||
valid: boolean;
|
||||
}
|
||||
|
||||
export interface UserInfo {
|
||||
/**
|
||||
* Username assigned from UPN or email.
|
||||
*/
|
||||
userName: string;
|
||||
/**
|
||||
* Properties parsed from `id_token`.
|
||||
*/
|
||||
profile: any;
|
||||
}
|
||||
|
||||
export type TokenCallback = (
|
||||
errorDesc: string | null,
|
||||
token: string,
|
||||
error: any
|
||||
) => void;
|
||||
|
||||
export type UserCallback = (errorDesc: string | null, user: UserInfo) => void;
|
||||
|
||||
export interface AuthenticationContextOptions {
|
||||
/**
|
||||
* Client ID assigned to your app by Azure Active Directory.
|
||||
*/
|
||||
clientId: string;
|
||||
/**
|
||||
* Endpoint at which you expect to receive tokens.Defaults to `window.location.href`.
|
||||
*/
|
||||
redirectUri: string;
|
||||
/**
|
||||
* Azure Active Directory instance. Defaults to `https://login.microsoftonline.com/`.
|
||||
*/
|
||||
instance?: string;
|
||||
/**
|
||||
* Your target tenant. Defaults to `common`.
|
||||
*/
|
||||
tenant?: string;
|
||||
/**
|
||||
* Query parameters to add to the authentication request.
|
||||
*/
|
||||
extraQueryParameter?: string;
|
||||
/**
|
||||
* Unique identifier used to map the request with the response. Defaults to RFC4122 version 4 guid (128 bits).
|
||||
*/
|
||||
correlationId?: string;
|
||||
/**
|
||||
* User defined function of handling the navigation to Azure AD authorization endpoint in case of login.
|
||||
*/
|
||||
displayCall?: (url: string) => void;
|
||||
/**
|
||||
* Set this to true to enable login in a popup winodow instead of a full redirect. Defaults to `false`.
|
||||
*/
|
||||
popUp?: boolean;
|
||||
/**
|
||||
* Set this to the resource to request on login. Defaults to `clientId`.
|
||||
*/
|
||||
loginResource?: string;
|
||||
/**
|
||||
* Set this to redirect the user to a custom login page.
|
||||
*/
|
||||
localLoginUrl?: string;
|
||||
/**
|
||||
* Redirects to start page after login. Defaults to `true`.
|
||||
*/
|
||||
navigateToLoginRequestUrl?: boolean;
|
||||
/**
|
||||
* Set this to redirect the user to a custom logout page.
|
||||
*/
|
||||
logOutUri?: string;
|
||||
/**
|
||||
* Redirects the user to postLogoutRedirectUri after logout. Defaults to `redirectUri`.
|
||||
*/
|
||||
postLogoutRedirectUri?: string;
|
||||
/**
|
||||
* Sets browser storage to either 'localStorage' or sessionStorage'. Defaults to `sessionStorage`.
|
||||
*/
|
||||
cacheLocation?: "localStorage" | "sessionStorage";
|
||||
/**
|
||||
* Array of keywords or URIs. Adal will attach a token to outgoing requests that have these keywords or URIs.
|
||||
*/
|
||||
endpoints?: { [resource: string]: string };
|
||||
/**
|
||||
* Array of keywords or URIs. Adal will not attach a token to outgoing requests that have these keywords or URIs.
|
||||
*/
|
||||
anonymousEndpoints?: string[];
|
||||
/**
|
||||
* If the cached token is about to be expired in the expireOffsetSeconds (in seconds), Adal will renew the token instead of using the cached token. Defaults to 300 seconds.
|
||||
*/
|
||||
expireOffsetSeconds?: number;
|
||||
/**
|
||||
* The number of milliseconds of inactivity before a token renewal response from AAD should be considered timed out. Defaults to 6 seconds.
|
||||
*/
|
||||
loadFrameTimeout?: number;
|
||||
/**
|
||||
* Callback to be invoked when a token is acquired.
|
||||
*/
|
||||
callback?: TokenCallback;
|
||||
}
|
||||
|
||||
export default class AuthenticationContext {
|
||||
constructor(options: AuthenticationContextOptions);
|
||||
/**
|
||||
* Initiates the login process by redirecting the user to Azure AD authorization endpoint.
|
||||
*/
|
||||
login(): void;
|
||||
/**
|
||||
* Returns whether a login is in progress.
|
||||
*/
|
||||
loginInProgress(): boolean;
|
||||
/**
|
||||
* Gets token for the specified resource from the cache.
|
||||
* @param resource A URI that identifies the resource for which the token is requested.
|
||||
*/
|
||||
getCachedToken(resource: string): string;
|
||||
/**
|
||||
* If user object exists, returns it. Else creates a new user object by decoding `id_token` from the cache.
|
||||
*/
|
||||
getCachedUser(): UserInfo;
|
||||
/**
|
||||
* Adds the passed callback to the array of callbacks for the specified resource.
|
||||
* @param resource A URI that identifies the resource for which the token is requested.
|
||||
* @param expectedState A unique identifier (guid).
|
||||
* @param callback The callback provided by the caller. It will be called with token or error.
|
||||
*/
|
||||
registerCallback(
|
||||
expectedState: string,
|
||||
resource: string,
|
||||
callback: TokenCallback
|
||||
): void;
|
||||
/**
|
||||
* Acquires token from the cache if it is not expired. Otherwise sends request to AAD to obtain a new token.
|
||||
* @param resource Resource URI identifying the target resource.
|
||||
* @param callback The callback provided by the caller. It will be called with token or error.
|
||||
*/
|
||||
acquireToken(resource: string, callback: TokenCallback): void;
|
||||
/**
|
||||
* Acquires token (interactive flow using a popup window) by sending request to AAD to obtain a new token.
|
||||
* @param resource Resource URI identifying the target resource.
|
||||
* @param extraQueryParameters Query parameters to add to the authentication request.
|
||||
* @param claims Claims to add to the authentication request.
|
||||
* @param callback The callback provided by the caller. It will be called with token or error.
|
||||
*/
|
||||
acquireTokenPopup(
|
||||
resource: string,
|
||||
extraQueryParameters: string | null | undefined,
|
||||
claims: string | null | undefined,
|
||||
callback: TokenCallback
|
||||
): void;
|
||||
/**
|
||||
* Acquires token (interactive flow using a redirect) by sending request to AAD to obtain a new token. In this case the callback passed in the authentication request constructor will be called.
|
||||
* @param resource Resource URI identifying the target resource.
|
||||
* @param extraQueryParameters Query parameters to add to the authentication request.
|
||||
* @param claims Claims to add to the authentication request.
|
||||
*/
|
||||
acquireTokenRedirect(
|
||||
resource: string,
|
||||
extraQueryParameters?: string | null,
|
||||
claims?: string | null
|
||||
): void;
|
||||
/**
|
||||
* Redirects the browser to Azure AD authorization endpoint.
|
||||
* @param urlNavigate URL of the authorization endpoint.
|
||||
*/
|
||||
promptUser(urlNavigate: string): void;
|
||||
/**
|
||||
* Clears cache items.
|
||||
*/
|
||||
clearCache(): void;
|
||||
/**
|
||||
* Clears cache items for a given resource.
|
||||
* @param resource Resource URI identifying the target resource.
|
||||
*/
|
||||
clearCacheForResource(resource: string): void;
|
||||
/**
|
||||
* Redirects user to logout endpoint. After logout, it will redirect to `postLogoutRedirectUri` if added as a property on the config object.
|
||||
*/
|
||||
logOut(): void;
|
||||
/**
|
||||
* Calls the passed in callback with the user object or error message related to the user.
|
||||
* @param callback The callback provided by the caller. It will be called with user or error.
|
||||
*/
|
||||
getUser(callback: UserCallback): void;
|
||||
/**
|
||||
* Checks if the URL fragment contains access token, id token or error description.
|
||||
* @param hash Hash passed from redirect page.
|
||||
*/
|
||||
isCallback(hash: string): boolean;
|
||||
/**
|
||||
* Gets login error.
|
||||
*/
|
||||
getLoginError(): string;
|
||||
/**
|
||||
* Creates a request info object from the URL fragment and returns it.
|
||||
*/
|
||||
getRequestInfo(hash: string): RequestInfo;
|
||||
/**
|
||||
* Saves token or error received in the response from AAD in the cache. In case of `id_token`, it also creates the user object.
|
||||
*/
|
||||
saveTokenFromHash(requestInfo: RequestInfo): void;
|
||||
/**
|
||||
* Gets resource for given endpoint if mapping is provided with config.
|
||||
* @param endpoint Resource URI identifying the target resource.
|
||||
*/
|
||||
getResourceForEndpoint(resource: string): string;
|
||||
/**
|
||||
* This method must be called for processing the response received from AAD. It extracts the hash, processes the token or error, saves it in the cache and calls the callbacks with the result.
|
||||
* @param hash Hash fragment of URL. Defaults to `window.location.hash`.
|
||||
*/
|
||||
handleWindowCallback(hash?: string): void;
|
||||
|
||||
/**
|
||||
* Checks the logging Level, constructs the log message and logs it. Users need to implement/override this method to turn on logging.
|
||||
* @param level Level can be set 0, 1, 2 and 3 which turns on 'error', 'warning', 'info' or 'verbose' level logging respectively.
|
||||
* @param message Message to log.
|
||||
* @param error Error to log.
|
||||
*/
|
||||
log(level: LoggingLevel, message: string, error: any): void;
|
||||
/**
|
||||
* Logs messages when logging level is set to 0.
|
||||
* @param message Message to log.
|
||||
* @param error Error to log.
|
||||
*/
|
||||
error(message: string, error: any): void;
|
||||
/**
|
||||
* Logs messages when logging level is set to 1.
|
||||
* @param message Message to log.
|
||||
*/
|
||||
warn(message: string): void;
|
||||
/**
|
||||
* Logs messages when logging level is set to 2.
|
||||
* @param message Message to log.
|
||||
*/
|
||||
info(message: string): void;
|
||||
/**
|
||||
* Logs messages when logging level is set to 3.
|
||||
* @param message Message to log.
|
||||
*/
|
||||
verbose(message: string): void;
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es2017",
|
||||
"lib": [
|
||||
"dom",
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
@@ -19,6 +19,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"egg-tests.ts"
|
||||
"adal-angular-tests.ts"
|
||||
]
|
||||
}
|
||||
Vendored
-40
@@ -1,40 +0,0 @@
|
||||
// Type definitions for ADAL.JS 1.0.8
|
||||
// Project: https://github.com/AzureAD/azure-activedirectory-library-for-js
|
||||
// Definitions by: mmaitre314 <https://github.com/mmaitre314>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
/// <reference types="angular" />
|
||||
|
||||
declare namespace adal {
|
||||
|
||||
interface AdalAuthenticationServiceProvider {
|
||||
init(configOptions: Config, httpProvider: angular.IHttpProvider): void;
|
||||
}
|
||||
|
||||
interface UserInfo {
|
||||
isAuthenticated: boolean,
|
||||
userName: string,
|
||||
loginError: string,
|
||||
profile: any
|
||||
}
|
||||
|
||||
interface AdalAuthenticationService {
|
||||
|
||||
config: Config;
|
||||
userInfo: UserInfo,
|
||||
|
||||
login(): void;
|
||||
loginInProgress(): boolean;
|
||||
logOut(): void;
|
||||
getCachedToken(resource: string): string;
|
||||
acquireToken(resource: string): angular.IPromise<string>;
|
||||
getUser(): angular.IPromise<User>;
|
||||
getResourceForEndpoint(endpoint: string): string,
|
||||
clearCache(): void;
|
||||
clearCacheForResource(resource: string): void;
|
||||
info(message: string): void;
|
||||
verbose(message: string): void;
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
-179
@@ -1,179 +0,0 @@
|
||||
// Type definitions for ADAL.JS 1.0.14
|
||||
// Project: https://github.com/AzureAD/azure-activedirectory-library-for-js
|
||||
// Definitions by: mmaitre314 <https://github.com/mmaitre314>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
declare var AuthenticationContext: adal.AuthenticationContextStatic;
|
||||
declare var Logging: adal.Logging;
|
||||
|
||||
declare module 'adal' {
|
||||
export const AuthenticationContext: adal.AuthenticationContextStatic;
|
||||
export const Logging: adal.Logging;
|
||||
}
|
||||
|
||||
declare namespace adal {
|
||||
|
||||
interface Config {
|
||||
tenant?: string;
|
||||
clientId: string;
|
||||
redirectUri?: string;
|
||||
instance?: string;
|
||||
endpoints?: any; // If you need to send CORS api requests.
|
||||
popUp?: boolean;
|
||||
localLoginUrl?: string;
|
||||
displayCall?: (urlNavigate: string) => any;
|
||||
postLogoutRedirectUri?: string; // redirect url after succesful logout operation
|
||||
cacheLocation?: string;
|
||||
anonymousEndpoints?: string[];
|
||||
expireOffsetSeconds?: number;
|
||||
correlationId?: string;
|
||||
loginResource?: string;
|
||||
resource?: string;
|
||||
extraQueryParameter?: string;
|
||||
navigateToLoginRequestUrl?: boolean;
|
||||
logOutUri?: string;
|
||||
isAngular?: boolean;
|
||||
}
|
||||
|
||||
interface User {
|
||||
userName: string;
|
||||
profile: any;
|
||||
}
|
||||
|
||||
interface RequestInfo {
|
||||
valid: boolean;
|
||||
parameters: any;
|
||||
stateMatch: boolean;
|
||||
stateResponse: string;
|
||||
requestType: string;
|
||||
}
|
||||
|
||||
interface Logging {
|
||||
log: (message: string) => void;
|
||||
level: LoggingLevel;
|
||||
}
|
||||
|
||||
enum LoggingLevel {
|
||||
ERROR = 0,
|
||||
WARNING = 1,
|
||||
INFO = 2,
|
||||
VERBOSE = 3
|
||||
}
|
||||
|
||||
interface AuthenticationContextStatic {
|
||||
new (config: Config): AuthenticationContext;
|
||||
}
|
||||
|
||||
interface AuthenticationContext {
|
||||
|
||||
instance: string;
|
||||
config: Config;
|
||||
|
||||
/**
|
||||
* Gets initial Idtoken for the app backend
|
||||
* Saves the resulting Idtoken in localStorage.
|
||||
*/
|
||||
login(): void;
|
||||
|
||||
/**
|
||||
* Indicates whether login is in progress now or not.
|
||||
*/
|
||||
loginInProgress(): boolean;
|
||||
|
||||
/**
|
||||
* Gets token for the specified resource from local storage cache
|
||||
* @param {string} resource A URI that identifies the resource for which the token is valid.
|
||||
* @returns {string} token if exists and not expired or null
|
||||
*/
|
||||
getCachedToken(resource: string): string;
|
||||
|
||||
/**
|
||||
* Retrieves and parse idToken from localstorage
|
||||
* @returns {User} user object
|
||||
*/
|
||||
getCachedUser(): User;
|
||||
|
||||
registerCallback(expectedState: string, resource: string, callback: (message: string, token: string) => any): void;
|
||||
|
||||
/**
|
||||
* Acquire token from cache if not expired and available. Acquires token from iframe if expired.
|
||||
* @param {string} resource ResourceUri identifying the target resource
|
||||
* @param {requestCallback} callback
|
||||
*/
|
||||
acquireToken(resource: string, callback: (message: string, token: string) => any): void;
|
||||
|
||||
/**
|
||||
* Redirect the Browser to Azure AD Authorization endpoint
|
||||
* @param {string} urlNavigate The authorization request url
|
||||
*/
|
||||
promptUser(urlNavigate: string): void;
|
||||
|
||||
/**
|
||||
* Clear cache items.
|
||||
*/
|
||||
clearCache(): void;
|
||||
|
||||
/**
|
||||
* Clear cache items for a resource.
|
||||
*/
|
||||
clearCacheForResource(resource: string): void;
|
||||
|
||||
/**
|
||||
* Logout user will redirect page to logout endpoint.
|
||||
* After logout, it will redirect to post_logout page if provided.
|
||||
*/
|
||||
logOut(): void;
|
||||
|
||||
/**
|
||||
* Gets a user profile
|
||||
* @param {requestCallback} callback - The callback that handles the response.
|
||||
*/
|
||||
getUser(callback: (message: string, user?: User) => any): void;
|
||||
|
||||
/**
|
||||
* Checks if hash contains access token or id token or error_description
|
||||
* @param {string} hash - Hash passed from redirect page
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isCallback(hash: string): boolean;
|
||||
|
||||
/**
|
||||
* Gets login error
|
||||
* @returns {string} error message related to login
|
||||
*/
|
||||
getLoginError(): string;
|
||||
|
||||
/**
|
||||
* Gets requestInfo from given hash.
|
||||
* @returns {RequestInfo} for appropriate hash.
|
||||
*/
|
||||
getRequestInfo(hash: string): RequestInfo;
|
||||
|
||||
/**
|
||||
* Saves token from hash that is received from redirect.
|
||||
*/
|
||||
saveTokenFromHash(requestInfo: RequestInfo): void;
|
||||
|
||||
/**
|
||||
* Gets resource for given endpoint if mapping is provided with config.
|
||||
* @param {string} endpoint - API endpoint
|
||||
* @returns {string} resource for this API endpoint
|
||||
*/
|
||||
getResourceForEndpoint(endpoint: string): string;
|
||||
|
||||
/**
|
||||
* Handles redirection after login operation.
|
||||
* Gets access token from url and saves token to the (local/session) storage
|
||||
* or saves error in case unsuccessful login.
|
||||
*/
|
||||
handleWindowCallback(): void;
|
||||
|
||||
log(level: number, message: string, error: any): void;
|
||||
error(message: string, error: any): void;
|
||||
warn(message: string): void;
|
||||
info(message: string): void;
|
||||
verbose(message: string): void;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
|
||||
|
||||
// Code samples from:
|
||||
// - https://github.com/AzureAD/azure-activedirectory-library-for-js
|
||||
// - https://github.com/Azure-Samples/active-directory-angularjs-singlepageapp
|
||||
|
||||
// Variable provided by AngularJS
|
||||
var $httpProvider: angular.IHttpProvider = null;
|
||||
var adalAuthenticationServiceProvider: adal.AdalAuthenticationServiceProvider = null;
|
||||
var adalAuthenticationService: adal.AdalAuthenticationService = null;
|
||||
|
||||
var endpoints = {
|
||||
"https://yourhost/api": "b6a68585-5287-45b2-ba82-383ba1f60932",
|
||||
};
|
||||
adalAuthenticationServiceProvider.init({
|
||||
tenant: "52d4b072-9470-49fb-8721-bc3a1c9912a1",
|
||||
clientId: "e9a5a8b6-8af7-4719-9821-0deef255f68e",
|
||||
endpoints: endpoints
|
||||
},
|
||||
$httpProvider
|
||||
);
|
||||
|
||||
adalAuthenticationServiceProvider.init({
|
||||
clientId: "e9a5a8b6-8af7-4719-9821-0deef255f68e"
|
||||
},
|
||||
$httpProvider
|
||||
);
|
||||
|
||||
adalAuthenticationServiceProvider.init(
|
||||
{
|
||||
clientId: 'cb68f72f...',
|
||||
cacheLocation: 'localStorage'
|
||||
},
|
||||
$httpProvider // pass http provider to inject request interceptor to attach tokens
|
||||
);
|
||||
|
||||
adalAuthenticationServiceProvider.init({
|
||||
tenant: 'Enter your tenant name here e.g. contoso.onmicrosoft.com',
|
||||
clientId: 'Enter your client ID here e.g. e9a5a8b6-8af7-4719-9821-0deef255f68e',
|
||||
extraQueryParameter: 'nux=1'
|
||||
},
|
||||
$httpProvider
|
||||
);
|
||||
|
||||
adalAuthenticationService.login();
|
||||
adalAuthenticationService.logOut();
|
||||
@@ -1,24 +0,0 @@
|
||||
|
||||
|
||||
var endpoints = {
|
||||
"https://yourhost/api": "b6a68585-5287-45b2-ba82-383ba1f60932",
|
||||
};
|
||||
|
||||
var config : adal.Config = {
|
||||
tenant: "52d4b072-9470-49fb-8721-bc3a1c9912a1", // Optional by default, it sends common
|
||||
clientId: "e9a5a8b6-8af7-4719-9821-0deef255f68e", // Required
|
||||
endpoints: endpoints // If you need to send CORS api requests.
|
||||
};
|
||||
|
||||
var auth = new AuthenticationContext(config);
|
||||
|
||||
Logging.log = (message: string) => {
|
||||
console.log(message);
|
||||
}
|
||||
|
||||
Logging.level = 4;
|
||||
|
||||
auth.info("Logging message");
|
||||
|
||||
var userName: string = auth.getCachedUser().userName;var postLogoutRedirectUrl = auth.config.postLogoutRedirectUri;
|
||||
var isValidRequest = auth.getRequestInfo('hash').valid;
|
||||
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"adal-angular.d.ts",
|
||||
"test/index.ts",
|
||||
"test/angular.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+1
@@ -1652,6 +1652,7 @@ declare namespace adone {
|
||||
* Ends the stream
|
||||
*/
|
||||
end(chunk?: Buffer): void;
|
||||
end(chunk?: () => void): void;
|
||||
|
||||
/**
|
||||
* Returns the byte at the specified index
|
||||
|
||||
Vendored
+2
-2
@@ -113,8 +113,8 @@ declare class Agenda extends EventEmitter {
|
||||
* @param options The options for the job.
|
||||
* @param handler The handler to execute.
|
||||
*/
|
||||
define(name: string, handler: (job?: Agenda.Job, done?: (err?: Error) => void) => void): void;
|
||||
define(name: string, options: Agenda.JobOptions, handler: (job?: Agenda.Job, done?: (err?: Error) => void) => void): void;
|
||||
define(name: string, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void;
|
||||
define(name: string, options: Agenda.JobOptions, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void;
|
||||
|
||||
/**
|
||||
* Runs job name at the given interval. Optionally, data and options can be passed in.
|
||||
|
||||
Vendored
+3
-3
@@ -1,4 +1,4 @@
|
||||
// Type definitions for algoliasearch-client-js 3.24.6
|
||||
// Type definitions for algoliasearch-client-js 3.24.8
|
||||
// Project: https://github.com/algolia/algoliasearch-client-js
|
||||
// Definitions by: Baptiste Coquelle <https://github.com/cbaptiste>
|
||||
// Haroen Viaene <https://github.com/haroenv>
|
||||
@@ -192,14 +192,14 @@ declare namespace algoliasearch {
|
||||
* @param cb(err, res)
|
||||
* https://github.com/algolia/algoliasearch-client-js#custom-batch---batch
|
||||
*/
|
||||
batch(action: AlgoliaAction, cb: (err: Error, res: any) => void): void;
|
||||
batch(action: AlgoliaAction[], cb: (err: Error, res: any) => void): void;
|
||||
/**
|
||||
* Perform multiple operations with one API call to reduce latency
|
||||
* @param action
|
||||
* return {Promise}
|
||||
* https://github.com/algolia/algoliasearch-client-js#custom-batch---batch
|
||||
*/
|
||||
batch(action: AlgoliaAction): Promise<any>;
|
||||
batch(action: AlgoliaAction[]): Promise<any>;
|
||||
/**
|
||||
* Lists global API Keys
|
||||
* @param cb(err, res)
|
||||
|
||||
Vendored
+629
@@ -0,0 +1,629 @@
|
||||
import AmBalloon from "./AmBalloon";
|
||||
import AmChart from "./AmChart";
|
||||
import AmLegend from "./AmLegend";
|
||||
import ExportSettings from "./ExportSettings";
|
||||
import GaugeArrow from "./GaugeArrow";
|
||||
import GaugeAxis from "./GaugeAxis";
|
||||
import Label from "./Label";
|
||||
import Title from "./Title";
|
||||
|
||||
/**
|
||||
* AmAngularGauge Extension for AmChart to create gauge charts.
|
||||
*/
|
||||
export default class AmAngularGauge extends AmChart {
|
||||
/**
|
||||
* When enabled, chart adds aria-label attributes to columns, bullets or map objects.
|
||||
* You can control values of these labels using properties like accessibleLabel of AmGraph.
|
||||
* Note, not all screen readers support these tags.
|
||||
* We tested this mostly with NVDA Screen reader.
|
||||
* WAI-ARIA is now official W3 standard, so in future more readers will handle this well.
|
||||
* We will be improving accessibility on our charts, so we would be glad to hear your feedback.
|
||||
* @default true
|
||||
*/
|
||||
accessible: boolean;
|
||||
|
||||
/**
|
||||
* Description which will be added to node of SVG element.
|
||||
* Most of the screen readers will read this description.
|
||||
*/
|
||||
accessibleDescription: string;
|
||||
|
||||
/**
|
||||
* Description which is added to of a SVG element. Some of the screen readers will read this description.
|
||||
*/
|
||||
accessibleTitle: string;
|
||||
|
||||
/**
|
||||
* Specifies, if class names should be added to chart elements.
|
||||
* @default false
|
||||
*/
|
||||
addClassNames: boolean;
|
||||
|
||||
/**
|
||||
* Uses the whole space of the canvas to draw the gauge.
|
||||
* @default true
|
||||
*/
|
||||
adjustSize: boolean;
|
||||
|
||||
/**
|
||||
* Array of Labels. Example of label object, with all possible properties:
|
||||
* {
|
||||
* "x": 20,
|
||||
* "y": 20,
|
||||
* "text": "this is label",
|
||||
* "align": "left",
|
||||
* "size": 12,
|
||||
* "color": "#CC0000",
|
||||
* "alpha": 1,
|
||||
* "rotation": 0,
|
||||
* "bold": true,
|
||||
* "url": "http://www.amcharts.com"
|
||||
* }
|
||||
* @default []
|
||||
*/
|
||||
allLabels: [Label];
|
||||
|
||||
/**
|
||||
* Array of arrows.
|
||||
*/
|
||||
arrows: [GaugeArrow];
|
||||
|
||||
/**
|
||||
* If you set it to true the chart will automatically monitor changes of display style of chart’s container
|
||||
* (or any of it’s parents) and will render chart correctly if it is changed from none to block.
|
||||
* We recommend setting it to true if you change this style at a run time, as it affects performance a bit.
|
||||
* @default false
|
||||
*/
|
||||
autoDisplay: boolean;
|
||||
|
||||
/**
|
||||
* Set this to false if you don't want chart to resize itself whenever its parent container size changes.
|
||||
* @default true
|
||||
*/
|
||||
autoResize: boolean;
|
||||
|
||||
/**
|
||||
* If you set it to true and your chart div (or any of the parent div) has css scale applied,
|
||||
* the chart will position mouse at a correct position.
|
||||
* Default value is false because this operation consumes some CPU and quite a
|
||||
* few people are using css transfroms.
|
||||
* @default false
|
||||
*/
|
||||
autoTransform: boolean;
|
||||
|
||||
/**
|
||||
* Array of axes.
|
||||
* @default [GaugeAxis]
|
||||
*/
|
||||
axes: [GaugeAxis];
|
||||
|
||||
/**
|
||||
* Opacity of background. Set it to >0 value if you want backgroundColor to work.
|
||||
* However we recommend changing div's background-color style for changing background color.
|
||||
* @default 0
|
||||
*/
|
||||
backgroundAlpha: number;
|
||||
|
||||
/**
|
||||
* Background color. You should set backgroundAlpha to >0 value in order background to be visible.
|
||||
* We recommend setting background color directly on a chart's DIV instead of using this property.
|
||||
* @default #FFFFFF
|
||||
*/
|
||||
backgroundColor: string;
|
||||
|
||||
/**
|
||||
* The chart creates AmBalloon class itself.
|
||||
* If you want to customize balloon, get balloon instance using this property,
|
||||
* and then change balloon's properties.
|
||||
* @default AmBalloon
|
||||
*/
|
||||
balloon: AmBalloon;
|
||||
|
||||
/**
|
||||
* Opacity of chart's border. Value range is 0 - 1.
|
||||
* @default 0
|
||||
*/
|
||||
borderAlpha: number;
|
||||
|
||||
/**
|
||||
* Color of chart's border. You should set borderAlpha >0 in order border to be visible.
|
||||
* We recommend setting border color directly on a chart's DIV instead of using this property.
|
||||
* @default #000000
|
||||
*/
|
||||
borderColor: string;
|
||||
|
||||
/**
|
||||
* This prefix is added to all class names which are added to all visual elements of a chart
|
||||
* in case addClassNames is set to true.
|
||||
* @default amcharts
|
||||
*/
|
||||
classNamePrefix: string;
|
||||
|
||||
/**
|
||||
* In case you use gauge to create a clock, set this to true.
|
||||
* @default false
|
||||
*/
|
||||
clockWiseOnly: boolean;
|
||||
|
||||
/**
|
||||
* Text color.
|
||||
* @default #000000
|
||||
*/
|
||||
color: string;
|
||||
|
||||
/**
|
||||
* Non-commercial version only. Specifies position of link to amCharts site.
|
||||
* Allowed values are: top-left, top-right, bottom-left and bottom-right.
|
||||
* @default 'top - left'
|
||||
*/
|
||||
creditsPosition: string;
|
||||
|
||||
/**
|
||||
* A config object for Data Loader plugin. Please refer to the following page for more information.
|
||||
*/
|
||||
dataLoader: object;
|
||||
|
||||
/**
|
||||
* Array of data objects, for example:
|
||||
* [
|
||||
* {country:"US", value:524},
|
||||
* {country:"UK", value:624},
|
||||
* {country:"Lithuania", value:824}
|
||||
* ]
|
||||
* You can have any number of fields and use any field names.
|
||||
* In case of AmMap, data provider should be MapData object.
|
||||
* The data set data.
|
||||
* Important: if you are using date/time-based category axis, the data points needs to come pre-ordered
|
||||
* in ascending order. Data with incorrect order might result in visual and functional glitches on the chart.
|
||||
*/
|
||||
dataProvider: [object];
|
||||
|
||||
/**
|
||||
* Decimal separator.
|
||||
* @default "."
|
||||
*/
|
||||
decimalSeparator: string;
|
||||
|
||||
/**
|
||||
* Using this property you can add any additional information to SVG, like SVG filters or clip paths.
|
||||
* The structure of this object should be identical to XML structure of a object you are adding,
|
||||
* only in JSON format.
|
||||
*/
|
||||
defs: object;
|
||||
|
||||
/**
|
||||
* Export config. Specifies how export to image/data export/print/annotate menu will look and behave.
|
||||
* You can find a lot of examples in amcharts/plugins/export folder. More details can be found here.
|
||||
*/
|
||||
export: ExportSettings;
|
||||
|
||||
/**
|
||||
* Gauge face opacity.
|
||||
* @default 0
|
||||
*/
|
||||
faceAlpha: number;
|
||||
|
||||
/**
|
||||
* Gauge face border opacity.
|
||||
* @default 0
|
||||
*/
|
||||
faceBorderAlpha: number;
|
||||
|
||||
/**
|
||||
* Gauge face border color.
|
||||
* @default #555555
|
||||
*/
|
||||
faceBorderColor: string;
|
||||
|
||||
/**
|
||||
* Gauge face border width.
|
||||
* @default 1
|
||||
*/
|
||||
faceBorderWidth: number;
|
||||
|
||||
/**
|
||||
* Gauge face color, requires faceAlpha > 0
|
||||
* @default #FAFAFA
|
||||
*/
|
||||
faceColor: string;
|
||||
|
||||
/**
|
||||
* Gauge face image-pattern.
|
||||
* Example: {"url":"../amcharts/patterns/black/pattern1.png", "width":4, "height":4}
|
||||
* fontFamily String Verdana Font family.
|
||||
* fontSize Number 11 Font size.
|
||||
*/
|
||||
facePattern: object;
|
||||
|
||||
/**
|
||||
* Gauge's horizontal position in pixel, origin is the center. Centered by default.
|
||||
*/
|
||||
gaugeX: number;
|
||||
|
||||
/**
|
||||
* Gauge's vertical position in pixel, origin is the center. Centered by default.
|
||||
*/
|
||||
gaugeY: number;
|
||||
|
||||
/**
|
||||
* If you set this to true, the lines of the chart will be distorted and will produce hand-drawn effect.
|
||||
* Try to adjust chart.handDrawScatter and chart.handDrawThickness properties for a more scattered result.
|
||||
* @default false
|
||||
*/
|
||||
handDrawn: boolean;
|
||||
|
||||
/**
|
||||
* Defines by how many pixels hand-drawn line (when handDrawn is set to true) will fluctuate.
|
||||
* @default 2
|
||||
*/
|
||||
handDrawScatter: number;
|
||||
|
||||
/**
|
||||
* Defines by how many pixels line thickness will fluctuate (when handDrawn is set to true).
|
||||
* @default 1
|
||||
*/
|
||||
handDrawThickness: number;
|
||||
|
||||
/**
|
||||
* Time, in milliseconds after which balloon is hidden if the user rolls-out of the object.
|
||||
* Might be useful for AmMap to avoid balloon flickering while moving mouse over the areas.
|
||||
* Note, this is not duration of fade-out. Duration of fade-out is set in AmBalloon class.
|
||||
* @default 150
|
||||
*/
|
||||
hideBalloonTime: number;
|
||||
|
||||
/**
|
||||
* Allows changing language easily.
|
||||
* Note, you should include language js file from amcharts/lang or ammap/lang folder and then use
|
||||
* variable name used in this file, like chart.language = "de"; Note, for maps this works differently -
|
||||
* you use language only for country names, as there are no other strings in the maps application.
|
||||
*/
|
||||
language: string;
|
||||
|
||||
/**
|
||||
* Legend of a chart.
|
||||
*/
|
||||
legend: AmLegend;
|
||||
|
||||
/**
|
||||
* Read-only. Reference to the div of the legend.
|
||||
*/
|
||||
legendDiv: HTMLElement;
|
||||
|
||||
/**
|
||||
* You can add listeners of events using this property.
|
||||
* Example: listeners = [{"event":"dataUpdated", "method":handleEvent}];
|
||||
* @default [Object]
|
||||
*/
|
||||
listeners: [object];
|
||||
|
||||
/**
|
||||
* Bottom spacing between chart and container.
|
||||
* @default 10
|
||||
*/
|
||||
marginBottom: number;
|
||||
|
||||
/**
|
||||
* Left-hand spacing between chart and container.
|
||||
* @default 10
|
||||
*/
|
||||
marginLeft: number;
|
||||
|
||||
/**
|
||||
* Right-hand spacing between chart and container.
|
||||
* @default 10
|
||||
*/
|
||||
marginRight: number;
|
||||
|
||||
/**
|
||||
* Top spacing between chart and container.
|
||||
* @default 10
|
||||
*/
|
||||
marginTop: number;
|
||||
|
||||
/**
|
||||
* Minimum radius of a gauge.
|
||||
* @default 10
|
||||
*/
|
||||
minRadius: number;
|
||||
|
||||
/**
|
||||
* This setting affects touch-screen devices only.
|
||||
* If a chart is on a page, and panEventsEnabled are set to true, the page won't move if
|
||||
* the user touches the chart first. If a chart is big enough and occupies all the screen of your touch device,
|
||||
* the user won’t be able to move the page at all.
|
||||
* If you think that selecting/panning the chart or moving/pinching the map is a primary purpose of your users,
|
||||
* you should set panEventsEnabled to true, otherwise - false.
|
||||
* @default true
|
||||
*/
|
||||
panEventsEnabled: boolean;
|
||||
|
||||
/**
|
||||
* Specifies absolute or relative path to amCharts files, i.e."amcharts/". (where all.js files are located)
|
||||
* If relative URLs are used, they will be relative to the current web page, displaying the chart.
|
||||
* You can also set path globally, using global JavaScript variable AmCharts_path.If this variable is set,
|
||||
* and "path" is not set in chart config, the chart will assume the path from the global variable.
|
||||
* This allows setting amCharts path globally.
|
||||
* I.e.:
|
||||
* let AmCharts_path = "/libs/amcharts/";
|
||||
* "path" parameter will be used by the charts to locate it's files, like images, plugins or patterns.
|
||||
* @default 'amcharts/'
|
||||
*/
|
||||
path: string;
|
||||
|
||||
/**
|
||||
* Specifies path to the folder where images like resize grips, lens and similar are.
|
||||
* IMPORTANT: Since V3.14.12, you should use "path" to point to amCharts directory instead.
|
||||
* The "pathToImages" will be automatically set and does not need to be in the chart config,
|
||||
* unless you keep your images separately from other amCharts files.
|
||||
*/
|
||||
pathToImages: string;
|
||||
|
||||
/**
|
||||
* Precision of percent values. -1 means percent values won't be rounded at all and show as they are.
|
||||
* @default 2
|
||||
*/
|
||||
percentPrecision: number;
|
||||
|
||||
/**
|
||||
* Precision of values. -1 means values won't be rounded at all and show as they are.
|
||||
* @default -1
|
||||
*/
|
||||
precision: number;
|
||||
|
||||
/**
|
||||
* Prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc.
|
||||
* Prefixes are used on value axes and in the legend.
|
||||
* To enable prefixes, set usePrefixes property to true.
|
||||
* @default [
|
||||
* {"number": 1e+3, "prefix": "k"},
|
||||
* {"number": 1e+6, "prefix": "M"},
|
||||
* {"number": 1e+9, "prefix": "G"},
|
||||
* {"number": 1e+12, "prefix": "T"},
|
||||
* {"number": 1e+15, "prefix": "P"},
|
||||
* {"number": 1e+18, "prefix": "E"},
|
||||
* {"number": 1e+21, "prefix": "Z"},
|
||||
* {"number": 1e+24, "prefix": "Y"}
|
||||
* ]
|
||||
*/
|
||||
prefixesOfBigNumbers: [{ number: number; prefix: string }];
|
||||
|
||||
/**
|
||||
* Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc.
|
||||
* Prefixes are used on value axes and in the legend.
|
||||
* To enable prefixes, set usePrefixes property to true.
|
||||
* @default [
|
||||
* {"number": 1e-24, "prefix": "y"},
|
||||
* {"number": 1e-21, "prefix": "z"},
|
||||
* {"number": 1e-18, "prefix": "a"},
|
||||
* {"number": 1e-15, "prefix": "f"},
|
||||
* {"number": 1e-12, "prefix": "p"},
|
||||
* {"number": 1e-9, "prefix": "n"},
|
||||
* {"number": 1e-6, "prefix": "μ"},
|
||||
* {"number": 1e-3, "prefix": "m"}
|
||||
* ]
|
||||
*/
|
||||
prefixesOfSmallNumbers: [{ number: number; prefix: string }];
|
||||
|
||||
/**
|
||||
* If processTimeout is > 0, 1000 data items will be parsed at a time,
|
||||
* then the chart will make pause and continue parsing data until it finishes.
|
||||
* @default 1000
|
||||
*/
|
||||
processCount: number;
|
||||
|
||||
/**
|
||||
* If you set it to 1 millisecond or some bigger value, chart will be built in chunks instead of all at once.
|
||||
* This is useful if you work with a lot of data and the initial build of the chart takes a lot of time,
|
||||
* which freezes the whole web application by not allowing other processes to do their
|
||||
* job while the chart is busy.
|
||||
* @default 0
|
||||
*/
|
||||
processTimeout: number;
|
||||
|
||||
/**
|
||||
* A config object for Responsive plugin. Please refer to the following page for more information.
|
||||
*/
|
||||
responsive: object;
|
||||
|
||||
/**
|
||||
* Duration of arrow animation.
|
||||
* @default 1
|
||||
*/
|
||||
startDuration: number;
|
||||
|
||||
/**
|
||||
* Transition effect of the arrows, possible effects: easeOutSine, easeInSine, elastic, bounce.
|
||||
* @default easeInSine
|
||||
*/
|
||||
startEffect: string;
|
||||
|
||||
/**
|
||||
* Charts will use SVG icons (some are loaded from images folder and some are drawn inline)
|
||||
* if browser supports SVG. his makes icons look good on retina displays on all resolutions.
|
||||
* @default true
|
||||
*/
|
||||
svgIcons: boolean;
|
||||
|
||||
/**
|
||||
* Charts which require gestures like swipe (charts with scrollbar/cursor) or pinch (maps) used to prevent
|
||||
* regular page scrolling and could result page to stick to the same spot if the chart occupied whole screen.
|
||||
* Now, in order these gestures to start working user has to touch the chart/maps once.
|
||||
* Regular touch events like touching on the bar/slice/map area do not require the first tap and will
|
||||
* show balloons and perform other tasks as usual.
|
||||
* If you have a map or chart which occupies full screen and your page does not require scrolling,
|
||||
* set tapToActivate to false – this will bring old behavior back.
|
||||
* @default true
|
||||
*/
|
||||
tapToActivate: boolean;
|
||||
|
||||
/**
|
||||
* Theme of a chart. Config files of themes can be found in amcharts/themes/ folder.
|
||||
* More info about using themes.
|
||||
* @default none
|
||||
*/
|
||||
theme: string;
|
||||
|
||||
/**
|
||||
* Thousands separator.
|
||||
* @default ,
|
||||
*/
|
||||
thousandsSeparator: string;
|
||||
|
||||
/**
|
||||
* Array of Title objects.
|
||||
* @default []
|
||||
*/
|
||||
titles: [Title];
|
||||
|
||||
/**
|
||||
* If you set it to 200 (milliseconds) or so, the chart will fire clickGraphItem or clickSlice (AmSlicedChart)
|
||||
* or clickMapObject only if user holds his/her finger for 0.2 seconds (200 ms) on the
|
||||
* column/bullet/slice/map object.
|
||||
* @default 0
|
||||
*/
|
||||
touchClickDuration: number;
|
||||
|
||||
/**
|
||||
* Type of a chart. Required when creating chart using JSON.
|
||||
* Possible types are: serial, pie, xy, radar, funnel, gauge, map, gantt, stock.
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* If true, prefixes will be used for big and small numbers.
|
||||
* You can set arrays of prefixes via prefixesOfSmallNumbers and prefixesOfBigNumbers properties.
|
||||
* @default false
|
||||
*/
|
||||
usePrefixes: boolean;
|
||||
|
||||
/**
|
||||
* Read-only. Indicates current version of a script.
|
||||
*/
|
||||
version: string;
|
||||
|
||||
/**
|
||||
* Adds arrow to the chart.
|
||||
*/
|
||||
addArrow(arrow: GaugeArrow): void;
|
||||
|
||||
/**
|
||||
* Adds axis to angular gauge.
|
||||
*/
|
||||
addAxis(axis: GaugeAxis): void;
|
||||
|
||||
/**
|
||||
* Adds a label on a chart. You can use it for labeling axes, adding chart title,
|
||||
* etc. x and y coordinates can be set in number, percent, or a number with ! in front of it -
|
||||
* coordinate will be calculated from right or bottom instead of left or top.
|
||||
*/
|
||||
addLabel(
|
||||
x: number,
|
||||
y: number,
|
||||
text: string,
|
||||
align: string,
|
||||
size: number,
|
||||
color: string,
|
||||
rotation: number,
|
||||
alpha: number,
|
||||
bold: boolean,
|
||||
url: string,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Adds a legend to the chart. By default, you don't need to create div for your legend,
|
||||
* however if you want it to be positioned in some different way,
|
||||
* you can create div anywhere you want and pass id or reference to your div as a second parameter.
|
||||
* NOTE: This method will not work on StockPanel.
|
||||
*/
|
||||
addLegend(legend: AmLegend, legendDivId?: string): void;
|
||||
/**
|
||||
* Adds a legend to the chart.
|
||||
* By default, you don't need to create div for your legend,
|
||||
* however if you want it to be positioned in some different way,
|
||||
* you can create div anywhere you want and pass id or reference to your div as a second parameter.
|
||||
* NOTE: This method will not work on StockPanel.
|
||||
* @param legend - The legend.
|
||||
* @param legendDiv - Legend div (optional).
|
||||
*/
|
||||
addLegend(legend: AmLegend, legendDiv: HTMLElement): void;
|
||||
|
||||
/**
|
||||
* Adds event listener to the object.
|
||||
*/
|
||||
addListener(
|
||||
type: string,
|
||||
handler: (
|
||||
e: {
|
||||
type: string;
|
||||
chart: AmChart;
|
||||
},
|
||||
) => void,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Adds title to the top of the chart. Pie, Radar positions are updated so that they won't overlap.
|
||||
* Plot area of Serial/XY chart is also updated unless autoMargins property is set to false.
|
||||
* You can add any number of titles - each of them will be placed in a new line.
|
||||
* To remove titles, simply clear titles array: chart.titles = []; and call chart.validateNow() method.
|
||||
*/
|
||||
addTitle(text: string, size: number, color: string, alpha: number, bold: boolean): void;
|
||||
|
||||
/**
|
||||
* Clears the chart area, intervals, etc.
|
||||
*/
|
||||
clear(): void;
|
||||
|
||||
/**
|
||||
* Removes all labels added to the chart.
|
||||
*/
|
||||
clearLabels(): void;
|
||||
|
||||
/**
|
||||
* Use this method to force the chart to resize to it's current container size.
|
||||
*/
|
||||
invalidateSize(): void;
|
||||
|
||||
/**
|
||||
* This method allows to create charts with a single config.
|
||||
*/
|
||||
makeChart(container: string, config: any, delay: number): AmChart;
|
||||
|
||||
/**
|
||||
* Removes arrow from the chart.
|
||||
*/
|
||||
removeArrow(arrow: GaugeArrow): void;
|
||||
|
||||
/**
|
||||
* Removes axis from the chart.
|
||||
*/
|
||||
removeAxis(axis: GaugeAxis): void;
|
||||
|
||||
/**
|
||||
* Removes chart's legend.
|
||||
*/
|
||||
removeLegend(): void;
|
||||
|
||||
/**
|
||||
* Removes event listener from chart object.
|
||||
*/
|
||||
removeListener(chart: AmChart, type: string, handler: any): void;
|
||||
|
||||
/**
|
||||
* This method should be called after data in your data provider changed or a new array was set to dataProvider.
|
||||
* After calling this method the chart will parse data and redraw.
|
||||
*/
|
||||
validateData(): void;
|
||||
|
||||
/**
|
||||
* This method should be called after you changed one or more properties of any class.
|
||||
* The chart will redraw after this method is called.
|
||||
* Both attributes, validateData and skipEvents are optional (false by default).
|
||||
*/
|
||||
validateNow(): void;
|
||||
|
||||
/**
|
||||
* Adds chart to the specified DIV.
|
||||
*/
|
||||
write(container: string | HTMLDivElement): void;
|
||||
}
|
||||
Vendored
+107
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* AmBalloon is the class which generates balloons (datatips).
|
||||
* Balloon follows the mouse when you roll-over the pie slice/line bullet/column/etc, chart indicator of
|
||||
* serial charts displays value balloons and category balloon.
|
||||
* Balloon instance is created by the chart automatically and can be accessed via "balloon" property of AmChart.
|
||||
* Chart shows/hides and sets position for every balloon automatically,
|
||||
* so all you need to do is to change balloon appearance, if you want to.
|
||||
* @example
|
||||
* let chart = new AmCharts.AmSerialChart();
|
||||
* // get balloon intance
|
||||
* let balloon = chart.balloon;
|
||||
* // set properties
|
||||
* balloon.adjustBorderColor = true;
|
||||
* balloon.color = "#000000";
|
||||
* balloon.cornerRadius = 5;
|
||||
* balloon.fillColor = "#FFFFFF";
|
||||
*/
|
||||
export default class AmBalloon {
|
||||
/**
|
||||
* If this is set to true, border color instead of background color will be changed
|
||||
* when user rolls-over the slice, graph, etc.
|
||||
*/
|
||||
adjustBorderColor: boolean;
|
||||
/**
|
||||
* Balloon border opacity. Value range is 0 - 1.
|
||||
* @default 1
|
||||
*/
|
||||
borderAlpha: number;
|
||||
/**
|
||||
* Balloon border color. #FFFFFF
|
||||
*/
|
||||
borderColor: string;
|
||||
/**
|
||||
* Balloon border thickness.
|
||||
* @default 2
|
||||
*/
|
||||
borderThickness: number;
|
||||
/**
|
||||
* Color of text in the balloon. #FFFFFF
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Balloon corner radius.
|
||||
* @default 6
|
||||
*/
|
||||
cornerRadius: number;
|
||||
/**
|
||||
* Balloon background opacity.
|
||||
* @default 1
|
||||
*/
|
||||
fillAlpha: number;
|
||||
/**
|
||||
* Balloon background color. Usually balloon background color is set by the chart.
|
||||
* Only if "adjustBorderColor" is "true" this color will be used.
|
||||
* @default "#CC0000"
|
||||
*/
|
||||
fillColor: string;
|
||||
/**
|
||||
* Size of text in the balloon. Chart's fontSize is used by default.
|
||||
*/
|
||||
fontSize: string;
|
||||
/**
|
||||
* Horizontal padding of the balloon.
|
||||
* @default 8
|
||||
*/
|
||||
horizontalPadding: number;
|
||||
/**
|
||||
* The width of the pointer (arrow) "root". Only used if cornerRadius is 0.
|
||||
* @default 10
|
||||
*/
|
||||
pointerWidth: number;
|
||||
/**
|
||||
* If cornerRadius of a balloon is >0, showBullet is set to true for value balloons when ChartCursor is used.
|
||||
* If you don't want the bullet near the balloon, set it to false: chart.balloon.showBullet = false
|
||||
*/
|
||||
showBullet: boolean;
|
||||
/**
|
||||
* Text alignment, possible values "left", "middle" and "right" middle
|
||||
*/
|
||||
textAlign: string;
|
||||
/**
|
||||
* Color of the text shadow. #000000
|
||||
*/
|
||||
textShadowColor: string;
|
||||
/**
|
||||
* Vertical padding of the balloon.
|
||||
* @default 5
|
||||
*/
|
||||
verticalPadding: number;
|
||||
/**
|
||||
* Hides balloon.
|
||||
*/
|
||||
hide(): void;
|
||||
/**
|
||||
* Defines a square within which the balloon should appear.
|
||||
* Bounds are set by chart class, you don't need to call this method yourself.
|
||||
*/
|
||||
setBounds(left: number, top: number, right: number, bottom: number): void;
|
||||
/**
|
||||
* Sets coordinates the balloon should point to.
|
||||
*/
|
||||
setPosition(x: number, y: number): void;
|
||||
/**
|
||||
* Specifies the text which should be displayed.
|
||||
*/
|
||||
show(value: string): void;
|
||||
}
|
||||
Vendored
+358
@@ -0,0 +1,358 @@
|
||||
import AmBalloon from "./AmBalloon";
|
||||
import AmLegend from "./AmLegend";
|
||||
import ExportSettings from "./ExportSettings";
|
||||
import Label from "./Label";
|
||||
import Title from "./Title";
|
||||
|
||||
/**
|
||||
* AmChart is a base class of all charts. It can not be instantiated explicitly.
|
||||
* AmCoordinateChart, AmPieChart and AmMap extend AmChart class.
|
||||
*/
|
||||
export default class AmChart {
|
||||
/**
|
||||
* used when constructing a chart with a theme
|
||||
*/
|
||||
constructor(theme?: any);
|
||||
/**
|
||||
* Specifies, if class names should be added to chart elements.
|
||||
*/
|
||||
addClassNames: boolean;
|
||||
/**
|
||||
* Array of Labels. Example of label object, with all possible properties:
|
||||
* {
|
||||
* "x": 20,
|
||||
* "y": 20,
|
||||
* "text": "this is label",
|
||||
* "align": "left",
|
||||
* "size": 12,
|
||||
* "color": "#CC0000",
|
||||
* "alpha": 1,
|
||||
* "rotation": 0,
|
||||
* "bold": true,
|
||||
* "url": "http://www.amcharts.com"
|
||||
* }
|
||||
*/
|
||||
allLabels: Label[];
|
||||
/**
|
||||
* Set this to false if you don't want chart to resize itself whenever its parent container size changes.
|
||||
*/
|
||||
autoResize: boolean;
|
||||
/**
|
||||
* Opacity of background. Set it to >0 value if you want backgroundColor to work.
|
||||
* However we recommend changing div's background-color style for changing background color.
|
||||
*/
|
||||
backgroundAlpha: number;
|
||||
/**
|
||||
* Background color. You should set backgroundAlpha to >0 value in order background to be visible.
|
||||
* We recommend setting background color directly on a chart's DIV instead of using this property.
|
||||
* @default "#FFFFFF"
|
||||
*/
|
||||
backgroundColor: string;
|
||||
/**
|
||||
* The chart creates AmBalloon class itself.
|
||||
* If you want to customize balloon, get balloon instance using this property,
|
||||
* and then change balloon's properties.
|
||||
*/
|
||||
balloon: AmBalloon;
|
||||
/**
|
||||
* Opacity of chart's border. Value range is 0 - 1.
|
||||
*/
|
||||
borderAlpha: number;
|
||||
/**
|
||||
* Color of chart's border. You should set borderAlpha >0 in order border to be visible.
|
||||
* We recommend setting border color directly on a chart's DIV instead of using this property.
|
||||
* @default #000000
|
||||
*/
|
||||
borderColor: string;
|
||||
/**
|
||||
* This prefix is added to all class names which are added to all visual elements of a chart
|
||||
* in case addClassNames is set to true.
|
||||
*/
|
||||
classNamePrefix: string;
|
||||
/**
|
||||
* Text color. #000000
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Non-commercial version only. Specifies position of link to amCharts site.
|
||||
* Allowed values are: top-left, top-right, bottom-left and bottom-right.
|
||||
* @default 'top-left'
|
||||
*/
|
||||
creditsPosition: string;
|
||||
/**
|
||||
* Array of data objects, for example:
|
||||
* [{country:"US", value:524}, {country:"UK", value:624}, {country:"Lithuania", value:824}].
|
||||
* You can have any number of fields and use any field names.
|
||||
* In case of AmMap, data provider should be MapData object.
|
||||
*/
|
||||
dataProvider: any[];
|
||||
/**
|
||||
* Decimal separator.
|
||||
* @default "."
|
||||
*/
|
||||
decimalSeparator: string;
|
||||
/**
|
||||
* Using this property you can add any additional information to SVG, like SVG filters or clip paths.
|
||||
* The structure of this object should be identical to XML structure of a object you are adding,
|
||||
* only in JSON format.
|
||||
*/
|
||||
defs: any;
|
||||
/**
|
||||
* Export config. Specifies how export to image/data export/print/annotate menu will look and behave.
|
||||
* You can find a lot of examples in amcharts/plugins/export folder.
|
||||
*/
|
||||
export: ExportSettings;
|
||||
/**
|
||||
* Font family. Verdana
|
||||
*/
|
||||
fontFamily: string;
|
||||
/**
|
||||
* Font size.
|
||||
* @default 11
|
||||
*/
|
||||
fontSize: string;
|
||||
/**
|
||||
* If you set this to true, the lines of the chart will be distorted and will produce hand-drawn effect.
|
||||
* Try to adjust chart.handDrawScatter and chart.handDrawThickness properties for a more scattered result.
|
||||
* @default false
|
||||
*/
|
||||
handDrawn: boolean;
|
||||
/**
|
||||
* Defines by how many pixels hand-drawn line (when handDrawn is set to true) will fluctuate.
|
||||
* @default 2
|
||||
*/
|
||||
handDrawScatter: number;
|
||||
/**
|
||||
* Defines by how many pixels line thickness will fluctuate (when handDrawn is set to true).
|
||||
* @default 1
|
||||
*/
|
||||
handDrawThickness: number;
|
||||
/**
|
||||
* Time, in milliseconds after which balloon is hidden if the user rolls-out of the object.
|
||||
* Might be useful for AmMap to avoid balloon flickering while moving mouse over the areas.
|
||||
* Note, this is not duration of fade-out. Duration of fade-out is set in AmBalloon class.
|
||||
* @default 150
|
||||
*/
|
||||
hideBalloonTime: number;
|
||||
/**
|
||||
* Legend of a chart.
|
||||
*/
|
||||
legend: AmLegend;
|
||||
/**
|
||||
* Reference to the div of the legend.
|
||||
*/
|
||||
legendDiv: HTMLElement;
|
||||
/**
|
||||
* You can add listeners of events using this property. Example:
|
||||
* listeners = [{"event":"dataUpdated", "method":handleEvent}];
|
||||
*/
|
||||
listerns: object[];
|
||||
/**
|
||||
* This setting affects touch-screen devices only.
|
||||
* If a chart is on a page, and panEventsEnabled are set to true, the page won't move
|
||||
* if the user touches the chart first.
|
||||
* If a chart is big enough and occupies all the screen of your touch device,
|
||||
* the user won’t be able to move the page at all. That's why the default value is "false".
|
||||
* If you think that selecting/panning the chart or moving/pinching the map is a primary purpose of your users,
|
||||
* you should set panEventsEnabled to true.
|
||||
*/
|
||||
panEventsEnabled: boolean;
|
||||
/**
|
||||
* Specifies absolute or relative path to amCharts files, i.e. "amcharts/". (where all .js files are located)
|
||||
* If relative URLs are used, they will be relative to the current web page, displaying the chart.
|
||||
* You can also set path globally, using global JavaScript variable AmCharts_path.
|
||||
* If this variable is set, and "path" is not set in chart config, the chart will assume the path from the
|
||||
* global variable. This allows setting amCharts path globally. I.e.:
|
||||
* let AmCharts_path = "/libs/amcharts/";
|
||||
* "path" parameter will be used by the charts to locate it's files, like images, plugins or patterns.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* Specifies path to the folder where images like resize grips, lens and similar are.
|
||||
* IMPORTANT: Since V3.14.12, you should use "path" to point to amCharts directory instead.
|
||||
* The "pathToImages" will be automatically set and does not need to be in the chart config,
|
||||
* unless you keep your images separately from other amCharts files.
|
||||
*/
|
||||
pathToImages: string;
|
||||
/**
|
||||
* Precision of percent values. -1 means percent values won't be rounded at all and show as they are.
|
||||
* @default 2
|
||||
*/
|
||||
percentPrecision: number;
|
||||
/**
|
||||
* Precision of values. -1 means values won't be rounded at all and show as they are.
|
||||
* @default 1
|
||||
*/
|
||||
precision: number;
|
||||
/**
|
||||
* Prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc.
|
||||
* Prefixes are used on value axes and in the legend.
|
||||
* To enable prefixes, set usePrefixes property to true.
|
||||
* [
|
||||
* {number:1e+3,prefix:"k"},
|
||||
* {number:1e+6,prefix:"M"},
|
||||
* {number:1e+9,prefix:"G"},
|
||||
* {number:1e+12,prefix:"T"},
|
||||
* {number:1e+15,prefix:"P"},
|
||||
* {number:1e+18,prefix:"E"},
|
||||
* {number:1e+21,prefix:"Z"},
|
||||
* {number:1e+24,prefix:"Y"}
|
||||
* ]
|
||||
*/
|
||||
prefixesOfBigNumbers: any[];
|
||||
/**
|
||||
* Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc.
|
||||
* Prefixes are used on value axes and in the legend.
|
||||
* To enable prefixes, set usePrefixes property to true.
|
||||
* [
|
||||
* {number:1e-24, prefix:"y"},
|
||||
* {number:1e-21, prefix:"z"},
|
||||
* {number:1e-18, prefix:"a"},
|
||||
* {number:1e-15, prefix:"f"},
|
||||
* {number:1e-12, prefix:"p"},
|
||||
* {number:1e-9, prefix:"n"},
|
||||
* {number:1e-6, prefix:"μ"},
|
||||
* {number:1e-3, prefix:"m"}
|
||||
* ]
|
||||
*/
|
||||
prefixesOfSmallNumbers: any[];
|
||||
/**
|
||||
* Theme of a chart. Config files of themes can be found in amcharts/themes/ folder.
|
||||
* More info about using themes.
|
||||
*/
|
||||
theme: string;
|
||||
/**
|
||||
* Thousands separator.
|
||||
* @default "."
|
||||
*/
|
||||
thousandsSeparator: string;
|
||||
/**
|
||||
* Array of Title objects.
|
||||
*/
|
||||
titles: Title[];
|
||||
/**
|
||||
* Type of a chart. Required when creating chart using JSON.
|
||||
* Possible types are: serial, pie, xy, radar, funnel, gauge, map, stock.
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* If true, prefixes will be used for big and small numbers.
|
||||
* You can set arrays of prefixes via prefixesOfSmallNumbers and prefixesOfBigNumbers properties.
|
||||
*/
|
||||
usePrefixes: boolean;
|
||||
/**
|
||||
* Read-only. Indicates current version of a script.
|
||||
*/
|
||||
version: string;
|
||||
/**
|
||||
* Adds a label on a chart.
|
||||
* You can use it for labeling axes, adding chart title, etc. x and y coordinates can be set in
|
||||
* number, percent, or a number with ! in front of it -
|
||||
* coordinate will be calculated from right or bottom instead of left or top.
|
||||
* x - horizontal coordinate
|
||||
* y - vertical coordinate
|
||||
* text - label's text
|
||||
* align - alignment (left/right/center)
|
||||
* size - text size
|
||||
* color - text color
|
||||
* rotation - angle of rotation
|
||||
* alpha - label alpha
|
||||
* bold - specifies if text is bold (true/false),
|
||||
* url - url
|
||||
*/
|
||||
addLabel(
|
||||
x: number | string,
|
||||
y: number | string,
|
||||
text: string,
|
||||
align: string,
|
||||
size?: number,
|
||||
color?: string,
|
||||
rotation?: number,
|
||||
alpha?: number,
|
||||
bold?: boolean,
|
||||
url?: string,
|
||||
): any;
|
||||
/**
|
||||
* Adds a legend to the chart.
|
||||
* By default, you don't need to create div for your legend,
|
||||
* however if you want it to be positioned in some different way,
|
||||
* you can create div anywhere you want and pass id or reference to your div as a second parameter.
|
||||
* (NOTE: This method will not work on StockPanel.)
|
||||
* @param legend - The legend.
|
||||
* @param legendDivId - Id of the legend div (optional).
|
||||
*/
|
||||
addLegend(legend: AmLegend, legendDivId?: string): void;
|
||||
/**
|
||||
* Adds a legend to the chart.
|
||||
* By default, you don't need to create div for your legend,
|
||||
* however if you want it to be positioned in some different way,
|
||||
* you can create div anywhere you want and pass id or reference to your div as a second parameter.
|
||||
* (NOTE: This method will not work on StockPanel.)
|
||||
* @param legend - The legend.
|
||||
* @param legendDiv - Legend div (optional).
|
||||
*/
|
||||
addLegend(legend: AmLegend, legendDiv: HTMLElement): void;
|
||||
|
||||
/**
|
||||
* Adds title to the top of the chart. Pie, Radar positions are updated so that they won't overlap.
|
||||
* Plot area of Serial/XY chart is also updated unless autoMargins property is set to false.
|
||||
* You can add any number of titles - each of them will be placed in a new line.
|
||||
* To remove titles, simply clear titles array: chart.titles = []; and call chart.validateNow() method.
|
||||
* text - text of a title size - font size color - title color alpha - title opacity bold -
|
||||
* boolean value indicating if title should be bold.
|
||||
*/
|
||||
addTitle(text: string, size: number, color: string, alpha: number, bold: boolean): void;
|
||||
/**
|
||||
* Clears the chart area, intervals, etc.
|
||||
*/
|
||||
clear(): void;
|
||||
/**
|
||||
* Removes all labels added to the chart.
|
||||
*/
|
||||
clearLabels(): void;
|
||||
/**
|
||||
* Use this method to force the chart to resize to it's current container size.
|
||||
*/
|
||||
invalidateSize(): void;
|
||||
/**
|
||||
* Removes chart's legend.
|
||||
*/
|
||||
removeLegend(): void;
|
||||
/**
|
||||
* This method should be called after data in your data provider changed or a new array was set to dataProvider.
|
||||
* After calling this method the chart will parse data and redraw.
|
||||
*/
|
||||
validateData(): void;
|
||||
/**
|
||||
* This method should be called after you changed one or more properties of any class.
|
||||
* The chart will redraw after this method is called.
|
||||
*/
|
||||
validateNow(): void;
|
||||
|
||||
/**
|
||||
* Adds chart to the specified DIV.
|
||||
*/
|
||||
write(container: string | HTMLDivElement): void;
|
||||
|
||||
/**
|
||||
* Adds event listener of the type "dataUpdated" or "init" to the object.
|
||||
* @param type "dataUpdated" or "init".
|
||||
* @param handler
|
||||
* If the type is "dataUpdated".
|
||||
* Dispatched when chart is build for the first time or after validateData() method was called.
|
||||
* If the type is "init". Dispatched when chart is build for the first time.
|
||||
*/
|
||||
addListener(
|
||||
type: string,
|
||||
handler: (
|
||||
e: {
|
||||
type: string; // Either "dataUpdated" or "init".
|
||||
chart: AmChart;
|
||||
},
|
||||
) => void,
|
||||
): void;
|
||||
/**
|
||||
* Removes event listener from chart object.
|
||||
*/
|
||||
removeListener(chart: AmChart, type: string, handler: any): void;
|
||||
}
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
import AmChart from "./AmChart";
|
||||
import AmGraph from "./AmGraph";
|
||||
import GraphDataItem from "./GraphDataItem";
|
||||
import Guide from "./Guide";
|
||||
import ValueAxis from "./ValueAxis";
|
||||
|
||||
/**
|
||||
* AmCoordinateChart is a base class of AmRectangularChart. It can not be instantiated explicitly.
|
||||
*/
|
||||
export default class AmCoordinateChart extends AmChart {
|
||||
/**
|
||||
* Array, holding processed chart's data.
|
||||
*/
|
||||
chartData: object[];
|
||||
/**
|
||||
* Specifies the colors of the graphs if the lineColor of a graph is not set.
|
||||
* It there are more graphs then colors in this array, the chart picks random color.
|
||||
* @default ['#FF6600','#FCD202','#B0DE09','#0D8ECF','#2A0CD0','#CD0D74','#CC0000','#00CC00',
|
||||
* '#0000CC','#DDDDDD','#999999','#333333','#990000']
|
||||
*/
|
||||
colors: string[];
|
||||
/**
|
||||
* The array of graphs belonging to this chart.
|
||||
* To add/remove graph use addGraph/removeGraph methods instead of adding/removing graphs directly to array.
|
||||
*/
|
||||
graphs: AmGraph[];
|
||||
/**
|
||||
* Specifies if grid should be drawn above the graphs or below. Will not work properly with 3D charts.
|
||||
* @default false
|
||||
*/
|
||||
gridAboveGraphs: boolean;
|
||||
/**
|
||||
* Instead of adding guides to the axes, you can push all of them to this array.
|
||||
* In case guide has category or date defined, it will automatically will be assigned to the category axis.
|
||||
* Otherwise to first value axis, unless you specify a different valueAxis for the guide.
|
||||
*/
|
||||
guides: Guide[];
|
||||
/**
|
||||
* Specifies whether the animation should be sequenced or all objects should appear at once.
|
||||
* @default true
|
||||
*/
|
||||
sequencedAnimation: boolean;
|
||||
/**
|
||||
* The initial opacity of the column/line.
|
||||
* If you set startDuration to a value higher than 0, the columns/lines will fade in from startAlpha.
|
||||
* Value range is 0 - 1.
|
||||
* @default 1
|
||||
*/
|
||||
startAlpha: number;
|
||||
/**
|
||||
* Duration of the animation, in seconds.
|
||||
*/
|
||||
startDuration: number;
|
||||
/**
|
||||
* Animation effect.
|
||||
* Possible values are ">", "<", elastic" and "bounce".
|
||||
* @default "elastic"
|
||||
*/
|
||||
startEffect: string;
|
||||
/**
|
||||
* Target of url.
|
||||
* @default this
|
||||
*/
|
||||
urlTarget: any;
|
||||
/**
|
||||
* The array of value axes.
|
||||
* To add/remove value axis use addValueAxis/removeValueAxis methods instead of
|
||||
* adding/removing axes directly to array.
|
||||
* Chart creates one value axis automatically, so if you need only one value axis, you don't need to create it.
|
||||
*/
|
||||
valueAxes: any[];
|
||||
/**
|
||||
* Adds a graph to the chart.
|
||||
*/
|
||||
addGraph(graph: AmGraph): void;
|
||||
/**
|
||||
* Adds value axis to the chart.
|
||||
* One value axis is created automatically, so if you don't want to change anything or add more value axes,
|
||||
* you don't need to add it.
|
||||
*/
|
||||
addValueAxis(axis: ValueAxis): void;
|
||||
/**
|
||||
* You can trigger the animation of the chart.
|
||||
*/
|
||||
animateAgain(): void;
|
||||
/**
|
||||
* AmGraph Returns graph by id.
|
||||
*/
|
||||
getGraphById(graphId: string): AmGraph;
|
||||
/**
|
||||
* Returns value axis by id.
|
||||
*/
|
||||
getValueAxisById(axisId: string): ValueAxis;
|
||||
/**
|
||||
* Hide the graph (if it is visible).
|
||||
* Usually this method is called from the Legend, when you click on the legend marker.
|
||||
*/
|
||||
hideGraph(graph: AmGraph): void;
|
||||
/**
|
||||
* Hide value balloon of a graph.
|
||||
* Usually this method is called from the Legend, when you click on the legend text.
|
||||
*/
|
||||
hideGraphsBalloon(graph: AmGraph): void;
|
||||
/**
|
||||
* Highlight the graph. Usually this method is called from the Legend, when you roll-over the legend entry.
|
||||
*/
|
||||
highlightGraph(graph: AmGraph): void;
|
||||
/**
|
||||
* Removes graph from the chart.
|
||||
*/
|
||||
removeGraph(graph: AmGraph): void;
|
||||
/**
|
||||
* Removes value axis from the chart.
|
||||
* When you remove value axis, all graphs assigned to this axis are also removed.
|
||||
*/
|
||||
removeValueAxis(axis: ValueAxis): void;
|
||||
/**
|
||||
* Show the graph (if it is hidden).
|
||||
* Usually this method is called from the Legend, when you click on the legend marker.
|
||||
*/
|
||||
showGraph(graph: AmGraph): void;
|
||||
/**
|
||||
* Show value balloon of a graph.
|
||||
* Usually this method is called from the Legend, when you click on the legend text.
|
||||
*/
|
||||
showGraphsBalloon(graph: AmGraph): void;
|
||||
/**
|
||||
* UnhighlightGraph the graph.
|
||||
* Usually this method is called from the Legend, when you roll-out the legend entry.
|
||||
*/
|
||||
unhighlightGraph(graph: AmGraph): void;
|
||||
/**
|
||||
* Adds event listener of the type "clickGraphItem" or "doubleClickGraphItem" or
|
||||
* "rightClickGraphItem" or "rollOutGraphItem" or "rollOverGraphItem" to the object.
|
||||
* @param type Either "clickGraphItem" or "doubleClickGraphItem" or "rightClickGraphItem"
|
||||
* or "rollOutGraphItem" or "rollOverGraphItem".
|
||||
* @param handler Dispatched when user clicks on the data item (column/bullet)
|
||||
*/
|
||||
addListener(
|
||||
type: string,
|
||||
handler: (
|
||||
e: {
|
||||
type: string;
|
||||
graph: AmGraph;
|
||||
item: GraphDataItem;
|
||||
index: number;
|
||||
chart: AmChart;
|
||||
},
|
||||
) => void,
|
||||
): void;
|
||||
}
|
||||
Vendored
+652
@@ -0,0 +1,652 @@
|
||||
import AmBalloon from "./AmBalloon";
|
||||
import GraphDataItem from "./GraphDataItem";
|
||||
import ValueAxis from "./ValueAxis";
|
||||
|
||||
/**
|
||||
* AmGraph class displays all types of graphs - line, column, step line, smoothed line, ohlc and candlestick.
|
||||
* @example
|
||||
* let chart = new AmCharts.AmSerialChart();
|
||||
* let graph = new AmCharts.AmGraph();
|
||||
* graph.valueField = 'value';
|
||||
* graph.type = 'column';
|
||||
* graph.fillAlphas = 1;
|
||||
* chart.addGraph(graph);
|
||||
*/
|
||||
export default class AmGraph {
|
||||
/**
|
||||
* Text which screen readers will read if user rolls-over the bullet/column or sets focus using tab key
|
||||
* (this is possible only if tabIndex property of AmGraph is set to some number).
|
||||
* Text is added as aria-label tag. Note - not all screen readers and browsers support this.
|
||||
* @default "[[title]] [[category]] [[value]]"
|
||||
*/
|
||||
accessibleLabel: string;
|
||||
/**
|
||||
* Name of the alpha field in your dataProvider.
|
||||
*/
|
||||
alphaField: string;
|
||||
/**
|
||||
* If you set this to true before chart is drawn, the animation of this graph won't be played.
|
||||
* @default false
|
||||
*/
|
||||
animationPlayed: boolean;
|
||||
/**
|
||||
* Allows customizing graphs balloons individually (only when ChartCursor is used).
|
||||
* Note: the balloon object is not created automatically, you should create it before setting properties
|
||||
*/
|
||||
balloon: AmBalloon;
|
||||
/**
|
||||
* Value balloon color. Will use graph or data item color if not set.
|
||||
*/
|
||||
balloonColor: string;
|
||||
/**
|
||||
* If you set some function, the graph will call it and pass GraphDataItem and AmGraph objects to it.
|
||||
* This function should return a string which will be displayed in a balloon.
|
||||
*/
|
||||
balloonFunction(graphDataItem: GraphDataItem, amGraph: AmGraph): string;
|
||||
/**
|
||||
* Balloon text.
|
||||
* You can use tags like
|
||||
* [[value]],
|
||||
* [[description]],
|
||||
* [[percents]],
|
||||
* [[open]],
|
||||
* [[category]]
|
||||
* or any other field name from your data provider. HTML tags can also be used.
|
||||
* @default [[value]]
|
||||
*/
|
||||
balloonText: string;
|
||||
/**
|
||||
* Specifies if the line graph should be placed behind column graphs
|
||||
* @default false
|
||||
*/
|
||||
behindColumns: boolean;
|
||||
/**
|
||||
* Type of the bullets.
|
||||
* Possible values are:
|
||||
* "none", "round", "square", "triangleUp", "triangleDown", "triangleLeft", "triangleRight",
|
||||
* "bubble", "diamond", "xError", "yError" and "custom".
|
||||
* @default "none"
|
||||
*/
|
||||
bullet: string;
|
||||
/**
|
||||
* Opacity of bullets. Value range is 0 - 1.
|
||||
* @default 1
|
||||
*/
|
||||
bulletAlpha: number;
|
||||
/**
|
||||
* bulletAxis value is used when you are building error chart.
|
||||
* Error chart is a regular serial or XY chart with bullet type set to "xError" or "yError".
|
||||
* The graph should know which axis should be used to determine the size of this bullet -
|
||||
* that's when bulletAxis should be set. Besides that, you should also set graph.errorField.
|
||||
* You can also use other bullet types with this feature too.
|
||||
* For example, if you set bulletAxis for XY chart, the size of a bullet will change as you zoom the chart.
|
||||
*/
|
||||
bulletAxis: ValueAxis;
|
||||
/**
|
||||
* Bullet border opacity.
|
||||
* @default 0
|
||||
*/
|
||||
bulletBorderAlpha: number;
|
||||
/**
|
||||
* Bullet border color. Will use lineColor if not set.
|
||||
*/
|
||||
bulletBorderColor: string;
|
||||
/**
|
||||
* Bullet border thickness.
|
||||
* @default 2
|
||||
*/
|
||||
bulletBorderThickness: number;
|
||||
/**
|
||||
* Bullet color. Will use lineColor if not set.
|
||||
*/
|
||||
bulletColor: string;
|
||||
/**
|
||||
* Name of the bullet field in your dataProvider.
|
||||
*/
|
||||
bulletField: string;
|
||||
/**
|
||||
* Useful for touch devices - if you set it to 20 or so, the bullets of a graph will have
|
||||
* invisible circle around the actual bullet (bullets should still be enabled),
|
||||
* which will be easier to touch (bullets usually are smaller and hard to hit).
|
||||
*/
|
||||
bulletHitAreaSize: number;
|
||||
/**
|
||||
* Bullet offset. Distance from the actual data point to the bullet.
|
||||
* Can be used to place custom bullets above the columns.
|
||||
* @default 0
|
||||
*/
|
||||
bulletOffset: number;
|
||||
/**
|
||||
* Bullet size.
|
||||
* @default 8
|
||||
*/
|
||||
bulletSize: number;
|
||||
/**
|
||||
* Name of the bullet size field in your dataProvider.
|
||||
*/
|
||||
bulletSizeField: string;
|
||||
/**
|
||||
* If this field is set and addClassNames is enabled, the chart will look for a class name string in
|
||||
* data using this setting and apply additional class names to elements of the particular data points,
|
||||
* such as bullets.
|
||||
*/
|
||||
classNameField: string;
|
||||
/**
|
||||
* Name of the close field (used by candlesticks and ohlc) in your dataProvider.
|
||||
*/
|
||||
closeField: string;
|
||||
/**
|
||||
* In case you want to place this graph's columns in front of other columns, set this to false.
|
||||
* In case "true", the columns will be clustered next to each other.
|
||||
* NOTE: clustering works only for graphs of type "column".
|
||||
* @default true
|
||||
*/
|
||||
clustered: boolean;
|
||||
/**
|
||||
* Color of value labels. Will use chart's color if not set.
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Name of the color field in your dataProvider.
|
||||
*/
|
||||
colorField: string;
|
||||
/**
|
||||
* You can use this property with non-stacked column graphs and specify order of columns of each category
|
||||
* (starting from 0).
|
||||
* Important: this feature does not work in stacked columns scenarios as well as with graph
|
||||
* toggling enabled in legend.
|
||||
*/
|
||||
columnIndexField: string;
|
||||
/**
|
||||
* You can specify custom column width for each graph individually.
|
||||
* Value range is 0 - 1 (we set relative width, not pixel width here).
|
||||
*/
|
||||
columnWidth: number;
|
||||
/**
|
||||
* Specifies whether to connect data points if data is missing. The default value is true.
|
||||
* This feature does not work with XY chart.
|
||||
* @default true
|
||||
*/
|
||||
connect: boolean;
|
||||
/**
|
||||
* Corner radius of column. It can be set both in pixels or in percents.
|
||||
* The chart's depth and angle styles must be set to 0. The default value is 0.
|
||||
* Note, cornerRadiusTop will be applied for all corners of the column,
|
||||
* JavaScript charts do not have a possibility to set separate corner radius for top and bottom.
|
||||
* As we want all the property names to be the same both on JS and Flex, we didn't change this too.
|
||||
* @default 0
|
||||
*/
|
||||
cornerRadiusTop: number;
|
||||
/**
|
||||
* If bulletsEnabled of ChartCurosor is true, a bullet on each graph follows the cursor.
|
||||
* You can set opacity of each graphs bullet. In case you want to disable these bullets for a certain graph,
|
||||
* set opacity to 0.
|
||||
* @default 1
|
||||
*/
|
||||
cursorBulletAlpha: number;
|
||||
/**
|
||||
* Path to the image of custom bullet.
|
||||
*/
|
||||
customBullet: string;
|
||||
/**
|
||||
* Name of the custom bullet field in your dataProvider.
|
||||
*/
|
||||
customBulletField: string;
|
||||
/**
|
||||
* Path to the image for legend marker.
|
||||
*/
|
||||
customMarker: string;
|
||||
/**
|
||||
* Dash length. If you set it to a value greater than 0, the graph line (or columns border) will be dashed.
|
||||
* @default 0
|
||||
*/
|
||||
dashLength: number;
|
||||
/**
|
||||
* Name of the dash length field in your dataProvider.
|
||||
* This property adds a possibility to change graphs’ line from solid to dashed on any data point.
|
||||
* You can also make columns border dashed using this setting. Note, this won't work with smoothedLineGraph.
|
||||
*/
|
||||
dashLengthField: string;
|
||||
/**
|
||||
* Used to format balloons if value axis is date-based.
|
||||
* @default "MMM DD, YYYY"
|
||||
*/
|
||||
dateFormat: string;
|
||||
/**
|
||||
* Name of the description field in your dataProvider.
|
||||
*/
|
||||
descriptionField: string;
|
||||
/**
|
||||
* Name of error value field in your data provider.
|
||||
*/
|
||||
errorField: string;
|
||||
/**
|
||||
* Opacity of fill. Plural form is used to keep the same property names as our Flex charts'.
|
||||
* Flex charts can accept array of numbers to generate gradients.
|
||||
* Although you can set array here, only first value of this array will be used.
|
||||
* @default 0
|
||||
*/
|
||||
fillAlphas: number;
|
||||
/**
|
||||
* Fill color. Will use lineColor if not set. You can also set array of colors here.
|
||||
*/
|
||||
fillColors: string;
|
||||
/**
|
||||
* Name of the fill colors field in your dataProvider.
|
||||
* This property adds a possibility to change line graphs’ fill color on any data point to create highlighted
|
||||
* sections of the graph. Works only with AmSerialChart.
|
||||
*/
|
||||
fillColorsField: string;
|
||||
/**
|
||||
* XY chart only. If you set this property to id or reference of your X or Y axis, and the fillAlphas is > 0,
|
||||
* the area between graph and axis will be filled with color, like in this demo.
|
||||
*/
|
||||
fillToAxis: ValueAxis;
|
||||
/**
|
||||
* You can set another graph here and if fillAlpha is >0, the area from this graph to fillToGraph will be filled
|
||||
* (instead of filling the area to the X axis).
|
||||
* This feature is not supported by smoothedLine graphs and Radar chart.
|
||||
*/
|
||||
fillToGraph: AmGraph;
|
||||
/**
|
||||
* Column width in pixels.
|
||||
* If you set this property, columns will be of a fixed width and won't adjust to the available space.
|
||||
*/
|
||||
fixedColumnWidth: number;
|
||||
/**
|
||||
* Size of value labels text. Will use chart's fontSize if not set.
|
||||
*/
|
||||
fontSize: number;
|
||||
/**
|
||||
* If this is set `true`, the graph will always break the line if the distance in time between
|
||||
* two adjacent data points is bigger than `gapPeriod x minPeriod`, even if `connect` is set to `true`.
|
||||
* @default false
|
||||
*/
|
||||
forceGap: boolean;
|
||||
/**
|
||||
* Name of the gap field in your dataProvider.
|
||||
* You can force graph to show gap at a desired data point using this feature.
|
||||
* This feature does not work with XY chart.
|
||||
*/
|
||||
gapField: string;
|
||||
/**
|
||||
* Using this property you can specify when graph should display gap -
|
||||
* if the time difference between data points is bigger than duration of minPeriod * gapPeriod,
|
||||
* and connect property of a graph is set to false, graph will display gap.
|
||||
* @default 1.1
|
||||
*/
|
||||
gapPeriod: number;
|
||||
/**
|
||||
* Orientation of the gradient fills (only for "column" graph type).
|
||||
* Possible values are "vertical" and "horizontal".
|
||||
* @default "vertical"
|
||||
*/
|
||||
gradientOrientation: string;
|
||||
/**
|
||||
* Specifies whether the graph is hidden.
|
||||
* Do not use this to show/hide the graph, use hideGraph(graph) and showGraph(graph) methods instead.
|
||||
* @default false
|
||||
*/
|
||||
hidden: boolean;
|
||||
/**
|
||||
* If there are more data points than hideBulletsCount, the bullets will not be shown.
|
||||
* 0 means the bullets will always be visible.
|
||||
* @default 0
|
||||
*/
|
||||
hideBulletsCount: number;
|
||||
/**
|
||||
* Name of the high field (used by candlesticks and ohlc) in your dataProvider.
|
||||
*/
|
||||
highField: string;
|
||||
/**
|
||||
* Unique id of a graph.
|
||||
* It is not required to set one, unless you want to use this graph for as your scrollbar's graph and need
|
||||
* to indicate which graph should be used.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Whether to include this graph when calculating min and max value of the axis.
|
||||
* @default true
|
||||
*/
|
||||
includeInMinMax: boolean;
|
||||
/**
|
||||
* Data label text anchor.
|
||||
* @default "auto"
|
||||
*/
|
||||
labelAnchor: string;
|
||||
/**
|
||||
* Name of label color field in data provider.
|
||||
*/
|
||||
labelColorField: string;
|
||||
/**
|
||||
* You can use it to format labels of data items in any way you want.
|
||||
* Graph will call this function and pass reference to GraphDataItem and formatted text as attributes.
|
||||
* This function should return string which will be displayed as label.
|
||||
*/
|
||||
labelFunction(value: number, valueText: string, valueAxis: ValueAxis): string;
|
||||
labelFunction(valueText: string, data: Date, valueAxis: ValueAxis): string;
|
||||
/**
|
||||
* Offset of data label.
|
||||
* @default 0
|
||||
*/
|
||||
labelOffset: number;
|
||||
/**
|
||||
* Position of value label. Possible values are: "bottom", "top", "right", "left", "inside", "middle".
|
||||
* Sometimes position is changed by the chart, depending on a graph type, rotation, etc.
|
||||
* @default "top"
|
||||
*/
|
||||
labelPosition: string;
|
||||
/**
|
||||
* Rotation of a data label.
|
||||
* @default 0
|
||||
*/
|
||||
labelRotation: number;
|
||||
/**
|
||||
* Value label text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]].
|
||||
*/
|
||||
labelText: string;
|
||||
/**
|
||||
* Legend marker opacity. Will use lineAlpha if not set. Value range is 0 - 1.
|
||||
*/
|
||||
legendAlpha: number;
|
||||
/**
|
||||
* Legend marker color. Will use lineColor if not set.
|
||||
*/
|
||||
legendColor: string;
|
||||
/**
|
||||
* It is called and the following attributes are passed:
|
||||
* dataItem, formattedText, periodValues, periodPercentValues
|
||||
* It should return hex color code which will be used for legend marker.
|
||||
*/
|
||||
legendColorFunction: object;
|
||||
/**
|
||||
* The text which will be displayed in the value portion of the legend when user is not hovering above
|
||||
* any data point. The tags should be made out of two parts - the name of a field
|
||||
* (value / open / close / high / low)
|
||||
* and the value of the period you want to be show -
|
||||
* open / close / high / low / sum / average / count.
|
||||
* For example: [[value.sum]]
|
||||
* means that sum of all data points of value field in the selected period will be displayed.
|
||||
*/
|
||||
legendPeriodValueText: string;
|
||||
/**
|
||||
* Legend value text.
|
||||
* You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]]
|
||||
* You can also use custom fields from your dataProvider. If not set, uses Legend's valueText.
|
||||
*/
|
||||
legendValueText: string;
|
||||
/**
|
||||
* Opacity of the line (or column border). Value range is 0 - 1.
|
||||
* @default 1
|
||||
*/
|
||||
lineAlpha: number;
|
||||
/**
|
||||
* Color of the line (or column border).
|
||||
* If you do not set any, the color from AmCoordinateChart.colors array will be used for each subsequent graph.
|
||||
*/
|
||||
lineColor: string;
|
||||
/**
|
||||
* Name of the line color field in your dataProvider.
|
||||
* This property adds a possibility to change graphs’ line color on any data point to create highlighted
|
||||
* sections of the graph. Works only with AmSerialChart.
|
||||
*/
|
||||
lineColorField: string;
|
||||
/**
|
||||
* Specifies thickness of the graph line (or column border).
|
||||
* @default 1
|
||||
*/
|
||||
lineThickness: number;
|
||||
/**
|
||||
* Name of the low field (used by candlesticks and ohlc) in your dataProvider.
|
||||
*/
|
||||
lowField: string;
|
||||
/**
|
||||
* Legend marker type. You can set legend marker (key) type for individual graphs.
|
||||
* Possible values are:
|
||||
* square, circle, diamond, triangleUp, triangleDown, triangleLeft, triangleDown, bubble, line, none.
|
||||
*/
|
||||
markerType: string;
|
||||
/**
|
||||
* Specifies size of the bullet which value is the biggest (XY chart).
|
||||
* @default 50
|
||||
*/
|
||||
maxBulletSize: number;
|
||||
/**
|
||||
* Specifies minimum size of the bullet (XY chart).
|
||||
* @default 4
|
||||
*/
|
||||
minBulletSize: number;
|
||||
/**
|
||||
* It is useful if you have really lots of data points.
|
||||
* Based on this property the graph will omit some of the lines
|
||||
* (if the distance between points is less that minDistance, in pixels).
|
||||
* This will not affect the bullets or indicator in anyway, so the user will not see any difference
|
||||
* (unless you set minValue to a bigger value, let say 5),
|
||||
* but will increase performance as less lines will be drawn.
|
||||
* By setting value to a bigger number you can also make your lines look less jagged.
|
||||
* @default 1
|
||||
*/
|
||||
minDistance: number;
|
||||
/**
|
||||
* If you use different colors for your negative values, a graph below zero line is filled with negativeColor.
|
||||
* With this property you can define a different base value at which
|
||||
* colors should be changed to negative colors.
|
||||
* @default 0
|
||||
*/
|
||||
negativeBase: number;
|
||||
/**
|
||||
* Fill opacity of negative part of the graph. Will use fillAlphas if not set.
|
||||
*/
|
||||
negativeFillAlphas: number;
|
||||
/**
|
||||
* Fill color of negative part of the graph. Will use fillColors if not set.
|
||||
*/
|
||||
negativeFillColors: string;
|
||||
/**
|
||||
* Opacity of the negative portion of the line (or column border). Value range is 0 - 1.
|
||||
* @default 1
|
||||
*/
|
||||
negativeLineAlpha: number;
|
||||
/**
|
||||
* Color of the line (or column) when the values are negative.
|
||||
* In case the graph type is "candlestick" or "ohlc", "negativeLineColor" is used
|
||||
* when close value is less then open value.
|
||||
*/
|
||||
negativeLineColor: string;
|
||||
/**
|
||||
* If you set it to true, column chart will begin new stack.
|
||||
* This allows having Clustered and Stacked column/bar chart.
|
||||
* @default false
|
||||
*/
|
||||
newStack: boolean;
|
||||
/**
|
||||
* In case you want to have a step line graph without risers, you should set this to true.
|
||||
* @default false
|
||||
*/
|
||||
noStepRisers: boolean;
|
||||
/**
|
||||
* Name of the open field (used by floating columns, candlesticks and ohlc) in your dataProvider.
|
||||
*/
|
||||
openField: string;
|
||||
/**
|
||||
* Value of pattern should be object with url, width, height of an image, optionally it might have x, y, randomX
|
||||
* and randomY values.
|
||||
* For example: {"url":"../amcharts/patterns/black/pattern1.png", "width":4, "height":4}.
|
||||
* If you want to have individual patterns for each column, define patterns in data provider and set
|
||||
* graph.patternField property. Check amcharts/patterns folder for some patterns.
|
||||
* You can create your own patterns and use them. Note, x, y, randomX and randomY properties won't work
|
||||
* with IE8 and older. 3D bar/Pie charts won't work properly with patterns.
|
||||
*/
|
||||
pattern: object;
|
||||
/**
|
||||
* Field name in your data provider which holds pattern information.
|
||||
* Value of pattern should be object with url, width, height of an image,
|
||||
* optionally it might have x, y, randomX and randomY values.
|
||||
* For example: {"url":"../amcharts/patterns/black/pattern1.png", "width":4, "height":4}.
|
||||
* Check amcharts/patterns folder for some patterns. You can create your own patterns and use them.
|
||||
* Note, x, y, randomX and randomY properties won't work with IE8 and older.
|
||||
* 3D bar/Pie charts won't work properly with patterns.
|
||||
*/
|
||||
patternField: string;
|
||||
/**
|
||||
* This property can be used by step graphs - you can set how many periods one horizontal line should span.
|
||||
* @default 1
|
||||
*/
|
||||
periodSpan: number;
|
||||
/**
|
||||
* Specifies where data points should be placed -
|
||||
* on the beginning of the period (day, hour, etc) or in the middle
|
||||
* (only when parseDates property of categoryAxis is set to true).
|
||||
* This setting affects Serial chart only. Possible values are "start", "middle" and "end"
|
||||
* @default "middle"
|
||||
*/
|
||||
pointPosition: string;
|
||||
/**
|
||||
* Precision of values. Will use chart's precision if not set any.
|
||||
*/
|
||||
precision: number;
|
||||
/**
|
||||
* If this is set to true, candlesticks will be colored in a different manner -
|
||||
* if current close is less than current open, the candlestick will be empty, otherwise - filled with color.
|
||||
* If previous close is less than current close, the candlestick will use positive color,
|
||||
* otherwise - negative color.
|
||||
* @default false
|
||||
*/
|
||||
proCandlesticks: boolean;
|
||||
/**
|
||||
* Gantt chart only. Contains unmodified segment object from data provider.
|
||||
*/
|
||||
segmentData: object;
|
||||
/**
|
||||
* If graph's type is column and labelText is set, graph hides labels which do not fit into the column's
|
||||
* space or go outside plot area. If you don't want these labels to be hidden, set this to true.
|
||||
* @default false
|
||||
*/
|
||||
showAllValueLabels: boolean;
|
||||
/**
|
||||
* Specifies whether the value balloon of this graph is shown when mouse is over data item or chart's
|
||||
* indicator is over some series.
|
||||
* @default true
|
||||
*/
|
||||
showBalloon: boolean;
|
||||
/**
|
||||
* Specifies graphs value at which cursor is showed. This is only important for candlestick and ohlc charts,
|
||||
* also if column chart has "open" value.
|
||||
* Possible values are: "open", "close", "high", "low".
|
||||
* "top" and "bottom" values will glue the balloon to top/bottom of the plot area.
|
||||
* @default "close"
|
||||
*/
|
||||
showBalloonAt: string;
|
||||
/**
|
||||
* Works with candlestick graph type, you can set it to open, close, high, low.
|
||||
* If you set it to high, the events will be shown at the tip of the high line.
|
||||
* @default "close"
|
||||
*/
|
||||
showBulletsAt: string;
|
||||
/**
|
||||
* If you want mouse pointer to change to hand when hovering the graph, set this property to true.
|
||||
* @default false
|
||||
*/
|
||||
showHandOnHover: boolean;
|
||||
/**
|
||||
* It can only be used together with topRadius (when columns look like cylinders).
|
||||
* If you set it to true, the cylinder will be lowered down so that the center of it's bottom circle would be
|
||||
* right on category axis.
|
||||
* @default false
|
||||
*/
|
||||
showOnAxis: boolean;
|
||||
/**
|
||||
* If the value axis of this graph has stack types like "regular" or "100%"
|
||||
* You can exclude this graph from stacking.
|
||||
* @default true
|
||||
*/
|
||||
stackable: boolean;
|
||||
/**
|
||||
* Step graph only. Specifies to which direction step should be drawn.
|
||||
* @default "right"
|
||||
*/
|
||||
stepDirection: string;
|
||||
/**
|
||||
* If you set it to false, the graph will not be hidden when user clicks on legend entry.
|
||||
* @default true
|
||||
*/
|
||||
switchable: boolean;
|
||||
/**
|
||||
* In case you set it to some number, the chart will set focus on bullet/column (starting from first)
|
||||
* when user clicks tab key. When a focus is set, screen readers like NVDA Screen reader will read label
|
||||
* which is set using accessibleLabel property of AmGraph. Note, not all browsers and readers support this.
|
||||
*/
|
||||
tabIndex: number;
|
||||
/**
|
||||
* Graph title.
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* If you set this to 1, columns will become cylinders (must set depth3D and angle properties of a chart to >0
|
||||
* values in order this to be visible). you can make columns look like cones (set topRadius to 0)
|
||||
* or even like some glasses (set to bigger than 1). We strongly recommend setting grid opacity to 0
|
||||
* in order this to look good.
|
||||
*/
|
||||
topRadius: number;
|
||||
/**
|
||||
* Type of the graph.
|
||||
* Possible values are: "line", "column", "step", "smoothedLine", "candlestick", "ohlc".
|
||||
* XY and Radar charts can only display "line" type graphs.
|
||||
* @default "line"
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* Name of the url field in your dataProvider.
|
||||
*/
|
||||
urlField: string;
|
||||
/**
|
||||
* Target to open URLs in, i.e. _blank, _top, etc.
|
||||
*/
|
||||
urlTarget: string;
|
||||
/**
|
||||
* If set to true, the bullet border will take the same color as graph line.
|
||||
* @default false
|
||||
*/
|
||||
useLineColorForBulletBorder: boolean;
|
||||
/**
|
||||
* If negativeLineColor and/or negativeFillColors are set and useNegativeColorIfDown is set to true
|
||||
* (default is false), the line, step and column graphs will use these colors for lines,
|
||||
* bullets or columns if previous value is bigger than current value. In case you set openField for the graph,
|
||||
* the graph will compare current value with openField value instead of comparing to previous value.
|
||||
* @default false
|
||||
*/
|
||||
useNegativeColorIfDown: boolean;
|
||||
/**
|
||||
* Specifies which value axis the graph will use. Will use the first value axis if not set.
|
||||
* You can use reference to the real ValueAxis object or set value axis id.
|
||||
* @default ValueAxis
|
||||
*/
|
||||
valueAxis: ValueAxis;
|
||||
/**
|
||||
* Name of the value field in your dataProvider.
|
||||
*/
|
||||
valueField: string;
|
||||
/**
|
||||
* Specifies whether this graph should be shown in the Legend.
|
||||
* @default true
|
||||
*/
|
||||
visibleInLegend: boolean;
|
||||
/**
|
||||
* XY chart only. A horizontal value axis object to attach graph to.
|
||||
* @default ValueAxis
|
||||
*/
|
||||
xAxis: ValueAxis;
|
||||
/**
|
||||
* XY chart only. Name of the x field in your dataProvider.
|
||||
*/
|
||||
xField: string;
|
||||
/**
|
||||
* XY chart only. A vertical value axis object to attach graph to.
|
||||
* @default ValueAxis
|
||||
*/
|
||||
yAxis: ValueAxis;
|
||||
/**
|
||||
* XY chart only. Name of the y field in your dataProvider.
|
||||
*/
|
||||
yField: string;
|
||||
}
|
||||
Vendored
+247
@@ -0,0 +1,247 @@
|
||||
import AmChart from "./AmChart";
|
||||
|
||||
/**
|
||||
* AmLegend is the class that displays legend of the chart.
|
||||
* Legend to the chart should be added using chart.addLegend(legend) method.
|
||||
* @example
|
||||
* let chart = new AmCharts.AmSerialChart();
|
||||
* let legend = new AmCharts.AmLegend();
|
||||
* chart.addLegend(legend);
|
||||
*/
|
||||
export default class AmLegend {
|
||||
/**
|
||||
* Alignment of legend entries. Possible values are: "left", "center", "right". left
|
||||
*/
|
||||
align: string;
|
||||
/**
|
||||
* Used if chart is Serial or XY.
|
||||
* In case true, margins of the legend are adjusted and made equal to chart's margins.
|
||||
* @default true
|
||||
*/
|
||||
autoMargins: boolean;
|
||||
/**
|
||||
* Opacity of legend's background. Value range is 0 - 1
|
||||
*/
|
||||
backgroundAlpha: number;
|
||||
/**
|
||||
* Background color. You should set backgroundAlpha to >0 vallue in order background to be visible.
|
||||
* @default "#FFFFFF"
|
||||
*/
|
||||
backgroundColor: string;
|
||||
/**
|
||||
* Opacity of chart's border. Value range is 0 - 1.
|
||||
*/
|
||||
borderAlpha: number;
|
||||
/**
|
||||
* Color of legend's border. You should set borderAlpha >0 in order border to be visible.
|
||||
* @default "#000000"
|
||||
*/
|
||||
borderColor: string;
|
||||
/**
|
||||
* In case legend position is set to "absolute", you can set distance from bottom of the chart, in pixels.
|
||||
*/
|
||||
bottom: number;
|
||||
/**
|
||||
* Text color. Will use chart's color if not set.
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* This can be used by AmMap only.
|
||||
* You can pass array of objects with title, color, markerType values, for example:
|
||||
* [{title: "One", color: "#3366CC"},{title: "Two", color: "#FFCC33"}]
|
||||
*/
|
||||
data: any[];
|
||||
/**
|
||||
* Specifies if each of legend entry should be equal to the most wide entry.
|
||||
* Won't look good if legend has more than one line.
|
||||
* @default true
|
||||
*/
|
||||
equalWidths: boolean;
|
||||
/**
|
||||
* Font size. Will use chart's font size if not set.
|
||||
*/
|
||||
fontSize: string;
|
||||
/**
|
||||
* Horizontal space between legend item and left/right border.
|
||||
*/
|
||||
horizontalGap: number;
|
||||
/**
|
||||
* The text which will be displayed in the legend.
|
||||
* Tag [[title]] will be replaced with the title of the graph. [[title]]
|
||||
*/
|
||||
labelText: string;
|
||||
/**
|
||||
* In case legend position is set to "absolute", you can set distance from left side of the chart, in pixels.
|
||||
*/
|
||||
left: number;
|
||||
/**
|
||||
* Bottom margin.
|
||||
*/
|
||||
marginBottom: number;
|
||||
/**
|
||||
* Left margin.
|
||||
* This property will be ignored if chart is Serial or XY
|
||||
* and autoMargins property of the legend is true (default).
|
||||
* @default 20
|
||||
*/
|
||||
marginLeft: number;
|
||||
/**
|
||||
* Right margin.
|
||||
* This property will be ignored if chart is Serial or XY
|
||||
* and autoMargins property of the legend is true (default).
|
||||
* @default 20
|
||||
*/
|
||||
marginRight: number;
|
||||
/**
|
||||
* Top margin.
|
||||
*/
|
||||
marginTop: number;
|
||||
/**
|
||||
* Marker border opacity 1.
|
||||
*/
|
||||
markerBorderAlpha: number;
|
||||
/**
|
||||
* Marker border color. If not set, will use the same color as marker.
|
||||
*/
|
||||
markerBorderColor: string;
|
||||
/**
|
||||
* Thickness of the legend border.
|
||||
* The default value (0) means the line will be a "hairline" (1 px).
|
||||
* In case marker type is line, this style will be used for line thickness.
|
||||
* @default 1
|
||||
*/
|
||||
markerBorderThickness: number;
|
||||
/**
|
||||
* The color of the disabled marker (when the graph is hidden). #AAB3B3
|
||||
*/
|
||||
markerDisabledColor: string;
|
||||
/**
|
||||
* Space between legend marker and legend text, in pixels.
|
||||
* @default 5
|
||||
*/
|
||||
markerLabelGap: number;
|
||||
/**
|
||||
* Size of the legend marker (key).
|
||||
* @default 16
|
||||
*/
|
||||
markerSize: number;
|
||||
/**
|
||||
* Shape of the legend marker (key).
|
||||
* Possible values are:
|
||||
* "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble", "none". square
|
||||
*/
|
||||
markerType: string;
|
||||
/**
|
||||
* Maximum number of columns in the legend.
|
||||
* If Legend's position is set to "right" or "left", maxColumns is automatically set to 1.
|
||||
*/
|
||||
maxColumns: number;
|
||||
/**
|
||||
* Position of a legend. Possible values are: "bottom", "top", "left", "right" and "absolute".
|
||||
* In case "absolute", you should set left and top properties too. (this setting is ignored in Stock charts).
|
||||
* In case legend is used with AmMap, position is set to "absolute" automatically. bottom
|
||||
*/
|
||||
position: string;
|
||||
/**
|
||||
* Specifies whether legend entries should be placed in reversed order.
|
||||
*/
|
||||
reversedOrder: boolean;
|
||||
/**
|
||||
* In case legend position is set to "absolute", you can set distance from right side of the chart, in pixels.
|
||||
*/
|
||||
right: number;
|
||||
/**
|
||||
* Legend item text color on roll-over. #CC0000
|
||||
*/
|
||||
rollOverColor: string;
|
||||
/**
|
||||
* When you roll-over the legend entry, all other graphs can reduce their opacity,
|
||||
* so that the graph you rolled-over would be distinguished. This style specifies the opacity of the graphs.
|
||||
* @default 1
|
||||
*/
|
||||
rollOverGraphAlpha: number;
|
||||
/**
|
||||
* You can use this property to turn all the legend entries off.
|
||||
* @default true
|
||||
*/
|
||||
showEntries: boolean;
|
||||
/**
|
||||
* Horizontal space between legend items, in pixels.
|
||||
* @default 10
|
||||
*/
|
||||
spacing: number;
|
||||
/**
|
||||
* Whether showing/hiding of graphs by clicking on the legend marker is enabled or not.
|
||||
* In case legend is used with AmMap, this is set to false automatically.
|
||||
* @default true
|
||||
*/
|
||||
switchable: boolean;
|
||||
/**
|
||||
* Legend switch color. #FFFFFF
|
||||
*/
|
||||
switchColor: string;
|
||||
/**
|
||||
* Legend switch type (in case the legend is switchable). Possible values are "x" and "v". x
|
||||
*/
|
||||
switchType: string;
|
||||
/**
|
||||
* If true, clicking on the text will show/hide balloon of the graph.
|
||||
* Otherwise it will show/hide graph/slice, if switchable is set to true.
|
||||
*/
|
||||
textClickEnabled: boolean;
|
||||
/**
|
||||
* In case legend position is set to "absolute", you can set distance from top of the chart, in pixels.
|
||||
*/
|
||||
top: number;
|
||||
/**
|
||||
* Legend markers can mirror graph’s settings, displaying a line and a real bullet as in the graph itself.
|
||||
* Set this property to true if you want to enable this feature.
|
||||
* Note, if you set graph colors in dataProvider, they will not be reflected in the marker.
|
||||
* @default false
|
||||
*/
|
||||
useGraphSettings: boolean;
|
||||
/**
|
||||
* Specifies if legend labels should be use same color as corresponding markers.
|
||||
*/
|
||||
useMarkerColorForLabels: boolean;
|
||||
/**
|
||||
* Alignment of the value text. Possible values are "left" and "right". right
|
||||
*/
|
||||
valueAlign: string;
|
||||
/**
|
||||
* The text which will be displayed in the value portion of the legend.
|
||||
* You can use tags like
|
||||
* [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]]. [[value]]
|
||||
*/
|
||||
valueText: string;
|
||||
/**
|
||||
* Width of the value text.
|
||||
* @default 80
|
||||
*/
|
||||
valueWidth: number;
|
||||
/**
|
||||
* Vertical space between legend items also between legend border and first and last legend row.
|
||||
* @default: 10
|
||||
*/
|
||||
verticalGap: number;
|
||||
/**
|
||||
* Adds event listener of the type "clickLabel" or "clickMarker" or "hideItem" to the object.
|
||||
* @param type Either "clickLabel" or "clickMarker" or "hideItem".
|
||||
* @param handler The event handler.
|
||||
*/
|
||||
addListener(
|
||||
type: string,
|
||||
handler: (
|
||||
e: {
|
||||
type: string;
|
||||
dataItem: object;
|
||||
chart: AmChart;
|
||||
},
|
||||
) => void,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Removes event listener from chart object.
|
||||
*/
|
||||
removeListener(chart: AmChart, type: string, handler: any): void;
|
||||
}
|
||||
Vendored
+314
@@ -0,0 +1,314 @@
|
||||
import AmChart from "./AmChart";
|
||||
import Slice from "./Slice";
|
||||
|
||||
/**
|
||||
* AmPieChart class creates pie/donut chart.
|
||||
* In order to display pie chart you need to set at least these three properties
|
||||
* dataProvider, titleField and valueField.
|
||||
* @example
|
||||
* let chartData = [{title:"Pie I have eaten",value:70},{title:"Pie I haven\'t eaten",value:30}];
|
||||
* let chart = new AmCharts.AmPieChart();
|
||||
* chart.valueField = "value";
|
||||
* chart.titleField = "title";
|
||||
* chart.dataProvider = chartData;
|
||||
* chart.write("chartdiv");
|
||||
*/
|
||||
export default class AmPieChart extends AmChart {
|
||||
/**
|
||||
* Name of the field in chart's dataProvider which holds slice's alpha.
|
||||
*/
|
||||
alphaField: string;
|
||||
/**
|
||||
* Pie lean angle (for 3D effect). Valid range is 0 - 90.
|
||||
*/
|
||||
angle: number;
|
||||
/**
|
||||
* Balloon text. The following tags can be used:
|
||||
* [[value]], [[title]], [[percents]], [[description]]. [[title]]: [[percents]]% ([[value]])\n[[description]]
|
||||
*/
|
||||
balloonText: string;
|
||||
/**
|
||||
* Read-only. Array of Slice objects.
|
||||
*/
|
||||
chartData: any[];
|
||||
/**
|
||||
* Name of the field in chart's dataProvider which holds slice's color.
|
||||
*/
|
||||
colorField: string;
|
||||
/**
|
||||
* Specifies the colors of the slices, if the slice color is not set.
|
||||
* If there are more slices than colors in this array, the chart picks random color.
|
||||
* [
|
||||
* "#FF0F00", "#FF6600", "#FF9E01", "#FCD202", "#F8FF01", "#B0DE09", "#04D215", "#0D8ECF",
|
||||
* "#0D52D1", "#2A0CD0", "#8A0CCF", "#CD0D74", "#754DEB", "#DDDDDD", "#999999", "#333333",
|
||||
* "#000000", "#57032A", "#CA9726", "#990000", "#4B0C25"
|
||||
* ]
|
||||
*/
|
||||
colors: any[];
|
||||
/**
|
||||
* Depth of the pie (for 3D effect).
|
||||
*/
|
||||
depth3D: number;
|
||||
/**
|
||||
* Name of the field in chart's dataProvider which holds a string with description.
|
||||
*/
|
||||
descriptionField: string;
|
||||
/**
|
||||
* Example: [-0.2,0.2]. Will make slices to be filled with color gradients.
|
||||
*/
|
||||
gradientRatio: number[];
|
||||
/**
|
||||
* Opacity of the group slice. Value range is 0 - 1.
|
||||
* @default 1
|
||||
*/
|
||||
groupedAlpha: number;
|
||||
/**
|
||||
* Color of the group slice. The default value is not set -
|
||||
* this means the next available color from "colors" array will be used.
|
||||
*/
|
||||
groupedColor: string;
|
||||
/**
|
||||
* Description of the group slice.
|
||||
*/
|
||||
groupedDescription: string;
|
||||
/**
|
||||
* If this is set to true, the group slice will be pulled out when the chart loads.
|
||||
*/
|
||||
groupedPulled: boolean;
|
||||
/**
|
||||
* Title of the group slice. Other
|
||||
*/
|
||||
groupedTitle: string;
|
||||
/**
|
||||
* If there is more than one slice whose percentage of the pie is less than this number,
|
||||
* those slices will be grouped together into one slice.
|
||||
* This is the "other" slice. It will always be the last slice in a pie.
|
||||
*/
|
||||
groupPercent: number;
|
||||
/**
|
||||
* Slices with percent less then hideLabelsPercent won't display labels.
|
||||
* This is useful to avoid cluttering up the chart, if you have a lot of small slices.
|
||||
* 0 means all labels will be shown.
|
||||
*/
|
||||
hideLabelsPercent: number;
|
||||
/**
|
||||
* Opacity of a hovered slice. Value range is 0 - 1.
|
||||
* @default 1
|
||||
*/
|
||||
hoverAlpha: number;
|
||||
/**
|
||||
* Inner radius of the pie, in pixels or percents.
|
||||
*/
|
||||
innerRadius: any;
|
||||
/**
|
||||
* The distance between the label and the slice, in pixels.
|
||||
* You can use negative values to put the label on the slice.
|
||||
* @default 30
|
||||
*/
|
||||
labelRadius: number;
|
||||
/**
|
||||
* Name of the field in dataProvider which specifies the length of a tick.
|
||||
* Note, the chart will not try to arrange labels automatically if this property is set.
|
||||
*/
|
||||
labelRadiusField: string;
|
||||
/**
|
||||
* Specifies whether data labels are visible.
|
||||
* @default true
|
||||
*/
|
||||
labelsEnabled: boolean;
|
||||
/**
|
||||
* Label text. The following tags can be used:
|
||||
* [[value]], [[title]], [[percents]], [[description]]. [[title]]: [[percents]]%
|
||||
*/
|
||||
labelText: string;
|
||||
/**
|
||||
* Label tick opacity. Value range is 0 - 1. 0.2
|
||||
*/
|
||||
labelTickAlpha: number;
|
||||
/**
|
||||
* Label tick color. #000000
|
||||
*/
|
||||
labelTickColor: string;
|
||||
/**
|
||||
* Bottom margin of the chart.
|
||||
* @default 5
|
||||
*/
|
||||
marginBottom: number;
|
||||
/**
|
||||
* Left margin of the chart.
|
||||
*/
|
||||
marginLeft: number;
|
||||
/**
|
||||
* Right margin of the chart.
|
||||
*/
|
||||
marginRight: number;
|
||||
/**
|
||||
* Top margin of the chart.
|
||||
* @default 5
|
||||
*/
|
||||
marginTop: number;
|
||||
/**
|
||||
* Minimum radius of the pie, in pixels.
|
||||
* @default 10
|
||||
*/
|
||||
minRadius: number;
|
||||
/**
|
||||
* Pie outline opacity. Value range is 0 - 1.
|
||||
*/
|
||||
outlineAlpha: number;
|
||||
/**
|
||||
* Pie outline color. #FFFFFF
|
||||
*/
|
||||
outlineColor: string;
|
||||
/**
|
||||
* Pie outline thickness.
|
||||
* @default 1
|
||||
*/
|
||||
outlineThickness: number;
|
||||
/**
|
||||
* Opacity of the slices. You can set the opacity of individual slice too.
|
||||
* @default 1
|
||||
*/
|
||||
pieAlpha: number;
|
||||
/**
|
||||
* Color of the first slice. All the other will be colored with darker or brighter colors.
|
||||
*/
|
||||
pieBaseColor: string;
|
||||
/**
|
||||
* Lightness increase of each subsequent slice. This is only useful if pieBaseColor is set.
|
||||
* Use negative values for darker colors. Value range is from -255 to 255.
|
||||
* @default 30
|
||||
*/
|
||||
pieBrightnessStep: number;
|
||||
/**
|
||||
* You can set fixed position of a pie center, in pixels or in percents.
|
||||
*/
|
||||
pieX: any;
|
||||
/**
|
||||
* You can set fixed position of a pie center, in pixels or in percents.
|
||||
*/
|
||||
pieY: any;
|
||||
/**
|
||||
* Name of the field in chart's dataProvider which holds a boolean value
|
||||
* telling the chart whether this slice must be pulled or not.
|
||||
*/
|
||||
pulledField: string;
|
||||
/**
|
||||
* Pull out duration, in seconds.
|
||||
* @default 1
|
||||
*/
|
||||
pullOutDuration: number;
|
||||
/**
|
||||
* Pull out effect. Possible values are ">", "<", elastic" and "bounce". bounce
|
||||
*/
|
||||
pullOutEffect: string;
|
||||
/**
|
||||
* If this is set to true, only one slice can be pulled out at a time.
|
||||
* If the viewer clicks on a slice, any other pulled-out slice will be pulled in.
|
||||
*/
|
||||
pullOutOnlyOne: boolean;
|
||||
/**
|
||||
* Pull out radius, in pixels or percents 0.2
|
||||
*/
|
||||
pullOutRadius: any;
|
||||
/**
|
||||
* Radius of a pie, in pixels or percents. By default, radius is calculated automatically.
|
||||
*/
|
||||
radius: any;
|
||||
/**
|
||||
* Specifies whether the animation should be sequenced or all slices should appear at once.
|
||||
*/
|
||||
sequencedAnimation: boolean;
|
||||
/**
|
||||
* Initial opacity of all slices. If you set startDuration higher than 0, slices will fade in from startAlpha.
|
||||
* @default 1
|
||||
*/
|
||||
startAlpha: number;
|
||||
/**
|
||||
* Angle of the first slice, in degrees. This will work properly only if "depth3D" is set to 0.
|
||||
* If "depth3D" is greater than 0, then there can be two angles only: 90 and 270. Value range is 0-360.
|
||||
* @default 90
|
||||
*/
|
||||
startAngle: number;
|
||||
/**
|
||||
* Duration of the animation, in seconds.
|
||||
* @default 1
|
||||
*/
|
||||
startDuration: number;
|
||||
/**
|
||||
* Animation effect. Possible values are ">", "<", "elastic" and "bounce". bounce
|
||||
*/
|
||||
startEffect: string;
|
||||
/**
|
||||
* Radius of the positions from which the slices will fly in.
|
||||
* @default 5
|
||||
*/
|
||||
startRadius: any;
|
||||
/**
|
||||
* Name of the field in chart's dataProvider which holds slice's title.
|
||||
*/
|
||||
titleField: string;
|
||||
/**
|
||||
* Name of the field in chart's dataProvider
|
||||
* which holds url which would be accessed if the user clicks on a slice.
|
||||
*/
|
||||
urlField: string;
|
||||
/**
|
||||
* If url is specified for a slice, it will be opened when user clicks on it.
|
||||
* urlTarget specifies target of this url. Use _blank if you want url to be opened in a new window. _self
|
||||
*/
|
||||
urlTarget: string;
|
||||
/**
|
||||
* Name of the field in chart's dataProvider which holds slice's value.
|
||||
*/
|
||||
valueField: string;
|
||||
/**
|
||||
* Name of the field in chart's dataProvider which holds boolean variable
|
||||
* defining whether this data item should have an entry in the legend.
|
||||
*/
|
||||
visibleInLegendField: string;
|
||||
/**
|
||||
* You can trigger the animation of the pie chart.
|
||||
*/
|
||||
animateAgain(): void;
|
||||
/**
|
||||
* You can trigger the click on a slice from outside. index - the number of a slice or Slice object.
|
||||
*/
|
||||
clickSlice(index: number): void;
|
||||
/**
|
||||
* Hides slice. index - the number of a slice or Slice object.
|
||||
*/
|
||||
hideSlice(index: number): void;
|
||||
/**
|
||||
* You can simulate roll-out of a slice from outside. index - the number of a slice or Slice object.
|
||||
*/
|
||||
rollOutSlice(index: number): void;
|
||||
/**
|
||||
* You can simulate roll-over a slice from outside. index - the number of a slice or Slice object.
|
||||
*/
|
||||
rollOverSlice(index: number): void;
|
||||
/**
|
||||
* Shows slice. index - the number of a slice or Slice object.
|
||||
*/
|
||||
showSlice(index: number): void;
|
||||
/**
|
||||
* Adds event listener of the type "clickSlice" or "pullInSlice" or "pullOutSlice" to the object.
|
||||
* @param type Always "clickSlice" or "pullInSlice" or "pullOutSlice".
|
||||
* @param handler
|
||||
* If the type is "clickSlice", dispatched when user clicks on a slice.
|
||||
* If the type is "pullInSlice", dispatched when user clicks on a slice and the slice is pulled-in.
|
||||
* If the type is "pullOutSlice", dispatched when user clicks on a slice and the slice is pulled-out.
|
||||
* If the type is "rollOutSlice", dispatched when user rolls-out of the slice.
|
||||
* If the type is "rollOverSlice", dispatched when user rolls-over the slice.
|
||||
*/
|
||||
addListener(
|
||||
type: string,
|
||||
handler: (
|
||||
e: {
|
||||
type: string; // Always "rollOverSlice".
|
||||
dataItem: Slice;
|
||||
chart: AmChart;
|
||||
},
|
||||
) => void,
|
||||
): void;
|
||||
}
|
||||
Vendored
+60
@@ -0,0 +1,60 @@
|
||||
import AmCoordinateChart from "./AmCoordinateChart";
|
||||
|
||||
/**
|
||||
* AmRadarChart is the class you have to use for radar and polar chart types.
|
||||
* @example
|
||||
* let chart;
|
||||
* let chartData = [
|
||||
* {country:"Czech Republic",litres:156.90},
|
||||
* {country:"Ireland",litres:131.10},
|
||||
* {country:"Germany",litres:115.80},
|
||||
* {country:"Australia",litres:109.90},
|
||||
* {country:"Austria",litres:108.30},
|
||||
* {country:"UK",litres:99.00}
|
||||
* ];
|
||||
*
|
||||
* window.onload = function() {
|
||||
* chart = new AmCharts.AmRadarChart();
|
||||
* chart.dataProvider = chartData;
|
||||
* chart.categoryField = "country";
|
||||
* chart.startDuration = 2;
|
||||
*
|
||||
* let valueAxis = new AmCharts.ValueAxis();
|
||||
* valueAxis.axisAlpha = 0.15;
|
||||
* valueAxis.minimum = 0;
|
||||
* valueAxis.dashLength = 3;
|
||||
* valueAxis.axisTitleOffset = 20;
|
||||
* valueAxis.gridCount = 5;
|
||||
* chart.addValueAxis(valueAxis);
|
||||
*
|
||||
* let graph = new AmCharts.AmGraph();
|
||||
* graph.valueField = "litres";
|
||||
* graph.bullet = "round";
|
||||
* graph.balloonText = "[[value]] litres of beer per year"
|
||||
* chart.addGraph(graph);
|
||||
*
|
||||
* chart.write("chartdiv");
|
||||
* };
|
||||
*/
|
||||
export default class AmRadarChart extends AmCoordinateChart {
|
||||
/**
|
||||
* Bottom margin of the chart.
|
||||
*/
|
||||
marginBottom: number;
|
||||
/**
|
||||
* Left margin of the chart.
|
||||
*/
|
||||
marginLeft: number;
|
||||
/**
|
||||
* Right margin of the chart.
|
||||
*/
|
||||
marginRight: number;
|
||||
/**
|
||||
* Top margin of the chart.
|
||||
*/
|
||||
marginTop: number;
|
||||
/**
|
||||
* Radius of a radar. 0.35
|
||||
*/
|
||||
radius: any;
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
import AmCoordinateChart from "./AmCoordinateChart";
|
||||
import ChartCursor from "./ChartCursor";
|
||||
import ChartScrollbar from "./ChartScrollbar";
|
||||
import TrendLine from "./TrendLine";
|
||||
|
||||
/**
|
||||
* AmRectangularChart is a base class of AmSerialChart and AmXYChart. It can not be instantiated explicitly.
|
||||
*/
|
||||
export default class AmRectangularChart extends AmCoordinateChart {
|
||||
/**
|
||||
* The angle of the 3D part of plot area. This creates a 3D effect (if the "depth3D" is > 0).
|
||||
* @default 0
|
||||
*/
|
||||
angle: number;
|
||||
/**
|
||||
* Space left from axis labels/title to the chart's outside border, if autoMargins set to true.
|
||||
* @default 10
|
||||
*/
|
||||
autoMarginOffset: number;
|
||||
/**
|
||||
* Specifies if margins of a chart should be calculated automatically so that labels of axes would fit.
|
||||
* The chart will adjust only margins with axes.
|
||||
* Other margins will use values set with marginRight, marginTop, marginLeft and marginBottom properties.
|
||||
* @default true
|
||||
*/
|
||||
autoMargins: boolean;
|
||||
/**
|
||||
* Cursor of a chart.
|
||||
*/
|
||||
chartCursor: ChartCursor;
|
||||
/**
|
||||
* Chart scrollbar.
|
||||
*/
|
||||
chartScrollbar: ChartScrollbar;
|
||||
/**
|
||||
* The depth of the 3D part of plot area. This creates a 3D effect (if the "angle" is > 0).
|
||||
* @default 0
|
||||
*/
|
||||
depth3D: number;
|
||||
/**
|
||||
* Number of pixels between the container's bottom border and plot area.
|
||||
* This space can be used for bottom axis' values.
|
||||
* If autoMargin is true and bottom side has axis, this property is ignored.
|
||||
* @default 20
|
||||
*/
|
||||
marginBottom: number;
|
||||
/**
|
||||
* Number of pixels between the container's left border and plot area.
|
||||
* This space can be used for left axis' values.
|
||||
* If autoMargin is true and left side has axis, this property is ignored.
|
||||
* @default 20
|
||||
*/
|
||||
marginLeft: number;
|
||||
/**
|
||||
* Number of pixels between the container's right border and plot area.
|
||||
* This space can be used for Right axis' values.
|
||||
* If autoMargin is true and right side has axis, this property is ignored.
|
||||
* @default 20
|
||||
*/
|
||||
marginRight: number;
|
||||
/**
|
||||
* Flag which should be set to false if you need margins to be recalculated on next chart.validateNow() call.
|
||||
* @default false
|
||||
*/
|
||||
marginsUpdated: boolean;
|
||||
/**
|
||||
* Number of pixels between the container's top border and plot area.
|
||||
* This space can be used for top axis' values.
|
||||
* If autoMargin is true and top side has axis, this property is ignored.
|
||||
* @default 20
|
||||
*/
|
||||
marginTop: number;
|
||||
/**
|
||||
* The opacity of plot area's border. Value range is 0 - 1.
|
||||
* @default 0
|
||||
*/
|
||||
plotAreaBorderAlpha: number;
|
||||
/**
|
||||
* The color of the plot area's border.
|
||||
* Note, the it is invisible by default, as plotAreaBorderAlpha default value is 0.
|
||||
* Set it to a value higher than 0 to make it visible.
|
||||
* @default '#000000'
|
||||
*/
|
||||
plotAreaBorderColor: string;
|
||||
/**
|
||||
* Opacity of plot area. Plural form is used to keep the same property names as our Flex charts'.
|
||||
* Flex charts can accept array of numbers to generate gradients.
|
||||
* Although you can set array here, only first value of this array will be used.
|
||||
* @default 0
|
||||
*/
|
||||
plotAreaFillAlphas: number;
|
||||
/**
|
||||
* You can set both one color if you need a solid color or array of colors to generate gradients, for example:
|
||||
* ["#000000", "#0000CC"]
|
||||
* @default '#FFFFFF'
|
||||
*/
|
||||
plotAreaFillColors: any;
|
||||
/**
|
||||
* If you are using gradients to fill the plot area, you can use this property to set gradient angle.
|
||||
* The only allowed values are horizontal and vertical: 0, 90, 180, 270.
|
||||
* @default 0
|
||||
*/
|
||||
plotAreaGradientAngle: number;
|
||||
/**
|
||||
* Array of trend lines added to a chart.
|
||||
* You can add trend lines to a chart using this array or access already existing trend lines
|
||||
*/
|
||||
trendLines: TrendLine[];
|
||||
/**
|
||||
* Opacity of zoom-out button background.
|
||||
* @default 0
|
||||
*/
|
||||
zoomOutButtonAlpha: number;
|
||||
/**
|
||||
* Zoom-out button background color.
|
||||
* @default '#e5e5e5'
|
||||
*/
|
||||
zoomOutButtonColor: string;
|
||||
/**
|
||||
* Name of zoom-out button image. In the images folder there is another lens image, called lensWhite.png.
|
||||
* You might want to have white lens when background is dark. Or you can simply use your own image.
|
||||
* @default lens.png
|
||||
*/
|
||||
zoomOutButtonImage: string;
|
||||
/**
|
||||
* Size of zoom-out button image
|
||||
* @default: 17
|
||||
*/
|
||||
zoomOutButtonImageSize: number;
|
||||
/**
|
||||
* Padding around the text and image.
|
||||
* @default: 8
|
||||
*/
|
||||
zoomOutButtonPadding: number;
|
||||
/**
|
||||
* Opacity of zoom-out button background when mouse is over it.
|
||||
* @default: 1
|
||||
*/
|
||||
zoomOutButtonRollOverAlpha: number;
|
||||
/**
|
||||
* Text in the zoom-out button. Show all
|
||||
*/
|
||||
zoomOutText: string;
|
||||
|
||||
/**
|
||||
* Adds a ChartCursor object to a chart
|
||||
*/
|
||||
addChartCursor(cursor: ChartCursor): void;
|
||||
/**
|
||||
* Adds a ChartScrollbar to a chart
|
||||
*/
|
||||
addChartScrollbar(scrollbar: ChartScrollbar): void;
|
||||
/**
|
||||
* Adds a TrendLine to a chart.
|
||||
* You should call chart.validateNow() after this method is called in order the trend line to be visible.
|
||||
*/
|
||||
addTrendLine(trendLine: TrendLine): void;
|
||||
/**
|
||||
* Removes cursor from the chart
|
||||
*/
|
||||
removeChartCursor(): void;
|
||||
/**
|
||||
* Removes scrollbar from the chart
|
||||
*/
|
||||
removeChartScrollbar(): void;
|
||||
/**
|
||||
* Removes a trend line from a chart.
|
||||
* You should call chart.validateNow() in order the changes to be visible.
|
||||
*/
|
||||
removeTrendLine(trendLine: TrendLine): void;
|
||||
}
|
||||
Vendored
+130
@@ -0,0 +1,130 @@
|
||||
import AmRectangularChart from "./AmRectangularChart";
|
||||
import CategoryAxis from "./CategoryAxis";
|
||||
|
||||
/**
|
||||
* AmSerialChart is the class you have to use for majority of chart types.
|
||||
* The supported chart types are: line, area, column, bar, step line, smoothed line, candlestick and OHLC.
|
||||
* The chart can be rotated by 90 degrees so the column chart becomes bar chart.
|
||||
* The chart supports simple and logarithmic scales, it can have multiple value axes.
|
||||
* The chart can place data points at equal intervals or can parse dates and place data points
|
||||
* at irregular intervals.
|
||||
* @example
|
||||
* let chartData = [{title:"sample 1",value:130},{title:"sample 2",value:26}];
|
||||
*
|
||||
* let chart = new AmCharts.AmSerialChart();
|
||||
* chart.categoryField = "title";
|
||||
* chart.dataProvider = chartData;
|
||||
*
|
||||
* let graph = new AmCharts.AmGraph();
|
||||
* graph.valueField = "value";
|
||||
* graph.type = "column";
|
||||
* graph.fillAlphas = 1;
|
||||
* chart.addGraph(graph);
|
||||
*
|
||||
* chart.write("chartdiv");
|
||||
*/
|
||||
export default class AmSerialChart extends AmRectangularChart {
|
||||
/**
|
||||
* Date format of the graph balloon (if chart parses dates and you don't use chartCursor).
|
||||
* @default 'MMM DD, YYYY'
|
||||
*/
|
||||
balloonDateFormat: string;
|
||||
/**
|
||||
* Read-only. Chart creates category axis itself.
|
||||
* If you want to change some properties, you should get this axis from the chart and
|
||||
* set properties to this object.
|
||||
*/
|
||||
categoryAxis: CategoryAxis;
|
||||
/**
|
||||
* Category field name tells the chart the name of the field in your dataProvider object
|
||||
* which will be used for category axis values.
|
||||
*/
|
||||
categoryField: string;
|
||||
/**
|
||||
* The gap in pixels between two columns of the same category.
|
||||
* @default 5
|
||||
*/
|
||||
columnSpacing: number;
|
||||
/**
|
||||
* Space between 3D stacked columns.
|
||||
* @default 0
|
||||
*/
|
||||
columnSpacing3D: number;
|
||||
/**
|
||||
* Relative width of columns. Value range is 0 - 1.
|
||||
* @default 0.8
|
||||
*/
|
||||
columnWidth: number;
|
||||
/**
|
||||
* Read-only. If category axis parses dates endDate indicates date to which the chart is currently displayed.
|
||||
*/
|
||||
endDate: Date;
|
||||
/**
|
||||
* Read-only. Category index to which the chart is currently displayed.
|
||||
*/
|
||||
endIndex: number;
|
||||
/**
|
||||
* Maximum number of series allowed to select.
|
||||
*/
|
||||
maxSelectedSeries: number;
|
||||
/**
|
||||
* The longest time span allowed to select (in milliseconds) for example
|
||||
* 259200000 will limit selection to 3 days.
|
||||
*/
|
||||
maxSelectedTime: number;
|
||||
/**
|
||||
* The shortest time span allowed to select (in milliseconds) for example
|
||||
* 1000 will limit selection to 1 second.
|
||||
* @default 0
|
||||
*/
|
||||
minSelectedTime: number;
|
||||
/**
|
||||
* Specifies if scrolling of a chart with mouse wheel is enabled.
|
||||
* If you press shift while rotating mouse wheel, the chart will zoom-in/out.
|
||||
*/
|
||||
mouseWheelScrollEnabled: boolean;
|
||||
/**
|
||||
* Specifies if zooming of a chart with mouse wheel is enabled.
|
||||
* If you press shift while rotating mouse wheel, the chart will scroll.
|
||||
*/
|
||||
mouseWheelZoomEnabled: boolean;
|
||||
/**
|
||||
* If you set this to true, the chart will be rotated by 90 degrees (the columns will become bars).
|
||||
*/
|
||||
rotate: boolean;
|
||||
/**
|
||||
* Read-only.
|
||||
* If category axis parses dates startDate indicates date from which the chart is currently displayed.
|
||||
*/
|
||||
startDate: Date;
|
||||
/**
|
||||
* Read-only. Category index from which the chart is currently displayed.
|
||||
*/
|
||||
startIndex: number;
|
||||
/**
|
||||
* Specifies if chart should zoom-out when data is updated.
|
||||
* @default true
|
||||
*/
|
||||
zoomOutOnDataUpdate: boolean;
|
||||
|
||||
/**
|
||||
* Number Returns index of the specified category value.
|
||||
*/
|
||||
getCategoryIndexByValue(value: number): void;
|
||||
/**
|
||||
* Zooms out, charts shows all available data.
|
||||
*/
|
||||
zoomOut(): void;
|
||||
/**
|
||||
* Zooms the chart by the value of the category axis.
|
||||
*/
|
||||
zoomToCategoryValues(start: Date, end: Date): void;
|
||||
/**
|
||||
* Zooms the chart from one date to another.
|
||||
*/
|
||||
zoomToDates(start: Date, end: Date): void;
|
||||
/**
|
||||
* Zooms the chart by the index of the category.
|
||||
*/
|
||||
zoomToIndexes(start: Date, end: Date): void;
|
||||
}
|
||||
Vendored
+198
@@ -0,0 +1,198 @@
|
||||
import AmBalloon from "./AmBalloon";
|
||||
import AmChart from "./AmChart";
|
||||
import AmSerialChart from "./AmSerialChart";
|
||||
import CategoryAxesSettings from "./CategoryAxesSettings";
|
||||
import ChartCursorSettings from "./ChartCursorSettings";
|
||||
import ChartScrollbarSettings from "./ChartScrollbarSettings";
|
||||
import DataSet from "./DataSet";
|
||||
import DataSetSelector from "./DataSetSelector";
|
||||
import LegendSettings from "./LegendSettings";
|
||||
import PanelsSettings from "./PanelSettings";
|
||||
import PeriodSelector from "./PeriodSelector";
|
||||
import StockEvent from "./StockEvent";
|
||||
import StockGraph from "./StockGraph";
|
||||
import StockPanel from "./StockPanel";
|
||||
import ValueAxesSettings from "./ValueAxesSettings";
|
||||
|
||||
/**
|
||||
* AmStockChart is a main class Stock chart.
|
||||
*/
|
||||
export default class AmStockChart {
|
||||
/**
|
||||
* Specifies if animation was already played.
|
||||
* Animation is only played once, when chart is rendered for the first time.
|
||||
* If you want the animation to be repeated, set this property to false.
|
||||
*/
|
||||
animationPlayed: boolean;
|
||||
/**
|
||||
* Balloon object.
|
||||
*/
|
||||
balloon: AmBalloon;
|
||||
/**
|
||||
* Settings for category axes.
|
||||
*/
|
||||
categoryAxesSettings: CategoryAxesSettings;
|
||||
/**
|
||||
* Indicates if the chart is created.
|
||||
*/
|
||||
chartCreated: boolean;
|
||||
/**
|
||||
* Chart cursor settings.
|
||||
*/
|
||||
chartCursorSettings: ChartCursorSettings;
|
||||
/**
|
||||
* Chart scrollbar settings.
|
||||
*/
|
||||
chartScrollbarSettings: ChartScrollbarSettings;
|
||||
/**
|
||||
* Array of colors used by data sets if no color was set explicitly on data set itself.
|
||||
* [
|
||||
* #FF6600, "#FCD202", "#B0DE09", "#0D8ECF", "#2A0CD0", "#CD0D74", "#CC0000",
|
||||
* "#00CC00", "#0000CC", "#DDDDDD", "#999999", "#333333", "#990000"
|
||||
* ]
|
||||
*/
|
||||
colors: any[];
|
||||
/**
|
||||
* Array of data sets selected for comparing.
|
||||
*/
|
||||
comparedDataSets: any[];
|
||||
/**
|
||||
* Array of DataSets.
|
||||
*/
|
||||
dataSets: any[];
|
||||
/**
|
||||
* DataSetSelector object.
|
||||
* You can add it if you have more than one data set and want users to be able to select/compare them.
|
||||
*/
|
||||
dataSetSelector: DataSetSelector;
|
||||
/**
|
||||
* Current end date of the selected period, get only.
|
||||
* To set start/end dates, use stockChart.zoom(startDate, endDate) method.
|
||||
*/
|
||||
endDate: Date;
|
||||
/**
|
||||
* Defines on which day week starts. 0 - Sunday, 1 - Monday..
|
||||
* @default 1
|
||||
*/
|
||||
firstDayOfWeek: number;
|
||||
/**
|
||||
* If set to true the scope of the data view will be set to the end after data update.
|
||||
*/
|
||||
glueToTheEnd: boolean;
|
||||
/**
|
||||
* Legend settings.
|
||||
*/
|
||||
legendSettings: LegendSettings;
|
||||
/**
|
||||
* Data set selected as main.
|
||||
*/
|
||||
mainDataSet: DataSet;
|
||||
/**
|
||||
* Array of StockPanels (charts).
|
||||
*/
|
||||
panels: any[];
|
||||
/**
|
||||
* Settings for stock panels.
|
||||
*/
|
||||
panelsSettings: PanelsSettings;
|
||||
/**
|
||||
* Period selector object.
|
||||
* You can add it if you want user's to be able to enter date ranges or
|
||||
* zoom chart with predefined period buttons.
|
||||
*/
|
||||
periodSelector: PeriodSelector;
|
||||
/**
|
||||
* Scrollbar's chart object, get only.
|
||||
*/
|
||||
scrollbarChart: AmSerialChart;
|
||||
/**
|
||||
* Current start date of the selected period, get only.
|
||||
* To set start/end dates, use stockChart.zoom(startDate, endDate) method.
|
||||
*/
|
||||
startDate: Date;
|
||||
/**
|
||||
* Settings for stock events.
|
||||
*/
|
||||
stockEventsSettings: any;
|
||||
/**
|
||||
* Settings for value axes.
|
||||
*/
|
||||
valueAxesSettings: ValueAxesSettings;
|
||||
/**
|
||||
* read-only. Indicates current version of a script.
|
||||
*/
|
||||
version: string;
|
||||
/**
|
||||
* Specifies whether the chart should zoom-out when main data set is changed.
|
||||
*/
|
||||
zoomOutOnDataSetChange: boolean;
|
||||
|
||||
/**
|
||||
* Adds panel to the stock chart. Requires stockChart.validateNow() method to be called after this action.
|
||||
*/
|
||||
addPanel(panel: StockPanel): void;
|
||||
/**
|
||||
* Adds panel to the stock chart at a specified index.
|
||||
* Requires stockChart.validateNow() method to be called after this action.
|
||||
*/
|
||||
addPanelAt(panel: StockPanel, index: number): void;
|
||||
/**
|
||||
* Destroys chart, all timeouts and listeners.
|
||||
*/
|
||||
clear(): void;
|
||||
/**
|
||||
* Hides event bullets.
|
||||
*/
|
||||
hideStockEvents(): void;
|
||||
/**
|
||||
* Removes panel from the stock chart. Requires stockChart.validateNow() method to be called after this action.
|
||||
*/
|
||||
removePanel(panel: StockPanel): void;
|
||||
/**
|
||||
* Shows event bullets.
|
||||
*/
|
||||
showStockEvents(): void;
|
||||
/**
|
||||
* Method which should be called after data was changed.
|
||||
*/
|
||||
validateData(): void;
|
||||
/**
|
||||
* Method which forces the stock chart to rebuild. Should be called after properties are changed.
|
||||
*/
|
||||
validateNow(): void;
|
||||
/**
|
||||
* Zooms chart to specified dates. startDate, endDate - Date objects.
|
||||
*/
|
||||
zoom(startDate: Date, endDate: Date): void;
|
||||
/**
|
||||
* Zooms out the chart.
|
||||
*/
|
||||
zoomOut(): void;
|
||||
/**
|
||||
* Adds event listener.
|
||||
* @param type - One of
|
||||
* "buildStarted", "clickStockEvent", "dataUpdated", "init", "panelRemoved", "rendered", "rollOutStockEvent",
|
||||
* "rollOverStockEvent", "zoomed".
|
||||
* @param handler - The event handler.
|
||||
*/
|
||||
addListener(
|
||||
type: string,
|
||||
handler: (
|
||||
e: {
|
||||
chart: AmStockChart;
|
||||
date?: Date;
|
||||
endDate?: Date;
|
||||
eventObject?: StockEvent;
|
||||
graph?: StockGraph;
|
||||
panel?: StockPanel;
|
||||
period?: string;
|
||||
startDate?: Date;
|
||||
type: string;
|
||||
},
|
||||
) => void,
|
||||
): void;
|
||||
/**
|
||||
* Removes event listener from chart object.
|
||||
*/
|
||||
removeListener(chart: AmChart, type: string, handler: any): void;
|
||||
}
|
||||
Vendored
+68
@@ -0,0 +1,68 @@
|
||||
import AmRectangularChart from "./AmRectangularChart";
|
||||
|
||||
/**
|
||||
* AmXYChart is the class you have to use for XY/Bubble/Scatter chart types.
|
||||
* The chart supports simple and logarithmic scales, it can have multiple value axes.
|
||||
* @example
|
||||
* let chartData = [
|
||||
* {x:10, y:14, value:59},
|
||||
* {x:5, y:3, value:50},
|
||||
* {x:-10, y:-3, value:19},
|
||||
* {x:-6, y:5, value:65},
|
||||
* {x:15, y:-4, value:92},
|
||||
* {x:13, y:1, value:8},
|
||||
* {x:1, y:6, value:35}
|
||||
* ];
|
||||
*
|
||||
* let chart = new AmCharts.AmXYChart();
|
||||
* chart.pathToImages = "../../amcharts/javascript/images/";
|
||||
* chart.dataProvider = chartData;
|
||||
* chart.marginLeft = 35;
|
||||
* chart.startDuration = 1.5;
|
||||
*
|
||||
* let xAxis = new AmCharts.ValueAxis();
|
||||
* xAxis.position = "left";
|
||||
* xAxis.autoGridCount = true;
|
||||
* chart.addValueAxis(xAxis);
|
||||
*
|
||||
* let yAxis = new AmCharts.ValueAxis();
|
||||
* yAxis.position = "bottom";
|
||||
* yAxis.autoGridCount = true;
|
||||
* chart.addValueAxis(yAxis);
|
||||
*
|
||||
* let graph = new AmCharts.AmGraph();
|
||||
* graph.valueField = "value";
|
||||
* graph.xField = "x";
|
||||
* graph.yField = "y";
|
||||
* graph.lineAlpha = 0;
|
||||
* graph.bullet = "round";
|
||||
* chart.addGraph(graph);
|
||||
*
|
||||
* let chartCursor = new AmCharts.ChartCursor();
|
||||
* chart.addChartCursor(chartCursor);
|
||||
*
|
||||
* let chartScrollbar = new AmCharts.ChartScrollbar();
|
||||
* chartScrollbar.hideResizeGrips = false;
|
||||
* chart.addChartScrollbar(chartScrollbar);
|
||||
*
|
||||
* chart.write("chartdiv);
|
||||
*/
|
||||
export default class AmXYChart extends AmRectangularChart {
|
||||
/**
|
||||
* Specifies if Scrollbar of X axis (horizontal) should be hidden.
|
||||
*/
|
||||
hideXScrollbar: boolean;
|
||||
/**
|
||||
* Specifies if Scrollbar of Y axis (vertical) should be hidden.
|
||||
*/
|
||||
hideYScrollbar: boolean;
|
||||
/**
|
||||
* Maximum zoom factor of the chart.
|
||||
* @default 20
|
||||
*/
|
||||
maxZoomFactor: number;
|
||||
/**
|
||||
* Zooms out, charts shows all available data.
|
||||
*/
|
||||
zoomOut(): void;
|
||||
}
|
||||
Vendored
+92
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* AreasSettings is a class which holds common settings of all MapArea objects.
|
||||
*/
|
||||
export default class AreasSettings {
|
||||
/**
|
||||
* Opacity of areas.
|
||||
* @default 1
|
||||
*/
|
||||
alpha: number;
|
||||
/**
|
||||
* Specifies if the areas should be zoomed-in when user clicks on them, event if zoom properties are not set.
|
||||
*/
|
||||
autoZoom: boolean;
|
||||
/**
|
||||
* Text which is displayed in a roll-over balloon. You can use the following tags:
|
||||
* [[title]], [[description]], [[value]] and [[percent]] [[title]]
|
||||
*/
|
||||
balloonText: string;
|
||||
/**
|
||||
* Color of the areas.
|
||||
* @default "#FFCC00"
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Color of area with highest value.
|
||||
* Colors for areas with values less then highest will be colored with intermediate colors
|
||||
* between color and colorSolid.
|
||||
* Use colorSteps property of AmMap to change the number of intermediate colors.
|
||||
* @default "#990000"
|
||||
*/
|
||||
colorSolid: string;
|
||||
/**
|
||||
* Height of a description window.
|
||||
*/
|
||||
descriptionWindowHeight: number;
|
||||
/**
|
||||
* Width of a description window.
|
||||
* @default 250
|
||||
*/
|
||||
descriptionWindowWidth: number;
|
||||
/**
|
||||
* X position of a description window.
|
||||
*/
|
||||
descriptionWindowX: number;
|
||||
/**
|
||||
* Y position of a description window.
|
||||
*/
|
||||
descriptionWindowY: number;
|
||||
/**
|
||||
* Opacity of area's outline.
|
||||
* @default 1
|
||||
*/
|
||||
outlineAlpha: number;
|
||||
/**
|
||||
* Color of area's outline. #FFFFFF
|
||||
*/
|
||||
outlineColor: string;
|
||||
/**
|
||||
* Thickness of area's outline. 0.5
|
||||
*/
|
||||
outlineThickness: number;
|
||||
/**
|
||||
* Color of area when user rolls-over it. undefined
|
||||
*/
|
||||
rollOverColor: string;
|
||||
/**
|
||||
* Color of area's outline when user rolls-over it. #CC0000
|
||||
*/
|
||||
rollOverOutlineColor: string;
|
||||
/**
|
||||
* Color of area which is currently selected. #CC0000
|
||||
*/
|
||||
selectedColor: string;
|
||||
/**
|
||||
* Opacity of all areas which are in the map svg file, but not listed as areas in DataSet.
|
||||
* @default 1
|
||||
*/
|
||||
unlistedAreasAlpha: number;
|
||||
/**
|
||||
* Color of all areas which are in the map svg file, but not listed as areas in DataSet. #DDDDDD
|
||||
*/
|
||||
unlistedAreasColor: string;
|
||||
/**
|
||||
* Opacity of all areas' outline which are in the map svg file, but not listed as areas in DataSet.
|
||||
* @default 1
|
||||
*/
|
||||
unlistedAreasOutlineAlpha: number;
|
||||
/**
|
||||
* Color of all areas' outline which are in the map svg file, but not listed as areas in DataSet. #FFFFFF
|
||||
*/
|
||||
unlistedAreasOutlineColor: string;
|
||||
}
|
||||
Vendored
+148
@@ -0,0 +1,148 @@
|
||||
import Guide from "./Guide";
|
||||
|
||||
/**
|
||||
* AxisBase is the base class for ValueAxis and CategoryAxis. It can not be instantiated explicitly.
|
||||
*/
|
||||
export default class AxisBase {
|
||||
/**
|
||||
* Specifies whether number of gridCount is specified automatically, acoarding to the axis size.
|
||||
* @default true
|
||||
*/
|
||||
autoGridCount: boolean;
|
||||
/**
|
||||
* Axis opacity. Value range is 0 - 1.
|
||||
* @default 1
|
||||
*/
|
||||
axisAlpha: number;
|
||||
/**
|
||||
* Axis color. #000000
|
||||
*/
|
||||
axisColor: string;
|
||||
/**
|
||||
* Thickness of the axis.
|
||||
* @default 1
|
||||
*/
|
||||
axisThickness: number;
|
||||
/**
|
||||
* Color of axis value labels. Will use chart's color if not set.
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Length of a dash. 0 means line is not dashed.
|
||||
*/
|
||||
dashLength: number;
|
||||
/**
|
||||
* Fill opacity. Every second space between grid lines can be filled with color.
|
||||
* Set fillAlpha to a value greater than 0 to see the fills.
|
||||
*/
|
||||
fillAlpha: number;
|
||||
/**
|
||||
* Fill color. Every second space between grid lines can be filled with color.
|
||||
* Set fillAlpha to a value greater than 0 to see the fills.
|
||||
* @default "#FFFFFF"
|
||||
*/
|
||||
fillColor: string;
|
||||
/**
|
||||
* Size of value labels text. Will use chart's fontSize if not set.
|
||||
*/
|
||||
fontSize: string;
|
||||
/**
|
||||
* Opacity of grid lines. 0.2
|
||||
*/
|
||||
gridAlpha: number;
|
||||
/**
|
||||
* Color of grid lines. #000000
|
||||
*/
|
||||
gridColor: string;
|
||||
/**
|
||||
* Number of grid lines. In case this is value axis, or your categoryAxis parses dates,
|
||||
* the number is approximate. The default value is 5. If you set autoGridCount to true,
|
||||
* this property is ignored.
|
||||
* @default 5
|
||||
*/
|
||||
gridCount: number;
|
||||
/**
|
||||
* Thickness of grid lines.
|
||||
* @default 1
|
||||
*/
|
||||
gridThickness: number;
|
||||
/**
|
||||
* The array of guides belonging to this axis.
|
||||
*/
|
||||
guides: any[];
|
||||
/**
|
||||
* If autoMargins of a chart is set to true, but you want this axis not to be measured when calculating margin,
|
||||
* set ignoreAxisWidth to true.
|
||||
*/
|
||||
ignoreAxisWidth: boolean;
|
||||
/**
|
||||
* Specifies whether values should be placed inside or outside plot area.
|
||||
*/
|
||||
inside: boolean;
|
||||
/**
|
||||
* Frequency at which labels should be placed. Doesn't work for CategoryAxis if parseDates is set to true.
|
||||
* @default 1
|
||||
*/
|
||||
labelFrequency: number;
|
||||
/**
|
||||
* Rotation angle of a label. Only horizontal axis' values can be rotated.
|
||||
* If you set this for vertical axis, the setting will be ignored.
|
||||
*/
|
||||
labelRotation: number;
|
||||
/**
|
||||
* Specifies whether axis displays category axis' labels and value axis' values.
|
||||
* @default true
|
||||
*/
|
||||
labelsEnabled: boolean;
|
||||
/**
|
||||
* The distance of the axis to the plot area, in pixels. Negative values can also be used.
|
||||
*/
|
||||
offset: number;
|
||||
/**
|
||||
* Possible values are: "top", "bottom", "left", "right".
|
||||
* If axis is vertical, default position is "left".
|
||||
* If axis is horizontal, default position is "bottom".
|
||||
*/
|
||||
position: string;
|
||||
/**
|
||||
* Whether to show first axis label or not.
|
||||
* @default true
|
||||
*/
|
||||
showFirstLabel: boolean;
|
||||
/**
|
||||
* Whether to show last axis label or not.
|
||||
* @default true
|
||||
*/
|
||||
showLastLabel: boolean;
|
||||
/**
|
||||
* Length of the tick marks.
|
||||
* @default 5
|
||||
*/
|
||||
tickLength: number;
|
||||
/**
|
||||
* Title of the axis.
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Specifies if title should be bold or not.
|
||||
* @default true
|
||||
*/
|
||||
titleBold: boolean;
|
||||
/**
|
||||
* Color of axis title. Will use text color of chart if not set any.
|
||||
*/
|
||||
titleColor: string;
|
||||
/**
|
||||
* Font size of axis title. Will use font size of chart plus two pixels if not set any.
|
||||
*/
|
||||
titlefontSize: string;
|
||||
|
||||
/**
|
||||
* Adds guide to the axis.
|
||||
*/
|
||||
addGuide(guide: Guide): void;
|
||||
/**
|
||||
* Removes guide from the axis.
|
||||
*/
|
||||
removeGuide(guide: Guide): void;
|
||||
}
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
* CategoryAxesSettings settings set's settings common for all CategoryAxes of StockPanels.
|
||||
* If you change a property after the chart is initialized, you should call stockChart.validateNow() method in
|
||||
* order for it to work. If there is no default value specified, default value of CategoryAxis class will be used.
|
||||
*/
|
||||
export default class CategoryAxesSettings {
|
||||
/**
|
||||
* Specifies whether number of gridCount is specified automatically, according to the axis size.
|
||||
* @default true
|
||||
*/
|
||||
autoGridCount: boolean;
|
||||
/**
|
||||
* Axis opacity.
|
||||
*/
|
||||
axisAlpha: number;
|
||||
/**
|
||||
* Axis color.
|
||||
*/
|
||||
axisColor: string;
|
||||
/**
|
||||
* Height of category axes. Set it to 0 if you set inside property to true.
|
||||
* @default 28
|
||||
*/
|
||||
axisHeight: number;
|
||||
/**
|
||||
* Thickness of the axis.
|
||||
*/
|
||||
axisThickness: number;
|
||||
/**
|
||||
* Text color.
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Length of a dash.
|
||||
*/
|
||||
dashLength: number;
|
||||
/**
|
||||
* Date formats of different periods.
|
||||
* Possible period values:
|
||||
* fff - milliseconds,
|
||||
* ss - seconds,
|
||||
* mm - minutes,
|
||||
* hh - hours,
|
||||
* DD - days,
|
||||
* MM - months,
|
||||
* WW - weeks,
|
||||
* YYYY - years
|
||||
* Check this page for date formatting strings.
|
||||
*/
|
||||
dateFormats: any[];
|
||||
/**
|
||||
* If you want data points to be placed at equal intervals (omiting dates with no data),
|
||||
* set equalSpacing to true.
|
||||
*/
|
||||
equalSpacing: boolean;
|
||||
/**
|
||||
* Fill opacity. Every second space between grid lines can be filled with fillColor.
|
||||
*/
|
||||
fillAlpha: number;
|
||||
/**
|
||||
* Fill color. Every second space between grid lines can be filled with color.
|
||||
* Set fillAlpha to a value greater than 0 to see the fills.
|
||||
*/
|
||||
fillColor: string;
|
||||
/**
|
||||
* Text size.
|
||||
*/
|
||||
fontSize: string;
|
||||
/**
|
||||
* Opacity of grid lines.
|
||||
*/
|
||||
gridAlpha: number;
|
||||
/**
|
||||
* Color of grid lines.
|
||||
*/
|
||||
gridColor: string;
|
||||
/**
|
||||
* Approximate number of grid lines.
|
||||
* You should set autoGridCount to false in order this property not to be ignored.
|
||||
* @default 10
|
||||
*/
|
||||
gridCount: number;
|
||||
/**
|
||||
* Thickness of grid lines.
|
||||
*/
|
||||
gridThickness: number;
|
||||
/**
|
||||
* Periods to which data will be gruoped in case there are more data items in
|
||||
* the selected period than specified in maxSeries property.
|
||||
* ["ss", "10ss", "30ss", "mm", "10mm", "30mm", "hh", "DD", "WW", "MM", "YYYY"]
|
||||
*/
|
||||
groupToPeriods: any[];
|
||||
/**
|
||||
* Specifies whether values should be placed inside or outside of plot area.
|
||||
*/
|
||||
inside: boolean;
|
||||
/**
|
||||
* Rotation angle of a label.
|
||||
*/
|
||||
labelRotation: number;
|
||||
/**
|
||||
* Maximum series shown at a time.
|
||||
* In case there are more data points in the selection than maxSeries,
|
||||
* the chart will group data to longer periods, for example - you have 250 days in the selection,
|
||||
* and maxSeries is 150 - the chart will group data to weeks.
|
||||
* @default 150
|
||||
*/
|
||||
maxSeries: number;
|
||||
/**
|
||||
* Specifies the shortest period of your data.
|
||||
* fff - millisecond,
|
||||
* ss - second,
|
||||
* mm - minute,
|
||||
* hh - hour,
|
||||
* DD - day,
|
||||
* MM - month,
|
||||
* YYYY - year
|
||||
* @default "DD"
|
||||
*/
|
||||
minPeriod: string;
|
||||
/**
|
||||
* top or "bottom".
|
||||
*/
|
||||
position: string;
|
||||
/**
|
||||
* Specifies whether the graph should start on axis or not.
|
||||
* In case you display columns, it is recommended to set this to false.
|
||||
* startOnAxis can be set to true only if equalSpacing is set to true.
|
||||
*/
|
||||
startOnAxis: boolean;
|
||||
/**
|
||||
* Tick length.
|
||||
*/
|
||||
tickLength: number;
|
||||
}
|
||||
Vendored
+106
@@ -0,0 +1,106 @@
|
||||
import AxisBase from "./AxisBase";
|
||||
|
||||
export default class CategoryAxis extends AxisBase {
|
||||
/**
|
||||
* When parse dates is on for the category axis, the chart will try to highlight the beginning of the periods,
|
||||
* like month, in bold. Set this to false to disable the functionality.
|
||||
* @default true
|
||||
*/
|
||||
boldPeriodBeginning: boolean;
|
||||
/**
|
||||
* Date formats of different periods. Possible period values:
|
||||
* fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, WW - weeks, YYYY - years.
|
||||
* Check this page for date formatting strings.
|
||||
* [
|
||||
* {period:'fff',format:'JJ:NN:SS'},
|
||||
* {period:'ss',format:'JJ:NN:SS'},
|
||||
* {period:'mm',format:'JJ:NN'},
|
||||
* {period:'hh',format:'JJ:NN'},
|
||||
* {period:'DD',format:'MMM DD'},
|
||||
* {period:'WW',format:'MMM DD'},
|
||||
* {period:'MM',format:'MMM'},
|
||||
* {period:'YYYY',format:'YYYY'}
|
||||
* ]
|
||||
*/
|
||||
dateFormats: any[];
|
||||
/**
|
||||
* In case your category axis values are Date objects and parseDates is set to true,
|
||||
* the chart will parse dates and will place your data points at irregular intervals.
|
||||
* However if you want dates to be parsed (displayed on the axis, baloons, etc),
|
||||
* but data points to be placed at equal intervals (omiting dates with no data), set equalSpacing to true.
|
||||
*/
|
||||
equalSpacing: boolean;
|
||||
/**
|
||||
* Field in data provider which specifies if the category value should always be shown.
|
||||
* For example: categoryAxis.forceShowField = "forceShow";
|
||||
* Field in data provider which specifies if the category value should always be shown.
|
||||
* For example: categoryAxis.forceShowField = "forceShow";
|
||||
* And in data:
|
||||
* {category:"one", forceShow:true, value:100}
|
||||
* Note, this works only when parseDates is set to false.
|
||||
*/
|
||||
forceShowField: string;
|
||||
/**
|
||||
* Specifies if a grid line is placed on the center of a cell or on the beginning of a cell.
|
||||
* Possible values are: "start" and "middle" This setting doesn't work if parseDates is set to true.
|
||||
* @default "middle"
|
||||
*/
|
||||
gridPosition: string;
|
||||
/**
|
||||
* Specifies if minor grid should be displayed.
|
||||
* NOTE: If equalSpacing is set to true, this setting will be ignored.
|
||||
* @default false
|
||||
*/
|
||||
minorGridEnabled: boolean;
|
||||
/**
|
||||
* Specifies the shortest period of your data. This should be set only if parseDates is set to "true".
|
||||
* Possible period values:
|
||||
* fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, YYYY - years.
|
||||
* @default "DD"
|
||||
*/
|
||||
minPeriod: string;
|
||||
/**
|
||||
* In case your category axis values are Date objects, set this to true.
|
||||
* In this case the chart will parse dates and will place your data points at irregular intervals.
|
||||
* If you want dates to be parsed, but data points to be placed at equal intervals,
|
||||
* set both parseDates and equalSpacing to true.
|
||||
*/
|
||||
parseDates: boolean;
|
||||
/**
|
||||
* Specifies whether the graph should start on axis or not.
|
||||
* In case you display columns, it is recommended to set this to false.
|
||||
* If parseDates is set to true, startOnAxis will allways be false, unless equalSpacing is set to true.
|
||||
*/
|
||||
startOnAxis: boolean;
|
||||
/**
|
||||
* Works only when parseDates is set to true and equalSpacing is false.
|
||||
* If you set it to true, at the position where bigger period changes,
|
||||
* category axis will display date strings of bot small and big period, in two rows.
|
||||
* @default false
|
||||
*/
|
||||
twoLineMode: boolean;
|
||||
/**
|
||||
* Use line color for bullet
|
||||
* @default false
|
||||
*/
|
||||
useLineColorForBulletBorder: boolean;
|
||||
/**
|
||||
* Number returns coordinate of a category. Works only if parseDates is false.
|
||||
* If parseDates is true, use dateToCoordinate method.
|
||||
*/
|
||||
categoryToCoordinate(category: string): void;
|
||||
/**
|
||||
* date - Date object Returns Date of the coordinate, in case parseDates is set to true and
|
||||
* equalSpacing is set to false.
|
||||
*/
|
||||
coordinateToDate(coordinate: number): void;
|
||||
/**
|
||||
* Number Returns coordinate of the date, in case parseDates is set to true.
|
||||
* If parseDates is false, use categoryToCoordinate method.
|
||||
*/
|
||||
dateToCoordinate(date: Date): void;
|
||||
/**
|
||||
* Number Returns index of the category which is most close to specified coordinate.
|
||||
*/
|
||||
xToIndex(x: number): void;
|
||||
}
|
||||
Vendored
+149
@@ -0,0 +1,149 @@
|
||||
import AmChart from "./AmChart";
|
||||
import AmGraph from "./AmGraph";
|
||||
|
||||
/**
|
||||
* ChartCursor is a class which displays a cursor which follows the mouse.
|
||||
* In case of Serial chart it also shows value and category balloons.
|
||||
* @example
|
||||
* let chart = new AmCharts.AmSerialChart();
|
||||
* let chartCursor = new AmCharts.ChartCursor();
|
||||
* chart.addChartCursor(chartCursor);
|
||||
*/
|
||||
export default class ChartCursor {
|
||||
/**
|
||||
* Specifies if bullet for each graph will follow the cursor.
|
||||
*/
|
||||
bulletsEnabled: boolean;
|
||||
/**
|
||||
* Size of bullets, following the cursor.
|
||||
* @default 8
|
||||
*/
|
||||
bulletSize: number;
|
||||
/**
|
||||
* Opacity of the category balloon.
|
||||
* @default 1
|
||||
*/
|
||||
categoryBalloonAlpha: number;
|
||||
/**
|
||||
* Color of the category balloon. cursorColor is used if not set.
|
||||
*/
|
||||
categoryBalloonColor: string;
|
||||
/**
|
||||
* Category balloon date format (used only if category axis parses dates).
|
||||
* Check this page for instructions on how to format dates. MMM DD, YYYY
|
||||
*/
|
||||
categoryBalloonDateFormat: string;
|
||||
/**
|
||||
* Specifies whether category balloon is enabled.
|
||||
* @default true
|
||||
*/
|
||||
categoryBalloonEnabled: boolean;
|
||||
/**
|
||||
* Text color. #FFFFFF
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Opacity of the cursor line. 1
|
||||
*/
|
||||
cursorAlpha: number;
|
||||
/**
|
||||
* Color of the cursor line. #CC0000
|
||||
*/
|
||||
cursorColor: string;
|
||||
/**
|
||||
* Specifies where the cursor line should be placed - on the beginning of the period (day, hour, etc) or
|
||||
* in the middle (only when parseDates property of categoryAxis is set to true).
|
||||
* If you want the cursor to follow mouse and not to glue to the nearest data point, set "mouse" here.
|
||||
* Possible values are: "start", "middle", "mouse".
|
||||
*/
|
||||
cursorPosition: string;
|
||||
/**
|
||||
* Specifies whether cursor is enabled.
|
||||
* @default true
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* If set to true, instead of a cursor line user will see a fill which width will always
|
||||
* be equal to the width of one data item.
|
||||
* Recommend setting cursorAlpha to 0.1 or some other small number if using this feature.
|
||||
* @default false
|
||||
*/
|
||||
fullWidth: boolean;
|
||||
/**
|
||||
* If this is set to true, only one balloon at a time will be displayed. Note, this is quite CPU consuming.
|
||||
*/
|
||||
oneBalloonOnly: boolean;
|
||||
/**
|
||||
* If this is set to true, the user will be able to pan the chart (Serial only) instead of zooming.
|
||||
*/
|
||||
pan: boolean;
|
||||
/**
|
||||
* Opacity of the selection.
|
||||
*/
|
||||
selectionAlpha: number;
|
||||
/**
|
||||
* Specifies if cursor should only mark selected area but not zoom-in after user releases mouse button.
|
||||
*/
|
||||
selectWithoutZooming: boolean;
|
||||
/**
|
||||
* Specifies whether value balloons are enabled.
|
||||
* In case they are not, the balloons might be displayed anyway, when the user rolls-over the column or bullet.
|
||||
* @default true
|
||||
*/
|
||||
valueBalloonsEnabled: boolean;
|
||||
/**
|
||||
* Specifies if the user can zoom-in the chart.
|
||||
* If pan is set to true, zoomable is switched to false automatically.
|
||||
* @default true
|
||||
*/
|
||||
zoomable: boolean;
|
||||
/**
|
||||
* Indicates if currently user is selecting some chart area to zoom-in.
|
||||
*/
|
||||
zooming: boolean;
|
||||
|
||||
/**
|
||||
* Hides cursor.
|
||||
*/
|
||||
hideCursor(): void;
|
||||
/**
|
||||
* You can force cursor to appear at specified cateogry or date.
|
||||
*/
|
||||
showCursorAt(category: string | Date): void;
|
||||
/**
|
||||
* Adds event listener.
|
||||
* @param type One of "changed", "draw", "moved", "onHideCursor", "onShowCursor", "panning",
|
||||
* "selected", "zoomed", "zoomStarted".
|
||||
* @param handler The event handler.
|
||||
*/
|
||||
addListener(
|
||||
type: string,
|
||||
handler: (
|
||||
e: {
|
||||
chart: AmChart;
|
||||
delta2X?: number;
|
||||
delta2Y?: number;
|
||||
deltaX?: number;
|
||||
deltaY?: number;
|
||||
end?: number;
|
||||
finalX?: number;
|
||||
finalY?: number;
|
||||
index?: number;
|
||||
initialX?: number;
|
||||
initialY?: number;
|
||||
mostCloseGraph?: AmGraph;
|
||||
start?: number;
|
||||
target?: ChartCursor;
|
||||
type: string;
|
||||
x?: number;
|
||||
y?: number;
|
||||
zooming?: boolean;
|
||||
},
|
||||
) => void,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Removes event listener from chart object.
|
||||
*/
|
||||
removeListener(chart: AmChart, type: string, handler: any): void;
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* ChartCursorSettings settings set's settings for chart cursor.
|
||||
* If you change a property after the chart is initialized, you should call stockChart.validateNow() method
|
||||
* in order for it to work. If there is no default value specified, default value of ChartCursor class will be used.
|
||||
*/
|
||||
export default class ChartCursorSettings {
|
||||
/**
|
||||
* Specifies if bullet for each graph will follow the cursor.
|
||||
*/
|
||||
bulletsEnabled: boolean;
|
||||
/**
|
||||
* Size of bullets, following the cursor.
|
||||
*/
|
||||
bulletSize: number;
|
||||
/**
|
||||
* Opacity of the category balloon.
|
||||
*/
|
||||
categoryBalloonAlpha: number;
|
||||
/**
|
||||
* Color of the category balloon.
|
||||
*/
|
||||
categoryBalloonColor: string;
|
||||
/**
|
||||
* Array of date format objects. Date format object must have "period" and "format" items.
|
||||
* Available periods are:
|
||||
* fff - millisecond,
|
||||
* ss - second,
|
||||
* mm - minute,
|
||||
* hh - hour,
|
||||
* DD - date,
|
||||
* WW - week,
|
||||
* MM - month,
|
||||
* YYYY - year
|
||||
* [
|
||||
* {period:"YYYY", format:"YYYY"},
|
||||
* {period:"MM", format:"MMM, YYYY"},
|
||||
* {period:"WW", format:"MMM DD, YYYY"},
|
||||
* {period:"DD", format:"MMM DD, YYYY"},
|
||||
* {period:"hh", format:"JJ:NN"},
|
||||
* {period:"mm", format:"JJ:NN"},
|
||||
* {period:"ss", format:"JJ:NN:SS"},
|
||||
* {period:"fff", format:"JJ:NN:SS"}
|
||||
* ]
|
||||
*/
|
||||
categoryBalloonDateFormats: any[];
|
||||
/**
|
||||
* Specifies whether category balloon is enabled.
|
||||
*/
|
||||
categoryBalloonEnabled: boolean;
|
||||
/**
|
||||
* Opacity of the cursor line.
|
||||
*/
|
||||
cursorAlpha: number;
|
||||
/**
|
||||
* Color of the cursor line.
|
||||
*/
|
||||
cursorColor: string;
|
||||
/**
|
||||
* Possible values: "start", "middle" and "mouse".
|
||||
*/
|
||||
cursorPosition: string;
|
||||
/**
|
||||
* Set this to "false" if you don't want chart cursor to appear in your charts.
|
||||
* @default true
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* If this is set to true, the user will be able to pan the chart instead of zooming.
|
||||
*/
|
||||
pan: boolean;
|
||||
/**
|
||||
* Specifies whether value balloons are enabled.
|
||||
* In case they are not, the balloons might be displayed anyway, when the user rolls-over the column or bullet.
|
||||
*/
|
||||
valueBalloonsEnabled: boolean;
|
||||
/**
|
||||
* Specifies if the user can zoom-in the chart.
|
||||
* If pan is set to true, zoomable is switched to false automatically.
|
||||
*/
|
||||
zoomable: boolean;
|
||||
}
|
||||
Vendored
+121
@@ -0,0 +1,121 @@
|
||||
import AmGraph from "./AmGraph";
|
||||
import CategoryAxis from "./CategoryAxis";
|
||||
|
||||
/**
|
||||
* ChartScrollbar class displays chart scrollbar. Supported by AmSerialChart and AmXYChart.
|
||||
* @example
|
||||
* let chart = new AmCharts.AmSerialChart();
|
||||
* let chartScrollbar = new AmCharts.ChartScrollbar();
|
||||
* chart.addChartScrollbar(chartScrollbar);
|
||||
*/
|
||||
export default class ChartScrollbar {
|
||||
/**
|
||||
* Specifies whether number of gridCount is specified automatically, acoarding to the axis size.
|
||||
*/
|
||||
autoGridCount: boolean;
|
||||
/**
|
||||
* Background opacity.
|
||||
* @default 1
|
||||
*/
|
||||
backgroundAlpha: number;
|
||||
/**
|
||||
* Background color of the scrollbar.
|
||||
* @default #D4D4D4
|
||||
*/
|
||||
backgroundColor: string;
|
||||
/**
|
||||
* Read-only. Category axis of the scrollbar.
|
||||
*/
|
||||
categoryAxis: CategoryAxis;
|
||||
/**
|
||||
* Text color. Will use chart's color if not set.
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Specifies which graph will be displayed in the scrollbar. Only Serial chart's scrollbar can display a graph.
|
||||
*/
|
||||
graph: AmGraph;
|
||||
/**
|
||||
* Graph fill opacity. Value range is 0 - 1. 0.1
|
||||
*/
|
||||
graphFillAlpha: number;
|
||||
/**
|
||||
* Graph fill color. #000000
|
||||
*/
|
||||
graphFillColor: string;
|
||||
/**
|
||||
* Graph line opacity. Value range is 0 - 1.
|
||||
*/
|
||||
graphLineAlpha: number;
|
||||
/**
|
||||
* Graph line color. #000000
|
||||
*/
|
||||
graphLineColor: string;
|
||||
/**
|
||||
* By default the graph type is the same as the original graph's type,
|
||||
* however in case of "candlestick" or "ohlc" you might want to show line graph in the scrollbar.
|
||||
* Possible values are: "line", "column", "step", "smoothedLine", "candlestick", "ohlc".
|
||||
*/
|
||||
graphType: string;
|
||||
/**
|
||||
* Grid opacity. Value range is 0 - 1. 0.7
|
||||
*/
|
||||
gridAlpha: number;
|
||||
/**
|
||||
* Grid color. #FFFFFF
|
||||
*/
|
||||
gridColor: string;
|
||||
/**
|
||||
* The number of grid lines.
|
||||
*/
|
||||
gridCount: number;
|
||||
/**
|
||||
* Specifies whether resize grips are hidden when mouse is away from the scrollbar.
|
||||
*/
|
||||
hideResizeGrips: boolean;
|
||||
/**
|
||||
* Specifies whether scrollbar has a resize feature.
|
||||
* @default true
|
||||
*/
|
||||
resizeEnabled: boolean;
|
||||
/**
|
||||
* Height (width, if chart is rotated) of a scrollbar.
|
||||
* @default 20
|
||||
*/
|
||||
scrollbarHeight: number;
|
||||
/**
|
||||
* Duration of scrolling, when the user clicks on scrollbar's background, in seconds.
|
||||
* @default 2
|
||||
*/
|
||||
scrollDuration: number;
|
||||
/**
|
||||
* Selected backround opacity.
|
||||
* @default 1
|
||||
*/
|
||||
selectedBackgroundAlpha: number;
|
||||
/**
|
||||
* Selected background color. #EFEFEF
|
||||
*/
|
||||
selectedBackgroundColor: string;
|
||||
/**
|
||||
* Selected graph's fill opacity. Value range is 0 - 1. 0.5
|
||||
*/
|
||||
selectedGraphFillAlpha: number;
|
||||
/**
|
||||
* Selected graph's fill color. #000000
|
||||
*/
|
||||
selectedGraphFillColor: string;
|
||||
/**
|
||||
* Selected graph's line opacity. Value range is 0 - 1.
|
||||
*/
|
||||
selectedGraphLineAlpha: number;
|
||||
/**
|
||||
* Selected graph's line color. #000000
|
||||
*/
|
||||
selectedGraphLineColor: string;
|
||||
/**
|
||||
* Specifies if the chart should be updated while dragging/resizing the scrollbar or only at the moment
|
||||
* when user releases mouse button.
|
||||
*/
|
||||
updateOnReleaseOnly: boolean;
|
||||
}
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
import AmGraph from "./AmGraph";
|
||||
|
||||
/**
|
||||
* ChartScrollbarSettings settings set's settings for chart scrollbar.
|
||||
* If you change a property after the chart is initialized, you should call stockChart.validateNow() method in
|
||||
* order for it to work. If there is no default value specified, default value of ChartScrollbar class will be used.
|
||||
*/
|
||||
export default class ChartScrollbarSettings {
|
||||
/**
|
||||
* Specifies whether number of gridCount is specified automatically, according to the axis size.
|
||||
* @default true
|
||||
*/
|
||||
autoGridCount: boolean;
|
||||
/**
|
||||
* Background opacity.
|
||||
*/
|
||||
backgroundAlpha: number;
|
||||
/**
|
||||
* Background color of the scrollbar.
|
||||
*/
|
||||
backgroundColor: string;
|
||||
/**
|
||||
* Text color.
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Set false if you don't need scrollbar.
|
||||
* @default true
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* Font size.
|
||||
*/
|
||||
fontSize: string;
|
||||
/**
|
||||
* Specifies which graph will be displayed in the scrollbar.
|
||||
*/
|
||||
graph: AmGraph;
|
||||
/**
|
||||
* Graph fill opacity.
|
||||
*/
|
||||
graphFillAlpha: number;
|
||||
/**
|
||||
* Graph fill color.
|
||||
*/
|
||||
graphFillColor: string;
|
||||
/**
|
||||
* Graph line opacity.
|
||||
*/
|
||||
graphLineAlpha: number;
|
||||
/**
|
||||
* Graph line color.
|
||||
*/
|
||||
graphLineColor: string;
|
||||
/**
|
||||
* Type of chart scrollbar's graph.
|
||||
* By default the graph type is the same as the original graph's type, however in case of "candlestick" or
|
||||
* "ohlc" you might want to show line graph in the scrollbar.
|
||||
* Possible values are: line, column, step, smoothedLine, candlestick, ohlc.
|
||||
*/
|
||||
graphType: string;
|
||||
/**
|
||||
* Grid opacity.
|
||||
*/
|
||||
gridAlpha: number;
|
||||
/**
|
||||
* Grid color.
|
||||
*/
|
||||
gridColor: string;
|
||||
/**
|
||||
* Grid count. You should set autoGridCount to false in order this property to work.
|
||||
*/
|
||||
gridCount: number;
|
||||
/**
|
||||
* Height of scrollbar, in pixels.
|
||||
* @default 40
|
||||
*/
|
||||
height: number;
|
||||
/**
|
||||
* Specifies whether resize grips are hidden when mouse is away from the scrollbar.
|
||||
*/
|
||||
hideResizeGrips: boolean;
|
||||
/**
|
||||
* Duration of scrolling, when the user clicks on scrollbar's background, in seconds.
|
||||
*/
|
||||
scrollDuration: number;
|
||||
/**
|
||||
* Selected background opacity.
|
||||
*/
|
||||
selectedBackgroundAlpha: number;
|
||||
/**
|
||||
* Selected background color.
|
||||
*/
|
||||
selectedBackgroundColor: string;
|
||||
/**
|
||||
* Selected graph'sfill opacity.
|
||||
*/
|
||||
selectedGraphFillAlpha: number;
|
||||
/**
|
||||
* Selected graph'sfill color.
|
||||
*/
|
||||
selectedGraphFillColor: string;
|
||||
/**
|
||||
* Selected graph'sline opacity.
|
||||
*/
|
||||
selectedGraphLineAlpha: number;
|
||||
/**
|
||||
* Selected graph's line color.
|
||||
*/
|
||||
selectedGraphLineColor: string;
|
||||
/**
|
||||
* Specifies if the chart should be updated while dragging/resizing the scrollbar or only at the moment when
|
||||
* user releases mouse button. Usefull when working with large data sets.
|
||||
* @default true
|
||||
*/
|
||||
updateOnReleaseOnly: boolean;
|
||||
}
|
||||
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
import StockEvent from "./StockEvent";
|
||||
|
||||
/**
|
||||
* DataSet is objects which holds all information about data.
|
||||
*/
|
||||
export default class DataSet {
|
||||
/**
|
||||
* Category field name in your dataProvider.
|
||||
*/
|
||||
categoryField: string;
|
||||
/**
|
||||
* Color of the data set. One of colors from AmStockChart.colors array will be used if not set.
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Whether this data set is selected for comparing.
|
||||
* If you change this property, you should call stockChart.validateData() method
|
||||
* in order the changes to be applied.
|
||||
*/
|
||||
compared: boolean;
|
||||
/**
|
||||
* Data provider of the data set.
|
||||
*/
|
||||
dataProvider: any[];
|
||||
/**
|
||||
* Array of field mappings. Field mapping is an object with fromField and toField properties.
|
||||
* fromField is a name of your value field in dataProvider.
|
||||
* toField might be chosen freely, it will be used to set value/open/close/high/low fields for the StockGraph.
|
||||
* Example: {fromField:"val1", toField:"value"}.
|
||||
*/
|
||||
fieldMappings: any[];
|
||||
/**
|
||||
* Specifies whether this data set should be visible in "compare to" list.
|
||||
* @default true
|
||||
*/
|
||||
showInCompare: boolean;
|
||||
/**
|
||||
* Specifies whether this data set should be visible in "select" dropdown.
|
||||
* @default true
|
||||
*/
|
||||
showInSelect: boolean;
|
||||
/**
|
||||
* Array of StockEvent objects.
|
||||
*/
|
||||
stockEvents: StockEvent[];
|
||||
/**
|
||||
* DataSet title.
|
||||
*/
|
||||
title: string;
|
||||
}
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* DataSetSelector is a tool for selecting data set's as main and for comparing with main data set.
|
||||
*/
|
||||
export default class DataSetSelector {
|
||||
/**
|
||||
* Text displayed in the "compare to" combobox (when position is "top" or "bottom"). Select...
|
||||
*/
|
||||
comboBoxSelectText: string;
|
||||
/**
|
||||
* Text displayed near "compare to" list. Compare to:
|
||||
*/
|
||||
compareText: string;
|
||||
/**
|
||||
* The maximum height of the Compare to field in pixels.
|
||||
* @default 150
|
||||
*/
|
||||
listHeight: number;
|
||||
/**
|
||||
* Possible values: "right", "left", "top", "bottom". "top" and "bottom" positions has a limitation -
|
||||
* only one data set can be selected for comparing.
|
||||
* @default "left"
|
||||
*/
|
||||
position: string;
|
||||
/**
|
||||
* Text displayed near "Select" dropDown. Select:
|
||||
*/
|
||||
selectText: string;
|
||||
/**
|
||||
* Width of a Data set selector, when position is "left" or "right".
|
||||
* @default 180
|
||||
*/
|
||||
width: number;
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Seems like this is meant: https://github.com/amcharts/export
|
||||
*/
|
||||
export default class ExportSettings {
|
||||
enabled: boolean;
|
||||
libs: object;
|
||||
menu: object;
|
||||
config: any;
|
||||
capture(config: any, callback: () => void): any;
|
||||
toJPG(config: any, callback: (config: any) => void): any;
|
||||
}
|
||||
Vendored
+92
@@ -0,0 +1,92 @@
|
||||
import GaugeAxis from "./GaugeAxis";
|
||||
|
||||
export default class GaugeArrow {
|
||||
/**
|
||||
* Opacity of an arrow.
|
||||
* @default 1
|
||||
*/
|
||||
alpha: number;
|
||||
|
||||
/**
|
||||
* Axis of the arrow. You can use reference to the axis or id of the axis.
|
||||
* If you don't set any axis, the first axis of a chart will be used.
|
||||
* @default GaugeAxis
|
||||
*/
|
||||
axis: GaugeAxis;
|
||||
|
||||
/**
|
||||
* Opacity of arrow border.
|
||||
* @default 1
|
||||
*/
|
||||
borderAlpha: number;
|
||||
|
||||
/**
|
||||
* In case you need the arrow to rotate only clock-wise, set this property to true.
|
||||
* @default false
|
||||
*/
|
||||
clockWiseOnly: boolean;
|
||||
|
||||
/**
|
||||
* Color of an arrow.
|
||||
* @default #000000
|
||||
*/
|
||||
color: string;
|
||||
|
||||
/**
|
||||
* Unique id of an arrow.
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* Inner radius of an arrow.
|
||||
* @default 0
|
||||
*/
|
||||
innerRadius: any;
|
||||
|
||||
/**
|
||||
* Opacity of a nail, holding the arrow.
|
||||
* @default 1
|
||||
*/
|
||||
nailAlpha: number;
|
||||
|
||||
/**
|
||||
* Opacity of nail border.
|
||||
* @default 0
|
||||
*/
|
||||
nailBorderAlpha: number;
|
||||
|
||||
/**
|
||||
* Thickness of nail border.
|
||||
* @default 1
|
||||
*/
|
||||
nailBorderThickness: number;
|
||||
|
||||
/**
|
||||
* Radius of a nail, holding the arrow.
|
||||
* @default 8
|
||||
*/
|
||||
nailRadius: number;
|
||||
|
||||
/**
|
||||
* Radius of an arrow.
|
||||
* @default '90%'
|
||||
*/
|
||||
radius: any;
|
||||
|
||||
/**
|
||||
* Width of arrow root.
|
||||
* @default 8
|
||||
*/
|
||||
startWidth: number;
|
||||
|
||||
/**
|
||||
* Value to which the arrow should point at.
|
||||
*/
|
||||
value: number;
|
||||
|
||||
/**
|
||||
* Sets value for the arrow.
|
||||
* Arrow will animate to this value if you do it after chart is written to it's container.
|
||||
*/
|
||||
setValue(value: number): void;
|
||||
}
|
||||
Vendored
+312
@@ -0,0 +1,312 @@
|
||||
import AmChart from "./AmChart";
|
||||
import GaugeBand from "./GaugeBand";
|
||||
|
||||
export default class GaugeAxis {
|
||||
/**
|
||||
* Axis opacity.
|
||||
* @default 1
|
||||
*/
|
||||
axisAlpha: number;
|
||||
|
||||
/**
|
||||
* Axis color.
|
||||
* @default #000000
|
||||
*/
|
||||
axisColor: string;
|
||||
|
||||
/**
|
||||
* Thickness of the axis outline.
|
||||
* @default 1
|
||||
*/
|
||||
axisThickness: number;
|
||||
|
||||
/**
|
||||
* Opacity of band fills.
|
||||
* @default 1
|
||||
*/
|
||||
bandAlpha: number;
|
||||
|
||||
/**
|
||||
* Example: [-0.2, 0, -0.2]. Will make bands to be filled with color gradients.
|
||||
* Negative value means the color will be darker than the original,
|
||||
* and positive number means the color will be lighter.
|
||||
* @default []
|
||||
*/
|
||||
bandGradientRatio: [number];
|
||||
|
||||
/**
|
||||
* Opacity of band outlines.
|
||||
* @default 0
|
||||
*/
|
||||
bandOutlineAlpha: number;
|
||||
|
||||
/**
|
||||
* Color of band outlines.
|
||||
* @default #000000
|
||||
*/
|
||||
bandOutlineColor: string;
|
||||
|
||||
/**
|
||||
* Thickness of band outlines.
|
||||
* @default 0
|
||||
*/
|
||||
bandOutlineThickness: number;
|
||||
|
||||
/**
|
||||
* Array of bands - GaugeBand objects. Bands are used to draw color fills between specified values.
|
||||
*/
|
||||
bands: [GaugeBand];
|
||||
|
||||
/**
|
||||
* Text displayed below the axis center.
|
||||
*/
|
||||
bottomText: string;
|
||||
|
||||
/**
|
||||
* Specifies if text should be bold.
|
||||
* @default true
|
||||
*/
|
||||
bottomTextBold: boolean;
|
||||
|
||||
/**
|
||||
* Bottom text color.
|
||||
*/
|
||||
bottomTextColor: string;
|
||||
|
||||
/**
|
||||
* Font size of bottom text.
|
||||
*/
|
||||
bottomTextFontSize: number;
|
||||
|
||||
/**
|
||||
* Y offset of bottom text.
|
||||
* @default 0
|
||||
*/
|
||||
bottomTextYOffset: number;
|
||||
|
||||
/**
|
||||
* X position of the axis, relative to the center of the gauge.
|
||||
* @default '0%'
|
||||
*/
|
||||
centerX: any;
|
||||
|
||||
/**
|
||||
* Y position of the axis, relative to the center of the gauge.
|
||||
* @default '0%'
|
||||
*/
|
||||
centerY: any;
|
||||
|
||||
/**
|
||||
* Specifies labels color of the axis.
|
||||
*/
|
||||
color: string;
|
||||
|
||||
/**
|
||||
* Axis end angle. Valid values are from - 180 to 180.
|
||||
* @default 120
|
||||
*/
|
||||
endAngle: number;
|
||||
|
||||
/**
|
||||
* Axis end (max) value
|
||||
*/
|
||||
endValue: number;
|
||||
|
||||
/**
|
||||
* Font size for axis labels.
|
||||
*/
|
||||
fontSize: number;
|
||||
|
||||
/**
|
||||
* Number of grid lines. Note, GaugeAxis doesn't adjust gridCount,
|
||||
* so you should check your values and choose a proper gridCount which would result grids at round numbers.
|
||||
* @default 5
|
||||
*/
|
||||
gridCount: number;
|
||||
|
||||
/**
|
||||
* Specifies if grid should be drawn inside or outside the axis.
|
||||
* @default true
|
||||
*/
|
||||
gridInside: boolean;
|
||||
|
||||
/**
|
||||
* Unique id of an axis.
|
||||
*/
|
||||
id: any;
|
||||
|
||||
/**
|
||||
* Specifies if labels should be placed inside or outside the axis.
|
||||
* @default true
|
||||
*/
|
||||
inside: boolean;
|
||||
|
||||
/**
|
||||
* Frequency of labels.
|
||||
* @default 1
|
||||
*/
|
||||
labelFrequency: number;
|
||||
|
||||
/**
|
||||
* You can use this function to format axis labels.
|
||||
* This function is called and value is passed as a attribute: labelFunction(value);
|
||||
*/
|
||||
labelFunction: (value: number) => string;
|
||||
|
||||
/**
|
||||
* Distance from axis to the labels.
|
||||
* @default 15
|
||||
*/
|
||||
labelOffset: number;
|
||||
|
||||
/**
|
||||
* Specifies if labels on the axis should be shown.
|
||||
* @default true
|
||||
*/
|
||||
labelsEnabled: boolean;
|
||||
|
||||
/**
|
||||
* You can add listeners of events using this property.
|
||||
* Example: listeners = [{"event":"clickBand", "method":handleClick}];
|
||||
*/
|
||||
listeners: object[];
|
||||
|
||||
/**
|
||||
* Interval, at which minor ticks should be placed.
|
||||
*/
|
||||
minorTickInterval: number;
|
||||
|
||||
/**
|
||||
* Length of a minor tick.
|
||||
* @default 5
|
||||
*/
|
||||
minorTickLength: number;
|
||||
|
||||
/**
|
||||
* Axis radius.
|
||||
* @default '95%'
|
||||
*/
|
||||
radius: any;
|
||||
|
||||
/**
|
||||
* Specifies if the first label should be shown.
|
||||
* @default true
|
||||
*/
|
||||
showFirstLabel: boolean;
|
||||
|
||||
/**
|
||||
* Specifies if the last label should be shown.
|
||||
* @default true
|
||||
*/
|
||||
showLastLabel: boolean;
|
||||
|
||||
/**
|
||||
* Axis start angle. Valid values are from - 180 to 180.
|
||||
* @default -120
|
||||
*/
|
||||
startAngle: number;
|
||||
|
||||
/**
|
||||
* Axis start (min) value.
|
||||
* @default 0
|
||||
*/
|
||||
startValue: number;
|
||||
|
||||
/**
|
||||
* Opacity of axis ticks.
|
||||
* @default 1
|
||||
*/
|
||||
tickAlpha: number;
|
||||
|
||||
/**
|
||||
* Color of axis ticks.
|
||||
* @default #555555
|
||||
*/
|
||||
tickColor: string;
|
||||
|
||||
/**
|
||||
* Length of a major tick.
|
||||
* @default 10
|
||||
*/
|
||||
tickLength: number;
|
||||
|
||||
/**
|
||||
* Tick thickness.
|
||||
* @default 1
|
||||
*/
|
||||
tickThickness: number;
|
||||
|
||||
/**
|
||||
* Text displayed above the axis center.
|
||||
*/
|
||||
topText: string;
|
||||
|
||||
/**
|
||||
* Specifies if text should be bold.
|
||||
* @default true
|
||||
*/
|
||||
topTextBold: boolean;
|
||||
|
||||
/**
|
||||
* Color of top text.
|
||||
*/
|
||||
topTextColor: string;
|
||||
|
||||
/**
|
||||
* Font size of top text.
|
||||
*/
|
||||
topTextFontSize: number;
|
||||
|
||||
/**
|
||||
* Y offset of top text.
|
||||
* @default 0
|
||||
*/
|
||||
topTextYOffset: number;
|
||||
|
||||
/**
|
||||
* A string which can be placed next to axis labels.
|
||||
*/
|
||||
unit: string;
|
||||
|
||||
/**
|
||||
* Position of the unit.
|
||||
* @default right
|
||||
*/
|
||||
unitPosition: string;
|
||||
|
||||
/**
|
||||
* Specifies if small and big numbers should use prefixes to make them more readable.
|
||||
* @default false
|
||||
*/
|
||||
usePrefixes: boolean;
|
||||
|
||||
/**
|
||||
* Interval, at which ticks with values should be placed.
|
||||
*/
|
||||
valueInterval: number;
|
||||
|
||||
/**
|
||||
* Adds event listener to the object.
|
||||
*/
|
||||
addListener(type: string, handler: any): void;
|
||||
|
||||
/**
|
||||
* Removes event listener from chart object.
|
||||
*/
|
||||
removeListener(chart: AmChart, type: string, handler: any): void;
|
||||
|
||||
/**
|
||||
* Sets bottom text.
|
||||
*/
|
||||
setBottomText(text: string): void;
|
||||
|
||||
/**
|
||||
* Sets top text.
|
||||
*/
|
||||
setTopText(textstring: string): void;
|
||||
|
||||
/**
|
||||
* Returns angle of the value.
|
||||
*/
|
||||
value2angle(value: number): void;
|
||||
}
|
||||
Vendored
+65
@@ -0,0 +1,65 @@
|
||||
export default class GaugeBand {
|
||||
/**
|
||||
* Opacity of band fill. Will use axis.bandAlpha if not set any.
|
||||
*/
|
||||
alpha: number;
|
||||
|
||||
/**
|
||||
* When rolled-over, band will display balloon if you set some text for this property.
|
||||
*/
|
||||
balloonText: string;
|
||||
|
||||
/**
|
||||
* Color of a band.
|
||||
*/
|
||||
color: string;
|
||||
|
||||
/**
|
||||
* End value of a fill.
|
||||
*/
|
||||
endValue: number;
|
||||
|
||||
/**
|
||||
* Example: [-0.2, 0, -0.2]. Will make bands to be filled with color gradients.
|
||||
* Negative value means the color will be darker than the original,
|
||||
* and positive number means the color will be lighter.
|
||||
* @default []
|
||||
*/
|
||||
gradientRatio: [number];
|
||||
|
||||
/**
|
||||
* Unique id of a band.
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* Inner radius of a band. If not set any, the band will end with the end of minor ticks.
|
||||
* Set 0 if you want the band to be drawn to the axis center.
|
||||
*/
|
||||
innerRadius: any;
|
||||
|
||||
/**
|
||||
* Band radius. If not set any, the band will start with the axis outline.
|
||||
*/
|
||||
radius: any;
|
||||
|
||||
/**
|
||||
* Start value of a fill.
|
||||
*/
|
||||
startValue: number;
|
||||
|
||||
/**
|
||||
* Gauge band can be clickable and can lead to some page.
|
||||
*/
|
||||
url: string;
|
||||
|
||||
/**
|
||||
* Sets end value for the band.
|
||||
*/
|
||||
setEndValue(value: number): void;
|
||||
|
||||
/**
|
||||
* Sets start value for the band.
|
||||
*/
|
||||
setStartValue(value: number): void;
|
||||
}
|
||||
Vendored
+70
@@ -0,0 +1,70 @@
|
||||
import SerialDataItem from "./SerialDataItem";
|
||||
|
||||
/**
|
||||
* GraphDataItem holds all the information about the graph's data item.
|
||||
* When working with a chart, you do not create GraphDataItem objects or change it's properties directly.
|
||||
* GraphDataItem is passed to you by events when user interacts with data item on the chart.
|
||||
* The list of properties below will help you to extract data item's value/coordinate/etc.
|
||||
*/
|
||||
export default class GraphDataItem {
|
||||
/**
|
||||
* Opacity of the data item.
|
||||
*/
|
||||
alpha: number;
|
||||
/**
|
||||
* Bullet type.
|
||||
*/
|
||||
bullet: string;
|
||||
/**
|
||||
* Bullet size.
|
||||
*/
|
||||
bulletSize: number;
|
||||
/**
|
||||
* Category value.
|
||||
*/
|
||||
category: string;
|
||||
/**
|
||||
* Color of the data item.
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Custom bullet (path to file name).
|
||||
*/
|
||||
customBullet: string;
|
||||
/**
|
||||
* Original object from data provider.
|
||||
*/
|
||||
dataContext: object;
|
||||
/**
|
||||
* Description.
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* Array of colors of the data item, used by column and candlestick chart only.
|
||||
*/
|
||||
fillColors: any[];
|
||||
/**
|
||||
* Object which holds percents when recalculateToPercents is set to true.
|
||||
*/
|
||||
percents: object;
|
||||
/**
|
||||
* SerialDataItem of this graphDataItem
|
||||
*/
|
||||
serialDataItem: SerialDataItem;
|
||||
/**
|
||||
* url
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* Object which holds values of the data item (value, open, close, low, high).
|
||||
*/
|
||||
values: object;
|
||||
/**
|
||||
* x coordinate of the data item.
|
||||
*/
|
||||
x: number;
|
||||
/**
|
||||
* y coordinate of the data item.
|
||||
*/
|
||||
y: number;
|
||||
}
|
||||
Vendored
+123
@@ -0,0 +1,123 @@
|
||||
import ValueAxis from "./ValueAxis";
|
||||
|
||||
/**
|
||||
* Guides are straight vertical or horizontal lines or areas supported by AmSerialChart, AmXYChart and AmRadarChart.
|
||||
* You can have guides both on value and category axes.
|
||||
* To add/remove a guide to an axis, use axis.addGuide(guide)/axis.removeGuide(guide) methods.
|
||||
* If you do not set properties such as dashLength, lineAlpha, lineColor, etc - values of the axis are used.
|
||||
*/
|
||||
export default class Guide {
|
||||
/**
|
||||
* If you set it to true, the guide will be displayed above the graphs.
|
||||
*/
|
||||
above: boolean;
|
||||
/**
|
||||
* Radar chart only. Specifies angle at which guide should start. Affects only fills, not lines.
|
||||
*/
|
||||
angle: number;
|
||||
/**
|
||||
* Baloon fill color.
|
||||
*/
|
||||
balloonColor: string;
|
||||
/**
|
||||
* The text which will be displayed if the user rolls-over the guide.
|
||||
*/
|
||||
balloonText: string;
|
||||
/**
|
||||
* Specifies if label should be bold or not.
|
||||
*/
|
||||
boldLabel: boolean;
|
||||
/**
|
||||
* Category of the guide (in case the guide is for category axis).
|
||||
*/
|
||||
category: string;
|
||||
/**
|
||||
* Dash length.
|
||||
*/
|
||||
dashLength: number;
|
||||
/**
|
||||
* Date of the guide (in case the guide is for category axis and parseDates is set to true).
|
||||
*/
|
||||
date: Date;
|
||||
/**
|
||||
* Works if a guide is added to CategoryAxis and this axis is non-date-based.
|
||||
* If you set it to true, the guide will start (or be placed, if it's not a fill) on the
|
||||
* beginning of the category cell and will end at the end of toCategory cell.
|
||||
*/
|
||||
expand: boolean;
|
||||
/**
|
||||
* Fill opacity. Value range is 0 - 1.
|
||||
*/
|
||||
fillAlpha: number;
|
||||
/**
|
||||
* Fill color.
|
||||
*/
|
||||
fillColor: string;
|
||||
/**
|
||||
* Font size of guide label.
|
||||
*/
|
||||
fontSize: string;
|
||||
/**
|
||||
* Unique id of a Guide. You don't need to set it, unless you want to.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Specifies whether label should be placed inside or outside plot area.
|
||||
*/
|
||||
inside: boolean;
|
||||
/**
|
||||
* The label which will be displayed near the guide.
|
||||
*/
|
||||
label: string;
|
||||
/**
|
||||
* Rotation angle of a guide label.
|
||||
*/
|
||||
labelRotation: number;
|
||||
/**
|
||||
* Line opacity.
|
||||
*/
|
||||
lineAlpha: number;
|
||||
/**
|
||||
* Line color.
|
||||
*/
|
||||
lineColor: string;
|
||||
/**
|
||||
* Line thickness.
|
||||
*/
|
||||
lineThickness: number;
|
||||
/**
|
||||
* Position of guide label. Possible values are "left" or "right" for horizontal axis
|
||||
* and "top" or "bottom" for vertical axis.
|
||||
*/
|
||||
position: string;
|
||||
/**
|
||||
* Tick length.
|
||||
*/
|
||||
tickLength: number;
|
||||
/**
|
||||
* Radar chart only. Specifies angle at which guide should end. Affects only fills, not lines.
|
||||
*/
|
||||
toAngle: number;
|
||||
/**
|
||||
* To category of the guide (in case the guide is for category axis).
|
||||
*/
|
||||
toCategory: string;
|
||||
/**
|
||||
* To date of the guide (in case the guide is for category axis and parseDates is set to true).
|
||||
* If you have both date and toDate, the space between these two dates can be filled with color.
|
||||
*/
|
||||
toDate: Date;
|
||||
/**
|
||||
* To value of the guide (in case the guide is for value axis).
|
||||
*/
|
||||
toValue: number;
|
||||
/**
|
||||
* Value of the guide (in case the guide is for value axis).
|
||||
*/
|
||||
value: number;
|
||||
/**
|
||||
* Value axis of a guide. As you can add guides directly to the chart,
|
||||
* you might need to specify which which value axis should be used.
|
||||
*/
|
||||
valueAxis: ValueAxis;
|
||||
}
|
||||
Vendored
+97
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* ImagesSettings is a class which holds common settings of all MapImage objects.
|
||||
*/
|
||||
export default class ImagesSettings {
|
||||
/**
|
||||
* Opacity of the image.
|
||||
* @default 1
|
||||
*/
|
||||
alpha: number;
|
||||
/**
|
||||
* Text which is displayed in a roll-over balloon. You can use the following tags:
|
||||
* [[title]], [[description]], [[value]] and [[percent]]. [[title]]
|
||||
*/
|
||||
balloonText: string;
|
||||
/**
|
||||
* Specifies if the image's center should be placed in the provided coordinates.
|
||||
* If false, top-left corner will be at provided coordinates.
|
||||
* @default true
|
||||
*/
|
||||
centered: boolean;
|
||||
/**
|
||||
* Color of image.
|
||||
* This will affect only predefined images (with "type" property set) and images with svgPath set.
|
||||
* This property won't affect bitmap images and loaded SVG images.
|
||||
* @default "#000000"
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Height of a description window.
|
||||
*/
|
||||
descriptionWindowHeight: number;
|
||||
/**
|
||||
* Width of a description window.
|
||||
* @default 250
|
||||
*/
|
||||
descriptionWindowWidth: number;
|
||||
/**
|
||||
* X position of a description window.
|
||||
*/
|
||||
descriptionWindowX: number;
|
||||
/**
|
||||
* Y position of a description window.
|
||||
*/
|
||||
descriptionWindowY: number;
|
||||
/**
|
||||
* Label color. #000000
|
||||
*/
|
||||
labelColor: string;
|
||||
/**
|
||||
* Font size of a label.
|
||||
* @default 11
|
||||
*/
|
||||
labelfontSize: string;
|
||||
/**
|
||||
* Position of the label. Allowed values are: left, right, top, bottom and middle. right
|
||||
*/
|
||||
labelPosition: string;
|
||||
/**
|
||||
* Label roll-over color. #00CC00
|
||||
*/
|
||||
labelRollOverColor: string;
|
||||
/**
|
||||
* Opacity of image outline.
|
||||
* This will affect only predefined images (with "type" property set) and images with svgPath set.
|
||||
* This property won't affect bitmap images and loaded SVG images.
|
||||
*/
|
||||
outlineAlpha: number;
|
||||
/**
|
||||
* Color of image outline.
|
||||
* This will affect only predefined images (with "type" property set) and images with svgPath set.
|
||||
* This property won't affect bitmap images and loaded SVG images.
|
||||
*/
|
||||
outlineColor: string;
|
||||
/**
|
||||
* Thickness of image outline.
|
||||
* This will affect only predefined images (with "type" property set) and images with svgPath set.
|
||||
* This property won't affect bitmap images and loaded SVG images.
|
||||
* @default 1
|
||||
*/
|
||||
outlineThickness: number;
|
||||
/**
|
||||
* Color of image when hovered.
|
||||
* This will affect only predefined images (with "type" property set) and images with svgPath set.
|
||||
* This property won't affect bitmap images and loaded SVG images.
|
||||
*/
|
||||
rollOverColor: string;
|
||||
/**
|
||||
* Scale of the image when hovered. Use value like 1.5 - 2 to enlarge image when user rolls-over it.
|
||||
* @default 1
|
||||
*/
|
||||
rollOverScale: number;
|
||||
/**
|
||||
* Scale of the image if it is selected. Use value like 1.5 - 2 to enlarge selected image.
|
||||
* @default 1
|
||||
*/
|
||||
selectedScale: number;
|
||||
}
|
||||
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Creates a label on the chart which can be placed anywhere, multiple can be assigned.
|
||||
*/
|
||||
export default class Label {
|
||||
/**
|
||||
* @Default 'left'
|
||||
*/
|
||||
align: string;
|
||||
/**
|
||||
* @Default 1
|
||||
*/
|
||||
alpha: number;
|
||||
/**
|
||||
* Specifies if label is bold or not.
|
||||
*/
|
||||
bold: boolean;
|
||||
/**
|
||||
* Color of a label
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Unique id of a Label. You don't need to set it, unless you want to.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Rotation angle.
|
||||
*/
|
||||
rotation: number;
|
||||
/**
|
||||
* Text size
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Text of a label
|
||||
*/
|
||||
text: string;
|
||||
/**
|
||||
* URL which will be access if user clicks on a label.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* X position of a label.
|
||||
*/
|
||||
x: number | string;
|
||||
/**
|
||||
* y position of a label.
|
||||
*/
|
||||
y: number | string;
|
||||
}
|
||||
Vendored
+114
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
* Common settings of legends.
|
||||
* If you change a property after the chart is initialized, you should call stockChart.validateNow() method
|
||||
* in order for it to work. If there is no default value specified, default value of StockLegend class will be used.
|
||||
*/
|
||||
export default class LegendSettings {
|
||||
/**
|
||||
* Alignment of legend entries. Possible values are: "left", "right" and "center".
|
||||
*/
|
||||
align: string;
|
||||
/**
|
||||
* Specifies if each legend entry should take the same space as the longest legend entry.
|
||||
*/
|
||||
equalWidths: boolean;
|
||||
/**
|
||||
* Horizontal space between legend item and left/right border.
|
||||
*/
|
||||
horizontalGap: number;
|
||||
/**
|
||||
* The text which will be displayed in the legend. Tag [[title]] will be replaced with the title of the graph.
|
||||
*/
|
||||
labelText: string;
|
||||
/**
|
||||
* Space below the last row of the legend, in pixels.
|
||||
*/
|
||||
marginBottom: number;
|
||||
/**
|
||||
* Space above the first row of the legend, in pixels.
|
||||
*/
|
||||
marginTop: number;
|
||||
/**
|
||||
* Opacity of marker border.
|
||||
*/
|
||||
markerBorderAlpha: number;
|
||||
/**
|
||||
* Marker border color.
|
||||
*/
|
||||
markerBorderColor: string;
|
||||
/**
|
||||
* Thickness of the legend border.
|
||||
*/
|
||||
markerBorderThickness: number;
|
||||
/**
|
||||
* The color of the disabled marker (when the graph is hidden).
|
||||
*/
|
||||
markerDisabledColor: string;
|
||||
/**
|
||||
* Space between legend marker and legend text, in pixels.
|
||||
*/
|
||||
markerLabelGap: number;
|
||||
/**
|
||||
* Size of the legend marker (key).
|
||||
*/
|
||||
markerSize: number;
|
||||
/**
|
||||
* Shape of the legend marker (key).
|
||||
* Possible values are:
|
||||
* "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble", "none".
|
||||
*/
|
||||
markerType: string;
|
||||
/**
|
||||
* Specifies whether legend entries should be placed in reversed order.
|
||||
*/
|
||||
reversedOrder: boolean;
|
||||
/**
|
||||
* Legend item text color on roll-over.
|
||||
*/
|
||||
rollOverColor: string;
|
||||
/**
|
||||
* When you roll-over the legend entry, all other graphs can reduce their opacity,
|
||||
* so that the graph you rolled-over would be distinguished. This property specifies the opacity of the graphs.
|
||||
*/
|
||||
rollOverGraphAlpha: number;
|
||||
/**
|
||||
* Whether showing/hiding of graphs by clicking on the legend marker is enabled or not.
|
||||
*/
|
||||
switchable: boolean;
|
||||
/**
|
||||
* Legend switch color.
|
||||
*/
|
||||
switchColor: string;
|
||||
/**
|
||||
* Legend switch type (in case the legend is switchable). Possible values are: "x" and "v".
|
||||
*/
|
||||
switchType: string;
|
||||
/**
|
||||
* Specifies whether the legend text is clickable or not.
|
||||
* Clicking on legend text can show/hide value balloons if they are enabled.
|
||||
*/
|
||||
textClickEnabled: boolean;
|
||||
/**
|
||||
* Specifies if legend labels should be use same color as corresponding markers.
|
||||
*/
|
||||
useMarkerColorForLabels: boolean;
|
||||
/**
|
||||
* The text which will be displayed in the value portion of the legend when graph is comparable and
|
||||
* at least one dataSet is selected for comparing.
|
||||
* You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]].
|
||||
*/
|
||||
valueTextComparing: string;
|
||||
/**
|
||||
* The text which will be displayed in the value portion of the legend.
|
||||
* You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]].
|
||||
*/
|
||||
valueTextRegular: string;
|
||||
/**
|
||||
* Width of the value text. Increase this value if your values do not fit in the allocated space.
|
||||
*/
|
||||
valueWidth: number;
|
||||
/**
|
||||
* Vertical space between legend items, in pixels.
|
||||
*/
|
||||
verticalGap: number;
|
||||
}
|
||||
Vendored
+145
@@ -0,0 +1,145 @@
|
||||
/**
|
||||
* PanelsSettings settings set's settings for all StockPanels.
|
||||
* If you change a property after the chart is initialized,
|
||||
* you should call stockChart.validateNow() method in order for it to work.
|
||||
* If there is no default value specified, default value of StockPanel class will be used.
|
||||
*/
|
||||
export default class PanelsSettings {
|
||||
/**
|
||||
* The angle of the 3D part of plot area. This creates a 3D effect (if the "depth3D" is > 0).
|
||||
*/
|
||||
angle: number;
|
||||
/**
|
||||
* Opacity of panel background. Possible values are 1 and 0. Values like 0.5 will not make it half-transparent.
|
||||
*/
|
||||
backgroundAlpha: number;
|
||||
/**
|
||||
* Background color of panels. Set backgroundAlpha to > 0 value in order to make background visible.
|
||||
* @default "#FFFFFF"
|
||||
*/
|
||||
backgroundColor: string;
|
||||
/**
|
||||
* The gap in pixels between two columns of the same category.
|
||||
*/
|
||||
columnSpacing: number;
|
||||
/**
|
||||
* Relative width of columns. Valid values 0 - 1.
|
||||
*/
|
||||
columnWidth: number;
|
||||
/**
|
||||
* The depth of the 3D part of plot area. This creates a 3D effect (if the "angle" is > 0).
|
||||
*/
|
||||
depth3D: number;
|
||||
/**
|
||||
* Font family.
|
||||
*/
|
||||
fontFamily: string;
|
||||
/**
|
||||
* Font size.
|
||||
*/
|
||||
fontSize: string;
|
||||
/**
|
||||
* Number of pixels between the container's bottom border and plot area.
|
||||
* @default 1
|
||||
*/
|
||||
marginBottom: number;
|
||||
/**
|
||||
* Number of pixels between the container's left border and plot area.
|
||||
* If your left valueAxis values ar not placed inside the plot area,
|
||||
* you should set marginLeft to 80 or some close value.
|
||||
*/
|
||||
marginLeft: number;
|
||||
/**
|
||||
* Number of pixels between the container's left border and plot area.
|
||||
* If your right valueAxis values ar not placed inside the plot area,
|
||||
* you should set marginRight to 80 or some close value.
|
||||
*/
|
||||
marginRight: number;
|
||||
/**
|
||||
* Number of pixels between the container's top border and plot area.
|
||||
*/
|
||||
marginTop: number;
|
||||
/**
|
||||
* Gap between panels.
|
||||
* @default 8
|
||||
*/
|
||||
panelSpacing: number;
|
||||
/**
|
||||
* This setting affects touch-screen devices only.
|
||||
* If a chart is on a page, and panEventsEnabled are set to true,
|
||||
* the page won't move if the user touches the chart first.
|
||||
* If a chart is big enough and occupies all the screen of your touch device,
|
||||
* the user won’t be able to move the page at all. That's why the default value is "false".
|
||||
* If you think that selecting or or panning the chart is a primary purpose of your chart users,
|
||||
* you should set panEventsEnabled to true.
|
||||
*/
|
||||
panEventsEnabled: boolean;
|
||||
/**
|
||||
* The opacity of plot area's border.
|
||||
*/
|
||||
plotAreaBorderAlpha: number;
|
||||
/**
|
||||
* The color of the plot area's border.
|
||||
*/
|
||||
plotAreaBorderColor: string;
|
||||
/**
|
||||
* Opacity of plot area fill.
|
||||
*/
|
||||
plotAreaFillAlphas: number;
|
||||
/**
|
||||
* Specifies the colors used to tint the background gradient fill of the plot area. String or Array of Strings
|
||||
*/
|
||||
plotAreaFillColors: any;
|
||||
/**
|
||||
* Prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc.
|
||||
* Prefixes are used on value axes and in the legend.
|
||||
* To enable prefixes, set usePrefixes property to true.
|
||||
* [
|
||||
* {number:1e+3,prefix:"k"},
|
||||
* {number:1e+6,prefix:"M"},
|
||||
* {number:1e+9,prefix:"G"},
|
||||
* {number:1e+12,prefix:"T"},
|
||||
* {number:1e+15,prefix:"P"},
|
||||
* {number:1e+18,prefix:"E"},
|
||||
* {number:1e+21,prefix:"Z"},
|
||||
* {number:1e+24,prefix:"Y"}
|
||||
* ]
|
||||
*/
|
||||
prefixesOfBigNumbers: any[];
|
||||
/**
|
||||
* Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc.
|
||||
* Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true.
|
||||
* [
|
||||
* {number:1e-24, prefix:"y"},
|
||||
* {number:1e-21, prefix:"z"},
|
||||
* {number:1e-18, prefix:"a"},
|
||||
* {number:1e-15, prefix:"f"},
|
||||
* {number:1e-12, prefix:"p"},
|
||||
* {number:1e-9, prefix:"n"},
|
||||
* {number:1e-6, prefix:"μ"},
|
||||
* {number:1e-3, prefix:"m"}
|
||||
* ]
|
||||
*/
|
||||
prefixesOfSmallNumbers: any[];
|
||||
/**
|
||||
* Specifies whether the animation should be sequenced or all objects should appear at once.
|
||||
*/
|
||||
sequencedAnimation: boolean;
|
||||
/**
|
||||
* The initial opacity of the column/line.
|
||||
* If you set startDuration to a value higher than 0, the columns/lines will fade in from startAlpha.
|
||||
*/
|
||||
startAlpha: number;
|
||||
/**
|
||||
* Duration of the animation, in seconds.
|
||||
*/
|
||||
startDuration: number;
|
||||
/**
|
||||
* Possible values are: "linear", "<", ">" "<>", "elastic", "bounce".
|
||||
*/
|
||||
startEffect: string;
|
||||
/**
|
||||
* If true, prefixes will be used for big and small numbers.
|
||||
*/
|
||||
usePrefixes: boolean;
|
||||
}
|
||||
Vendored
+88
@@ -0,0 +1,88 @@
|
||||
import AmChart from "./AmChart";
|
||||
|
||||
export default class PeriodSelector {
|
||||
/**
|
||||
* Date format of date input fields.
|
||||
* Check [[http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/formatters/DateFormatter.html
|
||||
* @default "DD-MM-YYYY"
|
||||
*/
|
||||
dateFormat: string;
|
||||
/**
|
||||
* Text displayed next to "from" date input field. From:
|
||||
*/
|
||||
fromText: string;
|
||||
/**
|
||||
* Specifies if period buttons with date range bigger than available data should be hidden.
|
||||
* @default true
|
||||
*/
|
||||
hideOutOfScopePeriods: boolean;
|
||||
/**
|
||||
* Specifies whether period selector displays "from" and "to" date input fields.
|
||||
* @default true
|
||||
*/
|
||||
inputFieldsEnabled: boolean;
|
||||
/**
|
||||
* Width of date input fields, in pixels. Works only if period selector is horizontal.
|
||||
* @default 100
|
||||
*/
|
||||
inputFieldWidth: number;
|
||||
/**
|
||||
* Array of predefined period objects. Period object has 4 properties - period, count, label and selected.
|
||||
* Possible period values are:
|
||||
* "ss" - seconds,
|
||||
* "mm" - minutes,
|
||||
* "hh" - hours,
|
||||
* "DD" - days,
|
||||
* "MM" - months,
|
||||
* "YYYY" - years.
|
||||
* Property "count" specifies how many periods this button will select.
|
||||
* "label" will be displayed on a button.
|
||||
* "selected" is a boolean which specifies if this button is selected when chart is initialized or not.
|
||||
* Example: {period:"DD", count:10, label:"10 days", selected:false}.
|
||||
*/
|
||||
periods: any[];
|
||||
/**
|
||||
* Text displayed next to predefined period buttons. Zoom:
|
||||
*/
|
||||
periodsText: string;
|
||||
/**
|
||||
* Possible values: "right", "left", "top", "bottom". bottom
|
||||
*/
|
||||
position: string;
|
||||
/**
|
||||
* Specifies whether predefined period buttons should select a period from the beginning or the end of the data.
|
||||
*/
|
||||
selectFromStart: boolean;
|
||||
/**
|
||||
* Text displayed next to "to" date input field. To:
|
||||
*/
|
||||
toText: string;
|
||||
/**
|
||||
* Width of a period selector, when position is "left" or "right".
|
||||
* @default 180
|
||||
*/
|
||||
width: number;
|
||||
|
||||
/**
|
||||
* Adds event listener to the object.
|
||||
* @param handler - Dispatched when dates in period selector input fields are changed or
|
||||
* user clicks on one of the predefined period buttons.
|
||||
*/
|
||||
addListener(
|
||||
type: string,
|
||||
handler: (
|
||||
e: {
|
||||
type: string;
|
||||
startDate: Date;
|
||||
endDate: Date;
|
||||
predefinedPeriod: string;
|
||||
count: number;
|
||||
},
|
||||
) => void,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Removes event listener from chart object.
|
||||
*/
|
||||
removeListener(chart: AmChart, type: string, handler: any): void;
|
||||
}
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* SerialDataItem holds all the information about each series.
|
||||
* When working with a chart, you do not create SerialDataItem objects or change it's properties directly.
|
||||
* Consider properties of a SerialDataItem read-only - change values in chart's data provider if you need to.
|
||||
* When serial chart parses dataProvider, it generates "chartData" array.
|
||||
* Objects of this array are SerialDataItem objects.
|
||||
*/
|
||||
export default class SerialDataItem {
|
||||
/**
|
||||
* You can access each GraphDataItem using this object.
|
||||
* The data structure is: graphDataItem = serialDataItem.axes[axisId].graphs[graphId].
|
||||
*/
|
||||
axes: object;
|
||||
/**
|
||||
* category value. String if parseDates is false, Date if true.
|
||||
*/
|
||||
category: any;
|
||||
/**
|
||||
* Timestamp of a series date. Avalable only if parseDates property of CategoryAxis is set to true.
|
||||
*/
|
||||
time: number;
|
||||
/**
|
||||
* Coordinate (horizontal or vertical, depends on chart's rotate property) of the series.
|
||||
*/
|
||||
x: number;
|
||||
}
|
||||
Vendored
+52
@@ -0,0 +1,52 @@
|
||||
/**
|
||||
* Slice is an item of AmPieChart's chartData Array and holds all the information about the slice.
|
||||
* When working with a pie chart, you do not create slices or change it's properties directly,
|
||||
* instead you set array of data using dataProvider property.
|
||||
* Consider properties of a Slice read-only - change values in chart's data provider if you need to.
|
||||
*/
|
||||
export default class Slice {
|
||||
/**
|
||||
* Opacity of a slice.
|
||||
*/
|
||||
alpha: number;
|
||||
/**
|
||||
* Color of a slice.
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Original object from data provider.
|
||||
*/
|
||||
dataContext: object;
|
||||
/**
|
||||
* Slice description.
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* Specifies whether the slice is hidden
|
||||
*/
|
||||
hidden: boolean;
|
||||
/**
|
||||
* Percent value of a slice.
|
||||
*/
|
||||
percents: number;
|
||||
/**
|
||||
* Specifies whether the slice is pulled or not.
|
||||
*/
|
||||
pulled: boolean;
|
||||
/**
|
||||
* Slice title
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Url of a slice
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* Value of a slice
|
||||
*/
|
||||
value: number;
|
||||
/**
|
||||
* specifies whether this slice has a legend entry
|
||||
*/
|
||||
visibleInLegend: boolean;
|
||||
}
|
||||
Vendored
+69
@@ -0,0 +1,69 @@
|
||||
import StockGraph from "./StockGraph";
|
||||
|
||||
/**
|
||||
* StockEvent is object which holds information about event(bullet).
|
||||
* Values from StockEventsSettings will be used if not set.
|
||||
* Stock event bullet's size depends on it's graphs fontSize.
|
||||
* When user rolls - over, clicks or rolls - out of the event bullet, AmStockChart dispatches events.
|
||||
*/
|
||||
export default class StockEvent {
|
||||
/**
|
||||
* Opacity of bullet background.
|
||||
* @default 1
|
||||
*/
|
||||
backgroundAlpha: number;
|
||||
/**
|
||||
* Color of bullet background. #DADADA
|
||||
*/
|
||||
backgroundColor: string;
|
||||
/**
|
||||
* Opacity of bullet border.
|
||||
* @default 1
|
||||
*/
|
||||
borderAlpha: number;
|
||||
/**
|
||||
* Bullet border color. #888888
|
||||
*/
|
||||
borderColor: string;
|
||||
/**
|
||||
* The color of the event text. #000000
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Date of an event. Must be Date object, not a string.
|
||||
*/
|
||||
date: Date;
|
||||
/**
|
||||
* graph on which event will be displayed.
|
||||
*/
|
||||
graph: StockGraph;
|
||||
/**
|
||||
* Roll-over background color. #CC0000
|
||||
*/
|
||||
rollOverColor: string;
|
||||
/**
|
||||
* Specifies if the event should be displayed on category axis
|
||||
*/
|
||||
showOnAxis: boolean;
|
||||
/**
|
||||
* Letter which will be displayed on the event. Not all types can display letters.
|
||||
* "text" type can display longer texts.
|
||||
*/
|
||||
text: string;
|
||||
/**
|
||||
* Type of bullet.
|
||||
* Possible values are:
|
||||
* "flag", "sign", "pin", "triangleUp", "triangleDown", "triangleLeft", "triangleRight", "text",
|
||||
* "arrowUp", "arrowDown"
|
||||
* @default "sign"
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* A URL to go to when user clicks the event.
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* target of url, "_blank" for example.
|
||||
*/
|
||||
urlTarget: string;
|
||||
}
|
||||
Vendored
+74
@@ -0,0 +1,74 @@
|
||||
import AmGraph from "./AmGraph";
|
||||
|
||||
export default class StockGraph extends AmGraph {
|
||||
/**
|
||||
* Specifies whether this graph will be compared if some data set is selected for comparing.
|
||||
*/
|
||||
comparable: boolean;
|
||||
/**
|
||||
* Specifies a field to be used to generate comparing graph.
|
||||
* Note, this field is not the one used in your dataProvider, but toField from FieldMapping object.
|
||||
*/
|
||||
compareField: string;
|
||||
/**
|
||||
* Balloon color of comparing graph.
|
||||
*/
|
||||
compareGraphBalloonColor: string;
|
||||
/**
|
||||
* Balloon text of comparing graph.
|
||||
*/
|
||||
compareGraphBalloonText: string;
|
||||
/**
|
||||
* Bullet of comparing graph.
|
||||
* Possible values are: "square", "round", "line", "triangleUp", "triangleDown", "dashedLine", "bubble".
|
||||
*/
|
||||
compareGraphBullet: string;
|
||||
/**
|
||||
* Bullet size of comparing graph.
|
||||
*/
|
||||
compareGraphBulletSize: number;
|
||||
/**
|
||||
* Corner radius of comparing graph (if type is "column").
|
||||
*/
|
||||
compareGraphCornerRadiusTop: number;
|
||||
/**
|
||||
* Dash length of compare graph.
|
||||
*/
|
||||
compareGraphDashLength: number;
|
||||
/**
|
||||
* Fill alpha of comparing graph.
|
||||
*/
|
||||
compareGraphFillAlphas: number;
|
||||
/**
|
||||
* Fill color of comparing graph.
|
||||
*/
|
||||
compareGraphFillColors: string;
|
||||
/**
|
||||
* Opacity of comparing graph line.
|
||||
*/
|
||||
compareGraphLineAlpha: number;
|
||||
/**
|
||||
* Thickness of compare graph.
|
||||
*/
|
||||
compareGraphLineThickness: number;
|
||||
/**
|
||||
* Type of comparing graph. Possible values are: "line", "column", "step", "smoothedLine." line
|
||||
*/
|
||||
compareGraphType: string;
|
||||
/**
|
||||
* Specifies if compare graph is visible in legend.
|
||||
* @default true
|
||||
*/
|
||||
compareGraphVisibleInLegend: boolean;
|
||||
/**
|
||||
* When data is grouped to periods, the graph must know which period value should be used.
|
||||
* Possible values are: "Open", "Low", "High", "Close", "Average" and "Sum".
|
||||
* @default "Close"
|
||||
*/
|
||||
periodValue: string;
|
||||
/**
|
||||
* Specifies whether data set color should be used as this graph's lineColor.
|
||||
* @default true
|
||||
*/
|
||||
useDataSetColors: boolean;
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
import AmLegend from "./AmLegend";
|
||||
|
||||
/**
|
||||
* StockLegend is a legend of StockPanel.
|
||||
*/
|
||||
export default class StockLegend extends AmLegend {
|
||||
/**
|
||||
* The text which will be displayed in the value portion of the legend when graph is comparable and
|
||||
* at least one dataSet is selected for comparing.
|
||||
* You can use tags like
|
||||
* [[value]], [[open]], [[high]], [[low]], [[close]], [[percents.value/open/close/low/high]],
|
||||
* [[description]]
|
||||
* @default [[percents.value]]%
|
||||
*/
|
||||
valueTextComparing: string;
|
||||
/**
|
||||
* The text which will be displayed in the value portion of the legend.
|
||||
* You can use tags like
|
||||
* [[value]], [[open]], [[high]], [[low]], [[close]],[[percents]], [[description]]
|
||||
* @default [[value]]
|
||||
*/
|
||||
valueTextRegular: string;
|
||||
}
|
||||
Vendored
+85
@@ -0,0 +1,85 @@
|
||||
import AmSerialChart from "./AmSerialChart";
|
||||
import StockGraph from "./StockGraph";
|
||||
import StockLegend from "./StockLegend";
|
||||
import ValueAxis from "./ValueAxis";
|
||||
|
||||
/**
|
||||
* StockPanel class creates stock panels (charts). AmStockChart can have multiple Stock panels.
|
||||
*/
|
||||
export default class StockPanel extends AmSerialChart {
|
||||
/**
|
||||
* Specifies whether x button will be displayed near the panel. This button allows turning panel off.
|
||||
*/
|
||||
allowTurningOff: boolean;
|
||||
/**
|
||||
* If true, drawing icons will be displayed in top-right corner.
|
||||
*/
|
||||
drawingIconsEnabled: boolean;
|
||||
/**
|
||||
* Specifies on which value axis user can draw trend lines.
|
||||
* Set drawingIconsEnabled to true if you want drawing icons to be visible.
|
||||
* First value axis will be used if not set here.
|
||||
*/
|
||||
drawOnAxis: ValueAxis;
|
||||
/**
|
||||
* Specifies if all trend lines should be erased when erase button is clicked.
|
||||
* If false, trend lines can be erased one by one.
|
||||
*/
|
||||
eraseAll: boolean;
|
||||
/**
|
||||
* Size of trend line drawing icons.
|
||||
* If you change this size, you should update icon images if you want them to look properly.
|
||||
* @default 18
|
||||
*/
|
||||
iconSize: number;
|
||||
/**
|
||||
* Relative height of panel. Possible values 0 - 100.
|
||||
*/
|
||||
percentHeight: number;
|
||||
/**
|
||||
* Specifies when values should be recalculated to percents.
|
||||
* Possible values are: "never", "always", "whenComparing".
|
||||
* @default "whenComparing"
|
||||
*/
|
||||
recalculateToPercents: string;
|
||||
/**
|
||||
* Specifies whether this panel will show category axis.
|
||||
* @default true
|
||||
*/
|
||||
showCategoryAxis: boolean;
|
||||
stockGraphs: StockGraph[];
|
||||
/**
|
||||
* Stock chart legend.
|
||||
*/
|
||||
stockLegend: StockLegend;
|
||||
/**
|
||||
* Title of a panel. Note, StockLegend should be added in order title to be displayed.
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Trend line opacity.
|
||||
* @default 1
|
||||
*/
|
||||
trendLineAlpha: number;
|
||||
/**
|
||||
* Trend line color. #00CC00
|
||||
*/
|
||||
trendLineColor: string;
|
||||
/**
|
||||
* Trend line dash length.
|
||||
*/
|
||||
trendLineDashLength: number;
|
||||
/**
|
||||
* Trend line thickness.
|
||||
* @default 2
|
||||
*/
|
||||
trendLineThickness: number;
|
||||
/**
|
||||
* Adds a graph to the panel.
|
||||
*/
|
||||
addStockGraph(graph: StockGraph): void;
|
||||
/**
|
||||
* Removes graph from the panel.
|
||||
*/
|
||||
removeStockGraph(graph: StockGraph): void;
|
||||
}
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
export default class Title {
|
||||
/**
|
||||
* @default 1
|
||||
*/
|
||||
alpha: number;
|
||||
/**
|
||||
* Specifies if the tile is bold or not.
|
||||
* @default false
|
||||
*/
|
||||
bold: boolean;
|
||||
/**
|
||||
* Text color of a title.
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Unique id of a Title. You don't need to set it, unless you want to.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Text size
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Text of a label
|
||||
*/
|
||||
text: string;
|
||||
}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Trend lines are straight lines indicating trends, might also be used for some different purposes.
|
||||
* Can be used by Serial and XY charts.
|
||||
* To add/remove trend line, use chart.addTrendLine(trendLine)/chart.removeTrendLine(trendLine) methods
|
||||
* or simply pass array of trend lines: chart.trendLines = [trendLine1, trendLine2].
|
||||
* @example
|
||||
* let trendLine = new AmCharts.TrendLine();
|
||||
* trendLine.initialDate = new Date(2012, 0, 2, 12); // 12 is hour - to start trend line in the middle of the day
|
||||
* trendLine.finalDate = new Date(2012, 0, 11, 12);
|
||||
* trendLine.initialValue = 10;
|
||||
* trendLine.finalValue = 19;
|
||||
* trendLine.lineColor = "#CC0000";
|
||||
* chart.addTrendLine(trendLine);
|
||||
*/
|
||||
export default class TrendLine { }
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
/**
|
||||
* ValueAxesSettings settings sets settings for all ValueAxes.
|
||||
* If you change a property after the chart is initialized,
|
||||
* you should call stockChart.validateNow() method in order for it to work.
|
||||
* If there is no default value specified, default value of ValueAxis class will be used.
|
||||
*/
|
||||
export default class ValueAxesSettings {
|
||||
/**
|
||||
* Specifies whether number for gridCount is specified automatically, according to the axis size.
|
||||
* @default true
|
||||
*/
|
||||
autoGridCount: boolean;
|
||||
/**
|
||||
* Axis opacity.
|
||||
*/
|
||||
axisAlpha: number;
|
||||
/**
|
||||
* Axis color.
|
||||
*/
|
||||
axisColor: string;
|
||||
/**
|
||||
* Thickness of the axis.
|
||||
*/
|
||||
axisThickness: number;
|
||||
/**
|
||||
* Label color.
|
||||
*/
|
||||
color: string;
|
||||
/**
|
||||
* Length of a dash. By default, the grid line is not dashed.
|
||||
*/
|
||||
dashLength: number;
|
||||
/**
|
||||
* Fill opacity. Every second space between grid lines can be filled with color.
|
||||
*/
|
||||
fillAlpha: number;
|
||||
/**
|
||||
* Fill color. Every second space between grid lines can be filled with color.
|
||||
* Set fillAlpha to a value greater than 0 to see the fills.
|
||||
*/
|
||||
fillColor: string;
|
||||
/**
|
||||
* Opacity of grid lines.
|
||||
*/
|
||||
gridAlpha: number;
|
||||
/**
|
||||
* Color of grid lines.
|
||||
*/
|
||||
gridColor: string;
|
||||
/**
|
||||
* Approximate number of grid lines. autoGridCount should be set to false,
|
||||
* otherwise this property will be ignored.
|
||||
*/
|
||||
gridCount: number;
|
||||
/**
|
||||
* Thickness of grid lines.
|
||||
*/
|
||||
gridThickness: number;
|
||||
/**
|
||||
* Specifies whether guide values should be included when calculating min and max of the axis.
|
||||
*/
|
||||
includeGuidesInMinMax: boolean;
|
||||
/**
|
||||
* If true, the axis will include hidden graphs when calculating min and max values.
|
||||
*/
|
||||
includeHidden: boolean;
|
||||
/**
|
||||
* Specifies whether values should be placed inside or outside plot area.
|
||||
* In case you set this to false, you'll have to adjust marginLeft or marginRight in
|
||||
* [[PanelsSettings]] in order labels to be visible.
|
||||
* @default true
|
||||
*/
|
||||
inside: boolean;
|
||||
/**
|
||||
* Specifies whether values on axis can only be integers or both integers and doubles.
|
||||
*/
|
||||
integersOnly: boolean;
|
||||
/**
|
||||
* Frequency at which labels should be placed.
|
||||
*/
|
||||
labelFrequency: number;
|
||||
/**
|
||||
* Specifies whether value labels are displayed.
|
||||
*/
|
||||
labelsEnabled: boolean;
|
||||
/**
|
||||
* Set to true if value axis is logarithmic, false otherwise.
|
||||
*/
|
||||
logarithmic: boolean;
|
||||
/**
|
||||
* The distance of the axis to the plot area, in pixels. Useful if you have more then one axis on the same side.
|
||||
*/
|
||||
offset: number;
|
||||
/**
|
||||
* Position of the value axis. Possible values are "left" and "right".
|
||||
*/
|
||||
position: string;
|
||||
/**
|
||||
* Set to true if value axis is reversed (smaller values on top), false otherwise.
|
||||
*/
|
||||
reversed: boolean;
|
||||
/**
|
||||
* Specifies if first label of value axis should be displayed.
|
||||
*/
|
||||
showFirstLabel: boolean;
|
||||
/**
|
||||
* Specifies if last label of value axis should be displayed.
|
||||
*/
|
||||
showLastLabel: boolean;
|
||||
/**
|
||||
* Stacking mode of the axis. Possible values are: "none", "regular", "100%", "3d".
|
||||
*/
|
||||
stackType: string;
|
||||
/**
|
||||
* Tick length.
|
||||
*/
|
||||
tickLength: number;
|
||||
/**
|
||||
* Unit which will be added to the value label.
|
||||
*/
|
||||
unit: string;
|
||||
/**
|
||||
* Position of the unit. Possible values are "left" or "right".
|
||||
*/
|
||||
unitPosition: string;
|
||||
}
|
||||
Vendored
+250
@@ -0,0 +1,250 @@
|
||||
import AmChart from "./AmChart";
|
||||
import AxisBase from "./AxisBase";
|
||||
import Guide from "./Guide";
|
||||
|
||||
/**
|
||||
* ValueAxis is the class which displays value axis for the chart. The chart can have any number of value axes.
|
||||
* For Serial chart one value axis is created automatically.
|
||||
* For XY Chart two value axes (horizontal and vertical) are created automatically.
|
||||
*/
|
||||
export default class ValueAxis extends AxisBase {
|
||||
/**
|
||||
* Radar chart only. Specifies distance from axis to the axis title (category) 10
|
||||
*/
|
||||
axisTitleOffset: number;
|
||||
/**
|
||||
* Read-only. Coordinate of the base value.
|
||||
*/
|
||||
baseCoord: number;
|
||||
/**
|
||||
* Specifies base value of the axis.
|
||||
*/
|
||||
baseValue: number;
|
||||
/**
|
||||
* If your values represents time units, and you want value axis labels to be formatted as duration,
|
||||
* you have to set the duration unit. Possible values are: "ss", "mm", "hh" and "DD".
|
||||
*/
|
||||
duration: string;
|
||||
/**
|
||||
* If duration property is set, you can specify what string should be displayed next to day,
|
||||
* hour, minute and second.
|
||||
* {DD:"d. ", hh:":", mm:":",ss:""}
|
||||
*/
|
||||
durationUnits: { DD: string; hh: string; mm: string; ss: string };
|
||||
/**
|
||||
* Radar chart only. Possible values are: "polygons" and "circles". Set "circles" for polar charts.
|
||||
* @default "polygons"
|
||||
*/
|
||||
gridType: string;
|
||||
/**
|
||||
* Unique id of value axis. It is not required to set it, unless you need to tell the graph which exact
|
||||
* value axis it should use.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Specifies whether guide values should be included when calculating min and max of the axis.
|
||||
*/
|
||||
includeGuidesInMinMax: boolean;
|
||||
/**
|
||||
* If true, the axis will include hidden graphs when calculating min and max values.
|
||||
*/
|
||||
includeHidden: boolean;
|
||||
/**
|
||||
* Specifies whether values on axis can only be integers or both integers and doubles.
|
||||
*/
|
||||
integersOnly: boolean;
|
||||
/**
|
||||
* You can use this function to format Value axis labels.
|
||||
* This function is called and these parameters are passed: labelFunction(value, valueText, valueAxis);
|
||||
* Where value is numeric value, valueText is formatted string and valueAxis is a reference to valueAxis object.
|
||||
* If axis type is "date", labelFunction will pass different arguments:
|
||||
* labelFunction(valueText, date, valueAxis)
|
||||
* Your function should return string.
|
||||
*/
|
||||
labelFunction(value: number, valueText: string, valueAxis: ValueAxis): string;
|
||||
labelFunction(valueText: string, data: Date, valueAxis: ValueAxis): string;
|
||||
/**
|
||||
* Specifies if this value axis' scale should be logarithmic.
|
||||
*/
|
||||
logarithmic: boolean;
|
||||
/**
|
||||
* Read-only. Maximum value of the axis.
|
||||
*/
|
||||
max: number;
|
||||
/**
|
||||
* If you don't want max value to be calculated by the chart, set it using this property.
|
||||
* This value might still be adjusted so that it would be possible to draw grid at rounded intervals.
|
||||
*/
|
||||
maximum: number;
|
||||
/**
|
||||
* If your value axis is date-based, you can specify maximum date of the axis.
|
||||
* Can be set as date object, timestamp number or string if dataDateFormat is set.
|
||||
*/
|
||||
maximumData: Date;
|
||||
/**
|
||||
* Read-only. Minimum value of the axis.
|
||||
*/
|
||||
min: number;
|
||||
/**
|
||||
* If you don't want min value to be calculated by the chart, set it using this property.
|
||||
* This value might still be adjusted so that it would be possible to draw grid at rounded intervals.
|
||||
*/
|
||||
minimum: number;
|
||||
/**
|
||||
* If your value axis is date-based, you can specify minimum date of the axis.
|
||||
* Can be set as date object, timestamp number or string if dataDateFormat is set.
|
||||
*/
|
||||
minimumDate: Date;
|
||||
/**
|
||||
* If set value axis scale (min and max numbers) will be multiplied by it.
|
||||
* I.e. if set to 1.2 the scope of values will increase by 20%.
|
||||
*/
|
||||
minMaxMultiplier: number;
|
||||
/**
|
||||
* Works with radar charts only.
|
||||
* If you set it to “middle”, labels and data points will be placed in the middle between axes.
|
||||
*/
|
||||
pointPosition: string;
|
||||
/**
|
||||
* Possible values are: "top", "bottom", "left", "right".
|
||||
* If axis is vertical, default position is "left". If axis is horizontal, default position is "bottom".
|
||||
*/
|
||||
position: string;
|
||||
/**
|
||||
* Precision (number of decimals) of values.
|
||||
*/
|
||||
precision: number;
|
||||
/**
|
||||
* Radar chart only. Specifies if categories (axes' titles) should be displayed near axes)
|
||||
* @default true
|
||||
*/
|
||||
radarCategoriesEnabled: boolean;
|
||||
/**
|
||||
* pecifies if graphs's values should be recalculated to percents.
|
||||
*/
|
||||
recalculateToPercents: boolean;
|
||||
/**
|
||||
* Specifies if value axis should be reversed (smaller values on top).
|
||||
*/
|
||||
reversed: boolean;
|
||||
/**
|
||||
* Stacking mode of the axis.
|
||||
* Possible values are: "none", "regular", "100%", "3d".
|
||||
* Note, only graphs of one type will be stacked.
|
||||
* @default "none"
|
||||
*/
|
||||
stackType: string;
|
||||
/**
|
||||
* Read-only. Value difference between two grid lines.
|
||||
*/
|
||||
step: number;
|
||||
/**
|
||||
* If you set minimum and maximum for your axis, chart adjusts them so that grid would start and end on the
|
||||
* beginning and end of plot area and grid would be at equal intervals.
|
||||
* If you set strictMinMax to true, the chart will not adjust minimum and maximum of value axis.
|
||||
*/
|
||||
strictMinMax: boolean;
|
||||
/**
|
||||
* In case you synchronize one value axis with another, you need to set the synchronization multiplier.
|
||||
* Use synchronizeWithAxis method to set with which axis it should be synced.
|
||||
*/
|
||||
synchronizationMultiplier: number;
|
||||
/**
|
||||
* One value axis can be synchronized with another value axis.
|
||||
* You can use both reference to your axis or id of the axis here.
|
||||
* You should set synchronizationMultiplyer in order for this to work.
|
||||
*/
|
||||
synchronizeWith: ValueAxis;
|
||||
/**
|
||||
* If this value axis is stacked and has columns, setting valueAxis.totalText = "[[total]]" will make it
|
||||
* to display total value above the most-top column.
|
||||
*/
|
||||
totalText: string;
|
||||
/**
|
||||
* Color of total text.
|
||||
*/
|
||||
totalTextColor: string;
|
||||
/**
|
||||
* Distance from data point to total text.
|
||||
*/
|
||||
totalTextOffset: number;
|
||||
/**
|
||||
* This allows you to have logarithmic value axis and have zero values in the data.
|
||||
* You must set it to >0 value in order to work.
|
||||
*/
|
||||
treatZeroAs: number;
|
||||
/**
|
||||
* Type of value axis.
|
||||
* If your values in data provider are dates and you want this axis to show dates instead of numbers,
|
||||
* set it to "date".
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* Unit which will be added to the value label.
|
||||
*/
|
||||
unit: string;
|
||||
/**
|
||||
* Position of the unit. Possible values are "left" and "right". right
|
||||
*/
|
||||
unitPosition: string;
|
||||
/**
|
||||
* If true, prefixes will be used for big and small numbers.
|
||||
* You can set arrays of prefixes directly to the chart object
|
||||
* via prefixesOfSmallNumbers and prefixesOfBigNumbers.
|
||||
*/
|
||||
usePrefixes: boolean;
|
||||
/**
|
||||
* If true, values will always be formatted using scientific notation (5e+8, 5e-8...)
|
||||
* Otherwise only values bigger then 1e+21 and smaller then 1e-7 will be displayed in scientific notation.
|
||||
*/
|
||||
useScientificNotation: boolean;
|
||||
|
||||
/**
|
||||
* Adds guide to the axis.
|
||||
*/
|
||||
addGuide(guide: Guide): void;
|
||||
/**
|
||||
* Number, - value of coordinate. Returns value of the coordinate. coordinate - y or x coordinate, in pixels.
|
||||
*/
|
||||
coordinateToValue(coordinate: number): void;
|
||||
/**
|
||||
* Number - coordinate Returns coordinate of the value in pixels. value - Number
|
||||
*/
|
||||
getCoordinate(value: number): void;
|
||||
/**
|
||||
* Removes guide from the axis.
|
||||
*/
|
||||
removeGuide(guide: Guide): void;
|
||||
|
||||
/**
|
||||
* One value axis can be synchronized with another value axis.
|
||||
* You should set synchronizationMultiplyer in order for this to work.
|
||||
*/
|
||||
synchronizeWithAxis(axis: ValueAxis): void;
|
||||
/**
|
||||
* XY Chart only. Zooms-in the axis to the provided values.
|
||||
*/
|
||||
zoomToValues(startValue: number, endValue: number): void;
|
||||
|
||||
/**
|
||||
* Adds event listener.
|
||||
* @param type One of "axisChanged", "axisZoomed", "logarithmicAxisFailed".
|
||||
* @param handler The event handler.
|
||||
*/
|
||||
addListener(
|
||||
type: string,
|
||||
handler: (
|
||||
e: {
|
||||
type: string;
|
||||
startValue?: Date;
|
||||
endValue?: Date;
|
||||
chart: AmChart;
|
||||
},
|
||||
) => void,
|
||||
): void;
|
||||
|
||||
/**
|
||||
* Removes event listener from chart object.
|
||||
*/
|
||||
removeListener(chart: AmChart, type: string, handler: any): void;
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
import { AmCharts } from "amcharts";
|
||||
|
||||
const theme = AmCharts.themes.light;
|
||||
|
||||
// Global namespace settings.
|
||||
AmCharts.useUTC = false;
|
||||
AmCharts.theme = theme;
|
||||
|
||||
// "JSON"-style API.
|
||||
const chart = AmCharts.makeChart("chartdiv", {
|
||||
type: "gauge",
|
||||
arrows: [
|
||||
{
|
||||
value: 130
|
||||
}
|
||||
],
|
||||
titles: [
|
||||
{
|
||||
text: "Speedometer",
|
||||
size: 15
|
||||
}
|
||||
],
|
||||
axes: [
|
||||
{
|
||||
bottomText: "0 km/h",
|
||||
endValue: 220,
|
||||
valueInterval: 10,
|
||||
bands: [
|
||||
{
|
||||
color: "#00CC00",
|
||||
endValue: 90,
|
||||
startValue: 0
|
||||
},
|
||||
{
|
||||
color: "#ffac29",
|
||||
endValue: 130,
|
||||
startValue: 90
|
||||
},
|
||||
{
|
||||
color: "#ea3838",
|
||||
endValue: 220,
|
||||
startValue: 130,
|
||||
innerRadius: "95%"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// Object based API.
|
||||
const amAngularGauge = new AmCharts.AmAngularGauge(theme);
|
||||
const amBalloon = new AmCharts.AmBalloon();
|
||||
const amChart = new AmCharts.AmChart(theme);
|
||||
const amCoordinateChart = new AmCharts.AmCoordinateChart(theme);
|
||||
const amGraph = new AmCharts.AmGraph();
|
||||
const amLegend = new AmCharts.AmLegend();
|
||||
const amPieChart = new AmCharts.AmPieChart(theme);
|
||||
const amRadarChart = new AmCharts.AmRadarChart(theme);
|
||||
const amRectangularChart = new AmCharts.AmRectangularChart(theme);
|
||||
const amSerialChart = new AmCharts.AmSerialChart(theme);
|
||||
const amXYChart = new AmCharts.AmXYChart(theme);
|
||||
const axisBase = new AmCharts.AxisBase();
|
||||
const categoryBase = new AmCharts.CategoryAxis();
|
||||
const chartCursor = new AmCharts.ChartCursor();
|
||||
const chartScrollbar = new AmCharts.ChartScrollbar();
|
||||
const gaugeArrow = new AmCharts.GaugeArrow();
|
||||
const gaugeAxis = new AmCharts.GaugeAxis();
|
||||
const gaugeBand = new AmCharts.GaugeBand();
|
||||
const graphDataItem = new AmCharts.GraphDataItem();
|
||||
const guid = new AmCharts.Guide();
|
||||
const label = new AmCharts.Label();
|
||||
const serialDateItem = new AmCharts.SerialDataItem();
|
||||
const slice = new AmCharts.Slice();
|
||||
const title = new AmCharts.Title();
|
||||
const trendLine = new AmCharts.TrendLine();
|
||||
const valueAxis = new AmCharts.ValueAxis();
|
||||
Vendored
+120
-3474
File diff suppressed because it is too large
Load Diff
@@ -5,9 +5,9 @@
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": false,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
@@ -18,6 +18,50 @@
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
"index.d.ts",
|
||||
"AmAngularGauge.d.ts",
|
||||
"AmBalloon.d.ts",
|
||||
"AmChart.d.ts",
|
||||
"AmCoordinateChart.d.ts",
|
||||
"AmGraph.d.ts",
|
||||
"AmLegend.d.ts",
|
||||
"AmPieChart.d.ts",
|
||||
"AmRadarChart.d.ts",
|
||||
"AmRectangularChart.d.ts",
|
||||
"AmSerialChart.d.ts",
|
||||
"AmStockChart.d.ts",
|
||||
"AmXYChart.d.ts",
|
||||
"AreasSettings.d.ts",
|
||||
"AxisBase.d.ts",
|
||||
"CategoryAxesSettings.d.ts",
|
||||
"CategoryAxis.d.ts",
|
||||
"ChartCursor.d.ts",
|
||||
"ChartCursorSettings.d.ts",
|
||||
"ChartScrollbar.d.ts",
|
||||
"ChartScrollbarSettings.d.ts",
|
||||
"DataSet.d.ts",
|
||||
"DataSetSelector.d.ts",
|
||||
"ExportSettings.d.ts",
|
||||
"GaugeArrow.d.ts",
|
||||
"GaugeAxis.d.ts",
|
||||
"GaugeBand.d.ts",
|
||||
"GraphDataItem.d.ts",
|
||||
"Guide.d.ts",
|
||||
"ImagesSettings.d.ts",
|
||||
"Label.d.ts",
|
||||
"LegendSettings.d.ts",
|
||||
"PanelSettings.d.ts",
|
||||
"PeriodSelector.d.ts",
|
||||
"SerialDataItem.d.ts",
|
||||
"Slice.d.ts",
|
||||
"StockEvent.d.ts",
|
||||
"StockGraph.d.ts",
|
||||
"StockLegend.d.ts",
|
||||
"StockPanel.d.ts",
|
||||
"Title.d.ts",
|
||||
"TrendLine.d.ts",
|
||||
"ValueAxesSettings.d.ts",
|
||||
"ValueAxis.d.ts",
|
||||
"amcharts-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,79 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
"max-line-length": [true, 120]
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+13
@@ -54,6 +54,19 @@ export interface ConfirmChannel extends Channel {
|
||||
waitForConfirms(callback?: (err: any) => void): void;
|
||||
}
|
||||
|
||||
export const credentials: {
|
||||
external(): {
|
||||
mechanism: string;
|
||||
response(): Buffer;
|
||||
};
|
||||
plain(username: string, password: string): {
|
||||
mechanism: string;
|
||||
response(): Buffer;
|
||||
username: string;
|
||||
password: string;
|
||||
};
|
||||
};
|
||||
|
||||
export function connect(callback: (err: any, connection: Connection) => void): void;
|
||||
export function connect(url: string, callback: (err: any, connection: Connection) => void): void;
|
||||
export function connect(url: string, socketOptions: any, callback: (err: any, connection: Connection) => void): void;
|
||||
|
||||
Vendored
+13
@@ -63,4 +63,17 @@ export interface ConfirmChannel extends Channel {
|
||||
waitForConfirms(): Promise<void>;
|
||||
}
|
||||
|
||||
export const credentials: {
|
||||
external(): {
|
||||
mechanism: string;
|
||||
response(): Buffer;
|
||||
};
|
||||
plain(username: string, password: string): {
|
||||
mechanism: string;
|
||||
response(): Buffer;
|
||||
username: string;
|
||||
password: string;
|
||||
};
|
||||
};
|
||||
|
||||
export function connect(url: string | Options.Connect, socketOptions?: any): Promise<Connection>;
|
||||
|
||||
@@ -5,6 +5,7 @@ app.config((localStorageServiceProvider: angular.dynamicLocale.tmhDynamicLocaleP
|
||||
localStorageServiceProvider
|
||||
.localeLocationPattern("app/config/locales/")
|
||||
.useCookieStorage();
|
||||
localStorageServiceProvider.defaultLocale('en');
|
||||
});
|
||||
|
||||
class LocaleTestController {
|
||||
|
||||
+1
@@ -17,6 +17,7 @@ declare module 'angular' {
|
||||
}
|
||||
|
||||
interface tmhDynamicLocaleProvider extends angular.IServiceProvider {
|
||||
defaultLocale(locale: string): void;
|
||||
localeLocationPattern(location: string): tmhDynamicLocaleProvider;
|
||||
localeLocationPattern(): string;
|
||||
storageKey(storageKey: string): void;
|
||||
|
||||
@@ -131,7 +131,7 @@ angular
|
||||
$scope['foo']; // = undefined
|
||||
locker.get('foo'); // = undefined
|
||||
|
||||
if (! locker.supported()) {
|
||||
if (! locker.supported('session')) {
|
||||
// load a polyfill?
|
||||
}
|
||||
}]);
|
||||
|
||||
Vendored
+1
-1
@@ -140,7 +140,7 @@ declare module 'angular' {
|
||||
*
|
||||
* @param {String} driver The driver to check support with
|
||||
*/
|
||||
supported(): boolean;
|
||||
supported(driver: string): boolean;
|
||||
/**
|
||||
* Unbind a storage key from a $scope property
|
||||
*
|
||||
|
||||
@@ -196,7 +196,7 @@ myApp.controller('DialogController', ($scope: TestScope, $mdDialog: ng.material.
|
||||
});
|
||||
|
||||
class IconDirective implements ng.IDirective {
|
||||
private $mdIcon: ng.material.IIcon;
|
||||
private readonly $mdIcon: ng.material.IIcon;
|
||||
constructor($mdIcon: ng.material.IIcon) {
|
||||
this.$mdIcon = $mdIcon;
|
||||
}
|
||||
|
||||
@@ -50,11 +50,11 @@ namespace TestApp {
|
||||
var horixontalPosition: number = $document.duScrollLeft();
|
||||
}
|
||||
|
||||
private invertedEasingFn = (x: number): number => {
|
||||
private readonly invertedEasingFn = (x: number): number => {
|
||||
return 1 - x;
|
||||
}
|
||||
|
||||
private onScrollCompleted = (): void => {
|
||||
private readonly onScrollCompleted = (): void => {
|
||||
console.log('Done scrolling');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class EmployeesFactory {
|
||||
static $inject = ['$rootScope', 'Hub', '$timeout'];
|
||||
private hub: ngSignalr.Hub;
|
||||
private readonly hub: ngSignalr.Hub;
|
||||
public all: Array<Employee>;
|
||||
|
||||
constructor($rootScope: ng.IRootScopeService, Hub: ngSignalr.HubFactory, $timeout: ng.ITimeoutService) {
|
||||
|
||||
@@ -137,10 +137,10 @@ class UrlLocatorTestService implements IUrlLocatorTestService {
|
||||
static $inject = ["$http", "$rootScope", "$urlRouter", "$state"];
|
||||
|
||||
constructor(
|
||||
private $http: ng.IHttpService,
|
||||
private $rootScope: ng.IRootScopeService,
|
||||
private $urlRouter: ng.ui.IUrlRouterService,
|
||||
private $state: ng.ui.IStateService
|
||||
private readonly $http: ng.IHttpService,
|
||||
private readonly $rootScope: ng.IRootScopeService,
|
||||
private readonly $urlRouter: ng.ui.IUrlRouterService,
|
||||
private readonly $state: ng.ui.IStateService
|
||||
) {
|
||||
$rootScope.$on("$locationChangeSuccess", (event: ng.IAngularEvent) => this.onLocationChangeSuccess(event));
|
||||
$rootScope.$on('$stateNotFound', (event: ng.IAngularEvent, unfoundState: ng.ui.IUnfoundState, fromState: ng.ui.IState, fromParams: {}) =>
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
/* tslint:disable:no-empty no-shadowed-variable */
|
||||
|
||||
class AuthService {
|
||||
/**
|
||||
* Holds all the requests which failed due to 401 response,
|
||||
@@ -163,7 +161,7 @@ namespace My.Namespace {
|
||||
}
|
||||
|
||||
class TestProvider implements ng.IServiceProvider {
|
||||
constructor(private $scope: ng.IScope) {}
|
||||
constructor(private readonly $scope: ng.IScope) {}
|
||||
|
||||
$get() {}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -159,7 +159,7 @@ declare namespace angular {
|
||||
module(
|
||||
name: string,
|
||||
requires?: string[],
|
||||
configFn?: Function): IModule;
|
||||
configFn?: Injectable<Function>): IModule;
|
||||
|
||||
noop(...args: any[]): void;
|
||||
reloadWithDebugInfo(): void;
|
||||
|
||||
Vendored
+2
-2
@@ -112,7 +112,7 @@ interface AngularFireObject extends AngularFireSimpleObject {
|
||||
* @param {object} scope
|
||||
* @param {string} varName
|
||||
* @returns a promise which resolves to an unbind method after data is set in scope
|
||||
*/
|
||||
*/
|
||||
$bindTo(scope: ng.IScope, varName: string): ng.IPromise<any>;
|
||||
|
||||
/**
|
||||
@@ -125,7 +125,7 @@ interface AngularFireObject extends AngularFireSimpleObject {
|
||||
* @param {Function} cb
|
||||
* @param {Object} [context]
|
||||
* @returns {Function} invoke to stop observing events
|
||||
*/
|
||||
*/
|
||||
$watch(callback: Function, context?: any): Function;
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@types/firebase": "^2.4.1"
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ interface TestScope extends ng.IScope {
|
||||
}
|
||||
|
||||
class TestController {
|
||||
constructor(private $scope: TestScope, private storage: ng.localStorage.ILocalStorageService) {
|
||||
constructor(private readonly $scope: TestScope, private readonly storage: ng.localStorage.ILocalStorageService) {
|
||||
storage.bind($scope, 'varName');
|
||||
storage.bind($scope,'varName', { defaultValue: 'randomValue123', storeName: 'customStoreKey' });
|
||||
$scope.viewType = 'ANYTHING';
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import * as colors from 'ansi-colors';
|
||||
|
||||
let s: string;
|
||||
|
||||
s = colors.bgblack("hello");
|
||||
s = colors.bgblue("hello");
|
||||
s = colors.bgcyan("hello");
|
||||
s = colors.bggreen("hello");
|
||||
s = colors.bgmagenta("hello");
|
||||
s = colors.bgred("hello");
|
||||
s = colors.bgwhite("hello");
|
||||
s = colors.bgyellow("hello");
|
||||
s = colors.black("hello");
|
||||
s = colors.blue("hello");
|
||||
s = colors.bold("hello");
|
||||
s = colors.cyan("hello");
|
||||
s = colors.dim("hello");
|
||||
s = colors.gray("hello");
|
||||
s = colors.green("hello");
|
||||
s = colors.grey("hello");
|
||||
s = colors.hidden("hello");
|
||||
s = colors.inverse("hello");
|
||||
s = colors.italic("hello");
|
||||
s = colors.magenta("hello");
|
||||
s = colors.red("hello");
|
||||
s = colors.reset("hello");
|
||||
s = colors.strikethrough("hello");
|
||||
s = colors.underline("hello");
|
||||
s = colors.white("hello");
|
||||
s = colors.yellow("hello");
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
// Type definitions for ansi-colors 1.0
|
||||
// Project: https://github.com/doowb/ansi-colors
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function bgblack(s: string): string;
|
||||
export function bgblue(s: string): string;
|
||||
export function bgcyan(s: string): string;
|
||||
export function bggreen(s: string): string;
|
||||
export function bgmagenta(s: string): string;
|
||||
export function bgred(s: string): string;
|
||||
export function bgwhite(s: string): string;
|
||||
export function bgyellow(s: string): string;
|
||||
export function black(s: string): string;
|
||||
export function blue(s: string): string;
|
||||
export function bold(s: string): string;
|
||||
export function cyan(s: string): string;
|
||||
export function dim(s: string): string;
|
||||
export function gray(s: string): string;
|
||||
export function green(s: string): string;
|
||||
export function grey(s: string): string;
|
||||
export function hidden(s: string): string;
|
||||
export function inverse(s: string): string;
|
||||
export function italic(s: string): string;
|
||||
export function magenta(s: string): string;
|
||||
export function red(s: string): string;
|
||||
export function reset(s: string): string;
|
||||
export function strikethrough(s: string): string;
|
||||
export function underline(s: string): string;
|
||||
export function white(s: string): string;
|
||||
export function yellow(s: string): string;
|
||||
@@ -18,6 +18,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"bignumber.js-tests.ts"
|
||||
"ansi-colors-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import anydbsql = require('anydb-sql');
|
||||
import { Table, Column } from 'anydb-sql'
|
||||
import migrator = require('anydb-sql-migrations');
|
||||
|
||||
function do_not_run() {
|
||||
|
||||
var db = anydbsql({
|
||||
url: 'postgres://user:pass@host:port/database',
|
||||
connections: { min: 2, max: 20 }
|
||||
});
|
||||
|
||||
migrator
|
||||
.create(db, '/path/to/migrations/dir')
|
||||
.run();
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
// Type definitions for anydb-sql-migrations
|
||||
// Project: https://github.com/spion/anydb-sql-migrations
|
||||
// Definitions by: Gorgi Kosev <https://github.com/spion>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import Promise = require('bluebird');
|
||||
import { Column, Table, Transaction, AnydbSql } from 'anydb-sql';
|
||||
export interface Migration {
|
||||
version: string;
|
||||
}
|
||||
export interface MigrationsTable extends Table<Migration> {
|
||||
version: Column<string>;
|
||||
}
|
||||
export interface MigFn {
|
||||
(tx: Transaction): Promise<any>;
|
||||
}
|
||||
export interface MigrationTask {
|
||||
up: MigFn;
|
||||
down: MigFn;
|
||||
name: string;
|
||||
}
|
||||
export declare function create(db: AnydbSql, tasks: string | MigrationTask[]): {
|
||||
run: () => Promise<any>;
|
||||
migrateTo: (target?: string) => Promise<any>;
|
||||
check: (f: (m: {
|
||||
type: string;
|
||||
items: MigrationTask[];
|
||||
}) => any) => Promise<any>;
|
||||
};
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"anydb-sql-migrations-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
import * as appInsights from "applicationinsights";
|
||||
|
||||
// basic use
|
||||
appInsights.setup("<instrumentation_key>").start();
|
||||
|
||||
// basic use with auto-collection configuration
|
||||
appInsights.setup("<instrumentation_key>")
|
||||
.setAutoCollectRequests(false)
|
||||
.setAutoCollectPerformance(false)
|
||||
.setAutoCollectExceptions(false)
|
||||
// no telemetry will be sent until .start() is called
|
||||
// this prevents any of the auto-collectors from initializing
|
||||
.enableVerboseLogging()
|
||||
.start();
|
||||
|
||||
appInsights.client.trackEvent("custom event", {customProperty: "custom property value"});
|
||||
appInsights.client.trackException(new Error("handled exceptions can be logged with this method"));
|
||||
appInsights.client.trackMetric("custom metric", 3);
|
||||
appInsights.client.trackTrace("trace message");
|
||||
appInsights.client.trackDependency("dependency name", "commandName", 500, true);
|
||||
|
||||
// assign common properties to all telemetry
|
||||
appInsights.client.commonProperties = {
|
||||
environment: "dev"
|
||||
};
|
||||
|
||||
// send any pending data and log the response
|
||||
appInsights.client.sendPendingData(function (response) {
|
||||
console.log(response);
|
||||
});
|
||||
Vendored
-490
@@ -1,490 +0,0 @@
|
||||
// Type definitions for Application Insights v0.15.12
|
||||
// Project: https://github.com/Microsoft/ApplicationInsights-node.js
|
||||
// Definitions by: Scott Southwood <https://github.com/scsouthw>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface AutoCollectConsole {
|
||||
constructor(client: Client): AutoCollectConsole;
|
||||
enable(isEnabled: boolean): void;
|
||||
isInitialized(): boolean;
|
||||
}
|
||||
|
||||
interface AutoCollectExceptions {
|
||||
constructor(client:Client): AutoCollectExceptions;
|
||||
isInitialized(): boolean;
|
||||
enable(isEnabled:boolean): void;
|
||||
}
|
||||
|
||||
interface AutoCollectPerformance {
|
||||
constructor(client: Client): AutoCollectPerformance;
|
||||
enable(isEnabled: boolean): void;
|
||||
isInitialized(): boolean;
|
||||
}
|
||||
|
||||
interface AutoCollectRequests {
|
||||
constructor(client: Client): AutoCollectRequests;
|
||||
enable(isEnabled: boolean): void;
|
||||
isInitialized(): boolean;
|
||||
}
|
||||
|
||||
|
||||
declare namespace ContractsModule {
|
||||
enum DataPointType {
|
||||
Measurement = 0,
|
||||
Aggregation = 1,
|
||||
}
|
||||
enum DependencyKind {
|
||||
SQL = 0,
|
||||
Http = 1,
|
||||
Other = 2,
|
||||
}
|
||||
enum DependencySourceType {
|
||||
Undefined = 0,
|
||||
Aic = 1,
|
||||
Apmc = 2,
|
||||
}
|
||||
enum SessionState {
|
||||
Start = 0,
|
||||
End = 1,
|
||||
}
|
||||
enum SeverityLevel {
|
||||
Verbose = 0,
|
||||
Information = 1,
|
||||
Warning = 2,
|
||||
Error = 3,
|
||||
Critical = 4,
|
||||
}
|
||||
interface ContextTagKeys {
|
||||
applicationVersion: string;
|
||||
applicationBuild: string;
|
||||
deviceId: string;
|
||||
deviceIp: string;
|
||||
deviceLanguage: string;
|
||||
deviceLocale: string;
|
||||
deviceModel: string;
|
||||
deviceNetwork: string;
|
||||
deviceOEMName: string;
|
||||
deviceOS: string;
|
||||
deviceOSVersion: string;
|
||||
deviceRoleInstance: string;
|
||||
deviceRoleName: string;
|
||||
deviceScreenResolution: string;
|
||||
deviceType: string;
|
||||
deviceMachineName: string;
|
||||
locationIp: string;
|
||||
operationId: string;
|
||||
operationName: string;
|
||||
operationParentId: string;
|
||||
operationRootId: string;
|
||||
operationSyntheticSource: string;
|
||||
operationIsSynthetic: string;
|
||||
sessionId: string;
|
||||
sessionIsFirst: string;
|
||||
sessionIsNew: string;
|
||||
userAccountAcquisitionDate: string;
|
||||
userAccountId: string;
|
||||
userAgent: string;
|
||||
userId: string;
|
||||
userStoreRegion: string;
|
||||
sampleRate: string;
|
||||
internalSdkVersion: string;
|
||||
internalAgentVersion: string;
|
||||
constructor(): ContextTagKeys;
|
||||
}
|
||||
interface Domain {
|
||||
ver: number;
|
||||
properties: any;
|
||||
constructor(): Domain;
|
||||
}
|
||||
interface Data<TDomain extends ContractsModule.Domain> {
|
||||
baseType: string;
|
||||
baseData: TDomain;
|
||||
constructor(): Data<TDomain>;
|
||||
}
|
||||
interface Envelope {
|
||||
ver: number;
|
||||
name: string;
|
||||
time: string;
|
||||
sampleRate: number;
|
||||
seq: string;
|
||||
iKey: string;
|
||||
flags: number;
|
||||
deviceId: string;
|
||||
os: string;
|
||||
osVer: string;
|
||||
appId: string;
|
||||
appVer: string;
|
||||
userId: string;
|
||||
tags: {
|
||||
[key: string]: string;
|
||||
};
|
||||
data: Data<Domain>;
|
||||
constructor(): Envelope;
|
||||
}
|
||||
interface EventData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
name: string;
|
||||
properties: any;
|
||||
measurements: any;
|
||||
constructor(): EventData;
|
||||
}
|
||||
interface MessageData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
message: string;
|
||||
severityLevel: ContractsModule.SeverityLevel;
|
||||
properties: any;
|
||||
constructor(): MessageData;
|
||||
}
|
||||
interface ExceptionData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
handledAt: string;
|
||||
exceptions: ExceptionDetails[];
|
||||
severityLevel: ContractsModule.SeverityLevel;
|
||||
problemId: string;
|
||||
crashThreadId: number;
|
||||
properties: any;
|
||||
measurements: any;
|
||||
constructor(): ExceptionData;
|
||||
}
|
||||
interface StackFrame {
|
||||
level: number;
|
||||
method: string;
|
||||
assembly: string;
|
||||
fileName: string;
|
||||
line: number;
|
||||
constructor(): StackFrame;
|
||||
}
|
||||
interface ExceptionDetails {
|
||||
id: number;
|
||||
outerId: number;
|
||||
typeName: string;
|
||||
message: string;
|
||||
hasFullStack: boolean;
|
||||
stack: string;
|
||||
parsedStack: StackFrame[];
|
||||
constructor(): ExceptionDetails;
|
||||
}
|
||||
interface DataPoint {
|
||||
name: string;
|
||||
kind: ContractsModule.DataPointType;
|
||||
value: number;
|
||||
count: number;
|
||||
min: number;
|
||||
max: number;
|
||||
stdDev: number;
|
||||
constructor(): DataPoint;
|
||||
}
|
||||
interface MetricData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
metrics: DataPoint[];
|
||||
properties: any;
|
||||
constructor(): MetricData;
|
||||
}
|
||||
interface PageViewData extends ContractsModule.EventData {
|
||||
ver: number;
|
||||
url: string;
|
||||
name: string;
|
||||
duration: string;
|
||||
properties: any;
|
||||
measurements: any;
|
||||
constructor(): PageViewData;
|
||||
}
|
||||
interface PageViewPerfData extends ContractsModule.PageViewData {
|
||||
ver: number;
|
||||
url: string;
|
||||
perfTotal: string;
|
||||
name: string;
|
||||
duration: string;
|
||||
networkConnect: string;
|
||||
sentRequest: string;
|
||||
receivedResponse: string;
|
||||
domProcessing: string;
|
||||
properties: any;
|
||||
measurements: any;
|
||||
constructor(): PageViewPerfData;
|
||||
}
|
||||
interface RemoteDependencyData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
name: string;
|
||||
kind: ContractsModule.DataPointType;
|
||||
value: number;
|
||||
count: number;
|
||||
min: number;
|
||||
max: number;
|
||||
stdDev: number;
|
||||
dependencyKind: ContractsModule.DependencyKind;
|
||||
success: boolean;
|
||||
async: boolean;
|
||||
dependencySource: ContractsModule.DependencySourceType;
|
||||
commandName: string;
|
||||
dependencyTypeName: string;
|
||||
properties: any;
|
||||
constructor(): RemoteDependencyData;
|
||||
}
|
||||
interface AjaxCallData extends ContractsModule.PageViewData {
|
||||
ver: number;
|
||||
url: string;
|
||||
ajaxUrl: string;
|
||||
name: string;
|
||||
duration: string;
|
||||
requestSize: number;
|
||||
responseSize: number;
|
||||
timeToFirstByte: string;
|
||||
timeToLastByte: string;
|
||||
callbackDuration: string;
|
||||
responseCode: string;
|
||||
success: boolean;
|
||||
properties: any;
|
||||
measurements: any;
|
||||
constructor(): AjaxCallData;
|
||||
}
|
||||
interface RequestData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
id: string;
|
||||
name: string;
|
||||
startTime: string;
|
||||
duration: string;
|
||||
responseCode: string;
|
||||
success: boolean;
|
||||
httpMethod: string;
|
||||
url: string;
|
||||
properties: any;
|
||||
measurements: any;
|
||||
constructor(): RequestData;
|
||||
}
|
||||
interface SessionStateData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
state: ContractsModule.SessionState;
|
||||
constructor(): SessionStateData;
|
||||
}
|
||||
interface PerformanceCounterData extends ContractsModule.Domain {
|
||||
ver: number;
|
||||
categoryName: string;
|
||||
counterName: string;
|
||||
instanceName: string;
|
||||
kind: DataPointType;
|
||||
count: number;
|
||||
min: number;
|
||||
max: number;
|
||||
stdDev: number;
|
||||
value: number;
|
||||
properties: any;
|
||||
constructor(): PerformanceCounterData;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface Channel {
|
||||
constructor(isDisabled: () => boolean, getBatchSize: () => number, getBatchIntervalMs: () => number, sender: Sender): Channel;
|
||||
/**
|
||||
* Add a telemetry item to the send buffer
|
||||
*/
|
||||
send(envelope: ContractsModule.Envelope): void;
|
||||
handleCrash(envelope: ContractsModule.Envelope): void;
|
||||
/**
|
||||
* Immediately send buffered data
|
||||
*/
|
||||
triggerSend(isNodeCrashing?: boolean): void;
|
||||
}
|
||||
|
||||
interface Client {
|
||||
config: Config;
|
||||
context: Context;
|
||||
commonProperties: {
|
||||
[key: string]: string;
|
||||
};
|
||||
channel: Channel;
|
||||
/**
|
||||
* Constructs a new client of the client
|
||||
* @param iKey the instrumentation key to use (read from environment variable if not specified)
|
||||
*/
|
||||
constructor(iKey?: string): Client;
|
||||
/**
|
||||
* Log a user action or other occurrence.
|
||||
* @param name A string to identify this event in the portal.
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
*/
|
||||
trackEvent(name: string, properties?: {
|
||||
[key: string]: string;
|
||||
}, measurements?: {
|
||||
[key: string]: number;
|
||||
}): void;
|
||||
/**
|
||||
* Log a trace message
|
||||
* @param message A string to identify this event in the portal.
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
*/
|
||||
trackTrace(message: string, severityLevel?: ContractsModule.SeverityLevel, properties?: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
/**
|
||||
* Log an exception you have caught.
|
||||
* @param exception An Error from a catch clause, or the string error message.
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||
*/
|
||||
trackException(exception: Error, properties?: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
/**
|
||||
* Log a numeric value that is not associated with a specific event. Typically used to send regular reports of performance indicators.
|
||||
* To send a single measurement, use just the first two parameters. If you take measurements very frequently, you can reduce the
|
||||
* telemetry bandwidth by aggregating multiple measurements and sending the resulting average at intervals.
|
||||
* @param name A string that identifies the metric.
|
||||
* @param value The value of the metric
|
||||
* @param count the number of samples used to get this value
|
||||
* @param min the min sample for this set
|
||||
* @param max the max sample for this set
|
||||
* @param stdDev the standard deviation of the set
|
||||
*/
|
||||
trackMetric(name: string, value: number, count?:number, min?: number, max?: number, stdDev?: number, properties?: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
|
||||
/**
|
||||
* Log an incoming http request to your server. The request data will be tracked during the response "finish" event if it is successful or the request "error"
|
||||
* event if it fails. The request duration is automatically calculated as the timespan between when the trackRequest method was called, and when the response "finish"
|
||||
* or request "error" events were fired.
|
||||
* @param request The http.IncomingMessage object to track
|
||||
* @param response The http.ServerResponse object for this request
|
||||
* @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty.
|
||||
*/
|
||||
trackRequest(request: any /* http.IncomingMessage */, response: any /* http.ServerResponse */, properties?: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
|
||||
/**
|
||||
* Log an incoming http request to your server. The request data is tracked synchronously rather than waiting for the response "finish"" or request "error"" events.
|
||||
* Use this if you need your request telemetry to respect custom app insights operation and user context (for example if you set any appInsights.client.context.tags).
|
||||
* @param request The http.IncomingMessage object to track
|
||||
* @param response The http.ServerResponse object for this request
|
||||
* @param ellapsedMilliseconds The duration for this request. Defaults to 0.
|
||||
* @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty.
|
||||
* @param error An error that was returned for this request if it was unsuccessful. Defaults to null.
|
||||
*/
|
||||
trackRequestSync(request: any /*http.IncomingMessage */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: {
|
||||
[key: string]: string;}, error?: any) : void;
|
||||
|
||||
/**
|
||||
* Log information about a dependency of your app. Typically used to track the time database calls or outgoing http requests take from your server.
|
||||
* @param name The name of the dependency (i.e. "myDatabse")
|
||||
* @param commandname The name of the command executed on the dependency
|
||||
* @param elapsedTimeMs The amount of time in ms that the dependency took to return the result
|
||||
* @param success True if the dependency succeeded, false otherwise
|
||||
* @param dependencyTypeName The type of the dependency (i.e. "SQL" "HTTP"). Defaults to empty.
|
||||
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||
* @param dependencyKind ContractsModule.DependencyKind of this dependency. Defaults to Other.
|
||||
* @param async True if the dependency was executed asynchronously, false otherwise. Defaults to false
|
||||
* @param dependencySource ContractsModule.DependencySourceType of this dependency. Defaults to Undefined.
|
||||
*/
|
||||
trackDependency(name: string, commandName: string, elapsedTimeMs: number, success: boolean, dependencyTypeName?: string, properties?: {}, dependencyKind?: any, async?: boolean, dependencySource?: number): void;
|
||||
/**
|
||||
* Immediately send all queued telemetry.
|
||||
*/
|
||||
sendPendingData(callback?: (response: string) => void): void;
|
||||
getEnvelope(data: ContractsModule.Data<ContractsModule.Domain>, tagOverrides?: {
|
||||
[key: string]: string;
|
||||
}): ContractsModule.Envelope;
|
||||
/**
|
||||
* Generic track method for all telemetry types
|
||||
* @param data the telemetry to send
|
||||
* @param tagOverrides the context tags to use for this telemetry which overwrite default context values
|
||||
*/
|
||||
track(data: ContractsModule.Data<ContractsModule.Domain>, tagOverrides?: {
|
||||
[key: string]: string;
|
||||
}): void;
|
||||
}
|
||||
|
||||
interface Config {
|
||||
instrumentationKey: string;
|
||||
sessionRenewalMs: number;
|
||||
sessionExpirationMs: number;
|
||||
endpointUrl: string;
|
||||
maxBatchSize: number;
|
||||
maxBatchIntervalMs: number;
|
||||
disableAppInsights: boolean;
|
||||
constructor(instrumentationKey?: string): Config;
|
||||
}
|
||||
|
||||
interface Context {
|
||||
keys: ContractsModule.ContextTagKeys;
|
||||
tags: {
|
||||
[key: string]: string;
|
||||
};
|
||||
constructor(packageJsonPath?: string): Context;
|
||||
}
|
||||
|
||||
interface Sender {
|
||||
constructor(getUrl: () => string, onSuccess?: (response: string) => void, onError?: (error: Error) => void): Sender;
|
||||
send(payload: any/* Buffer */): void;
|
||||
saveOnCrash(payload: string): void;
|
||||
/**
|
||||
* enable caching events locally on error
|
||||
*/
|
||||
enableCacheOnError(): void;
|
||||
/**
|
||||
* disable caching events locally on error
|
||||
*/
|
||||
disableCacheOnError(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The singleton meta interface for the default client of the client. This interface is used to setup/start and configure
|
||||
* the auto-collection behavior of the application insights module.
|
||||
*/
|
||||
interface ApplicationInsights {
|
||||
client: Client;
|
||||
/**
|
||||
* Initializes a client with the given instrumentation key, if this is not specified, the value will be
|
||||
* read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY
|
||||
* @returns {ApplicationInsights/Client} a new client
|
||||
*/
|
||||
getClient(instrumentationKey?: string): Client;
|
||||
/**
|
||||
* Initializes the default client of the client and sets the default configuration
|
||||
* @param instrumentationKey the instrumentation key to use. Optional, if this is not specified, the value will be
|
||||
* read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
setup(instrumentationKey?: string): ApplicationInsights;
|
||||
/**
|
||||
* Starts automatic collection of telemetry. Prior to calling start no telemetry will be collected
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
start(): ApplicationInsights;
|
||||
/**
|
||||
* Sets the state of console tracking (enabled by default)
|
||||
* @param value if true console activity will be sent to Application Insights
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
setAutoCollectConsole(value: boolean): ApplicationInsights;
|
||||
/**
|
||||
* Sets the state of exception tracking (enabled by default)
|
||||
* @param value if true uncaught exceptions will be sent to Application Insights
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
setAutoCollectExceptions(value: boolean): ApplicationInsights;
|
||||
/**
|
||||
* Sets the state of performance tracking (enabled by default)
|
||||
* @param value if true performance counters will be collected every second and sent to Application Insights
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
setAutoCollectPerformance(value: boolean): ApplicationInsights;
|
||||
/**
|
||||
* Sets the state of request tracking (enabled by default)
|
||||
* @param value if true requests will be sent to Application Insights
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
setAutoCollectRequests(value: boolean): ApplicationInsights;
|
||||
/**
|
||||
* Enables verbose debug logging
|
||||
* @returns {ApplicationInsights} this interface
|
||||
*/
|
||||
enableVerboseLogging(): ApplicationInsights;
|
||||
}
|
||||
|
||||
declare module "applicationinsights" {
|
||||
const applicationinsights: ApplicationInsights;
|
||||
export = applicationinsights;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"applicationinsights-tests.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+37640
-1077
File diff suppressed because it is too large
Load Diff
Vendored
+137
-34
@@ -1,4 +1,4 @@
|
||||
// Type definitions for ArcGIS API for JavaScript 3.22
|
||||
// Type definitions for ArcGIS API for JavaScript 3.23
|
||||
// Project: https://developers.arcgis.com/javascript/3/
|
||||
// Definitions by: Esri <https://github.com/Esri>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -110,7 +110,10 @@ declare module "esri" {
|
||||
resourceInfo?: any;
|
||||
/** When true, the layer's attribution is displayed on the map. */
|
||||
showAttribution?: boolean;
|
||||
/** By default, images are exported in MIME format, and the image is streamed to the client. */
|
||||
/**
|
||||
* By default, images are exported in MIME format, and the image is streamed to the client.
|
||||
* @deprecated
|
||||
*/
|
||||
useMapImage?: boolean;
|
||||
/** When true, the layer will update its content based on the map's time extent. */
|
||||
useMapTime?: boolean;
|
||||
@@ -478,6 +481,10 @@ declare module "esri" {
|
||||
zoomOptions?: any;
|
||||
}
|
||||
export interface ColorPickerOptions {
|
||||
/** Indicates whether the widget displays collapsed. */
|
||||
collapsed?: boolean;
|
||||
/** Indicates whether the widget can be collapsed. */
|
||||
collapsible?: boolean;
|
||||
/** The selected color. */
|
||||
color: Color;
|
||||
/** The row size of the palette. */
|
||||
@@ -1830,8 +1837,10 @@ declare module "esri" {
|
||||
whereFields: any;
|
||||
}
|
||||
export interface QueryTaskOptions {
|
||||
/** Specify the geodatabase version to display. */
|
||||
/** The geodatabase version to display. */
|
||||
gdbVersion?: string;
|
||||
/** The dynamic layer or table source. */
|
||||
source?: LayerSource;
|
||||
}
|
||||
export interface RasterLayerOptions {
|
||||
/** Sets the layer's draw mode. */
|
||||
@@ -2150,9 +2159,15 @@ declare module "esri" {
|
||||
export interface SymbolStylerOptions {
|
||||
/** Added at v. */
|
||||
portal?: string | any;
|
||||
/** Self response of Portal used as symbol provider. */
|
||||
/**
|
||||
* Self response of Portal used as symbol provider.
|
||||
* @deprecated
|
||||
*/
|
||||
portalSelf?: any;
|
||||
/** URL to Portal used as symbol provider. */
|
||||
/**
|
||||
* URL to Portal used as symbol provider.
|
||||
* @deprecated
|
||||
*/
|
||||
portalUrl?: string;
|
||||
}
|
||||
export interface TemplatePickerOptions {
|
||||
@@ -3852,6 +3867,10 @@ declare module "esri/dijit/ColorPicker" {
|
||||
|
||||
/** A widget to assist choosing a color from a color palette. */
|
||||
class ColorPicker {
|
||||
/** Indicates whether the widget displays collapsed. */
|
||||
collapsed: boolean;
|
||||
/** Indicates whether the widget is collapsible. */
|
||||
collapsible: boolean;
|
||||
/** The selected color. */
|
||||
color: Color;
|
||||
/** The set of available color options. */
|
||||
@@ -3921,7 +3940,10 @@ declare module "esri/dijit/Directions" {
|
||||
* @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into.
|
||||
*/
|
||||
constructor(options: esri.DirectionsOptions, srcNodeRef: Node | string);
|
||||
/** Deprecated at v3.13. */
|
||||
/**
|
||||
* Deprecated at v3.13.
|
||||
* @deprecated
|
||||
*/
|
||||
activate(): void;
|
||||
/**
|
||||
* Add a stop to the directions widget at the specified index location.
|
||||
@@ -3942,7 +3964,10 @@ declare module "esri/dijit/Directions" {
|
||||
centerAtSegmentStart(index: number): void;
|
||||
/** Remove the route directions from the directions list. */
|
||||
clearDirections(): void;
|
||||
/** Deprecated at v3.13. */
|
||||
/**
|
||||
* Deprecated at v3.13.
|
||||
* @deprecated
|
||||
*/
|
||||
deactivate(): void;
|
||||
/** Destroy the Directions widget. */
|
||||
destroy(): void;
|
||||
@@ -4106,7 +4131,10 @@ declare module "esri/dijit/FeatureTable" {
|
||||
featureLayer: FeatureLayer;
|
||||
/** An array of objects representing field information. */
|
||||
fieldInfos: any[];
|
||||
/** Reference to the dGrid. */
|
||||
/**
|
||||
* Reference to the dGrid.
|
||||
* @deprecated
|
||||
*/
|
||||
grid: any;
|
||||
/** Reference to the 'Options' drop-down menu. */
|
||||
gridMenu: any;
|
||||
@@ -8158,9 +8186,9 @@ declare module "esri/geometry/geometryEngine" {
|
||||
*/
|
||||
nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): any[];
|
||||
/**
|
||||
* Creates offset version of the input geometry.
|
||||
* The offset operation creates a geometry that is a constant planar distance from an input polyline or polygon.
|
||||
* @param geometry The geometries to offset.
|
||||
* @param offsetDistance The offset distance for the Geometries.
|
||||
* @param offsetDistance The planar distance to offset from the input geometry.
|
||||
* @param offsetUnit Measurement unit for the offset.
|
||||
* @param joinType The join type.
|
||||
* @param bevelRatio Applicable to MITER, bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled.
|
||||
@@ -8401,9 +8429,9 @@ declare module "esri/geometry/geometryEngineAsync" {
|
||||
*/
|
||||
nearestVertices(geometry: Geometry, inputPoint: Point, searchRadius: number, maxVertexCountToReturn: number): any;
|
||||
/**
|
||||
* Creates offset version of the input geometry.
|
||||
* The offset operation creates a geometry that is a constant planar distance from an input polyline or polygon.
|
||||
* @param geometry The geometries to offset.
|
||||
* @param offsetDistance The offset distance for the Geometries.
|
||||
* @param offsetDistance The planar distance to offset from the input geometry.
|
||||
* @param offsetUnit Measurement unit for the offset.
|
||||
* @param joinType The join type.
|
||||
* @param bevelRatio Applicable to MITER, bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled.
|
||||
@@ -8583,6 +8611,7 @@ declare module "esri/geometry/screenUtils" {
|
||||
* @param width The current width of the map in screen units.
|
||||
* @param height The current height of the map in screen units.
|
||||
* @param screenPoint The screenPoint to convert from screen to map units.
|
||||
* @deprecated
|
||||
*/
|
||||
toMapPoint(extent: Extent, width: number, height: number, screenPoint: ScreenPoint): Point;
|
||||
/**
|
||||
@@ -8599,6 +8628,7 @@ declare module "esri/geometry/screenUtils" {
|
||||
* @param width The current width of the map in screen units.
|
||||
* @param height The current height of the map in screen units.
|
||||
* @param mapPoint The point to convert from map to screen units.
|
||||
* @deprecated
|
||||
*/
|
||||
toScreenPoint(extent: Extent, width: number, height: number, mapPoint: Point): ScreenPoint;
|
||||
};
|
||||
@@ -8691,14 +8721,14 @@ declare module "esri/graphic" {
|
||||
clone(): Graphic;
|
||||
/** Draws the graphic. */
|
||||
draw(): Graphic;
|
||||
/**
|
||||
* Returns the graphics summarized by the given aggregate graphic in a clustering or feature reduction visualization.
|
||||
* @param aggregateGraphic A graphic representing the aggregation (or reduction) of several individual graphics in a layer.
|
||||
*/
|
||||
getChildGraphics(aggregateGraphic: Graphic): Graphic[];
|
||||
/** Returns the graphics summarized by an aggregate graphic in a clustering or feature reduction visualization. */
|
||||
getChildGraphics(): Graphic[];
|
||||
/** Returns the content string based on attributes and infoTemplate values. */
|
||||
getContent(): string;
|
||||
/** Returns the dojo/gfx/shape.Shape of the Esri graphic. */
|
||||
/**
|
||||
* Returns the dojo/gfx/shape.Shape of the Esri graphic.
|
||||
* @deprecated
|
||||
*/
|
||||
getDojoShape(): any;
|
||||
/** Returns the info template associated with the graphic. */
|
||||
getInfoTemplate(): InfoTemplate;
|
||||
@@ -8880,7 +8910,10 @@ declare module "esri/layers/ArcGISDynamicMapServiceLayer" {
|
||||
timeInfo: TimeInfo;
|
||||
/** Default units of the layer as defined by the service. */
|
||||
units: string;
|
||||
/** When true, the image is saved to the server, and a JSON formatted response is sent to the client with the URL location of the image. */
|
||||
/**
|
||||
* When true, the image is saved to the server, and a JSON formatted response is sent to the client with the URL location of the image.
|
||||
* @deprecated
|
||||
*/
|
||||
useMapImage: boolean;
|
||||
/** The version of ArcGIS Server where the map service is published. */
|
||||
version: number;
|
||||
@@ -10836,7 +10869,10 @@ declare module "esri/layers/RasterDataSource" {
|
||||
declare module "esri/layers/RasterFunction" {
|
||||
/** Specifies the processing to be done to the image service. */
|
||||
class RasterFunction {
|
||||
/** Deprecated at v3.10, use functionArguments instead. */
|
||||
/**
|
||||
* Deprecated at v3.10, use functionArguments instead.
|
||||
* @deprecated
|
||||
*/
|
||||
arguments: any;
|
||||
/** The arguments for the raster function. */
|
||||
functionArguments: any;
|
||||
@@ -12326,7 +12362,10 @@ declare module "esri/opsdashboard/ExtensionBase" {
|
||||
portalHelperServices: any;
|
||||
/** Read-only: The URL to the ArcGIS.com site or in-house portal that you are currently signed in to. */
|
||||
portalUrl: string;
|
||||
/** Get the collection of data sources from the host application. */
|
||||
/**
|
||||
* Get the collection of data sources from the host application.
|
||||
* @deprecated
|
||||
*/
|
||||
getDataSourceProxies(): any;
|
||||
/**
|
||||
* Get the data source corresponding to the data source id from the host application.
|
||||
@@ -12954,7 +12993,10 @@ declare module "esri/renderers/ClassBreaksRenderer" {
|
||||
attributeField: string;
|
||||
/** To symbolize polygon features with graduated symbols, use backgroundFillSymbol to specify a simple fill symbol to represent polygon features, and use marker symbols of varying sizes in class breaks to indicate the quantity. */
|
||||
backgroundFillSymbol: FillSymbol;
|
||||
/** Deprecated at v2.0, use infos instead. */
|
||||
/**
|
||||
* Deprecated at v2.0, use infos instead.
|
||||
* @deprecated
|
||||
*/
|
||||
breaks: any[];
|
||||
/** The classification method used to generate class breaks. */
|
||||
classificationMethod: string;
|
||||
@@ -13136,13 +13178,25 @@ declare module "esri/renderers/Renderer" {
|
||||
|
||||
/** The base class for the renderers - SimpleRenderer, ClassBreaksRenderer, UniqueValueRenderer, DotDensityRenderer, ScaleDependentRenderer, TemporalRenderer, HeatmapRenderer, and VectorFieldRenderer used with a GraphicsLayer and FeatureLayer. */
|
||||
class Renderer {
|
||||
/** Deprecated. */
|
||||
/**
|
||||
* Deprecated.
|
||||
* @deprecated
|
||||
*/
|
||||
colorInfo: any;
|
||||
/** Deprecated. */
|
||||
/**
|
||||
* Deprecated.
|
||||
* @deprecated
|
||||
*/
|
||||
opacityInfo: any;
|
||||
/** Deprecated. */
|
||||
/**
|
||||
* Deprecated.
|
||||
* @deprecated
|
||||
*/
|
||||
rotationInfo: any;
|
||||
/** Deprecated. */
|
||||
/**
|
||||
* Deprecated.
|
||||
* @deprecated
|
||||
*/
|
||||
sizeInfo: any;
|
||||
/** This property allows you to define how to render values in a layer. */
|
||||
visualVariables: any[];
|
||||
@@ -13185,21 +13239,25 @@ declare module "esri/renderers/Renderer" {
|
||||
/**
|
||||
* Deprecated.
|
||||
* @param info An info object that defines the color.
|
||||
* @deprecated
|
||||
*/
|
||||
setColorInfo(info: any): Renderer;
|
||||
/**
|
||||
* Deprecated.
|
||||
* @param info The info parameter is an object with the same properties as opacityInfo.
|
||||
* @deprecated
|
||||
*/
|
||||
setOpacityInfo(info: any): Renderer;
|
||||
/**
|
||||
* Deprecated.
|
||||
* @param info An object with the same properties as rotationInfo.
|
||||
* @deprecated
|
||||
*/
|
||||
setRotationInfo(info: any): Renderer;
|
||||
/**
|
||||
* Deprecated.
|
||||
* @param info An object with the same properties as sizeInfo.
|
||||
* @deprecated
|
||||
*/
|
||||
setSizeInfo(info: any): Renderer;
|
||||
/**
|
||||
@@ -13417,7 +13475,10 @@ declare module "esri/renderers/UniqueValueRenderer" {
|
||||
valueExpression: string;
|
||||
/** The title identifying and describing the associated Arcade expression as defined in the valueExpression property. */
|
||||
valueExpressionTitle: string;
|
||||
/** Deprecated at v2.0, use infos instead. */
|
||||
/**
|
||||
* Deprecated at v2.0, use infos instead.
|
||||
* @deprecated
|
||||
*/
|
||||
values: string[];
|
||||
/**
|
||||
* Creates a new UniqueValueRenderer object.
|
||||
@@ -13588,6 +13649,20 @@ declare module "esri/request" {
|
||||
export = request;
|
||||
}
|
||||
|
||||
declare module "esri/support/expressionUtils" {
|
||||
/** A utility module that allows you to enable geometry operations referenced inside Arcade expressions. */
|
||||
var expressionUtils: {
|
||||
/** Loads all geometry operations for use in any Arcade expression within the given application. */
|
||||
enableGeometryOperations(): any;
|
||||
/**
|
||||
* Indicates if the given Arcade expression contains one or more geometry operations.
|
||||
* @param expression The Arcade expression to evaluate for the presence of one or more geometry operations.
|
||||
*/
|
||||
hasGeometryOperations(expression: string): boolean;
|
||||
};
|
||||
export = expressionUtils;
|
||||
}
|
||||
|
||||
declare module "esri/symbols/CartographicLineSymbol" {
|
||||
import SimpleLineSymbol = require("esri/symbols/SimpleLineSymbol");
|
||||
import Color = require("esri/Color");
|
||||
@@ -13718,7 +13793,10 @@ declare module "esri/symbols/Font" {
|
||||
size: number;
|
||||
/** Text style. */
|
||||
style: string;
|
||||
/** Text variant. */
|
||||
/**
|
||||
* Text variant (deprecated).
|
||||
* @deprecated
|
||||
*/
|
||||
variant: string;
|
||||
/** Text weight. */
|
||||
weight: string;
|
||||
@@ -13759,8 +13837,9 @@ declare module "esri/symbols/Font" {
|
||||
*/
|
||||
setStyle(style: string): Font;
|
||||
/**
|
||||
* Sets the font variant.
|
||||
* Sets the font variant (deprecated).
|
||||
* @param variant Font variant.
|
||||
* @deprecated
|
||||
*/
|
||||
setVariant(variant: string): Font;
|
||||
/**
|
||||
@@ -14018,6 +14097,8 @@ declare module "esri/symbols/SimpleLineSymbol" {
|
||||
static STYLE_SHORTDOT: any;
|
||||
/** The line is solid. */
|
||||
static STYLE_SOLID: any;
|
||||
/** Indicates marker symbols present at the beginning and/or end of a SimpleLineSymbol. */
|
||||
marker: any;
|
||||
/** The line style. */
|
||||
style: string;
|
||||
/** Creates a new empty SimpleLineSymbol object. */
|
||||
@@ -14034,6 +14115,11 @@ declare module "esri/symbols/SimpleLineSymbol" {
|
||||
* @param json JSON object representing the SimpleLineSymbol.
|
||||
*/
|
||||
constructor(json: Object);
|
||||
/**
|
||||
* Sets marker symbols at the beginning and/or end of a SimpleLineSymbol.
|
||||
* @param options The options defining the marker style and placement.
|
||||
*/
|
||||
setMarker(options: any): void;
|
||||
/**
|
||||
* Sets the line symbol style.
|
||||
* @param style Line style.
|
||||
@@ -14143,11 +14229,17 @@ declare module "esri/symbols/TextSymbol" {
|
||||
static DECORATION_OVERLINE: any;
|
||||
/** Text is underlined. */
|
||||
static DECORATION_UNDERLINE: any;
|
||||
/** The text alignment in relation to the point. */
|
||||
/**
|
||||
* The text alignment in relation to the point.
|
||||
* @deprecated
|
||||
*/
|
||||
align: string;
|
||||
/** Text angle. */
|
||||
angle: number;
|
||||
/** The decoration on the text. */
|
||||
/**
|
||||
* The decoration on the text.
|
||||
* @deprecated
|
||||
*/
|
||||
decoration: string;
|
||||
/** Font for displaying text. */
|
||||
font: Font;
|
||||
@@ -14189,6 +14281,7 @@ declare module "esri/symbols/TextSymbol" {
|
||||
/**
|
||||
* Sets the alignment of the text.
|
||||
* @param align The text alignment.
|
||||
* @deprecated
|
||||
*/
|
||||
setAlign(align: string): TextSymbol;
|
||||
/**
|
||||
@@ -14199,6 +14292,7 @@ declare module "esri/symbols/TextSymbol" {
|
||||
/**
|
||||
* Sets the decoration for the text.
|
||||
* @param decoration The decoration on the text.
|
||||
* @deprecated
|
||||
*/
|
||||
setDecoration(decoration: string): TextSymbol;
|
||||
/**
|
||||
@@ -15038,7 +15132,7 @@ declare module "esri/tasks/GeometryService" {
|
||||
*/
|
||||
lengths(lengthsParameter: LengthsParameters, callback?: Function, errback?: Function): any;
|
||||
/**
|
||||
* Constructs the offset of the input geometries.
|
||||
* Constructs the offset of the input geometries based on a planar distance.
|
||||
* @param params Set the geometries to offset, distance and units.
|
||||
* @param callback The function to call when the method has completed.
|
||||
* @param errback An error object is returned if an error occurs during task execution.
|
||||
@@ -15150,7 +15244,10 @@ declare module "esri/tasks/Geoprocessor" {
|
||||
|
||||
/** Represents a GP Task resource exposed by the ArcGIS Server REST API. */
|
||||
class Geoprocessor {
|
||||
/** Deprecated at v2.0, use outSpatialReference instead. */
|
||||
/**
|
||||
* Deprecated at v2.0, use outSpatialReference instead.
|
||||
* @deprecated
|
||||
*/
|
||||
outputSpatialReference: SpatialReference;
|
||||
/** The spatial reference of the output geometries. */
|
||||
outSpatialReference: SpatialReference;
|
||||
@@ -15219,6 +15316,7 @@ declare module "esri/tasks/Geoprocessor" {
|
||||
/**
|
||||
* Deprecated at v2.0, use setOutSpatialReference instead.
|
||||
* @param spatialReference The well-known ID of a spatial reference.
|
||||
* @deprecated
|
||||
*/
|
||||
setOutputSpatialReference(spatialReference: SpatialReference): void;
|
||||
/**
|
||||
@@ -15680,7 +15778,7 @@ declare module "esri/tasks/OffsetParameters" {
|
||||
bevelRatio: number;
|
||||
/** The array of geometries to be offset. */
|
||||
geometries: Geometry[];
|
||||
/** Specifies the distance for constructing an offset based on the input geometries. */
|
||||
/** Specifies the planar distance for constructing an offset based on the input geometries. */
|
||||
offsetDistance: number;
|
||||
/** Options that determine how the ends intersect. */
|
||||
offsetHow: string;
|
||||
@@ -15806,12 +15904,17 @@ declare module "esri/tasks/ProjectParameters" {
|
||||
|
||||
declare module "esri/tasks/QueryTask" {
|
||||
import esri = require("esri");
|
||||
import LayerSource = require("esri/layers/LayerSource");
|
||||
import Query = require("esri/tasks/query");
|
||||
import RelationshipQuery = require("esri/tasks/RelationshipQuery");
|
||||
import FeatureSet = require("esri/tasks/FeatureSet");
|
||||
|
||||
/** Executes a query operation on a layer resource of a map service exposed by the ArcGIS Server REST API. */
|
||||
class QueryTask {
|
||||
/** The geodatabase version to display. */
|
||||
gdbVersion: string;
|
||||
/** The dynamic layer or table source. */
|
||||
source: LayerSource;
|
||||
/** URL to the ArcGIS Server REST resource that represents a map service layer. */
|
||||
url: string;
|
||||
/**
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
import artyomjs = require('artyom.js');
|
||||
|
||||
// Get an unique ArtyomJS instance
|
||||
const artyom = artyomjs.ArtyomBuilder.getInstance();
|
||||
|
||||
// Add a command (not smart)
|
||||
artyom.addCommands({
|
||||
description: 'Test command',
|
||||
indexes: ['hello', 'hi'],
|
||||
action: (i: number) => {
|
||||
console.log('hello action');
|
||||
}
|
||||
});
|
||||
|
||||
// Add a smart command
|
||||
artyom.addCommands({
|
||||
description: 'Test command 2',
|
||||
smart: true,
|
||||
indexes: ['test *'],
|
||||
action: (i: number, wildcard: string) => {
|
||||
console.log('wildcard: ', wildcard);
|
||||
}
|
||||
});
|
||||
|
||||
// Get the browser voices
|
||||
artyom.getVoices();
|
||||
|
||||
// Get all supported languages for Artyom
|
||||
artyom.getLanguage();
|
||||
|
||||
// Get the artyom.js version
|
||||
artyom.getVersion();
|
||||
Vendored
-473
@@ -1,473 +0,0 @@
|
||||
// Type definitions for artyom.js 1.0
|
||||
// Project: https://github.com/sdkcarlos/artyom.js
|
||||
// Definitions by: Sema García (José Manuel García) <https://github.com/semagarcia>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Extension of Window interface
|
||||
*/
|
||||
interface ArtyomWindow extends Window {
|
||||
webkitSpeechRecognition: any;
|
||||
SpeechRecognition: any;
|
||||
SpeechSynthesisUtterance: any;
|
||||
}
|
||||
|
||||
interface SpeechRecognition extends EventTarget {
|
||||
grammars: SpeechGrammarList;
|
||||
lang: string;
|
||||
continuous: boolean;
|
||||
interimResults: boolean;
|
||||
maxAlternatives: number;
|
||||
serviceURI: string;
|
||||
start(): void;
|
||||
stop(): void;
|
||||
abort(): void;
|
||||
onaudiostart(ev: Event): any;
|
||||
onsoundstart(ev: Event): any;
|
||||
onspeechstart(ev: Event): any;
|
||||
onspeechend(ev: Event): any;
|
||||
onsoundend(ev: Event): any;
|
||||
onresult(ev: SpeechRecognitionEvent): any;
|
||||
onnomatch(ev: SpeechRecognitionEvent): any;
|
||||
onerror(ev: SpeechRecognitionError): any;
|
||||
onstart(ev: Event): any;
|
||||
onend(ev: Event): any;
|
||||
}
|
||||
|
||||
interface SpeechRecognitionStatic {
|
||||
prototype: SpeechRecognition;
|
||||
new (): SpeechRecognition;
|
||||
}
|
||||
|
||||
declare var SpeechRecognition: SpeechRecognitionStatic;
|
||||
declare var webkitSpeechRecognition: SpeechRecognitionStatic;
|
||||
|
||||
interface SpeechRecognitionError extends Event {
|
||||
error: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
interface SpeechRecognitionAlternative {
|
||||
transcript: string;
|
||||
confidence: number;
|
||||
}
|
||||
|
||||
interface SpeechRecognitionResult {
|
||||
length: number;
|
||||
item(index: number): SpeechRecognitionAlternative;
|
||||
[index: number]: SpeechRecognitionAlternative;
|
||||
isFinal: boolean;
|
||||
}
|
||||
|
||||
interface SpeechRecognitionResultList {
|
||||
length: number;
|
||||
item(index: number): SpeechRecognitionResult;
|
||||
[index: number]: SpeechRecognitionResult;
|
||||
}
|
||||
|
||||
interface SpeechRecognitionEvent extends Event {
|
||||
resultIndex: number;
|
||||
results: SpeechRecognitionResultList;
|
||||
interpretation: any;
|
||||
emma: Document;
|
||||
}
|
||||
|
||||
interface SpeechGrammar {
|
||||
src: string;
|
||||
weight: number;
|
||||
}
|
||||
|
||||
interface SpeechGrammarStatic {
|
||||
prototype: SpeechGrammar;
|
||||
new (): SpeechGrammar;
|
||||
}
|
||||
|
||||
declare var SpeechGrammar: SpeechGrammarStatic;
|
||||
declare var webkitSpeechGrammar: SpeechGrammarStatic;
|
||||
|
||||
interface SpeechGrammarList {
|
||||
length: number;
|
||||
item(index: number): SpeechGrammar;
|
||||
[index: number]: SpeechGrammar;
|
||||
addFromURI(src: string, weight: number): void;
|
||||
addFromString(string: string, weight: number): void;
|
||||
}
|
||||
|
||||
interface SpeechGrammarListStatic {
|
||||
prototype: SpeechGrammarList;
|
||||
new (): SpeechGrammarList;
|
||||
}
|
||||
|
||||
declare var SpeechGrammarList: SpeechGrammarListStatic;
|
||||
declare var webkitSpeechGrammarList: SpeechGrammarListStatic;
|
||||
|
||||
interface SpeechSynthesis extends EventTarget {
|
||||
pending: boolean;
|
||||
speaking: boolean;
|
||||
paused: boolean;
|
||||
|
||||
onvoiceschanged(ev: Event): any;
|
||||
speak(utterance: SpeechSynthesisUtterance): void;
|
||||
cancel(): void;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
getVoices(): SpeechSynthesisVoice[];
|
||||
}
|
||||
|
||||
interface SpeechSynthesisGetter {
|
||||
speechSynthesis: SpeechSynthesis;
|
||||
}
|
||||
|
||||
declare var speechSynthesis: SpeechSynthesis;
|
||||
|
||||
interface SpeechSynthesisUtterance extends EventTarget {
|
||||
text: string;
|
||||
lang: string;
|
||||
voice: SpeechSynthesisVoice;
|
||||
volume: number;
|
||||
rate: number;
|
||||
pitch: number;
|
||||
|
||||
onstart(ev: SpeechSynthesisEvent): any;
|
||||
onend(ev: SpeechSynthesisEvent): any;
|
||||
onerror(ev: SpeechSynthesisErrorEvent): any;
|
||||
onpause(ev: SpeechSynthesisEvent): any;
|
||||
onresume(ev: SpeechSynthesisEvent): any;
|
||||
onmark(ev: SpeechSynthesisEvent): any;
|
||||
onboundary(ev: SpeechSynthesisEvent): any;
|
||||
}
|
||||
|
||||
interface SpeechSynthesisUtteranceStatic {
|
||||
prototype: SpeechSynthesisUtterance;
|
||||
new (text?: string): SpeechSynthesisUtterance;
|
||||
}
|
||||
|
||||
declare var SpeechSynthesisUtterance: SpeechSynthesisUtteranceStatic;
|
||||
|
||||
interface SpeechSynthesisEvent extends Event {
|
||||
utterance: SpeechSynthesisUtterance;
|
||||
charIndex: number;
|
||||
elapsedTime: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface SpeechSynthesisErrorEvent extends SpeechSynthesisEvent {
|
||||
error: string;
|
||||
}
|
||||
|
||||
interface SpeechSynthesisVoice {
|
||||
voiceURI: string;
|
||||
name: string;
|
||||
lang: string;
|
||||
localService: boolean;
|
||||
default: boolean;
|
||||
}
|
||||
|
||||
declare namespace Artyom {
|
||||
interface ArtyomDevice {
|
||||
isChrome(): boolean;
|
||||
isMobile(): boolean;
|
||||
}
|
||||
|
||||
interface ArtyomBrowserVoiceObject {
|
||||
default: boolean;
|
||||
lang: string;
|
||||
localService: false;
|
||||
name: string;
|
||||
voiceURI: string;
|
||||
}
|
||||
|
||||
interface ArtyomConfigProperties {
|
||||
/** Set the default language of artyom with this property */
|
||||
lang?: string;
|
||||
recognizing?: boolean;
|
||||
/** Choose if should listen one command and then stops, or listening forever */
|
||||
continuous?: boolean;
|
||||
/** Moderates the speed with which Artyom talks (0 ~ 1) */
|
||||
speed?: number;
|
||||
/** Adjust the volume of the voice of artyom */
|
||||
volume?: number;
|
||||
/** If listen is equal to true the voice recognition will be started otherwise this property can be ignored */
|
||||
listen: boolean;
|
||||
/** Recognition mode: normal, quick, remote */
|
||||
mode?: string;
|
||||
/** Displays all the grammars recognized in the console */
|
||||
debug: boolean;
|
||||
helpers?: {
|
||||
redirectRecognizedTextOutput: any;
|
||||
remoteProcessorHandler: any;
|
||||
lastSay: any;
|
||||
};
|
||||
/** Set a keyword that allows your command to be executed immediately when you say this word (Useful in noisy environments) */
|
||||
executionKeyword?: string;
|
||||
/** Set a keyword that allows to enable the command recognition automatically if this word is recognized while artyom is paused (artyom.dontObey) */
|
||||
obeyKeyword?: string;
|
||||
speaking?: boolean;
|
||||
obeying?: boolean;
|
||||
soundex?: boolean;
|
||||
}
|
||||
|
||||
interface ArtyomCommand {
|
||||
/** Triggers of the command */
|
||||
indexes: string[];
|
||||
/** Logic to execute when the command is triggered */
|
||||
action(i: number, wildcard?: string, full?: string): void;
|
||||
/** Description of the command */
|
||||
description?: string;
|
||||
/** Flag to specify is a command is either normal or smart */
|
||||
smart?: boolean;
|
||||
}
|
||||
|
||||
interface ArtyomFlags {
|
||||
restartRecognition: boolean;
|
||||
}
|
||||
|
||||
interface ArtyomRecognizer {
|
||||
lang: string;
|
||||
continuous: boolean;
|
||||
interimResults: boolean;
|
||||
start(): void;
|
||||
stop(): void;
|
||||
onstart(): void;
|
||||
onresult(event: any): void;
|
||||
onerror(event: any): void;
|
||||
onend(): void;
|
||||
}
|
||||
|
||||
interface ArtyomJS {
|
||||
/**
|
||||
* Contains some basic information that artyom needs to know as the type of device and browser
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/6/read-doc/artyom-device/artyom-js
|
||||
*/
|
||||
device: ArtyomDevice;
|
||||
|
||||
/**
|
||||
* Object which provides the speech interface, and set some of its attributes and event handlers
|
||||
*/
|
||||
artyomWSR: ArtyomRecognizer;
|
||||
|
||||
/**
|
||||
* Artyom can return inmediately the voices available in your browser.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/14/read-doc/artyom-getvoices/artyom-js
|
||||
*/
|
||||
getVoices(): SpeechSynthesisVoice[];
|
||||
|
||||
/**
|
||||
* Returns an array with all the available commands for artyom.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/10/read-doc/artyom-getavailablecommands/artyom-js
|
||||
*/
|
||||
getAvailableCommands(): ArtyomCommand[];
|
||||
|
||||
/**
|
||||
* Set up artyom for the application. This function will set the default language used by artyom
|
||||
* or notice the user if artyom is not supported in the actual browser.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/15/read-doc/artyom-initialize/artyom-js
|
||||
*/
|
||||
initialize(config: ArtyomConfigProperties): boolean;
|
||||
|
||||
/**
|
||||
* Force artyom to stop listen even if is in continuos mode.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/9/read-doc/artyom-fatality/artyom-js
|
||||
*/
|
||||
fatality(): boolean;
|
||||
|
||||
/**
|
||||
* Add dinamically commands to artyom using. You can even add commands while artyom is active.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/4/read-doc/artyom-addcommands/artyom-js
|
||||
*/
|
||||
addCommands(newCommand: ArtyomCommand | ArtyomCommand[]): boolean;
|
||||
|
||||
/**
|
||||
* Remove the commands of artyom with indexes that matches with the given text.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/19/read-doc/artyom-removecommands/artyom-js
|
||||
*/
|
||||
removeCommands(identifier: string): number[];
|
||||
|
||||
/**
|
||||
* Removes all the added commands of artyom.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/7/read-doc/artyom-emptycommands/artyom-js
|
||||
*/
|
||||
emptyCommands(): ArtyomCommand[];
|
||||
|
||||
/**
|
||||
* Stops the actual and pendings messages that artyom have to say.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/23/read-doc/artyom-shutup/artyom-js
|
||||
*/
|
||||
shutUp(): void;
|
||||
|
||||
/**
|
||||
* Returns an object with the actual properties of artyom.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/12/read-doc/artyom-getproperties/artyom-js
|
||||
*/
|
||||
getProperties(): ArtyomConfigProperties;
|
||||
|
||||
/**
|
||||
* Create a listener when an artyom action is called.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/24/read-doc/artyom-when/artyom-js
|
||||
*/
|
||||
when(event: any, action: any): any;
|
||||
|
||||
/**
|
||||
* Returns the code language of artyom according to initialize function.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/11/read-doc/artyom-getlanguage/artyom-js
|
||||
* @returns Language
|
||||
*/
|
||||
getLanguage(): string;
|
||||
|
||||
/**
|
||||
* Talks a text according to the given parameters (private function).
|
||||
* @param text Text to be spoken
|
||||
* @param actualChunk Number of chunk of the
|
||||
*/
|
||||
artyomTalk(text: any, actualChunk: any, totalChunks: any, callbacks: any): any;
|
||||
|
||||
/**
|
||||
* Splits a string into an array of strings with a limited size (chunk_length).
|
||||
* @param input text to split into chunks
|
||||
* @param chunk_length limit of characters in every chunk
|
||||
*/
|
||||
splitStringByChunks(input: any, chunk_length: any): string[];
|
||||
|
||||
/**
|
||||
* Process the given text into chunks and execute the private function artyom_talk.
|
||||
* @param message Text to be spoken
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/20/read-doc/artyom-say/artyom-js
|
||||
*/
|
||||
say(message: any, callbacks: any): void;
|
||||
|
||||
/**
|
||||
* Repeats the last sentence that artyom said. Useful in noisy environments.
|
||||
* @param returnObject If set to true, an object with the text and the timestamp when was executed will be returned.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/25/read-doc/artyom-repeatlastsay/artyom-js
|
||||
*/
|
||||
repeatLastSay(returnObject: any): void;
|
||||
|
||||
/**
|
||||
* Verify if the browser supports speechSynthesis.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/40/read-doc/artyom-speechsupported/artyom-js
|
||||
*/
|
||||
speechSupported(): boolean;
|
||||
|
||||
/**
|
||||
* Verify if the browser supports webkitSpeechRecognition.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/39/read-doc/artyom-recognizingsupported/artyom-js
|
||||
*/
|
||||
recognizingSupported(): boolean;
|
||||
|
||||
/**
|
||||
* Simulate a voice command via JS.
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/22/read-doc/artyom-simulateinstruction/artyom-js
|
||||
*/
|
||||
simulateInstruction(sentence: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns an object with data of the matched element.
|
||||
* @returns . There is a result field when the function should return a boolean value.
|
||||
*/
|
||||
artyomExecute(voiceCommand: string): any;
|
||||
|
||||
/**
|
||||
* Displays a message in the console if the artyom propery DEBUG is set to true.
|
||||
* @param error The error to be debugged
|
||||
* @param traceLevel Error level: { error | warn | info }
|
||||
* @see http://ourcodeworld.com/projects/projects-documentation/38/read-doc/artyom-debug/artyom-js
|
||||
*/
|
||||
debug(stringEvent: string, traceLevel: string): void;
|
||||
|
||||
/**
|
||||
* Allows to retrieve the recognized spoken text of artyom and do something with it everytime something is recognized.
|
||||
*/
|
||||
redirectRecognizedTextOutput(action: () => void): boolean;
|
||||
|
||||
/**
|
||||
* Says a random quote and returns it's object.
|
||||
*/
|
||||
sayRandom(data: any): any;
|
||||
|
||||
/**
|
||||
* Artyom provide an easy way to create a dictation for your user. Just create an instance and start and stop when you want.
|
||||
*/
|
||||
newDictation(settings: any): any;
|
||||
|
||||
/**
|
||||
* A voice prompt will be executed.
|
||||
*/
|
||||
newPrompt(config: any): any;
|
||||
|
||||
/**
|
||||
* Artyom awaits for orders when this function is executed. If artyom gets a first parameter the instance will be stopped.
|
||||
*/
|
||||
artyomHey(): any;
|
||||
|
||||
/**
|
||||
* This function will return the webkitSpeechRecognition object used by artyom retrieve it only to debug on it or get some
|
||||
* values, do not make changes directly.
|
||||
*/
|
||||
getNativeApi(): any;
|
||||
|
||||
/**
|
||||
* This function returns a boolean according to the SpeechRecognition status if artyom is listening, will return true.
|
||||
* Note: This is not a feature of SpeechRecognition, therefore this value hangs on the fiability of the onStart and onEnd
|
||||
* events of the SpeechRecognition
|
||||
*/
|
||||
isRecognizing(): boolean;
|
||||
|
||||
/**
|
||||
* This function returns a boolean according to the speechSynthesis status if artyom is speaking, will return true.
|
||||
* Note: This is not a feature of speechSynthesis, therefore this value hangs on the fiability of the onStart and onEnd
|
||||
* events of the speechSynthesis.
|
||||
*/
|
||||
isSpeaking(): boolean;
|
||||
|
||||
/**
|
||||
* The SpeechSynthesisUtterance objects are stored in the artyom_garbage_collector variable to prevent the wrong behaviour
|
||||
* of artyom.say. Use this method to clear all spoken SpeechSynthesisUtterance unused objects.
|
||||
*/
|
||||
clearGarbageCollection(): any;
|
||||
|
||||
/**
|
||||
* Returns the SpeechSynthesisUtterance garbageobjects.
|
||||
*/
|
||||
getGarbageCollection(): any;
|
||||
|
||||
/**
|
||||
* Pause the processing of commands. Artyom still listening in the background and it can be resumed after a couple of seconds.
|
||||
*/
|
||||
dontObey(): any;
|
||||
|
||||
/**
|
||||
* Allow artyom to obey commands again.
|
||||
*/
|
||||
obey(): any;
|
||||
|
||||
/**
|
||||
* A boolean to check if artyom is obeying commands or not.
|
||||
*/
|
||||
isObeying(): boolean;
|
||||
|
||||
/**
|
||||
* Process the recognized text if artyom is active in remote mode.
|
||||
*/
|
||||
remoteProcessorService(action: any): any;
|
||||
|
||||
/**
|
||||
* Returns a string with the actual version of Artyom script.
|
||||
*/
|
||||
getVersion(): string;
|
||||
|
||||
/**
|
||||
* Add commands like an artisan. If you use artyom for simple
|
||||
* tasks then probably you don't like to write a lot to achieve it.
|
||||
* Use the artisan syntax to write less, but with the same accuracy.
|
||||
* @disclaimer Not a promise-based implementation, just syntax.
|
||||
*/
|
||||
on(indexes: any, smart: any): any;
|
||||
}
|
||||
|
||||
class ArtyomBuilder {
|
||||
static getInstance(): ArtyomJS;
|
||||
}
|
||||
}
|
||||
|
||||
export = Artyom;
|
||||
export as namespace Artyom;
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODOs
|
||||
"export-just-namespace": false,
|
||||
"no-unnecessary-class": false
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as ascii2mathml from 'ascii2mathml';
|
||||
|
||||
const fn = ascii2mathml({}); // $ExpectType any
|
||||
const fn = ascii2mathml({}); // $ExpectType ascii2mathml
|
||||
fn(''); // $ExpectType string
|
||||
ascii2mathml('', {}); // $ExpectType string
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user