You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/06/08 19:34:34 UTC

[superset] branch master updated: chore: Deprecates some NVD3 charts in 3.0 (#24322)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 7e626c04cb chore: Deprecates some NVD3 charts in 3.0 (#24322)
7e626c04cb is described below

commit 7e626c04cb1271139470461dd397bf2d425519a5
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Thu Jun 8 16:34:25 2023 -0300

    chore: Deprecates some NVD3 charts in 3.0 (#24322)
---
 .../plugins/legacy-preset-chart-nvd3/src/Area/index.js     |  6 +++++-
 .../plugins/legacy-preset-chart-nvd3/src/Bar/index.js      |  8 +++++++-
 .../plugins/legacy-preset-chart-nvd3/src/DistBar/index.js  | 14 +++++++-------
 .../plugins/legacy-preset-chart-nvd3/src/Line/index.js     |  6 +++++-
 .../plugins/legacy-preset-chart-nvd3/src/Pie/index.js      |  9 +++++++--
 .../src/visualizations/FilterBox/FilterBoxChartPlugin.js   |  5 +++--
 6 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Area/index.js b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Area/index.js
index c0208b8e97..ba20a958c9 100644
--- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Area/index.js
+++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Area/index.js
@@ -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';
@@ -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: [
@@ -58,6 +59,9 @@ const metadata = new ChartMetadata({
   useLegacyApi: true,
 });
 
+/**
+ * @deprecated in version 3.0.
+ */
 export default class AreaChartPlugin extends ChartPlugin {
   constructor() {
     super({
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bar/index.js b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bar/index.js
index 35a345fdbb..33436be148 100644
--- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bar/index.js
+++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Bar/index.js
@@ -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';
@@ -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: [
@@ -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({
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/DistBar/index.js b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/DistBar/index.js
index 09d289d694..66b98e4ccc 100644
--- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/DistBar/index.js
+++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/DistBar/index.js
@@ -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';
@@ -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'),
@@ -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({
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Line/index.js b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Line/index.js
index 0d903ce3ca..51db67edf2 100644
--- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Line/index.js
+++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Line/index.js
@@ -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';
@@ -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,
@@ -47,6 +48,9 @@ const metadata = new ChartMetadata({
   useLegacyApi: true,
 });
 
+/**
+ * @deprecated in version 3.0.
+ */
 export default class LineChartPlugin extends ChartPlugin {
   constructor() {
     super({
diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Pie/index.js b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Pie/index.js
index 50c6e721b9..75b66fb933 100644
--- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Pie/index.js
+++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/Pie/index.js
@@ -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 controlPanel from './controlPanel';
@@ -24,11 +24,16 @@ 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({
diff --git a/superset-frontend/src/visualizations/FilterBox/FilterBoxChartPlugin.js b/superset-frontend/src/visualizations/FilterBox/FilterBoxChartPlugin.js
index fbd3846e46..774f7bdedf 100644
--- a/superset-frontend/src/visualizations/FilterBox/FilterBoxChartPlugin.js
+++ b/superset-frontend/src/visualizations/FilterBox/FilterBoxChartPlugin.js
@@ -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';
@@ -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.