mirror of https://github.com/apache/superset.git
use the builtin calendar control panel (#9771)
This commit is contained in:
parent
8a49c69f38
commit
3a213916c4
|
@ -6594,9 +6594,9 @@
|
||||||
"integrity": "sha512-e4FuWPL8vFonhQBaUl9qHr8XrOa/NKIuYJ2rwVAhT10Do15C669EEDLSLD8kC3nER6rk79GCrIH4Obz11dTX8Q=="
|
"integrity": "sha512-e4FuWPL8vFonhQBaUl9qHr8XrOa/NKIuYJ2rwVAhT10Do15C669EEDLSLD8kC3nER6rk79GCrIH4Obz11dTX8Q=="
|
||||||
},
|
},
|
||||||
"@superset-ui/legacy-plugin-chart-calendar": {
|
"@superset-ui/legacy-plugin-chart-calendar": {
|
||||||
"version": "0.13.3",
|
"version": "0.13.6",
|
||||||
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-calendar/-/legacy-plugin-chart-calendar-0.13.3.tgz",
|
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-calendar/-/legacy-plugin-chart-calendar-0.13.6.tgz",
|
||||||
"integrity": "sha512-fbYpLXQZvVqasYNceseECSlh4mlMS8CL+JU8zQJBHL56FQlFE9o5UjuGmDVFXSdsUjxP5KIImu5RRH8kCjp0Bg==",
|
"integrity": "sha512-Ziv7fVdXNYATziITy1sXjMMg6e3NTJymUFdzkqYPVYl2CMszuXKS7LM7xTbwrcJ6og0eKhofyiGznR0TEvUMlg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"d3-array": "^2.0.3",
|
"d3-array": "^2.0.3",
|
||||||
"d3-selection": "^1.4.0",
|
"d3-selection": "^1.4.0",
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
"@superset-ui/control-utils": "^0.13.3",
|
"@superset-ui/control-utils": "^0.13.3",
|
||||||
"@superset-ui/core": "^0.13.5",
|
"@superset-ui/core": "^0.13.5",
|
||||||
"@superset-ui/dimension": "^0.13.3",
|
"@superset-ui/dimension": "^0.13.3",
|
||||||
"@superset-ui/legacy-plugin-chart-calendar": "^0.13.3",
|
"@superset-ui/legacy-plugin-chart-calendar": "^0.13.6",
|
||||||
"@superset-ui/legacy-plugin-chart-chord": "^0.13.3",
|
"@superset-ui/legacy-plugin-chart-chord": "^0.13.3",
|
||||||
"@superset-ui/legacy-plugin-chart-country-map": "^0.13.3",
|
"@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-event-flow": "^0.11.15",
|
||||||
|
|
|
@ -1,193 +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 { legacyValidateInteger } from '@superset-ui/validator';
|
|
||||||
import {
|
|
||||||
// formatSelectOptionsForRange,
|
|
||||||
formatSelectOptions,
|
|
||||||
// mainMetric,
|
|
||||||
} from '../../modules/utils';
|
|
||||||
import { D3_TIME_FORMAT_OPTIONS, D3_FORMAT_DOCS } from '../controls';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
requiresTime: true,
|
|
||||||
controlPanelSections: [
|
|
||||||
{
|
|
||||||
label: t('Query'),
|
|
||||||
expanded: true,
|
|
||||||
controlSetRows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name: 'domain_granularity',
|
|
||||||
config: {
|
|
||||||
type: 'SelectControl',
|
|
||||||
label: t('Domain'),
|
|
||||||
default: 'month',
|
|
||||||
choices: formatSelectOptions([
|
|
||||||
'hour',
|
|
||||||
'day',
|
|
||||||
'week',
|
|
||||||
'month',
|
|
||||||
'year',
|
|
||||||
]),
|
|
||||||
description: t('The time unit used for the grouping of blocks'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'subdomain_granularity',
|
|
||||||
config: {
|
|
||||||
type: 'SelectControl',
|
|
||||||
label: t('Subdomain'),
|
|
||||||
default: 'day',
|
|
||||||
choices: formatSelectOptions([
|
|
||||||
'min',
|
|
||||||
'hour',
|
|
||||||
'day',
|
|
||||||
'week',
|
|
||||||
'month',
|
|
||||||
]),
|
|
||||||
description: t(
|
|
||||||
'The time unit for each block. Should be a smaller unit than ' +
|
|
||||||
'domain_granularity. Should be larger or equal to Time Grain',
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
['metrics'],
|
|
||||||
['adhoc_filters'],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('Chart Options'),
|
|
||||||
expanded: true,
|
|
||||||
controlSetRows: [
|
|
||||||
['linear_color_scheme'],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name: 'cell_size',
|
|
||||||
config: {
|
|
||||||
type: 'TextControl',
|
|
||||||
isInt: true,
|
|
||||||
default: 10,
|
|
||||||
validators: [legacyValidateInteger],
|
|
||||||
renderTrigger: true,
|
|
||||||
label: t('Cell Size'),
|
|
||||||
description: t('The size of the square cell, in pixels'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'cell_padding',
|
|
||||||
config: {
|
|
||||||
type: 'TextControl',
|
|
||||||
isInt: true,
|
|
||||||
validators: [legacyValidateInteger],
|
|
||||||
renderTrigger: true,
|
|
||||||
default: 2,
|
|
||||||
label: t('Cell Padding'),
|
|
||||||
description: t('The distance between cells, in pixels'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name: 'cell_radius',
|
|
||||||
config: {
|
|
||||||
type: 'TextControl',
|
|
||||||
isInt: true,
|
|
||||||
validators: [legacyValidateInteger],
|
|
||||||
renderTrigger: true,
|
|
||||||
default: 0,
|
|
||||||
label: t('Cell Radius'),
|
|
||||||
description: t('The pixel radius'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'steps',
|
|
||||||
config: {
|
|
||||||
type: 'TextControl',
|
|
||||||
isInt: true,
|
|
||||||
validators: [legacyValidateInteger],
|
|
||||||
renderTrigger: true,
|
|
||||||
default: 10,
|
|
||||||
label: t('Color Steps'),
|
|
||||||
description: t('The number color "steps"'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'y_axis_format',
|
|
||||||
{
|
|
||||||
name: 'x_axis_time_format',
|
|
||||||
config: {
|
|
||||||
type: 'SelectControl',
|
|
||||||
freeForm: true,
|
|
||||||
label: t('Time Format'),
|
|
||||||
renderTrigger: true,
|
|
||||||
default: 'smart_date',
|
|
||||||
choices: D3_TIME_FORMAT_OPTIONS,
|
|
||||||
description: D3_FORMAT_DOCS,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
name: 'show_legend',
|
|
||||||
config: {
|
|
||||||
type: 'CheckboxControl',
|
|
||||||
label: t('Legend'),
|
|
||||||
renderTrigger: true,
|
|
||||||
default: true,
|
|
||||||
description: t('Whether to display the legend (toggles)'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
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: 'show_metric_name',
|
|
||||||
config: {
|
|
||||||
type: 'CheckboxControl',
|
|
||||||
label: t('Show Metric Names'),
|
|
||||||
renderTrigger: true,
|
|
||||||
default: true,
|
|
||||||
description: t('Whether to display the metric name as a title'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
null,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
controlOverrides: {
|
|
||||||
y_axis_format: {
|
|
||||||
label: t('Number Format'),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
|
@ -25,7 +25,6 @@ import Bar from '../explore/controlPanels/Bar';
|
||||||
import BoxPlot from '../explore/controlPanels/BoxPlot';
|
import BoxPlot from '../explore/controlPanels/BoxPlot';
|
||||||
import Bubble from '../explore/controlPanels/Bubble';
|
import Bubble from '../explore/controlPanels/Bubble';
|
||||||
import Bullet from '../explore/controlPanels/Bullet';
|
import Bullet from '../explore/controlPanels/Bullet';
|
||||||
import CalHeatmap from '../explore/controlPanels/CalHeatmap';
|
|
||||||
import Chord from '../explore/controlPanels/Chord';
|
import Chord from '../explore/controlPanels/Chord';
|
||||||
import Compare from '../explore/controlPanels/Compare';
|
import Compare from '../explore/controlPanels/Compare';
|
||||||
import CountryMap from '../explore/controlPanels/CountryMap';
|
import CountryMap from '../explore/controlPanels/CountryMap';
|
||||||
|
@ -75,7 +74,6 @@ export default function setupPlugins() {
|
||||||
.registerValue('box_plot', BoxPlot)
|
.registerValue('box_plot', BoxPlot)
|
||||||
.registerValue('bubble', Bubble)
|
.registerValue('bubble', Bubble)
|
||||||
.registerValue('bullet', Bullet)
|
.registerValue('bullet', Bullet)
|
||||||
.registerValue('cal_heatmap', CalHeatmap)
|
|
||||||
.registerValue('chord', Chord)
|
.registerValue('chord', Chord)
|
||||||
.registerValue('compare', Compare)
|
.registerValue('compare', Compare)
|
||||||
.registerValue('country_map', CountryMap)
|
.registerValue('country_map', CountryMap)
|
||||||
|
|
Loading…
Reference in New Issue