From 368f806a7a99769fd8b5e41d8b84a1ed7ad69a99 Mon Sep 17 00:00:00 2001 From: Ashwin P Chandran Date: Fri, 15 Jul 2022 03:37:40 -0700 Subject: [PATCH] chore: Adds a few readme's (#1894) Signed-off-by: Ashwin Pc --- src/plugins/navigation/README.md | 8 +++++ src/plugins/wizard/README.md | 56 +++++++++++++++++++++++++++++--- 2 files changed, 60 insertions(+), 4 deletions(-) diff --git a/src/plugins/navigation/README.md b/src/plugins/navigation/README.md index 2b32cb50f0b1..db65dd82ccfe 100644 --- a/src/plugins/navigation/README.md +++ b/src/plugins/navigation/README.md @@ -3,3 +3,11 @@ The navigation plugins exports the `TopNavMenu` component. It also provides a stateful version of it on the `start` contract. +## navigation.ui.TopNavMenu + +The `naivgation.ui` module exposes the `TopNavMenu` component that features The search bar, time filter and menu options to be used across the app in multiple locations. It primarity consists of 2 components: + +- Menu options: Options to show on the menu bar alongside the breadcrumbs +- Search bar: The [`data.ui.SearchBar`](../data/public/ui/search_bar/) component responsible for the query bar, time filter and field filters. + +Most of the logic for the component resides in the `SearchBar` component. This simply adds a way to add menu options on top of the search bar. diff --git a/src/plugins/wizard/README.md b/src/plugins/wizard/README.md index bcb362b374cb..9cd95d4810db 100755 --- a/src/plugins/wizard/README.md +++ b/src/plugins/wizard/README.md @@ -1,10 +1,58 @@ -# wizard +# Wizard -A OpenSearch Dashboards plugin +A OpenSearch Dashboards plugin for the visualization experience that makes exploring data and creating visualizations much easier. It will act as an additional way to create visualizations alongside the exiting tools within the current visualizations plugin. The tool will be incremental to the visualization tools available to the user in OpenSearch Dashboards today. ---- +## Usage -## Development +To use this plugin, navigate to: + +Visualize -> Create Visualization -> Wizard + +## Add a visualization (TODO: Cleanup before merging into mainline) + +All new visualizations currently reside in [public/visualizations](./public/visualizations). To add a new one, create a new visualization folder and add the required code to setup and register a new vis type. + +### Anatomy of a visualization + +``` +metric/ +├─ metric_viz_type.ts +├─ index.ts +├─ to_expression.ts +├─ components/ + ├─ metric_viz_options.tsx +``` + +Outline: +- index.ts: Exposes the createConfig function that is used to register the viz type +- _viz_type.ts: Contains the config that the type service needs to register the new vis type. +- to_expression.ts: The expression function that the plugin will use to render the visualization given the state of the plugin +- _viz_options.tsx: The component that will render the other properties that user can set in the `Style` tab. + +**Notes:** + +- Currently only the metric viz is setup so schema properties that other vis types need may not be setup fully and need to be set correctly. +- `to_expression` is quite custom and can be abstracted into a common utility for different visualizations. Adding more vis types should make it clear as to how this can be done + + +## Development (TODO: Delete before merging into mainline) + +All work for this feature currently happens on the `feature/d-and-d` branch + +### Git workflow + +Set main repo as the `upstream` remote +```sh +git remote add upstream https://github.com/opensearch-project/OpenSearch-Dashboards.git +``` + +Keeping the `feature/d-and-d` branch up to date locally + +```sh +git fetch upstream +git checkout feature/d-and-d +git merge upstream/feature/d-and-d +``` See the [OpenSearch Dashboards contributing guide](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/master/CONTRIBUTING.md) for instructions