mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
feat: Adds Histogram chart migration logic (#28780)
This commit is contained in:
committed by
GitHub
parent
dabb4e064f
commit
df0b1cb8ed
@@ -280,3 +280,26 @@ class MigrateHeatmapChart(MigrateViz):
|
||||
|
||||
def _pre_action(self) -> None:
|
||||
self.data["legend_type"] = "continuous"
|
||||
|
||||
|
||||
class MigrateHistogramChart(MigrateViz):
|
||||
source_viz_type = "histogram"
|
||||
target_viz_type = "histogram_v2"
|
||||
rename_keys = {
|
||||
"x_axis_label": "x_axis_title",
|
||||
"y_axis_label": "y_axis_title",
|
||||
"normalized": "normalize",
|
||||
}
|
||||
remove_keys = {"all_columns_x", "link_length", "queryFields"}
|
||||
|
||||
def _pre_action(self) -> None:
|
||||
all_columns_x = self.data.get("all_columns_x")
|
||||
if all_columns_x and len(all_columns_x) > 0:
|
||||
self.data["column"] = all_columns_x[0]
|
||||
|
||||
link_length = self.data.get("link_length")
|
||||
self.data["bins"] = int(link_length) if link_length else 5
|
||||
|
||||
groupby = self.data.get("groupby")
|
||||
if not groupby:
|
||||
self.data["groupby"] = []
|
||||
|
||||
Reference in New Issue
Block a user