-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
refactor(monorepo): relocate deckgl to Superset #17596
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
fab90a2
move deckgl
zhaoyongjie 0ebef10
update stories.tsx
zhaoyongjie b937f50
edit jest
zhaoyongjie 102fdc6
remove yarn.lock
zhaoyongjie f624938
fix lint
zhaoyongjie 7ea4a82
fix type
zhaoyongjie 2f7fee1
add license
zhaoyongjie 78b3918
refresh lock file
zhaoyongjie 72b5607
change controlpanel to ts
zhaoyongjie 22f5582
fix lint
zhaoyongjie bd513f0
export filterOption
zhaoyongjie 760c6cc
add tsconfig
zhaoyongjie c85f44b
refactor factory.jsx to factory.tsx
zhaoyongjie 2768ead
fix lint
zhaoyongjie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
...ges/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Arc/Stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '', | ||
}} | ||
/> | ||
); |
19 changes: 19 additions & 0 deletions
19
...legacy-preset-chart-deckgl/Arc/payload.js → ...legacy-preset-chart-deckgl/Arc/payload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
...es/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Grid/Stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '', | ||
}} | ||
/> | ||
); |
19 changes: 19 additions & 0 deletions
19
...legacy-preset-chart-deckgl/Hex/payload.js → ...egacy-preset-chart-deckgl/Grid/payload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...ges/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Hex/Stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '', | ||
}} | ||
/> | ||
); |
19 changes: 19 additions & 0 deletions
19
...egacy-preset-chart-deckgl/Grid/payload.js → ...legacy-preset-chart-deckgl/Hex/payload.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: can we simplify this import? Maybe by setting a base path in
tsconfig.json
tostorybook
? Then we could import likeimport dummyDatasource from 'storybook/shared/dummyDatasource';
WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(comment also applies to other files below that import dummyDatasource like that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
absolute import
depends on how to locate thestorybook/shared
module. (Maybe needed module alias in somewhere).so
relative import
is straightforward here.