From 168a88acf612d54a93455a6c253544b533d876b8 Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Thu, 19 Sep 2019 00:14:47 -0700 Subject: [PATCH] docs: update readme --- .../superset-ui-plugins-deckgl/README.md | 83 +------------------ .../README.md | 23 +++-- 2 files changed, 13 insertions(+), 93 deletions(-) diff --git a/superset-frontend/temporary_superset_ui/superset-ui-plugins-deckgl/README.md b/superset-frontend/temporary_superset_ui/superset-ui-plugins-deckgl/README.md index b1b33cb20b..46c20014f8 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui-plugins-deckgl/README.md +++ b/superset-frontend/temporary_superset_ui/superset-ui-plugins-deckgl/README.md @@ -54,90 +54,13 @@ yarn install yarn build ``` -### Activating plugins for local development - -1. Enable `npm link` for the package. - -```sh -cd superset-ui -cd packages/superset-ui-chart -npm link -``` - -2. Link the local package to `incubator-superset`. - -```sh -cd incubator-superset -cd superset/assets -npm link @superset-ui/chart \# use package name in package.json, not directory name -``` - -3) After npm link complete, update the import statements in Superset. - -Instead of - -```js -import { xxx } from '@superset-ui/plugin-chart-horizon'; -``` - -which will point to the transpiled code. - -do refer to `src` - -```js -import { xxx } from '@superset-ui/plugin-chart-horizon/src' -``` - -4. After that you can run `dev-server` as usual. - -```sh -npm run dev-server -``` - -Now when you change the code in `@superset-ui`, it will update the app immediately similar to code inside `incubator-superset`. - -### Deactivating plugins for local development - -1. Change the `import` statements back. - -2. Unlink the package from `incubator-superset`. - -```cd incubator-superset -cd superset/assets -npm unlink @superset-ui/chart -``` - -Note: Quite often, `npm link` mess up your `node_modules` and the `unlink` command above does not work correctly, making webpack build fails or other unexpected behaviors. If that happens, just delete your `node_modules` and `npm install` from scratch. - -3. Clean up global link. - -```sh -cd superset-ui -cd packages/superset-ui-chart -npm unlink -``` - ### Builds, linting, and testing Each package defines its own build config, linting, and testing. You can have lerna run commands -across all packages using the syntax `yarn run test` (or `yarn run test:watch` for watch mode) from the root `@superset-ui` directory. +across all packages using the syntax `yarn run test` (or `yarn run test:watch` for watch mode) from the root `@superset-ui-plugins-deckgl` directory. -#### Storybook - -You can demo your changes by running the storybook demo locally with the following commands: - -```sh -yarn install -yarn build -cd packages/superset-ui-plugins-deckgl-demo -yarn storybook:run -``` - -Alternatively, you can demo your changes by using the following command while in `packages/superset-ui-plugins-deckgl-demo`: - -```sh -yarn storybook -``` +* [Using Storybook](https://github.com/apache-superset/superset-ui/blob/master/docs/storybook.md) - You can test your components independently from Superset app. +* [Debugging Superset plugins in Superset app](https://github.com/apache-superset/superset-ui/blob/master/docs/debugging.md) - Sometimes something went wrong and you have to do it. ### Committing diff --git a/superset-frontend/temporary_superset_ui/superset-ui-plugins-deckgl/packages/superset-ui-legacy-preset-chart-deckgl/README.md b/superset-frontend/temporary_superset_ui/superset-ui-plugins-deckgl/packages/superset-ui-legacy-preset-chart-deckgl/README.md index 2a00965792..3f96d049de 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui-plugins-deckgl/packages/superset-ui-legacy-preset-chart-deckgl/README.md +++ b/superset-frontend/temporary_superset_ui/superset-ui-plugins-deckgl/packages/superset-ui-legacy-preset-chart-deckgl/README.md @@ -3,36 +3,33 @@ [![Version](https://img.shields.io/npm/v/@superset-ui/legacy-preset-chart-nvd3.svg?style=flat-square)](https://img.shields.io/npm/v/@superset-ui/legacy-preset-chart-nvd3.svg?style=flat-square) [![David (path)](https://img.shields.io/david/apache-superset/superset-ui-plugins.svg?path=packages%2Fsuperset-ui-legacy-preset-chart-nvd3&style=flat-square)](https://david-dm.org/apache-superset/superset-ui-plugins?path=packages/superset-ui-legacy-preset-chart-nvd3) -This plugin provides Big Number for Superset. +This plugin provides `deck.gl` for Superset. ### Usage -Import the preset and register. This will register all the chart plugins under nvd3. +Import the preset and register. This will register all the chart plugins under `deck.gl`. ```js -import { NVD3ChartPreset } from '@superset-ui/legacy-preset-chart-nvd3'; +import { DeckGLChartPreset } from '@superset-ui/legacy-preset-chart-deckgl'; -new NVD3ChartPreset().register(); +new DeckGLChartPreset().register(); ``` or register charts one by one. Configure `key`, which can be any `string`, and register the plugin. This `key` will be used to lookup this chart throughout the app. ```js -import { AreaChartPlugin, LineChartPlugin } from '@superset-ui/legacy-preset-chart-nvd3'; +import { ArcChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl'; -new AreaChartPlugin() - .configure({ key: 'area' }) - .register(); -new LineChartPlugin() - .configure({ key: 'line' }) +new ArcChartPlugin() + .configure({ key: 'deck_arc' }) .register(); ``` -Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/superset-ui-plugins/?selectedKind=plugin-chart-nvd3) for more details. +Then use it via `SuperChart`. See [storybook](https://apache-superset.github.io/superset-ui-plugins-deckgl) for more details. ```js -``` \ No newline at end of file +```