Skip to content

Commit

Permalink
chore: remove markup from viz.py (#9997)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Jun 10, 2020
1 parent 280b4dc commit 7cb38fe
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 60 deletions.
30 changes: 0 additions & 30 deletions superset/viz.py
Expand Up @@ -794,36 +794,6 @@ def get_data(self, df: pd.DataFrame) -> VizData:
)


class MarkupViz(BaseViz):

"""Use html or markdown to create a free form widget"""

viz_type = "markup"
verbose_name = _("Markup")
is_timeseries = False

def query_obj(self) -> QueryObjectDict:
return {}

def get_df(self, query_obj: Optional[QueryObjectDict] = None) -> pd.DataFrame:
return pd.DataFrame()

def get_data(self, df: pd.DataFrame) -> VizData:
markup_type = self.form_data.get("markup_type")
code = self.form_data.get("code", "")
if markup_type == "markdown":
code = markdown(code)
return dict(html=code, theme_css=get_manifest_files("theme", "css"))


class SeparatorViz(MarkupViz):

"""Use to create section headers in a dashboard, similar to `Markup`"""

viz_type = "separator"
verbose_name = _("Separator")


class TreemapViz(BaseViz):

"""Tree map visualisation for hierarchical data."""
Expand Down
30 changes: 0 additions & 30 deletions superset/viz_sip38.py
Expand Up @@ -832,36 +832,6 @@ def get_data(self, df: pd.DataFrame) -> VizData:
)


class MarkupViz(BaseViz):

"""Use html or markdown to create a free form widget"""

viz_type = "markup"
verbose_name = _("Markup")
is_timeseries = False

def query_obj(self):
return None

def get_df(self, query_obj: Optional[Dict[str, Any]] = None) -> pd.DataFrame:
return pd.DataFrame()

def get_data(self, df: pd.DataFrame) -> VizData:
markup_type = self.form_data.get("markup_type")
code = self.form_data.get("code", "")
if markup_type == "markdown":
code = markdown(code)
return dict(html=code, theme_css=get_manifest_files("theme", "css"))


class SeparatorViz(MarkupViz):

"""Use to create section headers in a dashboard, similar to `Markup`"""

viz_type = "separator"
verbose_name = _("Separator")


class TreemapViz(BaseViz):

"""Tree map visualisation for hierarchical data."""
Expand Down

0 comments on commit 7cb38fe

Please sign in to comment.