From 9580eb2ba0259a79066f6a581da327887da1b1d6 Mon Sep 17 00:00:00 2001 From: Stacey Gammon Date: Wed, 15 Apr 2020 14:12:14 -0400 Subject: [PATCH] Update README.md (#63622) --- src/plugins/embeddable/README.md | 36 ++++++++++---------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/plugins/embeddable/README.md b/src/plugins/embeddable/README.md index 1fe91f426f43f..343a1cc32cd10 100644 --- a/src/plugins/embeddable/README.md +++ b/src/plugins/embeddable/README.md @@ -1,39 +1,25 @@ -# The Embeddable API V2 +# Embeddables -The Embeddable API's main goal is to have documented and standardized ways to share and exchange information and functionality across applications and plugins. +Embeddables are re-usable widgets that can be rendered in any environment or plugin. Developers can embed them directly in their plugin. End users can dynamically add them to any embeddable _containers_. -There are three main pieces of this infrastructure: - - Embeddables & Containers - - Actions - - Triggers +## Embeddable containers -## Embeddables & Containers +Containers are a special type of embeddable that can contain nested embeddables. Embeddables can be dynamically added to embeddable _containers_. Currently only dashboard uses this interface. -Embeddables are isolated, serializable, renderable widgets. A developer can hard code an embeddable inside their -application, or they can use some built in actions to allow users to dynamically add them to *containers*. - -Containers are a special type of embeddable that can contain nested embeddables. - -## Actions - -Actions are pluggable pieces of functionality exposed to the user that take an embeddable as context, plus an optional action context. - -## Triggers - -Triggers are the way actions are connected to a user action. We ship with two default triggers, `CONTEXT_MENU_TRIGGER` and `APPLY_FILTER`. - -Actions attached to the `CONTEXT_MENU_TRIGGER` will be displayed in supported embeddables context menu to the user. Actions attached to the `APPLY_FILTER` trigger will show up when any embeddable emits this trigger. +## Examples -A developer can register new triggers that their embeddables, or external components, can emit (as long as they have an embeddable to pass along as context). +Many example embeddables are implemented and registered [here](https://github.com/elastic/kibana/tree/master/examples/embeddable_examples). They can be played around with and explored [in the Embeddable Explorer example plugin](https://github.com/elastic/kibana/tree/master/examples/embeddable_explorer). Just run kibana with -## Examples +``` +yarn start --run-examples +``` -Many examples can be viewed in the functionally tested `kbn_tp_embeddable_explorer` plugin, as well as the jest tested classes inside the `embeddable_api/public/test_samples` folder. +and navigate to the Embeddable explorer app. ## Testing Run unit tests ```shell -node scripts/jest embeddable_api +node scripts/jest embeddable ```