Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Canvas][Docs] Updates Canvas function reference #37614

Closed
wants to merge 3 commits into from

Conversation

cqliu1
Copy link
Contributor

@cqliu1 cqliu1 commented May 31, 2019

Summary

Blocked by #37305.
[skip-ci]

The Canvas function references have gotten out of sync with the codebase. I went through each function and updated the docs. I also made a few formatting changes. Changes made in #37305 are reflected in these doc changes.

Changes:

  • Moved argument aliases and default values onto a new line below the name and description, respectively
  • Wrapped function names, argument names, and data types/Canvas specific object names in backticks so they display in code blocks
  • Added a marker to indicate an argument can be passed multiple times, which was missing from the docs previously
  • Added links to related functions for certain functions
  • Replace context type "Anything or nothing" with null and any
  • Added definitions for clear and progress
  • Removed definition for clog
  • Moved definitions for markdown, timelion and to to canvas-client-functions
  • Removed boolean and null as valid context types and boolean as valid value type for gt, gte, lt, and lte because they didn't make sense
  • Added missing args min, max, and tickSize in axisConfig definition
  • Added neq as valid op value in compare
  • Added filterGroup arg to dropdownControl, exactly, and timefilterControl

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

- [ ] This was checked for cross-browser compatibility, including a check against IE11

For maintainers

@cqliu1 cqliu1 added the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas label May 31, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@cqliu1 cqliu1 added loe:large Large Level of Effort impact:critical This issue should be addressed immediately due to a critical level of impact on the product. v7.2.0 v7.3.0 v8.0.0 release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. release_note:skip Skip the PR/issue when compiling release notes WIP Work in progress Team:Docs and removed release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. labels May 31, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-docs

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@kibanamachine kibanamachine mentioned this pull request May 31, 2019
21 tasks
Copy link
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM. I just skimmed the diff, but its obviously providing many corrections and additions. We can continue iterating on it and it feels like something we should push sooner rather than later.

@cqliu1 cqliu1 removed the WIP Work in progress label Jun 4, 2019
@cqliu1 cqliu1 force-pushed the docs/canvas-functions branch from 17da51d to 4ff40bb Compare June 4, 2019 22:41
@cqliu1 cqliu1 added v7.2.0 and removed v7.2.0 labels Jun 4, 2019
@cqliu1 cqliu1 requested a review from gchaps June 4, 2019 22:42
@cqliu1 cqliu1 added the review label Jun 4, 2019
@cqliu1 cqliu1 marked this pull request as ready for review June 4, 2019 22:43
@cqliu1 cqliu1 requested a review from KOTungseth June 7, 2019 20:08
@cqliu1 cqliu1 removed the v7.2.0 label Jun 7, 2019
Copy link
Contributor

@KOTungseth KOTungseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My recommendations mostly include format changes, but let me know if you want to chat about any of these.

I'll review another chunk of this tomorrow.

docs/canvas/canvas-client-functions.asciidoc Show resolved Hide resolved
docs/canvas/canvas-client-functions.asciidoc Show resolved Hide resolved
docs/canvas/canvas-client-functions.asciidoc Show resolved Hide resolved
docs/canvas/canvas-client-functions.asciidoc Show resolved Hide resolved
docs/canvas/canvas-client-functions.asciidoc Show resolved Hide resolved

Outputs the context to the console.
Clears _context_ and returns `null`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Clears the _context_, then returns null.



[float]
=== columns
[[columns_fn]]
=== `columns`

Includes or excludes columns from a data table. If you specify both, this will exclude first.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

Includes or excludes columns from a data table. TIP: When you specify both options, excludes the first option.

|include
|string
|`include`
|`string`
|A comma separated list of column names to keep in the table
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be:

A comma-separated list of column names to include in the data table.

|exclude
|string
|`exclude`
|`string`
|A comma separated list of column names to remove from the table
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be:

A comma-separated list of column names to remove from the data table.`

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.
Compares the input to something else to determine `true` or `false`.
Copy link
Contributor

@KOTungseth KOTungseth Jun 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

To determine true or false, compares the input. TIP: The compare function works only with primitive types, such as boolean, number, and string. Use compare with `<<if_fin>>. See also <<eq_fn>>, <<gt_fn>>, <<gte_fn>>, <<lt_fn>>, <<lte_fn>>, and <<neq_fn>>.

Copy link
Contributor

@clintandrewhall clintandrewhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: let's also be consistent about ending all entries with periods, (or not)

docs/canvas/canvas-client-functions.asciidoc Show resolved Hide resolved
docs/canvas/canvas-client-functions.asciidoc Show resolved Hide resolved
docs/canvas/canvas-client-functions.asciidoc Show resolved Hide resolved
docs/canvas/canvas-client-functions.asciidoc Show resolved Hide resolved
docs/canvas/canvas-client-functions.asciidoc Show resolved Hide resolved
docs/canvas/canvas-client-functions.asciidoc Show resolved Hide resolved

Alias: `type`
|`string`
|The name of the demo data set to use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd include a path to the demo data index file.

docs/canvas/canvas-server-functions.asciidoc Show resolved Hide resolved
docs/canvas/canvas-server-functions.asciidoc Show resolved Hide resolved
docs/canvas/canvas-server-functions.asciidoc Show resolved Hide resolved
cqliu1 added a commit to cqliu1/kibana that referenced this pull request Jun 20, 2019
@cqliu1
Copy link
Contributor Author

cqliu1 commented Jun 20, 2019

Closing this in favor of #38300. All changes made in this PR are reflected in #38300, and feedback provided here were added to #38300 in 6898b44.

@cqliu1 cqliu1 closed this Jun 20, 2019
cqliu1 added a commit to cqliu1/kibana that referenced this pull request Jul 11, 2019
* Synced up docs with function defs

* Updated docs with changes from PR elastic#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 elastic#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
cqliu1 added a commit that referenced this pull request Jul 11, 2019
* 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
cqliu1 added a commit to cqliu1/kibana that referenced this pull request Jul 11, 2019
    * Synced up docs with function defs

    * Updated docs with changes from PR elastic#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 elastic#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
cqliu1 added a commit that referenced this pull request Jul 12, 2019
* [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

* Fixes Canvas doc headers (#40921)
cqliu1 added a commit that referenced this pull request Jul 12, 2019
* [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

* Fixes Canvas doc headers (#40921)

* Fixed imports
@cqliu1 cqliu1 deleted the docs/canvas-functions branch April 27, 2020 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:critical This issue should be addressed immediately due to a critical level of impact on the product. loe:large Large Level of Effort release_note:skip Skip the PR/issue when compiling release notes review Team:Docs Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v7.3.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants