Skip to content

Commit

Permalink
refactor(monorepo): relocate deckgl to Superset (#17596)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie authored Dec 9, 2021
1 parent b7ae7f9 commit 04e3cfa
Show file tree
Hide file tree
Showing 127 changed files with 1,916 additions and 2,178 deletions.
2 changes: 1 addition & 1 deletion superset-frontend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
'^src/(.*)$': '<rootDir>/src/$1',
'^spec/(.*)$': '<rootDir>/spec/$1',
// mapping to souce code instead of lib or esm module
'@superset-ui/(((?!(legacy-preset-chart-deckgl|core/src)).)*)$':
'@superset-ui/(((?!(core/src)).)*)$':
'<rootDir>/node_modules/@superset-ui/$1/src',
'@superset-ui/core/src/(.*)$':
'<rootDir>/node_modules/@superset-ui/core/src/$1',
Expand Down
443 changes: 227 additions & 216 deletions superset-frontend/package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export type SelectControlType =
| 'FilterBoxItemControl';

// via react-select/src/filters
interface FilterOption<T extends SelectOption> {
export interface FilterOption<T extends SelectOption> {
label: string;
value: string;
data: T;
Expand Down
1 change: 1 addition & 0 deletions superset-frontend/packages/superset-ui-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"@superset-ui/legacy-plugin-chart-treemap": "0.18.25",
"@superset-ui/legacy-plugin-chart-world-map": "0.18.25",
"@superset-ui/legacy-preset-chart-big-number": "0.18.25",
"@superset-ui/legacy-preset-chart-deckgl": "^0.4.13",
"@superset-ui/legacy-preset-chart-nvd3": "0.18.25",
"@superset-ui/plugin-chart-echarts": "0.18.25",
"@superset-ui/plugin-chart-table": "0.18.25",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/* eslint-disable sort-keys */
/* eslint-disable no-magic-numbers */
import React from 'react';
import { SuperChart } from '@superset-ui/core';
import { ArcChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl';
import payload from './payload';
import dummyDatasource from '../../../../shared/dummyDatasource';

new ArcChartPlugin().configure({ key: 'deck_arc' }).register();

export default {
title: 'Legacy Chart Plugins/legacy-preset-chart-deckgl/ArcChartPlugin',
};

export const ArcChartViz = () => (
<SuperChart
chartType="deck_arc"
width={400}
height={400}
datasource={dummyDatasource}
queriesData={[payload]}
formData={{
datasource: '10__table',
viz_type: 'deck_arc',
granularity_sqla: 'dttm',
time_grain_sqla: null,
time_range: ' : ',
start_spatial: {
latCol: 'LATITUDE',
lonCol: 'LONGITUDE',
type: 'latlong',
},
end_spatial: {
latCol: 'LATITUDE_DEST',
lonCol: 'LONGITUDE_DEST',
type: 'latlong',
},
row_limit: 5000,
filter_nulls: true,
adhoc_filters: [],
mapbox_style: 'mapbox://styles/mapbox/light-v9',
viewport: {
altitude: 1.5,
bearing: 8.546256357301871,
height: 642,
latitude: 44.596651438714254,
longitude: -91.84340711201104,
maxLatitude: 85.05113,
maxPitch: 60,
maxZoom: 20,
minLatitude: -85.05113,
minPitch: 0,
minZoom: 0,
pitch: 60,
width: 997,
zoom: 2.929837070560775,
},
autozoom: true,
color_picker: {
a: 1,
b: 135,
g: 122,
r: 0,
},
target_color_picker: {
r: 0,
g: 122,
b: 135,
a: 1,
},
dimension: null,
label_colors: {},
stroke_width: 1,
legend_position: 'tr',
legend_format: null,
js_columns: [],
js_data_mutator: '',
js_tooltip: '',
js_onclick_href: '',
}}
/>
);
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/* eslint-disable sort-keys, no-magic-numbers */

export default {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/* eslint-disable sort-keys */
/* eslint-disable no-magic-numbers */
import React from 'react';
import { SuperChart } from '@superset-ui/core';
import { GridChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl';
import payload from './payload';
import dummyDatasource from '../../../../shared/dummyDatasource';

new GridChartPlugin().configure({ key: 'deck_grid' }).register();

export default {
title: 'Legacy Chart Plugins/legacy-preset-chart-deckgl/GridChartPlugin',
};

export const GridChartViz = () => (
<SuperChart
chartType="deck_grid"
width={400}
height={400}
datasource={dummyDatasource}
queriesData={[payload]}
formData={{
datasource: '5__table',
viz_type: 'deck_grid',
slice_id: 69,
url_params: {},
granularity_sqla: 'dttm',
time_grain_sqla: null,
time_range: '+:+',
spatial: { latCol: 'LAT', lonCol: 'LON', type: 'latlong' },
size: 'count',
row_limit: 5000,
filter_nulls: true,
adhoc_filters: [],
mapbox_style: 'mapbox://styles/mapbox/satellite-streets-v9',
viewport: {
bearing: 155.80099696026355,
latitude: 37.7942314882596,
longitude: -122.42066918995666,
pitch: 53.470800300695146,
zoom: 12.699690845482069,
},
color_picker: { a: 1, b: 0, g: 255, r: 14 },
autozoom: true,
grid_size: 120,
extruded: true,
js_columns: [],
js_data_mutator: '',
js_tooltip: '',
js_onclick_href: '',
}}
/>
);
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/* eslint-disable sort-keys */
/* eslint-disable no-magic-numbers */
export default {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/* eslint-disable sort-keys */
/* eslint-disable no-magic-numbers */
import React from 'react';
import { SuperChart } from '@superset-ui/core';
import { HexChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl';
import payload from './payload';
import dummyDatasource from '../../../../shared/dummyDatasource';

new HexChartPlugin().configure({ key: 'deck_hex' }).register();

export default {
title: 'Legacy Chart Plugins/legacy-preset-chart-deckgl/HexChartPlugin',
};

export const HexChartViz = () => (
<SuperChart
chartType="deck_hex"
width={400}
height={400}
datasource={dummyDatasource}
queriesData={[payload]}
formData={{
datasource: '5__table',
viz_type: 'deck_hex',
slice_id: 68,
url_params: {},
granularity_sqla: 'dttm',
time_grain_sqla: null,
time_range: '+:+',
spatial: { latCol: 'LAT', lonCol: 'LON', type: 'latlong' },
size: 'count',
row_limit: 5000,
filter_nulls: true,
adhoc_filters: [],
mapbox_style: 'mapbox://styles/mapbox/streets-v9',
viewport: {
bearing: -2.3984797349335167,
latitude: 37.789795085160335,
longitude: -122.40632230075536,
pitch: 54.08961642447763,
zoom: 13.835465702403654,
},
color_picker: { a: 1, b: 0, g: 255, r: 14 },
autozoom: true,
grid_size: 40,
extruded: true,
js_agg_function: 'sum',
js_columns: [],
js_data_mutator: '',
js_tooltip: '',
js_onclick_href: '',
}}
/>
);
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

/* eslint-disable sort-keys */
/* eslint-disable no-magic-numbers */
export default {
Expand Down
Loading

0 comments on commit 04e3cfa

Please sign in to comment.