Skip to content

Commit

Permalink
chore: Deprecates some NVD3 charts in 3.0 (#24322)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Jun 8, 2023
1 parent e5b7f7c commit 7e626c0
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
import { t, ChartMetadata, ChartPlugin, ChartLabel } from '@superset-ui/core';
import transformProps from '../transformProps';
import example1 from './images/example1.jpg';
import example2 from './images/example2.jpg';
Expand All @@ -38,6 +38,7 @@ const metadata = new ChartMetadata({
{ url: example3, caption: t('Video game consoles') },
{ url: example4, caption: t('Vehicle Types') },
],
label: ChartLabel.DEPRECATED,
name: t('Area Chart (legacy)'),
supportedAnnotationTypes: [ANNOTATION_TYPES.INTERVAL, ANNOTATION_TYPES.EVENT],
tags: [
Expand All @@ -58,6 +59,9 @@ const metadata = new ChartMetadata({
useLegacyApi: true,
});

/**
* @deprecated in version 3.0.
*/
export default class AreaChartPlugin extends ChartPlugin {
constructor() {
super({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
import { t, ChartMetadata, ChartPlugin, ChartLabel } from '@superset-ui/core';
import transformProps from '../transformProps';
import thumbnail from './images/thumbnail.png';
import example1 from './images/Time_Series_Bar_Chart.jpg';
Expand All @@ -32,6 +32,7 @@ const metadata = new ChartMetadata({
'Visualize how a metric changes over time using bars. Add a group by column to visualize group level metrics and how they change over time.',
),
exampleGallery: [{ url: example1 }, { url: example2 }, { url: example3 }],
label: ChartLabel.DEPRECATED,
name: t('Time-series Bar Chart (legacy)'),
supportedAnnotationTypes: [ANNOTATION_TYPES.INTERVAL, ANNOTATION_TYPES.EVENT],
tags: [
Expand All @@ -44,11 +45,16 @@ const metadata = new ChartMetadata({
t('Proportional'),
t('Advanced-Analytics'),
t('nvd3'),
t('Legacy'),
t('Deprecated'),
],
thumbnail,
useLegacyApi: true,
});

/**
* @deprecated in version 3.0.
*/
export default class BarChartPlugin extends ChartPlugin {
constructor() {
super({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import {
t,
ChartMetadata,
ChartPlugin,
hasGenericChartAxes,
} from '@superset-ui/core';
import { t, ChartMetadata, ChartPlugin, ChartLabel } from '@superset-ui/core';
import transformProps from '../transformProps';
import thumbnail from './images/thumbnail.png';
import example1 from './images/Bar_Chart.jpg';
Expand All @@ -40,7 +35,8 @@ const metadata = new ChartMetadata({
{ url: example2, caption: 'Grouped style' },
{ url: example3 },
],
name: hasGenericChartAxes ? t('Bar Chart (legacy)') : t('Bar Chart'),
label: ChartLabel.DEPRECATED,
name: t('Bar Chart (legacy)'),
tags: [
t('Additive'),
t('Bar'),
Expand All @@ -53,11 +49,15 @@ const metadata = new ChartMetadata({
t('Stacked'),
t('Vertical'),
t('nvd3'),
t('Deprecated'),
],
thumbnail,
useLegacyApi: true,
});

/**
* @deprecated in version 3.0.
*/
export default class DistBarChartPlugin extends ChartPlugin {
constructor() {
super({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
import { t, ChartMetadata, ChartPlugin, ChartLabel } from '@superset-ui/core';
import transformProps from '../transformProps';
import example1 from './images/LineChart.jpg';
import example2 from './images/LineChart2.jpg';
Expand All @@ -35,6 +35,7 @@ const metadata = new ChartMetadata({
{ url: example2 },
{ url: battery, caption: t('Battery level over time') },
],
label: ChartLabel.DEPRECATED,
name: t('Line Chart (legacy)'),
supportedAnnotationTypes: [
ANNOTATION_TYPES.TIME_SERIES,
Expand All @@ -47,6 +48,9 @@ const metadata = new ChartMetadata({
useLegacyApi: true,
});

/**
* @deprecated in version 3.0.
*/
export default class LineChartPlugin extends ChartPlugin {
constructor() {
super({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,24 @@
* specific language governing permissions and limitations
* under the License.
*/
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
import { t, ChartMetadata, ChartPlugin, ChartLabel } from '@superset-ui/core';
import transformProps from '../transformProps';
import thumbnail from './images/thumbnail.png';
import controlPanel from './controlPanel';

const metadata = new ChartMetadata({
credits: ['http://nvd3.org'],
description: '',
name: t('Pie Chart'),
label: ChartLabel.DEPRECATED,
name: t('Pie Chart (legacy)'),
thumbnail,
useLegacyApi: true,
tags: [t('Legacy'), t('nvd3'), t('Deprecated')],
});

/**
* @deprecated in version 3.0.
*/
export default class PieChartPlugin extends ChartPlugin {
constructor() {
super({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { t, ChartMetadata, ChartPlugin } from '@superset-ui/core';
import { t, ChartMetadata, ChartPlugin, ChartLabel } from '@superset-ui/core';
import transformProps from './transformProps';
import thumbnail from './images/thumbnail.png';
import example1 from './images/example1.jpg';
Expand All @@ -25,7 +25,8 @@ import controlPanel from './controlPanel';

const metadata = new ChartMetadata({
category: t('Tools'),
name: t('Filter box (deprecated)'),
label: ChartLabel.DEPRECATED,
name: t('Filter box (legacy)'),
description:
t(`Chart component that lets you add a custom filter UI in your dashboard. When added to dashboard, a filter box lets users specify specific values or ranges to filter charts by. The charts that each filter box is applied to can be fine tuned as well in the dashboard view.
Expand Down

0 comments on commit 7e626c0

Please sign in to comment.