Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

chore: pulling in Sunburst controls from incubator-superset #443

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions plugins/legacy-plugin-chart-sunburst/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superset-ui/legacy-plugin-chart-sunburst",
"version": "0.13.5",
"version": "0.13.6",
rusackas marked this conversation as resolved.
Show resolved Hide resolved
"description": "Superset Legacy Chart - Sunburst",
"sideEffects": [
"*.css"
Expand Down Expand Up @@ -35,6 +35,7 @@
"@superset-ui/chart": "^0.13.0",
"@superset-ui/color": "^0.13.0",
"@superset-ui/number-format": "^0.13.0",
"@superset-ui/translation": "^0.13.0"
"@superset-ui/translation": "^0.13.0",
"@superset-ui/control-utils": "^0.13.0"
}
}
59 changes: 59 additions & 0 deletions plugins/legacy-plugin-chart-sunburst/src/controlPanel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* 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('Query'),
expanded: true,
controlSetRows: [
['groupby'],
['metric'],
['secondary_metric'],
['adhoc_filters'],
['row_limit'],
],
},
{
label: t('Chart Options'),
expanded: true,
controlSetRows: [['color_scheme', 'label_colors']],
},
],
controlOverrides: {
metric: {
label: t('Primary Metric'),
description: t('The primary metric is used to define the arc segment sizes'),
},
secondary_metric: {
label: t('Secondary Metric'),
default: null,
description: t(
'[optional] this secondary metric is used to ' +
'define the color as a ratio against the primary metric. ' +
'When omitted, the color is categorical and based on labels',
),
},
groupby: {
label: t('Hierarchy'),
description: t('This defines the level of the hierarchy'),
},
},
};
2 changes: 2 additions & 0 deletions plugins/legacy-plugin-chart-sunburst/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { t } from '@superset-ui/translation';
import { ChartMetadata, ChartPlugin } from '@superset-ui/chart';
import transformProps from './transformProps';
import thumbnail from './images/thumbnail.png';
import controlPanel from './controlPanel.ts';
rusackas marked this conversation as resolved.
Show resolved Hide resolved

const metadata = new ChartMetadata({
credits: ['https://bl.ocks.org/kerryrodden/7090426'],
Expand All @@ -35,6 +36,7 @@ export default class SunburstChartPlugin extends ChartPlugin {
loadChart: () => import('./ReactSunburst.js'),
metadata,
transformProps,
controlPanel,
});
}
}