diff --git a/docs/plugins.rst b/docs/plugins.rst index 60f5f24c..aae63e16 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -318,10 +318,10 @@ This plugin supports binning a light curve in time or phase-space. * :meth:`lightkurve.LightCurve.bin` -.. _export-plot: +.. _export: -Export Plot -=========== +Export +====== This plugin allows exporting the plot in a given viewer to various image formats. @@ -329,7 +329,7 @@ This plugin allows exporting the plot in a given viewer to various image formats .. admonition:: User API Example :class: dropdown - See the :class:`~lcviz.plugins.export_plot.export_plot.ExportViewer` user API documentation for more details. + See the :class:`~lcviz.plugins.export.export.Export` user API documentation for more details. .. code-block:: python @@ -340,11 +340,11 @@ This plugin allows exporting the plot in a given viewer to various image formats lcviz.load_data(lc) lcviz.show() - export = lcviz.plugins['Export Plot'] - export.save_figure('test.png') + export = lcviz.plugins['Export'] + export.export('test.png') .. seealso:: :ref:`Jdaviz Export Plot ` - Jdaviz documentation on the Export Plot plugin. + Jdaviz documentation on the Export plugin. diff --git a/lcviz/helper.py b/lcviz/helper.py index ab3bb328..c93baa2d 100644 --- a/lcviz/helper.py +++ b/lcviz/helper.py @@ -70,7 +70,7 @@ class LCviz(ConfigHelper): 'tray': ['lcviz-metadata-viewer', 'flux-column', 'lcviz-plot-options', 'lcviz-subset-plugin', 'lcviz-markers', 'flatten', 'frequency-analysis', 'ephemeris', - 'binning', 'lcviz-export-plot'], + 'binning', 'lcviz-export'], 'viewer_area': [{'container': 'col', 'children': [{'container': 'row', 'viewers': [{'name': 'flux-vs-time', diff --git a/lcviz/plugins/__init__.py b/lcviz/plugins/__init__.py index 42ba1f17..9fbeef06 100644 --- a/lcviz/plugins/__init__.py +++ b/lcviz/plugins/__init__.py @@ -3,7 +3,7 @@ from .binning.binning import * # noqa from .ephemeris.ephemeris import * # noqa -from .export_plot.export_plot import * # noqa +from .export.export import * # noqa from .flatten.flatten import * # noqa from .flux_column.flux_column import * # noqa from .frequency_analysis.frequency_analysis import * # noqa diff --git a/lcviz/plugins/export/__init__.py b/lcviz/plugins/export/__init__.py new file mode 100644 index 00000000..aa5f6174 --- /dev/null +++ b/lcviz/plugins/export/__init__.py @@ -0,0 +1 @@ +from .export import * # noqa diff --git a/lcviz/plugins/export_plot/export_plot.py b/lcviz/plugins/export/export.py similarity index 61% rename from lcviz/plugins/export_plot/export_plot.py rename to lcviz/plugins/export/export.py index a10fba2e..e25340e5 100644 --- a/lcviz/plugins/export_plot/export_plot.py +++ b/lcviz/plugins/export/export.py @@ -1,13 +1,13 @@ -from jdaviz.configs.default.plugins import ExportViewer +from jdaviz.configs.default.plugins import Export from jdaviz.core.registries import tray_registry -__all__ = ['ExportViewer'] +__all__ = ['Export'] -@tray_registry('lcviz-export-plot', label="Export Plot") -class ExportViewer(ExportViewer): +@tray_registry('lcviz-export', label="Export") +class Export(Export): """ - See the :ref:`Export Plot Plugin Documentation ` for more details. + See the :ref:`Export Plot Plugin Documentation ` for more details. Only the following attributes and methods are available through the :ref:`public plugin API `: @@ -15,10 +15,11 @@ class ExportViewer(ExportViewer): * :meth:`~jdaviz.core.template_mixin.PluginTemplateMixin.show` * :meth:`~jdaviz.core.template_mixin.PluginTemplateMixin.open_in_tray` * :meth:`~jdaviz.core.template_mixin.PluginTemplateMixin.close_in_tray` - * ``viewer`` (:class:`~jdaviz.core.template_mixin.ViewerSelect`): - Viewer to select for exporting the figure image. - * :meth:`save_figure` + * ``viewer`` (:class:`~jdaviz.core.template_mixin.ViewerSelect`) + * ``viewer_format`` (:class:`~jdaviz.core.template_mixin.SelectPluginComponent`) + * ``filename`` + * :meth:`export` """ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.docs_link = f"https://lcviz.readthedocs.io/en/{self.vdocs}/plugins.html#export-plot" + self.docs_link = f"https://lcviz.readthedocs.io/en/{self.vdocs}/plugins.html#export" diff --git a/lcviz/plugins/export_plot/__init__.py b/lcviz/plugins/export_plot/__init__.py deleted file mode 100644 index dbcfe9b4..00000000 --- a/lcviz/plugins/export_plot/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .export_plot import * # noqa