Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WiP] - Dynamically import of viz plugins, take 1 #9324

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
313 changes: 209 additions & 104 deletions superset-frontend/package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"mousetrap": "^1.6.1",
"mustache": "^2.2.1",
"omnibar": "^2.1.1",
"path": "^0.12.7",
"prop-types": "^15.6.0",
"re-resizable": "^4.3.1",
"react": "^16.9.0",
Expand Down Expand Up @@ -157,7 +158,8 @@
"regenerator-runtime": "^0.13.3",
"shortid": "^2.2.6",
"urijs": "^1.18.10",
"use-query-params": "^0.4.5"
"use-query-params": "^0.4.5",
"zlib": "^1.0.5"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
Expand Down Expand Up @@ -220,6 +222,7 @@
"less-loader": "^5.0.0",
"mini-css-extract-plugin": "^0.4.0",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"os": "^0.1.1",
"po2json": "^0.4.5",
"prettier": "^1.19.1",
"react-test-renderer": "^16.9.0",
Expand Down
145 changes: 91 additions & 54 deletions superset-frontend/src/visualizations/presets/MainPreset.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,12 @@
* under the License.
*/
import { Preset } from '@superset-ui/core';

import {
BigNumberChartPlugin,
BigNumberTotalChartPlugin,
} from '@superset-ui/legacy-preset-chart-big-number';
import CalendarChartPlugin from '@superset-ui/legacy-plugin-chart-calendar';
import ChordChartPlugin from '@superset-ui/legacy-plugin-chart-chord';
import CountryMapChartPlugin from '@superset-ui/legacy-plugin-chart-country-map';
import EventFlowChartPlugin from '@superset-ui/legacy-plugin-chart-event-flow';
import ForceDirectedChartPlugin from '@superset-ui/legacy-plugin-chart-force-directed';
import HeatmapChartPlugin from '@superset-ui/legacy-plugin-chart-heatmap';
import HistogramChartPlugin from '@superset-ui/legacy-plugin-chart-histogram';
import HorizonChartPlugin from '@superset-ui/legacy-plugin-chart-horizon';
import IframeChartPlugin from '@superset-ui/legacy-plugin-chart-iframe';
import MapBoxChartPlugin from '@superset-ui/legacy-plugin-chart-map-box';
import MarkupChartPlugin from '@superset-ui/legacy-plugin-chart-markup';
import PairedTTestChartPlugin from '@superset-ui/legacy-plugin-chart-paired-t-test';
import ParallelCoordinatesChartPlugin from '@superset-ui/legacy-plugin-chart-parallel-coordinates';
import PartitionChartPlugin from '@superset-ui/legacy-plugin-chart-partition';
import PivotTableChartPlugin from '@superset-ui/legacy-plugin-chart-pivot-table';
import RoseChartPlugin from '@superset-ui/legacy-plugin-chart-rose';
import SankeyChartPlugin from '@superset-ui/legacy-plugin-chart-sankey';
import SunburstChartPlugin from '@superset-ui/legacy-plugin-chart-sunburst';
import TableChartPlugin from '@superset-ui/legacy-plugin-chart-table';
import TreemapChartPlugin from '@superset-ui/legacy-plugin-chart-treemap';
import WordCloudChartPlugin from '@superset-ui/legacy-plugin-chart-word-cloud';
import WorldMapChartPlugin from '@superset-ui/legacy-plugin-chart-world-map';

// There is a known issue with bubble chart that the bubbles will not show up.
// (<path d="NaN" />)
// Make sure to import '@superset-ui/legacy-preset-chart-nvd3/lib'
Expand All @@ -61,57 +41,114 @@ import {
PieChartPlugin,
TimePivotChartPlugin,
} from '@superset-ui/legacy-preset-chart-nvd3/lib';
import { BoxPlotChartPlugin } from '@superset-ui/preset-chart-xy/esm/legacy';
import { DeckGLChartPreset } from '@superset-ui/legacy-preset-chart-deckgl';

import FilterBoxChartPlugin from '../FilterBox/FilterBoxChartPlugin';
import TimeTableChartPlugin from '../TimeTable/TimeTableChartPlugin';
import { BoxPlotChartPlugin } from '@superset-ui/preset-chart-xy/esm/legacy';

