upgrade plugins, remove unnecessary code (#9848)

This commit is contained in:
David Aaron Suddjian 2020-05-20 12:41:12 -07:00 committed by GitHub
parent a43a1d6303
commit f076485fd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 53 additions and 1015 deletions

View File

@ -6587,9 +6587,9 @@
}
},
"@superset-ui/control-utils": {
"version": "0.13.9",
"resolved": "https://registry.npmjs.org/@superset-ui/control-utils/-/control-utils-0.13.9.tgz",
"integrity": "sha512-R8BkUqd5WaDfFB7LiGfNBD3kfFsoqwRzIUDNvZxVzBJsmYTgF0pPVV9OB9pKZ/fImEqd/WqPb5PyB7FMtRj5Ug==",
"version": "0.13.12",
"resolved": "https://registry.npmjs.org/@superset-ui/control-utils/-/control-utils-0.13.12.tgz",
"integrity": "sha512-fxl9lWITCuvZjb2lTPE7X6WA01dM1BInnKktUForK7HP09K+oSaiInRdwZSVC5P9cH7xNlcbkPPh/AOC+Hk/Hg==",
"requires": {
"@types/react-bootstrap": "0.32.21",
"lodash": "^4.17.15",
@ -6664,18 +6664,18 @@
}
},
"@superset-ui/legacy-plugin-chart-force-directed": {
"version": "0.13.3",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-force-directed/-/legacy-plugin-chart-force-directed-0.13.3.tgz",
"integrity": "sha512-kXMDX7UiEFhpKlFUeAL2Tfl3teA3ACpeoGSOot1iHPar9mClETs3BebM7PAdkKPyoZ9630sRXY8OBbXdyRKiXA==",
"version": "0.13.16",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-force-directed/-/legacy-plugin-chart-force-directed-0.13.16.tgz",
"integrity": "sha512-LBkxN9Sgzagq4mzYtZaI1PBOHxXWiQqyWhrXT8Jl6z84K8L/zEd0rdbtQz3UI7WioEYXx7OU7eK1zzJxoEoDXQ==",
"requires": {
"d3": "^3.5.17",
"prop-types": "^15.6.2"
}
},
"@superset-ui/legacy-plugin-chart-heatmap": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-heatmap/-/legacy-plugin-chart-heatmap-0.13.5.tgz",
"integrity": "sha512-p2/pI0AfMLpnHmwbHMBiSqqM2DhXp3+3wHzxAzZUtbScatxSagZCB4UaX39bH5CF94o4kRlJUjGcIc5qcTRIwA==",
"version": "0.13.16",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-heatmap/-/legacy-plugin-chart-heatmap-0.13.16.tgz",
"integrity": "sha512-5hPO33B/5qg9uK20fneWRE5uNWLS5n/rp19X/3osx38m4peIOtOEmM2LJizxgPKpi7dVxql++hSOFm+LaIb3zw==",
"requires": {
"d3": "^3.5.17",
"d3-svg-legend": "^1.x",
@ -6684,22 +6684,22 @@
}
},
"@superset-ui/legacy-plugin-chart-histogram": {
"version": "0.13.3",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-histogram/-/legacy-plugin-chart-histogram-0.13.3.tgz",
"integrity": "sha512-kKimulREtk2gAclacMYEQvA81+E6LwzXg3Xj3pNRCGcHTuhwqGYzz4QraJarkWN9eVBI6sTn30zkIU8kIZKKqw==",
"version": "0.13.16",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-histogram/-/legacy-plugin-chart-histogram-0.13.16.tgz",
"integrity": "sha512-x2up2/wDU0F8wuXKxwfhk1vmyD/xiIaHo5STRxWf+O3os9Brcky/IhbtncxI/JaPfAkS+ObcOD4MdTuOsadcqg==",
"requires": {
"@data-ui/histogram": "^0.0.84",
"@data-ui/theme": "^0.0.84",
"@vx/legend": "^0.0.195",
"@vx/responsive": "^0.0.195",
"@vx/scale": "^0.0.195",
"@vx/legend": "^0.0.196",
"@vx/responsive": "^0.0.196",
"@vx/scale": "^0.0.196",
"prop-types": "^15.6.2"
},
"dependencies": {
"@vx/group": {
"version": "0.0.195",
"resolved": "https://registry.npmjs.org/@vx/group/-/group-0.0.195.tgz",
"integrity": "sha512-XzbCIb2dVR3b51gbiG+gfc8J/H7IaepQ7mQEOKKXnb4gP66kYU/Rtr7WTZzLD3uwsBDXjJaa2y16arnMmhUlNQ==",
"version": "0.0.196",
"resolved": "https://registry.npmjs.org/@vx/group/-/group-0.0.196.tgz",
"integrity": "sha512-neWYucGoyrWloEali12yEn//5pRVwSBtKpuzKlQ43yYTav8OLa869DtCSVeRlDG8TIcPvg9YWfWKKhGWKXRCtg==",
"requires": {
"@types/classnames": "^2.2.9",
"@types/react": "*",
@ -6708,22 +6708,34 @@
}
},
"@vx/legend": {
"version": "0.0.195",
"resolved": "https://registry.npmjs.org/@vx/legend/-/legend-0.0.195.tgz",
"integrity": "sha512-EduXqrgU+JlJAQlA723nXsAvT81EAEscw3cl3/E4m4d8LCHnudLIX3AMG0AD9gxY/4pJclkYFU9MQP3TfoTVag==",
"version": "0.0.196",
"resolved": "https://registry.npmjs.org/@vx/legend/-/legend-0.0.196.tgz",
"integrity": "sha512-VTXluzTIFqZEFSM46OSV8DcOWLmGhfe9ILt6ghkMg7Z1yG34qE8S0KjGByqn6isQgHdlrg3VbF7NGd3NJA6HkA==",
"requires": {
"@types/classnames": "^2.2.9",
"@types/d3-scale": "^2.1.1",
"@types/react": "*",
"@vx/group": "0.0.195",
"@vx/group": "0.0.196",
"classnames": "^2.2.5",
"prop-types": "^15.5.10"
}
},
"@vx/responsive": {
"version": "0.0.196",
"resolved": "https://registry.npmjs.org/@vx/responsive/-/responsive-0.0.196.tgz",
"integrity": "sha512-mwV0pf7YjdzQH5vqA81vtDLuPT9cKFDu2+vfyP8e4Xun0eWato7ut3j9dP0QLZ3k71CJWeZ4v2thzlcUWafAow==",
"requires": {
"@types/lodash": "^4.14.146",
"@types/react": "*",
"lodash": "^4.17.10",
"prop-types": "^15.6.1",
"resize-observer-polyfill": "1.5.1"
}
},
"@vx/scale": {
"version": "0.0.195",
"resolved": "https://registry.npmjs.org/@vx/scale/-/scale-0.0.195.tgz",
"integrity": "sha512-aZ2N+YVB6k9um7jzOQY9h/BaV/5vTA8DeuWjqMmeuJCTkX3NzJqu+/oWQRwOcMr/07rAPLf/0YUVEGE50OTEFQ==",
"version": "0.0.196",
"resolved": "https://registry.npmjs.org/@vx/scale/-/scale-0.0.196.tgz",
"integrity": "sha512-s3lVbwEni0F9AGACaJG3m071uXVryoOgogiU6+yXv1O1gUoZMMm6AjzCndcz9jq1sCFDNcIrxyf5LomOA2tQaQ==",
"requires": {
"@types/d3-scale": "^2.1.1",
"d3-scale": "^2.2.2"
@ -6745,9 +6757,9 @@
}
},
"@superset-ui/legacy-plugin-chart-horizon": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-horizon/-/legacy-plugin-chart-horizon-0.13.5.tgz",
"integrity": "sha512-NJqtAqewTG3R+7Ilv3g792L8eURIZivW2v5CZw1NslDsBPhdigGFP38cpH/oLJHtg52MkQDg331P1S66QLZGxQ==",
"version": "0.13.16",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-horizon/-/legacy-plugin-chart-horizon-0.13.16.tgz",
"integrity": "sha512-XTZjvY02jLIloifBC8xdkUR35wAdPvGlSVvQrH6fJ6kX6xcss71PmV2/B6ler2FLSME/ZnihqYxbBbhYQwSE5Q==",
"requires": {
"d3-array": "^2.0.3",
"d3-scale": "^3.0.1",
@ -6774,9 +6786,9 @@
}
},
"@superset-ui/legacy-plugin-chart-iframe": {
"version": "0.13.3",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-iframe/-/legacy-plugin-chart-iframe-0.13.3.tgz",
"integrity": "sha512-TYFXiUj2cNqOVdwxLYTb2mt/60qq7h1HvDfJKwm+SYPWIlupBHCWRTjpUJZ7mfUa0w9OUBXPD9who5VyEKt6EA==",
"version": "0.13.16",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-iframe/-/legacy-plugin-chart-iframe-0.13.16.tgz",
"integrity": "sha512-9a1YNql6yAYLfP5DARbZxi6zGOKCWxEleQPumJuSD167p5eVmJvm8Avvy1lscKngGydFFJ4uIRmNyPAmlKhbnA==",
"requires": {
"mustache": "^4.0.0",
"prop-types": "^15.6.2"
@ -6790,9 +6802,9 @@
}
},
"@superset-ui/legacy-plugin-chart-map-box": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-map-box/-/legacy-plugin-chart-map-box-0.13.5.tgz",
"integrity": "sha512-wnZaYUBVxeO+JLxg5wQsQXEzVS4XPbAJ0jiIPxPBLaepQY2R5v1Rup4kefvFfdGyQB9Fubx0ihfIQijrMsLA6w==",
"version": "0.13.16",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-map-box/-/legacy-plugin-chart-map-box-0.13.16.tgz",
"integrity": "sha512-14B+vd883Ne0feNFXNcGOyluPUjAl7MEqswYfOPZTpAQYh1neyiDnFhUUssYaYH8h9/pNK7s33c38TfZjxFUiA==",
"requires": {
"immutable": "^3.8.2",
"mapbox-gl": "^0.53.0",

View File

@ -63,19 +63,19 @@
"@superset-ui/chart-composition": "^0.13.5",
"@superset-ui/color": "^0.13.3",
"@superset-ui/connection": "^0.13.5",
"@superset-ui/control-utils": "^0.13.9",
"@superset-ui/control-utils": "^0.13.12",
"@superset-ui/core": "^0.13.5",
"@superset-ui/dimension": "^0.13.3",
"@superset-ui/legacy-plugin-chart-calendar": "^0.13.6",
"@superset-ui/legacy-plugin-chart-chord": "^0.13.13",
"@superset-ui/legacy-plugin-chart-country-map": "^0.13.3",
"@superset-ui/legacy-plugin-chart-event-flow": "^0.11.15",
"@superset-ui/legacy-plugin-chart-force-directed": "^0.13.3",
"@superset-ui/legacy-plugin-chart-heatmap": "^0.13.5",
"@superset-ui/legacy-plugin-chart-histogram": "^0.13.3",
"@superset-ui/legacy-plugin-chart-horizon": "^0.13.5",
"@superset-ui/legacy-plugin-chart-iframe": "^0.13.3",
"@superset-ui/legacy-plugin-chart-map-box": "^0.13.5",
"@superset-ui/legacy-plugin-chart-force-directed": "^0.13.16",
"@superset-ui/legacy-plugin-chart-heatmap": "^0.13.16",
"@superset-ui/legacy-plugin-chart-histogram": "^0.13.16",
"@superset-ui/legacy-plugin-chart-horizon": "^0.13.16",
"@superset-ui/legacy-plugin-chart-iframe": "^0.13.16",
"@superset-ui/legacy-plugin-chart-map-box": "^0.13.16",
"@superset-ui/legacy-plugin-chart-markup": "^0.13.12",
"@superset-ui/legacy-plugin-chart-paired-t-test": "^0.13.5",
"@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.13.3",

View File

@ -1,94 +0,0 @@
/**
* 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.
*/
import { t } from '@superset-ui/translation';
import { formatSelectOptions } from '../../modules/utils';
export default {
controlPanelSections: [
{
label: t('Query'),
expanded: true,
controlSetRows: [
['groupby'],
['metric'],
['adhoc_filters'],
['row_limit'],
],
},
{
label: t('Options'),
controlSetRows: [
[
{
name: 'link_length',
config: {
type: 'SelectControl',
renderTrigger: true,
freeForm: true,
label: t('Link Length'),
default: '200',
choices: formatSelectOptions([
'10',
'25',
'50',
'75',
'100',
'150',
'200',
'250',
]),
description: t('Link length in the force layout'),
},
},
],
[
{
name: 'charge',
config: {
type: 'SelectControl',
renderTrigger: true,
freeForm: true,
label: t('Charge'),
default: '-500',
choices: formatSelectOptions([
'-50',
'-75',
'-100',
'-150',
'-200',
'-250',
'-500',
'-1000',
'-2500',
'-5000',
]),
description: t('Charge in the force layout'),
},
},
],
],
},
],
controlOverrides: {
groupby: {
label: t('Source / Target'),
description: t('Choose a source and a target'),
},
},
};

View File

@ -1,290 +0,0 @@
/**
* 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.
*/
import { t } from '@superset-ui/translation';
import { validateNonEmpty } from '@superset-ui/validator';
import {
formatSelectOptionsForRange,
formatSelectOptions,
} from '../../modules/utils';
import { columnChoices } from '../controls';
const sortAxisChoices = [
['alpha_asc', t('Axis ascending')],
['alpha_desc', t('Axis descending')],
['value_asc', t('Metric ascending')],
['value_desc', t('Metric descending')],
];
export default {
controlPanelSections: [
{
label: t('Query'),
expanded: true,
controlSetRows: [
[
{
name: 'all_columns_x',
config: {
type: 'SelectControl',
label: 'X',
default: null,
description: t('Columns to display'),
mapStateToProps: state => ({
choices: columnChoices(state.datasource),
}),
validators: [validateNonEmpty],
},
},
{
name: 'all_columns_y',
config: {
type: 'SelectControl',
label: 'Y',
default: null,
description: t('Columns to display'),
mapStateToProps: state => ({
choices: columnChoices(state.datasource),
}),
validators: [validateNonEmpty],
},
},
],
['metric'],
['adhoc_filters'],
['row_limit'],
],
},
{
label: t('Heatmap Options'),
expanded: true,
controlSetRows: [
['linear_color_scheme'],
[
{
name: 'xscale_interval',
config: {
type: 'SelectControl',
label: t('XScale Interval'),
renderTrigger: true,
choices: formatSelectOptionsForRange(1, 50),
default: '1',
clearable: false,
description: t(
'Number of steps to take between ticks when displaying the X scale',
),
},
},
{
name: 'yscale_interval',
config: {
type: 'SelectControl',
label: t('YScale Interval'),
choices: formatSelectOptionsForRange(1, 50),
default: '1',
clearable: false,
renderTrigger: true,
description: t(
'Number of steps to take between ticks when displaying the Y scale',
),
},
},
],
[
{
name: 'canvas_image_rendering',
config: {
type: 'SelectControl',
label: t('Rendering'),
renderTrigger: true,
choices: [
['pixelated', 'pixelated (Sharp)'],
['auto', 'auto (Smooth)'],
],
default: 'pixelated',
description: t(
'image-rendering CSS attribute of the canvas object that ' +
'defines how the browser scales up the image',
),
},
},
{
name: 'normalize_across',
config: {
type: 'SelectControl',
label: t('Normalize Across'),
choices: [
['heatmap', 'heatmap'],
['x', 'x'],
['y', 'y'],
],
default: 'heatmap',
description: t(
'Color will be rendered based on a ratio ' +
'of the cell against the sum of across this ' +
'criteria',
),
},
},
],
[
{
name: 'left_margin',
config: {
type: 'SelectControl',
freeForm: true,
clearable: false,
label: t('Left Margin'),
choices: formatSelectOptions([
'auto',
50,
75,
100,
125,
150,
200,
]),
default: 'auto',
renderTrigger: true,
description: t(
'Left margin, in pixels, allowing for more room for axis labels',
),
},
},
{
name: 'bottom_margin',
config: {
type: 'SelectControl',
clearable: false,
freeForm: true,
label: t('Bottom Margin'),
choices: formatSelectOptions([
'auto',
50,
75,
100,
125,
150,
200,
]),
default: 'auto',
renderTrigger: true,
description: t(
'Bottom margin, in pixels, allowing for more room for axis labels',
),
},
},
],
[
{
name: 'y_axis_bounds',
config: {
type: 'BoundsControl',
label: t('Value bounds'),
renderTrigger: true,
default: [null, null],
description: t(
'Hard value bounds applied for color coding. Is only relevant ' +
'and applied when the normalization is applied against the whole heatmap.',
),
},
},
'y_axis_format',
],
[
{
name: 'show_legend',
config: {
type: 'CheckboxControl',
label: t('Legend'),
renderTrigger: true,
default: true,
description: t('Whether to display the legend (toggles)'),
},
},
{
name: 'show_perc',
config: {
type: 'CheckboxControl',
label: t('Show percentage'),
renderTrigger: true,
description: t(
'Whether to include the percentage in the tooltip',
),
default: true,
},
},
],
[
{
name: 'show_values',
config: {
type: 'CheckboxControl',
label: t('Show Values'),
renderTrigger: true,
default: false,
description: t(
'Whether to display the numerical values within the cells',
),
},
},
{
name: 'normalized',
config: {
type: 'CheckboxControl',
label: t('Normalized'),
renderTrigger: true,
description: t('Whether to normalize the histogram'),
default: false,
},
},
],
[
{
name: 'sort_x_axis',
config: {
type: 'SelectControl',
label: t('Sort X Axis'),
choices: sortAxisChoices,
clearable: false,
default: 'alpha_asc',
},
},
{
name: 'sort_y_axis',
config: {
type: 'SelectControl',
label: t('Sort Y Axis'),
choices: sortAxisChoices,
clearable: false,
default: 'alpha_asc',
},
},
],
],
},
],
controlOverrides: {
normalized: t(
'Whether to apply a normal distribution based on rank on the color scale',
),
y_axis_format: {
label: t('Value Format'),
},
},
};

View File

@ -1,116 +0,0 @@
/**
* 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.
*/
import { t } from '@superset-ui/translation';
import { validateNonEmpty } from '@superset-ui/validator';
import { columnChoices } from '../controls';
import { formatSelectOptions } from '../../modules/utils';
export default {
controlPanelSections: [
{
label: t('Query'),
expanded: true,
controlSetRows: [
[
{
name: 'all_columns_x',
config: {
type: 'SelectControl',
label: t('Numeric Columns'),
default: null,
description: t(
'Select the numeric columns to draw the histogram',
),
mapStateToProps: state => ({
choices: columnChoices(state.datasource),
}),
multi: true,
validators: [validateNonEmpty],
},
},
],
['adhoc_filters'],
['row_limit'],
['groupby'],
],
},
{
label: t('Chart Options'),
expanded: true,
controlSetRows: [
['color_scheme', 'label_colors'],
[
{
name: 'link_length',
config: {
type: 'SelectControl',
renderTrigger: true,
freeForm: true,
label: t('No of Bins'),
default: 5,
choices: formatSelectOptions([
'10',
'25',
'50',
'75',
'100',
'150',
'200',
'250',
]),
description: t('Select the number of bins for the histogram'),
},
},
],
[
{
name: 'x_axis_label',
config: {
type: 'TextControl',
label: t('X Axis Label'),
renderTrigger: true,
default: '',
},
},
{
name: 'y_axis_label',
config: {
type: 'TextControl',
label: t('Y Axis Label'),
renderTrigger: true,
default: '',
},
},
],
[
{
name: 'normalized',
config: {
type: 'CheckboxControl',
label: t('Normalized'),
renderTrigger: true,
description: t('Whether to normalize the histogram'),
default: false,
},
},
],
],
},
],
};

View File

@ -1,73 +0,0 @@
/**
* 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.
*/
import { t } from '@superset-ui/translation';
import { NVD3TimeSeries } from './sections';
import { formatSelectOptions } from '../../modules/utils';
export default {
controlPanelSections: [
NVD3TimeSeries[0],
{
label: t('Chart Options'),
expanded: true,
controlSetRows: [
[
{
name: 'series_height',
config: {
type: 'SelectControl',
renderTrigger: true,
freeForm: true,
label: t('Series Height'),
default: '25',
choices: formatSelectOptions([
'10',
'25',
'40',
'50',
'75',
'100',
'150',
'200',
]),
description: t('Pixel height of each series'),
},
},
{
name: 'horizon_color_scale',
config: {
type: 'SelectControl',
renderTrigger: true,
label: t('Value Domain'),
choices: [
['series', 'series'],
['overall', 'overall'],
['change', 'change'],
],
default: 'series',
description: t(
'series: Treat each series independently; overall: All series use the same scale; change: Show changes compared to the first data point in each series',
),
},
},
],
],
},
],
};

View File

@ -1,51 +0,0 @@
/**
* 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.
*/
import { t } from '@superset-ui/translation';
export default {
controlPanelSections: [
{
label: t('Options'),
controlSetRows: [
[
{
name: 'url',
config: {
type: 'TextControl',
label: t('URL'),
description: t(
'The URL, this control is templated, so you can integrate ' +
'{{ width }} and/or {{ height }} in your URL string.',
),
default: '',
},
},
],
],
},
],
sectionOverrides: {
druidTimeSeries: {
controlSetRows: [],
},
sqlaTimeSeries: {
controlSetRows: [],
},
},
};

View File

@ -1,312 +0,0 @@
/**
* 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.
*/
import { t } from '@superset-ui/translation';
import { formatSelectOptions } from '../../modules/utils';
import { columnChoices } from '../controls';
export default {
controlPanelSections: [
{
label: t('Query'),
expanded: true,
controlSetRows: [
[
{
name: 'all_columns_x',
config: {
type: 'SelectControl',
label: t('Longitude'),
default: null,
description: t('Column containing longitude data'),
mapStateToProps: state => ({
choices: columnChoices(state.datasource),
}),
},
},
{
name: 'all_columns_y',
config: {
type: 'SelectControl',
label: t('Latitude'),
default: null,
description: t('Column containing latitude data'),
mapStateToProps: state => ({
choices: columnChoices(state.datasource),
}),
},
},
],
[
{
name: 'clustering_radius',
config: {
type: 'SelectControl',
freeForm: true,
label: t('Clustering Radius'),
default: '60',
choices: formatSelectOptions([
'0',
'20',
'40',
'60',
'80',
'100',
'200',
'500',
'1000',
]),
description: t(
'The radius (in pixels) the algorithm uses to define a cluster. ' +
'Choose 0 to turn off clustering, but beware that a large ' +
'number of points (>1000) will cause lag.',
),
},
},
],
['row_limit'],
['adhoc_filters'],
['groupby'],
],
},
{
label: t('Points'),
controlSetRows: [
[
{
name: 'point_radius',
config: {
type: 'SelectControl',
label: t('Point Radius'),
default: 'Auto',
description: t(
'The radius of individual points (ones that are not in a cluster). ' +
'Either a numerical column or `Auto`, which scales the point based ' +
'on the largest cluster',
),
mapStateToProps: state => ({
choices: formatSelectOptions(['Auto']).concat(
columnChoices(state.datasource),
),
}),
},
},
],
[
{
name: 'point_radius_unit',
config: {
type: 'SelectControl',
label: t('Point Radius Unit'),
default: 'Pixels',
choices: formatSelectOptions(['Pixels', 'Miles', 'Kilometers']),
description: t(
'The unit of measure for the specified point radius',
),
},
},
],
],
},
{
label: t('Labelling'),
controlSetRows: [
[
{
name: 'mapbox_label',
config: {
type: 'SelectControl',
multi: true,
label: t('label'),
default: [],
description: t(
'`count` is COUNT(*) if a group by is used. ' +
'Numerical columns will be aggregated with the aggregator. ' +
'Non-numerical columns will be used to label points. ' +
'Leave empty to get a count of points in each cluster.',
),
mapStateToProps: state => ({
choices: columnChoices(state.datasource),
}),
},
},
],
[
{
name: 'pandas_aggfunc',
config: {
type: 'SelectControl',
label: t('Cluster label aggregator'),
clearable: false,
choices: formatSelectOptions([
'sum',
'mean',
'min',
'max',
'std',
'var',
]),
default: 'sum',
description: t(
'Aggregate function applied to the list of points ' +
'in each cluster to produce the cluster label.',
),
},
},
],
],
},
{
label: t('Visual Tweaks'),
controlSetRows: [
[
{
name: 'render_while_dragging',
config: {
type: 'CheckboxControl',
label: t('Live render'),
default: true,
description: t(
'Points and clusters will update as the viewport is being changed',
),
},
},
],
[
{
name: 'mapbox_style',
config: {
type: 'SelectControl',
label: t('Map Style'),
clearable: false,
renderTrigger: true,
choices: [
['mapbox://styles/mapbox/streets-v9', 'Streets'],
['mapbox://styles/mapbox/dark-v9', 'Dark'],
['mapbox://styles/mapbox/light-v9', 'Light'],
[
'mapbox://styles/mapbox/satellite-streets-v9',
'Satellite Streets',
],
['mapbox://styles/mapbox/satellite-v9', 'Satellite'],
['mapbox://styles/mapbox/outdoors-v9', 'Outdoors'],
],
default: 'mapbox://styles/mapbox/light-v9',
description: t('Base layer map style'),
},
},
],
[
{
name: 'global_opacity',
config: {
type: 'TextControl',
label: t('Opacity'),
default: 1,
isFloat: true,
description: t(
'Opacity of all clusters, points, and labels. Between 0 and 1.',
),
},
},
],
[
{
name: 'mapbox_color',
config: {
type: 'SelectControl',
freeForm: true,
label: t('RGB Color'),
default: 'rgb(0, 122, 135)',
choices: [
['rgb(0, 139, 139)', 'Dark Cyan'],
['rgb(128, 0, 128)', 'Purple'],
['rgb(255, 215, 0)', 'Gold'],
['rgb(69, 69, 69)', 'Dim Gray'],
['rgb(220, 20, 60)', 'Crimson'],
['rgb(34, 139, 34)', 'Forest Green'],
],
description: t('The color for points and clusters in RGB'),
},
},
],
],
},
{
label: t('Viewport'),
expanded: true,
controlSetRows: [
[
{
name: 'viewport_longitude',
config: {
type: 'TextControl',
label: t('Default longitude'),
renderTrigger: true,
default: -122.405293,
isFloat: true,
description: t('Longitude of default viewport'),
places: 8,
// Viewport longitude changes shouldn't prompt user to re-run query
dontRefreshOnChange: true,
},
},
{
name: 'viewport_latitude',
config: {
type: 'TextControl',
label: t('Default latitude'),
renderTrigger: true,
default: 37.772123,
isFloat: true,
description: t('Latitude of default viewport'),
places: 8,
// Viewport latitude changes shouldn't prompt user to re-run query
dontRefreshOnChange: true,
},
},
],
[
{
name: 'viewport_zoom',
config: {
type: 'TextControl',
label: t('Zoom'),
renderTrigger: true,
isFloat: true,
default: 11,
description: t('Zoom level of the map'),
places: 8,
// Viewport zoom shouldn't prompt user to re-run query
dontRefreshOnChange: true,
},
},
null,
],
],
},
],
controlOverrides: {
groupby: {
description: t(
'One or many controls to group by. If grouping, latitude ' +
'and longitude columns must be present.',
),
},
},
};

View File

@ -1,26 +0,0 @@
/**
* 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.
*/
// These are control configurations that are shared ONLY within the BigNumber viz plugin repo.
import { t } from '@superset-ui/translation';
export const foo = {
name: 'foo_control',
config: {},
};

View File

@ -30,14 +30,8 @@ import DeckPath from '../explore/controlPanels/DeckPath';
import DeckPolygon from '../explore/controlPanels/DeckPolygon';
import DeckScatter from '../explore/controlPanels/DeckScatter';
import DeckScreengrid from '../explore/controlPanels/DeckScreengrid';
import DirectedForce from '../explore/controlPanels/DirectedForce';
import EventFlow from '../explore/controlPanels/EventFlow';
import FilterBox from '../explore/controlPanels/FilterBox';
import Heatmap from '../explore/controlPanels/Heatmap';
import Histogram from '../explore/controlPanels/Histogram';
import Horizon from '../explore/controlPanels/Horizon';
import Iframe from '../explore/controlPanels/Iframe';
import Mapbox from '../explore/controlPanels/Mapbox';
import PairedTtest from '../explore/controlPanels/PairedTtest';
import Para from '../explore/controlPanels/Para';
import Separator from '../explore/controlPanels/Separator';
@ -50,14 +44,8 @@ export default function setupPlugins() {
// TODO: Remove these shims once the control panel configs are moved into the plugin package.
getChartControlPanelRegistry()
.registerValue('country_map', CountryMap)
.registerValue('directed_force', DirectedForce)
.registerValue('event_flow', EventFlow)
.registerValue('filter_box', FilterBox)
.registerValue('heatmap', Heatmap)
.registerValue('histogram', Histogram)
.registerValue('horizon', Horizon)
.registerValue('iframe', Iframe)
.registerValue('mapbox', Mapbox)
.registerValue('paired_ttest', PairedTtest)
.registerValue('para', Para)
.registerValue('separator', Separator)