You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/07/08 03:46:15 UTC

[GitHub] [superset] zhaoyongjie commented on a diff in pull request #20359: feat: Area viz migration

zhaoyongjie commented on code in PR #20359:
URL: https://github.com/apache/superset/pull/20359#discussion_r916438943


##########
superset/utils/migrate_viz.py:
##########
@@ -117,6 +111,38 @@ def _pre_action(self) -> None:
             self.data["metric"] = self.data["metrics"][0]
 
 
+class MigrateArea(MigrateViz):
+    source_viz_type = "area"
+    target_viz_type = "echarts_area"
+    remove_keys = {"contribution", "stacked_style", "x_axis_label"}
+
+    def _pre_action(self) -> None:
+        if self.data.get("contribution"):
+            self.data["contributionMode"] = "row"
+
+        stacked = self.data.get("stacked_style")
+        stacked_map = {
+            "expand": "Expand",
+            "stack": "Stack",
+        }
+        if stacked:
+            self.data["show_extra_controls"] = True
+            self.data["stack"] = stacked_map.get(stacked)

Review Comment:
   done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org