From 31fa599eda68cef11e49c381edf59ae1f6b9c2c1 Mon Sep 17 00:00:00 2001 From: Catherine Liu Date: Thu, 11 Jul 2019 14:47:56 -0700 Subject: [PATCH] [Canvas][Docs] Merge Canvas function references (#38300) * Synced up docs with function defs * Updated docs with changes from PR #37305 * Merged canvas function ref into a single doc * Fixed arg order * Fixed typo * Added alphabet links * Added alphabet headers * Removed B header * Added missing args from * Added edits from PR #37614 * Updated containerStyle * Removed metafields. ESSQL doesn't support retrieving metafields * Edits to function copy * More edits * More edits * Final round of edits * Fixed i18n errors * Addressing feedback * Fixed jest test * Fixed missing import * Fixed i18n error * Restored metaFields arg in esdocs * Extracted i18n string constants * Fixed i18n errors * Updated translation files --- docs/canvas/canvas-client-functions.asciidoc | 79 - docs/canvas/canvas-common-functions.asciidoc | 1421 ----------- .../canvas/canvas-function-reference.asciidoc | 2153 ++++++++++++++++- docs/canvas/canvas-server-functions.asciidoc | 199 -- .../interpreter/public/functions/font.ts | 28 +- .../functions/common/alterColumn.ts | 8 +- .../functions/common/axisConfig.ts | 24 +- .../functions/common/columns.ts | 1 + .../functions/common/containerStyle.ts | 36 +- .../functions/common/date.ts | 2 +- .../functions/common/exactly.ts | 2 +- .../functions/common/filterrows.ts | 2 +- .../common/{__tests__ => }/join_rows.test.js | 8 +- .../functions/common/join_rows.ts | 20 +- .../canvas_plugin_src/functions/common/lt.ts | 1 - .../canvas_plugin_src/functions/common/lte.ts | 1 - .../canvas_plugin_src/functions/common/pie.ts | 47 +- .../functions/common/plot/index.ts | 28 +- .../canvas_plugin_src/functions/common/ply.ts | 2 - .../functions/common/progress.ts | 42 +- .../functions/common/repeatImage.ts | 18 +- .../functions/common/shape.ts | 14 +- .../functions/common/string.ts | 4 +- .../functions/common/timefilter.ts | 2 +- .../functions/server/demodata/index.ts | 2 +- .../functions/server/escount.ts | 10 +- .../functions/server/esdocs.ts | 26 +- .../functions/server/essql.ts | 2 +- .../functions/server/pointseries/index.ts | 16 +- .../canvas_plugin_src/strings/constants.ts | 35 + .../strings/functions/all.ts | 9 +- .../strings/functions/alterColumn.ts | 19 +- .../strings/functions/any.ts | 10 +- .../canvas_plugin_src/strings/functions/as.ts | 9 +- .../strings/functions/axisConfig.ts | 26 +- .../strings/functions/case.ts | 28 +- .../strings/functions/clear.ts | 7 +- .../strings/functions/columns.ts | 17 +- .../strings/functions/compare.ts | 34 +- .../strings/functions/containerStyle.ts | 65 +- .../strings/functions/context.ts | 6 +- .../strings/functions/csv.ts | 14 +- .../strings/functions/date.ts | 18 +- .../strings/functions/demodata.ts | 4 +- .../canvas_plugin_src/strings/functions/do.ts | 15 +- .../strings/functions/dropdownControl.ts | 8 +- .../canvas_plugin_src/strings/functions/eq.ts | 11 +- .../strings/functions/escount.ts | 17 +- .../strings/functions/esdocs.ts | 49 +- .../strings/functions/essql.ts | 20 +- .../strings/functions/exactly.ts | 10 +- .../strings/functions/filterrows.ts | 17 +- .../strings/functions/formatdate.ts | 14 +- .../strings/functions/formatnumber.ts | 13 +- .../strings/functions/getCell.ts | 12 +- .../canvas_plugin_src/strings/functions/gt.ts | 11 +- .../strings/functions/gte.ts | 11 +- .../strings/functions/head.ts | 11 +- .../canvas_plugin_src/strings/functions/if.ts | 26 +- .../strings/functions/image.ts | 28 +- .../strings/functions/join_rows.ts | 8 +- .../strings/functions/location.ts | 9 +- .../canvas_plugin_src/strings/functions/lt.ts | 11 +- .../strings/functions/lte.ts | 11 +- .../strings/functions/mapColumn.ts | 17 +- .../strings/functions/markdown.ts | 19 +- .../strings/functions/math.ts | 21 +- .../strings/functions/metric.ts | 19 +- .../strings/functions/neq.ts | 11 +- .../strings/functions/palette.ts | 15 +- .../strings/functions/pie.ts | 65 +- .../strings/functions/plot.ts | 53 +- .../strings/functions/ply.ts | 26 +- .../strings/functions/pointseries.ts | 32 +- .../strings/functions/progress.ts | 32 +- .../strings/functions/render.ts | 18 +- .../strings/functions/repeatImage.ts | 33 +- .../strings/functions/replace.ts | 15 +- .../strings/functions/revealImage.ts | 27 +- .../strings/functions/rounddate.ts | 12 +- .../strings/functions/rowCount.ts | 4 +- .../strings/functions/seriesStyle.ts | 45 +- .../strings/functions/shape.ts | 21 +- .../strings/functions/sort.ts | 15 +- .../strings/functions/staticColumn.ts | 13 +- .../strings/functions/string.ts | 7 +- .../strings/functions/switch.ts | 19 +- .../strings/functions/table.ts | 24 +- .../strings/functions/tail.ts | 11 +- .../strings/functions/timefilter.ts | 29 +- .../strings/functions/timefilterControl.ts | 11 +- .../strings/functions/urlparam.ts | 19 +- .../plugins/canvas/common/lib/constants.ts | 1 + .../plugins/canvas/public/functions/asset.js | 7 +- .../canvas/public/functions/filters.js | 6 +- .../canvas/public/functions/timelion.js | 15 +- .../plugins/canvas/public/functions/to.js | 2 +- .../translations/translations/ja-JP.json | 136 +- .../translations/translations/zh-CN.json | 134 +- 99 files changed, 3144 insertions(+), 2601 deletions(-) delete mode 100644 docs/canvas/canvas-client-functions.asciidoc delete mode 100644 docs/canvas/canvas-common-functions.asciidoc delete mode 100644 docs/canvas/canvas-server-functions.asciidoc rename x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/{__tests__ => }/join_rows.test.js (89%) create mode 100644 x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/constants.ts diff --git a/docs/canvas/canvas-client-functions.asciidoc b/docs/canvas/canvas-client-functions.asciidoc deleted file mode 100644 index 48e47b713efaf..0000000000000 --- a/docs/canvas/canvas-client-functions.asciidoc +++ /dev/null @@ -1,79 +0,0 @@ -[role="xpack"] -[[canvas-client-functions]] -=== Canvas client functions - -These functions must execute in a browser. They are only available -from within the Canvas application, not via the Canvas HTTP API. These functions must -execute in the browser because they use browser specific APIs, such as location, -or interact with the workpad to read filters. - -A *** denotes a required argument. - -[float] -=== asset - -Uses Canvas workpad asset objects to provide argument values. Usually images. - -*Accepts:* null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|string -|The ID of the asset value to return -|=== - -*Returns:* string - - -[float] -=== browser - -Forces the interpreter to return to the browser. - -*Accepts:* Anything or nothing - -*Returns:* Depends on your input and arguments - -[float] -=== filters - -Collects element filters on the workpad, usually to provide them to a data source. - -*Accepts:* null - -*Returns:* filter - -[float] -=== location - -Uses the browser's location functionality to get your current location. Usually -quite slow, but fairly accurate. - -*Accepts:* null - -*Returns:* datatable - -[float] -=== urlparam - -Accesses URL parameters and use them in expressions. This will always return a string. - -*Accepts:* null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* (Aliases: `var`, `variable`) -|string -|The URL hash parameter to access - -|default -|string -|Return this string if the url parameter is not defined (default: `""`) -|=== - -*Returns:* string diff --git a/docs/canvas/canvas-common-functions.asciidoc b/docs/canvas/canvas-common-functions.asciidoc deleted file mode 100644 index 58de65d2753ba..0000000000000 --- a/docs/canvas/canvas-common-functions.asciidoc +++ /dev/null @@ -1,1421 +0,0 @@ -[role="xpack"] -[[canvas-common-functions]] -=== Canvas common functions - -The common functions can run anywhere, which means they'll execute wherever -the expression is currently executing. For example, if the engine is currently -running on the server, the functions will run on the server. - -A *** denotes a required argument. - - -[float] -=== all - -Returns true if all of the conditions are true. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|boolean -|The conditions to check -|=== - -*Returns:* boolean - - -[float] -=== alterColumn - -Converts between core types, for example, string, number, null, boolean, date -and rename columns. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|column* -|string -|The name of the column to alter - -|type -|string -|The type to convert the column to; leave blank to not change type (default: `null`) - -|name -|string -|The resultant column name; leave blank to not rename (default: `null`) -|=== - -*Returns:* datatable - - -[float] -=== any - -Returns true if any of the conditions are true. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|boolean -|The conditions to check -|=== - -*Returns:* boolean - - -[float] -=== as - -Creates a datatable with a single value. - -*Accepts:* string, boolean, number, null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_ (Alias: `name`) -|string -|A name to give the column (default: `value`) -|=== - -*Returns:* datatable - - -[float] -=== axisConfig - -Configures axis of a visualization. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|show -|boolean -|default: `true` - -|position -|string -|The position of the axis labels, for example, top, bottom, left, and right -|=== - -*Returns:* axisConfig - - -[float] -=== case - -Builds a case (including a condition/result) to pass to the switch function. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_ -|any -|This value is compared to the context to see if the condition -s met. It is overridden by the "if" argument if both are provided. - -|if* -|boolean -|This value determines whether or not the condition is met. -It overrides the unnamed argument if both are provided. - -|then -|any -|The value to return if the condition is met -|=== - -*Returns:* case - -[float] -=== clog - -Outputs the context to the console. - -*Accepts:* Anything or nothing - -*Returns:* Depends on your input and arguments - - -[float] -=== columns - -Includes or excludes columns from a data table. If you specify both, this will exclude first. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|include -|string -|A comma separated list of column names to keep in the table -(default: `null`) - -|exclude -|string -|A comma separated list of column names to remove from the table -(default: `null`) -|=== - -*Returns:* datatable - - -[float] -=== compare - -Compares the input to something else to determine true or false. -Usually used in combination with `if`. This only works with primitive types, -such as number, string, and boolean. - -*Accepts:* null, string, number, boolean - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_ (Alias: `op`) -|string -|The operator to use in the comparison: `eq` (equal), `ne` (not equal), `lt` -(less than), `gt` (greater than), `lte` (less than equal), `gte` (greater than eq). -The default is `eq`. - -|to (Aliases: `this`, `b`) -|any -|The value to compare the context to, usually returned by a subexpression -|=== - -*Returns:* boolean - - -[float] -=== containerStyle - -Creates an object used for describing the properties of a series on a chart. -You would usually use this inside of a charting function. - -*Accepts:* null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|border -|string -|Valid CSS border string - -|borderRadius -|string -|Number of pixels to use when rounding the border - -|padding -|string -|Content distance in pixels from border - -|backgroundColor -|string -|Valid CSS background color string - -|backgroundImage -|string -|Valid CSS background image string - -|backgroundSize -|string -|Valid CSS background size string (default: `contain`) - -|backgroundRepeat -|string -|Valid CSS background repeat string (default: `no-repeat`) - -|opacity -|number -|A number between 0 and 1 representing the degree of transparency of the element -|=== - -*Returns:* containerStyle - - -[float] -=== context - -Returns whatever you pass into it. This can be useful when you need to use -context as argument to a function as a sub-expression. - -*Accepts:* Anything or nothing - -*Returns:* Depends on your input and arguments - -[float] -=== csv - -Creates a datatable from CSV input. - -*Accepts:* null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|string -|CSV data to use - -|delimiter* -|string -|Data separation character - -|newLine* -|string -|Row separation character -|=== - -*Returns:* containerStyle - - -[float] -=== date - -Returns the current time, or a time parsed from a string, as milliseconds since epoch. - -*Accepts:* null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_ -|string -|An optional date string to be parsed into milliseconds -since epoch. Can be either a valid JavaScript Date input or a string to parse -using the format argument. Must be an ISO 8601 string or you must provide the format. - -|format* -|string -|The Moment.js format for parsing the optional date -string. See the https://momentjs.com/docs/#/displaying/[Moment.js documentation]. -|=== - -*Returns:* number - - -[float] -=== do - -Runs multiple sub-expressions. Returns the passed in context. Nice for running -actions producing functions. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_ -|any -|One or more sub-expressions. The value of these is not -available in the root pipeline as this function simply returns the passed in context. -|=== - -*Returns:* Depends on your input and arguments - - -[float] -=== dropdownControl - -Configures a dropdown filter control element. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|filterColumn -|any -|The column or field to which to attach the filter - -|valueColumn -|any -|The datatable column from which to extract the unique values -for the dropdown -|=== - -*Returns:* render - - -[float] -=== eq - -Returns whether the context is equal to the argument. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|boolean, number, string -|The value to which to compare the context -|=== - -*Returns:* boolean - -[float] -=== exactly - -Creates a filter that matches a given column for a perfectly exact value. - -*Accepts:* filter - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|column* (Aliases: `field`, `c`) -|string -|The column or field to attach the filter to - -|value* (Aliases: `v`, `val`) -|string -|The value to match exactly, including white space and -capitalization -|=== - -*Returns:* filter - - -[float] -=== filterrows - -Filters rows in a datatable based on the return value of a subexpression. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* (Alias: `fn`) -|boolean -|An expression to pass into each row in the datatable. -The expression should return a boolean. A true value preserves the row, -and a false value removes it. -|=== - -*Returns:* datatable - - -[float] -=== font - -Creates font style. - -*Accepts:* null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|size -|number -|The font size in pixels (default: `14`) - -|lHeight* (Alias: `lineHeight`) -|number -|The line height in pixels - -|family -|string -|An acceptable CSS web font string (default: `"'Open Sans', Helvetica, Arial, sans-serif"`) - -|color -|string -|The text color - -|weight -|string -|The font weight, for example, `normal`, `bold`, `bolder`, `lighter`, -`100`, `200`, `300`, `400`, `500`, `600`, `700`, `800`, `900` (default is `normal`) - -|underline -|boolean -|Underline the text, `true` or `false` (default is `false`) - -|italic -|boolean -|Italicize the text, `true` or `false` (default is `false`) - -|align -|string -|The horizontal alignment of text (default is `left`) -|=== - -*Returns:* style - - -[float] -=== formatdate - -Outputs milliseconds since epoch as a formatted string. - -*Accepts:* number - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|string -|Moment.js Format with which to bucket, see the https://momentjs.com/docs/#/displaying/[Moment.js documentation] -|=== - -*Returns:* string - - -[float] -=== formatnumber - -Turns a number into a string using a Number.js format. - -*Accepts:* number - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|string -|Numeral.js format string, see the http://numeraljs.com/#format[Numeral.js documentation] -|=== - -*Returns:* string - - -[float] -=== getCell - -Fetches a single cell in a table. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* (Aliases: `column`, `c`) -|string -|The name of the column value to fetch - -|row (Alias: `r`) -|number -|The row number, starting at 0 (default: `0`) -|=== - -*Returns:* Depends on your input and arguments - - -[float] -=== gt - -Returns whether the context is greater than the argument. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|boolean, number, string -|The value to compare the context to -|=== - -*Returns:* boolean - - -[float] -=== gte - -Returns whether the context is greater than or equal to the argument. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|boolean, number, string -|The value to compare the context to -|=== - -*Returns:* boolean - - -[float] -=== head - -Gets the first N rows from the datatable. Also see `tail`. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_ -|number -|Return this number of rows from the beginning of the datatable (default: `1`) -|=== - -*Returns:* datatable - - -[float] -=== if - -Performs conditional logic. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_ (Alias: `condition`) -|boolean -|A boolean true or false, usually returned by a subexpression. -If this is not supplied, then the input context will be used. - -|then -|any -|The return value if true - -|else -|any -|The return value if false. If else is not specified, and the condition is false, -then the input context to the function will be returned. -|=== - -*Returns:* Depends on your input and arguments - - -[float] -=== image - -Displays an image. - -*Accepts:* null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|dataurl (Alias: `_,`, `url`) -|string -|An image asset can be provided as a base64 dataurl, or passed in as a subexpression -(see example below) - -|mode -|string -|`contain` -|=== - -Example value for the `dataurl` argument, formatted as a base64 data URL: -[source, url] -------------- -data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmlld0JveD0iMCAwIDI3MC42MDAwMSAyNjkuNTQ2NjYiCiAgIGhlaWdodD0iMjY5LjU0NjY2IgogICB3aWR0aD0iMjcwLjYwMDAxIgogICB4bWw6c3BhY2U9InByZXNlcnZlIgogICBpZD0ic3ZnMiIKICAgdmVyc2lvbj0iMS4xIj48bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGE4Ij48cmRmOlJERj48Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+PGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+PGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPjwvY2M6V29yaz48L3JkZjpSREY+PC9tZXRhZGF0YT48ZGVmcwogICAgIGlkPSJkZWZzNiIgLz48ZwogICAgIHRyYW5zZm9ybT0ibWF0cml4KDEuMzMzMzMzMywwLDAsLTEuMzMzMzMzMywwLDI2OS41NDY2NykiCiAgICAgaWQ9ImcxMCI+PGcKICAgICAgIHRyYW5zZm9ybT0ic2NhbGUoMC4xKSIKICAgICAgIGlkPSJnMTIiPjxwYXRoCiAgICAgICAgIGlkPSJwYXRoMTQiCiAgICAgICAgIHN0eWxlPSJmaWxsOiNmZmZmZmY7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiCiAgICAgICAgIGQ9Im0gMjAyOS40OCw5NjIuNDQxIGMgMCwxNzAuMDk5IC0xMDUuNDYsMzE4Ljc5OSAtMjY0LjE3LDM3Ni42NTkgNi45OCwzNS44NiAxMC42Miw3MS43MSAxMC42MiwxMDkuMDUgMCwzMTYuMTkgLTI1Ny4yNCw1NzMuNDMgLTU3My40Nyw1NzMuNDMgLTE4NC43MiwwIC0zNTYuNTU4LC04OC41OSAtNDY0LjUzLC0yMzcuODUgLTUzLjA5LDQxLjE4IC0xMTguMjg1LDYzLjc1IC0xODYuMzA1LDYzLjc1IC0xNjcuODM2LDAgLTMwNC4zODMsLTEzNi41NCAtMzA0LjM4MywtMzA0LjM4IDAsLTM3LjA4IDYuNjE3LC03Mi41OCAxOS4wMzEsLTEwNi4wOCBDIDEwOC40ODgsMTM4MC4wOSAwLDEyMjcuODkgMCwxMDU4Ljg4IDAsODg3LjkxIDEwNS45NzcsNzM4LjUzOSAyNjUuMzk4LDY4MS4wOSBjIC02Ljc2OSwtMzUuNDQyIC0xMC40NiwtNzIuMDIgLTEwLjQ2LC0xMDkgQyAyNTQuOTM4LDI1Ni42MjEgNTExLjU2NiwwIDgyNy4wMjcsMCAxMDEyLjIsMCAxMTgzLjk0LDg4Ljk0MTQgMTI5MS4zLDIzOC44MzIgYyA1My40NSwtNDEuOTYxIDExOC44LC02NC45OTIgMTg2LjU2LC02NC45OTIgMTY3LjgzLDAgMzA0LjM4LDEzNi40OTIgMzA0LjM4LDMwNC4zMzIgMCwzNy4wNzggLTYuNjIsNzIuNjI5IC0xOS4wMywxMDYuMTI5IDE1Ny43OCw1Ni44NzkgMjY2LjI3LDIwOS4xMjkgMjY2LjI3LDM3OC4xNCIgLz48cGF0aAogICAgICAgICBpZD0icGF0aDE2IgogICAgICAgICBzdHlsZT0iZmlsbDojZmFjZjA5O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgICBkPSJtIDc5Ny44OTgsMTE1MC45MyA0NDQuMDcyLC0yMDIuNDUgNDQ4LjA1LDM5Mi41OCBjIDYuNDksMzIuMzkgOS42Niw2NC42NyA5LjY2LDk4LjQ2IDAsMjc2LjIzIC0yMjQuNjgsNTAwLjk1IC01MDAuOSw1MDAuOTUgLTE2NS4yNCwwIC0zMTkuMzcsLTgxLjM2IC00MTMuMDUzLC0yMTcuNzkgbCAtNzQuNTI0LC0zODYuNjQgODYuNjk1LC0xODUuMTEiIC8+PHBhdGgKICAgICAgICAgaWQ9InBhdGgxOCIKICAgICAgICAgc3R5bGU9ImZpbGw6IzQ5YzFhZTtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIKICAgICAgICAgZD0ibSAzMzguMjIzLDY4MC42NzIgYyAtNi40ODksLTMyLjM4MyAtOS44MDksLTY1Ljk4MSAtOS44MDksLTk5Ljk3MyAwLC0yNzYuOTI5IDIyNS4zMzYsLTUwMi4yNTc2IDUwMi4zMTMsLTUwMi4yNTc2IDE2Ni41OTMsMCAzMjEuNDczLDgyLjExNzYgNDE1LjAxMywyMTkuOTQ5NiBsIDczLjk3LDM4NS4zNDcgLTk4LjcyLDE4OC42MjEgTCA3NzUuMTU2LDEwNzUuNTcgMzM4LjIyMyw2ODAuNjcyIiAvPjxwYXRoCiAgICAgICAgIGlkPSJwYXRoMjAiCiAgICAgICAgIHN0eWxlPSJmaWxsOiNlZjI5OWI7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiCiAgICAgICAgIGQ9Im0gMzM1LjQxLDE0NDkuMTggMzA0LjMzMiwtNzEuODYgNjYuNjgsMzQ2LjAyIGMgLTQxLjU4NiwzMS43OCAtOTIuOTMsNDkuMTggLTE0NS43MzEsNDkuMTggLTEzMi4yNSwwIC0yMzkuODEyLC0xMDcuNjEgLTIzOS44MTIsLTIzOS44NyAwLC0yOS4yMSA0Ljg3OSwtNTcuMjIgMTQuNTMxLC04My40NyIgLz48cGF0aAogICAgICAgICBpZD0icGF0aDIyIgogICAgICAgICBzdHlsZT0iZmlsbDojNGNhYmU0O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgICBkPSJNIDMwOC45OTIsMTM3Ni43IEMgMTczLjAyLDEzMzEuNjQgNzguNDgwNSwxMjAxLjMgNzguNDgwNSwxMDU3LjkzIDc4LjQ4MDUsOTE4LjM0IDE2NC44Miw3OTMuNjggMjk0LjQwNiw3NDQuMzUyIGwgNDI2Ljk4MSwzODUuOTM4IC03OC4zOTUsMTY3LjUxIC0zMzQsNzguOSIgLz48cGF0aAogICAgICAgICBpZD0icGF0aDI0IgogICAgICAgICBzdHlsZT0iZmlsbDojODVjZTI2O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgICBkPSJtIDEzMjMuOCwyOTguNDEgYyA0MS43NCwtMzIuMDkgOTIuODMsLTQ5LjU5IDE0NC45OCwtNDkuNTkgMTMyLjI1LDAgMjM5LjgxLDEwNy41NTkgMjM5LjgxLDIzOS44MjEgMCwyOS4xNiAtNC44OCw1Ny4xNjggLTE0LjUzLDgzLjQxOCBsIC0zMDQuMDgsNzEuMTYgLTY2LjE4LC0zNDQuODA5IiAvPjxwYXRoCiAgICAgICAgIGlkPSJwYXRoMjYiCiAgICAgICAgIHN0eWxlPSJmaWxsOiMzMTc3YTc7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiCiAgICAgICAgIGQ9Im0gMTM4NS42Nyw3MjIuOTMgMzM0Ljc2LC03OC4zMDEgYyAxMzYuMDIsNDQuOTYxIDIzMC41NiwxNzUuMzUxIDIzMC41NiwzMTguNzYyIDAsMTM5LjMzOSAtODYuNTQsMjYzLjg1OSAtMjE2LjM4LDMxMy4wMzkgbCAtNDM3Ljg0LC0zODMuNTkgODguOSwtMTY5LjkxIiAvPjwvZz48L2c+PC9zdmc+ -------------- - -*Returns:* image - - -[float] -=== lt - -Returns whether the context is less than the argument passed in. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|boolean, number, string -|The value to compare the context to -|=== - -*Returns:* boolean - - -[float] -=== lte - -Returns whether the context is less than or equal to the argument passed in. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|boolean, number, string -|The value to compare the context to -|=== - -*Returns:* boolean - - -[float] -=== mapColumn - -Adds a column calculated as the result of other columns, or not. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* (Alias: `column`) -|string -|The name of the resulting column - -|expression (Aliases: `exp`, `fn`) -|boolean, number, string -|A Canvas expression that will be passed to each row as a single row datatable -|=== - -*Returns:* datatable - - -[float] -=== markdown - -Adds an element for rendering Markdown text. Great for single numbers, metrics, or paragraphs of text. - -*Accepts:* datatable, null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_ -|string -|A string containing Markdown. You can pass this multiple -times to achieve concatenation (default: `""`). - -|font -|style -|Font settings. Technically, you can put other styles in here too (default is `{font}`). -|=== - -*Returns:* render - - -[float] -=== math - -Interprets a math expression, with a number or datatable as context. Datatable -columns are available by their column name. If you pass in a number, it is -available as "value" (without the quotes). - -*Accepts:* number, datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|string -|An evaluated TinyMath expression, see <> -|=== - -*Returns:* number - - -[float] -=== metric - -A number with a label. - -*Accepts:* string, null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_ -|string -|Text describing the metric (default is `""`) - -|metricFont -|style -|Font settings for the metric. Technically, you can put other styles in here too. -The default is `{font size=48 family="'Open Sans', Helvetica, Arial, sans-serif" color="#000000" align=center lHeight=48}`. - -|labelFont -|style -|Font settings for the label. Technically you can put other styles in here too. -The default is `{font size=14 family="'Open Sans', Helvetica, Arial, sans-serif" color="#000000" align=center}`. -|=== - -*Returns:* render - - -[float] -=== neq - -Returns whether the context is not equal to the argument. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|boolean, number, string -|The value to compare the context to -|=== - -*Returns:* boolean - - -[float] -=== palette - -Creates a color palette. - -*Accepts:* null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|string -|Palette colors, rgba, hex, or HTML color string; you can pass this multiple times - -|gradient -|boolean -|Make a gradient, where supported (default: `false`) - -|reverse -|any -|Reverse the palette (default is `false`) -|=== - -*Returns:* palette - - -[float] -=== pie - -Configures a pie chart element. - -*Accepts:* pointseries - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|palette -|palette -|A palette object for describing the colors to use on this pie (default: `{palette}`) - -|seriesStyle -|seriesStyle -|A style of a specific series - -|radius -|any -|Radius of the pie as a percentage (between 0 and 1) of the available space. -Set to `auto` to automatically set radius (default: `auto`). - -|hole -|number -|Draw a hole in the pie, 0-100, as a percentage of the pie radius (default: `0`) - -|labels -|boolean -|Show pie labels (default: `true`) - -|labelRadius -|number -|The percentage of the area of container to use as a radius for the label circle -(default: `100`) - -|font -|style -|The label font (default: `{font}`) - -|legend -|string, boolean -|The legend position, `nw`, `sw`, `ne`, `se`, or `false` (default: `false`) - -|tilt -|number -|The percentage of tilt, where 1 is fully vertical and 0 is completely flat (default: `1`) -|=== - -*Returns:* render - - -[float] -=== plot - -Configures a plot element. - -*Accepts:* pointseries - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|seriesStyle -|seriesStyle -|A style of a specific series - -|defaultStyle -|seriesStyle -|The default style to use for every series (default is `{seriesStyle points=5}`) - -|palette -|palette -|A palette object for describing the colors to use on this plot (default is `{palette}`) - -|font -|style -|The legend and tick mark fonts (default is `{font}`) - -|legend -|string, boolean -|The legend position, `nw`, `sw`, `ne`, `se`, or `false` (default is `ne`) - -|yaxis -|boolean, axisConfig -|Axis configuration, or use `false` to disable (default is `true`) - -|xaxis -|boolean, axisConfig -|Axis configuration, or use `false` to disable (default is `true`) -|=== - -*Returns:* render - - -[float] -=== ply - -Subdivides a datatable and passes the resulting tables into an expression, -then merges the output. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|by* -|string -|The column to subdivide - -|expression* (Alias: `fn`, `function`) -|datatable -|An expression to pass into each resulting data table. -Expressions must return a datatable. Use `as` to turn literals into datatables. -Multiple expressions must return the same number of rows. If you need to return -a differing row count, pipe into another instance of `ply`. -If multiple expressions return the same columns, the last one wins. -|=== - -*Returns:* datatable - - -[float] -=== render - -Renders an input as a specific element and sets element level options, -such as styling. - -*Accepts:* render - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|as -|string -|The element type to use in rendering. You might want to use a -specialized function instead, such as `plot` or `grid`. - -|css -|string -|Any block of custom CSS to be scoped to this element (default is `"* > * {}"`) - -|containerStyle -|containerStyle -|Style for the container, including background, border, and opacity -|=== - -*Returns:* render - - -[float] -=== repeatImage - -Configures a repeating image element. - -*Accepts:* number - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|image -|string -|An image asset can be provided as a base64 dataurl, or passed in as a subexpression - (see example below) - -|size -|number -|default: `100` - -|max -|number -|default: `100` - -|emptyImage -|string -|default: `null` -|=== - - -Example value for the `image` argument, formatted as a base64 data URL: -[source, url] ------------- -data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20viewBox%3D%22-3.948730230331421%20-1.7549896240234375%20245.25946044921875%20241.40370178222656%22%20width%3D%22245.25946044921875%22%20height%3D%22241.40370178222656%22%20style%3D%22enable-background%3Anew%200%200%20686.2%20235.7%3B%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cdefs%3E%0A%20%20%20%20%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%232D2D2D%3B%7D%0A%3C%2Fstyle%3E%0A%20%20%3C%2Fdefs%3E%0A%20%20%3Cg%20transform%3D%22matrix%281%2C%200%2C%200%2C%201%2C%200%2C%200%29%22%3E%0A%20%20%20%20%3Cg%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M329.4%2C160.3l4.7-0.5l0.3%2C9.6c-12.4%2C1.7-23%2C2.6-31.8%2C2.6c-11.7%2C0-20-3.4-24.9-10.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-4.9-6.8-7.3-17.4-7.3-31.7c0-28.6%2C11.4-42.9%2C34.1-42.9c11%2C0%2C19.2%2C3.1%2C24.6%2C9.2c5.4%2C6.1%2C8.1%2C15.8%2C8.1%2C28.9l-0.7%2C9.3h-53.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0%2C9%2C1.6%2C15.7%2C4.9%2C20c3.3%2C4.3%2C8.9%2C6.5%2C17%2C6.5C312.8%2C161.2%2C321.1%2C160.9%2C329.4%2C160.3z%20M325%2C124.9c0-10-1.6-17.1-4.8-21.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.2-4.1-8.4-6.2-15.6-6.2c-7.2%2C0-12.7%2C2.2-16.3%2C6.5c-3.6%2C4.3-5.5%2C11.3-5.6%2C20.9H325z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M354.3%2C171.4V64h12.2v107.4H354.3z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M443.5%2C113.5v41.1c0%2C4.1%2C10.1%2C3.9%2C10.1%2C3.9l-0.6%2C10.8c-8.6%2C0-15.7%2C0.7-20-3.4c-9.8%2C4.3-19.5%2C6.1-29.3%2C6.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.5%2C0-13.2-2.1-17.1-6.4c-3.9-4.2-5.9-10.3-5.9-18.3c0-7.9%2C2-13.8%2C6-17.5c4-3.7%2C10.3-6.1%2C18.9-6.9l25.6-2.4v-7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0-5.5-1.2-9.5-3.6-11.9c-2.4-2.4-5.7-3.6-9.8-3.6l-32.1%2C0V87.2h31.3c9.2%2C0%2C15.9%2C2.1%2C20.1%2C6.4C441.4%2C97.8%2C443.5%2C104.5%2C443.5%2C113.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bz%20M393.3%2C146.7c0%2C10%2C4.1%2C15%2C12.4%2C15c7.4%2C0%2C14.7-1.2%2C21.8-3.7l3.7-1.3v-26.9l-24.1%2C2.3c-4.9%2C0.4-8.4%2C1.8-10.6%2C4.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3BC394.4%2C138.7%2C393.3%2C142.2%2C393.3%2C146.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M491.2%2C98.2c-11.8%2C0-17.8%2C4.1-17.8%2C12.4c0%2C3.8%2C1.4%2C6.5%2C4.1%2C8.1c2.7%2C1.6%2C8.9%2C3.2%2C18.6%2C4.9%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc9.7%2C1.7%2C16.5%2C4%2C20.5%2C7.1c4%2C3%2C6%2C8.7%2C6%2C17.1c0%2C8.4-2.7%2C14.5-8.1%2C18.4c-5.4%2C3.9-13.2%2C5.9-23.6%2C5.9c-6.7%2C0-29.2-2.5-29.2-2.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bl0.7-10.6c12.9%2C1.2%2C22.3%2C2.2%2C28.6%2C2.2c6.3%2C0%2C11.1-1%2C14.4-3c3.3-2%2C5-5.4%2C5-10.1c0-4.7-1.4-7.9-4.2-9.6c-2.8-1.7-9-3.3-18.6-4.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-9.6-1.5-16.4-3.7-20.4-6.7c-4-2.9-6-8.4-6-16.3c0-7.9%2C2.8-13.8%2C8.4-17.6c5.6-3.8%2C12.6-5.7%2C20.9-5.7c6.6%2C0%2C29.6%2C1.7%2C29.6%2C1.7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bv10.7C508.1%2C99%2C498.2%2C98.2%2C491.2%2C98.2z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M581.7%2C99.5h-25.9v39c0%2C9.3%2C0.7%2C15.5%2C2%2C18.4c1.4%2C2.9%2C4.6%2C4.4%2C9.7%2C4.4l14.5-1l0.8%2C10.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.3%2C1.2-12.8%2C1.8-16.6%2C1.8c-8.5%2C0-14.3-2.1-17.6-6.2c-3.3-4.1-4.9-12-4.9-23.6V99.5h-11.6V88.9h11.6V63.9h12.1v24.9h25.9V99.5z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M598.7%2C78.4V64.3h12.2v14.2H598.7z%20M598.7%2C171.4V88.9h12.2v82.5H598.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M663.8%2C87.2c3.6%2C0%2C9.7%2C0.7%2C18.3%2C2l3.9%2C0.5l-0.5%2C9.9c-8.7-1-15.1-1.5-19.2-1.5c-9.2%2C0-15.5%2C2.2-18.8%2C6.6%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.3%2C4.4-5%2C12.6-5%2C24.5c0%2C11.9%2C1.5%2C20.2%2C4.6%2C24.9c3.1%2C4.7%2C9.5%2C7%2C19.3%2C7l19.2-1.5l0.5%2C10.1c-10.1%2C1.5-17.7%2C2.3-22.7%2C2.3%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-12.7%2C0-21.5-3.3-26.3-9.8c-4.8-6.5-7.3-17.5-7.3-33c0-15.5%2C2.6-26.4%2C7.8-32.6C643%2C90.4%2C651.7%2C87.2%2C663.8%2C87.2z%22%2F%3E%0A%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M236.6%2C123.5c0-19.8-12.3-37.2-30.8-43.9c0.8-4.2%2C1.2-8.4%2C1.2-12.7C207%2C30%2C177%2C0%2C140.2%2C0%26%2310%3B%26%239%3B%26%239%3BC118.6%2C0%2C98.6%2C10.3%2C86%2C27.7c-6.2-4.8-13.8-7.4-21.7-7.4c-19.6%2C0-35.5%2C15.9-35.5%2C35.5c0%2C4.3%2C0.8%2C8.5%2C2.2%2C12.4%26%2310%3B%26%239%3B%26%239%3BC12.6%2C74.8%2C0%2C92.5%2C0%2C112.2c0%2C19.9%2C12.4%2C37.3%2C30.9%2C44c-0.8%2C4.1-1.2%2C8.4-1.2%2C12.7c0%2C36.8%2C29.9%2C66.7%2C66.7%2C66.7%26%2310%3B%26%239%3B%26%239%3Bc21.6%2C0%2C41.6-10.4%2C54.1-27.8c6.2%2C4.9%2C13.8%2C7.6%2C21.7%2C7.6c19.6%2C0%2C35.5-15.9%2C35.5-35.5c0-4.3-0.8-8.5-2.2-12.4%26%2310%3B%26%239%3B%26%239%3BC223.9%2C160.9%2C236.6%2C143.2%2C236.6%2C123.5z%20M91.6%2C34.8c10.9-15.9%2C28.9-25.4%2C48.1-25.4c32.2%2C0%2C58.4%2C26.2%2C58.4%2C58.4%26%2310%3B%26%239%3B%26%239%3Bc0%2C3.9-0.4%2C7.7-1.1%2C11.5l-52.2%2C45.8L93%2C101.5L82.9%2C79.9L91.6%2C34.8z%20M65.4%2C29c6.2%2C0%2C12.1%2C2%2C17%2C5.7l-7.8%2C40.3l-35.5-8.4%26%2310%3B%26%239%3B%26%239%3Bc-1.1-3.1-1.7-6.3-1.7-9.7C37.4%2C41.6%2C49.9%2C29%2C65.4%2C29z%20M9.1%2C112.3c0-16.7%2C11-31.9%2C26.9-37.2L75%2C84.4l9.1%2C19.5l-49.8%2C45%26%2310%3B%26%239%3B%26%239%3BC19.2%2C143.1%2C9.1%2C128.6%2C9.1%2C112.3z%20M145.2%2C200.9c-10.9%2C16.1-29%2C25.6-48.4%2C25.6c-32.3%2C0-58.6-26.3-58.6-58.5c0-4%2C0.4-7.9%2C1.1-11.7%26%2310%3B%26%239%3B%26%239%3Bl50.9-46l52%2C23.7l11.5%2C22L145.2%2C200.9z%20M171.2%2C206.6c-6.1%2C0-12-2-16.9-5.8l7.7-40.2l35.4%2C8.3c1.1%2C3.1%2C1.7%2C6.3%2C1.7%2C9.7%26%2310%3B%26%239%3B%26%239%3BC199.2%2C194.1%2C186.6%2C206.6%2C171.2%2C206.6z%20M200.5%2C160.5l-39-9.1l-10.4-19.8l51-44.7c15.1%2C5.7%2C25.2%2C20.2%2C25.2%2C36.5%26%2310%3B%26%239%3B%26%239%3BC227.4%2C140.1%2C216.4%2C155.3%2C200.5%2C160.5z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E ------------- - -*Returns:* render - - - -[float] -=== replace - -Uses a regular expression to replace parts of a string. - -*Accepts:* string - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* (Aliases: `pattern`, `regex`) -|string -|The text or pattern of a JavaScript regular expression, for example, `"[aeiou]"`. -You can use capture groups here. - -|flags (Alias: `modifiers`) -|datatable -|Specify flags. See the -https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp[RegExp documentation] -for reference (default: `g`). - -|replacement -|string -|The replacement for the matching parts of string. Capture groups can be accessed -by their index, for example $1 (default: `""`). -|=== - -*Returns:* string - - -[float] -=== revealImage - -Configures an image reveal element. - -*Accepts:* number - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|image -|string -|An image asset can be provided as a base64 dataurl, or passed in as a subexpression -(see example below) - -|emptyImage -|string -|default: `null` - -|origin -|string -|default: `bottom` -|=== - - -Example value for the `image` argument, formatted as a base64 data URL: -[source, url] ------------- -data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20viewBox%3D%22-3.948730230331421%20-1.7549896240234375%20245.25946044921875%20241.40370178222656%22%20width%3D%22245.25946044921875%22%20height%3D%22241.40370178222656%22%20style%3D%22enable-background%3Anew%200%200%20686.2%20235.7%3B%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cdefs%3E%0A%20%20%20%20%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%232D2D2D%3B%7D%0A%3C%2Fstyle%3E%0A%20%20%3C%2Fdefs%3E%0A%20%20%3Cg%20transform%3D%22matrix%281%2C%200%2C%200%2C%201%2C%200%2C%200%29%22%3E%0A%20%20%20%20%3Cg%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M329.4%2C160.3l4.7-0.5l0.3%2C9.6c-12.4%2C1.7-23%2C2.6-31.8%2C2.6c-11.7%2C0-20-3.4-24.9-10.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-4.9-6.8-7.3-17.4-7.3-31.7c0-28.6%2C11.4-42.9%2C34.1-42.9c11%2C0%2C19.2%2C3.1%2C24.6%2C9.2c5.4%2C6.1%2C8.1%2C15.8%2C8.1%2C28.9l-0.7%2C9.3h-53.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0%2C9%2C1.6%2C15.7%2C4.9%2C20c3.3%2C4.3%2C8.9%2C6.5%2C17%2C6.5C312.8%2C161.2%2C321.1%2C160.9%2C329.4%2C160.3z%20M325%2C124.9c0-10-1.6-17.1-4.8-21.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.2-4.1-8.4-6.2-15.6-6.2c-7.2%2C0-12.7%2C2.2-16.3%2C6.5c-3.6%2C4.3-5.5%2C11.3-5.6%2C20.9H325z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M354.3%2C171.4V64h12.2v107.4H354.3z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M443.5%2C113.5v41.1c0%2C4.1%2C10.1%2C3.9%2C10.1%2C3.9l-0.6%2C10.8c-8.6%2C0-15.7%2C0.7-20-3.4c-9.8%2C4.3-19.5%2C6.1-29.3%2C6.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.5%2C0-13.2-2.1-17.1-6.4c-3.9-4.2-5.9-10.3-5.9-18.3c0-7.9%2C2-13.8%2C6-17.5c4-3.7%2C10.3-6.1%2C18.9-6.9l25.6-2.4v-7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0-5.5-1.2-9.5-3.6-11.9c-2.4-2.4-5.7-3.6-9.8-3.6l-32.1%2C0V87.2h31.3c9.2%2C0%2C15.9%2C2.1%2C20.1%2C6.4C441.4%2C97.8%2C443.5%2C104.5%2C443.5%2C113.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bz%20M393.3%2C146.7c0%2C10%2C4.1%2C15%2C12.4%2C15c7.4%2C0%2C14.7-1.2%2C21.8-3.7l3.7-1.3v-26.9l-24.1%2C2.3c-4.9%2C0.4-8.4%2C1.8-10.6%2C4.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3BC394.4%2C138.7%2C393.3%2C142.2%2C393.3%2C146.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M491.2%2C98.2c-11.8%2C0-17.8%2C4.1-17.8%2C12.4c0%2C3.8%2C1.4%2C6.5%2C4.1%2C8.1c2.7%2C1.6%2C8.9%2C3.2%2C18.6%2C4.9%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc9.7%2C1.7%2C16.5%2C4%2C20.5%2C7.1c4%2C3%2C6%2C8.7%2C6%2C17.1c0%2C8.4-2.7%2C14.5-8.1%2C18.4c-5.4%2C3.9-13.2%2C5.9-23.6%2C5.9c-6.7%2C0-29.2-2.5-29.2-2.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bl0.7-10.6c12.9%2C1.2%2C22.3%2C2.2%2C28.6%2C2.2c6.3%2C0%2C11.1-1%2C14.4-3c3.3-2%2C5-5.4%2C5-10.1c0-4.7-1.4-7.9-4.2-9.6c-2.8-1.7-9-3.3-18.6-4.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-9.6-1.5-16.4-3.7-20.4-6.7c-4-2.9-6-8.4-6-16.3c0-7.9%2C2.8-13.8%2C8.4-17.6c5.6-3.8%2C12.6-5.7%2C20.9-5.7c6.6%2C0%2C29.6%2C1.7%2C29.6%2C1.7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bv10.7C508.1%2C99%2C498.2%2C98.2%2C491.2%2C98.2z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M581.7%2C99.5h-25.9v39c0%2C9.3%2C0.7%2C15.5%2C2%2C18.4c1.4%2C2.9%2C4.6%2C4.4%2C9.7%2C4.4l14.5-1l0.8%2C10.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.3%2C1.2-12.8%2C1.8-16.6%2C1.8c-8.5%2C0-14.3-2.1-17.6-6.2c-3.3-4.1-4.9-12-4.9-23.6V99.5h-11.6V88.9h11.6V63.9h12.1v24.9h25.9V99.5z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M598.7%2C78.4V64.3h12.2v14.2H598.7z%20M598.7%2C171.4V88.9h12.2v82.5H598.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M663.8%2C87.2c3.6%2C0%2C9.7%2C0.7%2C18.3%2C2l3.9%2C0.5l-0.5%2C9.9c-8.7-1-15.1-1.5-19.2-1.5c-9.2%2C0-15.5%2C2.2-18.8%2C6.6%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.3%2C4.4-5%2C12.6-5%2C24.5c0%2C11.9%2C1.5%2C20.2%2C4.6%2C24.9c3.1%2C4.7%2C9.5%2C7%2C19.3%2C7l19.2-1.5l0.5%2C10.1c-10.1%2C1.5-17.7%2C2.3-22.7%2C2.3%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-12.7%2C0-21.5-3.3-26.3-9.8c-4.8-6.5-7.3-17.5-7.3-33c0-15.5%2C2.6-26.4%2C7.8-32.6C643%2C90.4%2C651.7%2C87.2%2C663.8%2C87.2z%22%2F%3E%0A%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M236.6%2C123.5c0-19.8-12.3-37.2-30.8-43.9c0.8-4.2%2C1.2-8.4%2C1.2-12.7C207%2C30%2C177%2C0%2C140.2%2C0%26%2310%3B%26%239%3B%26%239%3BC118.6%2C0%2C98.6%2C10.3%2C86%2C27.7c-6.2-4.8-13.8-7.4-21.7-7.4c-19.6%2C0-35.5%2C15.9-35.5%2C35.5c0%2C4.3%2C0.8%2C8.5%2C2.2%2C12.4%26%2310%3B%26%239%3B%26%239%3BC12.6%2C74.8%2C0%2C92.5%2C0%2C112.2c0%2C19.9%2C12.4%2C37.3%2C30.9%2C44c-0.8%2C4.1-1.2%2C8.4-1.2%2C12.7c0%2C36.8%2C29.9%2C66.7%2C66.7%2C66.7%26%2310%3B%26%239%3B%26%239%3Bc21.6%2C0%2C41.6-10.4%2C54.1-27.8c6.2%2C4.9%2C13.8%2C7.6%2C21.7%2C7.6c19.6%2C0%2C35.5-15.9%2C35.5-35.5c0-4.3-0.8-8.5-2.2-12.4%26%2310%3B%26%239%3B%26%239%3BC223.9%2C160.9%2C236.6%2C143.2%2C236.6%2C123.5z%20M91.6%2C34.8c10.9-15.9%2C28.9-25.4%2C48.1-25.4c32.2%2C0%2C58.4%2C26.2%2C58.4%2C58.4%26%2310%3B%26%239%3B%26%239%3Bc0%2C3.9-0.4%2C7.7-1.1%2C11.5l-52.2%2C45.8L93%2C101.5L82.9%2C79.9L91.6%2C34.8z%20M65.4%2C29c6.2%2C0%2C12.1%2C2%2C17%2C5.7l-7.8%2C40.3l-35.5-8.4%26%2310%3B%26%239%3B%26%239%3Bc-1.1-3.1-1.7-6.3-1.7-9.7C37.4%2C41.6%2C49.9%2C29%2C65.4%2C29z%20M9.1%2C112.3c0-16.7%2C11-31.9%2C26.9-37.2L75%2C84.4l9.1%2C19.5l-49.8%2C45%26%2310%3B%26%239%3B%26%239%3BC19.2%2C143.1%2C9.1%2C128.6%2C9.1%2C112.3z%20M145.2%2C200.9c-10.9%2C16.1-29%2C25.6-48.4%2C25.6c-32.3%2C0-58.6-26.3-58.6-58.5c0-4%2C0.4-7.9%2C1.1-11.7%26%2310%3B%26%239%3B%26%239%3Bl50.9-46l52%2C23.7l11.5%2C22L145.2%2C200.9z%20M171.2%2C206.6c-6.1%2C0-12-2-16.9-5.8l7.7-40.2l35.4%2C8.3c1.1%2C3.1%2C1.7%2C6.3%2C1.7%2C9.7%26%2310%3B%26%239%3B%26%239%3BC199.2%2C194.1%2C186.6%2C206.6%2C171.2%2C206.6z%20M200.5%2C160.5l-39-9.1l-10.4-19.8l51-44.7c15.1%2C5.7%2C25.2%2C20.2%2C25.2%2C36.5%26%2310%3B%26%239%3B%26%239%3BC227.4%2C140.1%2C216.4%2C155.3%2C200.5%2C160.5z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E ------------- - -*Returns:* render - - -[float] -=== rounddate - -Rounds milliseconds since epoch using a Moment.js formatting string; returns -milliseconds since epoch. - -*Accepts:* number - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|string -|Moment.js Format with which to bucket. See the -https://momentjs.com/docs/#/displaying/[MomentJS documentation]. -For example, "YYYY-MM" rounds to the month. -|=== - -*Returns:* number - - -[float] -=== rowCount - -Returns the number of rows. Pairs with `ply` to get the count of unique column -values, or combinations of unique column values. - -*Accepts:* datatable - -*Returns:* number - -[float] -=== seriesStyle - -Creates an object used for describing the properties of a series on a chart. -You typically use this inside of a charting function. - -*Accepts:* null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|label* -|string -|The label of the line this style applies to, not the name you would like to give the line. - -|color -|string -|The color to assign the line - -|lines -|number -|The width of the line (default: `0`) - -|bars -|number -|The width of bars (default: `0`) - -|points -|number -|The size of points on line (default: `5`) - -|fill -|number, boolean -|Designates if points should be filled (default: `false`) - -|stack -|number -|Designates if the series should be stacked? This number is the stack "id"; series -with the same stack id are stacked together. - -|horizontalBars -|boolean -|Sets the orientation of bars in the chart to horizontal (default: `false`) -|=== - -*Returns:* Depends on your input and arguments - - -[float] -=== shape - -Creates a shape. - -*Accepts:* null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_ (Alias: `shape`) -|string -|Pick a shape (default: `square`) - -|fill -|string -|Valid CSS color string (default: `black`) - -|border (Alias `stroke`) -|number -|Valid CSS color string - -|borderWidth (Alias: `strokeWidth`) -|number -|Thickness of the border (default: `0`) - -|maintainAspect -|boolean -|Select `true` to maintain aspect ratio (default: `false`) -|=== - -*Returns:* shape - - -[float] -=== sort - -Sorts a datatable on a column. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* (Alias: `column`) -|string -|The column to sort on. If column is not specified, the datatable is sorted on -the first column. - -|reverse* -|boolean -|Reverse the sort order. If reverse is not specified, the datatable is sorted -in ascending order. -|=== - -*Returns:* datatable - - -[float] -=== staticColumn - -Adds a column with a static value. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* (Alias: `column`) -|string -|The name of the new column - -|value -|string, number, boolean -|The value to insert in each column (default: is `null`). Tip: Use a sub-expression -to rollup other columns into a static value. -|=== - -*Returns:* datatable - - -[float] -=== string - -Outputs a string made of other strings. Mostly useful when combined with -sub-expressions that output a string, or something castable to a string. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|string -|One or more strings to join together; include spaces where needed -|=== - -*Returns:* string - - -[float] -=== switch - -Performs conditional logic with multiple conditions. See also the case function, -which builds a case to pass to the switch function. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* (Alias: `case`) -|case -|The list of conditions to check - -|default (Alias: `finally`) -|any -|The default case, if no cases match -|=== - -*Returns:* Depends on your input and arguments - - -[float] -=== table - -Configures a data table element. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|font -|style -|Font style (default: `{font}`) - -|paginate -|boolean -|Show pagination controls (default: `true`). If set to `false` only the first -page is displayed. - -|perPage -|number -|Show this many rows per page (default: `10`) - -|showHeader -|boolean -|Show or hide the header row with titles for each column (default: `true`) -|=== - -*Returns:* render - - -[float] -=== tail - -Gets the last N rows from the end of a datatable. See also, `head`. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* -|case -|Return this many rows from the end of the datatable -|=== - -*Returns:* datatable - - -[float] -=== timefilter - -Creates a time filter for querying a source. - -*Accepts:* filter - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|column (Aliases: `field`, `c`) -|any -|The column or field to attach the filter to (default: `@timestamp`) - -|from (Aliases: `f`, `start`) -|string -|Beginning of the range, in ISO8601 or {es} datemath format - -|to (Aliases: `t`, `end`) -|string -|End of the range, in ISO8601 or {es} datemath format -|=== - -*Returns:* filter - - -[float] -=== timefilterControl - -Configures a time filter control element. - -*Accepts:* null - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|column (Aliases: `field`, `c`) -|any -|The column or field to attach the filter to - -|compact -|any -|Show the time filter as a button that triggers a popover (default: `true`) -|=== - -*Returns:* render - - -[float] -=== to - -Explicitly casts from one type to another. - -*Accepts:* Anything or nothing - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* (Alias: `type`) -|string -|A known type -|=== - -*Returns:* Depends on your input and arguments - diff --git a/docs/canvas/canvas-function-reference.asciidoc b/docs/canvas/canvas-function-reference.asciidoc index 28966a963aa73..6fea00fb05c13 100644 --- a/docs/canvas/canvas-function-reference.asciidoc +++ b/docs/canvas/canvas-function-reference.asciidoc @@ -1,17 +1,2154 @@ [role="xpack"] [[canvas-function-reference]] -== Canvas function reference += Canvas function reference Behind the scenes, Canvas is driven by a powerful expression language, with dozens of functions and other capabilities, including table transforms, type casting, and sub-expressions. -For the purpose of this documentation, -the Canvas functions are divided by the environment they run in: +The Canvas expression language also supports <>, which +perform complex math calculations. + +A *** denotes a required argument. + +A *†* denotes an argument can be passed multiple times. + +<> | B | <> | <> | <> | <> | <> | <> | <> | <> | K | <> | <> | <> | O | <> | Q | <> | <> | <> | <> | V | W | X | Y | Z + +[float] +[[a_fns]] +== A +[[all_fn]] +=== `all` + +Returns `true` if all of the conditions are met. See also <>. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** *†* + +Alias: `condition` +|`boolean` +|The conditions to check. +|=== + +*Returns:* `boolean` + + +[float] +[[alterColumn_fn]] +=== `alterColumn` + +Converts between core types, including `string`, `number`, `null`, `boolean`, and `date`, and renames columns. See also <> and <>. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `column` +|`string` +|The name of the column to alter. + +|`name` +|`string` +|The resultant column name. Leave blank to not rename. + +|`type` +|`string` +|The type to convert the column to. Leave blank to not change the type. +|=== + +*Returns:* `datatable` + + +[float] +[[any_fn]] +=== `any` + +Returns `true` if at least one of the conditions is met. See also <>. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** *†* + +Alias: `condition` +|`boolean` +|The conditions to check. +|=== + +*Returns:* `boolean` + + +[float] +[[as_fn]] +=== `as` + +Creates a `datatable` with a single value. See also <>. + +*Accepts:* `string`, `boolean`, `number`, `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `name` +|`string` +|The name to give the column. + +Default: `"value"` +|=== + +*Returns:* `datatable` + + +[float] +[[asset_fn]] +=== `asset` + +Retrieves Canvas workpad asset objects to provide as argument values. Usually images. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `id` +|`string` +|The ID of the asset to retrieve. +|=== + +*Returns:* `string` + + +[float] +[[axisConfig_fn]] +=== `axisConfig` + +Configures the axis of a visualization. Only used with <>. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`max` +|`number`, `string`, `null` +|The maximum value displayed in the axis. Must be a `number`, a date in milliseconds since epoch, or an ISO8601 `string` + +|`min` +|`number`, `string`, `null` +|The minimum value displayed in the axis. Must be a `number`, a date in milliseconds since epoch, or an ISO8601 `string` + +|`position` +|`string` +|The position of the axis labels. For example, `"top"`, `"bottom"`, `"left"`, or `"right"`. + +Default: `"left"` + +|`show` +|`boolean` +|Show the axis labels? + +Default: `true` + +|`tickSize` +|`number`, `null` +|The increment size between each tick. Use for `number` axes only. +|=== + +*Returns:* `axisConfig` + +[float] +[[c_fns]] +== C +[[case_fn]] +=== `case` + +Builds a `case` (including a condition/result) to pass to the <> function. + +*Accepts:* `any` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `when` +|`any` +|The value compared to the _context_ to see if they are equal. The `when` argument is ignored when the `if` argument is also specified. + +|`if` +|`boolean` +|This value indicates whether the condition is met. The `if` argument overrides the `when` argument when both are provided. + +|`then` *** +|`any` +|The value returned if the condition is met. +|=== + +*Returns:* `case` + + +[float] +[[clear_fn]] +=== `clear` + +Clears the _context_, and returns `null`. + +*Accepts:* `null` + +*Returns:* `null` + + +[float] +[[columns_fn]] +=== `columns` + +Includes or excludes columns from a data table. If you specify both, this will exclude first. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `include` +|`string` +|A comma-separated list of column names to keep in the `datatable`. + +|`exclude` +|`string` +|A comma-separated list of column names to remove from the `datatable`. +|=== + +*Returns:* `datatable` + + +[float] +[[compare_fn]] +=== `compare` + +Compares the _context_ to specified value to determine `true` or `false`. +Usually used in combination with <> or <>. This only works with primitive types, +such as `number`, `string`, and `boolean`. See also <>, <>, <>, <>, <>, and <>. + +*Accepts:* `string`, `number`, `boolean`, `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `op` +|`string` +|The operator to use in the comparison: `eq` (equal to), `gt` (greater than), `gte` (greater than or equal to), `lt` (less than), `lte` (less than or equal to), `ne` or `neq` (not equal to). + +Default: `"eq"` + +|`to` + +Alias: `this`, `b` +|`any` +|The value compared to the _context_. +|=== + +*Returns:* `boolean` + + +[float] +[[containerStyle_fn]] +=== `containerStyle` + +Creates an object used for styling an element's container, including background, border, and opacity. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`backgroundColor` +|`string` +|A valid CSS background color. + +|`backgroundImage` +|`string` +|A valid CSS background image. + +|`backgroundRepeat` +|`string` +|A valid CSS background repeat. + +Default: `"no-repeat"` + +|`backgroundSize` +|`string` +|A valid CSS background size. + +Default: `"contain"` + +|`border` +|`string` +|A valid CSS border. + +|`borderRadius` +|`string` +|The number of pixels to use when rounding the corners. + +|`opacity` +|`number` +|A number between 0 and 1 that represents the degree of transparency of the element. + +|`overflow` +|`string` +|A valid CSS overflow. + +Default: `"hidden"` + +|`padding` +|`string` +|The distance of the content, in pixels, from the border. +|=== + +*Returns:* `containerStyle` + + +[float] +[[context_fn]] +=== `context` + +Returns whatever you pass into it. This can be useful when you need to use the +_context_ as an argument to a function as a sub-expression. + +*Accepts:* `any` + +*Returns:* Original _context_ + +[float] +[[csv_fn]] +=== `csv` + +Creates a `datatable` from CSV input. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `data` +|`string` +|The CSV data to use. + +|`delimiter` +|`string` +|The data separation character. + +|`newLine` +|`string` +|The row separation character. +|=== + +*Returns:* `datatable` + + +[float] +[[d_fns]] +== D +[[date_fn]] +=== `date` + +Returns the current time, or a time parsed from a `string`, as milliseconds since epoch. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `value` +|`string` +|A date string to be parsed into milliseconds since epoch. The date string be either a valid JavaScript Date input or a string to parse +using the `format` argument. Must be an ISO8601 string or you must provide the format. + +|`format` +|`string` +|The MomentJS format for parsing the optional date +`string`. See the https://momentjs.com/docs/#/displaying/[MomentJS documentation]. +|=== + +*Returns:* `number` + + +[float] +[[demodata_fn]] +=== `demodata` + +A mock data set that includes project CI times with usernames, countries, and run phases. + +*Accepts:* `filter` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `type` +|`string` +|The name of the demo data set to use. + +Default: `"ci"` +|=== + +*Returns:* `datatable` + + +[float] +[[do_fn]] +=== `do` + +Executes multiple sub-expressions, then returns the original _context_. Use for running functions that produce an action or side effect without changing the original _context_. + +*Accepts:* `any` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *†* + +Aliases: `expression`, `exp`, `fn`, `function` +|`any` +|The sub-expressions to execute. The return values of these sub-expressions are not available in the root pipeline as this function simply returns the _context_. +|=== + +*Returns:* Original _context_ + + +[float] +[[dropdownControl_fn]] +=== `dropdownControl` + +Configures a dropdown filter control element. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`filterColumn` *** +|`string` +|The column or field that you want to filter. + +|`valueColumn` *** +|`string` +|The column or field to extract the unique values for the drop-down control. + +|`filterGroup` +|`string` +|The group name for the filter. +|=== + +*Returns:* `render` + + +[float] +[[e_fns]] +== E +[[eq_fn]] +=== `eq` + +Returns whether the _context_ is equal to the argument. + +*Accepts:* `boolean`, `number`, `string`, `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `value` +|`boolean`, `number`, `string`, `null` +|The value compared to the _context_. +|=== + +*Returns:* `boolean` + + +[float] +[[escount_fn]] +=== `escount` + +Queries {es} for the number of hits matching the specified query. + +*Accepts:* `filter` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `q`, `query` +|`string` +|A Lucene query string. + +Default: `"-_index:.kibana"` + +|`index` +|`string` +|An index or index pattern. For example, `"logstash-*"`. + +Default: `_all` +|=== + +*Returns:* `number` + + +[float] +[[esdocs_fn]] +=== `esdocs` + +Queries {es} for raw documents. Specify the fields you want to retrieve, +especially if you are asking for a lot of rows. + +*Accepts:* `filter` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Aliases: `q`, `query` +|`string` +|A Lucene query string. + +Default: `"-_index:.kibana"` + +|`count` +|`number` +|The number of documents to retrieve. For better performance, use a smaller data set. + +Default: `100` + +|`fields` +|`string` +|A comma-separated list of fields. For better performance, use fewer fields. + +|`index` +|`string` +|An index or index pattern. For example, `"logstash-*"`. + +Default: `"_all"` + +|`sort` +|`string` +|The sort direction formatted as `"field, direction"`. For example, `"@timestamp, desc"` or `"bytes, asc"`. +|=== + +*Returns:* `datatable` + + +[float] +[[essql_fn]] +=== `essql` + +Queries {es} using {es} SQL. + +*Accepts:* `filter` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `q`, `query` +|`string` +|An {es} SQL query. + +|`count` +|`number` +|The number of documents to retrieve. Smaller numbers perform better. + +Default: `1000` + +|`timezone` +|`string` +|The timezone to use for date operations. Valid ISO8601 formats and UTC offsets both work. + +Default: `UTC` +|=== + +*Returns:* `datatable` + + +[float] +[[exactly_fn]] +=== `exactly` + +Creates a filter that matches a given column to an exact value. + +*Accepts:* `filter` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`column` *** + +Aliases: `field`, `c` +|`string` +|The column or field that you want to filter. + +|`value` *** + +Aliases: `v`, `val` +|`string` +|The value to match exactly, including white space and +capitalization. + +|`filterGroup` +|`string` +|The group name for the filter. +|=== + +*Returns:* `filter` + + +[float] +[[f_fns]] +== F +[[filterrows_fn]] +=== `filterrows` + +Filters rows in a `datatable` based on the return value of a sub-expression. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Aliases: `fn`, `exp`, `expression` +|`boolean` +|An expression to pass into each row in the `datatable.` +The expression should return a `boolean`. A `true` value preserves the row, +and a `false` value removes it. +|=== + +*Returns:* `datatable` + + +[float] +[[filters_fn]] +=== `filters` + +Aggregates element filters from the workpad for use elsewhere, usually a data source. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *†* + +Alias: `group` +|`string` +|The name of the filter group to use. + +|`ungrouped` + +Alias: `nogroup`, `nogroups` +|`boolean` +|Exclude filters that belong to a filter group? + +Default: `false` +|=== + +*Returns:* `filter` + + +[float] +[[font_fn]] +=== `font` + +Creates a font style. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`align` +|`string` +|The horizontal alignment of text. + +Default: `left` + +|`color` +|`string` +|The text color. + +|`family` +|`string` +|An acceptable CSS web font string. + +Default: `"'Open Sans', Helvetica, Arial, sans-serif"` + +|`italic` +|`boolean` +|Italicize the text? + +Default: `false` + +|`lHeight` + +Alias: `lineHeight` +|`number`, `null` +|The line height in pixels. + +|`size` +|`number` +|The font size in pixels. + +Default: `14` + +|`underline` +|`boolean` +|Underline the text? + +Default: `false` + +|`weight` +|`string` +|The font weight. For example, `"normal"`, `"bold"`, `"bolder"`, `"lighter"`, `"100"`, `"200"`, `"300"`, `"400"`, `"500"`, `"600"`, `"700"`, `"800"`, or `"900"`. + +Default: `"normal"` + +|=== + +*Returns:* `style` + + +[float] +[[formatdate_fn]] +=== `formatdate` + +Formats an ISO8601 date string or a date in milliseconds since epoch using MomentJS. See https://momentjs.com/docs/#/displaying/. + +*Accepts:* `number`, `string` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `format` +|`string` +|A MomentJS format. For example, `"MM/DD/YYYY"`. See https://momentjs.com/docs/#/displaying/. +|=== + +*Returns:* `string` + + +[float] +[[formatnumber_fn]] +=== `formatnumber` + +Formats a `number` into a formatted `string` using NumeralJS. See http://numeraljs.com/#format. + +*Accepts:* `number` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `format` +|`string` +|A NumeralJS format string. For example, `"0.0a"` or `"0%"`. See http://numeraljs.com/#format. +|=== + +*Returns:* `string` + + +[float] +[[g_fns]] +== G +[[getCell_fn]] +=== `getCell` + +Fetches a single cell from a `datatable`. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Aliases: `column`, `c` +|`string` +|The name of the column to fetch the value from. If not provided, the value is retrieved from the first column. + +|`row` + +Alias: `r` +|`number` +|The row number, starting at 0. + +Default: `0` +|=== + +*Returns:* Depends on the data in the cell + + +[float] +[[gt_fn]] +=== `gt` + +Returns whether the _context_ is greater than the argument. + +*Accepts:* `number`, `string` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `value` +|`number`, `string` +|The value compared to the _context_. +|=== + +*Returns:* `boolean` + + +[float] +[[gte_fn]] +=== `gte` + +Returns whether the _context_ is greater or equal to the argument. + +*Accepts:* `number`, `string` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `value` +|`number`, `string` +|The value compared to the _context_. +|=== + +*Returns:* `boolean` + + +[float] +[[h_fns]] +== H +[[head_fn]] +=== `head` + +Retrieves the first N rows from the `datatable`. See also <>. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `count` +|`number` +|The number of rows to retrieve from the beginning of the `datatable`. + +Default: `1` +|=== + +*Returns:* `datatable` + + +[float] +[[i_fns]] +== I +[[if_fn]] +=== `if` + +Performs conditional logic. + +*Accepts:* `any` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `condition` +|`boolean` +|A `true` or `false` indicating whether a condition is met, usually returned by a sub-expression. When unspecified, the original _context_ is returned. + +|`then` +|`any` +|The return value when the condition is `true`. When unspecified and the condition is met, the original _context_ is returned. + +|`else` +|`any` +|The return value when the condition is `false`. When unspecified and the condition is not met, the original _context_ is returned. +|=== + +*Returns:* Depends on your _context_ and arguments + + +[float] +[[image_fn]] +=== `image` + +Displays an image. Provide an image asset as a `base64` data URL, or pass in a sub-expression. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Aliases: `dataurl`, `url` +|`string`, `null` +|The HTTP(S) URL or `base64` data URL of an image. + +|`mode` +|`string` +|`"contain"` shows the entire image, scaled to fit. +`"cover"` fills the container with the image, cropping from the sides or bottom as needed. +`"stretch"` resizes the height and width of the image to 100% of the container. + + +Default: `"contain"` +|=== + +Example value for the `dataurl` argument, formatted as a `base64` data URL: +[source, url] +------------- +data:image/svg+xml;`base64`,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgdmlld0JveD0iMCAwIDI3MC42MDAwMSAyNjkuNTQ2NjYiCiAgIGhlaWdodD0iMjY5LjU0NjY2IgogICB3aWR0aD0iMjcwLjYwMDAxIgogICB4bWw6c3BhY2U9InByZXNlcnZlIgogICBpZD0ic3ZnMiIKICAgdmVyc2lvbj0iMS4xIj48bWV0YWRhdGEKICAgICBpZD0ibWV0YWRhdGE4Ij48cmRmOlJERj48Y2M6V29yawogICAgICAgICByZGY6YWJvdXQ9IiI+PGRjOmZvcm1hdD5pbWFnZS9zdmcreG1sPC9kYzpmb3JtYXQ+PGRjOnR5cGUKICAgICAgICAgICByZGY6cmVzb3VyY2U9Imh0dHA6Ly9wdXJsLm9yZy9kYy9kY21pdHlwZS9TdGlsbEltYWdlIiAvPjwvY2M6V29yaz48L3JkZjpSREY+PC9tZXRhZGF0YT48ZGVmcwogICAgIGlkPSJkZWZzNiIgLz48ZwogICAgIHRyYW5zZm9ybT0ibWF0cml4KDEuMzMzMzMzMywwLDAsLTEuMzMzMzMzMywwLDI2OS41NDY2NykiCiAgICAgaWQ9ImcxMCI+PGcKICAgICAgIHRyYW5zZm9ybT0ic2NhbGUoMC4xKSIKICAgICAgIGlkPSJnMTIiPjxwYXRoCiAgICAgICAgIGlkPSJwYXRoMTQiCiAgICAgICAgIHN0eWxlPSJmaWxsOiNmZmZmZmY7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiCiAgICAgICAgIGQ9Im0gMjAyOS40OCw5NjIuNDQxIGMgMCwxNzAuMDk5IC0xMDUuNDYsMzE4Ljc5OSAtMjY0LjE3LDM3Ni42NTkgNi45OCwzNS44NiAxMC42Miw3MS43MSAxMC42MiwxMDkuMDUgMCwzMTYuMTkgLTI1Ny4yNCw1NzMuNDMgLTU3My40Nyw1NzMuNDMgLTE4NC43MiwwIC0zNTYuNTU4LC04OC41OSAtNDY0LjUzLC0yMzcuODUgLTUzLjA5LDQxLjE4IC0xMTguMjg1LDYzLjc1IC0xODYuMzA1LDYzLjc1IC0xNjcuODM2LDAgLTMwNC4zODMsLTEzNi41NCAtMzA0LjM4MywtMzA0LjM4IDAsLTM3LjA4IDYuNjE3LC03Mi41OCAxOS4wMzEsLTEwNi4wOCBDIDEwOC40ODgsMTM4MC4wOSAwLDEyMjcuODkgMCwxMDU4Ljg4IDAsODg3LjkxIDEwNS45NzcsNzM4LjUzOSAyNjUuMzk4LDY4MS4wOSBjIC02Ljc2OSwtMzUuNDQyIC0xMC40NiwtNzIuMDIgLTEwLjQ2LC0xMDkgQyAyNTQuOTM4LDI1Ni42MjEgNTExLjU2NiwwIDgyNy4wMjcsMCAxMDEyLjIsMCAxMTgzLjk0LDg4Ljk0MTQgMTI5MS4zLDIzOC44MzIgYyA1My40NSwtNDEuOTYxIDExOC44LC02NC45OTIgMTg2LjU2LC02NC45OTIgMTY3LjgzLDAgMzA0LjM4LDEzNi40OTIgMzA0LjM4LDMwNC4zMzIgMCwzNy4wNzggLTYuNjIsNzIuNjI5IC0xOS4wMywxMDYuMTI5IDE1Ny43OCw1Ni44NzkgMjY2LjI3LDIwOS4xMjkgMjY2LjI3LDM3OC4xNCIgLz48cGF0aAogICAgICAgICBpZD0icGF0aDE2IgogICAgICAgICBzdHlsZT0iZmlsbDojZmFjZjA5O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgICBkPSJtIDc5Ny44OTgsMTE1MC45MyA0NDQuMDcyLC0yMDIuNDUgNDQ4LjA1LDM5Mi41OCBjIDYuNDksMzIuMzkgOS42Niw2NC42NyA5LjY2LDk4LjQ2IDAsMjc2LjIzIC0yMjQuNjgsNTAwLjk1IC01MDAuOSw1MDAuOTUgLTE2NS4yNCwwIC0zMTkuMzcsLTgxLjM2IC00MTMuMDUzLC0yMTcuNzkgbCAtNzQuNTI0LC0zODYuNjQgODYuNjk1LC0xODUuMTEiIC8+PHBhdGgKICAgICAgICAgaWQ9InBhdGgxOCIKICAgICAgICAgc3R5bGU9ImZpbGw6IzQ5YzFhZTtmaWxsLW9wYWNpdHk6MTtmaWxsLXJ1bGU6bm9uemVybztzdHJva2U6bm9uZSIKICAgICAgICAgZD0ibSAzMzguMjIzLDY4MC42NzIgYyAtNi40ODksLTMyLjM4MyAtOS44MDksLTY1Ljk4MSAtOS44MDksLTk5Ljk3MyAwLC0yNzYuOTI5IDIyNS4zMzYsLTUwMi4yNTc2IDUwMi4zMTMsLTUwMi4yNTc2IDE2Ni41OTMsMCAzMjEuNDczLDgyLjExNzYgNDE1LjAxMywyMTkuOTQ5NiBsIDczLjk3LDM4NS4zNDcgLTk4LjcyLDE4OC42MjEgTCA3NzUuMTU2LDEwNzUuNTcgMzM4LjIyMyw2ODAuNjcyIiAvPjxwYXRoCiAgICAgICAgIGlkPSJwYXRoMjAiCiAgICAgICAgIHN0eWxlPSJmaWxsOiNlZjI5OWI7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiCiAgICAgICAgIGQ9Im0gMzM1LjQxLDE0NDkuMTggMzA0LjMzMiwtNzEuODYgNjYuNjgsMzQ2LjAyIGMgLTQxLjU4NiwzMS43OCAtOTIuOTMsNDkuMTggLTE0NS43MzEsNDkuMTggLTEzMi4yNSwwIC0yMzkuODEyLC0xMDcuNjEgLTIzOS44MTIsLTIzOS44NyAwLC0yOS4yMSA0Ljg3OSwtNTcuMjIgMTQuNTMxLC04My40NyIgLz48cGF0aAogICAgICAgICBpZD0icGF0aDIyIgogICAgICAgICBzdHlsZT0iZmlsbDojNGNhYmU0O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgICBkPSJNIDMwOC45OTIsMTM3Ni43IEMgMTczLjAyLDEzMzEuNjQgNzguNDgwNSwxMjAxLjMgNzguNDgwNSwxMDU3LjkzIDc4LjQ4MDUsOTE4LjM0IDE2NC44Miw3OTMuNjggMjk0LjQwNiw3NDQuMzUyIGwgNDI2Ljk4MSwzODUuOTM4IC03OC4zOTUsMTY3LjUxIC0zMzQsNzguOSIgLz48cGF0aAogICAgICAgICBpZD0icGF0aDI0IgogICAgICAgICBzdHlsZT0iZmlsbDojODVjZTI2O2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpub256ZXJvO3N0cm9rZTpub25lIgogICAgICAgICBkPSJtIDEzMjMuOCwyOTguNDEgYyA0MS43NCwtMzIuMDkgOTIuODMsLTQ5LjU5IDE0NC45OCwtNDkuNTkgMTMyLjI1LDAgMjM5LjgxLDEwNy41NTkgMjM5LjgxLDIzOS44MjEgMCwyOS4xNiAtNC44OCw1Ny4xNjggLTE0LjUzLDgzLjQxOCBsIC0zMDQuMDgsNzEuMTYgLTY2LjE4LC0zNDQuODA5IiAvPjxwYXRoCiAgICAgICAgIGlkPSJwYXRoMjYiCiAgICAgICAgIHN0eWxlPSJmaWxsOiMzMTc3YTc7ZmlsbC1vcGFjaXR5OjE7ZmlsbC1ydWxlOm5vbnplcm87c3Ryb2tlOm5vbmUiCiAgICAgICAgIGQ9Im0gMTM4NS42Nyw3MjIuOTMgMzM0Ljc2LC03OC4zMDEgYyAxMzYuMDIsNDQuOTYxIDIzMC41NiwxNzUuMzUxIDIzMC41NiwzMTguNzYyIDAsMTM5LjMzOSAtODYuNTQsMjYzLjg1OSAtMjE2LjM4LDMxMy4wMzkgbCAtNDM3Ljg0LC0zODMuNTkgODguOSwtMTY5LjkxIiAvPjwvZz48L2c+PC9zdmc+ +------------- + +*Returns:* `image` + + +[float] +[[j_fns]] +== J + +[float] +[[joinRows_fn]] +=== `joinRows` + +Concatenates values from rows in a `datatable` into a single string. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `column` +|`string` +|The column or field from which to extract the values. + +|distinct +|`boolean` +|Extract only unique values? + +Default: `true` + +|quote +|`string` +|The quote character to wrap around each extracted value. + +Default: `"'"` + +|separator + +Aliases: `sep`, `delimiter` +|`string` +|The delimiter to insert between each extracted value. + +Default: `", "` +|=== + +*Returns:* `string` + + +[float] +[[l_fns]] +== L +[float] +[[location_fn]] +=== `location` + +Find your current location using the Geolocation API of the browser. Performance can vary, but is fairly accurate. +See: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/geolocation. + +*Accepts:* `null` + +*Returns:* `datatable` + + +[float] +[[lt_fn]] +=== `lt` + +Returns whether the _context_ is less than the argument. + +*Accepts:* `number`, `string` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `value` +|`number`, `string` +|The value compared to the _context_. +|=== + +*Returns:* `boolean` + + +[float] +[[lte_fn]] +=== `lte` + +Returns whether the _context_ is less than or equal to the argument. + +*Accepts:* `number`, `string` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `value` +|`number`, `string` +|The value compared to the _context_. +|=== + +*Returns:* `boolean` + + +[float] +[[m_fns]] +== M +[[mapColumn_fn]] +=== `mapColumn` + +Adds a column calculated as the result of other columns. Changes are made only when you provide arguments. See also <> and <>. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `column` +|`string` +|The name of the resulting column. + +|`expression` *** + +Alias: `exp`, `fn`, `function` +|`boolean`, `number`, `string`, `null` +|A Canvas expression that is passed to each row as a single row `datatable`. +|=== + +*Returns:* `datatable` + + +[float] +[[markdown_fn]] +=== `markdown` + +Adds an element that renders Markdown text. TIP: Use the <> function for single numbers, metrics, and paragraphs of text. + +*Accepts:* `datatable`, `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *†* + +Alias: `expression`, `content` +|`string` +|A string of text that contains Markdown. To concatenate, pass the <> function multiple times. + +Default: `""` + +|`font` +|`style` +|The CSS font properties for the content. For example, `font-family` or `font-weight`. + +Default: `{<>}` +|=== + +*Returns:* `render` + + +[float] +[[math_fn]] +=== `math` + +Interprets a `TinyMath` math expression using a `number` or `datatable` as _context_. The `datatable` columns are available by their column name. If the _context_ is a `number`, it is available as `value`. + +*Accepts:* `number`, `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `expression` +|`string` +|An evaluated TinyMath expression. See <>. +|=== + +*Returns:* `number` + + +[float] +[[metric_fn]] +=== `metric` + +Displays a number over a label. + +*Accepts:* `number`, `string`, `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Aliases: `label`, `text`, `description` +|`string` +|The text describing the metric. + +Default: `""` + +|`metricFont` +|`style` +|The CSS font properties for the metric. For example, `font-family` or `font-weight`. + +Default: `{<> size=48 family="'Open Sans', Helvetica, Arial, sans-serif" color="#000000" align=center lHeight=48}`. + +|`labelFont` +|`style` +|The CSS font properties for the label. For example, `font-family` or `font-weight`. + +Default: `{<> size=14 family="'Open Sans', Helvetica, Arial, sans-serif" color="#000000" align=center}`. +|=== + +*Returns:* `render` + + +[float] +[[n_fns]] +== N +[[neq_fn]] +=== `neq` + +Returns whether the _context_ is not equal to the argument. + +*Accepts:* `boolean`, `number`, `string`, `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `value` +|`boolean`, `number`, `string`, `null` +|The value compared to the _context_. +|=== + +*Returns:* `boolean` + + +[float] +[[p_fns]] +== P +[[palette_fn]] +=== `palette` + +Creates a color palette. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** *†* + +Alias: `color` +|`string` +|The palette colors. Accepts an HTML color name, HEX, HSL, HSLA, RGB, or RGBA. + +|`gradient` +|`boolean` +|Make a gradient where supported? + +Default: `false` + +|`reverse` +|`boolean` +|Reverse the palette? + +Default: `false` +|=== + +*Returns:* `palette` + + +[float] +[[pie_fn]] +=== `pie` + +Configures a pie chart element. + +*Accepts:* `pointseries` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`font` +|`style` +|The CSS font properties for the labels. For example, `font-family` or `font-weight`. + +Default: `{<>}` + +|`hole` +|`number` +|Draws a hole in the pie, 0-100, as a percentage of the pie radius. + +Default: `0` + +|`labelRadius` +|`number` +|The percentage of the container area to use as a radius for the label circle. + +Default: `100` + +|`labels` +|`boolean` +|Display the pie labels? + +Default: `true` + +|`legend` +|`string`, `boolean` +|The legend position. For example, `"nw"`, `"sw"`, `"ne"`, `"se"`. When `false`, the legend is hidden. + +Default: `false` + +|`palette` +|`palette` +|A `palette` object for describing the colors to use in this pie chart + +Default: `{<>}` + +|`radius` +|`string`, `number` +|The radius of the pie as a percentage (between 0 and 1) of the available space. To automatically set radius, use `"auto"`. + +Default: `"auto"` + +|`seriesStyle` *†* +|`seriesStyle` +|A style of a specific series + +|`tilt` +|`number` +|The percentage of tilt, where 1 is fully vertical, and 0 is completely flat. + +Default: `1` +|=== + +*Returns:* `render` + + +[float] +[[plot_fn]] +=== `plot` + +Configures a plot element. + +*Accepts:* `pointseries` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`defaultStyle` +|`seriesStyle` +|The default style to use for every series. + +Default: `{<> points=5}` + +|`font` +|`style` +|The CSS font properties for the labels. For example, `font-family` or `font-weight`. + +Default: `{<>}` + +|`legend` +|`string`, `boolean` +|The legend position. For example, `"nw"`, `"sw"`, `"ne"`, `"se"`, or `false`. When `false`, the legend is hidden. + +Default: `"ne"` + +|`palette` +|`palette` +|A `palette` object for describing the colors to use in this chart + +Default: `{<>}` + +|`seriesStyle` *†* +|`seriesStyle` +|A style of a specific series + +|`xaxis` +|`boolean`, `axisConfig` +|The axis configuration. When `false`, the axis is hidden. + +Default: `true` + +|`yaxis` +|`boolean`, `axisConfig` +|The axis configuration. When `false`, the axis is hidden. + +Default: `true` +|=== + +*Returns:* `render` + + +[float] +[[ply_fn]] +=== `ply` + +Subdivides a `datatable` by the unique values of the specified columns, and passes the resulting tables into an expression, then merges the outputs of each expression. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`by` *** *†* +|`string` +|The column to subdivide the `datatable`. -* <> can run anywhere -* <> can only execute on the server -* <> must execute in a browser +|`expression` *** *†* + +Alias: `fn`, `exp`, `function` +|`datatable` +|An expression to pass into each resulting data table. Expressions must return a `datatable`. Use `as` to turn literals into `datatable`s. Multiple expressions must return the same number of rows. If you need to return a different row count, pipe into another instance of <>. If multiple expressions return `datatable`s with the same column names, the last one wins. +|=== + +*Returns:* `datatable` + + +[float] +[[pointseries_fn]] +=== `pointseries` + +Turns a `datatable` into a point series model. Currently we differentiate measure from dimensions by looking for a <>. If you enter a TinyMath +expression in your argument, Canvas treats that argument as a measure. Otherwise, it is a dimension. Dimensions are combined to create unique keys. Measures are then deduplicated by those keys using the specified TinyMath function. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`color` +|`string` +|An expression to use in determining the mark's color. + +|`size` +|`string` +|The size of the marks. Only applicable to supported elements. + +|`text` +|`string` +|The text to show on the mark. Only applicable to supported elements. + +|`x` +|`string` +|The values along the X-axis. + +|`y` +|`string` +|The values along the Y-axis. +|=== + +*Returns:* `pointseries` + + +[float] +[[progress_fn]] +=== `progress` + +Configures a progress element + +*Accepts:* `number` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +| _Unnamed_ + +Alias: `shape` +|`string` +|Select `"gauge"`, `"horizontalBar"`, `"horizontalPill"`, `"semicircle"`, `"unicorn"`, `"verticalBar"`, `"verticalPill"`, or `"wheel"`. + +Default: `"gauge"` + +|`barColor` +|`string` +|The color of the background bar. + +Default: `"#f0f0f0"` + +|`barWeight` +|`number` +|The thickness of the background bar. + +Default: `20` + +|`font` +|`style` +|The CSS font properties for the label. For example, `font-family` or `font-weight`. + +Default: `{<> size=24 family="'Open Sans', Helvetica, Arial, sans-serif" color="#000000" align=center}` + +|`label` +|`boolean`, `string` +|To show or hide the value, use `true` or `false`. Alternatively, provide a string to display as a label. + +Default: `true` + +|`max` +|`number` +|The maximum value of the progress element. + +Default: `1` + +|`valueColor` +|`string` +|The color of the progress bar. + +Default: `"#1785b0"` + +|`valueWeight` +|`number` +|The thickness of the progress bar. + +Default: `20` +|=== + +*Returns:* `render` + + +[float] +[[r_fns]] +== R +[[render_fn]] +=== `render` + +Renders the _context_ as a specific element and sets element level options, such as background and border styling. + +*Accepts:* `render` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`as` +|`string` +|The element type to render. You might want to use a specialized function instead, such as <> or <>. + +|`css` +|`string` +|Any block of custom CSS to be scoped to the element + +Default: `".canvasRenderEl{\n\n}"` + +|`containerStyle` +|`containerStyle` +|The style for the container, including background, border, and opacity. + +Default: `{<>}` +|=== + +*Returns:* `render` + + +[float] +[[repeatImage_fn]] +=== `repeatImage` + +Configures a repeating image element. + +*Accepts:* `number` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`emptyImage` +|`string` +|Fills the difference between the _context_ and `max` parameter for the element with this image. Provide an image asset as a `base64` data URL, or pass in a sub-expression. + +Default: `null` + +|`image` +|`string` +|The image to repeat. Provide an image asset as a `base64` data URL, or pass in a sub-expression. + +|`max` +|`number` +|The maximum number of times the image can repeat. + +Default: `100` + +|`size` +|`number` +|The maximum height or width of the image, in pixels. When the image is taller than it is wide, this function limits the height. + +Default: `100` +|=== + + +Example value for the `image` argument, formatted as a `base64` data URL: +[source, url] +------------ +data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20viewBox%3D%22-3.948730230331421%20-1.7549896240234375%20245.25946044921875%20241.40370178222656%22%20width%3D%22245.25946044921875%22%20height%3D%22241.40370178222656%22%20style%3D%22enable-background%3Anew%200%200%20686.2%20235.7%3B%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cdefs%3E%0A%20%20%20%20%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%232D2D2D%3B%7D%0A%3C%2Fstyle%3E%0A%20%20%3C%2Fdefs%3E%0A%20%20%3Cg%20transform%3D%22matrix%281%2C%200%2C%200%2C%201%2C%200%2C%200%29%22%3E%0A%20%20%20%20%3Cg%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M329.4%2C160.3l4.7-0.5l0.3%2C9.6c-12.4%2C1.7-23%2C2.6-31.8%2C2.6c-11.7%2C0-20-3.4-24.9-10.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-4.9-6.8-7.3-17.4-7.3-31.7c0-28.6%2C11.4-42.9%2C34.1-42.9c11%2C0%2C19.2%2C3.1%2C24.6%2C9.2c5.4%2C6.1%2C8.1%2C15.8%2C8.1%2C28.9l-0.7%2C9.3h-53.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0%2C9%2C1.6%2C15.7%2C4.9%2C20c3.3%2C4.3%2C8.9%2C6.5%2C17%2C6.5C312.8%2C161.2%2C321.1%2C160.9%2C329.4%2C160.3z%20M325%2C124.9c0-10-1.6-17.1-4.8-21.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.2-4.1-8.4-6.2-15.6-6.2c-7.2%2C0-12.7%2C2.2-16.3%2C6.5c-3.6%2C4.3-5.5%2C11.3-5.6%2C20.9H325z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M354.3%2C171.4V64h12.2v107.4H354.3z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M443.5%2C113.5v41.1c0%2C4.1%2C10.1%2C3.9%2C10.1%2C3.9l-0.6%2C10.8c-8.6%2C0-15.7%2C0.7-20-3.4c-9.8%2C4.3-19.5%2C6.1-29.3%2C6.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.5%2C0-13.2-2.1-17.1-6.4c-3.9-4.2-5.9-10.3-5.9-18.3c0-7.9%2C2-13.8%2C6-17.5c4-3.7%2C10.3-6.1%2C18.9-6.9l25.6-2.4v-7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0-5.5-1.2-9.5-3.6-11.9c-2.4-2.4-5.7-3.6-9.8-3.6l-32.1%2C0V87.2h31.3c9.2%2C0%2C15.9%2C2.1%2C20.1%2C6.4C441.4%2C97.8%2C443.5%2C104.5%2C443.5%2C113.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bz%20M393.3%2C146.7c0%2C10%2C4.1%2C15%2C12.4%2C15c7.4%2C0%2C14.7-1.2%2C21.8-3.7l3.7-1.3v-26.9l-24.1%2C2.3c-4.9%2C0.4-8.4%2C1.8-10.6%2C4.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3BC394.4%2C138.7%2C393.3%2C142.2%2C393.3%2C146.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M491.2%2C98.2c-11.8%2C0-17.8%2C4.1-17.8%2C12.4c0%2C3.8%2C1.4%2C6.5%2C4.1%2C8.1c2.7%2C1.6%2C8.9%2C3.2%2C18.6%2C4.9%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc9.7%2C1.7%2C16.5%2C4%2C20.5%2C7.1c4%2C3%2C6%2C8.7%2C6%2C17.1c0%2C8.4-2.7%2C14.5-8.1%2C18.4c-5.4%2C3.9-13.2%2C5.9-23.6%2C5.9c-6.7%2C0-29.2-2.5-29.2-2.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bl0.7-10.6c12.9%2C1.2%2C22.3%2C2.2%2C28.6%2C2.2c6.3%2C0%2C11.1-1%2C14.4-3c3.3-2%2C5-5.4%2C5-10.1c0-4.7-1.4-7.9-4.2-9.6c-2.8-1.7-9-3.3-18.6-4.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-9.6-1.5-16.4-3.7-20.4-6.7c-4-2.9-6-8.4-6-16.3c0-7.9%2C2.8-13.8%2C8.4-17.6c5.6-3.8%2C12.6-5.7%2C20.9-5.7c6.6%2C0%2C29.6%2C1.7%2C29.6%2C1.7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bv10.7C508.1%2C99%2C498.2%2C98.2%2C491.2%2C98.2z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M581.7%2C99.5h-25.9v39c0%2C9.3%2C0.7%2C15.5%2C2%2C18.4c1.4%2C2.9%2C4.6%2C4.4%2C9.7%2C4.4l14.5-1l0.8%2C10.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.3%2C1.2-12.8%2C1.8-16.6%2C1.8c-8.5%2C0-14.3-2.1-17.6-6.2c-3.3-4.1-4.9-12-4.9-23.6V99.5h-11.6V88.9h11.6V63.9h12.1v24.9h25.9V99.5z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M598.7%2C78.4V64.3h12.2v14.2H598.7z%20M598.7%2C171.4V88.9h12.2v82.5H598.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M663.8%2C87.2c3.6%2C0%2C9.7%2C0.7%2C18.3%2C2l3.9%2C0.5l-0.5%2C9.9c-8.7-1-15.1-1.5-19.2-1.5c-9.2%2C0-15.5%2C2.2-18.8%2C6.6%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.3%2C4.4-5%2C12.6-5%2C24.5c0%2C11.9%2C1.5%2C20.2%2C4.6%2C24.9c3.1%2C4.7%2C9.5%2C7%2C19.3%2C7l19.2-1.5l0.5%2C10.1c-10.1%2C1.5-17.7%2C2.3-22.7%2C2.3%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-12.7%2C0-21.5-3.3-26.3-9.8c-4.8-6.5-7.3-17.5-7.3-33c0-15.5%2C2.6-26.4%2C7.8-32.6C643%2C90.4%2C651.7%2C87.2%2C663.8%2C87.2z%22%2F%3E%0A%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M236.6%2C123.5c0-19.8-12.3-37.2-30.8-43.9c0.8-4.2%2C1.2-8.4%2C1.2-12.7C207%2C30%2C177%2C0%2C140.2%2C0%26%2310%3B%26%239%3B%26%239%3BC118.6%2C0%2C98.6%2C10.3%2C86%2C27.7c-6.2-4.8-13.8-7.4-21.7-7.4c-19.6%2C0-35.5%2C15.9-35.5%2C35.5c0%2C4.3%2C0.8%2C8.5%2C2.2%2C12.4%26%2310%3B%26%239%3B%26%239%3BC12.6%2C74.8%2C0%2C92.5%2C0%2C112.2c0%2C19.9%2C12.4%2C37.3%2C30.9%2C44c-0.8%2C4.1-1.2%2C8.4-1.2%2C12.7c0%2C36.8%2C29.9%2C66.7%2C66.7%2C66.7%26%2310%3B%26%239%3B%26%239%3Bc21.6%2C0%2C41.6-10.4%2C54.1-27.8c6.2%2C4.9%2C13.8%2C7.6%2C21.7%2C7.6c19.6%2C0%2C35.5-15.9%2C35.5-35.5c0-4.3-0.8-8.5-2.2-12.4%26%2310%3B%26%239%3B%26%239%3BC223.9%2C160.9%2C236.6%2C143.2%2C236.6%2C123.5z%20M91.6%2C34.8c10.9-15.9%2C28.9-25.4%2C48.1-25.4c32.2%2C0%2C58.4%2C26.2%2C58.4%2C58.4%26%2310%3B%26%239%3B%26%239%3Bc0%2C3.9-0.4%2C7.7-1.1%2C11.5l-52.2%2C45.8L93%2C101.5L82.9%2C79.9L91.6%2C34.8z%20M65.4%2C29c6.2%2C0%2C12.1%2C2%2C17%2C5.7l-7.8%2C40.3l-35.5-8.4%26%2310%3B%26%239%3B%26%239%3Bc-1.1-3.1-1.7-6.3-1.7-9.7C37.4%2C41.6%2C49.9%2C29%2C65.4%2C29z%20M9.1%2C112.3c0-16.7%2C11-31.9%2C26.9-37.2L75%2C84.4l9.1%2C19.5l-49.8%2C45%26%2310%3B%26%239%3B%26%239%3BC19.2%2C143.1%2C9.1%2C128.6%2C9.1%2C112.3z%20M145.2%2C200.9c-10.9%2C16.1-29%2C25.6-48.4%2C25.6c-32.3%2C0-58.6-26.3-58.6-58.5c0-4%2C0.4-7.9%2C1.1-11.7%26%2310%3B%26%239%3B%26%239%3Bl50.9-46l52%2C23.7l11.5%2C22L145.2%2C200.9z%20M171.2%2C206.6c-6.1%2C0-12-2-16.9-5.8l7.7-40.2l35.4%2C8.3c1.1%2C3.1%2C1.7%2C6.3%2C1.7%2C9.7%26%2310%3B%26%239%3B%26%239%3BC199.2%2C194.1%2C186.6%2C206.6%2C171.2%2C206.6z%20M200.5%2C160.5l-39-9.1l-10.4-19.8l51-44.7c15.1%2C5.7%2C25.2%2C20.2%2C25.2%2C36.5%26%2310%3B%26%239%3B%26%239%3BC227.4%2C140.1%2C216.4%2C155.3%2C200.5%2C160.5z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E +------------ + +*Returns:* `render` + + +[float] +[[replace_fn]] +=== `replace` + +Uses a regular expression to replace parts of a string. + +*Accepts:* `string` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `pattern`, `regex` +|`string` +|The text or pattern of a JavaScript regular expression. For example, `"[aeiou]"`. +You can use capturing groups here. + +|`flags` + +Alias: `modifiers` +|`datatable` +|Specify flags. See the +https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp[RegExp documentation] +for reference + +Default: `"g"` + +|`replacement` +|`string` +|The replacement for the matching parts of `string`. Capturing groups can be accessed +by their index. For example, `$1`. + +Default: `""` +|=== + +*Returns:* `string` + + +[float] +[[revealImage_fn]] +=== `revealImage` + +Configures an image reveal element. + +*Accepts:* `number` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`image` +|`string` +|The image to reveal. Provide an image asset as a `base64` data URL, or pass in a sub-expression. + +|`emptyImage` +|`string` +|An optional background image to reveal over. Provide an image asset as a `base64` data URL, or pass in a sub-expression. + +|`origin` +|`string` +|The position to start the image fill. For example, `"top"`, `"left"`, `"bottom"`, or `"right"` + +Default: `"bottom"` +|=== + + +Example value for the `image` argument, formatted as a `base64` data URL: +[source, url] +------------ +data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0A%3Csvg%20viewBox%3D%22-3.948730230331421%20-1.7549896240234375%20245.25946044921875%20241.40370178222656%22%20width%3D%22245.25946044921875%22%20height%3D%22241.40370178222656%22%20style%3D%22enable-background%3Anew%200%200%20686.2%20235.7%3B%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cdefs%3E%0A%20%20%20%20%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%09.st0%7Bfill%3A%232D2D2D%3B%7D%0A%3C%2Fstyle%3E%0A%20%20%3C%2Fdefs%3E%0A%20%20%3Cg%20transform%3D%22matrix%281%2C%200%2C%200%2C%201%2C%200%2C%200%29%22%3E%0A%20%20%20%20%3Cg%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M329.4%2C160.3l4.7-0.5l0.3%2C9.6c-12.4%2C1.7-23%2C2.6-31.8%2C2.6c-11.7%2C0-20-3.4-24.9-10.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-4.9-6.8-7.3-17.4-7.3-31.7c0-28.6%2C11.4-42.9%2C34.1-42.9c11%2C0%2C19.2%2C3.1%2C24.6%2C9.2c5.4%2C6.1%2C8.1%2C15.8%2C8.1%2C28.9l-0.7%2C9.3h-53.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0%2C9%2C1.6%2C15.7%2C4.9%2C20c3.3%2C4.3%2C8.9%2C6.5%2C17%2C6.5C312.8%2C161.2%2C321.1%2C160.9%2C329.4%2C160.3z%20M325%2C124.9c0-10-1.6-17.1-4.8-21.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.2-4.1-8.4-6.2-15.6-6.2c-7.2%2C0-12.7%2C2.2-16.3%2C6.5c-3.6%2C4.3-5.5%2C11.3-5.6%2C20.9H325z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M354.3%2C171.4V64h12.2v107.4H354.3z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M443.5%2C113.5v41.1c0%2C4.1%2C10.1%2C3.9%2C10.1%2C3.9l-0.6%2C10.8c-8.6%2C0-15.7%2C0.7-20-3.4c-9.8%2C4.3-19.5%2C6.1-29.3%2C6.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.5%2C0-13.2-2.1-17.1-6.4c-3.9-4.2-5.9-10.3-5.9-18.3c0-7.9%2C2-13.8%2C6-17.5c4-3.7%2C10.3-6.1%2C18.9-6.9l25.6-2.4v-7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc0-5.5-1.2-9.5-3.6-11.9c-2.4-2.4-5.7-3.6-9.8-3.6l-32.1%2C0V87.2h31.3c9.2%2C0%2C15.9%2C2.1%2C20.1%2C6.4C441.4%2C97.8%2C443.5%2C104.5%2C443.5%2C113.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bz%20M393.3%2C146.7c0%2C10%2C4.1%2C15%2C12.4%2C15c7.4%2C0%2C14.7-1.2%2C21.8-3.7l3.7-1.3v-26.9l-24.1%2C2.3c-4.9%2C0.4-8.4%2C1.8-10.6%2C4.2%26%2310%3B%26%239%3B%26%239%3B%26%239%3BC394.4%2C138.7%2C393.3%2C142.2%2C393.3%2C146.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M491.2%2C98.2c-11.8%2C0-17.8%2C4.1-17.8%2C12.4c0%2C3.8%2C1.4%2C6.5%2C4.1%2C8.1c2.7%2C1.6%2C8.9%2C3.2%2C18.6%2C4.9%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc9.7%2C1.7%2C16.5%2C4%2C20.5%2C7.1c4%2C3%2C6%2C8.7%2C6%2C17.1c0%2C8.4-2.7%2C14.5-8.1%2C18.4c-5.4%2C3.9-13.2%2C5.9-23.6%2C5.9c-6.7%2C0-29.2-2.5-29.2-2.5%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bl0.7-10.6c12.9%2C1.2%2C22.3%2C2.2%2C28.6%2C2.2c6.3%2C0%2C11.1-1%2C14.4-3c3.3-2%2C5-5.4%2C5-10.1c0-4.7-1.4-7.9-4.2-9.6c-2.8-1.7-9-3.3-18.6-4.8%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-9.6-1.5-16.4-3.7-20.4-6.7c-4-2.9-6-8.4-6-16.3c0-7.9%2C2.8-13.8%2C8.4-17.6c5.6-3.8%2C12.6-5.7%2C20.9-5.7c6.6%2C0%2C29.6%2C1.7%2C29.6%2C1.7%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bv10.7C508.1%2C99%2C498.2%2C98.2%2C491.2%2C98.2z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M581.7%2C99.5h-25.9v39c0%2C9.3%2C0.7%2C15.5%2C2%2C18.4c1.4%2C2.9%2C4.6%2C4.4%2C9.7%2C4.4l14.5-1l0.8%2C10.1%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-7.3%2C1.2-12.8%2C1.8-16.6%2C1.8c-8.5%2C0-14.3-2.1-17.6-6.2c-3.3-4.1-4.9-12-4.9-23.6V99.5h-11.6V88.9h11.6V63.9h12.1v24.9h25.9V99.5z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M598.7%2C78.4V64.3h12.2v14.2H598.7z%20M598.7%2C171.4V88.9h12.2v82.5H598.7z%22%2F%3E%0A%20%20%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M663.8%2C87.2c3.6%2C0%2C9.7%2C0.7%2C18.3%2C2l3.9%2C0.5l-0.5%2C9.9c-8.7-1-15.1-1.5-19.2-1.5c-9.2%2C0-15.5%2C2.2-18.8%2C6.6%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-3.3%2C4.4-5%2C12.6-5%2C24.5c0%2C11.9%2C1.5%2C20.2%2C4.6%2C24.9c3.1%2C4.7%2C9.5%2C7%2C19.3%2C7l19.2-1.5l0.5%2C10.1c-10.1%2C1.5-17.7%2C2.3-22.7%2C2.3%26%2310%3B%26%239%3B%26%239%3B%26%239%3Bc-12.7%2C0-21.5-3.3-26.3-9.8c-4.8-6.5-7.3-17.5-7.3-33c0-15.5%2C2.6-26.4%2C7.8-32.6C643%2C90.4%2C651.7%2C87.2%2C663.8%2C87.2z%22%2F%3E%0A%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%3Cpath%20class%3D%22st0%22%20d%3D%22M236.6%2C123.5c0-19.8-12.3-37.2-30.8-43.9c0.8-4.2%2C1.2-8.4%2C1.2-12.7C207%2C30%2C177%2C0%2C140.2%2C0%26%2310%3B%26%239%3B%26%239%3BC118.6%2C0%2C98.6%2C10.3%2C86%2C27.7c-6.2-4.8-13.8-7.4-21.7-7.4c-19.6%2C0-35.5%2C15.9-35.5%2C35.5c0%2C4.3%2C0.8%2C8.5%2C2.2%2C12.4%26%2310%3B%26%239%3B%26%239%3BC12.6%2C74.8%2C0%2C92.5%2C0%2C112.2c0%2C19.9%2C12.4%2C37.3%2C30.9%2C44c-0.8%2C4.1-1.2%2C8.4-1.2%2C12.7c0%2C36.8%2C29.9%2C66.7%2C66.7%2C66.7%26%2310%3B%26%239%3B%26%239%3Bc21.6%2C0%2C41.6-10.4%2C54.1-27.8c6.2%2C4.9%2C13.8%2C7.6%2C21.7%2C7.6c19.6%2C0%2C35.5-15.9%2C35.5-35.5c0-4.3-0.8-8.5-2.2-12.4%26%2310%3B%26%239%3B%26%239%3BC223.9%2C160.9%2C236.6%2C143.2%2C236.6%2C123.5z%20M91.6%2C34.8c10.9-15.9%2C28.9-25.4%2C48.1-25.4c32.2%2C0%2C58.4%2C26.2%2C58.4%2C58.4%26%2310%3B%26%239%3B%26%239%3Bc0%2C3.9-0.4%2C7.7-1.1%2C11.5l-52.2%2C45.8L93%2C101.5L82.9%2C79.9L91.6%2C34.8z%20M65.4%2C29c6.2%2C0%2C12.1%2C2%2C17%2C5.7l-7.8%2C40.3l-35.5-8.4%26%2310%3B%26%239%3B%26%239%3Bc-1.1-3.1-1.7-6.3-1.7-9.7C37.4%2C41.6%2C49.9%2C29%2C65.4%2C29z%20M9.1%2C112.3c0-16.7%2C11-31.9%2C26.9-37.2L75%2C84.4l9.1%2C19.5l-49.8%2C45%26%2310%3B%26%239%3B%26%239%3BC19.2%2C143.1%2C9.1%2C128.6%2C9.1%2C112.3z%20M145.2%2C200.9c-10.9%2C16.1-29%2C25.6-48.4%2C25.6c-32.3%2C0-58.6-26.3-58.6-58.5c0-4%2C0.4-7.9%2C1.1-11.7%26%2310%3B%26%239%3B%26%239%3Bl50.9-46l52%2C23.7l11.5%2C22L145.2%2C200.9z%20M171.2%2C206.6c-6.1%2C0-12-2-16.9-5.8l7.7-40.2l35.4%2C8.3c1.1%2C3.1%2C1.7%2C6.3%2C1.7%2C9.7%26%2310%3B%26%239%3B%26%239%3BC199.2%2C194.1%2C186.6%2C206.6%2C171.2%2C206.6z%20M200.5%2C160.5l-39-9.1l-10.4-19.8l51-44.7c15.1%2C5.7%2C25.2%2C20.2%2C25.2%2C36.5%26%2310%3B%26%239%3B%26%239%3BC227.4%2C140.1%2C216.4%2C155.3%2C200.5%2C160.5z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E +------------ + +*Returns:* `render` + + +[float] +[[rounddate_fn]] +=== `rounddate` + +Uses a MomentJS formatting string to round milliseconds since epoch, and returns milliseconds since epoch. + +*Accepts:* `number` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `format` +|`string` +|The MomentJS Format to use for bucketing. For example, `"YYYY-MM"` rounds to months. See https://momentjs.com/docs/#/displaying/. +|=== + +*Returns:* `number` + + +[float] +[[rowCount_fn]] +=== `rowCount` + +Returns the number of rows. Pairs with `<>` to get the count of unique column values, or combinations of unique column values. + +*Accepts:* `datatable` + +*Returns:* `number` + +[float] +[[s_fns]] +== S +[[seriesStyle_fn]] +=== `seriesStyle` + +Creates an object used for describing the properties of a series on a chart. Use <> inside of a charting function, like <> or <>. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`label` +|`string` +|The name of the series to style. + +|`color` +|`string` +|The line color. + +|`lines` +|`number` +|The width of the line. + +|`bars` +|`number` +|The width of bars. + +|`points` +|`number` +|The size of points on line. + +|`fill` +|`number`, `boolean` +|Should we fill in the points? + +Default: `false` + +|`stack` +|`number`, `null` +|Specifies if the series should be stacked. The number is the stack ID. Series with the same stack ID are stacked together. + +|`horizontalBars` +|`boolean` +|Sets the orientation of the bars in the chart to horizontal. + +Default: `false` +|=== + +*Returns:* `seriesStyle` + + +[float] +[[shape_fn]] +=== `shape` + +Creates a shape. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `shape` +|`string` +|Pick a shape + +Default: `"square"` + +|`border` + +Alias `stroke` +|`number` +|An SVG color for the border outlining the shape. + +|`borderWidth` + +Alias: `strokeWidth` +|`number` +|The thickness of the border + +Default: `0` + +|`fill` +|`string` +|An SVG color to fill the shape. + +Default: `"black"` + +|`maintainAspect` +|`boolean` +|Maintain the shape's original aspect ratio? + +Default: `false` +|=== + +*Returns:* shape + + +[float] +[[sort_fn]] +=== `sort` + +Sorts a `datatable` by the specified column. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Alias: `column` +|`string` +|The column to sort by. When unspecified, the `datatable` is sorted by the first column. + +|`reverse` +|`boolean` +|Reverse the sorting order? When unspecified, the `datatable` is sorted in ascending order. + +Default: `false` +|=== + +*Returns:* `datatable` + + +[float] +[[staticColumn_fn]] +=== `staticColumn` + +Adds a column with the same static value in every row. See also <> and <>. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `column`, `name` +|`string` +|The name of the new column. + +|`value` +|`string`, `number`, `boolean`, `null` +|The value to insert in each row in the new column. Tip: use a sub-expression to rollup other columns into a static value. + +Default: `null` +|=== + +*Returns:* `datatable` + + +[float] +[[string_fn]] +=== `string` + +Concatenates all of the arguments into a single string. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** *†* + +Alias: `value` +|`string`, `number`, `boolean` +|The values to join together into one string. Include spaces where needed. +|=== + +*Returns:* `string` + + +[float] +[[switch_fn]] +=== `switch` + +Performs conditional logic with multiple conditions. See also <>, which builds a `case` to pass to the <> function. + +*Accepts:* `any` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** *†* + +Alias: `case` +|`case` +|The conditions to check. + +|`default` + +Alias: `finally` +|`any` +|The value returned when no conditions are met. When unspecified and no conditions are met, the original _context_ is returned. +|=== + +*Returns:* Depends on your arguments + + +[float] +[[t_fns]] +== T +[[table_fn]] +=== `table` + +Configures a table element. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`font` +|`style` +|The CSS font properties for the contents of the table. For example, `font-family` or `font-weight`. + +Default: `{<>}` + +|`paginate` +|`boolean` +|Show pagination controls? When `false`, only the first page is displayed. + +Default: `true` + +|`perPage` +|`number` +|The number of rows to display on each page. + +Default: `10` + +|`showHeader` +|`boolean` +|Show or hide the header row with titles for each column. + +Default: `true` +|=== + +*Returns:* `render` + + +[float] +[[tail_fn]] +=== `tail` + +Retrieves the last N rows from the end of a `datatable`. See also <>. + +*Accepts:* `datatable` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `count` +|`number` +|The number of rows to retrieve from the end of the datatable. +|=== + +*Returns:* `datatable` + + +[float] +[[timefilter_fn]] +=== `timefilter` + +Creates a time filter for querying a source. + +*Accepts:* `filter` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`column` + +Alias: `field`, `c` +|`string` +|The column or field that you want to filter. + +Default: `"@timestamp"` + +|`from` + +Alias: `f`, `start` +|`string` +|The beginning of the range, in ISO8601 or {es} `datemath` format + +|`to` + +Alias: `t`, `end` +|`string` +|The end of the range, in ISO8601 or {es} `datemath` format + +|`filterGroup` +|`string` +|The group name for the filter +|=== + +*Returns:* `filter` + + +[float] +[[timefilterControl_fn]] +=== `timefilterControl` + +Configures a time filter control element. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|`column` + +Alias: `field`, `c` +|`string` +|The column or field that you want to filter. + +Default: `"@timestamp"` + +|`compact` +|`boolean` +|Shows the time filter as a button, which triggers a popover. + +Default: `true` + +|`filterGroup` +|`string` +|The group name for the filter. +|=== + + +*Returns:* `render` + + +[float] +[[timelion_fn]] +=== `timelion` + +Uses Timelion to extract one or more time series from many sources. + +*Accepts:* `filter` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ + +Aliases: `q`, `query` +|`string` +|A Timelion query + +Default: `".es(*)"` + +|`interval` +|`string` +|The bucket interval for the time series + +Default: `"auto"` + +|`from` +|`string` +|The {es} `datemath` string for the beginning of the time range. + +Default: `"now-1y"` + +|`to` +|`string` +|The {es} `datemath` string for the end of the time range. + +Default: `"now"` + +|`timezone` +|`string` +|The timezone for the time range. See [Moment Timezone](https://momentjs.com/timezone/). + +Default: `"UTC"` +|=== + +*Returns:* `datatable` + + +[float] +[[to_fn]] +=== `to` + +Explicitly casts the type of the _context_ from one type to the specified type. + +*Accepts:* `any` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Alias: `type` +|`string` +|A known type +|=== + +*Returns:* Depends on your input and arguments + + +[float] +[[u_fns]] +== U +[[urlparam_fn]] +=== `urlparam` + +Retrieves a URL parameter to use in an expression. The <> function always returns a `string`. For example, you can retrieve the value `"20"` from the parameter `myVar` from the URL `https://localhost:5601/app/canvas?myVar=20`. + +*Accepts:* `null` + +[cols="3*^<"] +|=== +|Argument |Type |Description + +|_Unnamed_ *** + +Aliases: `var`, `variable` +|`string` +|The URL hash parameter to retrieve. + +|`default` +|`string` +|The string returned when the URL parameter is unspecified. + +Default: `""` +|=== + +*Returns:* `string` -The Canvas expression language also supports <>, which -perform complex math calculations. diff --git a/docs/canvas/canvas-server-functions.asciidoc b/docs/canvas/canvas-server-functions.asciidoc deleted file mode 100644 index b765476898b3e..0000000000000 --- a/docs/canvas/canvas-server-functions.asciidoc +++ /dev/null @@ -1,199 +0,0 @@ -[role="xpack"] -[[canvas-server-functions]] -=== Canvas server functions - -These functions can only execute on the server. This may be for performance -or security reasons, or because the function uses an API only available on the -{kib} server. If the expression is executing in the browser, it will transfer to -the server when it hits one of these functions. - -A *** denotes a required argument. - -[float] -=== demodata - -A mock data set that includes project CI times with usernames, countries, and run phases. - -*Accepts:* filter - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_ (Alias: `type`) -|string -|The name of the demo data set to use (default: `ci`) -|=== - -*Returns:* datatable - - -[float] -=== esdocs - -Queries {es} and gets back raw documents. Specify the fields you want to receive, -especially if you are asking for a lot of rows. - -*Accepts:* filter - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|index -|string -|Specify an index pattern, for example, "logstash-*" (default is `_all`) - -|_Unnamed_ (Aliases: `query`, `q`) -|string -|A Lucene query string (default: `_index:.kibana`) - -|sort -|string -|Sort directions as "field, direction", for example, "@timestamp, desc" or "bytes, asc" - -|fields -|string -|Comma separated list of fields. Fewer fields will perform better - -|metaFields -|string -|Comma separated list of meta fields, for example, "_index,_type" - -|count -|number -|The number of docs to pull back. Smaller numbers perform better (default: `100`) -|=== - -*Returns:* datatable - - -[float] -=== escount - -Queries {es} for a count of the number of hits matching a query. - -*Accepts:* filter - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|index -|string -|Specify an index pattern, for example, "logstash-*" (default: `all`) - -|_Unnamed_ (Alias: `query`, `q`) -|string -|A Lucene query string (default: `"-_index:.kibana"`) -|=== - -*Returns:* number - - -[float] -=== essql - -Specifies an {es} SQL. - -*Accepts:* filter - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_* (Alias: `query`, `q`) -|string -|An SQL query - -|count -|number -|The default is `1000` -|=== - -*Returns:* datatable - - -[float] -=== pointseries - -Turns a datatable into a point series model. Currently Canvas differentiates measure -from dimensions by looking for a <>. If you enter a TinyMath -expression in your argument, Canvas treats that argument as a measure. Otherwise, it -is a dimension. Dimensions are combined to create unique keys. Measures are -then deduplicated by those keys using the specified TinyMath function. - -*Accepts:* datatable - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|x -|string -|The values along the X-axis - -|y -|string -|The values along the Y-axis - -|color -|string -|An expression to use in determining the mark's color - -|size -|string -|For elements that support it, the size of the marks - -|text -|string -|For use in charts that support it, the text to show in the mark -|=== - -*Returns:* pointseries - - -[float] -=== server - -Forces the interpreter to return to the server. - -*Accepts:* Anything or nothing - -*Returns:* Depends on your input and arguments -  - -[float] -=== timelion - -Uses Timelion to extract one or more time series from many sources. - -*Accepts:* filter - -[cols="3*^<"] -|=== -|Argument |Type |Description - -|_Unnamed_ (Aliases: `query`, `q`) -|string -|A Timelion query (default: `".es(*)"`) - -|interval -|string -|Bucket interval for the time series (default: `auto`) - -|from -|any -|{es} date math string for the start of the time range (default: `now-1y`) - -|to -|any -|{es} date math string for the end of the time range (default: `now`) - -|timezone -|any -|Time zone for the time range (default: `UTC`) -|=== - -*Returns:* datatable - diff --git a/src/legacy/core_plugins/interpreter/public/functions/font.ts b/src/legacy/core_plugins/interpreter/public/functions/font.ts index a63b28c40938c..6f4097f22c3c0 100644 --- a/src/legacy/core_plugins/interpreter/public/functions/font.ts +++ b/src/legacy/core_plugins/interpreter/public/functions/font.ts @@ -49,7 +49,7 @@ export function font(): ExpressionFunction<'font', null, Arguments, Style> { aliases: [], type: 'style', help: i18n.translate('interpreter.functions.fontHelpText', { - defaultMessage: 'Create a font style', + defaultMessage: 'Create a font style.', }), context: { types: ['null'], @@ -58,14 +58,14 @@ export function font(): ExpressionFunction<'font', null, Arguments, Style> { align: { default: 'left', help: i18n.translate('interpreter.functions.font.args.alignHelpText', { - defaultMessage: 'Horizontal text alignment', + defaultMessage: 'The horizontal text alignment.', }), options: Object.values(TextAlignment), types: ['string'], }, color: { help: i18n.translate('interpreter.functions.font.args.colorHelpText', { - defaultMessage: 'Text color', + defaultMessage: 'The text color.', }), types: ['string'], }, @@ -82,7 +82,7 @@ export function font(): ExpressionFunction<'font', null, Arguments, Style> { italic: { default: false, help: i18n.translate('interpreter.functions.font.args.italicHelpText', { - defaultMessage: 'Italicize, true or false', + defaultMessage: 'Italicize the text?', }), options: [true, false], types: ['boolean'], @@ -90,27 +90,21 @@ export function font(): ExpressionFunction<'font', null, Arguments, Style> { lHeight: { aliases: ['lineHeight'], help: i18n.translate('interpreter.functions.font.args.lHeightHelpText', { - defaultMessage: 'Line height ({px})', - values: { - px: 'px', - }, + defaultMessage: 'The line height in pixels', }), types: ['number', 'null'], }, size: { default: 14, help: i18n.translate('interpreter.functions.font.args.sizeHelpText', { - defaultMessage: 'Font size ({px})', - values: { - px: 'px', - }, + defaultMessage: 'The font size in pixels', }), types: ['number'], }, underline: { default: false, help: i18n.translate('interpreter.functions.font.args.underlineHelpText', { - defaultMessage: 'Underline the text, true or false', + defaultMessage: 'Underline the text?', }), options: [true, false], types: ['boolean'], @@ -118,9 +112,13 @@ export function font(): ExpressionFunction<'font', null, Arguments, Style> { weight: { default: 'normal', help: i18n.translate('interpreter.functions.font.args.weightHelpText', { - defaultMessage: 'Set the font weight, e.g. {examples}', + defaultMessage: 'The font weight. For example, {list}, or {end}.', values: { - examples: Object.values(FontWeight).join(', '), + list: Object.values(FontWeight) + .slice(0, -1) + .map(weight => `\`"${weight}"\``) + .join(', '), + end: `\`"${Object.values(FontWeight).slice(-1)[0]}"\``, }, }), options: Object.values(FontWeight), diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/alterColumn.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/alterColumn.ts index 57bd07c7c34f7..fefa404e55c81 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/alterColumn.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/alterColumn.ts @@ -33,15 +33,15 @@ export function alterColumn(): ExpressionFunction<'alterColumn', Datatable, Argu required: true, help: argHelp.column, }, + name: { + types: ['string'], + help: argHelp.name, + }, type: { types: ['string'], help: argHelp.type, options: ['null', 'boolean', 'number', 'string', 'date'], }, - name: { - types: ['string'], - help: argHelp.name, - }, }, fn: (context, args) => { if (!args.column || (!args.type && !args.name)) { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/axisConfig.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/axisConfig.ts index d9ba6b68eb6e1..a65d451c6fadf 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/axisConfig.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/axisConfig.ts @@ -29,15 +29,18 @@ export function axisConfig(): ExpressionFunction<'axisConfig', null, Arguments, name: 'axisConfig', aliases: [], type: 'axisConfig', + help, context: { types: ['null'], }, - help, args: { - show: { - types: ['boolean'], - help: argHelp.show, - default: true, + max: { + types: ['number', 'string', 'null'], + help: argHelp.max, + }, + min: { + types: ['number', 'string', 'null'], + help: argHelp.min, }, position: { types: ['string'], @@ -45,13 +48,10 @@ export function axisConfig(): ExpressionFunction<'axisConfig', null, Arguments, options: Object.values(Position), default: 'left', }, - min: { - types: ['number', 'string', 'null'], - help: argHelp.min, - }, - max: { - types: ['number', 'string', 'null'], - help: argHelp.max, + show: { + types: ['boolean'], + help: argHelp.show, + default: true, }, tickSize: { types: ['number', 'null'], diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/columns.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/columns.ts index 2b2406941a0de..a47b2f86a9c19 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/columns.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/columns.ts @@ -26,6 +26,7 @@ export function columns(): ExpressionFunction<'columns', Datatable, Arguments, D }, args: { include: { + aliases: ['_'], types: ['string'], help: argHelp.include, }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.ts index f9aba3379665e..7a5451a202f4e 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/containerStyle.ts @@ -25,24 +25,12 @@ export function containerStyle(): ExpressionFunction< return { name: 'containerStyle', aliases: [], + type: 'containerStyle', + help, context: { types: ['null'], }, - type: 'containerStyle', - help, args: { - border: { - types: ['string'], - help: argHelp.border, - }, - borderRadius: { - types: ['string'], - help: argHelp.borderRadius, - }, - padding: { - types: ['string'], - help: argHelp.padding, - }, backgroundColor: { types: ['string'], help: argHelp.backgroundColor, @@ -51,17 +39,25 @@ export function containerStyle(): ExpressionFunction< types: ['string'], help: argHelp.backgroundImage, }, + backgroundRepeat: { + types: ['string'], + help: argHelp.backgroundRepeat, + default: 'no-repeat', + options: Object.values(BackgroundRepeat), + }, backgroundSize: { types: ['string'], help: argHelp.backgroundSize, default: 'contain', options: Object.values(BackgroundSize), }, - backgroundRepeat: { + border: { types: ['string'], - help: argHelp.backgroundRepeat, - default: 'no-repeat', - options: Object.values(BackgroundRepeat), + help: argHelp.border, + }, + borderRadius: { + types: ['string'], + help: argHelp.borderRadius, }, opacity: { types: ['number'], @@ -73,6 +69,10 @@ export function containerStyle(): ExpressionFunction< options: Object.values(Overflow), default: 'hidden', }, + padding: { + types: ['string'], + help: argHelp.padding, + }, }, fn: (_context, args) => { const { backgroundImage, backgroundSize, backgroundRepeat, ...remainingArgs } = args; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/date.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/date.ts index f45c9dd205844..b20b92c22e2c2 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/date.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/date.ts @@ -20,10 +20,10 @@ export function date(): ExpressionFunction<'date', null, Arguments, number> { return { name: 'date', type: 'number', + help, context: { types: ['null'], }, - help, args: { value: { aliases: ['_'], diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/exactly.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/exactly.ts index 17a6bad828183..773b5459f5aa7 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/exactly.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/exactly.ts @@ -20,10 +20,10 @@ export function exactly(): ExpressionFunction<'exactly', Filter, Arguments, Filt name: 'exactly', aliases: [], type: 'filter', + help, context: { types: ['filter'], }, - help, args: { column: { types: ['string'], diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/filterrows.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/filterrows.ts index 7759ca4e6496c..d14b93851eb45 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/filterrows.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/filterrows.ts @@ -23,10 +23,10 @@ export function filterrows(): ExpressionFunction< name: 'filterrows', aliases: [], type: 'datatable', + help, context: { types: ['datatable'], }, - help, args: { fn: { resolve: false, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/join_rows.test.js b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/join_rows.test.js similarity index 89% rename from x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/join_rows.test.js rename to x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/join_rows.test.js index 83eae7e44a75c..0e2d902eda086 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/__tests__/join_rows.test.js +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/join_rows.test.js @@ -4,10 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ -import { joinRows } from '../join_rows'; -import { functionWrapper } from '../../../../__tests__/helpers/function_wrapper'; -import { getFunctionErrors } from '../../../strings/functions'; -import { testTable } from './fixtures/test_tables'; +import { functionWrapper } from '../../../__tests__/helpers/function_wrapper'; +import { getFunctionErrors } from '../../strings'; +import { testTable } from './__tests__/fixtures/test_tables'; +import { joinRows } from './join_rows'; const errors = getFunctionErrors().joinRows; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/join_rows.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/join_rows.ts index 642e441ff7ca1..283a269c9e502 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/join_rows.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/join_rows.ts @@ -40,21 +40,21 @@ export function joinRows(): ExpressionFunction<'joinRows', Datatable, Arguments, required: true, help: argHelp.column, }, - separator: { - aliases: ['sep'], - types: ['string'], - default: ',', - help: argHelp.separator, + distinct: { + types: ['boolean'], + help: argHelp.distinct, + default: true, }, quote: { types: ['string'], - default: `"'"`, help: argHelp.quote, + default: `"'"`, }, - distinct: { - types: ['boolean'], - default: true, - help: argHelp.distinct, + separator: { + aliases: ['sep', 'delimiter'], + types: ['string'], + help: argHelp.separator, + default: ',', }, }, fn: (context, { column, separator, quote, distinct }) => { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lt.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lt.ts index d7a0ffd410dc3..474591a40f881 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lt.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lt.ts @@ -37,7 +37,6 @@ export function lt(): ExpressionFunction<'lt', Context, Arguments, boolean> { return false; } - // @ts-ignore #35433 This is a wonky comparison for nulls return context < value; }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lte.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lte.ts index 7e965a8514230..7e8f36d3c8a3c 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lte.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/lte.ts @@ -37,7 +37,6 @@ export function lte(): ExpressionFunction<'lte', Context, Arguments, boolean> { return false; } - // @ts-ignore #35433 This is a wonky comparison for nulls return context <= value; }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/pie.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/pie.ts index a59aefb46d0b9..a406483df7247 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/pie.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/pie.ts @@ -82,41 +82,25 @@ export function pie(): ExpressionFunction<'pie', PointSeries, Arguments, Render< types: ['pointseries'], }, args: { - palette: { - types: ['palette'], - help: argHelp.palette, - default: '{palette}', - }, - seriesStyle: { - multi: true, - types: ['seriesStyle'], - help: argHelp.seriesStyle, - }, - radius: { - types: ['string', 'number'], - help: argHelp.radius, - default: 'auto', + font: { + types: ['style'], + help: argHelp.font, + default: '{font}', }, hole: { types: ['number'], default: 0, help: argHelp.hole, }, - labels: { - types: ['boolean'], - default: true, - help: argHelp.labels, - options: [true, false], - }, labelRadius: { types: ['number'], default: 100, help: argHelp.labelRadius, }, - font: { - types: ['style'], - help: argHelp.font, - default: '{font}', + labels: { + types: ['boolean'], + default: true, + help: argHelp.labels, }, legend: { types: ['string', 'boolean'], @@ -124,6 +108,21 @@ export function pie(): ExpressionFunction<'pie', PointSeries, Arguments, Render< default: false, options: Object.values(Legend).concat(false), }, + palette: { + types: ['palette'], + help: argHelp.palette, + default: '{palette}', + }, + radius: { + types: ['string', 'number'], + help: argHelp.radius, + default: 'auto', + }, + seriesStyle: { + multi: true, + types: ['seriesStyle'], + help: argHelp.seriesStyle, + }, tilt: { types: ['number'], default: 1, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/index.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/index.ts index 6a3a5a1e8c2b4..981c9a7a706fd 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/index.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/plot/index.ts @@ -41,22 +41,12 @@ export function plot(): ExpressionFunction<'plot', PointSeries, Arguments, Rende types: ['pointseries'], }, args: { - seriesStyle: { - multi: true, - types: ['seriesStyle'], - help: argHelp.seriesStyle, - }, defaultStyle: { multi: false, types: ['seriesStyle'], help: argHelp.defaultStyle, default: '{seriesStyle points=5}', }, - palette: { - types: ['palette'], - help: argHelp.palette, - default: '{palette}', - }, font: { types: ['style'], help: argHelp.font, @@ -68,16 +58,26 @@ export function plot(): ExpressionFunction<'plot', PointSeries, Arguments, Rende default: 'ne', options: Object.values(Legend).concat(false), }, - yaxis: { - types: ['boolean', 'axisConfig'], - help: argHelp.yaxis, - default: true, + palette: { + types: ['palette'], + help: argHelp.palette, + default: '{palette}', + }, + seriesStyle: { + multi: true, + types: ['seriesStyle'], + help: argHelp.seriesStyle, }, xaxis: { types: ['boolean', 'axisConfig'], help: argHelp.xaxis, default: true, }, + yaxis: { + types: ['boolean', 'axisConfig'], + help: argHelp.yaxis, + default: true, + }, }, fn: (context, args) => { const seriesStyles: { [key: string]: SeriesStyle } = diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/ply.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/ply.ts index 0b9fa4f2d5b37..ae64da6778368 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/ply.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/ply.ts @@ -40,8 +40,6 @@ export function ply(): ExpressionFunction<'ply', Datatable, Arguments, Return> { aliases: ['exp', 'fn', 'function'], help: argHelp.expression, }, - // In the future it may make sense to add things like shape, or tooltip values, but I think what we have is good for now - // The way the function below is written you can add as many arbitrary named args as you want. }, fn: (context, args) => { if (!args) { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/progress.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/progress.ts index fc3e65cd71043..bbad9f8864c8e 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/progress.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/progress.ts @@ -45,47 +45,47 @@ export function progress(): ExpressionFunction<'progress', number, Arguments, Re types: ['number'], }, args: { + shape: { + aliases: ['_'], + types: ['string'], + help: argHelp.shape, + options: Object.values(Shape), + default: 'gauge', + }, barColor: { - default: `#f0f0f0`, - help: argHelp.barColor, types: ['string'], + help: argHelp.barColor, + default: `#f0f0f0`, }, barWeight: { - default: 20, - help: argHelp.barWeight, types: ['number'], + help: argHelp.barWeight, + default: 20, }, font: { - default: `{font size=24 family="${openSans.value}" color="#000000" align=center}`, - help: argHelp.font, types: ['style'], + help: argHelp.font, + default: `{font size=24 family="${openSans.value}" color="#000000" align=center}`, }, label: { - default: true, - help: argHelp.label, types: ['boolean', 'string'], + help: argHelp.label, + default: true, }, max: { - default: 1, - help: argHelp.max, types: ['number'], - }, - shape: { - aliases: ['_'], - default: 'gauge', - help: argHelp.shape, - options: Object.values(Shape), - types: ['string'], + help: argHelp.max, + default: 1, }, valueColor: { - default: `#1785b0`, - help: argHelp.valueColor, types: ['string'], + help: argHelp.valueColor, + default: `#1785b0`, }, valueWeight: { - default: 20, - help: argHelp.valueWeight, types: ['number'], + help: argHelp.valueWeight, + default: 20, }, }, fn: (value, args) => { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/repeatImage.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/repeatImage.ts index b58ce06f1c95d..55d80bedd39fe 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/repeatImage.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/repeatImage.ts @@ -36,25 +36,25 @@ export function repeatImage(): ExpressionFunction< types: ['number'], }, args: { + emptyImage: { + types: ['string', 'null'], + help: argHelp.emptyImage, + default: null, + }, image: { types: ['string', 'null'], help: argHelp.image, default: elasticOutline, }, - size: { - types: ['number'], - default: 100, - help: argHelp.size, - }, max: { types: ['number'], help: argHelp.max, default: 1000, }, - emptyImage: { - types: ['string', 'null'], - help: argHelp.emptyImage, - default: null, + size: { + types: ['number'], + default: 100, + help: argHelp.size, }, }, fn: (count, args) => { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/shape.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/shape.ts index 915f4ccc7ae9c..2bd0caf1a4a55 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/shape.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/shape.ts @@ -49,6 +49,13 @@ export function shape(): ExpressionFunction<'shape', null, Arguments, Return> { types: ['null'], }, args: { + shape: { + types: ['string'], + help: argHelp.shape, + aliases: ['_'], + default: 'square', + options: Object.values(Shape), + }, border: { types: ['string'], aliases: ['stroke'], @@ -60,13 +67,6 @@ export function shape(): ExpressionFunction<'shape', null, Arguments, Return> { help: argHelp.borderWidth, default: 0, }, - shape: { - types: ['string'], - help: argHelp.shape, - aliases: ['_'], - default: 'square', - options: Object.values(Shape), - }, fill: { types: ['string'], help: argHelp.fill, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/string.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/string.ts index 0e38abb68a1eb..facbe5eddea38 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/string.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/string.ts @@ -7,7 +7,7 @@ import { ExpressionFunction } from 'src/legacy/core_plugins/interpreter/public'; import { getFunctionHelp } from '../../strings'; interface Arguments { - value: string[]; + value: Array; } export function string(): ExpressionFunction<'string', null, Arguments, string> { @@ -24,7 +24,7 @@ export function string(): ExpressionFunction<'string', null, Arguments, string> args: { value: { aliases: ['_'], - types: ['string'], + types: ['string', 'number', 'boolean'], multi: true, help: argHelp.value, }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/timefilter.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/timefilter.ts index d103c70a2ee59..3a5e770de955a 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/timefilter.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/timefilter.ts @@ -47,7 +47,7 @@ export function timefilter(): ExpressionFunction<'timefilter', Filter, Arguments }, filterGroup: { types: ['string'], - help: 'Group name for the filter', + help: 'The group name for the filter', }, }, fn: (context, args) => { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/index.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/index.ts index 3f5a52d168157..92e5ecfc2bee2 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/index.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/demodata/index.ts @@ -6,7 +6,7 @@ import { sortBy } from 'lodash'; import { ExpressionFunction } from 'src/legacy/core_plugins/interpreter/public'; -// @ts-ignore +// @ts-ignore unconverted lib file import { queryDatatable } from '../../../../common/lib/datatable/query'; import { DemoRows, getDemoRows } from './get_demo_rows'; import { Filter, Datatable, DatatableColumn, DatatableRow } from '../../../../types'; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/escount.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/escount.ts index 184e943a89965..667d52dfdb30f 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/escount.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/escount.ts @@ -26,17 +26,17 @@ export function escount(): ExpressionFunction<'escount', Filter, Arguments, any> types: ['filter'], }, args: { - index: { - types: ['string'], - default: '_all', - help: argHelp.index, - }, query: { types: ['string'], aliases: ['_', 'q'], help: argHelp.query, default: '"-_index:.kibana"', }, + index: { + types: ['string'], + default: '_all', + help: argHelp.index, + }, }, fn: (context, args, handlers) => { context.and = context.and.concat([ diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts index 0f30204bd45e8..e16d5cdff97e1 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/esdocs.ts @@ -31,33 +31,35 @@ export function esdocs(): ExpressionFunction<'esdocs', Filter, Arguments, any> { types: ['filter'], }, args: { - index: { - types: ['string'], - default: '_all', - help: argHelp.index, - }, query: { types: ['string'], aliases: ['_', 'q'], help: argHelp.query, default: '-_index:.kibana', }, - sort: { - types: ['string'], - help: argHelp.sort, + count: { + types: ['number'], + default: 100, + help: argHelp.count, }, fields: { help: argHelp.fields, types: ['string'], }, + index: { + types: ['string'], + default: '_all', + help: argHelp.index, + }, + // TODO: This arg isn't being used in the function. + // We need to restore this functionality or remove it as an arg. metaFields: { help: argHelp.metaFields, types: ['string'], }, - count: { - types: ['number'], - default: 100, - help: argHelp.count, + sort: { + types: ['string'], + help: argHelp.sort, }, }, fn: (context, args, handlers) => { diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/essql.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/essql.ts index e7f5b6d7de901..a505f41a75908 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/essql.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/essql.ts @@ -22,10 +22,10 @@ export function essql(): ExpressionFunction<'essql', Filter, Arguments, any> { return { name: 'essql', type: 'datatable', + help, context: { types: ['filter'], }, - help, args: { query: { aliases: ['_', 'q'], diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts index 8baffa9d486e2..9218f03841c1e 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts @@ -55,14 +55,6 @@ export function pointseries(): ExpressionFunction< types: ['datatable'], }, args: { - x: { - types: ['string'], - help: argHelp.x, - }, - y: { - types: ['string'], - help: argHelp.y, - }, color: { types: ['string'], help: argHelp.color, // If you need categorization, transform the field. @@ -75,6 +67,14 @@ export function pointseries(): ExpressionFunction< types: ['string'], help: argHelp.text, }, + x: { + types: ['string'], + help: argHelp.x, + }, + y: { + types: ['string'], + help: argHelp.y, + }, // In the future it may make sense to add things like shape, or tooltip values, but I think what we have is good for now // The way the function below is written you can add as many arbitrary named args as you want. }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/constants.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/constants.ts new file mode 100644 index 0000000000000..582549c1a2934 --- /dev/null +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/constants.ts @@ -0,0 +1,35 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export const BASE64 = '`base64`'; +export const BOOLEAN_FALSE = '`false`'; +export const BOOLEAN_TRUE = '`true`'; +export const CANVAS = 'Canvas'; +export const CONTEXT = '_context_'; +export const CSS = 'CSS'; +export const CSV = 'CSV'; +export const DATEMATH = '`datemath`'; +export const DATATABLE = '`datatable`'; +export const ELASTICSEARCH = 'Elasticsearch'; +export const FONT_FAMILY = '`font-family`'; +export const FONT_WEIGHT = '`font-weight`'; +export const ISO8601 = 'ISO8601'; +export const JS = 'JavaScript'; +export const LUCENE = 'Lucene'; +export const MARKDOWN = 'Markdown'; +export const MOMENTJS = 'MomentJS'; +export const NUMERALJS = 'NumeralJS'; +export const SQL = 'SQL'; +export const SVG = 'SVG'; +export const TINYMATH = '`TinyMath`'; +export const TINYMATH_URL = + 'https://www.elastic.co/guide/en/kibana/current/canvas-tinymath-functions.html'; +export const TYPE_BOOLEAN = '`boolean`'; +export const TYPE_NULL = '`null`'; +export const TYPE_NUMBER = '`number`'; +export const TYPE_STRING = '`string`'; +export const URL = 'URL'; +export const UTC = 'UTC'; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/all.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/all.ts index 66b9003bb5a5d..ab212419f4a9e 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/all.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/all.ts @@ -8,14 +8,19 @@ import { i18n } from '@kbn/i18n'; import { all } from '../../functions/common/all'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { BOOLEAN_TRUE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.allHelpText', { - defaultMessage: 'Return true if all of the conditions are true', + defaultMessage: 'Returns {BOOLEAN_TRUE} if all of the conditions are met. See also {anyFn}.', + values: { + anyFn: '`any`', + BOOLEAN_TRUE, + }, }), args: { condition: i18n.translate('xpack.canvas.functions.all.args.conditionHelpText', { - defaultMessage: 'One or more conditions to check', + defaultMessage: 'The conditions to check.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/alterColumn.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/alterColumn.ts index 33f877e97e45a..b9c2c68a5ce26 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/alterColumn.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/alterColumn.ts @@ -8,23 +8,32 @@ import { i18n } from '@kbn/i18n'; import { alterColumn } from '../../functions/common/alterColumn'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { DATATABLE_COLUMN_TYPES } from '../../../common/lib'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.alterColumnHelpText', { - defaultMessage: 'Converts between core types (eg {examples}) and rename columns', + defaultMessage: + 'Converts between core types, including {list}, and {end}, and rename columns. ' + + 'See also {mapColumnFn} and {staticColumnFn}.', values: { - examples: ['string', 'number', 'null', 'boolean', 'date'].join(','), + list: Object.values(DATATABLE_COLUMN_TYPES) + .slice(0, -1) + .map(type => `\`${type}\``) + .join(', '), + end: Object.values(DATATABLE_COLUMN_TYPES).slice(-1)[0], + mapColumnFn: '`mapColumn`', + staticColumnFn: '`staticColumn`', }, }), args: { column: i18n.translate('xpack.canvas.functions.alterColumn.args.columnHelpText', { - defaultMessage: 'The name of the column to alter', + defaultMessage: 'The name of the column to alter.', }), name: i18n.translate('xpack.canvas.functions.alterColumn.args.nameHelpText', { - defaultMessage: 'The resultant column name. Leave blank to not rename', + defaultMessage: 'The resultant column name. Leave blank to not rename.', }), type: i18n.translate('xpack.canvas.functions.alterColumn.args.typeHelpText', { - defaultMessage: 'The type to convert the column to. Leave blank to not change type', + defaultMessage: 'The type to convert the column to. Leave blank to not change type.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/any.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/any.ts index 225ad7e071bd6..cdf24f7c5ea77 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/any.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/any.ts @@ -8,14 +8,20 @@ import { i18n } from '@kbn/i18n'; import { any } from '../../functions/common/any'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { BOOLEAN_TRUE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.anyHelpText', { - defaultMessage: 'Return true if any of the conditions are true', + defaultMessage: + 'Returns {BOOLEAN_TRUE} if at least one of the conditions is met. See also {all_fn}.', + values: { + all_fn: '`all`', + BOOLEAN_TRUE, + }, }), args: { condition: i18n.translate('xpack.canvas.functions.any.args.conditionHelpText', { - defaultMessage: 'One or more conditions to check', + defaultMessage: 'The conditions to check.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/as.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/as.ts index ca323cc57495e..a8c9a8da1e985 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/as.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/as.ts @@ -8,14 +8,19 @@ import { i18n } from '@kbn/i18n'; import { asFn } from '../../functions/common/as'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { DATATABLE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.asHelpText', { - defaultMessage: 'One or more conditions to check', + defaultMessage: 'Creates a {DATATABLE} with a single value. See also {getCellFn}.', + values: { + DATATABLE, + getCellFn: '`getCell`', + }, }), args: { name: i18n.translate('xpack.canvas.functions.as.args.nameHelpText', { - defaultMessage: 'A name to give the column', + defaultMessage: 'A name to give the column.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/axisConfig.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/axisConfig.ts index 90c2bb7d0c3d0..5e24a499475b0 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/axisConfig.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/axisConfig.ts @@ -9,39 +9,45 @@ import { axisConfig } from '../../functions/common/axisConfig'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; import { Position } from '../../../types'; +import { ISO8601 } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.axisConfigHelpText', { - defaultMessage: 'Configure axis of a visualization', + defaultMessage: 'Configures the axis of a visualization. Only used with {plotFn}.', + values: { + plotFn: '`plot`', + }, }), args: { max: i18n.translate('xpack.canvas.functions.axisConfig.args.maxHelpText', { defaultMessage: - 'Maximum value displayed in the axis. Must be a number or a date in {ms} or {iso} string', + 'The maximum value displayed in the axis. Must be a number or a date in milliseconds since epoch or {ISO8601} string.', values: { - ms: 'ms', - iso: 'ISO8601', + ISO8601, }, }), min: i18n.translate('xpack.canvas.functions.axisConfig.args.minHelpText', { defaultMessage: - 'Minimum value displayed in the axis. Must be a number or a date in {ms} or {iso} string', + 'The minimum value displayed in the axis. Must be a number or a date in milliseconds since epoch or {ISO8601} string.', values: { - ms: 'ms', - iso: 'ISO8601', + ISO8601, }, }), position: i18n.translate('xpack.canvas.functions.axisConfig.args.positionHelpText', { - defaultMessage: 'Position of the axis labels: {examples}', + defaultMessage: 'The position of the axis labels. For example, {list}, or {end}.', values: { - examples: Object.values(Position).join(', '), + list: Object.values(Position) + .slice(0, -1) + .map(position => `\`"${position}"\``) + .join(', '), + end: Object.values(Position).slice(-1)[0], }, }), show: i18n.translate('xpack.canvas.functions.axisConfig.args.showHelpText', { defaultMessage: 'Show the axis labels?', }), tickSize: i18n.translate('xpack.canvas.functions.axisConfig.args.tickSizeHelpText', { - defaultMessage: 'Increment size between each tick. Use for number axes only', + defaultMessage: 'The increment size between each tick. Use for `number` axes only', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/case.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/case.ts index 6c649ba9e9b1e..9eb4c84b1b301 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/case.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/case.ts @@ -8,28 +8,40 @@ import { i18n } from '@kbn/i18n'; import { caseFn } from '../../functions/common/case'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT } from '../constants'; + +const IF_ARG = '`if`'; +const WHEN_ARG = '`when`'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.caseHelpText', { - defaultMessage: 'Build a case (including a condition/result) to pass to the {switch} function', + defaultMessage: + 'Builds a {case}, including a condition and a result, to pass to the {switchFn} function.', values: { - switch: 'switch', + case: '`case`', + switchFn: '`switch`', }, }), args: { - if: i18n.translate('xpack.canvas.functions.case.args.ifHelpText', { + when: i18n.translate('xpack.canvas.functions.case.args.whenHelpText', { defaultMessage: - 'This value is used as whether or not the condition is met. It overrides the unnamed argument if both are provided.', + 'The value compared to the {CONTEXT} to see if they are equal. The {WHEN_ARG} argument is ignored when the {IF_ARG} argument is also specified.', + values: { + CONTEXT, + IF_ARG, + WHEN_ARG, + }, }), - when: i18n.translate('xpack.canvas.functions.case.args.whenHelpText', { + if: i18n.translate('xpack.canvas.functions.case.args.ifHelpText', { defaultMessage: - 'This value is compared to the context to see if the condition is met. It is overridden by the "{if}" argument if both are provided.', + 'This value indicates whether the condition is met, usually using a sub-expression. The {IF_ARG} argument overrides the {WHEN_ARG} argument when both are provided.', values: { - if: 'if', + IF_ARG, + WHEN_ARG, }, }), then: i18n.translate('xpack.canvas.functions.case.args.thenHelpText', { - defaultMessage: 'The value to return if the condition is met', + defaultMessage: 'The value to return if the condition is met.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/clear.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/clear.ts index 893153036d62c..75816f34f9e19 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/clear.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/clear.ts @@ -8,10 +8,15 @@ import { i18n } from '@kbn/i18n'; import { clear } from '../../functions/common/clear'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT, TYPE_NULL } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.clearHelpText', { - defaultMessage: 'Clears context and returns null', + defaultMessage: 'Clears the {CONTEXT}, and returns {TYPE_NULL}.', + values: { + CONTEXT, + TYPE_NULL, + }, }), args: {}, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/columns.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/columns.ts index 601aa75c355bc..290c932789822 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/columns.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/columns.ts @@ -8,18 +8,29 @@ import { i18n } from '@kbn/i18n'; import { columns } from '../../functions/common/columns'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { DATATABLE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.columnsHelpText', { defaultMessage: - 'Include or exclude columns from a data table. If you specify both, this will exclude first', + 'Includes or excludes columns from a {DATATABLE}. ' + + 'When both arguments are specified, the excluded columns will be removed first.', + values: { + DATATABLE, + }, }), args: { include: i18n.translate('xpack.canvas.functions.columns.args.includeHelpText', { - defaultMessage: 'A comma separated list of column names to keep in the table', + defaultMessage: 'A comma-separated list of column names to keep in the {DATATABLE}.', + values: { + DATATABLE, + }, }), exclude: i18n.translate('xpack.canvas.functions.columns.args.excludeHelpText', { - defaultMessage: 'A comma separated list of column names to remove from the table', + defaultMessage: 'A comma-separated list of column names to remove from the {DATATABLE}.', + values: { + DATATABLE, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/compare.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/compare.ts index f8296a32aac01..1df7a3b27271d 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/compare.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/compare.ts @@ -8,22 +8,41 @@ import { i18n } from '@kbn/i18n'; import { compare, Operation } from '../../functions/common/compare'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { + CONTEXT, + TYPE_BOOLEAN, + TYPE_NUMBER, + TYPE_STRING, + BOOLEAN_TRUE, + BOOLEAN_FALSE, + TYPE_NULL, +} from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.compareHelpText', { defaultMessage: - 'Compare the input to something else to determine true or false. Usually used in combination with `{if}`. ' + - 'This only works with primitive types, such as {examples}.', + 'Compares the {CONTEXT} to specified value to determine {BOOLEAN_TRUE} or {BOOLEAN_FALSE}. Usually used in combination with `{ifFn}` or `{caseFn}`. ' + + 'This only works with primitive types, such as {examples}. See also `{eqFn}`, `{gtFn}`, `{gteFn}`, `{ltFn}`, `{lteFn}`, `{neqFn}`', values: { - if: '{if}', - examples: ['number', 'string', 'boolean'].join(', '), + CONTEXT, + BOOLEAN_TRUE, + BOOLEAN_FALSE, + ifFn: 'if', + caseFn: 'case', + examples: [TYPE_NUMBER, TYPE_STRING, TYPE_BOOLEAN, TYPE_NULL].join(', '), + eqFn: 'eq', + gtFn: 'gt', + gteFn: 'gte', + ltFn: 'lt', + lteFn: 'lte', + neqFn: 'neq', }, }), args: { op: i18n.translate('xpack.canvas.functions.compare.args.opHelpText', { defaultMessage: 'The operator to use in the comparison: {eq} (equal to), {gt} (greater than), {gte} (greater than or equal to)' + - ', {lt} (less than), {lte} (less than or equal to), {ne} or {neq} (not equal to)', + ', {lt} (less than), {lte} (less than or equal to), {ne} or {neq} (not equal to).', values: { eq: Operation.EQ, gt: Operation.GT, @@ -35,7 +54,10 @@ export const help: FunctionHelp> = { }, }), to: i18n.translate('xpack.canvas.functions.compare.args.toHelpText', { - defaultMessage: 'The value to compare the context to, usually returned by a subexpression', + defaultMessage: 'The value compared to the {CONTEXT}.', + values: { + CONTEXT, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/containerStyle.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/containerStyle.ts index d63ed1731d93f..2feb6c703b072 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/containerStyle.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/containerStyle.ts @@ -8,70 +8,73 @@ import { i18n } from '@kbn/i18n'; import { containerStyle } from '../../functions/common/containerStyle'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CSS } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.containerStyleHelpText', { - defaultMessage: - 'Creates an object used for describing the properties of a series on a chart. You would usually use this inside of a charting function', + defaultMessage: `Creates an object used for styling an element's container, including background, border, and opacity.`, }), args: { - border: i18n.translate('xpack.canvas.functions.containerStyle.args.borderHelpText', { - defaultMessage: 'Valid {css} border string', - values: { - css: 'CSS', - }, - }), - borderRadius: i18n.translate( - 'xpack.canvas.functions.containerStyle.args.borderRadiusHelpText', - { - defaultMessage: 'Number of pixels to use when rounding the border', - } - ), - padding: i18n.translate('xpack.canvas.functions.containerStyle.args.paddingHelpText', { - defaultMessage: 'Content distance in pixels from border', - }), backgroundColor: i18n.translate( 'xpack.canvas.functions.containerStyle.args.backgroundColorHelpText', { - defaultMessage: 'Valid {css} background color string', + defaultMessage: 'A valid {CSS} background color.', values: { - css: 'CSS', + CSS, }, } ), backgroundImage: i18n.translate( 'xpack.canvas.functions.containerStyle.args.backgroundImageHelpText', { - defaultMessage: 'Valid {css} background image string', + defaultMessage: 'A valid {CSS} background image.', values: { - css: 'CSS', + CSS, }, } ), - backgroundSize: i18n.translate( - 'xpack.canvas.functions.containerStyle.args.backgroundSizeHelpText', + backgroundRepeat: i18n.translate( + 'xpack.canvas.functions.containerStyle.args.backgroundRepeatHelpText', { - defaultMessage: 'Valid {css} background size string', + defaultMessage: 'A valid {CSS} background repeat.', values: { - css: 'CSS', + CSS, }, } ), - backgroundRepeat: i18n.translate( - 'xpack.canvas.functions.containerStyle.args.backgroundRepeatHelpText', + backgroundSize: i18n.translate( + 'xpack.canvas.functions.containerStyle.args.backgroundSizeHelpText', { - defaultMessage: 'Valid {css} background repeat string', + defaultMessage: 'A valid {CSS} background size.', values: { - css: 'CSS', + CSS, }, } ), + border: i18n.translate('xpack.canvas.functions.containerStyle.args.borderHelpText', { + defaultMessage: 'A valid {CSS} border.', + values: { + CSS, + }, + }), + borderRadius: i18n.translate( + 'xpack.canvas.functions.containerStyle.args.borderRadiusHelpText', + { + defaultMessage: 'The number of pixels to use when rounding the corners.', + } + ), opacity: i18n.translate('xpack.canvas.functions.containerStyle.args.opacityHelpText', { defaultMessage: - 'A number between 0 and 1 representing the degree of transparency of the element', + 'A number between 0 and 1 that represents the degree of transparency of the element.', }), overflow: i18n.translate('xpack.canvas.functions.containerStyle.args.overflowHelpText', { - defaultMessage: 'Sets overflow of the container', + defaultMessage: 'A valid {CSS} overflow.', + values: { + CSS, + }, + }), + padding: i18n.translate('xpack.canvas.functions.containerStyle.args.paddingHelpText', { + defaultMessage: 'The distance of the content, in pixels, from border.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/context.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/context.ts index ff5ccff817574..431228d760ad3 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/context.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/context.ts @@ -8,12 +8,16 @@ import { i18n } from '@kbn/i18n'; import { context } from '../../functions/common/context'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.contextHelpText', { defaultMessage: 'Returns whatever you pass into it. This can be useful when you need to use ' + - 'context as argument to a function as a sub-expression', + '{CONTEXT} as argument to a function as a sub-expression.', + values: { + CONTEXT, + }, }), args: {}, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/csv.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/csv.ts index 1efafd006b60e..b1085bb10b416 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/csv.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/csv.ts @@ -8,26 +8,28 @@ import { i18n } from '@kbn/i18n'; import { csv } from '../../functions/common/csv'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { DATATABLE, CSV } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.csvHelpText', { - defaultMessage: 'Create datatable from {csv} input', + defaultMessage: 'Creates a {DATATABLE} from {CSV} input.', values: { - csv: 'CSV', + DATATABLE, + CSV, }, }), args: { data: i18n.translate('xpack.canvas.functions.csv.args.dataHelpText', { - defaultMessage: '{csv} data to use', + defaultMessage: 'The {CSV} data to use.', values: { - csv: 'CSV', + CSV, }, }), delimiter: i18n.translate('xpack.canvas.functions.csv.args.delimeterHelpText', { - defaultMessage: 'Data separation character', + defaultMessage: 'The data separation character.', }), newline: i18n.translate('xpack.canvas.functions.csv.args.newlineHelpText', { - defaultMessage: 'Row separation character', + defaultMessage: 'The row separation character.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/date.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/date.ts index 5f8f928c9fb55..962c6b95b2b80 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/date.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/date.ts @@ -8,26 +8,30 @@ import { i18n } from '@kbn/i18n'; import { date } from '../../functions/common/date'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { ISO8601, MOMENTJS, JS } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.dateHelpText', { defaultMessage: - 'Returns the current time, or a time parsed from a string, as milliseconds since epoch', + 'Returns the current time, or a time parsed from a specified string, as milliseconds since epoch.', }), args: { value: i18n.translate('xpack.canvas.functions.date.args.valueHelpText', { defaultMessage: - 'An optional date string to parse into milliseconds since epoch. Can be either a valid ' + - 'Javascript Date input or a string to parse using the format argument. Must be an {iso} ' + - 'string or you must provide the format', + 'An optional date string that is parsed into milliseconds since epoch. The date string can be either a valid ' + + '{JS} {date} input or a string to parse using the {formatArg} argument. Must be an {ISO8601} ' + + 'string, or you must provide the format.', values: { - iso: 'ISO8601', + JS, + date: '`Date`', + formatArg: '`format`', + ISO8601, }, }), format: i18n.translate('xpack.canvas.functions.date.args.formatHelpText', { - defaultMessage: 'The {moment} format for parsing the optional date string (See {url})', + defaultMessage: 'The {MOMENTJS} format used to parse the specified date string. See {url}.', values: { - moment: 'momentJS', + MOMENTJS, url: 'https://momentjs.com/docs/#/displaying/', }, }), diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/demodata.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/demodata.ts index 2b4725c1c5145..6b2c81fb3681a 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/demodata.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/demodata.ts @@ -13,14 +13,14 @@ import { DemoRows } from '../../functions/server/demodata/get_demo_rows'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.demodataHelpText', { defaultMessage: - 'A mock data set that includes project {ci} times with usernames, countries and run phases', + 'A mock data set that includes project {ci} times with usernames, countries, and run phases.', values: { ci: 'CI', }, }), args: { type: i18n.translate('xpack.canvas.functions.demodata.args.typeHelpText', { - defaultMessage: 'The name of the demo data set to use', + defaultMessage: 'The name of the demo data set to use.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/do.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/do.ts index 2219d6eecc429..55ea0f8409bd8 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/do.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/do.ts @@ -8,18 +8,25 @@ import { i18n } from '@kbn/i18n'; import { doFn } from '../../functions/common/do'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.doHelpText', { defaultMessage: - 'Runs multiple sub-expressions. Returns the passed in context. Nice for running ' + - 'actions producing functions.', + 'Executes multiple sub-expressions, then returns the original {CONTEXT}. ' + + 'Use for running functions that produce an action or a side effect without changing the original {CONTEXT}.', + values: { + CONTEXT, + }, }), args: { fn: i18n.translate('xpack.canvas.functions.do.args.fnHelpText', { defaultMessage: - 'One or more sub-expressions. The value of these is not available in the root ' + - 'pipeline as this function simply returns the passed in context', + 'The sub-expressions to execute. The return values of these sub-expressions are not available in the root ' + + 'pipeline as this function simply returns the original {CONTEXT}.', + values: { + CONTEXT, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/dropdownControl.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/dropdownControl.ts index bed960b2b6186..789981d396a08 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/dropdownControl.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/dropdownControl.ts @@ -11,21 +11,21 @@ import { FunctionFactory } from '../../../types'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.dropdownControlHelpText', { - defaultMessage: 'Configure a drop down filter control element', + defaultMessage: 'Configures a drop-down filter control element.', }), args: { filterColumn: i18n.translate( 'xpack.canvas.functions.dropdownControl.args.filterColumnHelpText', { - defaultMessage: 'The column or field to attach the filter to', + defaultMessage: 'The column or field that you want to filter.', } ), valueColumn: i18n.translate('xpack.canvas.functions.dropdownControl.args.valueColumnHelpText', { defaultMessage: - 'The datatable column from which to extract the unique values for the drop down', + 'The column or field from which to extract the unique values for the drop-down control.', }), filterGroup: i18n.translate('xpack.canvas.functions.dropdownControl.args.filterGroupHelpText', { - defaultMessage: 'Group name for the filter', + defaultMessage: 'The group name for the filter.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/eq.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/eq.ts index 8bf84f9836574..7fce30518cfd7 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/eq.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/eq.ts @@ -8,14 +8,21 @@ import { i18n } from '@kbn/i18n'; import { eq } from '../../functions/common/eq'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.eqHelpText', { - defaultMessage: 'Return if the context is equal to the argument', + defaultMessage: 'Return whether the {CONTEXT} is equal to the argument.', + values: { + CONTEXT, + }, }), args: { value: i18n.translate('xpack.canvas.functions.eq.args.valueHelpText', { - defaultMessage: 'The value to compare the context to', + defaultMessage: 'The value compared to the {CONTEXT}.', + values: { + CONTEXT, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/escount.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/escount.ts index 9cc2c728379c7..754465546f9d8 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/escount.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/escount.ts @@ -8,25 +8,26 @@ import { i18n } from '@kbn/i18n'; import { escount } from '../../functions/server/escount'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { ELASTICSEARCH, LUCENE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.escountHelpText', { - defaultMessage: 'Query {es} for a count of the number of hits matching a query', + defaultMessage: 'Query {ELASTICSEARCH} for the number of hits matching the specified query.', values: { - es: 'elasticsearch', + ELASTICSEARCH, }, }), args: { - index: i18n.translate('xpack.canvas.functions.escount.args.indexHelpText', { - defaultMessage: 'Specify an index pattern. Eg "{example}"', + query: i18n.translate('xpack.canvas.functions.escount.args.queryHelpText', { + defaultMessage: 'A {LUCENE} query string.', values: { - example: 'logstash-*', + LUCENE, }, }), - query: i18n.translate('xpack.canvas.functions.escount.args.queryHelpText', { - defaultMessage: 'A {lucene} query string', + index: i18n.translate('xpack.canvas.functions.escount.args.indexHelpText', { + defaultMessage: 'An index or index pattern. For example, {example}.', values: { - lucene: 'Lucene', + example: '`"logstash-*"`', }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/esdocs.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/esdocs.ts index 0800068970615..239184c3cb129 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/esdocs.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/esdocs.ts @@ -8,48 +8,51 @@ import { i18n } from '@kbn/i18n'; import { esdocs } from '../../functions/server/esdocs'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { ELASTICSEARCH, LUCENE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.esdocsHelpText', { defaultMessage: - 'Query {es} and get back raw documents. We recommend you specify the fields you want, ' + - 'especially if you are going to ask for a lot of rows', + 'Query {ELASTICSEARCH} for raw documents. Specify the fields you want to retrieve, ' + + 'especially if you are asking for a lot of rows.', values: { - es: 'elasticsearch', + ELASTICSEARCH, }, }), args: { - index: i18n.translate('xpack.canvas.functions.esdocs.args.indexHelpText', { - defaultMessage: 'Specify an index pattern. Eg "{example}"', - values: { - example: 'logstash-*', - }, - }), query: i18n.translate('xpack.canvas.functions.esdocs.args.queryHelpText', { - defaultMessage: 'A {lucene} query string', + defaultMessage: 'A {LUCENE} query string.', values: { - lucene: 'Lucene', + LUCENE, }, }), - sort: i18n.translate('xpack.canvas.functions.esdocs.args.sortHelpText', { - defaultMessage: 'Sort directions as "{directions}". Eg "{example1}" or "{example2}"', - values: { - directions: ['field', 'direction'].join(', '), - example1: ['@timestamp', 'desc'].join(', '), - example2: ['bytes', 'asc'].join(', '), - }, + count: i18n.translate('xpack.canvas.functions.esdocs.args.countHelpText', { + defaultMessage: + 'The number of documents to retrieve. For better performance, use a smaller data set.', }), fields: i18n.translate('xpack.canvas.functions.esdocs.args.fieldsHelpText', { - defaultMessage: 'Comma separated list of fields. Fewer fields will perform better', + defaultMessage: 'A comma-separated list of fields. For better performance, use fewer fields.', + }), + index: i18n.translate('xpack.canvas.functions.esdocs.args.indexHelpText', { + defaultMessage: 'An index or index pattern. For example, {example}.', + values: { + example: '`"logstash-*"`', + }, }), metaFields: i18n.translate('xpack.canvas.functions.esdocs.args.metaFieldsHelpText', { - defaultMessage: 'Comma separated list of meta fields, eg "{example}"', + defaultMessage: 'Comma separated list of meta fields. For example, {example}.', values: { - example: '_index,_type', + example: '`"_index,_type"`', }, }), - count: i18n.translate('xpack.canvas.functions.esdocs.args.countHelpText', { - defaultMessage: 'The number of docs to pull back. Smaller numbers perform better', + sort: i18n.translate('xpack.canvas.functions.esdocs.args.sortHelpText', { + defaultMessage: + 'The sort direction formatted as {directions}. For example, {example1} or {example2}.', + values: { + directions: `\`"${['field', 'direction'].join(', ')}"\``, + example1: `\`"${['@timestamp', 'desc'].join(', ')}"\``, + example2: `\`"${['bytes', 'asc'].join(', ')}"\``, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/essql.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/essql.ts index 48cce922d44f2..8e4be350c61ab 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/essql.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/essql.ts @@ -8,30 +8,34 @@ import { i18n } from '@kbn/i18n'; import { essql } from '../../functions/server/essql'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { ELASTICSEARCH, SQL, ISO8601, UTC } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.essqlHelpText', { - defaultMessage: '{essql}', + defaultMessage: 'Queries {ELASTICSEARCH} using {ELASTICSEARCH} {SQL}.', values: { - essql: 'Elasticsearch SQL', + ELASTICSEARCH, + SQL, }, }), args: { query: i18n.translate('xpack.canvas.functions.essql.args.queryHelpText', { - defaultMessage: '{sql} query', + defaultMessage: 'An {ELASTICSEARCH} {SQL} query.', values: { - sql: 'SQL', + ELASTICSEARCH, + SQL, }, }), count: i18n.translate('xpack.canvas.functions.essql.args.countHelpText', { - defaultMessage: 'The number of docs to pull back. Smaller numbers perform better', + defaultMessage: + 'The number of documents to retrieve. For better performance, use a smaller data set.', }), timezone: i18n.translate('xpack.canvas.functions.essql.args.timezoneHelpText', { defaultMessage: - 'Timezone to use for date operations, valid {iso} formats and {utc} offsets both work', + 'The timezone to use for date operations. Valid {ISO8601} formats and {UTC} offsets both work.', values: { - iso: 'ISO', - utc: 'UTC', + ISO8601, + UTC, }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/exactly.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/exactly.ts index 5603486420ee1..75b676b5f57be 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/exactly.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/exactly.ts @@ -11,17 +11,17 @@ import { FunctionFactory } from '../../../types'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.exactlyHelpText', { - defaultMessage: 'Create a filter that matches a given column for a perfectly exact value', + defaultMessage: 'Creates a filter that matches a given column to an exact value.', }), args: { column: i18n.translate('xpack.canvas.functions.exactly.args.columnHelpText', { - defaultMessage: 'The column or field to attach the filter to', + defaultMessage: 'The column or field that you want to filter.', }), value: i18n.translate('xpack.canvas.functions.exactly.args.valueHelpText', { - defaultMessage: 'The value to match exactly, including white space and capitalization', + defaultMessage: 'The value to match exactly, including white space and capitalization.', }), - filterGroup: i18n.translate('xpack.canvas.functions.dropdownControl.args.filterGroupHelpText', { - defaultMessage: 'Group name for the filter', + filterGroup: i18n.translate('xpack.canvas.functions.exactly.args.filterGroupHelpText', { + defaultMessage: 'The group name for the filter.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/filterrows.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/filterrows.ts index 3ae46952e5f3a..808d495f16444 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/filterrows.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/filterrows.ts @@ -8,16 +8,27 @@ import { i18n } from '@kbn/i18n'; import { filterrows } from '../../functions/common/filterrows'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { DATATABLE, TYPE_BOOLEAN, BOOLEAN_TRUE, BOOLEAN_FALSE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.filterrowsHelpText', { - defaultMessage: 'Filter rows in a datatable based on the return value of a subexpression.', + defaultMessage: 'Filter rows in a {DATATABLE} based on the return value of a sub-expression.', + values: { + DATATABLE, + }, }), args: { fn: i18n.translate('xpack.canvas.functions.filterrows.args.fnHelpText', { defaultMessage: - 'An expression to pass each rows in the datatable into. The expression should return a ' + - 'boolean. A true value will preserve the row, and a false value will remove it.', + 'An expression to pass into each row in the {DATATABLE}. ' + + 'The expression should return a {TYPE_BOOLEAN}. ' + + 'A {BOOLEAN_TRUE} value preserves the row, and a {BOOLEAN_FALSE} value removes it.', + values: { + BOOLEAN_FALSE, + BOOLEAN_TRUE, + DATATABLE, + TYPE_BOOLEAN, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/formatdate.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/formatdate.ts index 491af01b26aa2..a141d2bffa8b2 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/formatdate.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/formatdate.ts @@ -8,22 +8,24 @@ import { i18n } from '@kbn/i18n'; import { formatdate } from '../../functions/common/formatdate'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { ISO8601, MOMENTJS } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.formatdateHelpText', { defaultMessage: - 'Format a valid date string or number of {ms} since epoch using {moment} (see {url})', + 'Formats an {ISO8601} date string or a date in milliseconds since epoch using {MOMENTJS}. See {url}.', values: { - ms: 'ms', - moment: 'momentJS', - url: 'https://momentjs.com/', + ISO8601, + MOMENTJS, + url: 'https://momentjs.com/docs/#/displaying/', }, }), args: { format: i18n.translate('xpack.canvas.functions.formatdate.args.formatHelpText', { - defaultMessage: '{moment} Format with which to bucket (See {url})', + defaultMessage: 'A {MOMENTJS} format. For example, {example}. See {url}.', values: { - moment: 'momentJS', + MOMENTJS, + example: `"MM/DD/YYYY"`, url: 'https://momentjs.com/docs/#/displaying/', }, }), diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/formatnumber.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/formatnumber.ts index 810f3880b6d78..f1734ec67622b 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/formatnumber.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/formatnumber.ts @@ -8,19 +8,24 @@ import { i18n } from '@kbn/i18n'; import { formatnumber } from '../../functions/common/formatnumber'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { NUMERALJS } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.formatnumberHelpText', { - defaultMessage: 'Turn a number into a string using a {numeralJS} format', + defaultMessage: 'Formats a number into a formatted number string using {NUMERALJS}. See {url}.', values: { - numeralJS: 'NumeralJS', + NUMERALJS, + url: 'http://numeraljs.com/#format', }, }), args: { format: i18n.translate('xpack.canvas.functions.formatnumber.args.formatHelpText', { - defaultMessage: '{numeralJS} format string {url}', + defaultMessage: + 'A {NUMERALJS} format string. For example, {example1} or {example2}. See {url}.', values: { - numeralJS: 'NumeralJS', + example1: `"0.0a"`, + example2: `"0%"`, + NUMERALJS, url: 'http://numeraljs.com/#format', }, }), diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/getCell.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/getCell.ts index 2dfed976ed1de..ae219b294e5ff 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/getCell.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/getCell.ts @@ -8,17 +8,23 @@ import { i18n } from '@kbn/i18n'; import { getCell } from '../../functions/common/getCell'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { DATATABLE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.getCellHelpText', { - defaultMessage: 'Fetch a single cell in a table', + defaultMessage: 'Fetchs a single cell from a {DATATABLE}.', + values: { + DATATABLE, + }, }), args: { column: i18n.translate('xpack.canvas.functions.getCell.args.columnHelpText', { - defaultMessage: 'The name of the column value to fetch', + defaultMessage: + 'The name of the column to fetch the value from. ' + + 'If not provided, the value is retrieved from the first column.', }), row: i18n.translate('xpack.canvas.functions.getCell.args.rowHelpText', { - defaultMessage: 'The row number, starting at 0', + defaultMessage: 'The row number, starting at 0.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/gt.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/gt.ts index dc24406045a3d..aec5012f2d077 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/gt.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/gt.ts @@ -8,14 +8,21 @@ import { i18n } from '@kbn/i18n'; import { gt } from '../../functions/common/gt'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.gtHelpText', { - defaultMessage: 'Return if the context is greater than the argument', + defaultMessage: 'Returns whether the {CONTEXT} is greater than the argument.', + values: { + CONTEXT, + }, }), args: { value: i18n.translate('xpack.canvas.functions.gt.args.valueHelpText', { - defaultMessage: 'The value to compare the context to', + defaultMessage: 'The value compared to the {CONTEXT}.', + values: { + CONTEXT, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/gte.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/gte.ts index bf0515e5a899a..f216bd94fa51b 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/gte.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/gte.ts @@ -8,14 +8,21 @@ import { i18n } from '@kbn/i18n'; import { gte } from '../../functions/common/gte'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.gteHelpText', { - defaultMessage: 'Return if the context is greater than or equal to the argument', + defaultMessage: 'Returns whether the {CONTEXT} is greater or equal to the argument.', + values: { + CONTEXT, + }, }), args: { value: i18n.translate('xpack.canvas.functions.gte.args.valueHelpText', { - defaultMessage: 'The value to compare the context to', + defaultMessage: 'The value compared to the {CONTEXT}.', + values: { + CONTEXT, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/head.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/head.ts index d3e593760c72f..3a6ca22c4d63b 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/head.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/head.ts @@ -8,21 +8,22 @@ import { i18n } from '@kbn/i18n'; import { head } from '../../functions/common/head'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { DATATABLE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.headHelpText', { - defaultMessage: 'Get the first {n} rows from the {datatable}. Also see `{tail}`', + defaultMessage: 'Retrieves the first {n} rows from the {DATATABLE}. See also {tailFn}', values: { n: 'N', - datatable: 'datatable', - tail: 'tail', + DATATABLE, + tailFn: '`tail`', }, }), args: { count: i18n.translate('xpack.canvas.functions.head.args.countHelpText', { - defaultMessage: 'Return this many rows from the beginning of the {datatable}', + defaultMessage: 'The number of rows to retrieve from the beginning of the {DATATABLE}.', values: { - datatable: 'datatable', + DATATABLE, }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/if.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/if.ts index 4f1010d33a42f..5cbd9b9366791 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/if.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/if.ts @@ -8,6 +8,7 @@ import { i18n } from '@kbn/i18n'; import { ifFn } from '../../functions/common/if'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { BOOLEAN_TRUE, BOOLEAN_FALSE, CONTEXT } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.ifHelpText', { @@ -16,16 +17,31 @@ export const help: FunctionHelp> = { args: { condition: i18n.translate('xpack.canvas.functions.if.args.conditionHelpText', { defaultMessage: - 'A boolean true or false, usually returned by a subexpression. If this is not ' + - 'supplied then the input context will be used', + 'A {BOOLEAN_TRUE} or {BOOLEAN_FALSE} indicating whether a condition is met, ' + + 'usually returned by a sub-expression. When unspecified, the original {CONTEXT} is returned.', + values: { + BOOLEAN_TRUE, + BOOLEAN_FALSE, + CONTEXT, + }, }), then: i18n.translate('xpack.canvas.functions.if.args.thenHelpText', { - defaultMessage: 'The return value if true', + defaultMessage: + 'The return value when the condition is {BOOLEAN_TRUE}. ' + + 'When unspecified and the condition is met, the original {CONTEXT} is returned.', + values: { + BOOLEAN_TRUE, + CONTEXT, + }, }), else: i18n.translate('xpack.canvas.functions.if.args.elseHelpText', { defaultMessage: - 'The return value if false. If else is not specified, and the condition is false ' + - 'then the input context to the function will be returned', + 'The return value when the condition is {BOOLEAN_FALSE}. ' + + 'When unspecified and the condition is not met, the original {CONTEXT} is returned.', + values: { + BOOLEAN_FALSE, + CONTEXT, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/image.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/image.ts index be5f917aa3d7b..719e9f8f33414 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/image.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/image.ts @@ -8,25 +8,35 @@ import { i18n } from '@kbn/i18n'; import { image, ImageMode } from '../../functions/common/image'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { URL, BASE64 } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.imageHelpText', { - defaultMessage: 'Display an image', + defaultMessage: + 'Displays an image. Provide an image asset as a {BASE64} data {URL}, or pass in a sub-expression.', + values: { + BASE64, + URL, + }, }), args: { dataurl: i18n.translate('xpack.canvas.functions.image.args.dataurlHelpText', { - defaultMessage: 'The HTTP(S) URL or base64 data of an image.', + defaultMessage: 'The {https} {URL} or {BASE64} data {URL} of an image.', + values: { + BASE64, + https: 'HTTP(S)', + URL, + }, }), mode: i18n.translate('xpack.canvas.functions.image.args.modeHelpText', { defaultMessage: - '`{contain}` will show the entire image, scaled to fit. ' + - '`{cover}` will fill the container with the image, cropping from the sides or ' + - 'bottom as needed. ' + - '`{stretch}` will resize the height and width of the image to 100% of the container', + '{contain} shows the entire image, scaled to fit. ' + + '{cover} fills the container with the image, cropping from the sides or bottom as needed. ' + + '{stretch} resizes the height and width of the image to 100% of the container.', values: { - contain: ImageMode.CONTAIN, - cover: ImageMode.COVER, - stretch: ImageMode.STRETCH, + contain: `\`"${ImageMode.CONTAIN}"\``, + cover: `\`"${ImageMode.COVER}"\``, + stretch: `\`"${ImageMode.STRETCH}"\``, }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/join_rows.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/join_rows.ts index 51077d9442577..79937294bca16 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/join_rows.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/join_rows.ts @@ -15,16 +15,16 @@ export const help: FunctionHelp> = { }), args: { column: i18n.translate('xpack.canvas.functions.joinRows.args.columnHelpText', { - defaultMessage: 'Column to join values from', + defaultMessage: 'The column to join values from', }), separator: i18n.translate('xpack.canvas.functions.joinRows.args.separatorHelpText', { - defaultMessage: 'Separator to use between row values', + defaultMessage: 'The separator to use between row values', }), quote: i18n.translate('xpack.canvas.functions.joinRows.args.quoteHelpText', { - defaultMessage: 'Quote character around values', + defaultMessage: 'The quote character around values', }), distinct: i18n.translate('xpack.canvas.functions.joinRows.args.distinctHelpText', { - defaultMessage: 'Removes duplicate values if enabled', + defaultMessage: 'Removes duplicate values?', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/location.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/location.ts index b1d106a09d5f2..8a70208c025af 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/location.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/location.ts @@ -12,8 +12,13 @@ import { FunctionFactory } from '../../../types'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.locationHelpText', { defaultMessage: - "Use the browser's location functionality to get your current location. " + - 'Usually quite slow, but fairly accurate', + 'Find your current location using the {geolocationAPI} of the browser. ' + + 'Performance can vary, but is fairly accurate. ' + + 'See {url}.', + values: { + geolocationAPI: 'Geolocation API', + url: 'https://developer.mozilla.org/en-US/docs/Web/API/Navigator/geolocation', + }, }), args: {}, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/lt.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/lt.ts index f627f532d93ed..aa6c0110f5f0f 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/lt.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/lt.ts @@ -8,14 +8,21 @@ import { i18n } from '@kbn/i18n'; import { lt } from '../../functions/common/lt'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.ltHelpText', { - defaultMessage: 'Return if the context is less than the argument', + defaultMessage: 'Returns whether the {CONTEXT} is less than the argument.', + values: { + CONTEXT, + }, }), args: { value: i18n.translate('xpack.canvas.functions.lt.args.valueHelpText', { - defaultMessage: 'The value to compare the context to', + defaultMessage: 'The value compared to the {CONTEXT}.', + values: { + CONTEXT, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/lte.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/lte.ts index 2516de9a58a1e..bf6c0bf56e828 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/lte.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/lte.ts @@ -8,14 +8,21 @@ import { i18n } from '@kbn/i18n'; import { lte } from '../../functions/common/lte'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.lteHelpText', { - defaultMessage: 'Return if the context is less than or equal to the argument', + defaultMessage: 'Returns whether the {CONTEXT} is less than or equal to the argument.', + values: { + CONTEXT, + }, }), args: { value: i18n.translate('xpack.canvas.functions.lte.args.valueHelpText', { - defaultMessage: 'The value to compare the context to', + defaultMessage: 'The value compared to the {CONTEXT}.', + values: { + CONTEXT, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/mapColumn.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/mapColumn.ts index 14e7949d5bd62..9aa41a0b634c0 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/mapColumn.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/mapColumn.ts @@ -8,20 +8,29 @@ import { i18n } from '@kbn/i18n'; import { mapColumn } from '../../functions/common/mapColumn'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CANVAS, DATATABLE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.mapColumnHelpText', { - defaultMessage: 'Add a column calculated as the result of other columns, or not', + defaultMessage: + 'Adds a column calculated as the result of other columns. ' + + 'Changes are made only when you provide arguments.' + + 'See also {mapColumnFn} and {staticColumnFn}.', + values: { + mapColumnFn: '`mapColumn`', + staticColumnFn: '`staticColumn`', + }, }), args: { name: i18n.translate('xpack.canvas.functions.mapColumn.args.nameHelpText', { - defaultMessage: 'The name of the resulting column', + defaultMessage: 'The name of the resulting column.', }), expression: i18n.translate('xpack.canvas.functions.mapColumn.args.expressionHelpText', { defaultMessage: - 'A canvas expression which will be passed each row as a single row {datatable}', + 'A {CANVAS} expression that is passed to each row as a single row {DATATABLE}.', values: { - datatable: 'datatable', + CANVAS, + DATATABLE, }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/markdown.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/markdown.ts index c78515461f699..8b5805d0246b1 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/markdown.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/markdown.ts @@ -8,25 +8,34 @@ import { i18n } from '@kbn/i18n'; import { markdown } from '../../functions/browser/markdown'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { MARKDOWN, CSS } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.markdownHelpText', { defaultMessage: - 'An element for rendering {markdown} text. Great for single numbers, metrics or paragraphs of text.', + 'Adds an element that renders {MARKDOWN} text. TIP: Use the {markdownFn} function for single numbers, metrics, and paragraphs of text.', values: { - markdown: 'markdown', + MARKDOWN, + markdownFn: '`markdown`', }, }), args: { content: i18n.translate('xpack.canvas.functions.markdown.args.contentHelpText', { defaultMessage: - 'A {markdown} expression. You can pass this multiple times to achieve concatenation', + 'A string of text that contains {MARKDOWN}. To concatenate, pass the {stringFn} function multiple times.', values: { - markdown: 'markdown', + MARKDOWN, + stringFn: '`string`', }, }), font: i18n.translate('xpack.canvas.functions.markdown.args.fontHelpText', { - defaultMessage: 'Font settings. Technically, you can add other styles in here as well', + defaultMessage: + 'The {CSS} font properties for the content. For example, {fontFamily} or {fontWeight}.', + values: { + CSS, + fontFamily: 'font-family', + fontWeight: 'font-weight', + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/math.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/math.ts index 076d5732d195a..a10e0b6ded5aa 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/math.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/math.ts @@ -8,26 +8,27 @@ import { i18n } from '@kbn/i18n'; import { math } from '../../functions/common/math'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { DATATABLE, CONTEXT, TINYMATH, TINYMATH_URL } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.mathHelpText', { defaultMessage: - 'Interpret a math expression, with a number or {datatable} as context. {Datatable} ' + - 'columns are available by their column name. If you pass in a number it is available ' + - 'as "{value}" (without the quotes)', + 'Interprets a {TINYMATH} math expression using a number or {DATATABLE} as {CONTEXT}. ' + + 'The {DATATABLE} columns are available by their column name. ' + + 'If the {CONTEXT} is a number it is available as {value}.', values: { - datatable: 'datatable', - Datatable: 'Datatable', - value: 'value', + TINYMATH, + CONTEXT, + DATATABLE, + value: '`value`', }, }), args: { expression: i18n.translate('xpack.canvas.functions.math.args.expressionHelpText', { - defaultMessage: 'An evaluated {tinymath} expression. (See {url})', + defaultMessage: 'An evaluated {TINYMATH} expression. See {TINYMATH_URL}.', values: { - tinymath: 'TinyMath', - url: - '[TinyMath Functions](https://www.elastic.co/guide/en/kibana/current/canvas-tinymath-functions.html)', + TINYMATH, + TINYMATH_URL, }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/metric.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/metric.ts index d88c50f4800dc..8e92cd9efa9bd 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/metric.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/metric.ts @@ -8,22 +8,33 @@ import { i18n } from '@kbn/i18n'; import { metric } from '../../functions/common/metric'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { FONT_FAMILY, FONT_WEIGHT, CSS } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.metricHelpText', { - defaultMessage: 'A number with a label', + defaultMessage: 'Displays a number over a label.', }), args: { label: i18n.translate('xpack.canvas.functions.metric.args.labelHelpText', { - defaultMessage: 'Text describing the metric', + defaultMessage: 'The text describing the metric.', }), metricFont: i18n.translate('xpack.canvas.functions.metric.args.metricFontHelpText', { defaultMessage: - 'Font settings for the metric. Technically you can stick other styles in here too!', + 'The {CSS} font properties for the metric. For example, {FONT_FAMILY} or {FONT_WEIGHT}.', + values: { + CSS, + FONT_FAMILY, + FONT_WEIGHT, + }, }), labelFont: i18n.translate('xpack.canvas.functions.metric.args.labelFontHelpText', { defaultMessage: - 'Font settings for the label. Technically you can stick other styles in here too!', + 'The {CSS} font properties for the label. For example, {FONT_FAMILY} or {FONT_WEIGHT}.', + values: { + CSS, + FONT_FAMILY, + FONT_WEIGHT, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/neq.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/neq.ts index 5420e77678277..88c2792393b47 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/neq.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/neq.ts @@ -8,14 +8,21 @@ import { i18n } from '@kbn/i18n'; import { neq } from '../../functions/common/neq'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.neqHelpText', { - defaultMessage: 'Return if the context is not equal to the argument', + defaultMessage: 'Returns whether the {CONTEXT} is not equal to the argument.', + values: { + CONTEXT, + }, }), args: { value: i18n.translate('xpack.canvas.functions.neq.args.valueHelpText', { - defaultMessage: 'The value to compare the context to', + defaultMessage: 'The value compared to the {CONTEXT}.', + values: { + CONTEXT, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/palette.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/palette.ts index 2139338ca63fa..59627f9d28d90 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/palette.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/palette.ts @@ -11,23 +11,26 @@ import { FunctionFactory } from '../../../types'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.paletteHelpText', { - defaultMessage: 'Create a color palette', + defaultMessage: 'Creates a color palette.', }), args: { color: i18n.translate('xpack.canvas.functions.palette.args.colorHelpText', { defaultMessage: - 'Palette colors, {rgba}, {hex}, or {html} color string. Pass this multiple times.', + 'The palette colors. Accepts an {html} color name, {hex}, {hsl}, {hsla}, {rgb}, or {rgba}.', values: { - rgba: 'rgba', - hex: 'hex', html: 'HTML', + rgb: 'RGB', + rgba: 'RGBA', + hex: 'HEX', + hsl: 'HSL', + hsla: 'HSLA', }, }), gradient: i18n.translate('xpack.canvas.functions.palette.args.gradientHelpText', { - defaultMessage: 'Prefer to make a gradient where supported and useful?', + defaultMessage: 'Make a gradient palette where supported?', }), reverse: i18n.translate('xpack.canvas.functions.palette.args.reverseHelpText', { - defaultMessage: 'Reverse the palette', + defaultMessage: 'Reverse the palette?', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/pie.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/pie.ts index 7e99d86d6b18c..3c90ac3ba9d6f 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/pie.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/pie.ts @@ -9,50 +9,65 @@ import { pie } from '../../functions/common/pie'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; import { Position } from '../../../types'; +import { CSS, FONT_FAMILY, FONT_WEIGHT, BOOLEAN_FALSE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.pieHelpText', { - defaultMessage: 'Configure a pie chart element', + defaultMessage: 'Configure a pie chart element.', }), args: { - palette: i18n.translate('xpack.canvas.functions.pie.args.paletteHelpText', { - defaultMessage: 'A {palette} object for describing the colors to use on this pie', - values: { - palette: 'palette', - }, - }), - seriesStyle: i18n.translate('xpack.canvas.functions.pie.args.seriesStyleHelpText', { - defaultMessage: 'A style of a specific series', - }), - radius: i18n.translate('xpack.canvas.functions.pie.args.radiusHelpText', { + font: i18n.translate('xpack.canvas.functions.pie.args.fontHelpText', { defaultMessage: - 'Radius of the pie as a percentage (between 0 and 1) of the available ' + - 'space. Set to `{auto}` to automatically set radius', + 'The {CSS} font properties for the labels. For example, {FONT_FAMILY} or {FONT_WEIGHT}.', values: { - auto: 'auto', + CSS, + FONT_FAMILY, + FONT_WEIGHT, }, }), hole: i18n.translate('xpack.canvas.functions.pie.args.holeHelpText', { - defaultMessage: 'Draw a hole in the pie, 0-100, as a percentage of the pie radius', - }), - labels: i18n.translate('xpack.canvas.functions.pie.args.labelsHelpText', { - defaultMessage: 'Show pie labels?', + defaultMessage: + 'Draws a hole in the pie, between `0` and `100`, as a percentage of the pie radius.', }), labelRadius: i18n.translate('xpack.canvas.functions.pie.args.labelRadiusHelpText', { - defaultMessage: 'Percentage of area of container to use as radius for the label circle', + defaultMessage: + 'The percentage of the container area to use as a radius for the label circle.', }), - font: i18n.translate('xpack.canvas.functions.pie.args.fontHelpText', { - defaultMessage: 'Label font', + labels: i18n.translate('xpack.canvas.functions.pie.args.labelsHelpText', { + defaultMessage: 'Display the pie labels?', }), legend: i18n.translate('xpack.canvas.functions.pie.args.legendHelpText', { - defaultMessage: 'Legend position: {position} or {false}', + defaultMessage: + 'The legend position. For example, {positions}, or {BOOLEAN_FALSE}. When {BOOLEAN_FALSE}, the legend is hidden.', + values: { + positions: Object.values(Position) + .map(position => `\`"${position}"\``) + .join(', '), + BOOLEAN_FALSE, + }, + }), + palette: i18n.translate('xpack.canvas.functions.pie.args.paletteHelpText', { + defaultMessage: + 'A {palette} object for describing the colors to use in this pie chart. See {paletteFn}.', values: { - position: Object.values(Position).join(', '), - false: 'false', + palette: '`palette`', + paletteFn: '`palette`', }, }), + radius: i18n.translate('xpack.canvas.functions.pie.args.radiusHelpText', { + defaultMessage: + 'The radius of the pie as a percentage, between `0` and `1`, of the available space. ' + + 'To automatically set the radius, use {auto}.', + values: { + auto: '`"auto"`', + }, + }), + seriesStyle: i18n.translate('xpack.canvas.functions.pie.args.seriesStyleHelpText', { + defaultMessage: 'A style of a specific series', + }), tilt: i18n.translate('xpack.canvas.functions.pie.args.tiltHelpText', { - defaultMessage: 'Percentage of tilt where 1 is fully vertical and 0 is completely flat', + defaultMessage: + 'The percentage of tilt where `1` is fully vertical, and `0` is completely flat.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/plot.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/plot.ts index 3c89b1d76f9e4..ad9cbd7cfec8a 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/plot.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/plot.ts @@ -9,47 +9,56 @@ import { plot } from '../../functions/common/plot'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; import { Position } from '../../../types'; +import { CSS, FONT_FAMILY, FONT_WEIGHT, BOOLEAN_FALSE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.plotHelpText', { - defaultMessage: 'Configure a {plot} element', - values: { - plot: 'plot', - }, + defaultMessage: 'Configure a chart element', }), args: { - seriesStyle: i18n.translate('xpack.canvas.functions.plot.args.seriesStyleHelpText', { - defaultMessage: 'A style of a specific series', - }), defaultStyle: i18n.translate('xpack.canvas.functions.plot.args.defaultStyleHelpText', { - defaultMessage: 'The default style to use for every series', + defaultMessage: 'The default style to use for every series.', }), - palette: i18n.translate('xpack.canvas.functions.plot.args.paletteHelpText', { - defaultMessage: 'A {palette} object for describing the colors to use on this plot', + font: i18n.translate('xpack.canvas.functions.plot.args.fontHelpText', { + defaultMessage: + 'The {CSS} font properties for the labels. For example, {FONT_FAMILY} or {FONT_WEIGHT}.', values: { - palette: 'palette', + CSS, + FONT_FAMILY, + FONT_WEIGHT, }, }), - font: i18n.translate('xpack.canvas.functions.plot.args.fontHelpText', { - defaultMessage: 'Legend and tick mark fonts', - }), legend: i18n.translate('xpack.canvas.functions.plot.args.legendHelpText', { - defaultMessage: 'Legend position: {position} or {false}', + defaultMessage: + 'The legend position. For example, {positions}, or {BOOLEAN_FALSE}. When {BOOLEAN_FALSE}, the legend is hidden.', values: { - position: Object.values(Position).join(', '), - false: 'false', + positions: Object.values(Position) + .map(position => `\`"${position}"\``) + .join(', '), + BOOLEAN_FALSE, }, }), - yaxis: i18n.translate('xpack.canvas.functions.plot.args.yaxisHelpText', { - defaultMessage: 'Axis configuration, or {false} to disable', + palette: i18n.translate('xpack.canvas.functions.plot.args.paletteHelpText', { + defaultMessage: + 'A {palette} object for describing the colors to use in this chart. See {paletteFn}.', values: { - false: 'false', + palette: '`palette`', + paletteFn: '`palette`', }, }), + seriesStyle: i18n.translate('xpack.canvas.functions.plot.args.seriesStyleHelpText', { + defaultMessage: 'A style of a specific series', + }), xaxis: i18n.translate('xpack.canvas.functions.plot.args.xaxisHelpText', { - defaultMessage: 'Axis configuration, or {false} to disable', + defaultMessage: 'The axis configuration. When {BOOLEAN_FALSE}, the axis is hidden.', + values: { + BOOLEAN_FALSE, + }, + }), + yaxis: i18n.translate('xpack.canvas.functions.plot.args.yaxisHelpText', { + defaultMessage: 'The axis configuration. When {BOOLEAN_FALSE}, the axis is hidden.', values: { - false: 'false', + BOOLEAN_FALSE, }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/ply.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/ply.ts index db709c5ebfb4a..1a4b4ab53a123 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/ply.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/ply.ts @@ -8,29 +8,35 @@ import { i18n } from '@kbn/i18n'; import { ply } from '../../functions/common/ply'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { DATATABLE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.plyHelpText', { defaultMessage: - 'Subdivide a {datatable} and pass the resulting tables into an expression, then merge the output', + 'Subdivides a {DATATABLE} by the unique values of the specified column, ' + + 'and passes the resulting tables into an expression, then merges the outputs of each expression', values: { - datatable: 'datatable', + DATATABLE, }, }), args: { by: i18n.translate('xpack.canvas.functions.ply.args.byHelpText', { - defaultMessage: 'The column to subdivide on', + defaultMessage: 'The column to subdivide the {DATATABLE}.', + values: { + DATATABLE, + }, }), expression: i18n.translate('xpack.canvas.functions.ply.args.expressionHelpText', { defaultMessage: - 'An expression to pass each resulting {datatable} into. Tips: \n' + - ' Expressions must return a {datatable}. Use `as` to turn literals into {datatable}.\n' + - ' Multiple expressions must return the same number of rows.' + - ' If you need to return a differing row count, pipe into another instance of {ply}.\n' + - ' If multiple expressions return the same columns, the last one wins.', + 'An expression to pass each resulting {DATATABLE} into. ' + + 'Tips: Expressions must return a {DATATABLE}. Use {asFn} to turn literals into {DATATABLE}s. ' + + 'Multiple expressions must return the same number of rows.' + + 'If you need to return a different row count, pipe into another instance of {plyFn}. ' + + 'If multiple expressions returns the columns with the same name, the last one wins.', values: { - datatable: 'datatable', - ply: 'ply', + asFn: '`as`', + DATATABLE, + plyFn: '`ply`', }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/pointseries.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/pointseries.ts index 92b4768e545e3..ceb0f0e8ac5fd 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/pointseries.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/pointseries.ts @@ -8,37 +8,37 @@ import { i18n } from '@kbn/i18n'; import { pointseries } from '../../functions/server/pointseries'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { DATATABLE, TINYMATH, TINYMATH_URL } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.pointseriesHelpText', { defaultMessage: - 'Turn a {datatable} into a point series model. Currently we differentiate measure ' + - 'from dimensions by looking for a {url}. If you enter a {tinymath} expression in your ' + + 'Turn a {DATATABLE} into a point series model. Currently we differentiate measure ' + + 'from dimensions by looking for a {TINYMATH} expression. See {TINYMATH_URL}. If you enter a {TINYMATH} expression in your ' + 'argument, we treat that argument as a measure, otherwise it is a dimension. Dimensions ' + 'are combined to create unique keys. Measures are then deduplicated by those keys using ' + - 'the specified {tinymath} function', + 'the specified {TINYMATH} function', values: { - datatable: 'datatable', - url: - '[TinyMath function](https://www.elastic.co/guide/en/kibana/current/canvas-tinymath-functions.html)', - tinymath: 'TinyMath', + DATATABLE, + TINYMATH, + TINYMATH_URL, }, }), args: { - x: i18n.translate('xpack.canvas.functions.pointseries.args.xHelpText', { - defaultMessage: 'The values along the x-axis', - }), - y: i18n.translate('xpack.canvas.functions.pointseries.args.yHelpText', { - defaultMessage: 'The values along the y-axis', - }), color: i18n.translate('xpack.canvas.functions.pointseries.args.colorHelpText', { - defaultMessage: "An expression to use in determining the mark's color", + defaultMessage: "An expression to use in determining the mark's color.", }), size: i18n.translate('xpack.canvas.functions.pointseries.args.sizeHelpText', { - defaultMessage: 'For elements that support it, the size of the marks', + defaultMessage: 'The size of the marks. Only applicable to supported elements.', }), text: i18n.translate('xpack.canvas.functions.pointseries.args.textHelpText', { - defaultMessage: 'For use in charts that support it, the text to show in the mark', + defaultMessage: 'The text to show on the mark. Only applicable to supported elements.', + }), + x: i18n.translate('xpack.canvas.functions.pointseries.args.xHelpText', { + defaultMessage: 'The values along the x-axis.', + }), + y: i18n.translate('xpack.canvas.functions.pointseries.args.yHelpText', { + defaultMessage: 'The values along the y-axis.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/progress.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/progress.ts index d856b0664c6a1..cde3ae71a39ca 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/progress.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/progress.ts @@ -10,46 +10,54 @@ import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; import { Shape } from '../../functions/common/progress'; +import { CSS, FONT_FAMILY, FONT_WEIGHT, BOOLEAN_TRUE, BOOLEAN_FALSE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.progressHelpText', { - defaultMessage: 'Configure a progress element', + defaultMessage: 'Configures a progress element.', }), args: { barColor: i18n.translate('xpack.canvas.functions.progress.args.barColorHelpText', { - defaultMessage: 'Color of the background bar', + defaultMessage: 'The color of the background bar.', }), barWeight: i18n.translate('xpack.canvas.functions.progress.args.barWeightHelpText', { - defaultMessage: 'Thickness of the background bar', + defaultMessage: 'The thickness of the background bar.', }), font: i18n.translate('xpack.canvas.functions.progress.args.fontHelpText', { defaultMessage: - 'Font settings for the label. Technically you can stick other styles in here too!', + 'The {CSS} font properties for the label. For example, {FONT_FAMILY} or {FONT_WEIGHT}.', + values: { + CSS, + FONT_FAMILY, + FONT_WEIGHT, + }, }), label: i18n.translate('xpack.canvas.functions.progress.args.labelHelpText', { - defaultMessage: `Set {true}/{false} to show/hide label or provide a string to display as the label`, + defaultMessage: + 'To show or hide labels, use {BOOLEAN_TRUE} or {BOOLEAN_FALSE}. Alternatively, provide a string to display as a label.', values: { - true: 'true', - false: 'false', + BOOLEAN_TRUE, + BOOLEAN_FALSE, }, }), max: i18n.translate('xpack.canvas.functions.progress.args.maxHelpText', { - defaultMessage: 'Maximum value of the progress element', + defaultMessage: 'The maximum value of the progress element.', }), shape: i18n.translate('xpack.canvas.functions.progress.args.shapeHelpText', { - defaultMessage: `Select {list}, or {end}`, + defaultMessage: `Select {list}, or {end}.`, values: { list: Object.values(Shape) .slice(0, -1) + .map(shape => `\`"${shape}"\``) .join(', '), - end: Object.values(Shape).slice(-1)[0], + end: `\`"${Object.values(Shape).slice(-1)[0]}"\``, }, }), valueColor: i18n.translate('xpack.canvas.functions.progress.args.valueColorHelpText', { - defaultMessage: 'Color of the progress bar', + defaultMessage: 'The color of the progress bar.', }), valueWeight: i18n.translate('xpack.canvas.functions.progress.args.valueWeightHelpText', { - defaultMessage: 'Thickness of the progress bar', + defaultMessage: 'The thickness of the progress bar.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/render.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/render.ts index 831a0d9eee81c..54185771417b4 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/render.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/render.ts @@ -8,29 +8,33 @@ import { i18n } from '@kbn/i18n'; import { render } from '../../functions/common/render'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT, CSS } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.renderHelpText', { defaultMessage: - 'Render an input as a specific element and set element level options such as styling', + 'Render the {CONTEXT} as a specific element and sets element level options, such as background and border styling.', + values: { + CONTEXT, + }, }), args: { as: i18n.translate('xpack.canvas.functions.render.args.asHelpText', { defaultMessage: - 'The element type to use in rendering. You probably want a specialized function instead, such as `{plot}` or `{grid}`', + 'The element type to render. You probably want a specialized function instead, such as {plotFn} or {shapeFn}.', values: { - plot: 'plot', - grid: 'grid', + plotFn: '`plot`', + shapeFn: '`shape`', }, }), css: i18n.translate('xpack.canvas.functions.render.args.cssHelpText', { - defaultMessage: 'Any block of custom {css} to be scoped to this element.', + defaultMessage: 'Any block of custom {CSS} to be scoped to the element.', values: { - css: 'CSS', + CSS, }, }), containerStyle: i18n.translate('xpack.canvas.functions.render.args.containerStyleHelpText', { - defaultMessage: 'Style for the container, including background, border, and opacity', + defaultMessage: 'The style for the container, including background, border, and opacity.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/repeatImage.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/repeatImage.ts index 129d1604403a9..92df1667e2bf5 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/repeatImage.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/repeatImage.ts @@ -8,32 +8,39 @@ import { i18n } from '@kbn/i18n'; import { repeatImage } from '../../functions/common/repeatImage'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT, BASE64, URL } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.repeatImageHelpText', { - defaultMessage: 'Configure a repeating image element', + defaultMessage: 'Configures a repeating image element.', }), args: { - image: i18n.translate('xpack.canvas.functions.repeatImage.args.imageHelpText', { - defaultMessage: 'The image to repeat. Usually a {dataurl} or an asset', + emptyImage: i18n.translate('xpack.canvas.functions.repeatImage.args.emptyImageHelpText', { + defaultMessage: + 'Fills the difference between the {CONTEXT} and {maxArg} parameter for the element with this image' + + 'Provide an image asset as a {BASE64} data {URL}, or pass in a sub-expression.', values: { - dataurl: 'dataURL', + BASE64, + CONTEXT, + maxArg: '`max`', + URL, }, }), - size: i18n.translate('xpack.canvas.functions.repeatImage.args.sizeHelpText', { + image: i18n.translate('xpack.canvas.functions.repeatImage.args.imageHelpText', { defaultMessage: - 'The maximum height or width of the image, in pixels. Eg, if you images is taller ' + - 'than it is wide, this will limit its height', + 'The image to repeat. Provide an image asset as a {BASE64} data {URL}, or pass in a sub-expression.', + values: { + BASE64, + URL, + }, }), max: i18n.translate('xpack.canvas.functions.repeatImage.args.maxHelpText', { - defaultMessage: 'Maximum number of times the image may repeat', + defaultMessage: 'The maximum number of times the image can repeat.', }), - emptyImage: i18n.translate('xpack.canvas.functions.repeatImage.args.emptyImageHelpText', { + size: i18n.translate('xpack.canvas.functions.repeatImage.args.sizeHelpText', { defaultMessage: - 'Fill the difference between the input and the `{max}` parameter with this image', - values: { - max: 'max=', - }, + 'The maximum height or width of the image, in pixels. ' + + 'When the image is taller than it is wide, this function limits the height.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/replace.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/replace.ts index 64f1d1b6d04dc..f2d27280cdfd6 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/replace.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/replace.ts @@ -8,22 +8,23 @@ import { i18n } from '@kbn/i18n'; import { replace } from '../../functions/common/replace'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { JS } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.replaceImageHelpText', { - defaultMessage: 'Use a regular expression to replace parts of a string', + defaultMessage: 'Use a regular expression to replace parts of a string.', }), args: { pattern: i18n.translate('xpack.canvas.functions.replace.args.patternHelpText', { defaultMessage: - 'The text or pattern of a {js} regular expression, eg "{example}". You can use capture groups here.', + 'The text or pattern of a {JS} regular expression. For example, {example}. You can use capturing groups here.', values: { - js: 'JavaScript', - example: '[aeiou]', + JS, + example: '`"[aeiou]"`', }, }), flags: i18n.translate('xpack.canvas.functions.replace.args.flagsHelpText', { - defaultMessage: 'Specify flags. See {url} for reference.', + defaultMessage: 'Specify flags. See {url}.', values: { url: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp', @@ -31,9 +32,9 @@ export const help: FunctionHelp> = { }), replacement: i18n.translate('xpack.canvas.functions.replace.args.replacementHelpText', { defaultMessage: - 'The replacement for the matching parts of string. Capture groups can be accessed by their index, eg {example}', + 'The replacement for the matching parts of string. Capturing groups can be accessed by their index. For example, {example}.', values: { - example: '$1', + example: '`"$1"`', }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/revealImage.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/revealImage.ts index fd98e79b40cae..0ef8bed9d9c78 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/revealImage.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/revealImage.ts @@ -9,22 +9,39 @@ import { revealImage } from '../../functions/common/revealImage'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; import { Position } from '../../../types'; +import { BASE64, URL } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.revealImageHelpText', { - defaultMessage: 'Configure an image reveal element', + defaultMessage: 'Configure an image reveal element.', }), args: { image: i18n.translate('xpack.canvas.functions.revealImage.args.imageHelpText', { - defaultMessage: 'The image to reveal', + defaultMessage: + 'The image to reveal. Provide an image asset as a {BASE64} data {URL}, ' + + 'or pass in a sub-expression.', + values: { + BASE64, + URL, + }, }), emptyImage: i18n.translate('xpack.canvas.functions.revealImage.args.emptyImageHelpText', { - defaultMessage: 'An optional background image to reveal over', + defaultMessage: + 'An optional background image to reveal over. ' + + 'Provide an image asset as a `{BASE64}` data {URL}, or pass in a sub-expression.', + values: { + BASE64, + URL, + }, }), origin: i18n.translate('xpack.canvas.functions.revealImage.args.originHelpText', { - defaultMessage: 'Where to start from, eg {position}', + defaultMessage: 'The position to start the image fill. For example, {list}, or {end}.', values: { - position: Object.values(Position).join(', '), + list: Object.values(Position) + .slice(0, -1) + .map(position => `\`"${position}"\``) + .join(', '), + end: Object.values(Position).slice(-1)[0], }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/rounddate.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/rounddate.ts index c9a778655348e..26901b0f7a776 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/rounddate.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/rounddate.ts @@ -8,24 +8,24 @@ import { i18n } from '@kbn/i18n'; import { rounddate } from '../../functions/common/rounddate'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { MOMENTJS } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.rounddateHelpText', { defaultMessage: - 'Round {ms} since epoch using a {moment} formatting string. Returns {ms} since epoch', + 'Uses a {MOMENTJS} formatting string to round milliseconds since epoch, and returns milliseconds since epoch.', values: { - ms: 'ms', - moment: 'MomentJS', + MOMENTJS, }, }), args: { format: i18n.translate('xpack.canvas.functions.rounddate.args.formatHelpText', { defaultMessage: - '{moment} format with which to bucket (See {url}). For example "{example}" would round to the month', + 'The {MOMENTJS} format to use for bucketing. For example, {example} would round each date to months. See {url}.', values: { - moment: 'MomentJS', + example: '`"YYYY-MM"`', + MOMENTJS, url: 'https://momentjs.com/docs/#/displaying/', - example: 'YYYY-MM', }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/rowCount.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/rowCount.ts index 41687b61e9885..8957d9e97645d 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/rowCount.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/rowCount.ts @@ -12,10 +12,10 @@ import { FunctionFactory } from '../../../types'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.rowCountHelpText', { defaultMessage: - 'Return the number of rows. Pair with {ply} to get the count of unique column ' + + 'Returns the number of rows. Pair with {plyFn} to get the count of unique column ' + 'values, or combinations of unique column values.', values: { - ply: 'ply', + plyFn: '`ply`', }, }), args: {}, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/seriesStyle.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/seriesStyle.ts index f1b6d7ca63269..377bcedde122e 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/seriesStyle.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/seriesStyle.ts @@ -13,39 +13,42 @@ export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.seriesStyleHelpText', { defaultMessage: 'Creates an object used for describing the properties of a series on a chart. ' + - 'You would usually use this inside of a charting function', + 'Use {seriesStyleFn} inside of a charting function, like {plotFn} or {pieFn}.', + values: { + seriesStyleFn: '`seriesStyle`', + pieFn: '`pie`', + plotFn: '`plot`', + }, }), args: { - label: i18n.translate('xpack.canvas.functions.seriesStyle.args.labelHelpText', { - defaultMessage: - 'The label of the line this style applies to, not the name you would like to ' + - 'give the line', + bars: i18n.translate('xpack.canvas.functions.seriesStyle.args.barsHelpText', { + defaultMessage: 'The width of bars.', }), color: i18n.translate('xpack.canvas.functions.seriesStyle.args.colorHelpText', { - defaultMessage: 'Color to assign the line', + defaultMessage: 'The line color.', }), - lines: i18n.translate('xpack.canvas.functions.seriesStyle.args.linesHelpText', { - defaultMessage: 'Width of the line', + fill: i18n.translate('xpack.canvas.functions.seriesStyle.args.fillHelpText', { + defaultMessage: 'Should we fill in the points?', }), - bars: i18n.translate('xpack.canvas.functions.seriesStyle.args.barsHelpText', { - defaultMessage: 'Width of bars', + horizontalBars: i18n.translate( + 'xpack.canvas.functions.seriesStyle.args.horizontalBarsHelpText', + { + defaultMessage: 'Sets the orientation of the bars in the chart to horizontal.', + } + ), + label: i18n.translate('xpack.canvas.functions.seriesStyle.args.labelHelpText', { + defaultMessage: 'The name of the series to style.', + }), + lines: i18n.translate('xpack.canvas.functions.seriesStyle.args.linesHelpText', { + defaultMessage: 'The width of the line.', }), points: i18n.translate('xpack.canvas.functions.seriesStyle.args.pointsHelpText', { defaultMessage: 'Size of points on line', }), - fill: i18n.translate('xpack.canvas.functions.seriesStyle.args.fillHelpText', { - defaultMessage: 'Should we fill points?', - }), stack: i18n.translate('xpack.canvas.functions.seriesStyle.args.stackHelpText', { defaultMessage: - 'Should we stack the series? This is the stack "id". Series with the same ' + - 'stack id will be stacked together', + 'Specifies if the series should be stacked. The number is the stack ID. ' + + 'Series with the same stack ID are stacked together.', }), - horizontalBars: i18n.translate( - 'xpack.canvas.functions.seriesStyle.args.horizontalBarsHelpText', - { - defaultMessage: 'Sets the orientation of bars in the chart to horizontal', - } - ), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/shape.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/shape.ts index bc8b8a13b5c5f..09edb9f2a3dea 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/shape.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/shape.ts @@ -8,32 +8,33 @@ import { i18n } from '@kbn/i18n'; import { shape } from '../../functions/common/shape'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { SVG } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.shapeHelpText', { - defaultMessage: 'Create a shape', + defaultMessage: 'Create a shape.', }), args: { + shape: i18n.translate('xpack.canvas.functions.shape.args.shapeHelpText', { + defaultMessage: 'Pick a shape.', + }), border: i18n.translate('xpack.canvas.functions.shape.args.borderHelpText', { - defaultMessage: 'Valid {css} color string', + defaultMessage: 'An {SVG} color for the border outlining the shape.', values: { - css: 'CSS', + SVG, }, }), borderWidth: i18n.translate('xpack.canvas.functions.shape.args.borderWidthHelpText', { - defaultMessage: 'Thickness of the border', - }), - shape: i18n.translate('xpack.canvas.functions.shape.args.shapeHelpText', { - defaultMessage: 'Pick a shape', + defaultMessage: 'The thickness of the border.', }), fill: i18n.translate('xpack.canvas.functions.shape.args.fillHelpText', { - defaultMessage: 'Valid {css} color string', + defaultMessage: 'An {SVG} color to fill the shape.', values: { - css: 'CSS', + SVG, }, }), maintainAspect: i18n.translate('xpack.canvas.functions.shape.args.maintainAspectHelpText', { - defaultMessage: 'Select true to maintain aspect ratio', + defaultMessage: `Maintain the shape's original aspect ratio?`, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/sort.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/sort.ts index 6a1cb515468f2..a7aed9d955aaa 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/sort.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/sort.ts @@ -8,26 +8,27 @@ import { i18n } from '@kbn/i18n'; import { sort } from '../../functions/common/sort'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { DATATABLE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.sortHelpText', { - defaultMessage: 'Sorts a datatable on a column', + defaultMessage: 'Sorts a datatable by the specified column.', }), args: { by: i18n.translate('xpack.canvas.functions.sort.args.byHelpText', { defaultMessage: - 'The column to sort on. If column is not specified, the {datatable} ' + - 'will be sorted on the first column.', + 'The column to sort by. When unspecified, the `{DATATABLE}` ' + + 'is sorted by the first column.', values: { - datatable: 'datatable', + DATATABLE, }, }), reverse: i18n.translate('xpack.canvas.functions.sort.args.reverseHelpText', { defaultMessage: - 'Reverse the sort order. If reverse is not specified, the {datatable} ' + - 'will be sorted in ascending order.', + 'Reverses the sorting order. When unspecified, the `{DATATABLE}` ' + + 'is sorted in ascending order.', values: { - datatable: 'datatable', + DATATABLE, }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/staticColumn.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/staticColumn.ts index 219ef44ffd0af..f967b6520ecf7 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/staticColumn.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/staticColumn.ts @@ -11,16 +11,21 @@ import { FunctionFactory } from '../../../types'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.staticColumnHelpText', { - defaultMessage: 'Add a column with a static value', + defaultMessage: + 'Add a column with the same static value in every row. See also {alterColumnFn} and {mapColumnFn}.', + values: { + alterColumnFn: '`alterColumn`', + mapColumnFn: '`mapColumn`', + }, }), args: { name: i18n.translate('xpack.canvas.functions.staticColumn.args.nameHelpText', { - defaultMessage: 'The name of the new column column', + defaultMessage: 'The name of the new column column.', }), value: i18n.translate('xpack.canvas.functions.staticColumn.args.valueHelpText', { defaultMessage: - 'The value to insert in each column. Tip: use a sub-expression to rollup ' + - 'other columns into a static value', + 'The value to insert in each row in the new column. Tip: use a sub-expression to rollup ' + + 'other columns into a static value.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/string.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/string.ts index f69410a011f10..7e87d0669f421 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/string.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/string.ts @@ -11,14 +11,11 @@ import { FunctionFactory } from '../../../types'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.stringHelpText', { - defaultMessage: - 'Output a string made of other strings. Mostly useful when combined with ' + - 'sub-expressions that output a string, or something castable to a string', + defaultMessage: 'Concatenates all of the arguments into a single string.', }), args: { value: i18n.translate('xpack.canvas.functions.string.args.valueHelpText', { - defaultMessage: - "One or more strings to join together. Don't forget spaces " + 'where needed!', + defaultMessage: 'The values to join together into one string. Include spaces where needed.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/switch.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/switch.ts index 8227a2102a401..8d5ec9a2b354e 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/switch.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/switch.ts @@ -8,17 +8,30 @@ import { i18n } from '@kbn/i18n'; import { switchFn } from '../../functions/common/switch'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CONTEXT } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.switchHelpText', { - defaultMessage: 'Perform conditional logic with multiple conditions', + defaultMessage: + 'Performs conditional logic with multiple conditions. ' + + 'See also {caseFn} which builds a {case} to pass to the {switchFn} function.', + values: { + case: '`case`', + caseFn: '`case`', + switchFn: '`switch`', + }, }), args: { case: i18n.translate('xpack.canvas.functions.switch.args.caseHelpText', { - defaultMessage: 'The list of conditions to check', + defaultMessage: 'The conditions to check', }), default: i18n.translate('xpack.canvas.functions.switch.args.defaultHelpText', { - defaultMessage: 'The default case if no cases match', + defaultMessage: + 'The value returned when no conditions are met. ' + + 'When unspecified and no conditions are met, the original {CONTEXT} is returned.', + values: { + CONTEXT, + }, }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/table.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/table.ts index b7111440dab3c..3a6ff57a9896d 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/table.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/table.ts @@ -8,28 +8,34 @@ import { i18n } from '@kbn/i18n'; import { table } from '../../functions/common/table'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { CSS, FONT_FAMILY, FONT_WEIGHT, BOOLEAN_FALSE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.tableHelpText', { - defaultMessage: 'Configure a {datatable} element', - values: { - datatable: 'datatable', - }, + defaultMessage: 'Configures a table element', }), args: { font: i18n.translate('xpack.canvas.functions.table.args.fontHelpText', { - defaultMessage: 'Font style', + defaultMessage: + 'The {CSS} font properties for the contents of the table. For example, {FONT_FAMILY} or {FONT_WEIGHT}.', + values: { + CSS, + FONT_FAMILY, + FONT_WEIGHT, + }, }), paginate: i18n.translate('xpack.canvas.functions.table.args.paginateHelpText', { defaultMessage: - 'Show pagination controls. If set to false only the first page will be displayed', + 'Show pagination controls? When {BOOLEAN_FALSE}, only the first page is displayed.', + values: { + BOOLEAN_FALSE, + }, }), perPage: i18n.translate('xpack.canvas.functions.table.args.perPageHelpText', { - defaultMessage: - 'Show this many rows per page. You probably want to raise this is disabling pagination', + defaultMessage: 'The number of rows to display on each page.', }), showHeader: i18n.translate('xpack.canvas.functions.table.args.showHeaderHelpText', { - defaultMessage: 'Show or hide the header row with titles for each column', + defaultMessage: 'Show/hide the header row with titles for each column.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/tail.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/tail.ts index c556a6814ff20..b97d90923f59c 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/tail.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/tail.ts @@ -8,20 +8,21 @@ import { i18n } from '@kbn/i18n'; import { tail } from '../../functions/common/tail'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { DATATABLE } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.tailHelpText', { - defaultMessage: 'Get the last N rows from the end of a {datatable}. Also see `{head}`', + defaultMessage: 'Retrieves the last N rows from the end of a {DATATABLE}. See also {headFn}.', values: { - datatable: 'datatable', - head: 'head', + DATATABLE, + headFn: '`head`', }, }), args: { count: i18n.translate('xpack.canvas.functions.tail.args.countHelpText', { - defaultMessage: 'Return this many rows from the end of the {datatable}', + defaultMessage: 'The number of rows to retrieve from the end of the {DATATABLE}.', values: { - datatable: 'datatable', + DATATABLE, }, }), }, diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/timefilter.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/timefilter.ts index 92737e41eed46..18c655ac683b3 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/timefilter.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/timefilter.ts @@ -8,36 +8,35 @@ import { i18n } from '@kbn/i18n'; import { timefilter } from '../../functions/common/timefilter'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { ISO8601, ELASTICSEARCH, DATEMATH } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.timefilterHelpText', { - defaultMessage: 'Create a {timefilter} for querying a source', - values: { - timefilter: 'timefilter', - }, + defaultMessage: 'Create a time filter for querying a source.', }), args: { column: i18n.translate('xpack.canvas.functions.timefilter.args.columnHelpText', { - defaultMessage: 'The column or field to attach the filter to', + defaultMessage: 'The column or field that you want to filter.', }), from: i18n.translate('xpack.canvas.functions.timefilter.args.fromHelpText', { - defaultMessage: 'Beginning of the range, in {iso} or {es} {dm} format', + defaultMessage: + 'The beginning of the range, in {ISO8601} or {ELASTICSEARCH} {DATEMATH} format', values: { - iso: 'ISO8601', - es: 'Elasticsearch', - dm: 'datemath', + DATEMATH, + ELASTICSEARCH, + ISO8601, }, }), to: i18n.translate('xpack.canvas.functions.timefilter.args.toHelpText', { - defaultMessage: 'End of the range, in {iso} or {es} {dm} format', + defaultMessage: 'The end of the range, in {ISO8601} or {ELASTICSEARCH} {DATEMATH} format', values: { - iso: 'ISO8601', - es: 'Elasticsearch', - dm: 'datemath', + DATEMATH, + ELASTICSEARCH, + ISO8601, }, }), - filterGroup: i18n.translate('xpack.canvas.functions.dropdownControl.args.filterGroupHelpText', { - defaultMessage: 'Group name for the filter', + filterGroup: i18n.translate('xpack.canvas.functions.timefilter.args.filterGroupHelpText', { + defaultMessage: 'The group name for the filter.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/timefilterControl.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/timefilterControl.ts index 50bdee68b4565..4d524c589550a 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/timefilterControl.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/timefilterControl.ts @@ -11,20 +11,17 @@ import { FunctionFactory } from '../../../types'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.timefilterControlHelpText', { - defaultMessage: 'Configure a {timefilter} control element', - values: { - timefilter: 'timefilter', - }, + defaultMessage: 'Configures a time filter control element.', }), args: { column: i18n.translate('xpack.canvas.functions.timefilterControl.args.columnHelpText', { - defaultMessage: 'The column or field to attach the filter to', + defaultMessage: 'The column or field that you want to filter.', }), compact: i18n.translate('xpack.canvas.functions.timefilterControl.args.compactHelpText', { - defaultMessage: 'Show the time filter as a button that triggers a popover', + defaultMessage: 'Shows the time filter as a button, which triggers a popover.', }), filterGroup: i18n.translate('xpack.canvas.functions.dropdownControl.args.filterGroupHelpText', { - defaultMessage: 'Group name for the filter', + defaultMessage: 'The group name for the filter.', }), }, }; diff --git a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/urlparam.ts b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/urlparam.ts index c72722325f7af..f623409d46e73 100644 --- a/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/urlparam.ts +++ b/x-pack/legacy/plugins/canvas/canvas_plugin_src/strings/functions/urlparam.ts @@ -8,27 +8,34 @@ import { i18n } from '@kbn/i18n'; import { urlparam } from '../../functions/browser/urlparam'; import { FunctionHelp } from '.'; import { FunctionFactory } from '../../../types'; +import { TYPE_STRING, URL } from '../constants'; export const help: FunctionHelp> = { help: i18n.translate('xpack.canvas.functions.urlparamHelpText', { defaultMessage: - 'Access {url} parameters and use them in expressions. Eg {example}. This will always return a string', + 'Retreives a {URL} parameter to use in an expression. ' + + 'The {urlparamFn} function always returns a {TYPE_STRING}. ' + + 'For example, you can retrieve the value {value} from the parameter {myVar} from the {URL} {example}).', values: { - url: 'URL', example: 'https://localhost:5601/app/canvas?myVar=20', + myVar: '`myVar`', + TYPE_STRING, + URL, + urlparamFn: '`urlparam`', + value: '`"20"`', }, }), args: { param: i18n.translate('xpack.canvas.functions.urlparam.args.paramHelpText', { - defaultMessage: 'The {url} hash parameter to access', + defaultMessage: 'The {URL} hash parameter to retrieve.', values: { - url: 'URL', + URL, }, }), default: i18n.translate('xpack.canvas.functions.urlparam.args.defaultHelpText', { - defaultMessage: 'Return this string if the {url} parameter is not defined', + defaultMessage: 'The string returned when the {URL} parameter is unspecified.', values: { - url: 'url', + URL, }, }), }, diff --git a/x-pack/legacy/plugins/canvas/common/lib/constants.ts b/x-pack/legacy/plugins/canvas/common/lib/constants.ts index 9361bc078e411..5e0ed0b66fa4e 100644 --- a/x-pack/legacy/plugins/canvas/common/lib/constants.ts +++ b/x-pack/legacy/plugins/canvas/common/lib/constants.ts @@ -32,3 +32,4 @@ export const MIN_ZOOM_LEVEL = ZOOM_LEVELS[0]; export const MAX_ZOOM_LEVEL = ZOOM_LEVELS[ZOOM_LEVELS.length - 1]; export const WORKPAD_CANVAS_BUFFER = 32; // 32px padding around the workpad export const CANVAS_LAYOUT_STAGE_CONTENT_SELECTOR = `canvasLayout__stageContent`; +export const DATATABLE_COLUMN_TYPES = ['string', 'number', 'null', 'boolean', 'date']; diff --git a/x-pack/legacy/plugins/canvas/public/functions/asset.js b/x-pack/legacy/plugins/canvas/public/functions/asset.js index cb032f2b54441..49162b16e0c8b 100644 --- a/x-pack/legacy/plugins/canvas/public/functions/asset.js +++ b/x-pack/legacy/plugins/canvas/public/functions/asset.js @@ -10,17 +10,16 @@ import { getAssetById } from '../state/selectors/assets'; export const asset = () => ({ name: 'asset', aliases: [], + type: 'string', + help: 'Retrieves Canvas workpad asset objects to provide as argument values. Usually images.', context: { types: ['null'], }, - type: 'string', - help: 'Use Canvas workpad asset objects to provide argument values. Usually images', args: { id: { aliases: ['_'], types: ['string'], - help: 'The ID of the asset value to return', - multi: false, + help: 'The ID of the asset to retrieve.', required: true, }, }, diff --git a/x-pack/legacy/plugins/canvas/public/functions/filters.js b/x-pack/legacy/plugins/canvas/public/functions/filters.js index e2798e70bad01..2e84be61a9667 100644 --- a/x-pack/legacy/plugins/canvas/public/functions/filters.js +++ b/x-pack/legacy/plugins/canvas/public/functions/filters.js @@ -35,6 +35,7 @@ function getFiltersByGroup(filters, groups = [], ungrouped = false) { export const filters = () => ({ name: 'filters', type: 'filter', + help: 'Aggregates element filters from the workpad for use elsewhere, usually a data source.', context: { types: ['null'], }, @@ -42,17 +43,16 @@ export const filters = () => ({ group: { aliases: ['_'], types: ['string'], - help: 'The name of the filter group to use', + help: 'The name of the filter group to use.', multi: true, }, ungrouped: { aliases: ['nogroup', 'nogroups'], types: ['boolean'], - help: "Don't include filters that belong to groups", + help: 'Exclude filters that belong to a filter group?', default: false, }, }, - help: 'Collect element filters on the workpad, usually to provide them to a data source', fn: (_, { group, ungrouped }) => { const filterList = getFiltersByGroup(getGlobalFilters(getState()), group, ungrouped); diff --git a/x-pack/legacy/plugins/canvas/public/functions/timelion.js b/x-pack/legacy/plugins/canvas/public/functions/timelion.js index 737a17e78ecec..1c8e46723edac 100644 --- a/x-pack/legacy/plugins/canvas/public/functions/timelion.js +++ b/x-pack/legacy/plugins/canvas/public/functions/timelion.js @@ -11,6 +11,8 @@ import { buildBoolArray } from '../../server/lib/build_bool_array'; export const timelion = () => ({ name: 'timelion', + type: 'datatable', + help: 'Use Timelion to extract one or more timeseries from many sources.', context: { types: ['filter'], }, @@ -18,32 +20,31 @@ export const timelion = () => ({ query: { types: ['string'], aliases: ['_', 'q'], - help: 'A timelion query', + help: 'A Timelion query', default: '".es(*)"', }, interval: { types: ['string'], - help: 'Bucket interval for the time series', + help: 'The bucket interval for the time series.', default: 'auto', }, from: { type: ['string'], - help: 'Elasticsearch date math string for the start of the time range', + help: 'The Elasticsearch `datemath` string for the beginning of the time range.', default: 'now-1y', }, to: { type: ['string'], - help: 'Elasticsearch date math string for the end of the time range', + help: 'The Elasticsearch `datemath` string for the end of the time range.', default: 'now', }, timezone: { type: ['string'], - help: 'Timezone for the time range', + help: + 'The timezone for the time range. See [Moment Timezone](https://momentjs.com/timezone/).', default: 'UTC', }, }, - type: 'datatable', - help: 'Use timelion to extract one or more timeseries from many sources', fn: (context, args) => { // Timelion requires a time range. Use the time range from the timefilter element in the // workpad, if it exists. Otherwise fall back on the function args. diff --git a/x-pack/legacy/plugins/canvas/public/functions/to.js b/x-pack/legacy/plugins/canvas/public/functions/to.js index 152472ad69b05..feb72969a39dd 100644 --- a/x-pack/legacy/plugins/canvas/public/functions/to.js +++ b/x-pack/legacy/plugins/canvas/public/functions/to.js @@ -10,7 +10,7 @@ import { registries } from 'plugins/interpreter/registries'; export const to = () => ({ name: 'to', aliases: [], - help: 'Explicitly cast from one type to another', + help: 'Explicitly casts the type of the _context_ to the specified type.', context: {}, args: { type: { diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index a1d4db952b9c2..0c88a858fabb4 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -4255,174 +4255,81 @@ "xpack.canvas.elements.verticalProgressBarHelpText": "進捗状況を垂直のバーで表示します", "xpack.canvas.elements.verticalProgressPillDisplayName": "垂直プログレスピル", "xpack.canvas.elements.verticalProgressPillHelpText": "進捗状況を垂直のピルで表示します", - "xpack.canvas.functions.all.args.conditionHelpText": "確認する 1 つまたは複数の条件です", - "xpack.canvas.functions.allHelpText": "すべての条件が true の場合、true を返します", "xpack.canvas.functions.alterColumn.args.columnHelpText": "変更する列の名前です", "xpack.canvas.functions.alterColumn.args.nameHelpText": "変更後の列名です。名前を変更しない場合は未入力のままにします", "xpack.canvas.functions.alterColumn.args.typeHelpText": "列の変換語のタイプです。タイプを変更しない場合は未入力のままにします", "xpack.canvas.functions.alterColumn.cannotConvertTypeErrorMessage": "「{type}」に変換できません", "xpack.canvas.functions.alterColumn.columnNotFoundErrorMessage": "列が見つかりません: 「{column}」", - "xpack.canvas.functions.alterColumnHelpText": "コアタイプ (例: {examples}) を変換し、列名を変更します", - "xpack.canvas.functions.any.args.conditionHelpText": "確認する 1 つまたは複数の条件です", - "xpack.canvas.functions.anyHelpText": "いずれかの条件が true の場合、true を返します", "xpack.canvas.functions.as.args.nameHelpText": "列に付ける名前です", - "xpack.canvas.functions.asHelpText": "確認する 1 つまたは複数の条件です", - "xpack.canvas.functions.axisConfig.args.maxHelpText": "軸に表示する最高値です。{ms} または {iso} 文字列の数字または日付でなければなりません", - "xpack.canvas.functions.axisConfig.args.minHelpText": "軸に表示する最低値です。{ms} または {iso} 文字列の数字または日付でなければなりません", - "xpack.canvas.functions.axisConfig.args.positionHelpText": "軸ラベルの配置: {examples}", "xpack.canvas.functions.axisConfig.args.showHelpText": "軸ラベルを表示しますか?", "xpack.canvas.functions.axisConfig.args.tickSizeHelpText": "目盛り間の増加量。数字軸のみで使用されます", "xpack.canvas.functions.axisConfig.invalidMaxPositionErrorMessage": "無効なデータ文字列: 「{max}」。「max」は数字、ms での日付、または ISO8601 データ文字列出なければなりません", "xpack.canvas.functions.axisConfig.invalidMinDateStringErrorMessage": "無効なデータ文字列: 「{min}」。「min」は数字、ms での日付、または ISO8601 データ文字列出なければなりません", "xpack.canvas.functions.axisConfig.invalidPositionErrorMessage": "無効なポジション: 「{position}」", - "xpack.canvas.functions.axisConfigHelpText": "ビジュアライゼーションの軸を構成します", - "xpack.canvas.functions.case.args.ifHelpText": "この値は条件が満たされたかどうかに使用されます。両方が入力されている場合、無名の引数を上書きします。", "xpack.canvas.functions.case.args.thenHelpText": "条件が満たされた際に戻る値です", - "xpack.canvas.functions.case.args.whenHelpText": "この値は、条件が満たされているかどうか確認するために、コンテキストと比較されます。両方が入力されている場合、「{if}」引数で上書きされます。", - "xpack.canvas.functions.caseHelpText": "{switch} 関数に渡すケース (条件/結果を含む) を作成します", - "xpack.canvas.functions.clearHelpText": "コンテキストを消去して 0 戻します", - "xpack.canvas.functions.columns.args.excludeHelpText": "コンマ区切りの表から削除する列名のリストです", - "xpack.canvas.functions.columns.args.includeHelpText": "コンマ区切りの表に残す列名のリストです", - "xpack.canvas.functions.columnsHelpText": "データ表の列を含む、または除外します。両方指定した場合、まずこれが除外されます", "xpack.canvas.functions.compare.args.opHelpText": "比較で使用する演算子です: {eq} (equal to)、{gt} (greater than)、{gte} (greater than or equal to)、{lt} (less than)、{lte} (less than or equal to)、{ne} または {neq} (not equal to)", - "xpack.canvas.functions.compare.args.toHelpText": "コンテキストを比較する値です。通常部分式によって返されます", "xpack.canvas.functions.compare.invalidCompareOperatorErrorMessage": "無効な比較演算子: 「{op}」。{ops} を使用してください", - "xpack.canvas.functions.compareHelpText": "インプットを他と比較して true または false を判断します。通常「{if}」と組み合わせて使用されます。{examples} などの基本タイプにのみ使用できます。", - "xpack.canvas.functions.containerStyle.args.backgroundColorHelpText": "有効な {css} 背景色文字列", - "xpack.canvas.functions.containerStyle.args.backgroundImageHelpText": "有効な {css} 背景画像文字列", - "xpack.canvas.functions.containerStyle.args.backgroundRepeatHelpText": "有効な {css} 背景繰り返し文字列", - "xpack.canvas.functions.containerStyle.args.backgroundSizeHelpText": "有効な {css} 背景サイズ文字列", - "xpack.canvas.functions.containerStyle.args.borderHelpText": "有効な {css} 境界文字列", "xpack.canvas.functions.containerStyle.args.borderRadiusHelpText": "境界を丸くする際に使用されるピクセル数です", "xpack.canvas.functions.containerStyle.args.opacityHelpText": "0 から 1 までの数字で、エレメントの透明度を示します", - "xpack.canvas.functions.containerStyle.args.overflowHelpText": "コンテナーのオーバーフローを設定します", "xpack.canvas.functions.containerStyle.args.paddingHelpText": "ピクセル単位のコンテンツの境界からの距離です", "xpack.canvas.functions.containerStyle.invalidBackgroundImageErrorMessage": "無効な背景画像。アセットまたは URL を入力してください。", - "xpack.canvas.functions.containerStyleHelpText": "チャートの数列のプロパティの説明に使用されるオブジェクトを作成します。通常はチャート作成機能で使用します", - "xpack.canvas.functions.contextHelpText": "渡したものをすべて返します。これは、コンテキストを部分式として関数の引数として使用する際に有効です。", - "xpack.canvas.functions.csv.args.dataHelpText": "使用する {csv} データです", "xpack.canvas.functions.csv.args.delimeterHelpText": "データの区切り文字", "xpack.canvas.functions.csv.args.newlineHelpText": "行の区切り文字", "xpack.canvas.functions.csv.invalidInputCSVErrorMessage": "インプット CSV の解析中にエラーが発生しました。", - "xpack.canvas.functions.csvHelpText": "{csv} インプットからデータ表を作成します", - "xpack.canvas.functions.date.args.formatHelpText": "オプションの日付文字列を解析するための {moment} フォーマットです ({url} を参照)", - "xpack.canvas.functions.date.args.valueHelpText": "新紀元からのミリ秒に解析するオプションの日付文字列有効な Javascript 日付インプット、またはフォーマット引数を使用して解析する文字列のどちらかが使用できます。{iso} 文字列を使用するか、フォーマットを提供する必要があります", "xpack.canvas.functions.date.invalidDateInputErrorMessage": "無効な日付インプット: {date}", "xpack.canvas.functions.dateHelpText": "現在時刻、または文字列から解析された時刻を新紀元からのミリ秒で返します", "xpack.canvas.functions.demodata.args.typeHelpText": "使用するデモデータセットの名前です", "xpack.canvas.functions.demodata.invalidDataSetErrorMessage": "無効なデータセット: 「{arg}」。「{ci}」または「{shirts}」を使用してください", "xpack.canvas.functions.demodataHelpText": "プロジェクト {ci} の回数ととユーザー名、国、実行フェーズを含むデ模擬データセットです", - "xpack.canvas.functions.do.args.fnHelpText": "1 つまたは複数の部分式です。この関数は渡されたコンテキストを返すだけのため、これらの値はルートパイプラインで利用できません", - "xpack.canvas.functions.doHelpText": "複数部分式を実行します。渡されたコンテキストを返します。関数を生成するアクションの実行に有効です。", "xpack.canvas.functions.dropdownControl.args.filterColumnHelpText": "フィルターを添付する列またはフィールドです", "xpack.canvas.functions.dropdownControl.args.filterGroupHelpText": "フィルターのグループ名です", "xpack.canvas.functions.dropdownControl.args.valueColumnHelpText": "ドロップダウンの固有値を抽出する元のデータ表です", "xpack.canvas.functions.dropdownControlHelpText": "ドロップダウンフィルターのコントロールエレメントを構成します", - "xpack.canvas.functions.eq.args.valueHelpText": "コンテキストの比較対象となる値です", - "xpack.canvas.functions.eqHelpText": "コンテキストが引数と同じ場合に返します", "xpack.canvas.functions.escount.args.indexHelpText": "インデックスパターンを指定します例: 「{example}」", - "xpack.canvas.functions.escount.args.queryHelpText": "{lucene} クエリ文字列", - "xpack.canvas.functions.escountHelpText": "{es} にクエリを実行してクエリに一致するヒット数を求めます", "xpack.canvas.functions.esdocs.args.countHelpText": "引き戻すドキュメント数です。値が小さいほどパフォーマンスが向上します", "xpack.canvas.functions.esdocs.args.fieldsHelpText": "フィールドのコンマ区切りのリストです。フィールドが少ないほどパフォーマンスが向上します", "xpack.canvas.functions.esdocs.args.indexHelpText": "インデックスパターンを指定します例: 「{example}」", "xpack.canvas.functions.esdocs.args.metaFieldsHelpText": "メタフィールドのコンマ区切りのリストです。例: 「{example}」", - "xpack.canvas.functions.esdocs.args.queryHelpText": "{lucene} クエリ文字列です", "xpack.canvas.functions.esdocs.args.sortHelpText": "方向を「{directions}」として分類します。例: 「{example1}」または「{example2}」", - "xpack.canvas.functions.esdocsHelpText": "{es} にクエリを実行して生ドキュメントを取得します。特に多くの行を必要とする場合、希望のフィールドを指定することをお勧めします", "xpack.canvas.functions.essql.args.countHelpText": "引き戻すドキュメント数です。値が小さいほどパフォーマンスが向上します", - "xpack.canvas.functions.essql.args.queryHelpText": "{sql} クエリ", - "xpack.canvas.functions.essql.args.timezoneHelpText": "日付演算に使用するタイムゾーンです。有効な {iso} フォーマットと {utc} オフセットの両方が使用できます", - "xpack.canvas.functions.essqlHelpText": "{essql}", "xpack.canvas.functions.exactly.args.columnHelpText": "フィルターを添付する列またはフィールドです", "xpack.canvas.functions.exactly.args.valueHelpText": "ホワイトスペースと大文字・小文字を含め、正確に一致させる値です", "xpack.canvas.functions.exactlyHelpText": "特定の列をピッタリと正確な値に一致させるフィルターを作成します", - "xpack.canvas.functions.filterrows.args.fnHelpText": "データ表の各行を渡す表現です。この表現はブールを返します。行は値が true の場合残り、false の場合削除されます。", - "xpack.canvas.functions.filterrowsHelpText": "データ表の行を部分式から返された値に基づきフィルタリングします。", - "xpack.canvas.functions.formatdate.args.formatHelpText": "{moment} バケットするフォーマットです ({url} を参照)", - "xpack.canvas.functions.formatdateHelpText": "{moment} を使用して有効な日付文字列または新紀元以降の {ms} の数をフォーマットします ({url} を参照)", - "xpack.canvas.functions.formatnumber.args.formatHelpText": "{numeralJS} 文字列のフォーマットです {url}", - "xpack.canvas.functions.formatnumberHelpText": "{numeralJS} フォーマットで数字を文字列に変換します", - "xpack.canvas.functions.getCell.args.columnHelpText": "取得する列の名前です", "xpack.canvas.functions.getCell.args.rowHelpText": "列番号で、0 から開始します", "xpack.canvas.functions.getCell.columnNotFoundErrorMessage": "列が見つかりません: 「{column}」", "xpack.canvas.functions.getCell.rowNotFoundErrorMessage": "行が見つかりません: 「{row}」", - "xpack.canvas.functions.getCellHelpText": "表から単一のセルを取得します", - "xpack.canvas.functions.gt.args.valueHelpText": "コンテキストの比較対象となる値です", - "xpack.canvas.functions.gte.args.valueHelpText": "コンテキストの比較対象となる値です", - "xpack.canvas.functions.gteHelpText": "コンテキストが引数以上の場合に返します", - "xpack.canvas.functions.gtHelpText": "コンテキストが引数より大きい場合に返します", - "xpack.canvas.functions.head.args.countHelpText": "{datatable} の始めからこの数の列を返します", - "xpack.canvas.functions.headHelpText": "{datatable} から初めの {n} 列を取得します。「{tail}」も参照", - "xpack.canvas.functions.if.args.conditionHelpText": "ブールが true かfalse か、通常部分式により返されます。この値が入力されていない場合は、インプットコンテキストが使用されます", - "xpack.canvas.functions.if.args.elseHelpText": "False の場合の戻り値です。他が指定されておらず、条件が false の場合、関数のインプットコンテキストが返されます", - "xpack.canvas.functions.if.args.thenHelpText": "True の場合の戻り値です。", "xpack.canvas.functions.ifHelpText": "条件付きロジックを実行します", - "xpack.canvas.functions.image.args.dataurlHelpText": "画像の HTTP(S) URL または base64 データです。", - "xpack.canvas.functions.image.args.modeHelpText": "「{contain}」はサイズに合わせて拡大・縮小して画像全体を表示し「{cover}」はコンテナーを画像で埋め、必要に応じて両端や下をクロップします。「{stretch}」は画像の高さと幅をコンテナーの 100% になるよう変更します", + "xpack.canvas.functions.image.args.modeHelpText": "{contain}はサイズに合わせて拡大・縮小して画像全体を表示し{cover}はコンテナーを画像で埋め、必要に応じて両端や下をクロップします。{stretch}は画像の高さと幅をコンテナーの 100% になるよう変更します", "xpack.canvas.functions.image.invalidImageModeErrorMessage": "「mode」は「{contain}」、「{cover}」、または「{stretch}」でなければなりません", - "xpack.canvas.functions.imageHelpText": "画像を表示します", - "xpack.canvas.functions.locationHelpText": "ブラウザの位置情報機能を使用して現在位置を把握します。通常非常に遅いですが、比較的正確です", - "xpack.canvas.functions.lt.args.valueHelpText": "コンテキストの比較対象となる値です", - "xpack.canvas.functions.lte.args.valueHelpText": "コンテキストの比較対象となる値です", - "xpack.canvas.functions.lteHelpText": "コンテキストが引数以下の場合に返します", - "xpack.canvas.functions.ltHelpText": "コンテキストが引数より小きい場合に返します", - "xpack.canvas.functions.mapColumn.args.expressionHelpText": "各行が単一の行として渡されるキャンバス表現です {datatable}", "xpack.canvas.functions.mapColumn.args.nameHelpText": "結果の列の名前です", - "xpack.canvas.functions.mapColumnHelpText": "他の列の結果として計算された列を追加するかしないかです", - "xpack.canvas.functions.markdown.args.contentHelpText": "{markdown} 表現です。複数回渡して連結させることができます", - "xpack.canvas.functions.markdown.args.fontHelpText": "フォント設定です。厳密に言えば、ここに他のスタイルを追加することもできます", - "xpack.canvas.functions.markdownHelpText": "{markdown} テキストのレンダリングのエレメントです。単一の数字、メトリック、テキストの段落に有効です。", - "xpack.canvas.functions.math.args.expressionHelpText": "評価された {tinymath} 表現です。({url} を参照)", "xpack.canvas.functions.math.emptyDatatableErrorMessage": "空のデータベース", "xpack.canvas.functions.math.emptyExpressionErrorMessage": "空の表現", "xpack.canvas.functions.math.executionFailedErrorMessage": "数式の実行に失敗しました。列名を確認してください", "xpack.canvas.functions.math.tooManyResultsErrorMessage": "表現は 1 つの数字を返す必要があります。表現を {mean} または {sum} で囲んでみてください", - "xpack.canvas.functions.mathHelpText": "数字または {datatable} をコンテキストとして数式を解釈します。{Datatable} の列は列名で利用できます。数字を渡した場合、「{value}」として利用可能になります (括弧ぬき)", - "xpack.canvas.functions.metric.args.labelFontHelpText": "ラベルのフォント設定です。厳密に言えば、ここに他のスタイルを追加することもできます!", "xpack.canvas.functions.metric.args.labelHelpText": "メトリックを説明するテキストです", - "xpack.canvas.functions.metric.args.metricFontHelpText": "メトリックのフォント設定です。厳密に言えば、ここに他のスタイルを追加することもできます!", "xpack.canvas.functions.metricHelpText": "ラベル付きの数字です", - "xpack.canvas.functions.neq.args.valueHelpText": "コンテキストの比較対象となる値です", - "xpack.canvas.functions.neqHelpText": "コンテキストが引数と同じでない場合に返します", - "xpack.canvas.functions.palette.args.colorHelpText": "パレットからー、{rgba}、{hex}、または {html} のカラー文字列です。これを複数回渡します。", "xpack.canvas.functions.palette.args.gradientHelpText": "サポートされていて有効な場合にグラデーションを使用しますか?", "xpack.canvas.functions.palette.args.reverseHelpText": "パレットを反転させます", "xpack.canvas.functions.paletteHelpText": "カラーパレットを作成します", - "xpack.canvas.functions.pie.args.fontHelpText": "ラベルのフォントです", "xpack.canvas.functions.pie.args.holeHelpText": "円グラフに穴をあけます、0~100 で円グラフのパーセンテージを指定します", "xpack.canvas.functions.pie.args.labelRadiusHelpText": "ラベルの円の半径として使用する、コンテナーの免責のパーセンテージです", "xpack.canvas.functions.pie.args.labelsHelpText": "円グラフのラベルを表示しますか?", - "xpack.canvas.functions.pie.args.legendHelpText": "凡例の配置: {position} または {false}", - "xpack.canvas.functions.pie.args.paletteHelpText": "この円グラフに使用されている色を説明する {palette} オブジェクトです。", "xpack.canvas.functions.pie.args.radiusHelpText": "利用可能なスペースのパーセンテージで示された円グラフの半径です (0 から 1 の間)。半径を自動的に設定するには「{auto}」に設定します", "xpack.canvas.functions.pie.args.seriesStyleHelpText": "特定の数列のスタイルです", "xpack.canvas.functions.pie.args.tiltHelpText": "1 が完全に垂直、0 が完全に平らを表す傾きのパーセンテージです", "xpack.canvas.functions.pieHelpText": "円グラフのエレメントを構成します", "xpack.canvas.functions.plot.args.defaultStyleHelpText": "すべての数列に使用するデフォルトのスタイルです", - "xpack.canvas.functions.plot.args.fontHelpText": "凡例と目盛りのフォントです", - "xpack.canvas.functions.plot.args.legendHelpText": "凡例の配置: {position} または {false}", - "xpack.canvas.functions.plot.args.paletteHelpText": "このプロットに使用されている色を説明する {palette} オブジェクトです。", "xpack.canvas.functions.plot.args.seriesStyleHelpText": "特定の数列のスタイルです", - "xpack.canvas.functions.plot.args.xaxisHelpText": "軸の構成、{false} で無効にします", - "xpack.canvas.functions.plot.args.yaxisHelpText": "軸の構成、{false} で無効にします", - "xpack.canvas.functions.plotHelpText": "{plot} エレメントを構成します", - "xpack.canvas.functions.ply.args.byHelpText": "細分する列です", - "xpack.canvas.functions.ply.args.expressionHelpText": "それぞれの結果の {datatable} を渡す先の表現です。アドバイス:\n 表現は {datatable} を返す必要があります。直定数を {datatable} にするには「as」を使用します。\n 複数表現を使用する場合、同じ行数を返す必要があります。異なる行数を返す必要がある場合は、{ply} の別のインスタンスにパイピングします。\n 複数表現が同じ行を返した場合、最後の行が優先されます。", "xpack.canvas.functions.ply.columnNotFoundErrorMessage": "列が見つかりません: 「{by}」", "xpack.canvas.functions.ply.rowCountMismatchErrorMessage": "すべての表現が同じ行数を返す必要があります。", - "xpack.canvas.functions.plyHelpText": "{datatable} を細分して結果の表を表現に渡し、アウトプットを結合します", "xpack.canvas.functions.pointseries.args.colorHelpText": "マークの色を決めるのに使用する表現です", "xpack.canvas.functions.pointseries.args.sizeHelpText": "サポートしているエレメントでは、マークのサイズです。", "xpack.canvas.functions.pointseries.args.textHelpText": "サポートしているチャートで使用された場合、マークに表示するテキストです", "xpack.canvas.functions.pointseries.args.xHelpText": "X 軸の値です", "xpack.canvas.functions.pointseries.args.yHelpText": "Y 軸の値です", "xpack.canvas.functions.pointseries.unwrappedExpressionErrorMessage": "表現は {fn} などの関数で囲む必要があります", - "xpack.canvas.functions.pointseriesHelpText": "{datatable} を点の配列モデルに変換します。現在 {url} でディメンションのメジャーを区別します。引数に {tinymath} 表現が入力された場合、その引数をメジャーとして使用し、そうでない場合はディメンションになります。ディメンションを組み合わせて固有のキーを作成します。その後メジャーはそれらのキーで、指定された {tinymath} 関数を使用して複製されます。", "xpack.canvas.functions.progress.args.barColorHelpText": "背景バーの色です", "xpack.canvas.functions.progress.args.barWeightHelpText": "背景バーの太さです", - "xpack.canvas.functions.progress.args.fontHelpText": "ラベルのフォント設定です。厳密に言えば、ここに他のスタイルを追加することもできます!", - "xpack.canvas.functions.progress.args.labelHelpText": "{true}/{false} でラベルの表示/非表示を設定するか、ラベルとして表示する文字列を指定します", "xpack.canvas.functions.progress.args.maxHelpText": "進捗エレメントの最高値です", "xpack.canvas.functions.progress.args.shapeHelpText": "{list} または {end} を選択します", "xpack.canvas.functions.progress.args.valueColorHelpText": "プログレスバーの色です", @@ -4430,27 +4337,15 @@ "xpack.canvas.functions.progress.invalidMaxValueErrorMessage": "無効な {arg} 値: 「{max, number}」。「{arg}」は 0 より大きい必要があります", "xpack.canvas.functions.progress.invalidValueErrorMessage": "無効な値: 「{value, number}」。値は 0 と {max, number} の間でなければなりません", "xpack.canvas.functions.progressHelpText": "進捗エレメントを構成します", - "xpack.canvas.functions.render.args.asHelpText": "レンダリングに使用するエレメントタイプです。代わりに「{plot}」や「{grid}」などの特殊な関数を使用するほうがいいでしょう", "xpack.canvas.functions.render.args.containerStyleHelpText": "背景、境界、透明度を含む、コンテナーのスタイルです", - "xpack.canvas.functions.render.args.cssHelpText": "このエレメントの対象となるカスタム {css} のブロックです。", - "xpack.canvas.functions.renderHelpText": "インプットを特定のエレメントとしてレンダリングし、スタイルなどのエレメントレベルのオプションを設定します", - "xpack.canvas.functions.repeatImage.args.emptyImageHelpText": "この画像でインプットと「{max}」パラメーターの差を埋めます", - "xpack.canvas.functions.repeatImage.args.imageHelpText": "繰り返す画像です。通常 {dataurl} またはアセットです", "xpack.canvas.functions.repeatImage.args.maxHelpText": "画像が繰り返される最高回数です", "xpack.canvas.functions.repeatImage.args.sizeHelpText": "画像の高さまたは幅のピクセル単位での最高値です。例えば画像が縦長の場合、高さが制限されます", "xpack.canvas.functions.repeatImageHelpText": "繰り返し画像エレメントを構成します", "xpack.canvas.functions.replace.args.flagsHelpText": "フラグを指定します。{url} をご参照ください。", - "xpack.canvas.functions.replace.args.patternHelpText": "{js} 正規表現のテキストまたはパターンです。例: 「{example}」ここではキャプチャグループを使用できます。", "xpack.canvas.functions.replace.args.replacementHelpText": "文字列の一致する部分の代わりです。キャプチャグループはノードによってアクセス可能です。例: {example}", "xpack.canvas.functions.replaceImageHelpText": "正規表現で文字列の一部を置き換えます", - "xpack.canvas.functions.revealImage.args.emptyImageHelpText": "表示される背景画像です", - "xpack.canvas.functions.revealImage.args.imageHelpText": "表示する画像", - "xpack.canvas.functions.revealImage.args.originHelpText": "開始地点です。例: {position}", "xpack.canvas.functions.revealImage.invalidPercentErrorMessage": "無効な値: 「{percent}」.パーセンテージは 0 と 1 の間でなければなりません ", "xpack.canvas.functions.revealImageHelpText": "画像表示エレメントを構成します", - "xpack.canvas.functions.rounddate.args.formatHelpText": "バケットする {moment} フォーマットです ({url} を参照)例: 「{example}」は月単位で四捨五入します", - "xpack.canvas.functions.rounddateHelpText": "{moment} フォーマット文字列を使用して新世紀から {ms} を四捨五入します。新世紀からの {ms} を返します", - "xpack.canvas.functions.rowCountHelpText": "行数を返します。{ply} と組み合わせて、固有の列の値の数、または固有の列の値の組み合わせを求めます。", "xpack.canvas.functions.seriesStyle.args.barsHelpText": "バーの幅", "xpack.canvas.functions.seriesStyle.args.colorHelpText": "線に割り当てる色", "xpack.canvas.functions.seriesStyle.args.fillHelpText": "点を塗りつぶしますか?", @@ -4458,43 +4353,16 @@ "xpack.canvas.functions.seriesStyle.args.labelHelpText": "このスタイルが適用される線のラベルで、線に付ける名前ではありません", "xpack.canvas.functions.seriesStyle.args.linesHelpText": "線の幅", "xpack.canvas.functions.seriesStyle.args.pointsHelpText": "線上の点のサイズです", - "xpack.canvas.functions.seriesStyle.args.stackHelpText": "数列をスタックしますか?これはスタック「ID」です。同じスタック ID の数列は一緒にスタックされます", - "xpack.canvas.functions.seriesStyleHelpText": "チャートの数列のプロパティの説明に使用されるオブジェクトを作成します。通常はチャート作成機能で使用します", - "xpack.canvas.functions.shape.args.borderHelpText": "有効な {css} の色の設定です", "xpack.canvas.functions.shape.args.borderWidthHelpText": "境界の太さです", - "xpack.canvas.functions.shape.args.fillHelpText": "有効な {css} の色の設定です", - "xpack.canvas.functions.shape.args.maintainAspectHelpText": "アスペクト比を維持するには true を選択します", "xpack.canvas.functions.shape.args.shapeHelpText": "図形を選択します", "xpack.canvas.functions.shapeHelpText": "図形を作成します", - "xpack.canvas.functions.sort.args.byHelpText": "並べる列です。列が指定されていない場合は、{datatable} が初めの列に並べられます。", - "xpack.canvas.functions.sort.args.reverseHelpText": "並び順を反転させます。反転が指定されていない場合、{datatable} は昇順に並べられます。", "xpack.canvas.functions.sortHelpText": "データ表を列に並べます", "xpack.canvas.functions.staticColumn.args.nameHelpText": "新しい列の名前です", - "xpack.canvas.functions.staticColumn.args.valueHelpText": "各列に挿入する値です。ヒント: 部分式を使用して他の列を静的値にロールアップします", - "xpack.canvas.functions.staticColumnHelpText": "静的値の列を追加します", - "xpack.canvas.functions.string.args.valueHelpText": "結合させる 1 つまたは複数の文字列です。必要な場所にスペースを入れるのを忘れないでください!", - "xpack.canvas.functions.stringHelpText": "他の文字列からなる文字列をアウトプットします。主にアウトプットが文字列の部分式、または文字列にキャスト可能なものとと組み合わせると有効です。", - "xpack.canvas.functions.switch.args.caseHelpText": "確認する条件のリストです", - "xpack.canvas.functions.switch.args.defaultHelpText": "ケースが一致しなかった場合のデフォルトのケースです", - "xpack.canvas.functions.switchHelpText": "複数条件の条件付きロジックを実行します", - "xpack.canvas.functions.table.args.fontHelpText": "フォントスタイルです", - "xpack.canvas.functions.table.args.paginateHelpText": "ページ付けのコントロールを表示します。False の場合、初めのページのみが表示されます", - "xpack.canvas.functions.table.args.perPageHelpText": "1 ページごとにこの数の行を表示します。ページ付けを無効にする場合はこの値を上げることをお勧めします", "xpack.canvas.functions.table.args.showHeaderHelpText": "各行のタイトルと共にヘッダー行を表示するかしないかです", - "xpack.canvas.functions.tableHelpText": "{datatable} エレメントを構成します", - "xpack.canvas.functions.tail.args.countHelpText": "{datatable} の終わりからこの数の行を返します", - "xpack.canvas.functions.tailHelpText": "{datatable} の終わりから N 行をを取得します。「{head}」もご参照ください", "xpack.canvas.functions.timefilter.args.columnHelpText": "フィルターを添付する列またはフィールドです", - "xpack.canvas.functions.timefilter.args.fromHelpText": "範囲の始まりです。{iso} または {es} {dm} のフォーマットを使用します", - "xpack.canvas.functions.timefilter.args.toHelpText": "範囲の終わりです。{iso} または {es} {dm} のフォーマットを使用します", "xpack.canvas.functions.timefilter.invalidStringErrorMessage": "無効な日付/時刻文字列: 「{str}」", "xpack.canvas.functions.timefilterControl.args.columnHelpText": "フィルターを添付する列またはフィールドです", "xpack.canvas.functions.timefilterControl.args.compactHelpText": "時間フィルターを、ポップオーバーを実行するボタンとして表示します", - "xpack.canvas.functions.timefilterControlHelpText": "{timefilter} コントロールエレメントを構成します", - "xpack.canvas.functions.timefilterHelpText": "ソースのクエリ用の {timefilter} を作成します", - "xpack.canvas.functions.urlparam.args.defaultHelpText": "{url} パラメーターが提供されていない場合にこの文字列を返します", - "xpack.canvas.functions.urlparam.args.paramHelpText": "アクセスする {url} ハッシュパラメーターです", - "xpack.canvas.functions.urlparamHelpText": "{url} パラメーターにアクセスして表現で使用します。例: {example}これは常に文字列を返します", "xpack.canvas.sampleDataLinkLabel": "Canvas", "xpack.code.featureRegistry.codeFeatureName": "コード", "xpack.crossClusterReplication.addAutoFollowPatternButtonLabel": "自動フォローパターンを作成", @@ -10915,4 +10783,4 @@ "xpack.watcher.watchActions.logging.logTextIsRequiredValidationMessage": "ログテキストが必要です。", "xpack.watcher.watcherDescription": "アラートの作成、管理、監視によりデータへの変更を検知します。" } -} +} \ No newline at end of file diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 9c43a558c02da..2a6d7ffb7ad49 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -4256,174 +4256,81 @@ "xpack.canvas.elements.verticalProgressBarHelpText": "将进度显示为垂直条的一部分", "xpack.canvas.elements.verticalProgressPillDisplayName": "垂直进度胶囊", "xpack.canvas.elements.verticalProgressPillHelpText": "将进度显示为垂直胶囊的一部分", - "xpack.canvas.functions.all.args.conditionHelpText": "要检查的一个或多个条件", - "xpack.canvas.functions.allHelpText": "如果所有条件都为 true,则返回 true", "xpack.canvas.functions.alterColumn.args.columnHelpText": "要更改的列的名称", "xpack.canvas.functions.alterColumn.args.nameHelpText": "结果列名称留空将不重命名", "xpack.canvas.functions.alterColumn.args.typeHelpText": "将列转换成的类型。留空将不更改类型", "xpack.canvas.functions.alterColumn.cannotConvertTypeErrorMessage": "无法连接到“{type}”", "xpack.canvas.functions.alterColumn.columnNotFoundErrorMessage": "找不到列:“{column}”", - "xpack.canvas.functions.alterColumnHelpText": "在核心类型(例如 {examples})之间转换并重命名列", - "xpack.canvas.functions.any.args.conditionHelpText": "要检查的一个或多个条件", - "xpack.canvas.functions.anyHelpText": "如果任意条件为 true,则返回 true", "xpack.canvas.functions.as.args.nameHelpText": "要给予列的名称", - "xpack.canvas.functions.asHelpText": "要检查的一个或多个条件", - "xpack.canvas.functions.axisConfig.args.maxHelpText": "轴上显示的最大值。必须为数值或以 {ms} 为单位的日期或 {iso} 字符串", - "xpack.canvas.functions.axisConfig.args.minHelpText": "轴上显示的最小值。必须为数值或以 {ms} 为单位的日期或 {iso} 字符串", - "xpack.canvas.functions.axisConfig.args.positionHelpText": "轴标签的位置:{examples}", "xpack.canvas.functions.axisConfig.args.showHelpText": "显示轴标签?", "xpack.canvas.functions.axisConfig.args.tickSizeHelpText": "在每下一刻度递增大小。仅用于数值轴", "xpack.canvas.functions.axisConfig.invalidMaxPositionErrorMessage": "日期字符串无效:“{max}”。“max”必须是数值、以毫秒为单位的日期或 ISO8601 日期字符串", "xpack.canvas.functions.axisConfig.invalidMinDateStringErrorMessage": "日期字符串无效:“{min}”。“min”必须是数值、以毫秒为单位的日期或 ISO8601 日期字符串", "xpack.canvas.functions.axisConfig.invalidPositionErrorMessage": "无效的位置:“{position}”", - "xpack.canvas.functions.axisConfigHelpText": "配置可视化的轴", - "xpack.canvas.functions.case.args.ifHelpText": "此值用于表示条件是否得到满足。如果二个参数均提供,其将覆盖未命名参数。", "xpack.canvas.functions.case.args.thenHelpText": "条件得到满足时要返回的值", - "xpack.canvas.functions.case.args.whenHelpText": "此值与上下文对比,以确定条件是否得到满足。如果两个参数均提供,其将由“{if}”参数覆盖。", - "xpack.canvas.functions.caseHelpText": "构建要传递给 {switch} 函数的 case(包括条件/结果)", - "xpack.canvas.functions.clearHelpText": "清除上下文并返回 null", - "xpack.canvas.functions.columns.args.excludeHelpText": "要从表中移除的列名称逗号分隔列表", - "xpack.canvas.functions.columns.args.includeHelpText": "要在表中保留的列名称逗号分隔列表", - "xpack.canvas.functions.columnsHelpText": "在或从数据表中包括或排除的列。如果指定二者,将首先排除", "xpack.canvas.functions.compare.args.opHelpText": "要用于比较的运算符:{eq}(等于)、{gt}(大于)、{gte}(大于或等于)、{lt}(小于)、{lte}(小于或等于)、{ne} 或 {neq}(不等于)", - "xpack.canvas.functions.compare.args.toHelpText": "要与上下文进行比较的值,通常由子表达式返回", "xpack.canvas.functions.compare.invalidCompareOperatorErrorMessage": "无效的比较运算符:“{op}”。使用 {ops}", - "xpack.canvas.functions.compareHelpText": "将输入与其他内容比较,以确定 true 或 false。通常与 `{if}` 一起使用。这仅适用于基元类型,如 {examples}。", - "xpack.canvas.functions.containerStyle.args.backgroundColorHelpText": "有效的 {css} 背景色字符串", - "xpack.canvas.functions.containerStyle.args.backgroundImageHelpText": "有效的 {css} 背景图字符串", - "xpack.canvas.functions.containerStyle.args.backgroundRepeatHelpText": "有效的 {css} 背景重复字符串", - "xpack.canvas.functions.containerStyle.args.backgroundSizeHelpText": "有效的 {css} 背景大小字符串", - "xpack.canvas.functions.containerStyle.args.borderHelpText": "有效的 {css} 边框字符串", "xpack.canvas.functions.containerStyle.args.borderRadiusHelpText": "设置边框圆角时要使用的像素数", "xpack.canvas.functions.containerStyle.args.opacityHelpText": "0 和 1 之间的数值,表示元素的透明度", - "xpack.canvas.functions.containerStyle.args.overflowHelpText": "设置容器的溢出", "xpack.canvas.functions.containerStyle.args.paddingHelpText": "内容与边框的距离(像素)", "xpack.canvas.functions.containerStyle.invalidBackgroundImageErrorMessage": "无效的背景图。请提供资产或 URL。", - "xpack.canvas.functions.containerStyleHelpText": "创建用于在图表上描述序列属性的对象。通常在图表函数内使用此对象", - "xpack.canvas.functions.contextHelpText": "返回传入该函数的任何内容。需要将上下文用作充当子表达式的参数时,这会非常有用", - "xpack.canvas.functions.csv.args.dataHelpText": "要使用的 {csv} 数据", "xpack.canvas.functions.csv.args.delimeterHelpText": "数据分隔字符", "xpack.canvas.functions.csv.args.newlineHelpText": "行分隔字符", "xpack.canvas.functions.csv.invalidInputCSVErrorMessage": "解析输入 CSV 时出错。", - "xpack.canvas.functions.csvHelpText": "从 {csv} 输入创建数据表", - "xpack.canvas.functions.date.args.formatHelpText": "用于解析可选日期字符串的 {moment} 格式(请参见 {url})", - "xpack.canvas.functions.date.args.valueHelpText": "解析成自 Epoch 起毫秒数的可选日期字符串。可以是有效的 Javascript 日期输入,也可以是要使用格式参数解析的字符串。必须为 {iso} 字符串,或必须提供该格式", "xpack.canvas.functions.date.invalidDateInputErrorMessage": "无效的日期输入:{date}", "xpack.canvas.functions.dateHelpText": "将当前时间或从字符串解析的时间返回为自 Epoch 起毫秒数", "xpack.canvas.functions.demodata.args.typeHelpText": "要使用的演示数据集的名称", "xpack.canvas.functions.demodata.invalidDataSetErrorMessage": "无效的数据集:“{arg}”,请使用“{ci}”或“{shirts}”。", "xpack.canvas.functions.demodataHelpText": "包含项目 {ci} 时间以及用户名、国家/地区以及运行阶段的模拟数据集", - "xpack.canvas.functions.do.args.fnHelpText": "一个或多个子表达式。这些表达式的值在根管道中不可用,因为此函数仅返回传入的上下文。", - "xpack.canvas.functions.doHelpText": "运行多个子表达式。返回传入的上下文。适用于运行生成函数的操作。", "xpack.canvas.functions.dropdownControl.args.filterColumnHelpText": "附加筛选的列字段", "xpack.canvas.functions.dropdownControl.args.filterGroupHelpText": "筛选的组名称", "xpack.canvas.functions.dropdownControl.args.valueColumnHelpText": "从其中提取下拉列表唯一值的数据表列", "xpack.canvas.functions.dropdownControlHelpText": "配置下拉列表筛选控制元素", - "xpack.canvas.functions.eq.args.valueHelpText": "要与上下文比较的值", - "xpack.canvas.functions.eqHelpText": "如果上下文等于参数,则返回", "xpack.canvas.functions.escount.args.indexHelpText": "指定索引模式。例如,{example}", - "xpack.canvas.functions.escount.args.queryHelpText": "{lucene} 查询字符串", - "xpack.canvas.functions.escountHelpText": "用于计数匹配查询的命中数的查询 {es}", "xpack.canvas.functions.esdocs.args.countHelpText": "要拉取的文档数。数目越小,性能越好", "xpack.canvas.functions.esdocs.args.fieldsHelpText": "字段逗号分隔列表。字段越少,性能越好", "xpack.canvas.functions.esdocs.args.indexHelpText": "指定索引模式。例如,{example}", "xpack.canvas.functions.esdocs.args.metaFieldsHelpText": "元字段逗号分隔列表,例如“{example}”", - "xpack.canvas.functions.esdocs.args.queryHelpText": "{lucene} 查询字符串", "xpack.canvas.functions.esdocs.args.sortHelpText": "排序方向,表示为“{directions}”。例如,“{example1}”或“{example2}”", - "xpack.canvas.functions.esdocsHelpText": "查询 {es} 并获取原始文档。建议指定需要的字段,特别是要请求大量行时。", "xpack.canvas.functions.essql.args.countHelpText": "要拉取的文档数。数目越小,性能越好", - "xpack.canvas.functions.essql.args.queryHelpText": "{sql} 查询", - "xpack.canvas.functions.essql.args.timezoneHelpText": "要用于日期操作的时区,有效的 {iso} 格式和 {utc} 偏移均适用", - "xpack.canvas.functions.essqlHelpText": "{essql}", "xpack.canvas.functions.exactly.args.columnHelpText": "附加筛选的列字段", "xpack.canvas.functions.exactly.args.valueHelpText": "要完全匹配的值,包括空格和大写", "xpack.canvas.functions.exactlyHelpText": "创建使给定列匹配确切值的筛选。", - "xpack.canvas.functions.filterrows.args.fnHelpText": "要将数据表中的每行传入的表达式。表达式应返回布尔值。true 值将保留行,false 值将移除行。", - "xpack.canvas.functions.filterrowsHelpText": "根据子表达式的返回值筛选数据表中的行。", - "xpack.canvas.functions.formatdate.args.formatHelpText": "装入存储桶的 {moment} 格式(请参见 {url})", - "xpack.canvas.functions.formatdateHelpText": "使用 {moment} 格式化有效的日期字符串或自 Epoch 起{ms}数(请参阅 {url})", - "xpack.canvas.functions.formatnumber.args.formatHelpText": "{numeralJS} 格式字符串 {url}", - "xpack.canvas.functions.formatnumberHelpText": "使用 {numeralJS} 格式将数值转成字符串", - "xpack.canvas.functions.getCell.args.columnHelpText": "要提取的列值的名称", "xpack.canvas.functions.getCell.args.rowHelpText": "行编号,从 0 开始", "xpack.canvas.functions.getCell.columnNotFoundErrorMessage": "找不到列:“{column}”", "xpack.canvas.functions.getCell.rowNotFoundErrorMessage": "找不到行:“{row}”", - "xpack.canvas.functions.getCellHelpText": "提取表中的单个单元格", - "xpack.canvas.functions.gt.args.valueHelpText": "要与上下文比较的值", - "xpack.canvas.functions.gte.args.valueHelpText": "要与上下文比较的值", - "xpack.canvas.functions.gteHelpText": "如果上下文大于或等于参数,则返回", - "xpack.canvas.functions.gtHelpText": "如果上下文大于参数,则返回", - "xpack.canvas.functions.head.args.countHelpText": "从数据库 {datatable} 的开头返回此数目的行", - "xpack.canvas.functions.headHelpText": "从 {datatable} 获取前 {n} 行。另请参见 `{tail}`", - "xpack.canvas.functions.if.args.conditionHelpText": "布尔值 true 或 false,通常由子表达式返回。如果未提供,则将使用输入上下文", - "xpack.canvas.functions.if.args.elseHelpText": "false 时的返回值。如果未指定其他条件,该条件为 false,则将返回函数的输入上下文", - "xpack.canvas.functions.if.args.thenHelpText": "true 时的返回值", "xpack.canvas.functions.ifHelpText": "执行条件逻辑", - "xpack.canvas.functions.image.args.dataurlHelpText": "图像的 HTTP(S) URL 或 base64 数据。", - "xpack.canvas.functions.image.args.modeHelpText": "`{contain}` 将显示整个图像,图像缩放至适合大小。`{cover}` 将使用该图像填充容器,根据需要在两边或底部裁剪图像。`{stretch}` 将图像的高和宽调整为容器的 100%", + "xpack.canvas.functions.image.args.modeHelpText": "{contain} 将显示整个图像,图像缩放至适合大小。{cover} 将使用该图像填充容器,根据需要在两边或底部裁剪图像。{stretch} 将图像的高和宽调整为容器的 100%", "xpack.canvas.functions.image.invalidImageModeErrorMessage": "“mode”必须为“{contain}”、“{cover}”或“{stretch}”", - "xpack.canvas.functions.imageHelpText": "显示图像", - "xpack.canvas.functions.locationHelpText": "使用浏览器的位置功能获取您当前的位置。通常非常缓慢,但相当准确", - "xpack.canvas.functions.lt.args.valueHelpText": "要与上下文比较的值", - "xpack.canvas.functions.lte.args.valueHelpText": "要与上下文比较的值", - "xpack.canvas.functions.lteHelpText": "如果上下文小于或等于参数,则返回", - "xpack.canvas.functions.ltHelpText": "如果上下文小于参数,则返回", - "xpack.canvas.functions.mapColumn.args.expressionHelpText": "每行均传递为单行 {datatable} 的画布表达式", "xpack.canvas.functions.mapColumn.args.nameHelpText": "结果列的名称", - "xpack.canvas.functions.mapColumnHelpText": "添加计算为其他列的结果的列或添加未计算为其他列的结果的列", - "xpack.canvas.functions.markdown.args.contentHelpText": "{markdown} 表达式可以传递多次以实现串联", - "xpack.canvas.functions.markdown.args.fontHelpText": "字体设置。通常,也可以在此处添加其他样式", - "xpack.canvas.functions.markdownHelpText": "用于呈现 {markdown} 文本的元素。适用于单个数值、指标或文本段落。", - "xpack.canvas.functions.math.args.expressionHelpText": "已计算的 {tinymath} 表达式。(请参见 {url})", "xpack.canvas.functions.math.emptyDatatableErrorMessage": "空数据表", "xpack.canvas.functions.math.emptyExpressionErrorMessage": "空表达式", "xpack.canvas.functions.math.executionFailedErrorMessage": "无法执行数学表达式。检查您的列名称", "xpack.canvas.functions.math.tooManyResultsErrorMessage": "表达式必须返回单个数字。尝试将您的表达式包装在 {mean} 或 {sum} 中", - "xpack.canvas.functions.mathHelpText": "以数值或 {datatable} 作为上下文来解释数学表达式。{Datatable} 可通过列名进行使用。如果传入数值,其可用为“{value}”(无引号)", - "xpack.canvas.functions.metric.args.labelFontHelpText": "标签的字体设置。通常,也可以在此处粘贴其他样式!", "xpack.canvas.functions.metric.args.labelHelpText": "描述指标的文本", - "xpack.canvas.functions.metric.args.metricFontHelpText": "指标的字体设置。通常,也可以在此处粘贴其他样式!", "xpack.canvas.functions.metricHelpText": "具有标签的数字", - "xpack.canvas.functions.neq.args.valueHelpText": "要与上下文比较的值", - "xpack.canvas.functions.neqHelpText": "如果上下文不等于参数,则返回", - "xpack.canvas.functions.palette.args.colorHelpText": "调色板颜色、{rgba}、{hex} 或 {html} 颜色字符串。传递多次。", "xpack.canvas.functions.palette.args.gradientHelpText": "希望在支持以及有用的地方进行渐变?", "xpack.canvas.functions.palette.args.reverseHelpText": "反转调色板", "xpack.canvas.functions.paletteHelpText": "创建颜色调色板", - "xpack.canvas.functions.pie.args.fontHelpText": "标签字体", "xpack.canvas.functions.pie.args.holeHelpText": "在饼图中画孔洞,大小为饼图半径的百分比 (0-100)", "xpack.canvas.functions.pie.args.labelRadiusHelpText": "要用作标签圆形半径的容器的面积百分比", "xpack.canvas.functions.pie.args.labelsHelpText": "显示饼图标签?", - "xpack.canvas.functions.pie.args.legendHelpText": "图例位置:{position} 或 {false}", - "xpack.canvas.functions.pie.args.paletteHelpText": "用于描述要在饼图上使用的颜色的 {palette} 对象", "xpack.canvas.functions.pie.args.radiusHelpText": "饼图的半径,表示为可用空间的百分比(介于 0 和 1 之间)。设置为 `{auto}` 可自动设置半径", "xpack.canvas.functions.pie.args.seriesStyleHelpText": "特定序列的样式", "xpack.canvas.functions.pie.args.tiltHelpText": "倾斜百分比,其中 1 为完全垂直,0 为完全水平", "xpack.canvas.functions.pieHelpText": "配置饼图元素", "xpack.canvas.functions.plot.args.defaultStyleHelpText": "要用于每个序列的默认样式", - "xpack.canvas.functions.plot.args.fontHelpText": "图例和刻度线字体", - "xpack.canvas.functions.plot.args.legendHelpText": "图例位置:{position} 或 {false}", - "xpack.canvas.functions.plot.args.paletteHelpText": "用于描述要在绘图上使用的颜色的 {palette} 对象", "xpack.canvas.functions.plot.args.seriesStyleHelpText": "特定序列的样式", - "xpack.canvas.functions.plot.args.xaxisHelpText": "轴配置,或{false} 以禁用", - "xpack.canvas.functions.plot.args.yaxisHelpText": "轴配置,或{false} 以禁用", - "xpack.canvas.functions.plotHelpText": "配置 {plot} 元素", - "xpack.canvas.functions.ply.args.byHelpText": "细分所要基于的列", - "xpack.canvas.functions.ply.args.expressionHelpText": "要将每个结果 {datatable} 传入的表达式。提示:\n 表达式必须返回 {datatable}。使用 `as` 将文本转成 {datatable}。\n 多个表达式必须返回相同数目的行。如果需要返回不同行数,使用管道将数据加载到另一 {ply} 实例中。\n 如果多个表达式返回相同的列,则最后一个优先。", "xpack.canvas.functions.ply.columnNotFoundErrorMessage": "找不到列:“{by}”", "xpack.canvas.functions.ply.rowCountMismatchErrorMessage": "所有表达式必须返回相同数目的行", - "xpack.canvas.functions.plyHelpText": "细分 {datatable} 并将结果表传入表达式,然后合并输出", "xpack.canvas.functions.pointseries.args.colorHelpText": "要用于确定标记颜色的表达式", "xpack.canvas.functions.pointseries.args.sizeHelpText": "对于支持的元素,标记的大小", "xpack.canvas.functions.pointseries.args.textHelpText": "如果要用于支持的图表中,标记中要显示的文本", "xpack.canvas.functions.pointseries.args.xHelpText": "X 轴上的值", "xpack.canvas.functions.pointseries.args.yHelpText": "Y 轴上的值", "xpack.canvas.functions.pointseries.unwrappedExpressionErrorMessage": "表达式必须包装在函数中,例如 {fn}", - "xpack.canvas.functions.pointseriesHelpText": "将 {datatable} 转成点序列模型当前我们通过寻找 {url} 区分度量和维度。如果在参数中输入 {tinymath} 表达式,我们将该参数视为度量,否则该参数为维度。维度将进行组合以创建唯一键。然后,这些键使用指定的 {tinymath} 函数消除重复的度量。", "xpack.canvas.functions.progress.args.barColorHelpText": "背景条形的颜色", "xpack.canvas.functions.progress.args.barWeightHelpText": "背景条形的粗细", - "xpack.canvas.functions.progress.args.fontHelpText": "标签的字体设置。通常,也可以在此处粘贴其他样式!", - "xpack.canvas.functions.progress.args.labelHelpText": "设置 {true}/{false} 以显示/隐藏标签或提供显示为标签的字符串", "xpack.canvas.functions.progress.args.maxHelpText": "进度元素的最大值", "xpack.canvas.functions.progress.args.shapeHelpText": "选择 {list} 或 {end}", "xpack.canvas.functions.progress.args.valueColorHelpText": "进度条的颜色", @@ -4431,27 +4338,15 @@ "xpack.canvas.functions.progress.invalidMaxValueErrorMessage": "无效的 {arg} 值:“{max, number}”。“{arg}”必须大于 0", "xpack.canvas.functions.progress.invalidValueErrorMessage": "无效的值:“{value, number}”。值必须介于 0 和 {max, number} 之间", "xpack.canvas.functions.progressHelpText": "配置进度元素", - "xpack.canvas.functions.render.args.asHelpText": "要用于呈现的元素类型。您可能需要专门的函数,例如 `{plot}` 或 `{grid}`", "xpack.canvas.functions.render.args.containerStyleHelpText": "容器的样式,包括背景、边框和透明度", - "xpack.canvas.functions.render.args.cssHelpText": "要限定于此元素的任何定制 {css} 块。", - "xpack.canvas.functions.renderHelpText": "将输入呈现为指定元素并设置元素级选项(例如样式)", - "xpack.canvas.functions.repeatImage.args.emptyImageHelpText": "使用此图像填充输入和 `{max}` 参数之间的差异", - "xpack.canvas.functions.repeatImage.args.imageHelpText": "要重复的图像。通常 {dataurl} 或资产", "xpack.canvas.functions.repeatImage.args.maxHelpText": "图像可以重复的最大次数", "xpack.canvas.functions.repeatImage.args.sizeHelpText": "图像的最大高度或宽度,以像素为单位。例如,如果图像的高度大于宽度,这将会限制其高度", "xpack.canvas.functions.repeatImageHelpText": "配置重复图像元素", "xpack.canvas.functions.replace.args.flagsHelpText": "指定标志。有关信息,请参阅 {url}。", - "xpack.canvas.functions.replace.args.patternHelpText": "{js} 正则表达式的文本或模式,例如“{example}”。您可以在此处使用捕获组。", "xpack.canvas.functions.replace.args.replacementHelpText": "字符串匹配部分的替代。捕获组可以通过其索引(例如 {example})进行访问。", "xpack.canvas.functions.replaceImageHelpText": "使用正则表达式替换字符串各部分", - "xpack.canvas.functions.revealImage.args.emptyImageHelpText": "要显示的可选背景图像", - "xpack.canvas.functions.revealImage.args.imageHelpText": "要显示的图像", - "xpack.canvas.functions.revealImage.args.originHelpText": "起始位置,例如 {position}", "xpack.canvas.functions.revealImage.invalidPercentErrorMessage": "无效的值:“{percent}”。百分比必须介于 0 和 1 之间", "xpack.canvas.functions.revealImageHelpText": "配置图像显示元素", - "xpack.canvas.functions.rounddate.args.formatHelpText": "装入存储桶的 {moment} 格式(请参见 {url})例如,“{example}”将舍入为月", - "xpack.canvas.functions.rounddateHelpText": "使用 {moment} 格式字符串舍入自 Epoch 起{ms}数。返回自 Epoch 起{ms}数。", - "xpack.canvas.functions.rowCountHelpText": "返回行数。与 {ply} 搭配,可获取唯一行值的计数或唯一行值的组合。", "xpack.canvas.functions.seriesStyle.args.barsHelpText": "条形的宽度", "xpack.canvas.functions.seriesStyle.args.colorHelpText": "要为折线分配的颜色", "xpack.canvas.functions.seriesStyle.args.fillHelpText": "是否应填充点?", @@ -4459,43 +4354,16 @@ "xpack.canvas.functions.seriesStyle.args.labelHelpText": "此样式应用到的折线的标签,不是要为折线提供的名称", "xpack.canvas.functions.seriesStyle.args.linesHelpText": "折线的宽度", "xpack.canvas.functions.seriesStyle.args.pointsHelpText": "折线上的点大小", - "xpack.canvas.functions.seriesStyle.args.stackHelpText": "是否应堆叠序列?这是堆叠“id”。具有相同堆叠 ID 的序列将堆叠在一起", - "xpack.canvas.functions.seriesStyleHelpText": "创建用于在图表上描述序列属性的对象。通常在图表函数内使用此对象", - "xpack.canvas.functions.shape.args.borderHelpText": "有效的 {css} 颜色字符串", "xpack.canvas.functions.shape.args.borderWidthHelpText": "边框的粗细", - "xpack.canvas.functions.shape.args.fillHelpText": "有效的 {css} 颜色字符串", - "xpack.canvas.functions.shape.args.maintainAspectHelpText": "选择 true 可保持纵横比", "xpack.canvas.functions.shape.args.shapeHelpText": "选取形状", "xpack.canvas.functions.shapeHelpText": "创建形状", - "xpack.canvas.functions.sort.args.byHelpText": "排序要基于的列。如果未指定列,将基于第一列排序 {datatable}。", - "xpack.canvas.functions.sort.args.reverseHelpText": "反向排序。如果未指定反向,将升序排序 {datatable}。", "xpack.canvas.functions.sortHelpText": "基于列排序数据表", "xpack.canvas.functions.staticColumn.args.nameHelpText": "新列的名称", - "xpack.canvas.functions.staticColumn.args.valueHelpText": "要插入每列的值。提示:使用子表达式将其他列汇总为静态值", - "xpack.canvas.functions.staticColumnHelpText": "添加具有静态值的列", - "xpack.canvas.functions.string.args.valueHelpText": "要联结在一起的一个或多个字符串。在需要空格的地方切勿忘记空格!", - "xpack.canvas.functions.stringHelpText": "输出由其他字符串构成的字符串。与输出字符串或可转换成字符串的内容的子表达式组合使用时非常有用", - "xpack.canvas.functions.switch.args.caseHelpText": "要检查的条件列表", - "xpack.canvas.functions.switch.args.defaultHelpText": "没有 case 匹配时的默认 case", - "xpack.canvas.functions.switchHelpText": "执行具有多个条件的条件逻辑", - "xpack.canvas.functions.table.args.fontHelpText": "字体样式", - "xpack.canvas.functions.table.args.paginateHelpText": "显示分页控件如果设置为 false,将仅显示第一页", - "xpack.canvas.functions.table.args.perPageHelpText": "每页显示此数目的行。您可能想增加此设置,这将禁用分页", "xpack.canvas.functions.table.args.showHeaderHelpText": "显示或隐藏具有每列标题的标题行", - "xpack.canvas.functions.tableHelpText": "配置 {datatable} 元素", - "xpack.canvas.functions.tail.args.countHelpText": "从 {datatable} 结尾返回此数目的行", - "xpack.canvas.functions.tailHelpText": "从 {datatable} 结尾获取后 N 行。另请参见 `{head}`", "xpack.canvas.functions.timefilter.args.columnHelpText": "附加筛选的列字段", - "xpack.canvas.functions.timefilter.args.fromHelpText": "范围开始,使用 {iso} 或 {es} {dm} 格式", - "xpack.canvas.functions.timefilter.args.toHelpText": "范围结束,使用 {iso} 或 {es} {dm} 格式", "xpack.canvas.functions.timefilter.invalidStringErrorMessage": "无效的日期/时间字符串:“{str}”", "xpack.canvas.functions.timefilterControl.args.columnHelpText": "附加筛选的列字段", "xpack.canvas.functions.timefilterControl.args.compactHelpText": "将时间筛选显示为触发弹出框的按钮", - "xpack.canvas.functions.timefilterControlHelpText": "配置 {timefilter} 控制元素", - "xpack.canvas.functions.timefilterHelpText": "创建用于查询源的 {timefilter}", - "xpack.canvas.functions.urlparam.args.defaultHelpText": "如果未定义 {url} 参数,将返回此字符串", - "xpack.canvas.functions.urlparam.args.paramHelpText": "要访问的 {url} 哈希参数", - "xpack.canvas.functions.urlparamHelpText": "访问 {url} 参数并在表达式中使用它们。例如,{example}。这将始终返回字符串", "xpack.canvas.sampleDataLinkLabel": "Canvas", "xpack.code.featureRegistry.codeFeatureName": "Code", "xpack.crossClusterReplication.addAutoFollowPatternButtonLabel": "创建自动跟随模式",