feat: Adds Line chart migration logic#23973
Conversation
3e8840d to
bcfb878
Compare
bcfb878 to
7791b92
Compare
7791b92 to
3480a33
Compare
3480a33 to
808c8ac
Compare
1df9eb4 to
0200172
Compare
e39fa2c to
f09881a
Compare
| AREA = "area" | ||
| PIVOT_TABLE = "pivot_table" | ||
| SUNBURST = "sunburst" | ||
| LINE = "line" |
| has_x_axis_control = True | ||
|
|
||
| def _pre_action(self) -> None: | ||
| self.data["contributionMode"] = "row" if self.data.get("contribution") else None |
There was a problem hiding this comment.
Is this (and other attributes) required? Generally if not I think it's cleaner/safer to leave these undefined and fallback to the default.
There was a problem hiding this comment.
These rules were added to keep visual consistency between the previous and new versions.
|
|
||
| def _pre_action(self) -> None: | ||
| self.data["contributionMode"] = "row" if self.data.get("contribution") else None | ||
| self.data["zoomable"] = False if self.data.get("show_brush") == "no" else True |
There was a problem hiding this comment.
| self.data["zoomable"] = False if self.data.get("show_brush") == "no" else True | |
| self.data["zoomable"] = self.data.get("show_brush") != "no" |
| ): | ||
| self.data["bottom_margin"] = 30 | ||
|
|
||
| if (rolling_type := self.data.get("rolling_type")) and rolling_type != "None": |
There was a problem hiding this comment.
Any reason rolling_type is "None" as opposed to None?
There was a problem hiding this comment.
Many of these safe checks were added as a result of trying to run this migration using our production database which contained really old charts and inconsistent values.
|
|
||
| if time_compare := self.data.get("time_compare"): | ||
| self.data["time_compare"] = [ | ||
| value + " ago" for value in as_list(time_compare) if value |
There was a problem hiding this comment.
Are there causes when value is falsy?
There was a problem hiding this comment.
Same as above.
SUMMARY
This PR adds the Line chart migration logic (NVD3 ➡️ ECharts). Users can execute this migration using the migrate_viz CLI command and disable the legacy version with the VIZ_TYPE_DENYLIST configuration.
@sadpandajoe @jinghua-qa
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
1 - Upgrade a Line chart using the CLI command
2 - Check the new chart
3 - Downgrade a Line chart using the CLI command
4 - Check the legacy chart
ADDITIONAL INFORMATION