You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/10/23 20:00:18 UTC

[GitHub] kristw closed pull request #6094: [WIP] SuperChart

kristw closed pull request #6094: [WIP] SuperChart
URL: https://github.com/apache/incubator-superset/pull/6094
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/assets/src/chart/Chart.jsx b/superset/assets/src/chart/Chart.jsx
index 0d550272d6..05b6e6a801 100644
--- a/superset/assets/src/chart/Chart.jsx
+++ b/superset/assets/src/chart/Chart.jsx
@@ -1,15 +1,13 @@
-import React from 'react';
+import dompurify from 'dompurify';
 import PropTypes from 'prop-types';
+import React from 'react';
 import { Tooltip } from 'react-bootstrap';
-import dompurify from 'dompurify';
-
-import ChartBody from './ChartBody';
-import Loading from '../components/Loading';
 import { Logger, LOG_ACTIONS_RENDER_CHART } from '../logger';
-import StackTraceMessage from '../components/StackTraceMessage';
+import Loading from '../components/Loading';
 import RefreshChartOverlay from '../components/RefreshChartOverlay';
-import visPromiseLookup from '../visualizations';
-import sandboxedEval from '../modules/sandbox';
+import StackTraceMessage from '../components/StackTraceMessage';
+import ChartProps from '../visualizations/core/models/ChartProps';
+import SuperChart from '../visualizations/core/components/SuperChart';
 import './chart.css';
 
 const propTypes = {
@@ -52,23 +50,8 @@ const defaultProps = {
 class Chart extends React.PureComponent {
   constructor(props) {
     super(props);
-    // visualizations are lazy-loaded with promises that resolve to a renderVis function
-    this.state = {
-      renderVis: null,
-    };
-
-    // these properties are used by visualizations
-    this.annotationData = props.annotationData;
-    this.containerId = props.containerId;
-    this.selector = `#${this.containerId}`;
-    this.formData = props.formData;
-    this.datasource = props.datasource;
+    this.state = {};
     this.addFilter = this.addFilter.bind(this);
-    this.getFilters = this.getFilters.bind(this);
-    this.headerHeight = this.headerHeight.bind(this);
-    this.height = this.height.bind(this);
-    this.width = this.width.bind(this);
-    this.visPromise = null;
   }
 
   componentDidMount() {
@@ -79,69 +62,28 @@ class Chart extends React.PureComponent {
         this.props.timeout,
         this.props.chartId,
       );
-    } else {
-      // when drag/dropping in a dashboard, a chart may be unmounted/remounted but still have data
-      this.renderVis();
-    }
-
-    this.loadAsyncVis(this.props.vizType);
-  }
-
-  componentWillReceiveProps(nextProps) {
-    this.annotationData = nextProps.annotationData;
-    this.containerId = nextProps.containerId;
-    this.selector = `#${this.containerId}`;
-    this.formData = nextProps.formData;
-    this.datasource = nextProps.datasource;
-    if (nextProps.vizType !== this.props.vizType) {
-      this.setState(() => ({ renderVis: null }));
-      this.loadAsyncVis(nextProps.vizType);
-    }
-  }
-
-  componentDidUpdate(prevProps) {
-    if (
-      this.props.queryResponse &&
-      ['success', 'rendered'].indexOf(this.props.chartStatus) > -1 &&
-      !this.props.queryResponse.error &&
-      (prevProps.annotationData !== this.props.annotationData ||
-        prevProps.queryResponse !== this.props.queryResponse ||
-        prevProps.height !== this.props.height ||
-        prevProps.width !== this.props.width ||
-        prevProps.lastRendered !== this.props.lastRendered)
-    ) {
-      this.renderVis();
     }
   }
 
-  componentWillUnmount() {
-    this.visPromise = null;
-  }
-
-  getFilters() {
-    return this.props.getFilters();
-  }
+  // componentDidUpdate(prevProps) {
+  //   if (
+  //     this.props.queryResponse &&
+  //     ['success', 'rendered'].indexOf(this.props.chartStatus) > -1 &&
+  //     !this.props.queryResponse.error &&
+  //     (prevProps.annotationData !== this.props.annotationData ||
+  //       prevProps.queryResponse !== this.props.queryResponse ||
+  //       prevProps.height !== this.props.height ||
+  //       prevProps.width !== this.props.width ||
+  //       prevProps.lastRendered !== this.props.lastRendered)
+  //   ) {
+  //     this.renderVis();
+  //   }
+  // }
 
   setTooltip(tooltip) {
     this.setState({ tooltip });
   }
 
-  loadAsyncVis(visType) {
-    this.visPromise = visPromiseLookup[visType];
-
-    this.visPromise()
-      .then((renderVis) => {
-        // ensure Component is still mounted
-        if (this.visPromise) {
-          this.setState({ renderVis }, this.renderVis);
-        }
-      })
-      .catch((error) => {
-        console.warn(error); // eslint-disable-line
-        this.props.actions.chartRenderingFailed(error, this.props.chartId);
-      });
-  }
-
   addFilter(col, vals, merge = true, refresh = true) {
     this.props.addFilter(col, vals, merge, refresh);
   }
@@ -150,26 +92,39 @@ class Chart extends React.PureComponent {
     this.setState({ errorMsg: null });
   }
 
-  width() {
-    return (
-      this.props.width || (this.container && this.container.el && this.container.el.offsetWidth)
-    );
-  }
-
-  headerHeight() {
-    return this.props.headerHeight || 0;
-  }
-
-  height() {
-    return (
-      this.props.height || (this.container && this.container.el && this.container.el.offsetHeight)
-    );
-  }
-
   error(e) {
     this.props.actions.chartRenderingFailed(e, this.props.chartId);
   }
 
+  prepareChartProps() {
+    const {
+      annotationData,
+      datasource,
+      formData,
+      getFilters,
+      queryResponse,
+      setControlValue,
+    } = this.props;
+
+    return new ChartProps({
+      annotationData,
+      datasource,
+      filters: getFilters(),
+      formData,
+      onAddFilter: (...args) => {
+        this.addFilter(...args);
+      },
+      onError: (...args) => {
+        this.error(...args);
+      },
+      payload: queryResponse,
+      setControlValue,
+      setTooltip: (...args) => {
+        this.setTooltip(...args);
+      },
+    });
+  }
+
   renderTooltip() {
     if (this.state.tooltip) {
       return (
@@ -194,85 +149,87 @@ class Chart extends React.PureComponent {
     return null;
   }
 
-  renderVis() {
-    const { chartStatus } = this.props;
-    const hasVisPromise = !!this.state.renderVis;
-    // check that we have the render function and data
-    if (hasVisPromise && ['success', 'rendered'].indexOf(chartStatus) > -1) {
-      const { vizType, formData, queryResponse, setControlValue, chartId } = this.props;
-      const renderStart = Logger.getTimestamp();
-
-      try {
-        // Executing user-defined data mutator function
-        if (formData.js_data) {
-          queryResponse.data = sandboxedEval(formData.js_data)(queryResponse.data);
-        }
-        // [re]rendering the visualization
-        this.state.renderVis(this, queryResponse, setControlValue);
-
-        if (chartStatus !== 'rendered') {
-          this.props.actions.chartRenderingSucceeded(chartId);
-        }
-
-        Logger.append(LOG_ACTIONS_RENDER_CHART, {
-          slice_id: chartId,
-          viz_type: vizType,
-          start_offset: renderStart,
-          duration: Logger.getTimestamp() - renderStart,
-        });
-      } catch (e) {
-        console.warn(e); // eslint-disable-line
-        this.props.actions.chartRenderingFailed(e, chartId);
-      }
-    }
-  }
+  // renderVis() {
+  //   // const { chartStatus } = this.props;
+  //   // const hasVisPromise = !!this.state.renderVis;
+  //   // // check that we have the render function and data
+  //   // if (hasVisPromise && ['success', 'rendered'].indexOf(chartStatus) > -1) {
+  //   // }
+  // }
 
   render() {
-    const isLoading = this.props.chartStatus === 'loading' || !this.state.renderVis;
+    const {
+      width,
+      height,
+      actions,
+      chartAlert,
+      chartId,
+      chartStatus,
+      errorMessage,
+      onDismissRefreshOverlay,
+      onQuery,
+      queryResponse,
+      refreshOverlayVisible,
+      vizType,
+    } = this.props;
+
+    const isLoading = chartStatus === 'loading';
 
     // this allows <Loading /> to be positioned in the middle of the chart
-    const containerStyles = isLoading ? { height: this.height(), width: this.width() } : null;
+    const containerStyles = isLoading ? { height, width } : null;
+    const isFaded = refreshOverlayVisible && !errorMessage;
+    const renderStart = Logger.getTimestamp();
+
     return (
-      <div className={`chart-container ${isLoading ? 'is-loading' : ''}`} style={containerStyles}>
+      <div
+        className={`chart-container ${isLoading ? 'is-loading' : ''}`}
+        style={containerStyles}
+      >
         {this.renderTooltip()}
 
         {isLoading && <Loading size={50} />}
 
         {this.props.chartAlert && (
           <StackTraceMessage
-            message={this.props.chartAlert}
-            queryResponse={this.props.queryResponse}
+            message={chartAlert}
+            queryResponse={queryResponse}
           />
         )}
 
-        {!isLoading &&
-          !this.props.chartAlert &&
-          this.props.refreshOverlayVisible &&
-          !this.props.errorMessage &&
-          this.container && (
-            <RefreshChartOverlay
-              height={this.height()}
-              width={this.width()}
-              onQuery={this.props.onQuery}
-              onDismiss={this.props.onDismissRefreshOverlay}
-            />
-          )}
+        {!isLoading && !chartAlert && isFaded && (
+          <RefreshChartOverlay
+            width={width}
+            height={height}
+            onQuery={onQuery}
+            onDismiss={onDismissRefreshOverlay}
+          />
+        )}
 
-        {!isLoading &&
-          !this.props.chartAlert && (
-            <ChartBody
-              containerId={this.containerId}
-              vizType={this.props.vizType}
-              height={this.height}
-              width={this.width}
-              faded={
-                this.props.refreshOverlayVisible && !this.props.errorMessage
+        {!isLoading && !chartAlert && (
+          <SuperChart
+            className={`slice_container ${isFaded ? ' faded' : ''}`}
+            width={width}
+            height={height}
+            chartProps={this.prepareChartProps()}
+            vizType={vizType}
+            onRenderSuccess={() => {
+              if (chartStatus !== 'rendered') {
+                actions.chartRenderingSucceeded(chartId);
               }
-              ref={(inner) => {
-                this.container = inner;
-              }}
-            />
-          )}
+
+              Logger.append(LOG_ACTIONS_RENDER_CHART, {
+                slice_id: chartId,
+                viz_type: vizType,
+                start_offset: renderStart,
+                duration: Logger.getTimestamp() - renderStart,
+              });
+            }}
+            onRenderFailure={(e) => {
+              console.warn(e); // eslint-disable-line
+              actions.chartRenderingFailed(e, chartId);
+            }}
+          />
+        )}
       </div>
     );
   }
diff --git a/superset/assets/src/chart/ChartBody.jsx b/superset/assets/src/chart/ChartBody.jsx
deleted file mode 100644
index 4ab7364ea8..0000000000
--- a/superset/assets/src/chart/ChartBody.jsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-
-const propTypes = {
-  containerId: PropTypes.string.isRequired,
-  vizType: PropTypes.string.isRequired,
-  height: PropTypes.func.isRequired,
-  width: PropTypes.func.isRequired,
-  faded: PropTypes.bool,
-};
-
-class ChartBody extends React.PureComponent {
-  height() {
-    return this.props.height();
-  }
-
-  width() {
-    return this.props.width();
-  }
-
-  render() {
-    return (
-      <div
-        id={this.props.containerId}
-        className={`slice_container ${this.props.vizType}${this.props.faded ? ' faded' : ''}`}
-        ref={(el) => { this.el = el; }}
-      />
-    );
-  }
-}
-
-ChartBody.propTypes = propTypes;
-
-export default ChartBody;
diff --git a/superset/assets/src/common.js b/superset/assets/src/common.js
index 69c2556844..1af763eed4 100644
--- a/superset/assets/src/common.js
+++ b/superset/assets/src/common.js
@@ -5,6 +5,7 @@ import categoricalSchemes from './modules/colorSchemes/categorical';
 import lyft from './modules/colorSchemes/lyft';
 import { getInstance } from './modules/ColorSchemeManager';
 import { toggleCheckbox } from './modules/utils';
+import LegacyChartPreset from './visualizations/presets/LegacyChartPreset';
 
 // Everything imported in this file ends up in the common entry file
 // be mindful of double-imports
@@ -36,6 +37,9 @@ getInstance()
   .registerScheme('lyftColors', lyft.lyftColors)
   .setDefaultSchemeName('bnbColors');
 
+// Register chart types
+new LegacyChartPreset().register();
+
 export function appSetup() {
     // A set of hacks to allow apps to run within a FAB template
   // this allows for the server side generated menus to function
diff --git a/superset/assets/src/explore/components/ExploreChartPanel.jsx b/superset/assets/src/explore/components/ExploreChartPanel.jsx
index bcda75d711..aaa3a0d4c8 100644
--- a/superset/assets/src/explore/components/ExploreChartPanel.jsx
+++ b/superset/assets/src/explore/components/ExploreChartPanel.jsx
@@ -2,6 +2,7 @@ import $ from 'jquery';
 import React from 'react';
 import PropTypes from 'prop-types';
 import { Panel } from 'react-bootstrap';
+import ParentSize from '@vx/responsive/build/components/ParentSize';
 
 import { chartPropShape } from '../../dashboard/util/propShapes';
 import ChartContainer from '../../chart/ChartContainer';
@@ -40,31 +41,36 @@ class ExploreChartPanel extends React.PureComponent {
   renderChart() {
     const { chart } = this.props;
     return (
-      <ChartContainer
-        chartId={chart.id}
-        containerId={this.props.containerId}
-        datasource={this.props.datasource}
-        formData={this.props.form_data}
-        height={this.getHeight()}
-        slice={this.props.slice}
-        setControlValue={this.props.actions.setControlValue}
-        timeout={this.props.timeout}
-        vizType={this.props.vizType}
-        refreshOverlayVisible={this.props.refreshOverlayVisible}
-        errorMessage={this.props.errorMessage}
-        onQuery={this.props.onQuery}
-        onDismissRefreshOverlay={this.props.onDismissRefreshOverlay}
-        annotationData={chart.annotationData}
-        chartAlert={chart.chartAlert}
-        chartStatus={chart.chartStatus}
-        chartUpdateEndTime={chart.chartUpdateEndTime}
-        chartUpdateStartTime={chart.chartUpdateStartTime}
-        latestQueryFormData={chart.latestQueryFormData}
-        lastRendered={chart.lastRendered}
-        queryResponse={chart.queryResponse}
-        queryRequest={chart.queryRequest}
-        triggerQuery={chart.triggerQuery}
-      />
+      <ParentSize>
+        {({ width, height }) => (width > 0 && height > 0) && (
+          <ChartContainer
+            chartId={chart.id}
+            containerId={this.props.containerId}
+            datasource={this.props.datasource}
+            formData={this.props.form_data}
+            width={Math.floor(width)}
+            height={this.getHeight()}
+            slice={this.props.slice}
+            setControlValue={this.props.actions.setControlValue}
+            timeout={this.props.timeout}
+            vizType={this.props.vizType}
+            refreshOverlayVisible={this.props.refreshOverlayVisible}
+            errorMessage={this.props.errorMessage}
+            onQuery={this.props.onQuery}
+            onDismissRefreshOverlay={this.props.onDismissRefreshOverlay}
+            annotationData={chart.annotationData}
+            chartAlert={chart.chartAlert}
+            chartStatus={chart.chartStatus}
+            chartUpdateEndTime={chart.chartUpdateEndTime}
+            chartUpdateStartTime={chart.chartUpdateStartTime}
+            latestQueryFormData={chart.latestQueryFormData}
+            lastRendered={chart.lastRendered}
+            queryResponse={chart.queryResponse}
+            queryRequest={chart.queryRequest}
+            triggerQuery={chart.triggerQuery}
+          />
+        )}
+      </ParentSize>
     );
   }
 
@@ -87,7 +93,8 @@ class ExploreChartPanel extends React.PureComponent {
         form_data={this.props.form_data}
         timeout={this.props.timeout}
         chart={this.props.chart}
-      />);
+      />
+    );
     return (
       <div className="chart-container">
         <Panel
diff --git a/superset/assets/src/visualizations/core/components/SuperChart.jsx b/superset/assets/src/visualizations/core/components/SuperChart.jsx
new file mode 100644
index 0000000000..28d192679b
--- /dev/null
+++ b/superset/assets/src/visualizations/core/components/SuperChart.jsx
@@ -0,0 +1,177 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import getChartComponentRegistry from '../registries/ChartComponentRegistrySingleton';
+import getChartTransformPropsRegistry from '../registries/ChartTransformPropsRegistrySingleton';
+
+const STATUS = {
+  IDLE: 1,
+  LOADING: 2,
+  SUCCESS: 3,
+  FAILURE: 4,
+};
+const IDENTITY = x => x;
+
+const propTypes = {
+  id: PropTypes.string,
+  className: PropTypes.string,
+  width: PropTypes.number,
+  height: PropTypes.number,
+  chartProps: PropTypes.object.isRequired,
+  vizType: PropTypes.string.isRequired,
+  preTransformProps: PropTypes.func,
+  overrideTransformProps: PropTypes.func,
+  postTransformProps: PropTypes.func,
+  onRenderSuccess: PropTypes.func,
+  onRenderFailure: PropTypes.func,
+};
+const defaultProps = {
+  id: '',
+  className: '',
+  preTransformProps: IDENTITY,
+  overrideTransformProps: undefined,
+  postTransformProps: IDENTITY,
+  onRenderSuccess() {},
+  onRenderFailure() {},
+};
+
+class SuperChart extends React.PureComponent {
+  constructor(props) {
+    super(props);
+    this.state = {
+      status: STATUS.IDLE,
+      error: null,
+      Renderer: null,
+      transformProps: null,
+    };
+  }
+
+  componentDidMount() {
+    this.mounted = true;
+    this.loadChartType(this.props);
+  }
+
+  componentWillReceiveProps(nextProps) {
+    const { vizType, overrideTransformProps } = this.props;
+    if (nextProps.vizType !== vizType
+      || nextProps.overrideTransformProps !== overrideTransformProps
+    ) {
+      this.loadChartType(nextProps);
+    }
+  }
+
+  componentDidUpdate() {
+    const { onRenderSuccess, onRenderFailure } = this.props;
+    const { status, error } = this.state;
+    if (status === STATUS.SUCCESS) {
+      onRenderSuccess();
+    } else if (status === STATUS.FAILURE) {
+      onRenderFailure(error);
+    }
+  }
+
+  componentWillUnmount() {
+    this.mounted = false;
+  }
+
+  loadChartType({ vizType, overrideTransformProps }) {
+    if (this.mounted) {
+      // Clear state
+      this.setState({
+        status: vizType ? STATUS.IDLE : STATUS.LOADING,
+        error: null,
+        Renderer: null,
+        transformProps: null,
+      });
+
+      if (vizType) {
+        const componentPromise = getChartComponentRegistry().getAsPromise(vizType);
+        const transformPropsPromise = overrideTransformProps
+          ? Promise.resolve(overrideTransformProps)
+          : getChartTransformPropsRegistry().getAsPromise(vizType);
+
+        Promise.all([componentPromise, transformPropsPromise])
+          .then(
+            // on success
+            ([Renderer, transformProps]) => {
+              if (this.mounted) {
+                this.setState({
+                  status: STATUS.SUCCESS,
+                  Renderer: Renderer.default || Renderer,
+                  transformProps,
+                });
+              }
+            },
+            // on failure
+            (error) => {
+              if (this.mounted) {
+                this.setState({
+                  status: STATUS.FAILURE,
+                  error,
+                  transformProps: IDENTITY,
+                });
+              }
+            },
+          );
+      }
+    }
+  }
+
+  renderContent() {
+    const {
+      width,
+      height,
+      chartProps,
+      preTransformProps: pre,
+      postTransformProps: post,
+      vizType,
+    } = this.props;
+
+    const {
+      status,
+      error,
+      Renderer,
+      transformProps,
+    } = this.state;
+
+    switch (status) {
+      case STATUS.SUCCESS:
+        return (
+          <Renderer
+            width={width}
+            height={height}
+            {...post(transformProps(pre(chartProps)))}
+          />
+        );
+      case STATUS.FAILURE:
+        return (
+          <div className="alert alert-warning" role="alert">
+            <strong>ERROR</strong>&nbsp;
+            <code>vizType="{vizType}"</code> &mdash;
+            {error}
+          </div>
+        );
+      case STATUS.LOADING:
+        return (
+          <span>Loading...</span>
+        );
+      default:
+      case STATUS.IDLE:
+        return null;
+    }
+  }
+
+  render() {
+    const { id, className } = this.props;
+
+    return (
+      <div id={id} className={className}>
+        {this.renderContent()}
+      </div>
+    );
+  }
+}
+
+SuperChart.propTypes = propTypes;
+SuperChart.defaultProps = defaultProps;
+
+export default SuperChart;
diff --git a/superset/assets/src/visualizations/core/models/ChartProps.js b/superset/assets/src/visualizations/core/models/ChartProps.js
new file mode 100644
index 0000000000..429185fc16
--- /dev/null
+++ b/superset/assets/src/visualizations/core/models/ChartProps.js
@@ -0,0 +1,27 @@
+import convertKeysToCamelCase from '../../../utils/convertKeysToCamelCase';
+
+export default class ChartProps {
+  constructor({
+    annotationData,
+    datasource,
+    filters,
+    formData,
+    onAddFilter,
+    onError,
+    payload,
+    setControlValue,
+    setTooltip,
+  }) {
+    this.annotationData = annotationData;
+    this.datasource = convertKeysToCamelCase(datasource);
+    this.rawDatasource = datasource;
+    this.filters = filters;
+    this.formData = convertKeysToCamelCase(formData);
+    this.rawFormData = formData;
+    this.onAddFilter = onAddFilter;
+    this.onError = onError;
+    this.payload = payload;
+    this.setControlValue = setControlValue;
+    this.setTooltip = setTooltip;
+  }
+}
diff --git a/superset/assets/src/visualizations/deckgl/Multi/Multi.jsx b/superset/assets/src/visualizations/deckgl/Multi/Multi.jsx
index 99bd1a8731..c7b2fc3a2f 100644
--- a/superset/assets/src/visualizations/deckgl/Multi/Multi.jsx
+++ b/superset/assets/src/visualizations/deckgl/Multi/Multi.jsx
@@ -7,6 +7,8 @@ import layerGenerators from '../layers';
 import createAdaptor from '../createAdaptor';
 
 const propTypes = {
+  width: PropTypes.number,
+  height: PropTypes.number,
   formData: PropTypes.object.isRequired,
   payload: PropTypes.object.isRequired,
   setControlValue: PropTypes.func.isRequired,
@@ -65,10 +67,15 @@ class DeckMulti extends React.PureComponent {
   }
 
   render() {
-    const { payload, viewport, formData, setControlValue } = this.props;
+    const { width, height, payload, formData, setControlValue } = this.props;
     const { subSlicesLayers } = this.state;
 
     const layers = Object.keys(subSlicesLayers).map(k => subSlicesLayers[k]);
+    const viewport = {
+      ...formData.viewport,
+      width,
+      height,
+    };
 
     return (
       <DeckGLContainer
diff --git a/superset/assets/src/visualizations/deckgl/factory.jsx b/superset/assets/src/visualizations/deckgl/factory.jsx
index 73d48af777..db359d5166 100644
--- a/superset/assets/src/visualizations/deckgl/factory.jsx
+++ b/superset/assets/src/visualizations/deckgl/factory.jsx
@@ -5,10 +5,11 @@ import CategoricalDeckGLContainer from './CategoricalDeckGLContainer';
 import { fitViewport } from './layers/common';
 
 const propTypes = {
+  width: PropTypes.number,
+  height: PropTypes.number,
   formData: PropTypes.object.isRequired,
   payload: PropTypes.object.isRequired,
   setControlValue: PropTypes.func.isRequired,
-  viewport: PropTypes.object.isRequired,
   onAddFilter: PropTypes.func,
   setTooltip: PropTypes.func,
 };
@@ -20,14 +21,21 @@ const defaultProps = {
 export function createDeckGLComponent(getLayer, getPoints) {
   function Component(props) {
     const {
+      width,
+      height,
       formData,
       payload,
       setControlValue,
       onAddFilter,
       setTooltip,
-      viewport: originalViewport,
     } = props;
 
+    const originalViewport = {
+      ...formData.viewport,
+      width,
+      height,
+    };
+
     const viewport = formData.autozoom
       ? fitViewport(originalViewport, getPoints(payload.data.features))
       : originalViewport;
@@ -54,14 +62,21 @@ export function createDeckGLComponent(getLayer, getPoints) {
 export function createCategoricalDeckGLComponent(getLayer, getPoints) {
   function Component(props) {
     const {
+      width,
+      height,
       formData,
       payload,
       setControlValue,
       onAddFilter,
       setTooltip,
-      viewport: originalViewport,
     } = props;
 
+    const originalViewport = {
+      ...formData.viewport,
+      width,
+      height,
+    };
+
     const viewport = formData.autozoom
       ? fitViewport(originalViewport, getPoints(payload.data.features))
       : originalViewport;
diff --git a/superset/assets/src/visualizations/deckgl/layers/Geojson/Geojson.jsx b/superset/assets/src/visualizations/deckgl/layers/Geojson/Geojson.jsx
index f9f0b6eda1..bd71512677 100644
--- a/superset/assets/src/visualizations/deckgl/layers/Geojson/Geojson.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/Geojson/Geojson.jsx
@@ -94,6 +94,8 @@ export function getLayer(formData, payload, onAddFilter, setTooltip) {
 }
 
 const propTypes = {
+  width: PropTypes.number,
+  height: PropTypes.number,
   formData: PropTypes.object.isRequired,
   payload: PropTypes.object.isRequired,
   setControlValue: PropTypes.func.isRequired,
@@ -108,14 +110,21 @@ const defaultProps = {
 
 function deckGeoJson(props) {
   const {
+    width,
+    height,
     formData,
     payload,
     setControlValue,
     onAddFilter,
     setTooltip,
-    viewport,
   } = props;
 
+  const viewport = {
+    ...formData.viewport,
+    width,
+    height,
+  };
+
   // TODO get this to work
   // if (formData.autozoom) {
   //   viewport = common.fitViewport(viewport, geojsonExtent(payload.data.features));
diff --git a/superset/assets/src/visualizations/deckgl/layers/Screengrid/Screengrid.jsx b/superset/assets/src/visualizations/deckgl/layers/Screengrid/Screengrid.jsx
index 1018f1fb29..992ebb7e76 100644
--- a/superset/assets/src/visualizations/deckgl/layers/Screengrid/Screengrid.jsx
+++ b/superset/assets/src/visualizations/deckgl/layers/Screengrid/Screengrid.jsx
@@ -49,10 +49,11 @@ export function getLayer(formData, payload, onAddFilter, setTooltip, filters) {
 }
 
 const propTypes = {
+  width: PropTypes.number,
+  height: PropTypes.number,
   formData: PropTypes.object.isRequired,
   payload: PropTypes.object.isRequired,
   setControlValue: PropTypes.func.isRequired,
-  viewport: PropTypes.object.isRequired,
   onAddFilter: PropTypes.func,
   setTooltip: PropTypes.func,
 };
@@ -102,10 +103,17 @@ class DeckGLScreenGrid extends React.PureComponent {
   }
 
   render() {
-    const { formData, payload } = this.props;
+    const { width, height, formData, payload } = this.props;
+
+    const originalViewport = {
+      ...formData.viewport,
+      width,
+      height,
+    };
+
     const viewport = formData.autozoom
-      ? fitViewport(this.props.viewport, getPoints(payload.data.features))
-      : this.props.viewport;
+      ? fitViewport(originalViewport, getPoints(payload.data.features))
+      : originalViewport;
 
     return (
       <div>
diff --git a/superset/assets/src/visualizations/iframe.js b/superset/assets/src/visualizations/iframe.js
deleted file mode 100644
index 332f9bb0d0..0000000000
--- a/superset/assets/src/visualizations/iframe.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import Mustache from 'mustache';
-
-export default function iframeWidget(slice) {
-  const { selector, formData } = slice;
-  const { url } = formData;
-  const width = slice.width();
-  const height = slice.height();
-  const container = document.querySelector(selector);
-
-  const completedUrl = Mustache.render(url, {
-    width,
-    height,
-  });
-
-  const iframe = document.createElement('iframe');
-  iframe.style.width = '100%';
-  iframe.style.height = height;
-  iframe.setAttribute('src', completedUrl);
-  container.appendChild(iframe);
-}
diff --git a/superset/assets/src/visualizations/index.js b/superset/assets/src/visualizations/index.js
index 486b64d1ad..a10a222a91 100644
--- a/superset/assets/src/visualizations/index.js
+++ b/superset/assets/src/visualizations/index.js
@@ -1,142 +1,7 @@
-/* eslint-disable global-require */
-
 // You ***should*** use these to reference viz_types in code
 export const VIZ_TYPES = {
   area: 'area',
   bar: 'bar',
-  big_number: 'big_number',
-  big_number_total: 'big_number_total',
-  box_plot: 'box_plot',
-  bubble: 'bubble',
-  bullet: 'bullet',
-  cal_heatmap: 'cal_heatmap',
-  compare: 'compare',
-  directed_force: 'directed_force',
-  chord: 'chord',
-  dist_bar: 'dist_bar',
   filter_box: 'filter_box',
-  heatmap: 'heatmap',
-  histogram: 'histogram',
-  horizon: 'horizon',
-  iframe: 'iframe',
   line: 'line',
-  line_multi: 'line_multi',
-  mapbox: 'mapbox',
-  markup: 'markup',
-  para: 'para',
-  pie: 'pie',
-  pivot_table: 'pivot_table',
-  sankey: 'sankey',
-  separator: 'separator',
-  sunburst: 'sunburst',
-  table: 'table',
-  time_table: 'time_table',
-  time_pivot: 'time_pivot',
-  treemap: 'treemap',
-  country_map: 'country_map',
-  word_cloud: 'word_cloud',
-  world_map: 'world_map',
-  dual_line: 'dual_line',
-  event_flow: 'event_flow',
-  paired_ttest: 'paired_ttest',
-  partition: 'partition',
-  deck_scatter: 'deck_scatter',
-  deck_screengrid: 'deck_screengrid',
-  deck_grid: 'deck_grid',
-  deck_hex: 'deck_hex',
-  deck_path: 'deck_path',
-  deck_geojson: 'deck_geojson',
-  deck_multi: 'deck_multi',
-  deck_arc: 'deck_arc',
-  deck_polygon: 'deck_polygon',
-  rose: 'rose',
 };
-
-const loadVis = promise =>
-  promise.then((module) => {
-    const defaultExport = module.default || module;
-
-    // deckgl visualizations don't use esModules, fix it?
-    return defaultExport.default || defaultExport;
-  });
-const loadNvd3 = () => loadVis(import(/* webpackChunkName: "nvd3_vis" */ './nvd3/adaptor.jsx'));
-
-const vizMap = {
-  [VIZ_TYPES.area]: loadNvd3,
-  [VIZ_TYPES.bar]: loadNvd3,
-  [VIZ_TYPES.big_number]: () =>
-    loadVis(import(/* webpackChunkName: 'big_number' */ './BigNumber/adaptor.jsx')),
-  [VIZ_TYPES.big_number_total]: () =>
-    loadVis(import(/* webpackChunkName: "big_number" */ './BigNumber/adaptor.jsx')),
-  [VIZ_TYPES.box_plot]: loadNvd3,
-  [VIZ_TYPES.bubble]: loadNvd3,
-  [VIZ_TYPES.bullet]: loadNvd3,
-  [VIZ_TYPES.cal_heatmap]: () =>
-    loadVis(import(/* webpackChunkName: "cal_heatmap" */ './Calendar/adaptor.jsx')),
-  [VIZ_TYPES.compare]: loadNvd3,
-  [VIZ_TYPES.directed_force]: () =>
-    loadVis(import(/* webpackChunkName: "directed_force" */ './ForceDirected/adaptor.jsx')),
-  [VIZ_TYPES.chord]: () => loadVis(import(/* webpackChunkName: "chord" */ './Chord/adaptor.jsx')),
-  [VIZ_TYPES.dist_bar]: loadNvd3,
-  [VIZ_TYPES.filter_box]: () =>
-    loadVis(import(/* webpackChunkName: "filter_box" */ './FilterBox/adaptor.jsx')),
-  [VIZ_TYPES.heatmap]: () => loadVis(import(/* webpackChunkName: "heatmap" */ './Heatmap/adaptor.jsx')),
-  [VIZ_TYPES.histogram]: () =>
-    loadVis(import(/* webpackChunkName: "histogram" */ './Histogram/adaptor.jsx')),
-  [VIZ_TYPES.horizon]: () => loadVis(import(/* webpackChunkName: "horizon" */ './Horizon/adaptor.jsx')),
-  [VIZ_TYPES.iframe]: () => loadVis(import(/* webpackChunkName: "iframe" */ './iframe.js')),
-  [VIZ_TYPES.line]: loadNvd3,
-  [VIZ_TYPES.line_multi]: () =>
-    loadVis(import(/* webpackChunkName: "line_multi" */ './nvd3/LineMulti.js')),
-  [VIZ_TYPES.time_pivot]: loadNvd3,
-  [VIZ_TYPES.mapbox]: () => loadVis(import(/* webpackChunkName: "mapbox" */ './MapBox/adaptor.jsx')),
-  [VIZ_TYPES.markup]: () => loadVis(import(/* webpackChunkName: "markup" */ './markup.js')),
-  [VIZ_TYPES.para]: () =>
-    loadVis(import(/* webpackChunkName: "parallel_coordinates" */ './ParallelCoordinates/adaptor.jsx')),
-  [VIZ_TYPES.pie]: loadNvd3,
-  [VIZ_TYPES.pivot_table]: () =>
-    loadVis(import(/* webpackChunkName: "pivot_table" */ './PivotTable/adaptor.jsx')),
-  [VIZ_TYPES.sankey]: () => loadVis(import(/* webpackChunkName: "sankey" */ './Sankey/adaptor.jsx')),
-  [VIZ_TYPES.separator]: () => loadVis(import(/* webpackChunkName: "markup" */ './markup.js')),
-  [VIZ_TYPES.sunburst]: () => loadVis(import(/* webpackChunkName: "sunburst" */ './Sunburst/adaptor.jsx')),
-  [VIZ_TYPES.table]: () => loadVis(import(/* webpackChunkName: "table" */ './Table/adaptor.jsx')),
-  [VIZ_TYPES.time_table]: () =>
-    loadVis(import(/* webpackChunkName: "time_table" */ './TimeTable/adaptor.jsx')),
-  [VIZ_TYPES.treemap]: () => loadVis(import(/* webpackChunkName: "treemap" */ './Treemap/adaptor.jsx')),
-  [VIZ_TYPES.country_map]: () =>
-    loadVis(import(/* webpackChunkName: "country_map" */ './CountryMap/adaptor.jsx')),
-  [VIZ_TYPES.word_cloud]: () =>
-    loadVis(import(/* webpackChunkName: "word_cloud" */ './wordcloud/adaptor.jsx')),
-  [VIZ_TYPES.world_map]: () =>
-    loadVis(import(/* webpackChunkName: "world_map" */ './WorldMap/adaptor.jsx')),
-  [VIZ_TYPES.dual_line]: loadNvd3,
-  [VIZ_TYPES.event_flow]: () =>
-    loadVis(import(/* webpackChunkName: "EventFlow" */ './EventFlow/adaptor.jsx')),
-  [VIZ_TYPES.paired_ttest]: () =>
-    loadVis(import(/* webpackChunkName: "paired_ttest" */ './PairedTTest/adaptor.jsx')),
-  [VIZ_TYPES.partition]: () =>
-    loadVis(import(/* webpackChunkName: "partition" */ './Partition/adaptor.jsx')),
-  [VIZ_TYPES.deck_scatter]: () =>
-    loadVis(import(/* webpackChunkName: "deckgl/layers/scatter" */ './deckgl/layers/Scatter/Scatter.jsx')),
-  [VIZ_TYPES.deck_screengrid]: () =>
-    loadVis(
-      import(/* webpackChunkName: "deckgl/layers/screengrid" */ './deckgl/layers/Screengrid/Screengrid.jsx'),
-    ),
-  [VIZ_TYPES.deck_grid]: () =>
-    loadVis(import(/* webpackChunkName: "deckgl/layers/grid" */ './deckgl/layers/Grid/Grid.jsx')),
-  [VIZ_TYPES.deck_hex]: () =>
-    loadVis(import(/* webpackChunkName: "deckgl/layers/hex" */ './deckgl/layers/Hex/Hex.jsx')),
-  [VIZ_TYPES.deck_path]: () =>
-    loadVis(import(/* webpackChunkName: "deckgl/layers/path" */ './deckgl/layers/Path/Path.jsx')),
-  [VIZ_TYPES.deck_geojson]: () =>
-    loadVis(import(/* webpackChunkName: "deckgl/layers/geojson" */ './deckgl/layers/Geojson/Geojson.jsx')),
-  [VIZ_TYPES.deck_arc]: () =>
-    loadVis(import(/* webpackChunkName: "deckgl/layers/arc" */ './deckgl/layers/Arc/Arc.jsx')),
-  [VIZ_TYPES.deck_polygon]: () =>
-    loadVis(import(/* webpackChunkName: "deckgl/layers/polygon" */ './deckgl/layers/Polygon/Polygon.jsx')),
-  [VIZ_TYPES.deck_multi]: () =>
-    loadVis(import(/* webpackChunkName: "deckgl/multi" */ './deckgl/Multi/Multi.jsx')),
-  [VIZ_TYPES.rose]: () => loadVis(import(/* webpackChunkName: "rose" */ './Rose/adaptor.jsx')),
-};
-
-export default vizMap;
diff --git a/superset/assets/src/visualizations/markup.css b/superset/assets/src/visualizations/markup.css
deleted file mode 100644
index 7e63c6f92b..0000000000
--- a/superset/assets/src/visualizations/markup.css
+++ /dev/null
@@ -1,14 +0,0 @@
-.markup.slice_container {
-    margin: 10px;
-}
-.separator {
-    background-color: transparent !important;
-}
-.separator hr {
-    border: 0;
-    height: 1px;
-    background-image: linear-gradient(to right, rgba(0, 0, 0, 1), rgba(0, 0, 0, 1), rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
-}
-.separator .chart-header {
-    border: none !important;
-}
diff --git a/superset/assets/src/visualizations/markup.js b/superset/assets/src/visualizations/markup.js
deleted file mode 100644
index 1f632bf270..0000000000
--- a/superset/assets/src/visualizations/markup.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import srcdoc from 'srcdoc-polyfill';
-import './markup.css';
-
-function markupWidget(slice, payload) {
-  const { selector } = slice;
-  const height = slice.height();
-  const headerHeight = slice.headerHeight();
-  const vizType = slice.props.vizType;
-  const { data } = payload;
-
-  const container = document.querySelector(selector);
-  container.style.overflow = 'auto';
-
-  // markup height is slice height - (marginTop + marginBottom)
-  const iframeHeight = vizType === 'separator'
-    ? height - 20
-    : height + headerHeight;
-
-  const html = `
-    <html>
-      <head>
-        ${data.theme_css.map(
-          href => `<link rel="stylesheet" type="text/css" href="${href}" />`,
-        )}
-      </head>
-      <body style="background-color: transparent;">
-        ${data.html}
-      </body>
-    </html>`;
-
-  const iframe = document.createElement('iframe');
-  iframe.setAttribute('frameborder', 0);
-  iframe.setAttribute('height', iframeHeight);
-  iframe.setAttribute('sandbox', 'allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation');
-  container.appendChild(iframe);
-
-  srcdoc.set(iframe, html);
-}
-
-export default markupWidget;
diff --git a/superset/assets/src/visualizations/presets/ClassicChartPreset.js b/superset/assets/src/visualizations/presets/ClassicChartPreset.js
new file mode 100644
index 0000000000..4ea5093963
--- /dev/null
+++ b/superset/assets/src/visualizations/presets/ClassicChartPreset.js
@@ -0,0 +1,62 @@
+import Preset from '../core/models/Preset';
+import AreaChartPlugin from '../nvd3/Area/AreaChartPlugin';
+import BarChartPlugin from '../nvd3/Bar/BarChartPlugin';
+import BigNumberChartPlugin from '../BigNumber/BigNumberChartPlugin';
+import BigNumberTotalChartPlugin from '../BigNumberTotal/BigNumberTotalChartPlugin';
+import BoxPlotChartPlugin from '../nvd3/BoxPlot/BoxPlotChartPlugin';
+import BubbleChartPlugin from '../nvd3/Bubble/BubbleChartPlugin';
+import BulletChartPlugin from '../nvd3/Bullet/BulletChartPlugin';
+import CompareChartPlugin from '../nvd3/Compare/CompareChartPlugin';
+import DistBarChartPlugin from '../nvd3/DistBar/DistBarChartPlugin';
+import DualLineChartPlugin from '../nvd3/DualLine/DualLineChartPlugin';
+import FilterBoxChartPlugin from '../FilterBox/FilterBoxChartPlugin';
+import ForceDirectedChartPlugin from '../ForceDirected/ForceDirectedChartPlugin';
+import HeatmapChartPlugin from '../Heatmap/HeatmapChartPlugin';
+import HistogramChartPlugin from '../Histogram/HistogramChartPlugin';
+import LineChartPlugin from '../nvd3/Line/LineChartPlugin';
+import PartitionChartPlugin from '../Partition/PartitionChartPlugin';
+import PieChartPlugin from '../nvd3/Pie/PieChartPlugin';
+import PivotTableChartPlugin from '../PivotTable/PivotTableChartPlugin';
+import SankeyChartPlugin from '../Sankey/SankeyChartPlugin';
+import SunburstChartPlugin from '../Sunburst/SunburstChartPlugin';
+import TableChartPlugin from '../Table/TableChartPlugin';
+import TimeTableChartPlugin from '../TimeTable/TimeTableChartPlugin';
+import TimePivotChartPlugin from '../nvd3/TimePivot/TimePivotChartPlugin';
+import TreemapChartPlugin from '../Treemap/TreemapChartPlugin';
+import WordCloudChartPlugin from '../wordcloud/WordCloudChartPlugin';
+
+export default class ClassicChartPreset extends Preset {
+  constructor() {
+    super({
+      name: 'Classic charts',
+      plugins: [
+        new AreaChartPlugin().configure({ key: 'area' }),
+        new BarChartPlugin().configure({ key: 'bar' }),
+        new BigNumberChartPlugin().configure({ key: 'big_number' }),
+        new BigNumberTotalChartPlugin().configure({ key: 'big_number_total' }),
+        new BoxPlotChartPlugin().configure({ key: 'box_plot' }),
+        new BubbleChartPlugin().configure({ key: 'bubble' }),
+        new BulletChartPlugin().configure({ key: 'bullet' }),
+        new CompareChartPlugin().configure({ key: 'compare' }),
+        new DistBarChartPlugin().configure({ key: 'dist_bar' }),
+        new DualLineChartPlugin().configure({ key: 'dual_line' }),
+        new FilterBoxChartPlugin().configure({ key: 'filter_box' }),
+        new ForceDirectedChartPlugin().configure({ key: 'directed_force' }),
+        new HeatmapChartPlugin().configure({ key: 'heatmap' }),
+        new HistogramChartPlugin().configure({ key: 'histogram' }),
+        new LineChartPlugin().configure({ key: 'line' }),
+        // TODO: LineMulti
+        new PartitionChartPlugin().configure({ key: 'partition' }),
+        new PieChartPlugin().configure({ key: 'pie' }),
+        new PivotTableChartPlugin().configure({ key: 'pivot_table' }),
+        new SankeyChartPlugin().configure({ key: 'sankey' }),
+        new SunburstChartPlugin().configure({ key: 'sunburst' }),
+        new TableChartPlugin().configure({ key: 'table' }),
+        new TimeTableChartPlugin().configure({ key: 'time_table' }),
+        new TimePivotChartPlugin().configure({ key: 'time_pivot' }),
+        new TreemapChartPlugin().configure({ key: 'treemap' }),
+        new WordCloudChartPlugin().configure({ key: 'word_cloud' }),
+      ],
+    });
+  }
+}
diff --git a/superset/assets/src/visualizations/presets/DeckGLChartPreset.js b/superset/assets/src/visualizations/presets/DeckGLChartPreset.js
new file mode 100644
index 0000000000..1f55632b3f
--- /dev/null
+++ b/superset/assets/src/visualizations/presets/DeckGLChartPreset.js
@@ -0,0 +1,29 @@
+import Preset from '../core/models/Preset';
+import ArcChartPlugin from '../deckgl/layers/Arc/ArcChartPlugin';
+import GeoJsonChartPlugin from '../deckgl/layers/Geojson/GeojsonChartPlugin';
+import GridChartPlugin from '../deckgl/layers/Grid/GridChartPlugin';
+import HexChartPlugin from '../deckgl/layers/Hex/HexChartPlugin';
+import MultiChartPlugin from '../deckgl/Multi/MultiChartPlugin';
+import PathChartPlugin from '../deckgl/layers/Path/PathChartPlugin';
+import PolygonChartPlugin from '../deckgl/layers/Polygon/PolygonChartPlugin';
+import ScatterChartPlugin from '../deckgl/layers/Scatter/ScatterChartPlugin';
+import ScreengridChartPlugin from '../deckgl/layers/Screengrid/ScreengridChartPlugin';
+
+export default class DeckGLChartPreset extends Preset {
+  constructor() {
+    super({
+      name: 'deck.gl charts',
+      plugins: [
+        new ArcChartPlugin().configure({ key: 'deck_arc' }),
+        new GeoJsonChartPlugin().configure({ key: 'deck_geojson' }),
+        new GridChartPlugin().configure({ key: 'deck_grid' }),
+        new HexChartPlugin().configure({ key: 'deck_hex' }),
+        new MultiChartPlugin().configure({ key: 'deck_multi' }),
+        new PathChartPlugin().configure({ key: 'deck_path' }),
+        new PolygonChartPlugin().configure({ key: 'deck_polygon' }),
+        new ScatterChartPlugin().configure({ key: 'deck_scatter' }),
+        new ScreengridChartPlugin().configure({ key: 'deck_screengrid' }),
+      ],
+    });
+  }
+}
diff --git a/superset/assets/src/visualizations/presets/LegacyChartPreset.js b/superset/assets/src/visualizations/presets/LegacyChartPreset.js
new file mode 100644
index 0000000000..d96a58148c
--- /dev/null
+++ b/superset/assets/src/visualizations/presets/LegacyChartPreset.js
@@ -0,0 +1,17 @@
+import Preset from '../core/models/Preset';
+import ClassicChartPreset from './ClassicChartPreset';
+import MapChartPreset from './MapChartPlugin';
+import UncommonChartPreset from './UncommonChartPreset';
+
+export default class LegacyChartPreset extends Preset {
+  constructor() {
+    super({
+      name: 'Legacy charts',
+      presets: [
+        new ClassicChartPreset(),
+        new MapChartPreset(),
+        new UncommonChartPreset(),
+      ],
+    });
+  }
+}
diff --git a/superset/assets/src/visualizations/presets/MapChartPlugin.js b/superset/assets/src/visualizations/presets/MapChartPlugin.js
new file mode 100644
index 0000000000..a45ba5cdb5
--- /dev/null
+++ b/superset/assets/src/visualizations/presets/MapChartPlugin.js
@@ -0,0 +1,17 @@
+import Preset from '../core/models/Preset';
+import CountryMapChartPlugin from '../CountryMap/CountryMapChartPlugin';
+import MapBoxChartPlugin from '../MapBox/MapBoxChartPlugin';
+import WorldMapChartPlugin from '../WorldMap/WorldMapChartPlugin';
+
+export default class MapChartPreset extends Preset {
+  constructor() {
+    super({
+      name: 'Maps',
+      plugins: [
+        new CountryMapChartPlugin().configure({ key: 'country_map' }),
+        new MapBoxChartPlugin().configure({ key: 'mapbox' }),
+        new WorldMapChartPlugin().configure({ key: 'world_map' }),
+      ],
+    });
+  }
+}
diff --git a/superset/assets/src/visualizations/presets/UncommonChartPreset.js b/superset/assets/src/visualizations/presets/UncommonChartPreset.js
new file mode 100644
index 0000000000..b12a2089b8
--- /dev/null
+++ b/superset/assets/src/visualizations/presets/UncommonChartPreset.js
@@ -0,0 +1,25 @@
+import Preset from '../core/models/Preset';
+import CalendarChartPlugin from '../Calendar/CalendarChartPlugin';
+import ChordChartPlugin from '../Chord/ChordChartPlugin';
+import EventFlowChartPlugin from '../EventFlow/EventFlowChartPlugin';
+import HorizonChartPlugin from '../Horizon/HorizonChartPlugin';
+import PairedTTestChartPlugin from '../PairedTTest/PairedTTestChartPlugin';
+import ParallelCoordinatesChartPlugin from '../ParallelCoordinates/ParallelCoordinatesChartPlugin';
+import RoseChartPlugin from '../Rose/RoseChartPlugin';
+
+export default class UncommonChartPreset extends Preset {
+  constructor() {
+    super({
+      name: 'Uncommon charts',
+      plugins: [
+        new CalendarChartPlugin().configure({ key: 'cal_heatmap' }),
+        new ChordChartPlugin().configure({ key: 'chord' }),
+        new EventFlowChartPlugin().configure({ key: 'event_flow' }),
+        new HorizonChartPlugin().configure({ key: 'horizon' }),
+        new PairedTTestChartPlugin().configure({ key: 'paired_ttest' }),
+        new ParallelCoordinatesChartPlugin().configure({ key: 'para' }),
+        new RoseChartPlugin().configure({ key: 'rose' }),
+      ],
+    });
+  }
+}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org