export default class MainPreset extends Preset {
constructor() {
super({
name: 'Legacy charts',
presets: [new DeckGLChartPreset()],
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' }),
// import('../../../../../superset-ui-plugins_preset/packages/superset-ui-legacy-preset-chart-big-number/src/index').then(module => {
// import('@superset-ui/legacy-preset-chart-big-number').then(module => {
// new module.BigNumberChartPlugin().configure({ key: 'big_number' });
// new module.BigNumberTotalChartPlugin().configure({ key: 'big_number_total' });
// }),

// NVD3 STUFF
new AreaChartPlugin().configure({ key: 'area' }),
new BarChartPlugin().configure({ key: 'bar' }),
new BubbleChartPlugin().configure({ key: 'bubble' }),
new BulletChartPlugin().configure({ key: 'bullet' }),
new CalendarChartPlugin().configure({ key: 'cal_heatmap' }),
new ChordChartPlugin().configure({ key: 'chord' }),
new CompareChartPlugin().configure({ key: 'compare' }),
new CountryMapChartPlugin().configure({ key: 'country_map' }),
new DistBarChartPlugin().configure({ key: 'dist_bar' }),
new DualLineChartPlugin().configure({ key: 'dual_line' }),
new EventFlowChartPlugin().configure({ key: 'event_flow' }),
new FilterBoxChartPlugin().configure({ key: 'filter_box' }),
new ForceDirectedChartPlugin().configure({ key: 'directed_force' }),
new HeatmapChartPlugin().configure({ key: 'heatmap' }),
new HistogramChartPlugin().configure({ key: 'histogram' }),
new HorizonChartPlugin().configure({ key: 'horizon' }),
new IframeChartPlugin().configure({ key: 'iframe' }),
new LineChartPlugin().configure({ key: 'line' }),
new LineMultiChartPlugin().configure({ key: 'line_multi' }),
new MapBoxChartPlugin().configure({ key: 'mapbox' }),
new MarkupChartPlugin().configure({ key: 'markup' }),
new MarkupChartPlugin().configure({ key: 'separator' }),
new PairedTTestChartPlugin().configure({ key: 'paired_ttest' }),
new ParallelCoordinatesChartPlugin().configure({ key: 'para' }),
new PartitionChartPlugin().configure({ key: 'partition' }),
new PieChartPlugin().configure({ key: 'pie' }),
new PivotTableChartPlugin().configure({ key: 'pivot_table' }),
new RoseChartPlugin().configure({ key: 'rose' }),
new SankeyChartPlugin().configure({ key: 'sankey' }),
new SunburstChartPlugin().configure({ key: 'sunburst' }),
new TableChartPlugin().configure({ key: 'table' }),
new TimePivotChartPlugin().configure({ key: 'time_pivot' }),
new TimeTableChartPlugin().configure({ key: 'time_table' }),
new TreemapChartPlugin().configure({ key: 'treemap' }),
new WordCloudChartPlugin().configure({ key: 'word_cloud' }),
new WorldMapChartPlugin().configure({ key: 'world_map' }),
// END NVD3 STUFF

// BOXPLOT
new BoxPlotChartPlugin().configure({ key: 'box_plot' }),

import('@superset-ui/legacy-plugin-chart-calendar').then(module =>
new module.default().configure({ key: 'cal_heatmap' }),
),
import('../FilterBox/FilterBoxChartPlugin').then(module =>
new module.default().configure({ key: 'filter_box' }),
),
import('@superset-ui/legacy-plugin-chart-chord').then(module =>
new module.default().configure({ key: 'chord' }),
),
import('@superset-ui/legacy-plugin-chart-country-map').then(module =>
new module.default().configure({ key: 'country_map' }),
),
import('@superset-ui/legacy-plugin-chart-event-flow').then(module =>
new module.default().configure({ key: 'event_flow' }),
),
import('@superset-ui/legacy-plugin-chart-force-directed').then(module =>
new module.default().configure({ key: 'directed_force' }),
),
import('@superset-ui/legacy-plugin-chart-heatmap').then(module =>
new module.default().configure({ key: 'heatmap' }),
),
import('@superset-ui/legacy-plugin-chart-histogram').then(module =>
new module.default().configure({ key: 'histogram' }),
),
import('@superset-ui/legacy-plugin-chart-horizon').then(module =>
new module.default().configure({ key: 'horizon' }),
),
import('@superset-ui/legacy-plugin-chart-iframe').then(module =>
new module.default().configure({ key: 'iframe' }),
),
import('@superset-ui/legacy-plugin-chart-map-box').then(module =>
new module.default().configure({ key: 'mapbox' }),
),
import('@superset-ui/legacy-plugin-chart-markup').then(module =>
new module.default().configure({ key: 'separator' }),
),
import('@superset-ui/legacy-plugin-chart-paired-t-test').then(module =>
new module.default().configure({ key: 'paired_ttest' }),
),
import(
'@superset-ui/legacy-plugin-chart-parallel-coordinates'
).then(module => new module.default().configure({ key: 'para' })),
import('@superset-ui/legacy-plugin-chart-partition').then(module =>
new module.default().configure({ key: 'partition' }),
),
import('@superset-ui/legacy-plugin-chart-pivot-table').then(module =>
new module.default().configure({ key: 'pivot_table' }),
),
import('@superset-ui/legacy-plugin-chart-rose').then(module =>
new module.default().configure({ key: 'rose' }),
),
import('@superset-ui/legacy-plugin-chart-sankey').then(module =>
new module.default().configure({ key: 'sankey' }),
),
import('@superset-ui/legacy-plugin-chart-sunburst').then(module =>
new module.default().configure({ key: 'sunburst' }),
),
import('@superset-ui/legacy-plugin-chart-table').then(module =>
new module.default().configure({ key: 'table' }),
),
import('../TimeTable/TimeTableChartPlugin').then(module =>
new module.default().configure({ key: 'time_table' }),
),
// import('../../../../../superset-ui-plugins_preset/packages/superset-ui-legacy-plugin-chart-treemap/esm/').then(module => new module.default().configure({ key: 'treemap' })),
import('@superset-ui/legacy-plugin-chart-treemap').then(module =>
new module.default().configure({ key: 'treemap' }),
),
// import('../../../../../superset-ui-plugins_preset/packages/superset-ui-legacy-plugin-chart-word-cloud').then(module => new module.default().configure({ key: 'word_cloud' })),
import('@superset-ui/legacy-plugin-chart-word-cloud').then(module =>
new module.default().configure({ key: 'word_cloud' }),
),
import('@superset-ui/legacy-plugin-chart-world-map').then(module =>
new module.default().configure({ key: 'world_map' }),
),
],
});
}
Expand Down
54 changes: 27 additions & 27 deletions superset-frontend/stylesheets/fonts/FiraCode/specimen.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,44 @@
* specific language governing permissions and limitations
* under the License.
*/

