superset/superset-frontend/temporary_superset_ui/superset-ui-plugins-deckgl
2021-11-30 11:14:20 +08:00
..
.github initial commit 2021-11-30 11:14:18 +08:00
packages refactor: rename packages 2021-11-30 11:14:20 +08:00
.gitignore initial commit 2021-11-30 11:14:18 +08:00
.npmrc initial commit 2021-11-30 11:14:18 +08:00
.travis.yml initial commit 2021-11-30 11:14:18 +08:00
buildAssets.js initial commit 2021-11-30 11:14:18 +08:00
CHANGELOG.md initial commit 2021-11-30 11:14:18 +08:00
commitlint.config.js initial commit 2021-11-30 11:14:18 +08:00
lerna.json refactor: rename packages 2021-11-30 11:14:20 +08:00
LICENSE initial commit 2021-11-30 11:14:18 +08:00
package.json feat: add deckgl files 2021-11-30 11:14:19 +08:00
README.md initial commit 2021-11-30 11:14:18 +08:00

@superset-ui/plugins 🔌💡

Codecov branch Build Status David Netlify Status

@superset-ui/legacy-* packages are extracted from the classic Apache Superset and converted into plugins. These packages are extracted with minimal changes (almost as-is). They also depend on legacy API (viz.py) to function.

@superset-ui/plugin-* packages are newer and has higher quality in general. A key difference that they do not depend on viz.py (which contain visualization-specific python code) and interface with /api/v1/query/ instead: a new generic endpoint instead meant to serve all visualizations.

We are not accepting pull requests for new community-contributed plugins to be merged into this repository at the moment. We will keep it lean for now to improve the standard and reduce operational load on maintenance. Bug fixes are welcome.

In the future, we plan to have a template for new repository or generator for everybody to setup a single plugin repository easily on his/her own. This way anybody can create and publish a Superset plugin.

Demo (Storybook)

Most recent release: https://apache-superset.github.io/superset-ui-plugins/

Current master: https://superset-ui-plugins.netlify.com

Packages

Package Version Note
@superset-ui/plugin-chart-word-cloud Version
@superset-ui/preset-chart-xy Version experimental
Package Version
@superset-ui/legacy-preset-chart-big-number Version
@superset-ui/legacy-preset-chart-nvd3 Version
@superset-ui/legacy-plugin-chart-calendar Version
@superset-ui/legacy-plugin-chart-chord Version
@superset-ui/legacy-plugin-chart-country-map Version
@superset-ui/legacy-plugin-chart-event-flow Version
@superset-ui/legacy-plugin-chart-force-directed Version
@superset-ui/legacy-plugin-chart-heatmap Version
@superset-ui/legacy-plugin-chart-histogram Version
@superset-ui/legacy-plugin-chart-horizon Version
@superset-ui/legacy-plugin-chart-iframe Version
@superset-ui/legacy-plugin-chart-markup Version
@superset-ui/legacy-plugin-chart-map-box Version
@superset-ui/legacy-plugin-chart-paired-t-test Version
@superset-ui/legacy-plugin-chart-parallel-coordinates Version
@superset-ui/legacy-plugin-chart-partition Version
@superset-ui/legacy-plugin-chart-pivot-table Version
@superset-ui/legacy-plugin-chart-rose Version
@superset-ui/legacy-plugin-chart-sankey Version
@superset-ui/legacy-plugin-chart-sankey-loop Version
@superset-ui/legacy-plugin-chart-sunburst Version
@superset-ui/legacy-plugin-chart-table Version
@superset-ui/legacy-plugin-chart-treemap Version
@superset-ui/legacy-plugin-chart-word-cloud Version
@superset-ui/legacy-plugin-chart-world-map Version

Development

lerna and yarn are used to manage versions and dependencies between packages in this monorepo.

superset-ui/
  lerna.json
  package.json
  ...
  packages/
    package1/
      package.json
      ...
      src/
      test/
      ...
      lib/
      esm/
      ...
    ...

Installation

  1. clone this repo
  2. have yarn install package dependencies and manage the symlinking between packages for you
git clone ...superset-ui-plugins && cd superset-ui-plugins
yarn install
yarn build

Activating plugins for local development

  1. Enable npm link for the package.
cd superset-ui
cd packages/superset-ui-chart
npm link
  1. Link the local package to incubator-superset.
cd incubator-superset
cd superset/assets
npm link @superset-ui/chart \# use package name in package.json, not directory name 
  1. After npm link complete, update the import statements in Superset.

Instead of

import { xxx } from '@superset-ui/plugin-chart-horizon';

which will point to the transpiled code.

do refer to src

import { xxx } from '@superset-ui/plugin-chart-horizon/src'
  1. After that you can run dev-server as usual.
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 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.

  1. Clean up global link.
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.

Storybook

You can demo your changes by running the storybook demo locally with the following commands:

yarn install
yarn build
cd packages/superset-ui-plugins-demo
yarn storybook:run

Alternatively, you can demo your changes by using the following command while in packages/superset-ui-plugins-demo:

yarn storybook

Committing

This repository follows conventional commits guideline for commit messages and has a commitlint hook which will require you to have the valid commit message before committing. You can use npm run commit to help you create a commit message.

Publishing

Prerequisite: You'll need an npmjs.com account that is part of the @superset-ui organization.

  1. Make sure you're logged in to NPM from your shell. Run npm login if necessary.
  2. To make the release, run yarn run release and follow the prompts.

License

Apache-2.0