Skip to content

Commit

Permalink
updates for upstream migration from export plot to export plugin (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Mar 28, 2024
1 parent 7d300a2 commit 58709b8
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
14 changes: 7 additions & 7 deletions docs/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -318,18 +318,18 @@ 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.


.. 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
Expand All @@ -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:imviz-export-plot>`
Jdaviz documentation on the Export Plot plugin.
Jdaviz documentation on the Export plugin.
2 changes: 1 addition & 1 deletion lcviz/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion lcviz/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lcviz/plugins/export/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .export import * # noqa
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
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 <export-plot>` for more details.
See the :ref:`Export Plot Plugin Documentation <export>` for more details.
Only the following attributes and methods are available through the
:ref:`public plugin API <plugin-apis>`:
* :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"
1 change: 0 additions & 1 deletion lcviz/plugins/export_plot/__init__.py

This file was deleted.

0 comments on commit 58709b8

Please sign in to comment.