@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-Light.woff2') format('woff2'),
url("woff/FiraCode-Light.woff") format("woff");
font-weight: 300;
font-style: normal;
font-family: 'Fira Code';
src: url('woff2/FiraCode-Light.woff2') format('woff2'),
url('woff/FiraCode-Light.woff') format('woff');
font-weight: 300;
font-style: normal;
}

@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-Regular.woff2') format('woff2'),
url("woff/FiraCode-Regular.woff") format("woff");
font-weight: 400;
font-style: normal;
font-family: 'Fira Code';
src: url('woff2/FiraCode-Regular.woff2') format('woff2'),
url('woff/FiraCode-Regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-Medium.woff2') format('woff2'),
url("woff/FiraCode-Medium.woff") format("woff");
font-weight: 500;
font-style: normal;
font-family: 'Fira Code';
src: url('woff2/FiraCode-Medium.woff2') format('woff2'),
url('woff/FiraCode-Medium.woff') format('woff');
font-weight: 500;
font-style: normal;
}

@font-face {
font-family: 'Fira Code';
src: url('woff2/FiraCode-Bold.woff2') format('woff2'),
url("woff/FiraCode-Bold.woff") format("woff");
font-weight: 700;
font-style: normal;
font-family: 'Fira Code';
src: url('woff2/FiraCode-Bold.woff2') format('woff2'),
url('woff/FiraCode-Bold.woff') format('woff');
font-weight: 700;
font-style: normal;
}

@font-face {
font-family: 'Fira Code VF';
src: url('woff2/FiraCode-VF.woff2') format('woff2-variations'),
url('woff/FiraCode-VF.woff') format('woff-variations');
/* font-weight requires a range: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide#Using_a_variable_font_font-face_changes */
font-weight: 300 700;
font-style: normal;
font-family: 'Fira Code VF';
src: url('woff2/FiraCode-VF.woff2') format('woff2-variations'),
url('woff/FiraCode-VF.woff') format('woff-variations');
/* font-weight requires a range: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide#Using_a_variable_font_font-face_changes */
font-weight: 300 700;
font-style: normal;
}
Loading