diff --git a/docs/.buildinfo b/docs/.buildinfo index 90af60c6..4ee374f9 100644 --- a/docs/.buildinfo +++ b/docs/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: b79c8acf1f8d06e84a5ef3599410ca69 +config: a6aab7dae79e6a7e392e483aafbefdea tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/.doctrees/apidoc/tabulous.commands.doctree b/docs/.doctrees/apidoc/tabulous.commands.doctree index c8503e3e..f10ec8fb 100644 Binary files a/docs/.doctrees/apidoc/tabulous.commands.doctree and b/docs/.doctrees/apidoc/tabulous.commands.doctree differ diff --git a/docs/.doctrees/apidoc/tabulous.doctree b/docs/.doctrees/apidoc/tabulous.doctree index aa84a293..e83a7041 100644 Binary files a/docs/.doctrees/apidoc/tabulous.doctree and b/docs/.doctrees/apidoc/tabulous.doctree differ diff --git a/docs/.doctrees/apidoc/tabulous.style.doctree b/docs/.doctrees/apidoc/tabulous.style.doctree new file mode 100644 index 00000000..6ccb3dac Binary files /dev/null and b/docs/.doctrees/apidoc/tabulous.style.doctree differ diff --git a/docs/.doctrees/apidoc/tabulous.widgets.doctree b/docs/.doctrees/apidoc/tabulous.widgets.doctree index a6d79522..ac16045a 100644 Binary files a/docs/.doctrees/apidoc/tabulous.widgets.doctree and b/docs/.doctrees/apidoc/tabulous.widgets.doctree differ diff --git a/docs/.doctrees/environment.pickle b/docs/.doctrees/environment.pickle index 757e89aa..0b0a501f 100644 Binary files a/docs/.doctrees/environment.pickle and b/docs/.doctrees/environment.pickle differ diff --git a/docs/.doctrees/main/quickstart.doctree b/docs/.doctrees/main/quickstart.doctree index 10ad7e39..e539312c 100644 Binary files a/docs/.doctrees/main/quickstart.doctree and b/docs/.doctrees/main/quickstart.doctree differ diff --git a/docs/.doctrees/main/table_view_mode.doctree b/docs/.doctrees/main/table_view_mode.doctree index 644d70c4..7ec9e10a 100644 Binary files a/docs/.doctrees/main/table_view_mode.doctree and b/docs/.doctrees/main/table_view_mode.doctree differ diff --git a/docs/.doctrees/main/user_interface.doctree b/docs/.doctrees/main/user_interface.doctree index 9b1a71aa..25a608d9 100644 Binary files a/docs/.doctrees/main/user_interface.doctree and b/docs/.doctrees/main/user_interface.doctree differ diff --git a/docs/_images/cell_labels.png b/docs/_images/cell_labels.png index 1e9dbbfb..f4f04ee7 100644 Binary files a/docs/_images/cell_labels.png and b/docs/_images/cell_labels.png differ diff --git a/docs/_images/colormap.png b/docs/_images/colormap.png index 19cf1698..df9ea7f4 100644 Binary files a/docs/_images/colormap.png and b/docs/_images/colormap.png differ diff --git a/docs/_images/colormap_interpolate.png b/docs/_images/colormap_interpolate.png index 9715031c..d4ff9a1a 100644 Binary files a/docs/_images/colormap_interpolate.png and b/docs/_images/colormap_interpolate.png differ diff --git a/docs/_images/column_filter.png b/docs/_images/column_filter.png index a50f65b5..76b7f1ae 100644 Binary files a/docs/_images/column_filter.png and b/docs/_images/column_filter.png differ diff --git a/docs/_images/command_palette.png b/docs/_images/command_palette.png index c1291ae7..7c8e2e21 100644 Binary files a/docs/_images/command_palette.png and b/docs/_images/command_palette.png differ diff --git a/docs/_images/dock_with_table_data_annotation.png b/docs/_images/dock_with_table_data_annotation.png index 3ce29dfc..2c85f137 100644 Binary files a/docs/_images/dock_with_table_data_annotation.png and b/docs/_images/dock_with_table_data_annotation.png differ diff --git a/docs/_images/edit_cell.png b/docs/_images/edit_cell.png index 073b504e..b7f0a334 100644 Binary files a/docs/_images/edit_cell.png and b/docs/_images/edit_cell.png differ diff --git a/docs/_images/formatter.png b/docs/_images/formatter.png index 0dc29f16..cbff7324 100644 Binary files a/docs/_images/formatter.png and b/docs/_images/formatter.png differ diff --git a/docs/_images/spreadsheet.png b/docs/_images/spreadsheet.png index 6b3681fb..67242f72 100644 Binary files a/docs/_images/spreadsheet.png and b/docs/_images/spreadsheet.png differ diff --git a/docs/_images/table.png b/docs/_images/table.png index 23a5307d..bea89640 100644 Binary files a/docs/_images/table.png and b/docs/_images/table.png differ diff --git a/docs/_images/tile_tables.png b/docs/_images/tile_tables.png index 790967e6..0d703adc 100644 Binary files a/docs/_images/tile_tables.png and b/docs/_images/tile_tables.png differ diff --git a/docs/_images/validator.png b/docs/_images/validator.png index 99365ebf..f85a9316 100644 Binary files a/docs/_images/validator.png and b/docs/_images/validator.png differ diff --git a/docs/_modules/index.html b/docs/_modules/index.html index b1b75b4d..eb56c6b9 100644 --- a/docs/_modules/index.html +++ b/docs/_modules/index.html @@ -3,7 +3,7 @@ - Overview: module code — tabulous 0.4.1 documentation + Overview: module code — tabulous 0.5.0 documentation @@ -28,7 +28,7 @@ tabulous
- 0.4.1 + 0.5.0
@@ -84,7 +84,7 @@

All modules for which code is available

-
  • tabulous._magicgui
  • +
    • tabulous._magicgui._table
    • tabulous.color
    • tabulous.commands
    • tabulous.core
    • tabulous.exceptions
    • tabulous.post_init
    • +
    • tabulous.style._style
    • tabulous.types
    • tabulous.widgets._magicgui
    • tabulous.widgets._mainwindow
    • diff --git a/docs/_modules/tabulous/_magicgui/_table.html b/docs/_modules/tabulous/_magicgui/_table.html new file mode 100644 index 00000000..3b25ac8b --- /dev/null +++ b/docs/_modules/tabulous/_magicgui/_table.html @@ -0,0 +1,173 @@ + + + + + + tabulous._magicgui._table — tabulous 0.5.0rc1 documentation + + + + + + + + + + + + + + + +
      + + +
      + +
      +
      +
      +
        +
      • »
      • +
      • Module code »
      • +
      • tabulous._magicgui._table
      • +
      • +
      • +
      +
      +
      +
      +
      + +

      Source code for tabulous._magicgui._table

      +from __future__ import annotations
      +
      +from qtpy import QtWidgets as QtW
      +from magicgui.backends._qtpy.widgets import QBaseWidget
      +from magicgui.widgets import Widget
      +from tabulous.widgets import TableViewerWidget
      +from tabulous.types import TabPosition
      +
      +
      +
      [docs]class MagicTableViewer(Widget, TableViewerWidget): + """ + A magicgui widget of table viewer. + + This class is a subclass of ``magicgui.widget.Widget`` so that it can be used + in a compatible way with magicgui and napari. + + Parameters + ---------- + tab_position: TabPosition or str + Type of list-like widget to use. + """ + + def __init__( + self, + *, + tab_position: TabPosition | str = TabPosition.top, + name: str = "", + label: str = None, + tooltip: str | None = None, + visible: bool | None = None, + enabled: bool = True, + show: bool = False, + ): + super().__init__( + widget_type=QBaseWidget, + backend_kwargs={"qwidg": QtW.QWidget}, + name=name, + label=label, + tooltip=tooltip, + visible=visible, + enabled=enabled, + ) + TableViewerWidget.__init__(self, tab_position=tab_position, show=False) + mgui_native: QtW.QWidget = self._widget._mgui_get_native_widget() + mgui_native.setLayout(QtW.QVBoxLayout()) + mgui_native.layout().addWidget(self._qwidget) + mgui_native.setContentsMargins(0, 0, 0, 0) + if show: + self.show(run=False) + + @property + def native(self): + try: + return TableViewerWidget.native.fget(self) + except AttributeError: + return Widget.native.fget(self)
      +
      + +
      +
      + +
      +
      +
      +
      + + + + diff --git a/docs/_modules/tabulous/color.html b/docs/_modules/tabulous/color.html index b8f3eef0..1af667dc 100644 --- a/docs/_modules/tabulous/color.html +++ b/docs/_modules/tabulous/color.html @@ -3,7 +3,7 @@ - tabulous.color — tabulous 0.4.0 documentation + tabulous.color — tabulous 0.5.0rc1 documentation @@ -28,7 +28,7 @@ tabulous
      - 0.4.0 + 0.5.0rc1
      +
    • Customize Viewer Actions
    • Register Custom Actions
    • Cheat Sheet for Napari Users
    • tabulous
    • @@ -109,6 +110,8 @@

      Source code for tabulous.color

           @property
           def html(self) -> str:
               """Return a HTML color string."""
      +        if self.a == 255:
      +            return f"#{self.r:02X}{self.g:02X}{self.b:02X}"
               return f"#{self.r:02X}{self.g:02X}{self.b:02X}{self.a:02X}"
       
           @property
      @@ -162,13 +165,39 @@ 

      Source code for tabulous.color

       
       
      [docs] def equals(self, other): other = normalize_color(other) - return self == other
      + return self == other
      + +
      [docs] def brighten(self, ratio: float) -> ColorTuple: + """Set the saturation of the color.""" + hsv = self.hsva[:3] + val = round(hsv[2] * (1 + ratio)) + val = min(255, max(0, val)) + hsv = (hsv[0], hsv[1], val) + return ColorTuple.from_hsva(hsv)
      + +
      [docs] def mix(self, other, ratio: float = 0.5, alpha: bool = False) -> ColorTuple: + """Mix the color with another color.""" + other = normalize_color(other) + if alpha: + _alpha = _8bit(self.a * (1 - ratio) + other.a * ratio) + else: + _alpha = self.a + return ColorTuple( + _8bit(self.r * (1 - ratio) + other.r * ratio), + _8bit(self.g * (1 - ratio) + other.g * ratio), + _8bit(self.b * (1 - ratio) + other.b * ratio), + _alpha, + )
+ + +def _8bit(x: float) -> int: + return max(min(int(round(x)), 255), 0)
[docs]def normalize_color(color: ColorType) -> ColorTuple: """Normalize a color-like object to a ColorTuple.""" if isinstance(color, str): - return _str_color_to_tuple(color) + return ColorTuple(*_str_color_to_tuple(color)) if hasattr(color, "__iter__"): out = [int(c) for c in color] if len(out) == 3: diff --git a/docs/_modules/tabulous/commands.html b/docs/_modules/tabulous/commands.html index 14cc912f..b30adfa9 100644 --- a/docs/_modules/tabulous/commands.html +++ b/docs/_modules/tabulous/commands.html @@ -3,7 +3,7 @@ - tabulous.commands — tabulous 0.4.1 documentation + tabulous.commands — tabulous 0.5.0rc1 documentation @@ -28,7 +28,7 @@ tabulous
- 0.4.1 + 0.5.0rc1
@@ -161,6 +161,7 @@

Source code for tabulous.commands

     (window.close_window, "Ctrl+W"),
     (window.show_keymap, "Ctrl+K, Shift+?"),
     (window.toggle_focus, "Ctrl+Shift+F"),
+    (window.show_preference, "Ctrl+,"),
     (tab.activate_left, "Alt+Left"),
     (tab.activate_right, "Alt+Right"),
     (tab.swap_tab_with_left, "Alt+Shift+Left"),
@@ -178,9 +179,12 @@ 

Source code for tabulous.commands

     (table.show_undo_stack_view, "Ctrl+H"),
     (table.undo_table, "Ctrl+Z"),
     (table.redo_table, "Ctrl+Y"),
+    (table.zoom_in, "Ctrl+Shift+>"),
+    (table.zoom_out, "Ctrl+Shift+<"),
     (file.open_table, "Ctrl+O"),
     (file.open_spreadsheet, "Ctrl+K, Ctrl+O"),
     (file.save_table, "Ctrl+S"),
+    (file.save_table_to_source, "Ctrl+Shift+S"),
     (selection.show_context_menu, "Menu"),
     (selection.raise_slot_error, "F6"),
     (selection.copy_data_tab_separated, "Ctrl+C"),
diff --git a/docs/_modules/tabulous/commands/analysis.html b/docs/_modules/tabulous/commands/analysis.html
index e8d6033b..c8faf877 100644
--- a/docs/_modules/tabulous/commands/analysis.html
+++ b/docs/_modules/tabulous/commands/analysis.html
@@ -3,7 +3,7 @@
 
   
   
-  tabulous.commands.analysis — tabulous 0.4.1 documentation
+  tabulous.commands.analysis — tabulous 0.5.0rc1 documentation
       
       
       
@@ -28,7 +28,7 @@
              tabulous
           
               
- 0.4.1 + 0.5.0rc1
@@ -89,6 +89,7 @@

Source code for tabulous.commands.analysis

 from __future__ import annotations
 from typing import TYPE_CHECKING
 from . import _dialogs, _utils
+from tabulous._magicgui import ToggleSwitchSelect
 
 if TYPE_CHECKING:
     from tabulous.widgets._mainwindow import TableViewerBase
@@ -111,7 +112,7 @@ 

Source code for tabulous.commands.analysis

     table = _utils.get_table(viewer)
     out = _dialogs.summarize_table(
         table={"bind": table},
-        methods={"choices": SUMMARY_CHOICES, "widget_type": "Select"},
+        methods={"choices": SUMMARY_CHOICES, "widget_type": ToggleSwitchSelect},
         parent=viewer._qwidget,
     )
     if out is not None:
diff --git a/docs/_modules/tabulous/commands/column.html b/docs/_modules/tabulous/commands/column.html
index ba8beffb..b5ee7fa1 100644
--- a/docs/_modules/tabulous/commands/column.html
+++ b/docs/_modules/tabulous/commands/column.html
@@ -3,7 +3,7 @@
 
   
   
-  tabulous.commands.column — tabulous 0.4.1 documentation
+  tabulous.commands.column — tabulous 0.5.0rc1 documentation
       
       
       
@@ -28,7 +28,7 @@
              tabulous
           
               
- 0.4.1 + 0.5.0rc1
@@ -90,6 +90,7 @@

Source code for tabulous.commands.column

 from typing import TYPE_CHECKING
 from tabulous.exceptions import SelectionRangeError
 from . import _utils, _dialogs
+from tabulous.widgets._source import Source
 
 if TYPE_CHECKING:
     from tabulous.widgets import TableViewerBase
@@ -220,7 +221,8 @@ 

Source code for tabulous.commands.column

         raise SelectionRangeError("No columns selected")
     colnames = [table.columns[c] for c in cols]
     out = table.data.groupby(by=colnames)
-    viewer.add_groupby(out, name=f"{table.name}-groupby")
+ table_out = viewer.add_groupby(out, name=f"{table.name}-groupby") + table_out._source = Source.from_table(table)
[docs]def run_cut(viewer: TableViewerBase): diff --git a/docs/_modules/tabulous/commands/file.html b/docs/_modules/tabulous/commands/file.html index 3101a807..c89231cc 100644 --- a/docs/_modules/tabulous/commands/file.html +++ b/docs/_modules/tabulous/commands/file.html @@ -3,9 +3,10 @@ - tabulous.commands.file — tabulous 0.4.0rc0 documentation + tabulous.commands.file — tabulous 0.5.0rc1 documentation + @@ -27,7 +28,7 @@ tabulous
- 0.4.0rc0 + 0.5.0rc1
@@ -45,13 +46,15 @@
  • Table Selections and Highlights
  • Sort/Filter Table Data
  • Column-wise Settings
  • -
  • Working with Tables
  • +
  • Field Attributes of Tables
  • +
  • View Tables in Different Modes
    • +
    • Customize Viewer Actions
    • Register Custom Actions
    • Cheat Sheet for Napari Users
    • tabulous
    • @@ -103,17 +106,37 @@

      Source code for tabulous.commands.file

       
       
      [docs]def open_table(viewer: TableViewerBase): """Open a file as a table""" - return viewer._qwidget.openFromDialog(type="table")
      + paths = viewer.history_manager.openFileDialog(mode="rm", caption="Open file(s)") + for path in paths: + viewer.open(path, type="table") + return None
      [docs]def open_spreadsheet(viewer: TableViewerBase): """Open a file as a spreadsheet""" - return viewer._qwidget.openFromDialog(type="spreadsheet")
      + paths = viewer.history_manager.openFileDialog(mode="rm", caption="Open file(s)") + for path in paths: + viewer.open(path, type="spreadsheet") + return None
    [docs]def save_table(viewer: TableViewerBase): """Save current table data""" - return viewer._qwidget.saveFromDialog()
    + if table := viewer.current_table: + path = viewer.history_manager.openFileDialog(mode="w", caption="Save table") + if path: + table.save(path) + return None
    + + +def save_table_to_source(viewer: TableViewerBase): + """Save current table data to the source file if exists""" + if table := viewer.current_table: + if path := table.source.path: + table.save(path) + else: + save_table(viewer) + return None
    [docs]def open_sample(viewer: TableViewerBase): @@ -121,6 +144,16 @@

    Source code for tabulous.commands.file

         out = choose_one(choice={"choices": SAMPLE_CHOICES, "nullable": False})
         if out is not None:
             viewer.open_sample(out)
    + + +def save_as_xlsx(viewer: TableViewerBase): + """Save all tables to an Excel book""" + path = viewer.history_manager.openFileDialog( + mode="w", caption="Save table", filter="Excel book (*.xlsx; *.xls)" + ) + if path: + viewer.save_all(path) + return None
    diff --git a/docs/_modules/tabulous/commands/selection.html b/docs/_modules/tabulous/commands/selection.html index 9a196696..c592ad46 100644 --- a/docs/_modules/tabulous/commands/selection.html +++ b/docs/_modules/tabulous/commands/selection.html @@ -3,7 +3,7 @@ - tabulous.commands.selection — tabulous 0.4.1 documentation + tabulous.commands.selection — tabulous 0.5.0rc1 documentation @@ -28,7 +28,7 @@ tabulous
    - 0.4.1 + 0.5.0rc1
    @@ -90,6 +90,7 @@

    Source code for tabulous.commands.selection

     from typing import TYPE_CHECKING
     from magicgui import widgets as mwdg
     from . import _utils, _dialogs
    +from tabulous._magicgui import ToggleSwitchSelect
     
     if TYPE_CHECKING:
         from tabulous.widgets import TableViewerBase
    @@ -661,7 +662,7 @@ 

    Source code for tabulous.commands.selection

             chosen = _dialogs.choose_multiple(
                 choices={
                     "choices": list(df.columns),
    -                "widget_type": "Select",
    +                "widget_type": ToggleSwitchSelect,
                     "label": "by",
                 },
                 parent=viewer.native,
    diff --git a/docs/_modules/tabulous/commands/tab.html b/docs/_modules/tabulous/commands/tab.html
    index b94cbe18..f5f720bf 100644
    --- a/docs/_modules/tabulous/commands/tab.html
    +++ b/docs/_modules/tabulous/commands/tab.html
    @@ -3,9 +3,10 @@
     
       
       
    -  tabulous.commands.tab — tabulous 0.4.0rc0 documentation
    +  tabulous.commands.tab — tabulous 0.5.0rc1 documentation
           
           
    +      
       
    @@ -27,7 +28,7 @@
                  tabulous
               
                   
    - 0.4.0rc0 + 0.5.0rc1
    @@ -45,13 +46,15 @@
  • Table Selections and Highlights
  • Sort/Filter Table Data
  • Column-wise Settings
  • -
  • Working with Tables
  • +
  • Field Attributes of Tables
  • +
  • View Tables in Different Modes
    • +
    • Customize Viewer Actions
    • Register Custom Actions
    • Cheat Sheet for Napari Users
    • tabulous
    • @@ -86,6 +89,7 @@

      Source code for tabulous.commands.tab

       from __future__ import annotations
       from typing import TYPE_CHECKING
       from . import _dialogs
      +from tabulous._magicgui import ToggleSwitchSelect
       
       if TYPE_CHECKING:
           from tabulous.widgets import TableViewerBase
      @@ -141,7 +145,7 @@ 

      Source code for tabulous.commands.tab

           """Tile tabs"""
           choices = [(table.name, idx) for idx, table in enumerate(viewer.tables)]
           out = _dialogs.choose_multiple(
      -        choices={"choices": choices, "widget_type": "Select"},
      +        choices={"choices": choices, "widget_type": ToggleSwitchSelect},
               parent=viewer.native,
           )
           if out:
      @@ -182,7 +186,7 @@ 

      Source code for tabulous.commands.tab

       
      [docs]def delete_tab(viewer: TableViewerBase) -> None: """Delete current tab.""" idx = viewer.current_index - del viewer.tables[idx]
      + viewer.tables.del_checked(idx)
      diff --git a/docs/_modules/tabulous/commands/table.html b/docs/_modules/tabulous/commands/table.html index dec763ba..c876e252 100644 --- a/docs/_modules/tabulous/commands/table.html +++ b/docs/_modules/tabulous/commands/table.html @@ -3,7 +3,7 @@ - tabulous.commands.table — tabulous 0.4.1 documentation + tabulous.commands.table — tabulous 0.5.0rc1 documentation @@ -28,7 +28,7 @@ tabulous
      - 0.4.1 + 0.5.0rc1
      @@ -89,6 +89,8 @@

      Source code for tabulous.commands.table

       from __future__ import annotations
       from typing import TYPE_CHECKING
       from . import _dialogs, _utils
      +from tabulous._magicgui import ToggleSwitchSelect
      +from tabulous.widgets._source import Source
       
       if TYPE_CHECKING:
           from tabulous.widgets import TableViewerBase, TableBase, SpreadSheet
      @@ -103,13 +105,15 @@ 

      Source code for tabulous.commands.table

       
      [docs]def copy_as_table(viewer: TableViewerBase): """Copy current table as a new table""" table = _utils.get_table(viewer) - viewer.add_table(table.data, name=f"{table.name}-copy")
      + out = viewer.add_table(table.data, name=f"{table.name}-copy") + out._source = Source.from_table(table)
      [docs]def copy_as_spreadsheet(viewer: TableViewerBase): """Copy current table as a new spreadsheet""" table = _utils.get_table(viewer) - viewer.add_spreadsheet(table.data, name=f"{table.name}-copy")
      + out = viewer.add_spreadsheet(table.data, name=f"{table.name}-copy") + out._source = Source.from_table(table)
      [docs]def copy_to_clipboard(viewer: TableViewerBase): @@ -138,14 +142,15 @@

      Source code for tabulous.commands.table

               viewer={"bind": viewer},
               names={
                   "value": [viewer.current_table.name],
      -            "widget_type": "Select",
      +            "widget_type": ToggleSwitchSelect,
                   "choices": [t.name for t in viewer.tables],
               },
               axis={"choices": [("vertical", 0), ("horizontal", 1)]},
               parent=viewer._qwidget,
           )
           if out is not None:
      -        viewer.add_table(out, name="concat")
      + table = viewer.add_table(out, name="concat") + table._source = Source.from_table(viewer.current_table)
      [docs]def merge(viewer: TableViewerBase): @@ -165,7 +170,7 @@

      Source code for tabulous.commands.table

               merge={"changed": _update_choices},
               with_={"changed": _update_choices},
               how={"choices": ["left", "right", "outer", "inner"], "value": "inner"},
      -        on={"choices": [], "widget_type": "Select"},
      +        on={"choices": [], "widget_type": ToggleSwitchSelect},
               parent=viewer._qwidget,
           )
           if out is not None:
      @@ -186,26 +191,27 @@ 

      Source code for tabulous.commands.table

               parent=viewer._qwidget,
           )
           if out is not None:
      -        viewer.add_table(out, name=f"{table.name}-pivot")
      + table_out = viewer.add_table(out, name=f"{table.name}-pivot") + table_out._source = Source.from_table(table)
      [docs]def melt(viewer: TableViewerBase): """Melt (unpivot) current table data (pd.melt)""" table = _utils.get_table(viewer) - out = _dialogs.melt( - df={"bind": table.data}, - id_vars={"choices": list(table.data.columns), "widget_type": "Select"}, - parent=viewer._qwidget, - ) + cols = _utils.get_selected_columns(viewer) + df = table.data + out = df.melt(id_vars=[df.columns[i] for i in cols]) if out is not None: - viewer.add_table(out, name=f"{table.name}-melt")
      + table_out = viewer.add_table(out, name=f"{table.name}-melt") + table_out._source = Source.from_table(table)
      [docs]def transpose(viewer: TableViewerBase): """Transpose current table data""" table = _utils.get_table(viewer) out = table.data.T - viewer.add_table(out, name=f"{table.name}-transposed")
      + table_out = viewer.add_table(out, name=f"{table.name}-transposed") + table_out._source = Source.from_table(table)
      [docs]def fillna(viewer: TableViewerBase): @@ -232,7 +238,8 @@

      Source code for tabulous.commands.table

               parent=viewer._qwidget,
           )
           if out is not None:
      -        viewer.add_table(out, name=f"{table.name}-fillna")
      + table_out = viewer.add_table(out, name=f"{table.name}-fillna") + table_out._source = Source.from_table(table)
      [docs]def dropna(viewer: TableViewerBase): @@ -245,7 +252,8 @@

      Source code for tabulous.commands.table

               parent=viewer._qwidget,
           )
           if out is not None:
      -        viewer.add_table(out, name=f"{table.name}-dropna")
      + table_out = viewer.add_table(out, name=f"{table.name}-dropna") + table_out._source = Source.from_table(table)
      [docs]def show_finder_widget(viewer: TableViewerBase): @@ -383,6 +391,18 @@

      Source code for tabulous.commands.table

           table = _utils.get_table(viewer)
           table.native._qtable_view.resizeColumnsToContents()
           table.native._qtable_view.resizeRowsToContents()
      + + +
      [docs]def zoom_in(viewer: TableViewerBase): + """Zoom in""" + table = _utils.get_table(viewer) + table.native._qtable_view.zoomIn(1)
      + + +
      [docs]def zoom_out(viewer: TableViewerBase): + """Zoom in""" + table = _utils.get_table(viewer) + table.native._qtable_view.zoomIn(-1)
    diff --git a/docs/_modules/tabulous/commands/window.html b/docs/_modules/tabulous/commands/window.html index c4de12df..d4271940 100644 --- a/docs/_modules/tabulous/commands/window.html +++ b/docs/_modules/tabulous/commands/window.html @@ -3,7 +3,7 @@ - tabulous.commands.window — tabulous 0.4.1 documentation + tabulous.commands.window — tabulous 0.5.0rc1 documentation @@ -28,7 +28,7 @@ tabulous
    - 0.4.1 + 0.5.0rc1
    @@ -106,6 +106,10 @@

    Source code for tabulous.commands.window

     
    [docs]def new_window(viewer: TableViewerBase): """Create a new window""" new = viewer.__class__() + pos = viewer._qwidget.pos() + pos.setX(pos.x() + 20) + pos.setY(pos.y() + 20) + new._qwidget.move(pos) return new._qwidget.activateWindow()
    @@ -121,10 +125,7 @@

    Source code for tabulous.commands.window

     
     
    [docs]def toggle_fullscreen(viewer: TableViewerBase): """Toggle fullscreen""" - if viewer._qwidget.isFullScreen(): - viewer._qwidget.showNormal() - else: - viewer._qwidget.showFullScreen()
    + viewer._qwidget.toggleWindowState()
    [docs]def show_command_palette(viewer: TableViewerBase): @@ -172,6 +173,11 @@

    Source code for tabulous.commands.window

         else:
             raise TypeError(f"Cannot add widget to {type(viewer)}")
         return None
    + + +
    [docs]def show_preference(viewer: TableViewerBase): + """Show preference dialog""" + viewer._qwidget.showPreferenceDialog()
    diff --git a/docs/_modules/tabulous/style/_style.html b/docs/_modules/tabulous/style/_style.html new file mode 100644 index 00000000..c1d461a9 --- /dev/null +++ b/docs/_modules/tabulous/style/_style.html @@ -0,0 +1,181 @@ + + + + + + tabulous.style._style — tabulous 0.5.0rc1 documentation + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +

    Source code for tabulous.style._style

    +from __future__ import annotations
    +
    +from dataclasses import dataclass, asdict
    +from functools import lru_cache
    +import json
    +from pathlib import Path
    +from tabulous.color import normalize_color
    +
    +
    +
    [docs]@dataclass(frozen=True) +class Style: + background: str + foreground: str + base_color: str + highlight0: str + highlight1: str + background0: str + background1: str + cell_highlight: str + cell_selection: str + +
    [docs] @lru_cache(maxsize=12) + def format_text(self, text: str) -> str: + for name, value in asdict(self).items(): + text = text.replace(f"#[{name}]", f"{value}") + return text
    + +
    [docs] def format_file(self, file: str | Path | None = None) -> str: + if file is None: + file = Path(__file__).parent / "_style.qss" + with open(file) as f: + text = f.read() + return self.format_text(text)
    + +
    [docs] @classmethod + def from_global(cls, name: str) -> Style: + theme = GLOBAL_STYLES.get(name, None) + if theme is None: + raise ValueError(f"Theme {name!r} not found") + js = asdict(theme) + self = cls(**js) + return self
    + + +GLOBAL_STYLES: dict[str, Style] = {} + +with open(Path(__file__).parent / "defaults.json") as f: + js: dict = json.load(f) + for name, style in js.items(): + + bg = normalize_color(style["background"]) + fg = normalize_color(style["foreground"]) + base = normalize_color(style["base_color"]) + if "background0" not in style: + style["background0"] = bg.mix(fg, 0.1).html + if "background1" not in style: + style["background1"] = bg.mix(fg, -0.1).html + if "highlight0" not in style: + style["highlight0"] = base.mix(bg, 0.6).html + if "highlight1" not in style: + style["highlight1"] = base.mix(bg, 0.75).html + if "cell_selection" not in style: + style["cell_selection"] = base.html + GLOBAL_STYLES[name] = Style(**style) +
    + +
    +
    + +
    +
    +
    +
    + + + + diff --git a/docs/_modules/tabulous/widgets/_mainwindow.html b/docs/_modules/tabulous/widgets/_mainwindow.html index 45a383a8..84cc223f 100644 --- a/docs/_modules/tabulous/widgets/_mainwindow.html +++ b/docs/_modules/tabulous/widgets/_mainwindow.html @@ -3,7 +3,7 @@ - tabulous.widgets._mainwindow — tabulous 0.4.1 documentation + tabulous.widgets._mainwindow — tabulous 0.5.0rc1 documentation @@ -28,7 +28,7 @@ tabulous
    - 0.4.1 + 0.5.0rc1
    @@ -100,6 +100,7 @@

    Source code for tabulous.widgets._mainwindow

    from ._tablelist import TableList
     from ._sample import open_sample
     from ._component import Toolbar, Console, CommandPalette
    +from ._source import Source
     from . import _doc
     
     from tabulous import _utils, _io
    @@ -264,6 +265,15 @@ 

    Source code for tabulous.widgets._mainwindow

    """The file I/O history manager."""
             return self._qwidget._hist_mgr
     
    +    @property
    +    def theme(self) -> str:
    +        """Get current widget theme name."""
    +        return self._qwidget._style_theme
    +
    +    @theme.setter
    +    def theme(self, theme: str):
    +        self._qwidget.applyTheme(theme)
    +
     
    [docs] def show(self, *, run: bool = True) -> None: """Show the widget.""" self._qwidget.show() @@ -437,9 +447,11 @@

    Source code for tabulous.widgets._mainwindow

    out = _io.open_file(path)
             if isinstance(out, dict):
                 for sheet_name, df in out.items():
    -                fopen(df, name=sheet_name)
    +                table = fopen(df, name=sheet_name)
    +                table._source = Source(path)
             else:
    -            fopen(out, name=path.stem)
    +            table = fopen(out, name=path.stem)
    +            table._source = Source(path)
     
             _utils.dump_file_open_path(path)
             return None
    @@ -538,7 +550,22 @@

    Source code for tabulous.widgets._mainwindow

    [docs]    def resize(self, width: int, height: int):
             """Resize the table viewer."""
    -        return self._qwidget.resize(width, height)
    + warnings.warn( + "viewer.resize() is deprecated. Use `viewer.size` instead.", + DeprecationWarning, + ) + self.size = width, height
    + + @property + def size(self) -> tuple[int, int]: + """Return the size of the table viewer.""" + return self._qwidget.size().width(), self._qwidget.size().height() + + @size.setter + def size(self, size: tuple[int, int]): + """Set the size of the table viewer.""" + w, h = size + return self._qwidget.resize(int(w), int(h)) def _link_events(self): _tablist = self._tablist @@ -551,16 +578,20 @@

    Source code for tabulous.widgets._mainwindow

    @_tablist.events.removed.connect
             def _remove_qtable(index: int, table: TableBase):
    -            with _tablist.events.blocked():
    +            _qtablist.blockSignals(True)
    +            try:
                     _qtablist.takeTable(index)
    +            finally:
    +                _qtablist.blockSignals(False)
     
             @_tablist.events.moved.connect
             def _move_qtable(src: int, dst: int):
                 # Evented list emits (0, 1) when move(0, 2) is called (v0.3.5 now).
    -            if src < dst:
    -                dst += 1
    -            with _tablist.events.blocked():
    +            _qtablist.blockSignals(True)
    +            try:
                     _qtablist.moveTable(src, dst)
    +            finally:
    +                _qtablist.blockSignals(False)
     
             @_tablist.events.renamed.connect
             def _rename_qtable(index: int, name: str):
    @@ -570,6 +601,8 @@ 

    Source code for tabulous.widgets._mainwindow

    @_qtablist.itemMoved.connect
             def _move_pytable(src: int, dst: int):
                 """Move evented list when list is moved in GUI."""
    +            if src < dst:
    +                dst += 1
                 with self._tablist.events.blocked():
                     self._tablist.move(src, dst)
     
    @@ -648,6 +681,13 @@ 

    Source code for tabulous.widgets._mainwindow

    show=show,
             )
     
    +    @property
    +    def config(self) -> MappingProxyType:
    +        """Return the config info."""
    +        from tabulous._utils import get_config
    +
    +        return get_config().as_immutable()
    +
     
    [docs] def add_dock_widget( self, widget: Widget | QWidget, @@ -656,6 +696,20 @@

    Source code for tabulous.widgets._mainwindow

    area: str = "right",
             allowed_areas: list[str] | None = None,
         ):
    +        """
    +        Add a Qt or magic widget as a dock widget of the table viewer.
    +
    +        Parameters
    +        ----------
    +        widget : magicgui.widgets.Widget or QWidget
    +            Widget to add to the table viewer.
    +        name : str, optional
    +            Name of the widget.
    +        area : str, default is "right"
    +            The initial area of the dock widget.
    +        allowed_areas : list of str, optional
    +            The allowed areas of the dock widget.
    +        """
             backend_widget, name = _normalize_widget(widget, name)
     
             dock = self._qwidget.addDockWidget(
    diff --git a/docs/_modules/tabulous/widgets/_table.html b/docs/_modules/tabulous/widgets/_table.html
    index 68b36f24..26de74dd 100644
    --- a/docs/_modules/tabulous/widgets/_table.html
    +++ b/docs/_modules/tabulous/widgets/_table.html
    @@ -3,7 +3,7 @@
     
       
       
    -  tabulous.widgets._table — tabulous 0.4.1 documentation
    +  tabulous.widgets._table — tabulous 0.5.0rc1 documentation
           
           
           
    @@ -28,7 +28,7 @@
                  tabulous
               
                   
    - 0.4.1 + 0.5.0rc1
    @@ -97,6 +97,7 @@

    Source code for tabulous.widgets._table

     
     from tabulous.widgets import _doc, _component as _comp
     from tabulous.widgets._keymap_abc import SupportKeyMap
    +from tabulous.widgets._source import Source
     from tabulous.types import ItemInfo, HeaderInfo, EvalInfo
     from tabulous._psygnal import SignalArray, InCellRangedSlot
     
    @@ -177,6 +178,7 @@ 

    Source code for tabulous.widgets._table

             metadata: dict[str, Any] | None = None,
         ):
             from tabulous._qt import get_app
    +        from tabulous._map_model import SlotRefMapping
     
             _ = get_app()
     
    @@ -189,11 +191,11 @@ 

    Source code for tabulous.widgets._table

             self._qwidget = self._create_backend(_data)
             self._install_actions()
             self._qwidget.connectSelectionChangedSignal(self._emit_selections)
    -        from tabulous._map_model import SlotRefMapping
     
             self._qwidget._qtable_view._table_map = SlotRefMapping(self)
             self._view_mode = ViewMode.normal
             self._metadata: dict[str, Any] = metadata or {}
    +        self._source = Source()
     
             if self.mutable:
                 with self._qwidget._mgr.blocked():
    @@ -232,6 +234,11 @@ 

    Source code for tabulous.widgets._table

             )
             return self.cell.ref
     
    +    @property
    +    def source(self) -> Source:
    +        """The source of the table."""
    +        return self._source
    +
         def _emit_data_changed_signal(self, info: ItemInfo) -> None:
             r, c = info.row, info.column
             if info.value is info.DELETED or info.old_value is info.INSERTED:
    @@ -536,7 +543,9 @@ 

    Source code for tabulous.widgets._table

             """Save table data to the given path."""
             from tabulous._io import save_file
     
    +        path = Path(path)
             save_file(path, self.data)
    +        self._source = self.source.replace(path=path)
             return None
    [docs] def screenshot(self) -> np.ndarray: diff --git a/docs/_sources/apidoc/tabulous.rst.txt b/docs/_sources/apidoc/tabulous.rst.txt index 1b2b4784..56fd7f03 100644 --- a/docs/_sources/apidoc/tabulous.rst.txt +++ b/docs/_sources/apidoc/tabulous.rst.txt @@ -8,6 +8,7 @@ Subpackages :maxdepth: 4 tabulous.commands + tabulous.style tabulous.widgets Submodules diff --git a/docs/_sources/apidoc/tabulous.style.rst.txt b/docs/_sources/apidoc/tabulous.style.rst.txt new file mode 100644 index 00000000..bb777b84 --- /dev/null +++ b/docs/_sources/apidoc/tabulous.style.rst.txt @@ -0,0 +1,10 @@ +tabulous.style package +====================== + +Module contents +--------------- + +.. automodule:: tabulous.style + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/_sources/main/quickstart.rst.txt b/docs/_sources/main/quickstart.rst.txt index 0dca412a..ab3f05d7 100644 --- a/docs/_sources/main/quickstart.rst.txt +++ b/docs/_sources/main/quickstart.rst.txt @@ -51,13 +51,13 @@ but you can show it in several ways. 1. Set :attr:`visible` property of :attr:`console` interface to ``True``: ``>>> viewer.conosole.visible = True`` -2. Activate keyboard shortcut :kbd:`Ctrl+Shift+C`. +2. Activate keyboard shortcut :kbd:`Ctrl` :kbd:`Shift` :kbd:`C`. 3. Click the |toggle_console| tool button in the the toolbar. In ``tabulous`` viewer there are additional keybindings. -- :kbd:`Ctrl+Shift+↑`: Set console floating. -- :kbd:`Ctrl+Shift+↓`: Dock console. +- :kbd:`Ctrl` :kbd:`Shift` :kbd:`↑`: Set console floating. +- :kbd:`Ctrl` :kbd:`Shift` :kbd:`↓`: Dock console. Use Tables ========== @@ -225,7 +225,7 @@ Key combo :mod:`tabulous` supports many keyboard shortcuts including key combo. All the global key map is listed in a widget that will be shown when you press -:kbd:`Ctrl+K ⇒ Shift+?` key combo. +:kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`Shift` :kbd:`?` key combo. :attr:`keymap` is the key map registry object of table viewers. You can use :meth:`register` to register custom key combo. @@ -252,7 +252,7 @@ Command palette .. versionadded:: 0.4.0 -:kbd:`Ctrl+Shift+P` or :kbd:`F1` opens a command palette widget. You can search for a variety of +:kbd:`Ctrl` :kbd:`Shift` :kbd:`P` or :kbd:`F1` opens a command palette widget. You can search for a variety of registered commands. .. image:: ../fig/command_palette.png diff --git a/docs/_sources/main/table_view_mode.rst.txt b/docs/_sources/main/table_view_mode.rst.txt index ba9faa17..92d57786 100644 --- a/docs/_sources/main/table_view_mode.rst.txt +++ b/docs/_sources/main/table_view_mode.rst.txt @@ -30,8 +30,8 @@ To reset dual view, set the property to ``"normal"``. table.view_mode = "normal" -Dual view can also be turned on by key combo :kbd:`Ctrl+K ⇒ H` (horizontal) or -:kbd:`Ctrl+K ⇒ V` (vertical). Reset it by key combo :kbd:`Ctrl+K ⇒ N`. +Dual view can also be turned on by key combo :kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`H` (horizontal) or +:kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`V` (vertical). Reset it by key combo :kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`N`. Popup View ---------- @@ -48,7 +48,7 @@ similar to dual view by ``table.view_mode = "normal"`` table = viewer.add_table(data) table.view_mode = "popup" -Dual view can also be turned on by key combo :kbd:`Ctrl+K ⇒ P`. +Dual view can also be turned on by key combo :kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`P`. Tile View --------- @@ -64,7 +64,7 @@ window, but tabs named "A" and "B" still exist in the tab bar. ``viewer.tables[i also returns the same table as before. When tab "A" or "B" is clicked, the tiled table with "A" and "B" is shown as ``A|B``. -You can tile the current table and the table next to it by shortcut :kbd:`Ctrl+K ⇒ ^`. +You can tile the current table and the table next to it by shortcut :kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`^`. You can also programmatically tile tables by calling :meth:`viewer.tables.tile`. .. code-block:: python @@ -82,5 +82,5 @@ these tabs show tiled view ``A|B|C``. If you untiled "B", "A" and "C" are re-til while "B" returns the original state. Therefore, tabs "A" and "C" shows ``A|C`` and tab "B" shows ``B``. -You can untile the current table by shortcut :kbd:`Ctrl+K ⇒ \\`. +You can untile the current table by shortcut :kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`\\`. You can also programmatically untile tables by calling ``viewer.tables.untile([0, 1, 2])``. diff --git a/docs/_sources/main/user_interface.rst.txt b/docs/_sources/main/user_interface.rst.txt index e19d49b5..a54108f9 100644 --- a/docs/_sources/main/user_interface.rst.txt +++ b/docs/_sources/main/user_interface.rst.txt @@ -11,15 +11,26 @@ User Interface Tables ====== -Move around the table ---------------------- +Move and scroll +--------------- + +- Arrow keys (:kbd:`→` :kbd:`←` :kbd:`↑` :kbd:`↓`) with :kbd:`Ctrl` (or :kbd:`⌘` in Mac), + :kbd:`Shift` modifier work as you expects in most of table data editors. +- Arrow keys (:kbd:`→` :kbd:`←` :kbd:`↑` :kbd:`↓`) with :kbd:`Ctrl` + :kbd:`Alt` scrolls + the table to the desired direction. You can also scroll tables using the scroll bar, or + right-dragging. + +Zoom +---- + +- :kbd:`Ctrl` + ``mouse wheel`` zooms in/out the table. +- You can also use keybindings + :kbd:`Ctrl` :kbd:`Shift` :kbd:`>` :kbd:`Ctrl` :kbd:`Shift` :kbd:`<` to zoom in/out. -Arrow keys (:kbd:`→` :kbd:`←` :kbd:`↑` :kbd:`↓`) with :kbd:`Ctrl` (or :kbd:`⌘` in Mac), -:kbd:`Shift` modifier work as you expects in most of table data editors. +Resize +------ -Additionally, :kbd:`Ctrl` + ``mouse wheel`` zooms in/out the table. Arrow keys (:kbd:`→` -:kbd:`←` :kbd:`↑` :kbd:`↓`) with :kbd:`Ctrl` + :kbd:`Alt` scrolls the table to the desired -direction. +Cells and headers can be resized by dragging the borders of header sections. Edit cells and headers ---------------------- @@ -33,27 +44,6 @@ During editing, the text will always be validated. Invalid text will be shown in table cells, you can set any validation rules (see :doc:`/main/columnwise_settings`). For the table headers, duplicated names are not allowed and considered to be invalid. -Add cell labels ---------------- - -People using spreadsheets usually want to name some of the cells. For instance, when you -calculated the mean of a column, you want to name the cell as "mean". Usually, it is done -by editing one of the adjacent cells. - -=== ==== - A B -=== ==== - 1 mean - 2 2.5 - 3 - 4 -=== ==== - -In :mod:`tabulous`, however, you can directly name the cell using cell label. You can edit -cell labels by :kbd:`F3` key. - -.. image:: ../fig/cell_labels.png - Excel-style data evaluation --------------------------- @@ -66,7 +56,7 @@ data is available as a variable ``df``. By default, modules :mod:`numpy` and :mo also available as ``np`` and ``pd``. If the input string starts with ``=``, the editor is automatically switched to the literal evaluation mode and cell selection will insert table data reference to the editor. For instance, if you select column ``'A'`` and rows from 1 to 8, then -``df['A'][1:9]`` will be inserted. +``df[1:9, 0:1]`` will be inserted. One of the differences between this mode and Excel is that this evaluation does not use reference, so that changing the value of any of the source cells will **NOT** affect the value @@ -232,6 +222,37 @@ want to add more variables or functions, there are two ways to do it. You can't use none of ``np``, ``pd`` or ``df`` as a variable name. +Add cell labels +--------------- + +People using spreadsheets usually want to name some of the cells. For instance, when you +calculated the mean of a column, you want to name the cell as "mean". Usually, it is done +by editing one of the adjacent cells. + +=== ==== + A B +=== ==== + 1 mean + 2 2.5 + 3 + 4 +=== ==== + +In :mod:`tabulous`, however, you can directly name the cell using cell label. You can edit +cell labels by :kbd:`F3` key. + +.. image:: ../fig/cell_labels.png + +Table Tabs +========== + +All the tables are managed by the table tabs. + +- You can double-click to rename the tab. The ``name`` property of the table will also be + updated. +- You can run table specific actions by right-clicking the tab. +- You can drag-and-drop tabs between viewers by right-drag. + Toolbar ======= diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js index ec89c338..4b94c60e 100644 --- a/docs/_static/documentation_options.js +++ b/docs/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '0.4.1', + VERSION: '0.5.0', LANGUAGE: 'None', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/docs/apidoc/modules.html b/docs/apidoc/modules.html index f84dd242..658977db 100644 --- a/docs/apidoc/modules.html +++ b/docs/apidoc/modules.html @@ -4,7 +4,7 @@ - tabulous — tabulous 0.4.1 documentation + tabulous — tabulous 0.5.0 documentation @@ -31,7 +31,7 @@ tabulous
    - 0.4.1 + 0.5.0
    @@ -110,6 +110,10 @@

    tabulousModule contents +
  • tabulous.style package +
  • tabulous.widgets package diff --git a/docs/apidoc/tabulous.commands.html b/docs/apidoc/tabulous.commands.html index 35b25c2e..31b2d4b7 100644 --- a/docs/apidoc/tabulous.commands.html +++ b/docs/apidoc/tabulous.commands.html @@ -4,7 +4,7 @@ - tabulous.commands package — tabulous 0.4.1 documentation + tabulous.commands package — tabulous 0.5.0 documentation @@ -19,7 +19,7 @@ - + @@ -31,7 +31,7 @@ tabulous
    - 0.4.1 + 0.5.0
    @@ -64,6 +64,7 @@
  • tabulous package

  • diff --git a/docs/apidoc/tabulous.html b/docs/apidoc/tabulous.html index e94478e1..27f0b2a9 100644 --- a/docs/apidoc/tabulous.html +++ b/docs/apidoc/tabulous.html @@ -4,7 +4,7 @@ - tabulous package — tabulous 0.4.1 documentation + tabulous package — tabulous 0.5.0 documentation @@ -31,7 +31,7 @@ tabulous
    - 0.4.1 + 0.5.0
    @@ -64,6 +64,7 @@
  • tabulous package
  • +
  • tabulous.style package +
  • tabulous.widgets package @@ -166,6 +171,12 @@

    Submodules +
    +brighten(ratio: float) tabulous.color.ColorTuple[source]
    +

    Set the saturation of the color.

    +
    +
    equals(other)[source]
    @@ -213,6 +224,12 @@

    Submodules +
    +mix(other, ratio: float = 0.5, alpha: bool = False) tabulous.color.ColorTuple[source]
    +

    Mix the color with another color.

    +

    +
    property opacity: float
    @@ -607,7 +624,7 @@

    Submodules

    Module contents

    -class tabulous.MagicTableViewer(*, tab_position: TabPosition | str = TabPosition.top, name: str = '', label: str = None, tooltip: str | None = None, visible: bool | None = None, enabled: bool = True, show: bool = False)[source]
    +class tabulous.MagicTableViewer(*, tab_position: TabPosition | str = TabPosition.top, name: str = '', label: str = None, tooltip: str | None = None, visible: bool | None = None, enabled: bool = True, show: bool = False)[source]

    Bases: magicgui.widgets.bases._widget.Widget, tabulous.widgets._mainwindow.TableViewerWidget

    A magicgui widget of table viewer.

    This class is a subclass of magicgui.widget.Widget so that it can be used @@ -636,7 +653,24 @@

    Submodules
    add_dock_widget(widget: Widget | QWidget, *, name: str = '', area: str = 'right', allowed_areas: list[str] | None = None)[source]
    -

    +

    Add a Qt or magic widget as a dock widget of the table viewer.

    +
    +
    Parameters
    +
      +
    • widget (magicgui.widgets.Widget or QWidget) – Widget to add to the table viewer.

    • +
    • name (str, optional) – Name of the widget.

    • +
    • area (str, default is "right") – The initial area of the dock widget.

    • +
    • allowed_areas (list of str, optional) – The allowed areas of the dock widget.

    • +
    +
    +
    +

    + +
    +
    +property config: mappingproxy
    +

    Return the config info.

    +
    diff --git a/docs/apidoc/tabulous.style.html b/docs/apidoc/tabulous.style.html new file mode 100644 index 00000000..df75f2fe --- /dev/null +++ b/docs/apidoc/tabulous.style.html @@ -0,0 +1,214 @@ + + + + + + + tabulous.style package — tabulous 0.5.0 documentation + + + + + + + + + + + + + + + + + +
    + + +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +

    tabulous.style package

    +
    +

    Module contents

    +
    +
    +class tabulous.style.Style(background: 'str', foreground: 'str', base_color: 'str', highlight0: 'str', highlight1: 'str', background0: 'str', background1: 'str', cell_highlight: 'str', cell_selection: 'str')[source]
    +

    Bases: object

    +
    +
    +background: str
    +
    + +
    +
    +background0: str
    +
    + +
    +
    +background1: str
    +
    + +
    +
    +base_color: str
    +
    + +
    +
    +cell_highlight: str
    +
    + +
    +
    +cell_selection: str
    +
    + +
    +
    +foreground: str
    +
    + +
    +
    +format_file(file: str | Path | None = None) str[source]
    +
    + +
    +
    +format_text(text: str) str[source]
    +
    + +
    +
    +classmethod from_global(name: str) tabulous.style._style.Style[source]
    +
    + +
    +
    +highlight0: str
    +
    + +
    +
    +highlight1: str
    +
    + +
    + +
    +
    + + +
    +
    + +
    +
    +
    +
    + + + + diff --git a/docs/apidoc/tabulous.widgets.html b/docs/apidoc/tabulous.widgets.html index f56f22f5..7e6854af 100644 --- a/docs/apidoc/tabulous.widgets.html +++ b/docs/apidoc/tabulous.widgets.html @@ -4,7 +4,7 @@ - tabulous.widgets package — tabulous 0.4.1 documentation + tabulous.widgets package — tabulous 0.5.0 documentation @@ -19,7 +19,7 @@ - + @@ -30,7 +30,7 @@ tabulous
    - 0.4.1 + 0.5.0
    +
    property table_shape: tuple[int, int]
    @@ -615,7 +622,24 @@

    tabulous.widgets package
    add_dock_widget(widget: Widget | QWidget, *, name: str = '', area: str = 'right', allowed_areas: list[str] | None = None)[source]
    -

    +

    Add a Qt or magic widget as a dock widget of the table viewer.

    +
    +
    Parameters
    +
      +
    • widget (magicgui.widgets.Widget or QWidget) – Widget to add to the table viewer.

    • +
    • name (str, optional) – Name of the widget.

    • +
    • area (str, default is "right") – The initial area of the dock widget.

    • +
    • allowed_areas (list of str, optional) – The allowed areas of the dock widget.

    • +
    +
    +
    +
    + +
    +
    +property config: mappingproxy
    +

    Return the config info.

    +
    @@ -849,6 +873,12 @@

    tabulous.widgets package +
    +property size: tuple[int, int]
    +

    Return the size of the table viewer.

    +

    +
    property status: str
    @@ -861,6 +891,12 @@

    tabulous.widgets package +
    +property theme: str
    +

    Get current widget theme name.

    +

    +
    toolbar
    @@ -894,7 +930,7 @@

    tabulous.widgets package - +


  • diff --git a/docs/font.html b/docs/font.html index 5cf3b1c4..210520c0 100644 --- a/docs/font.html +++ b/docs/font.html @@ -4,7 +4,7 @@ - <no title> — tabulous 0.4.1 documentation + <no title> — tabulous 0.5.0 documentation @@ -29,7 +29,7 @@ tabulous
    - 0.4.1 + 0.5.0
    diff --git a/docs/genindex.html b/docs/genindex.html index be4d67e5..15acd86a 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -3,7 +3,7 @@ - Index — tabulous 0.4.1 documentation + Index — tabulous 0.5.0 documentation @@ -28,7 +28,7 @@ tabulous
    - 0.4.1 + 0.5.0
    @@ -180,20 +180,30 @@

    B

    + - - + - + + + +
    +
  • cell_highlight (tabulous.style.Style attribute) +
  • cell_namespace (tabulous.post_init.ViewerInitializer attribute)
  • +
  • cell_selection (tabulous.style.Style attribute) +
  • CellNamespaceMock (class in tabulous.post_init)
  • cellref (tabulous.widgets.TableBase property) @@ -247,18 +261,24 @@

    C

  • concat() (in module tabulous.commands.table)
  • +
  • config (tabulous.TableViewer property) + +
  • console (tabulous.post_init.ViewerInitializer attribute)
  • +
    +
  • from_global() (tabulous.style.Style class method) +
  • from_hlsa() (tabulous.color.ColorTuple class method)
  • from_hsva() (tabulous.color.ColorTuple class method) @@ -423,12 +451,16 @@

    H

  • -
    • tabulous.commands.selection @@ -982,6 +1024,8 @@

      T

    • module
    +
        tabulous.post_init
        + tabulous.style +
        diff --git a/docs/search.html b/docs/search.html index e17d492c..c082b54f 100644 --- a/docs/search.html +++ b/docs/search.html @@ -3,7 +3,7 @@ - Search — tabulous 0.4.1 documentation + Search — tabulous 0.5.0 documentation @@ -31,7 +31,7 @@ tabulous
    - 0.4.1 + 0.5.0
    diff --git a/docs/searchindex.js b/docs/searchindex.js index 0223a215..91679cfc 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["apidoc/modules","apidoc/tabulous","apidoc/tabulous.commands","apidoc/tabulous.widgets","index","main/customize","main/quickstart","main/register_action"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":5,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["apidoc\\modules.rst","apidoc\\tabulous.rst","apidoc\\tabulous.commands.rst","apidoc\\tabulous.widgets.rst","index.rst","main\\customize.rst","main\\quickstart.rst","main\\register_action.rst"],objects:{"":[[1,0,0,"-","tabulous"]],"tabulous.MagicTableViewer":[[1,2,1,"","native"]],"tabulous.TableViewer":[[1,3,1,"","add_dock_widget"],[1,4,1,"","events"],[1,3,1,"","remove_dock_widget"],[1,3,1,"","reset_choices"]],"tabulous.TableViewerWidget":[[1,3,1,"","add_widget"],[1,4,1,"","events"]],"tabulous.color":[[1,1,1,"","BrightenedColormap"],[1,1,1,"","ColorTuple"],[1,1,1,"","ConvertedColormap"],[1,1,1,"","InvertedColormap"],[1,1,1,"","OpacityColormap"],[1,5,1,"","normalize_color"],[1,5,1,"","rgba_to_str"]],"tabulous.color.BrightenedColormap":[[1,3,1,"","from_colormap"]],"tabulous.color.ColorTuple":[[1,4,1,"","a"],[1,4,1,"","b"],[1,3,1,"","equals"],[1,3,1,"","from_hlsa"],[1,3,1,"","from_hsva"],[1,3,1,"","from_html"],[1,4,1,"","g"],[1,2,1,"","hlsa"],[1,2,1,"","hsva"],[1,2,1,"","html"],[1,2,1,"","opacity"],[1,4,1,"","r"]],"tabulous.color.InvertedColormap":[[1,3,1,"","from_colormap"]],"tabulous.color.OpacityColormap":[[1,3,1,"","from_colormap"]],"tabulous.commands":[[2,0,0,"-","analysis"],[2,0,0,"-","column"],[2,0,0,"-","file"],[2,5,1,"","iter_commands"],[2,0,0,"-","plot"],[2,5,1,"","register_command"],[2,0,0,"-","selection"],[2,0,0,"-","tab"],[2,0,0,"-","table"],[2,0,0,"-","view"],[2,0,0,"-","window"]],"tabulous.commands.analysis":[[2,5,1,"","show_eval_widget"],[2,5,1,"","show_filter_widget"],[2,5,1,"","show_optimizer_widget"],[2,5,1,"","show_sklearn_widget"],[2,5,1,"","show_stats_widget"],[2,5,1,"","summarize_table"]],"tabulous.commands.column":[[2,5,1,"","adjust_brightness_background_colormap"],[2,5,1,"","adjust_brightness_text_colormap"],[2,5,1,"","invert_background_colormap"],[2,5,1,"","invert_text_colormap"],[2,5,1,"","reset_background_colormap"],[2,5,1,"","reset_text_colormap"],[2,5,1,"","reset_text_formatter"],[2,5,1,"","run_cut"],[2,5,1,"","run_groupby"],[2,5,1,"","set_background_colormap"],[2,5,1,"","set_background_colormap_opacity"],[2,5,1,"","set_text_colormap"],[2,5,1,"","set_text_colormap_opacity"],[2,5,1,"","set_text_formatter"]],"tabulous.commands.file":[[2,5,1,"","open_sample"],[2,5,1,"","open_spreadsheet"],[2,5,1,"","open_table"],[2,5,1,"","save_table"]],"tabulous.commands.plot":[[2,1,1,"","PlotInfo"],[2,5,1,"","bar"],[2,5,1,"","barplot"],[2,5,1,"","boxenplot"],[2,5,1,"","boxplot"],[2,5,1,"","errorbar"],[2,5,1,"","fill_between"],[2,5,1,"","fill_betweenx"],[2,5,1,"","hist"],[2,5,1,"","new_figure"],[2,5,1,"","plot"],[2,5,1,"","scatter"],[2,5,1,"","stripplot"],[2,5,1,"","swarmplot"],[2,5,1,"","violinplot"]],"tabulous.commands.plot.PlotInfo":[[2,4,1,"","columns"],[2,4,1,"","names"]],"tabulous.commands.selection":[[2,5,1,"","add_checkbox"],[2,5,1,"","add_float_slider"],[2,5,1,"","add_float_spinbox"],[2,5,1,"","add_highlight"],[2,5,1,"","add_line_edit"],[2,5,1,"","add_radio_button"],[2,5,1,"","add_slider"],[2,5,1,"","add_spinbox"],[2,5,1,"","copy_as_html"],[2,5,1,"","copy_as_latex"],[2,5,1,"","copy_as_literal"],[2,5,1,"","copy_as_markdown"],[2,5,1,"","copy_as_new_spreadsheet"],[2,5,1,"","copy_as_new_table"],[2,5,1,"","copy_as_rst_grid"],[2,5,1,"","copy_as_rst_simple"],[2,5,1,"","copy_data_comma_separated"],[2,5,1,"","copy_data_tab_separated"],[2,5,1,"","copy_data_with_header_comma_separated"],[2,5,1,"","copy_data_with_header_tab_separated"],[2,5,1,"","cut_data"],[2,5,1,"","delete_selected_highlight"],[2,5,1,"","delete_values"],[2,5,1,"","edit_current"],[2,5,1,"","filter_by_columns"],[2,5,1,"","insert_column_left"],[2,5,1,"","insert_column_right"],[2,5,1,"","insert_row_above"],[2,5,1,"","insert_row_below"],[2,5,1,"","paste_data_comma_separated"],[2,5,1,"","paste_data_from_markdown"],[2,5,1,"","paste_data_from_numpy_string"],[2,5,1,"","paste_data_from_rst"],[2,5,1,"","paste_data_tab_separated"],[2,5,1,"","raise_slot_error"],[2,5,1,"","remove_cell_widgets"],[2,5,1,"","remove_selected_columns"],[2,5,1,"","remove_selected_rows"],[2,5,1,"","select_all"],[2,5,1,"","set_column_dtype"],[2,5,1,"","show_context_menu"],[2,5,1,"","shuffle_data_column_wise"],[2,5,1,"","sort_by_columns"],[2,5,1,"","sort_inplace"],[2,5,1,"","write_data_reference_in_console"],[2,5,1,"","write_data_signal_in_console"],[2,5,1,"","write_slice_in_console"]],"tabulous.commands.tab":[[2,5,1,"","activate_left"],[2,5,1,"","activate_right"],[2,5,1,"","delete_tab"],[2,5,1,"","rename_tab"],[2,5,1,"","swap_tab_with_left"],[2,5,1,"","swap_tab_with_right"],[2,5,1,"","tile_tables"],[2,5,1,"","tile_with_adjacent_table"],[2,5,1,"","untile_table"]],"tabulous.commands.table":[[2,5,1,"","concat"],[2,5,1,"","copy_as_spreadsheet"],[2,5,1,"","copy_as_table"],[2,5,1,"","copy_to_clipboard"],[2,5,1,"","date_range"],[2,5,1,"","dropna"],[2,5,1,"","fillna"],[2,5,1,"","interval_range"],[2,5,1,"","melt"],[2,5,1,"","merge"],[2,5,1,"","new_spreadsheet"],[2,5,1,"","period_range"],[2,5,1,"","pivot"],[2,5,1,"","random"],[2,5,1,"","redo_table"],[2,5,1,"","reset_proxy"],[2,5,1,"","resize_cells_to_contents"],[2,5,1,"","round"],[2,5,1,"","show_finder_widget"],[2,5,1,"","show_undo_stack_view"],[2,5,1,"","switch_columns"],[2,5,1,"","switch_index"],[2,5,1,"","switch_layout"],[2,5,1,"","timedelta_range"],[2,5,1,"","toggle_editability"],[2,5,1,"","transpose"],[2,5,1,"","undo_table"]],"tabulous.commands.view":[[2,5,1,"","reset_view_mode"],[2,5,1,"","set_dual_h_mode"],[2,5,1,"","set_dual_v_mode"],[2,5,1,"","set_popup_mode"]],"tabulous.commands.window":[[2,5,1,"","add_text_edit"],[2,5,1,"","close_window"],[2,5,1,"","focus_table"],[2,5,1,"","new_window"],[2,5,1,"","show_command_palette"],[2,5,1,"","show_keymap"],[2,5,1,"","toggle_console"],[2,5,1,"","toggle_focus"],[2,5,1,"","toggle_fullscreen"],[2,5,1,"","toggle_toolbar"]],"tabulous.core":[[1,5,1,"","current_viewer"],[1,5,1,"","open_sample"],[1,5,1,"","read_csv"],[1,5,1,"","read_excel"],[1,5,1,"","set_current_viewer"],[1,5,1,"","view_spreadsheet"],[1,5,1,"","view_table"]],"tabulous.exceptions":[[1,1,1,"","ExceptionHandler"],[1,6,1,"","SelectionRangeError"]],"tabulous.post_init":[[1,1,1,"","CellNamespaceMock"],[1,1,1,"","CommandPaletteMock"],[1,1,1,"","ConsoleMock"],[1,1,1,"","ContextRegisterable"],[1,1,1,"","Initializer"],[1,1,1,"","KeyMapMock"],[1,1,1,"","TableInitializer"],[1,1,1,"","ViewerInitializer"],[1,5,1,"","get_initializers"]],"tabulous.post_init.CommandPaletteMock":[[1,3,1,"","register"]],"tabulous.post_init.ContextRegisterable":[[1,3,1,"","register"]],"tabulous.post_init.Initializer":[[1,3,1,"","join"]],"tabulous.post_init.KeyMapMock":[[1,3,1,"","register"]],"tabulous.post_init.TableInitializer":[[1,4,1,"","cell"],[1,4,1,"","columns"],[1,4,1,"","index"],[1,3,1,"","initialize_table"],[1,4,1,"","keymap"]],"tabulous.post_init.ViewerInitializer":[[1,4,1,"","cell_namespace"],[1,4,1,"","command_palette"],[1,4,1,"","console"],[1,3,1,"","initialize_viewer"],[1,4,1,"","keymap"],[1,4,1,"","tables"]],"tabulous.types":[[1,1,1,"","HeaderInfo"],[1,1,1,"","ItemInfo"],[1,5,1,"","TableColumn"],[1,5,1,"","TableData"],[1,5,1,"","TableDataTuple"],[1,1,1,"","TableInfo"]],"tabulous.types.HeaderInfo":[[1,4,1,"","index"],[1,4,1,"","old_value"],[1,4,1,"","value"]],"tabulous.types.ItemInfo":[[1,4,1,"","DELETED"],[1,4,1,"","INSERTED"],[1,2,1,"","col"],[1,4,1,"","column"],[1,4,1,"","old_value"],[1,4,1,"","row"],[1,4,1,"","value"]],"tabulous.widgets":[[3,1,1,"","GroupBy"],[3,1,1,"","MagicSpreadSheet"],[3,1,1,"","MagicTable"],[3,1,1,"","SpreadSheet"],[3,1,1,"","Table"],[3,1,1,"","TableBase"],[3,1,1,"","TableDisplay"],[3,1,1,"","TableViewer"],[3,1,1,"","TableViewerBase"],[3,1,1,"","TableViewerWidget"]],"tabulous.widgets.GroupBy":[[3,2,1,"","current_group"]],"tabulous.widgets.MagicSpreadSheet":[[3,2,1,"","native"]],"tabulous.widgets.MagicTable":[[3,2,1,"","native"]],"tabulous.widgets.SpreadSheet":[[3,3,1,"","add_item_widget"],[3,4,1,"","dtypes"]],"tabulous.widgets.TableBase":[[3,3,1,"","add_overlay_widget"],[3,3,1,"","add_side_widget"],[3,4,1,"","background_color"],[3,3,1,"","background_colormap"],[3,4,1,"","cell"],[3,2,1,"","cellref"],[3,4,1,"","columns"],[3,2,1,"","data"],[3,2,1,"","data_shown"],[3,2,1,"","editable"],[3,2,1,"","filter"],[3,3,1,"","foreground_colormap"],[3,4,1,"","formatter"],[3,4,1,"","highlights"],[3,4,1,"","iloc"],[3,4,1,"","index"],[3,2,1,"","layout"],[3,4,1,"","loc"],[3,2,1,"","metadata"],[3,3,1,"","move_iloc"],[3,3,1,"","move_loc"],[3,2,1,"","mutable"],[3,2,1,"","name"],[3,2,1,"","native"],[3,4,1,"","plt"],[3,4,1,"","proxy"],[3,3,1,"","refresh"],[3,3,1,"","save"],[3,3,1,"","save_screenshot"],[3,3,1,"","screenshot"],[3,4,1,"","selections"],[3,2,1,"","table_shape"],[3,2,1,"","table_type"],[3,4,1,"","text_color"],[3,4,1,"","text_formatter"],[3,2,1,"","undo_manager"],[3,4,1,"","validator"],[3,2,1,"","view_mode"],[3,2,1,"","zoom"]],"tabulous.widgets.TableDisplay":[[3,2,1,"","interval"],[3,2,1,"","loader"],[3,2,1,"","running"]],"tabulous.widgets.TableViewer":[[3,3,1,"","add_dock_widget"],[3,4,1,"","events"],[3,3,1,"","remove_dock_widget"],[3,3,1,"","reset_choices"]],"tabulous.widgets.TableViewerBase":[[3,3,1,"","add_groupby"],[3,3,1,"","add_layer"],[3,3,1,"","add_loader"],[3,3,1,"","add_spreadsheet"],[3,3,1,"","add_table"],[3,2,1,"","cell_namespace"],[3,3,1,"","close"],[3,4,1,"","command_palette"],[3,4,1,"","console"],[3,3,1,"","copy_data"],[3,2,1,"","current_index"],[3,2,1,"","current_table"],[3,4,1,"","events"],[3,2,1,"","history_manager"],[3,2,1,"","native"],[3,3,1,"","open"],[3,3,1,"","open_sample"],[3,3,1,"","paste_data"],[3,3,1,"","resize"],[3,3,1,"","save"],[3,3,1,"","save_all"],[3,3,1,"","save_screenshot"],[3,3,1,"","screenshot"],[3,3,1,"","show"],[3,2,1,"","status"],[3,2,1,"","tables"],[3,4,1,"","toolbar"]],"tabulous.widgets.TableViewerWidget":[[3,3,1,"","add_widget"],[3,4,1,"","events"]],tabulous:[[1,1,1,"","MagicTableViewer"],[1,1,1,"","TableViewer"],[1,1,1,"","TableViewerWidget"],[1,0,0,"-","color"],[2,0,0,"-","commands"],[1,0,0,"-","core"],[1,5,1,"","current_viewer"],[1,0,0,"-","exceptions"],[1,5,1,"","open_sample"],[1,0,0,"-","post_init"],[1,5,1,"","read_csv"],[1,5,1,"","read_excel"],[1,0,0,"-","types"],[1,5,1,"","view_spreadsheet"],[1,5,1,"","view_table"],[3,0,0,"-","widgets"]]},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","property","Python property"],"3":["py","method","Python method"],"4":["py","attribute","Python attribute"],"5":["py","function","Python function"],"6":["py","exception","Python exception"]},objtypes:{"0":"py:module","1":"py:class","2":"py:property","3":"py:method","4":"py:attribute","5":"py:function","6":"py:exception"},terms:{"0":[1,2,3,5,6,7],"1":[1,2,3,5,6,7],"10":[3,6],"14159265359":5,"2":[1,3,6,7],"20":6,"255":1,"3":[1,3,5,6],"4":[3,5,6,7],"5":[3,6],"6":[3,6],"8":[1,3],"boolean":3,"byte":3,"case":7,"class":[1,2,3,5],"default":[3,5,6],"do":[3,6],"float":[1,3,6],"function":[2,3,5,6,7],"import":[5,6,7],"int":[1,3,7],"new":[1,2,5,6],"return":[1,3,5],"switch":2,"true":[1,3,6],A:[1,3],If:[1,3,6,7],In:[6,7],It:[3,6],The:[1,3,5,6,7],To:[3,5],_:[1,3],_abstractview:3,_dataframetablelay:3,_keymap_abc:3,_mainwindow:[1,3],_qtmainwidgetbas:3,_register:1,_singleselect:3,_t:1,_tabl:3,_tablelik:3,_tablelist:3,_updat:1,_widget:[1,3],abov:2,access:3,accordingli:[4,6],achiev:4,acit:6,action:[3,4],activ:[2,3,6],activate_left:2,activate_right:2,actual:5,ad:[3,5,6],add:[1,2,3,5,6],add_checkbox:2,add_dock_widget:[1,3],add_float_slid:2,add_float_spinbox:2,add_groupbi:3,add_highlight:2,add_item_widget:3,add_lay:3,add_line_edit:2,add_load:3,add_overlay_widget:3,add_radio_button:2,add_side_widget:3,add_slid:2,add_spinbox:2,add_spreadsheet:[3,6],add_tabl:[3,6,7],add_text_edit:2,add_widget:[1,3],addit:[1,6],adjac:2,adjust:2,adjust_brightness_background_colormap:2,adjust_brightness_text_colormap:2,alia:[1,2],all:[1,2,3,6,7],allow:5,allowed_area:[1,3],alpha:1,also:[3,5,6,7],an:[1,2,3,7],analysi:[0,1],ani:[1,2,3,4],api:4,appli:3,applic:5,ar:[3,5,6,7],area:[1,3],arg:[1,3],arrai:3,ascend:3,ask:5,ask_on_clos:5,attribut:[1,3,4,5,6,7],automat:5,avail:[3,5,6],avoid:3,axi:3,b:[1,3,6],backend:[1,3],background:2,background_color:3,background_colormap:3,bar:[1,2,3,5],barplot:2,base:[1,2,3,4,6],basic:5,befor:[3,5],beginn:4,behav:[3,6],below:2,between:[1,2],bin:2,bind:6,bit:1,bool:[1,3],both:7,bottom:3,box:[1,3],boxenplot:2,boxplot:2,bright:2,brighten:1,brightenedcolormap:1,button:6,c:[3,6],callabl:[1,2,3],can:[1,3,5,6,7],canva:2,caus:1,cell:[1,2,3,5,6],cell_namespac:[1,3,5],cellnamespacemock:1,cellref:3,channel:1,chart:3,cheat:4,check:[3,5,6],checkbox:2,child:[1,3],classmethod:1,click:[5,6,7],clipboard:3,close:[2,3,5],close_window:2,cmap:1,col:1,color:0,colormap:[1,2],colortupl:1,column:[0,1,3,4,5,6,7],column_s:5,columnwis:2,combo:[1,3,7],comma:2,command:[0,1,3,5],command_palett:[1,3,5,7],commandpalettemock:1,compat:1,compon:[5,7],concat:2,concaten:2,conda:6,configur:5,connect:2,conosol:6,consid:3,consol:[1,2,3,5,6],console_namespac:5,consolemock:1,construct:1,contain:[1,3],content:0,context:[2,7],contextmenu:[3,5,6],contextregister:1,continu:3,convers:2,convert:[1,6],convertedcolormap:1,copi:[1,2,3,6],copy_as_html:2,copy_as_latex:2,copy_as_liter:2,copy_as_markdown:2,copy_as_new_spreadsheet:2,copy_as_new_t:2,copy_as_rst_grid:2,copy_as_rst_simpl:2,copy_as_spreadsheet:2,copy_as_t:2,copy_data:3,copy_data_comma_separ:2,copy_data_tab_separ:2,copy_data_with_header_comma_separ:2,copy_data_with_header_tab_separ:2,copy_to_clipboard:2,core:0,count:3,creat:[1,2,5,6],creation:4,csv:[1,6],ctrl:[5,6,7],current:[1,2,3,6,7],current_group:3,current_index:[3,6],current_t:[3,6,7],current_view:1,custom:[3,4,6],cut:2,cut_data:2,data:[1,2,3,4,6,7],data_shown:3,datafram:[1,3,6],dataframegroupbi:3,date:2,date_rang:2,decor:5,def:[3,5,6,7],defin:[2,7],del:[3,6],delet:[1,2,3,6],delete_selected_highlight:2,delete_tab:2,delete_valu:2,deprec:[3,7],desc:[1,2],describ:[1,3,5],descript:7,design:4,df2:6,df:[3,6],dict:[3,5],differ:[4,6],dir:5,directli:6,directori:5,displai:3,dock:[1,2,3,6],drop:2,dropna:2,dtype:[2,3,6],dual:2,e:[1,3],each:5,easili:[4,6],edit:[1,2,3,6],edit_curr:2,editor:3,embed:6,empti:[2,6],emul:3,enabl:[1,3],environ:6,equal:1,equival:1,errorbar:2,eval_prefix:5,evalu:[2,3,5],event:[1,3],excel:[1,3,6],except:0,exceptionhandl:1,execut:[2,7],exist:[3,6],express:2,extend:6,f1:6,factor:[1,3],fals:[1,3],famili:5,far:6,field:[1,2,4,6],figur:2,file:[0,1,3,5,6],fill:2,fill_between:2,fill_betweenx:2,fillna:2,filter:[2,3,4],filter_by_column:2,finder:2,first:5,fix:6,flexibl:3,floatslid:2,floatspinbox:2,focu:2,focus_t:2,follow:[5,6,7],font:5,font_siz:5,foo:3,forc:3,foreground_colormap:3,format:5,formatt:[2,3],four:7,frame:3,from:[1,2,3,5,6,7],from_colormap:1,from_hlsa:1,from_hsva:1,from_html:1,fulli:6,fullscreen:2,func:[1,2,7],g:[1,3],gener:[1,2],get:[1,3,6],get_initi:[1,5],get_loc:3,given:[1,3],global:6,good:3,googl:6,grid:2,grip:3,group:[2,3],groupbi:[2,3],gui:[1,6],gui_onli:3,ha:[5,6,7],handl:[1,6],hashabl:[2,3],have:[6,7],header:[1,2,3,5],headerinfo:1,height:[3,5],here:7,highlight:[2,3,4,6],hist:2,histori:3,history_manag:3,hlsa:1,hook:1,horizont:[2,5,7],hotli:3,hsla:1,hsva:1,html:[1,2],i:[3,7],id:3,identifi:5,iloc:[3,6,7],implement:3,includ:6,index:[1,2,3,4,5,6,7],indic:3,infer:6,inform:1,init:5,initi:[1,3,5],initialize_t:1,initialize_view:1,inplac:2,input:[3,6],insert:[1,2,3,6],insert_column_left:2,insert_column_right:2,insert_row_abov:2,insert_row_below:2,inspir:4,instanc:[1,5,6],int64:6,integ:3,integr:4,interfac:[3,4,6],interv:[2,3],interval_rang:2,invert:[1,2],invert_background_colormap:2,invert_text_colormap:2,invertedcolormap:1,ipython:5,isin:3,item:1,iteminfo:1,iter:[1,2],iter_command:2,its:[1,2,6,7],j:3,join:1,just:[3,6],k:[6,7],kei:[1,2,7],keybind:[5,6],keyboard:6,keycombo:7,keymap:[1,5,6,7],keymapmock:1,kwarg:[1,3],label:[1,3],larg:6,latex:2,launch:[5,6],layer:3,layout:[1,2,3],layoutstr:3,learn:2,left:[2,3],length:3,less:3,like:[1,3,5,6],lineedit:2,list:[1,2,3],liter:[1,2],ll:6,load:[3,5],load_startup_fil:5,loader:3,loc:[1,3],locat:[3,5,7],magicgui:[1,3,4],magicspreadsheet:3,magict:3,magictableview:1,main:[1,3,4,6],make:6,manag:3,mani:[3,6],manner:5,manual:6,map:[1,2,6],markdown:2,max_column_count:5,max_row_count:5,maximum:5,mean:3,melt:2,menu:[2,7],merg:2,metadata:3,method:[1,3,6,7],mock:1,mode:[2,3,4,6],modul:[0,4,5],more:4,most:6,move:[2,3,6],move_iloc:3,move_loc:3,multi:6,must:[3,7],mutabl:3,my:3,my_act:3,my_filter_func:3,my_func:5,my_var:5,myclass:5,name:[1,2,3,5,6,7],name_or_widget:[1,3],namedtupl:[1,2],namespac:3,nan:2,napari:[1,4],nativ:[1,3],ndarrai:3,new_data:6,new_figur:2,new_label:3,new_spreadsheet:2,new_window:2,newli:6,non:[1,3,4],none:[1,2,3,6],normal:1,normalize_color:1,note:[1,2,3],np:[3,5],number:[1,2,3,5],numpi:[2,5],o:3,object:[1,3,5,6,7],obtain:6,old:1,old_valu:1,one:[1,2,3],onli:3,opac:[1,2],opacitycolormap:1,open:[1,2,3],open_sampl:[1,2,3],open_spreadsheet:2,open_t:2,oper:2,optim:2,option:[3,6],origin:3,other:[1,3,6,7],over:3,overlai:3,overlaid:3,overwrit:[3,6],own:7,p:6,packag:[0,4],page:4,palett:[2,5],panda:[3,5,6],paramet:[1,3],parent:[1,3],pass:[5,6],past:[2,3],paste_data:3,paste_data_comma_separ:2,paste_data_from_markdown:2,paste_data_from_numpy_str:2,paste_data_from_rst:2,paste_data_tab_separ:2,path:[1,3,6],pathlib:3,pathlik:3,pd:[1,2,3,6],period:2,period_rang:2,pi:5,pivot:2,pixel:5,place:3,plot:[0,1,3],plotinfo:2,plt:[2,3],plugin:3,plugin_nam:1,point:5,popup:2,posit:[3,6,7],post_init:0,prefix:5,press:[6,7],print:[3,5,6,7],programmat:6,properti:[1,3,6],provid:7,proxi:[2,3],python:[2,4,6],q:6,qbaset:3,qoverlayfram:3,qt:4,qtconsol:[2,3],qtw:3,quickstart:4,qwidget:[1,3],r:1,radiobutton:2,rais:1,raise_slot_error:2,random:2,rang:[1,2,3,6],read:[1,3,6],read_csv:[1,6],read_excel:[1,6],readi:7,reason:6,recoveri:3,redo:2,redo_t:2,ref_prefix:5,refer:[2,5],refresh:3,regist:[1,3,4,6],register_act:7,register_command:2,registr:[5,7],registri:6,reject:6,reload:3,remov:[1,2,3,6],remove_cell_widget:2,remove_dock_widget:[1,3],remove_selected_column:2,remove_selected_row:2,renam:[2,6],rename_tab:2,reset:[1,2,3,5],reset_background_colormap:2,reset_choic:[1,3],reset_proxi:2,reset_text_colormap:2,reset_text_formatt:2,reset_view_mod:2,resiz:[2,3],resize_cells_to_cont:2,respect:5,restructuredtext:2,rgba:1,rgba_to_str:1,right:[1,2,3,6,7],round:2,row:[1,2,3,5,6,7],row_siz:5,rst:2,run:[2,3,5],run_cut:2,run_groupbi:2,s:[1,2],safer:3,same:3,sampl:[1,2,3],sample_nam:[1,3],save:[2,3],save_al:3,save_screenshot:3,save_t:2,scatter:2,scikit:2,scipi:2,screenshot:3,scroll:[1,3],seaborn:[1,3],search:[4,6],see:[5,6],sel:6,select:[0,1,3,4,6],select_al:2,selectionrangeerror:1,selectiontyp:3,sep:3,separ:[2,7],set:[1,2,3,4,5,6],set_background_colormap:2,set_background_colormap_opac:2,set_column_dtyp:2,set_current_view:1,set_dual_h_mod:2,set_dual_v_mod:2,set_popup_mod:2,set_text_colormap:2,set_text_colormap_opac:2,set_text_formatt:2,sever:[6,7],shape:[3,6],sheet:[1,3,4,6],shift:6,shortcut:6,shorter:7,show:[1,2,3,5,6],show_command_palett:2,show_consol:5,show_context_menu:2,show_eval_widget:2,show_filter_widget:2,show_finder_widget:2,show_keymap:2,show_optimizer_widget:2,show_sklearn_widget:2,show_stats_widget:2,show_undo_stack_view:2,shown:[3,6],shuffl:2,shuffle_data_column_wis:2,side:3,signal:2,signatur:7,similar:[3,5,7],similarli:7,simpl:[2,6],sinc:6,size:[3,5],slicabl:6,slice:[1,2,3,6],slider:2,sn:2,so:1,some:6,someth:[3,6],sort:[2,3,4],sort_by_column:2,sort_inplac:2,sourc:[1,2,3],specif:[2,3,7],spinbox:2,spreadsheet:[1,2,3],stack:2,startup:5,stat:2,statu:3,statup:3,store:[5,6],str:[1,2,3],string:[1,3,5,6],stripplot:2,strongli:4,structur:6,style:2,subclass:1,submenu:7,submodul:0,subpackag:0,sum:5,summar:2,summarize_t:2,support:[5,6,7],supportkeymap:3,suppos:7,swap:2,swap_tab_with_left:2,swap_tab_with_right:2,swarmplot:2,switch_column:2,switch_index:2,switch_layout:2,syntax:7,t:[3,6],tab:[0,1,5,6],tab_posit:[1,3],tabl:[0,1,3,5,7],table_shap:3,table_typ:3,tablebas:[1,3,7],tablecolumn:1,tabledata:1,tabledatatupl:1,tabledisplai:3,tableinfo:1,tableiniti:1,tablelist:3,tabletyp:3,tableview:[1,3,5,6,7],tableviewerbas:[1,2,3,7],tableviewersign:[1,3],tableviewerwidget:[1,3],tabposit:[1,3],tabul:[5,6,7],take:[1,6],task:3,tbl:6,test:5,text:[2,3],text_color:3,text_formatt:3,th:6,thi:[1,3,4,6,7],thread:1,thu:3,tile:2,tile_t:2,tile_with_adjacent_t:2,time:5,timedelta:2,timedelta_rang:2,tip:3,titl:[1,2],togeth:1,toggl:2,toggle_consol:2,toggle_edit:2,toggle_focu:2,toggle_fullscreen:2,toggle_toolbar:2,too:6,tool:6,toolbar:[2,3,6],tooltip:[1,3],top:[1,2,3],topleft:3,traceback:2,tracebacktyp:1,train:4,transpos:2,tupl:[1,2,3,7],two:[2,5],type:[0,3,6],u:[5,6,7],ui:3,under:7,undo:[2,3],undo_manag:3,undo_t:2,undomanag:3,union:[1,3],unless:6,unlimit:6,unpivot:2,until:[2,7],untile_t:2,updat:[1,3,6],us:[1,3,4,7],user:[2,4,5,7],valid:[2,3],valu:[1,2,3,6,7],valueerror:1,variabl:5,varieti:6,version:[5,6,7],vertic:[2,5,7],via:[3,6],view:[0,1,3,4,6],view_mod:3,view_spreadsheet:1,view_tabl:1,viewer:[1,2,3,4,7],vieweriniti:1,viewmod:3,violinplot:2,virtual:6,visibl:[1,2,3,6],wai:[1,6,7],want:7,what:5,when:[1,3,5,6],where:1,whether:3,which:7,widget:[0,1,2,6,7],width:[3,5],window:[0,1,4,5,6],wise:4,work:7,write:2,write_data_reference_in_consol:2,write_data_signal_in_consol:2,write_slice_in_consol:2,wrong:[1,6],x:[1,5],xlsx:6,xxx:7,y:1,you:[3,5,6,7],your:7,zero:3,zoom:3},titles:["tabulous","tabulous package","tabulous.commands package","tabulous.widgets package","tabulous","Customize Viewer Actions","Quickstart","Register Custom Actions"],titleterms:{A:6,For:6,action:[5,7],an:6,analysi:2,bar:7,cell:7,color:1,column:2,combo:6,command:[2,6,7],config:5,content:[1,2,3,4,6,7],contextmenu:7,cooper:4,core:1,custom:[5,7],detail:6,edit:5,except:1,file:2,header:7,indic:4,interpret:6,kei:6,keybind:7,list:6,method:5,modul:[1,2,3],more:6,namespac:5,open:6,other:4,packag:[1,2,3],palett:[6,7],plot:2,post_init:[1,5],py:5,quickstart:6,regist:[5,7],select:2,spreadsheet:6,submodul:[1,2],subpackag:1,tab:[2,7],tabl:[2,4,6],tabul:[0,1,2,3,4],toml:5,type:1,updat:5,us:[5,6],view:2,viewer:[5,6],widget:[3,4],window:2}}) +Search.setIndex({docnames:["apidoc/modules","apidoc/tabulous","apidoc/tabulous.commands","apidoc/tabulous.style","apidoc/tabulous.widgets","font","index","main/cheat_sheet","main/columnwise_settings","main/customize","main/integrate_custom_widgets","main/non_mainwindow","main/quickstart","main/register_action","main/selections","main/sort_filter","main/table_fields","main/table_view_mode","main/user_interface"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":5,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["apidoc\\modules.rst","apidoc\\tabulous.rst","apidoc\\tabulous.commands.rst","apidoc\\tabulous.style.rst","apidoc\\tabulous.widgets.rst","font.rst","index.rst","main\\cheat_sheet.rst","main\\columnwise_settings.rst","main\\customize.rst","main\\integrate_custom_widgets.rst","main\\non_mainwindow.rst","main\\quickstart.rst","main\\register_action.rst","main\\selections.rst","main\\sort_filter.rst","main\\table_fields.rst","main\\table_view_mode.rst","main\\user_interface.rst"],objects:{"":[[1,0,0,"-","tabulous"]],"tabulous.MagicTableViewer":[[1,2,1,"","native"]],"tabulous.TableViewer":[[1,3,1,"","add_dock_widget"],[1,2,1,"","config"],[1,4,1,"","events"],[1,3,1,"","remove_dock_widget"],[1,3,1,"","reset_choices"]],"tabulous.TableViewerWidget":[[1,3,1,"","add_widget"],[1,4,1,"","events"]],"tabulous.color":[[1,1,1,"","BrightenedColormap"],[1,1,1,"","ColorTuple"],[1,1,1,"","ConvertedColormap"],[1,1,1,"","InvertedColormap"],[1,1,1,"","OpacityColormap"],[1,5,1,"","normalize_color"],[1,5,1,"","rgba_to_str"]],"tabulous.color.BrightenedColormap":[[1,3,1,"","from_colormap"]],"tabulous.color.ColorTuple":[[1,4,1,"","a"],[1,4,1,"","b"],[1,3,1,"","brighten"],[1,3,1,"","equals"],[1,3,1,"","from_hlsa"],[1,3,1,"","from_hsva"],[1,3,1,"","from_html"],[1,4,1,"","g"],[1,2,1,"","hlsa"],[1,2,1,"","hsva"],[1,2,1,"","html"],[1,3,1,"","mix"],[1,2,1,"","opacity"],[1,4,1,"","r"]],"tabulous.color.InvertedColormap":[[1,3,1,"","from_colormap"]],"tabulous.color.OpacityColormap":[[1,3,1,"","from_colormap"]],"tabulous.commands":[[2,0,0,"-","analysis"],[2,0,0,"-","column"],[2,0,0,"-","file"],[2,5,1,"","iter_commands"],[2,0,0,"-","plot"],[2,5,1,"","register_command"],[2,0,0,"-","selection"],[2,0,0,"-","tab"],[2,0,0,"-","table"],[2,0,0,"-","view"],[2,0,0,"-","window"]],"tabulous.commands.analysis":[[2,5,1,"","show_eval_widget"],[2,5,1,"","show_filter_widget"],[2,5,1,"","show_optimizer_widget"],[2,5,1,"","show_sklearn_widget"],[2,5,1,"","show_stats_widget"],[2,5,1,"","summarize_table"]],"tabulous.commands.column":[[2,5,1,"","adjust_brightness_background_colormap"],[2,5,1,"","adjust_brightness_text_colormap"],[2,5,1,"","invert_background_colormap"],[2,5,1,"","invert_text_colormap"],[2,5,1,"","reset_background_colormap"],[2,5,1,"","reset_text_colormap"],[2,5,1,"","reset_text_formatter"],[2,5,1,"","run_cut"],[2,5,1,"","run_groupby"],[2,5,1,"","set_background_colormap"],[2,5,1,"","set_background_colormap_opacity"],[2,5,1,"","set_text_colormap"],[2,5,1,"","set_text_colormap_opacity"],[2,5,1,"","set_text_formatter"]],"tabulous.commands.file":[[2,5,1,"","open_sample"],[2,5,1,"","open_spreadsheet"],[2,5,1,"","open_table"],[2,5,1,"","save_table"]],"tabulous.commands.plot":[[2,1,1,"","PlotInfo"],[2,5,1,"","bar"],[2,5,1,"","barplot"],[2,5,1,"","boxenplot"],[2,5,1,"","boxplot"],[2,5,1,"","errorbar"],[2,5,1,"","fill_between"],[2,5,1,"","fill_betweenx"],[2,5,1,"","hist"],[2,5,1,"","new_figure"],[2,5,1,"","plot"],[2,5,1,"","scatter"],[2,5,1,"","stripplot"],[2,5,1,"","swarmplot"],[2,5,1,"","violinplot"]],"tabulous.commands.plot.PlotInfo":[[2,4,1,"","columns"],[2,4,1,"","names"]],"tabulous.commands.selection":[[2,5,1,"","add_checkbox"],[2,5,1,"","add_float_slider"],[2,5,1,"","add_float_spinbox"],[2,5,1,"","add_highlight"],[2,5,1,"","add_line_edit"],[2,5,1,"","add_radio_button"],[2,5,1,"","add_slider"],[2,5,1,"","add_spinbox"],[2,5,1,"","copy_as_html"],[2,5,1,"","copy_as_latex"],[2,5,1,"","copy_as_literal"],[2,5,1,"","copy_as_markdown"],[2,5,1,"","copy_as_new_spreadsheet"],[2,5,1,"","copy_as_new_table"],[2,5,1,"","copy_as_rst_grid"],[2,5,1,"","copy_as_rst_simple"],[2,5,1,"","copy_data_comma_separated"],[2,5,1,"","copy_data_tab_separated"],[2,5,1,"","copy_data_with_header_comma_separated"],[2,5,1,"","copy_data_with_header_tab_separated"],[2,5,1,"","cut_data"],[2,5,1,"","delete_selected_highlight"],[2,5,1,"","delete_values"],[2,5,1,"","edit_current"],[2,5,1,"","filter_by_columns"],[2,5,1,"","insert_column_left"],[2,5,1,"","insert_column_right"],[2,5,1,"","insert_row_above"],[2,5,1,"","insert_row_below"],[2,5,1,"","paste_data_comma_separated"],[2,5,1,"","paste_data_from_markdown"],[2,5,1,"","paste_data_from_numpy_string"],[2,5,1,"","paste_data_from_rst"],[2,5,1,"","paste_data_tab_separated"],[2,5,1,"","raise_slot_error"],[2,5,1,"","remove_cell_widgets"],[2,5,1,"","remove_selected_columns"],[2,5,1,"","remove_selected_rows"],[2,5,1,"","select_all"],[2,5,1,"","set_column_dtype"],[2,5,1,"","show_context_menu"],[2,5,1,"","shuffle_data_column_wise"],[2,5,1,"","sort_by_columns"],[2,5,1,"","sort_inplace"],[2,5,1,"","write_data_reference_in_console"],[2,5,1,"","write_data_signal_in_console"],[2,5,1,"","write_slice_in_console"]],"tabulous.commands.tab":[[2,5,1,"","activate_left"],[2,5,1,"","activate_right"],[2,5,1,"","delete_tab"],[2,5,1,"","rename_tab"],[2,5,1,"","swap_tab_with_left"],[2,5,1,"","swap_tab_with_right"],[2,5,1,"","tile_tables"],[2,5,1,"","tile_with_adjacent_table"],[2,5,1,"","untile_table"]],"tabulous.commands.table":[[2,5,1,"","concat"],[2,5,1,"","copy_as_spreadsheet"],[2,5,1,"","copy_as_table"],[2,5,1,"","copy_to_clipboard"],[2,5,1,"","date_range"],[2,5,1,"","dropna"],[2,5,1,"","fillna"],[2,5,1,"","interval_range"],[2,5,1,"","melt"],[2,5,1,"","merge"],[2,5,1,"","new_spreadsheet"],[2,5,1,"","period_range"],[2,5,1,"","pivot"],[2,5,1,"","random"],[2,5,1,"","redo_table"],[2,5,1,"","reset_proxy"],[2,5,1,"","resize_cells_to_contents"],[2,5,1,"","round"],[2,5,1,"","show_finder_widget"],[2,5,1,"","show_undo_stack_view"],[2,5,1,"","switch_columns"],[2,5,1,"","switch_index"],[2,5,1,"","switch_layout"],[2,5,1,"","timedelta_range"],[2,5,1,"","toggle_editability"],[2,5,1,"","transpose"],[2,5,1,"","undo_table"],[2,5,1,"","zoom_in"],[2,5,1,"","zoom_out"]],"tabulous.commands.view":[[2,5,1,"","reset_view_mode"],[2,5,1,"","set_dual_h_mode"],[2,5,1,"","set_dual_v_mode"],[2,5,1,"","set_popup_mode"]],"tabulous.commands.window":[[2,5,1,"","add_text_edit"],[2,5,1,"","close_window"],[2,5,1,"","focus_table"],[2,5,1,"","new_window"],[2,5,1,"","show_command_palette"],[2,5,1,"","show_keymap"],[2,5,1,"","show_preference"],[2,5,1,"","toggle_console"],[2,5,1,"","toggle_focus"],[2,5,1,"","toggle_fullscreen"],[2,5,1,"","toggle_toolbar"]],"tabulous.core":[[1,5,1,"","current_viewer"],[1,5,1,"","open_sample"],[1,5,1,"","read_csv"],[1,5,1,"","read_excel"],[1,5,1,"","set_current_viewer"],[1,5,1,"","view_spreadsheet"],[1,5,1,"","view_table"]],"tabulous.exceptions":[[1,1,1,"","ExceptionHandler"],[1,6,1,"","SelectionRangeError"]],"tabulous.post_init":[[1,1,1,"","CellNamespaceMock"],[1,1,1,"","CommandPaletteMock"],[1,1,1,"","ConsoleMock"],[1,1,1,"","ContextRegisterable"],[1,1,1,"","Initializer"],[1,1,1,"","KeyMapMock"],[1,1,1,"","TableInitializer"],[1,1,1,"","ViewerInitializer"],[1,5,1,"","get_initializers"]],"tabulous.post_init.CommandPaletteMock":[[1,3,1,"","register"]],"tabulous.post_init.ContextRegisterable":[[1,3,1,"","register"]],"tabulous.post_init.Initializer":[[1,3,1,"","join"]],"tabulous.post_init.KeyMapMock":[[1,3,1,"","register"]],"tabulous.post_init.TableInitializer":[[1,4,1,"","cell"],[1,4,1,"","columns"],[1,4,1,"","index"],[1,3,1,"","initialize_table"],[1,4,1,"","keymap"]],"tabulous.post_init.ViewerInitializer":[[1,4,1,"","cell_namespace"],[1,4,1,"","command_palette"],[1,4,1,"","console"],[1,3,1,"","initialize_viewer"],[1,4,1,"","keymap"],[1,4,1,"","tables"]],"tabulous.style":[[3,1,1,"","Style"]],"tabulous.style.Style":[[3,4,1,"","background"],[3,4,1,"","background0"],[3,4,1,"","background1"],[3,4,1,"","base_color"],[3,4,1,"","cell_highlight"],[3,4,1,"","cell_selection"],[3,4,1,"","foreground"],[3,3,1,"","format_file"],[3,3,1,"","format_text"],[3,3,1,"","from_global"],[3,4,1,"","highlight0"],[3,4,1,"","highlight1"]],"tabulous.types":[[1,1,1,"","HeaderInfo"],[1,1,1,"","ItemInfo"],[1,5,1,"","TableColumn"],[1,5,1,"","TableData"],[1,5,1,"","TableDataTuple"],[1,1,1,"","TableInfo"]],"tabulous.types.HeaderInfo":[[1,4,1,"","index"],[1,4,1,"","old_value"],[1,4,1,"","value"]],"tabulous.types.ItemInfo":[[1,4,1,"","DELETED"],[1,4,1,"","INSERTED"],[1,2,1,"","col"],[1,4,1,"","column"],[1,4,1,"","old_value"],[1,4,1,"","row"],[1,4,1,"","value"]],"tabulous.widgets":[[4,1,1,"","GroupBy"],[4,1,1,"","MagicSpreadSheet"],[4,1,1,"","MagicTable"],[4,1,1,"","SpreadSheet"],[4,1,1,"","Table"],[4,1,1,"","TableBase"],[4,1,1,"","TableDisplay"],[4,1,1,"","TableViewer"],[4,1,1,"","TableViewerBase"],[4,1,1,"","TableViewerWidget"]],"tabulous.widgets.GroupBy":[[4,2,1,"","current_group"]],"tabulous.widgets.MagicSpreadSheet":[[4,2,1,"","native"]],"tabulous.widgets.MagicTable":[[4,2,1,"","native"]],"tabulous.widgets.SpreadSheet":[[4,3,1,"","add_item_widget"],[4,4,1,"","dtypes"]],"tabulous.widgets.TableBase":[[4,3,1,"","add_overlay_widget"],[4,3,1,"","add_side_widget"],[4,4,1,"","background_color"],[4,3,1,"","background_colormap"],[4,4,1,"","cell"],[4,2,1,"","cellref"],[4,4,1,"","columns"],[4,2,1,"","data"],[4,2,1,"","data_shown"],[4,2,1,"","editable"],[4,2,1,"","filter"],[4,3,1,"","foreground_colormap"],[4,4,1,"","formatter"],[4,4,1,"","highlights"],[4,4,1,"","iloc"],[4,4,1,"","index"],[4,2,1,"","layout"],[4,4,1,"","loc"],[4,2,1,"","metadata"],[4,3,1,"","move_iloc"],[4,3,1,"","move_loc"],[4,2,1,"","mutable"],[4,2,1,"","name"],[4,2,1,"","native"],[4,4,1,"","plt"],[4,4,1,"","proxy"],[4,3,1,"","refresh"],[4,3,1,"","save"],[4,3,1,"","save_screenshot"],[4,3,1,"","screenshot"],[4,4,1,"","selections"],[4,2,1,"","source"],[4,2,1,"","table_shape"],[4,2,1,"","table_type"],[4,4,1,"","text_color"],[4,4,1,"","text_formatter"],[4,2,1,"","undo_manager"],[4,4,1,"","validator"],[4,2,1,"","view_mode"],[4,2,1,"","zoom"]],"tabulous.widgets.TableDisplay":[[4,2,1,"","interval"],[4,2,1,"","loader"],[4,2,1,"","running"]],"tabulous.widgets.TableViewer":[[4,3,1,"","add_dock_widget"],[4,2,1,"","config"],[4,4,1,"","events"],[4,3,1,"","remove_dock_widget"],[4,3,1,"","reset_choices"]],"tabulous.widgets.TableViewerBase":[[4,3,1,"","add_groupby"],[4,3,1,"","add_layer"],[4,3,1,"","add_loader"],[4,3,1,"","add_spreadsheet"],[4,3,1,"","add_table"],[4,2,1,"","cell_namespace"],[4,3,1,"","close"],[4,4,1,"","command_palette"],[4,4,1,"","console"],[4,3,1,"","copy_data"],[4,2,1,"","current_index"],[4,2,1,"","current_table"],[4,4,1,"","events"],[4,2,1,"","history_manager"],[4,2,1,"","native"],[4,3,1,"","open"],[4,3,1,"","open_sample"],[4,3,1,"","paste_data"],[4,3,1,"","resize"],[4,3,1,"","save"],[4,3,1,"","save_all"],[4,3,1,"","save_screenshot"],[4,3,1,"","screenshot"],[4,3,1,"","show"],[4,2,1,"","size"],[4,2,1,"","status"],[4,2,1,"","tables"],[4,2,1,"","theme"],[4,4,1,"","toolbar"]],"tabulous.widgets.TableViewerWidget":[[4,3,1,"","add_widget"],[4,4,1,"","events"]],tabulous:[[1,1,1,"","MagicTableViewer"],[1,1,1,"","TableViewer"],[1,1,1,"","TableViewerWidget"],[1,0,0,"-","color"],[2,0,0,"-","commands"],[1,0,0,"-","core"],[1,5,1,"","current_viewer"],[1,0,0,"-","exceptions"],[1,5,1,"","open_sample"],[1,0,0,"-","post_init"],[1,5,1,"","read_csv"],[1,5,1,"","read_excel"],[3,0,0,"-","style"],[1,0,0,"-","types"],[1,5,1,"","view_spreadsheet"],[1,5,1,"","view_table"],[4,0,0,"-","widgets"]]},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","property","Python property"],"3":["py","method","Python method"],"4":["py","attribute","Python attribute"],"5":["py","function","Python function"],"6":["py","exception","Python exception"]},objtypes:{"0":"py:module","1":"py:class","2":"py:property","3":"py:method","4":"py:attribute","5":"py:function","6":"py:exception"},terms:{"0":[1,2,4,7,8,9,10,12,13,14,15,16,17,18],"0th":17,"1":[1,2,4,8,9,12,13,14,15,16,17,18],"10":[4,12,14,15,16,18],"100":14,"14159265359":9,"1st":17,"2":[1,4,8,12,13,14,15,16,17,18],"20":[12,18],"255":[1,8],"2f":[8,16],"3":[1,4,8,9,12,14,15,16,17,18],"30":18,"4":[4,9,12,13,14,15,16,18],"40":18,"5":[1,4,8,10,12,14,15,16,18],"6":[4,8,12,14,15],"60":18,"7":[14,15],"8":[1,4,8,15,16,18],"9":[14,15,18],"95":14,"96":14,"97":14,"98":14,"99":14,"boolean":[4,15],"break":8,"byte":4,"case":[8,13,15,16],"class":[1,2,3,4,9,10,11,18],"default":[1,4,8,9,10,12,15,16,18],"do":[4,8,12,14,18],"float":[1,4,8,12,16],"function":[2,4,9,11,12,13,14,16,18],"import":[8,9,10,11,12,13,16,18],"int":[1,4,8,13],"long":18,"new":[1,2,8,9,10,12,15,16,18],"return":[1,4,8,9,10,11,15,16,17,18],"super":[10,11],"switch":[2,18],"true":[1,4,8,11,12],"while":[10,15,17],A:[1,4,8,11,14,15,16,17,18],As:[8,18],By:18,For:[8,11,14,16,17,18],If:[1,4,11,12,13,15,17,18],In:[8,10,11,12,13,15,17,18],It:[4,8,12],Its:18,NOT:[8,18],One:18,The:[1,4,8,9,11,12,13,14,15,16,18],There:[8,10],These:15,To:[4,8,9,11,14,16,17,18],_:[1,4,8,18],__all__:18,__init__:[10,11],__setitem__:8,_abstractview:4,_dataframetablelay:4,_keymap_abc:4,_mainwindow:[1,4],_on_chang:14,_qtmainwidgetbas:4,_register:1,_singleselect:4,_sourc:4,_style:3,_t:1,_tabl:4,_tablelik:4,_tablelist:4,_updat:1,_widget:[1,4],a0:15,a1:[15,18],a2:15,a3:15,a4:18,about:8,abov:[2,8,11,18],access:[4,16],accordingli:[6,12],achiev:6,acit:12,action:[4,6,16,18],activ:[2,4,10,12,18],activate_left:2,activate_right:2,actual:9,ad:[4,9,10,12,15,18],add:[1,2,4,9,12],add_checkbox:2,add_dock_widget:[1,4,7,10],add_float_slid:2,add_float_spinbox:2,add_groupbi:4,add_highlight:2,add_imag:7,add_item_widget:4,add_lay:4,add_line_edit:2,add_load:4,add_overlay_widget:[4,10],add_radio_button:2,add_side_widget:[4,10],add_slid:2,add_spinbox:2,add_spreadsheet:[4,8,12,16],add_tabl:[4,7,8,12,13,17],add_text_edit:2,add_widget:[1,4],addit:[1,12],addwidget:11,adjac:[2,18],adjust:[2,8],adjust_bright:8,adjust_brightness_background_colormap:2,adjust_brightness_text_colormap:2,affect:[8,17,18],after:[8,15],aim:11,alia:[1,2,10],all:[1,2,4,8,11,12,13,16,18],allow:[1,4,9,11,18],allowed_area:[1,4],alpha:[1,8],also:[4,8,9,10,11,12,13,14,15,16,17,18],alt:18,alwai:[10,14,15,18],an:[1,2,4,8,10,13,18],analysi:[0,1,16,18],anchor:15,ani:[1,2,4,6,8,18],anoth:[1,11,14],api:[6,15,16],appear:17,append:[10,11,14],appli:[4,8,10,15],applic:9,appropri:[8,18],ar:[4,8,9,10,11,12,13,14,15,16,17,18],arang:16,area:[1,4,18],arg:[1,4],argsort:15,argument:[8,10,15],arrai:[4,8,10,15,18],arrow:18,ascend:[4,15],ask:9,ask_on_clos:9,attribut:[1,4,6,9,12,13,14],auto:15,automat:[9,18],avail:[4,8,9,10,11,12,16,18],avoid:[4,11],axi:4,b:[1,4,8,12,15,16,17,18],backend:[1,4,11],background0:3,background1:3,background:[2,3,8,16],background_color:[4,8],background_colormap:4,bar:[1,2,4,9,17,18],barplot:2,base:[1,2,3,4,6,8,12],base_color:3,basic:[8,9,16],becaus:[8,15],becom:8,befor:[4,9,17],beginn:6,behav:[4,12,16],behavior:18,being:15,below:[2,15],benefit:11,better:[8,11],between:[1,2,8,14,18],bin:2,bind:[12,14],bit:[1,16],blue:8,bool:[1,4,10],border:18,both:[13,15],bottom:4,box:[1,4],boxenplot:2,boxplot:2,bright:[2,8],brighten:1,brightenedcolormap:1,brighter:8,brows:15,button:[12,15,18],c:[4,8,11,12,17],calcul:18,call:[8,14,15,17,18],callabl:[1,2,4],callback:14,can:[1,4,8,9,10,11,12,13,14,15,16,17,18],cannot:14,canva:[2,10,16,18],canvas:16,care:8,categor:8,categori:[8,16],caus:[1,18],cell:[1,2,4,8,9,12,14],cell_highlight:3,cell_namespac:[1,4,9,18],cell_select:3,cellnamespacemock:1,cellref:4,central:10,chang:[8,11,17,18],channel:[1,8],chapter:8,charact:18,characterist:8,chart:[4,10],cheat:6,check:[4,9,10,12,16,18],checkbox:2,child:[1,4,11],classmethod:[1,3],click:[8,9,12,13,14,15,17,18],clipboard:[4,18],close:[2,4,9],close_window:2,cluster:18,cm:[8,16],cmap:[1,8,16],col:[1,18],collect:15,color:[0,16,18],colormap:[1,2,16],colortupl:1,column:[0,1,4,6,9,12,13,14],column_nam:16,column_s:9,columndtypeinterfac:16,columnwis:2,combo:[1,4,13,17,18],combobox:10,comma:2,command:[0,1,4,9,18],command_palett:[1,4,9,13],commandpalettemock:1,common:[15,16],compat:[1,11],complet:15,complic:16,compon:[9,13],compos:8,concat:2,concaten:2,conda:12,config:[1,4],configur:9,conflict:11,confus:16,connect:[2,11,14],conosol:12,consid:[4,8,18],consol:[1,2,4,9,11,12,18],console_namespac:9,consolemock:1,construct:1,contain:[1,4,11,18],content:0,context:[2,8,13,14],contextmenu:[4,9,12,15,16],contextregister:1,continu:[4,8],contrast:8,convers:[2,8],convert:[1,8,12,14],convertedcolormap:1,coordin:10,copi:[1,2,4,11,12,16,18],copy_as_html:2,copy_as_latex:2,copy_as_liter:2,copy_as_markdown:2,copy_as_new_spreadsheet:2,copy_as_new_t:2,copy_as_rst_grid:2,copy_as_rst_simpl:2,copy_as_spreadsheet:2,copy_as_t:2,copy_data:4,copy_data_comma_separ:2,copy_data_tab_separ:2,copy_data_with_header_comma_separ:2,copy_data_with_header_tab_separ:2,copy_to_clipboard:2,core:0,corner:15,correspond:[8,14],count:4,creat:[1,2,9,12,18],creation:6,csv:[1,12],ctrl:[9,10,11,12,13,17,18],cumsum:18,current:[1,2,4,8,12,13,17,18],current_group:4,current_index:[4,12],current_t:[4,12,13,15],current_view:1,custom:[4,6,8,12,16],cut:[2,18],cut_data:2,d:15,darker:8,data:[1,2,4,6,8,10,11,12,13,16,17],data_shown:4,datafram:[1,4,10,12,14,15,16],dataframegroupbi:4,date:2,date_rang:2,datetim:[8,16],datetime64:8,decid:16,decomposit:18,decor:[9,15,16],def:[4,8,9,10,11,12,13,14,15,16,18],defin:[2,13,16,17],del:[4,8,12,16],delet:[1,2,4,12,16],delete_selected_highlight:2,delete_tab:2,delete_valu:2,deprec:[4,13],desc:[1,2],descend:15,describ:[1,4,9],descript:13,design:[6,11],desir:18,destin:18,detail:[11,15,16],determin:[8,16],deviat:18,df2:12,df:[4,7,12,14,15,16,18],dialog:[2,8,15,18],dict:[4,8,9,16,18],differ:[6,8,11,12,14,18],dir:9,direct:18,directli:[12,14,15,16,18],directori:[9,18],discret:8,displai:[4,8,16],divid:8,dock:[1,2,4,12,17],doe:[11,16,18],doesn:[8,15],don:18,done:18,doubl:18,drag:18,drawback:8,drop:[2,18],dropna:2,dtype:[2,4,8,12],dual:[2,18],duplic:18,dure:18,dynam:14,e:[1,4,15],each:[8,9,10,14,16,17],easiest:18,easili:[6,11,12],edit:[1,2,4,8,12,16,17],edit_curr:2,editor:[4,8,18],effici:17,els:8,embed:[11,12,18],emit:14,empti:[2,12],emul:4,enabl:[1,4,17],enough:8,environ:12,equal:[1,8],equival:[1,15,16,18],errorbar:2,especi:[8,16,18],essenti:[15,18],etc:18,eval:[15,18],eval_prefix:9,evalu:[2,4,9],event:[1,4,14],everi:[8,10,14],exampl:[8,10,11,15],excel:[1,4,10,12],except:[0,8],exceptionhandl:1,execut:[2,13,18],exist:[4,8,12,17],expect:18,express:[2,18],extend:12,extens:11,extern:11,f1:12,f2:18,f3:18,f:[8,10,16],factor:[1,4],fals:[1,4,15],famili:9,far:12,featur:14,field:[1,2,6,8,10,11,12],figur:[2,18],file:[0,1,3,4,9,11,12,18],file_edit:11,fileedit:11,fill:2,fill_between:2,fill_betweenx:2,fillna:2,filter:[2,4,6,16,18],filter_by_column:2,filter_func:15,find:18,finder:[2,18],first:[9,18],fix:12,flexibl:4,float64:16,floatslid:2,floatspinbox:2,fmt:16,focu:[2,17,18],focus_t:2,follow:[8,9,11,12,13,14,15,16,18],font:9,font_siz:9,foo:4,forc:4,foreground:3,foreground_colormap:4,format:[8,9,16],format_fil:3,format_text:3,formatt:[2,4],four:13,frame:4,from:[1,2,4,8,9,10,11,12,13,14,15,16,18],from_colormap:1,from_glob:3,from_hlsa:1,from_hsva:1,from_html:1,fulli:12,fullscreen:2,func:[1,2,10,13,18],futur:18,g:[1,4],gener:[1,2,8],get:[1,4,8,12,14,16,18],get_initi:[1,9],get_loc:[4,16],give:10,given:[1,4],global:12,good:4,googl:[12,18],grai:8,green:8,grid:2,grip:4,group:[2,4],groupbi:[2,4,18],gui:[1,12],gui_onli:4,h:[10,17],ha:[9,10,11,12,13,16],handl:[1,12],hashabl:[2,4],have:[11,12,13,14,15,18],header:[1,2,4,8,9,16],headerinfo:1,height:[4,9],help:18,here:[13,15],highlight0:3,highlight1:3,highlight:[2,4,6,12,15],highlighten:14,hist:[2,16,18],histogram:18,histori:[4,15],history_manag:4,hlsa:1,hook:1,horizont:[2,9,13,17,18],hotli:4,how:11,howev:18,hsla:1,hsva:1,html:[1,2],i:[4,13,15,17],id:4,ident:8,identifi:9,iloc:[4,12,13,14,16],imag:[7,10],imagedata:10,immedi:16,implement:[4,8,10,16],includ:[8,12,16],independ:17,index:[1,2,4,6,8,9,12,13],index_nam:16,indic:[4,15,17],individu:8,infer:12,inferno:8,info:[1,4],inform:[1,10],init:9,initi:[1,4,9],initialize_t:1,initialize_view:1,inplac:2,input:[4,8,12,18],insert:[1,2,4,12,18],insert_column_left:2,insert_column_right:2,insert_row_abov:2,insert_row_below:2,insid:[17,18],inspect:[15,17],inspir:6,instanc:[1,9,11,12,14,16,17,18],instead:[8,10,15,18],int64:[8,12],integ:4,integr:[6,11],interact:[10,16,18],interfac:[4,6,12],interg:15,intermediari:15,interp_from:8,interpret:[8,10,15,16,18],interv:[2,4],interval_rang:2,invalid:[8,18],invert:[1,2,8],invert_background_colormap:2,invert_text_colormap:2,invertedcolormap:1,ipython:9,iri:[8,14],isin:4,item:[1,16,18],iteminfo:1,iter:[1,2],iter_command:2,its:[1,2,8,12,13,18],itself:8,j:4,join:1,just:[4,8,12,15],k:[12,13,17],kei:[1,2,13,17,18],keybind:[9,12,18],keyboard:[12,14,18],keycombo:13,keyerror:16,keymap:[1,9,12,13],keymapmock:1,kwarg:[1,4],label:[1,4,8,10,15],larg:[12,17],last:18,latex:2,launch:[9,12],layer:[4,10],layout:[1,2,4,11,18],layoutstr:4,learn:[2,18],left:[2,4,10],length:[4,8],less:4,let:17,like:[1,4,8,9,12,14,15,16,18],limit:8,line:[15,18],linearli:8,lineedit:2,list:[1,2,4,8,10,14,17],liter:[1,2,18],ll:[8,12,14,15],lmax:8,lmin:8,load:[4,9,11],load_data:11,load_startup_fil:9,loader:4,loc:[1,4,16,18],locat:[4,9,10,13],look:15,loss:18,lrang:8,mac:18,magic:[1,4,11],magicclass:11,magicgui:[1,4,6],magicspreadsheet:4,magict:4,magictableview:[1,11],mai:[16,18],main:[1,4,6,12],make:[8,12,18],manag:[4,15,18],mani:[4,8,11,12,18],manner:9,manual:12,map:[1,2,8,12,15,16],mappingproxi:[1,4],markdown:2,match:18,matplotlib:[10,16,18],matter:10,max:[8,10],max_column_count:9,max_row_count:9,maximum:[8,9],mean:[4,10,16,18],melt:[2,18],menu:[2,8,13,14],merg:2,metadata:4,method:[1,4,8,10,12,13,14,15,16],microsoft:18,might:8,min:[8,10],minim:18,minimum:8,mininum:8,mix:1,mock:1,mode:[2,4,6,11,12,18],modifi:18,modul:[0,6,9,16,18],more:[6,8,11,14,16,18],most:[12,15,18],mous:[14,18],move:[2,4,12],move_iloc:4,move_loc:4,much:[8,11],multi:[12,15],must:[4,8,13],mutabl:4,my:[4,10],my_act:4,my_filter_func:4,my_func:9,my_var:9,myclass:9,myqwidget:11,mywidget:[10,11],n:17,name:[1,2,3,4,7,8,9,10,12,13,16,17,18],name_or_widget:[1,4],namedtupl:[1,2],namespac:4,nan:2,napari:[1,6,10],nativ:[1,4,11],ndarrai:[4,10],necessari:8,neg:8,new_cmap:8,new_data:12,new_figur:2,new_label:4,new_spreadsheet:2,new_window:2,newli:12,next:17,non:[1,4,6],none:[1,2,3,4,10,12,14,18],normal:[1,17],normalize_color:1,note:[1,2,4],now:18,np:[4,8,9,10,16,18],number:[1,2,4,8,9],numpi:[2,9,18],o:4,object:[1,3,4,8,9,12,13,14,16,18],obtain:[8,12,16],occasion:16,offic:18,old:1,old_valu:1,one:[1,2,4,10,11,17,18],ones:8,onli:[4,15],opac:[1,2,8],opacitycolormap:1,open:[1,2,4,10,11,14,15,18],open_sampl:[1,2,4,8,14],open_spreadsheet:2,open_t:2,oper:[2,10,14,15,16,17],optim:[2,18],option:[1,4,8,12],order:15,organ:16,origin:[4,15,17],other:[1,4,8,11,12,13,17],out:18,output:8,outsid:10,over:[4,10],overlai:[4,15],overlaid:4,overwrit:[4,12],own:[8,13],p:[12,17],packag:[0,6,11],page:6,paint:[8,14],palett:[2,9,18],panda:[4,8,9,12,15,16,18],paramet:[1,4],parent:[1,4,10],part:17,partial:[8,18],pass:[8,9,12,15],past:[2,4,11,15,18],paste_data:4,paste_data_comma_separ:2,paste_data_from_markdown:2,paste_data_from_numpy_str:2,paste_data_from_rst:2,paste_data_tab_separ:2,path:[1,3,4,11,12],pathlib:[4,11],pathlik:4,pd:[1,2,4,8,10,12,18],peopl:18,perform:18,period:2,period_rang:2,pi:9,pivot:[2,18],pixel:9,place:[4,10],plan:11,plot:[0,1,4,10,16],plotinfo:2,plt:[2,4,10,18],plugin:4,plugin_nam:1,point:9,pop:14,popup:[2,11,18],posit:[4,8,12,13],post_init:0,prefer:2,prefix:9,press:[10,12,13],preview:8,print:[4,8,9,10,12,13,14,16],problem:[8,11],profil:18,programat:14,programmat:[11,12,16,17],properli:15,properti:[1,4,11,12,14,17,18],provid:[8,13,16],proxi:[2,4],psygnal:14,purpos:8,push:18,py:18,pyplot:16,python:[2,6,12,18],q:12,qbaset:4,qmainwindow:11,qoverlayfram:4,qt:[1,4,6],qtconsol:[2,4],qtpy:[10,11],qtw:[4,11],qtwidget:[10,11],quickstart:6,qvboxlayout:11,qwidget:[1,4,10,11],r:1,radiobutton:2,rais:[1,8],raise_slot_error:2,random:2,rang:[1,2,4,12,14,18],ratio:1,re:17,read:[1,4,12],read_csv:[1,12],read_excel:[1,12],readabl:8,readi:[8,13],real:8,reason:[12,16],recov:10,recoveri:4,red:[8,15,18],redo:[2,10,11,18],redo_t:2,ref_prefix:9,refer:[2,8,9,15,16],refresh:4,regist:[1,4,6,10,12,14,16],register_act:13,register_command:2,registr:[9,13,16],registri:12,regress:18,regular:18,reject:12,relat:16,relev:18,reload:4,remov:[1,2,4,12,15],remove_cell_widget:2,remove_dock_widget:[1,4],remove_selected_column:2,remove_selected_row:2,renam:[2,12,18],rename_tab:2,repres:[8,14],reset:[1,2,4,8,9,15,16,17,18],reset_background_colormap:2,reset_choic:[1,4],reset_proxi:2,reset_text_colormap:2,reset_text_formatt:2,reset_view_mod:2,resiz:[2,4],resize_cells_to_cont:2,respect:9,restrict:[11,18],restructuredtext:2,result:18,rgb:8,rgba:[1,8,16],rgba_to_str:1,right:[1,2,4,8,12,13,14,15,18],round:2,row:[1,2,4,9,12,13,14,15,16],row_siz:9,rst:2,rule:[8,18],run:[2,4,8,9,18],run_cut:2,run_groupbi:2,s:[1,2,15,17],safe:[8,16],safer:[4,8],safeti:8,sai:[17,18],same:[4,10,17,18],sampl:[1,2,4,8,14,18],sample_nam:[1,4],satisfi:8,satur:1,save:[2,4,18],save_al:4,save_screenshot:4,save_t:2,scatter:[2,16,18],scikit:[2,18],scipi:[2,18],screenshot:4,script:18,scroll:[1,4,17],seaborn:[1,4,18],search:[6,12],section:[15,18],see:[8,9,10,11,12,15,16,17,18],segment:8,sel:[12,14],select:[0,1,4,6,8,12,15,18],select_al:2,selectionrang:14,selectionrangeerror:1,selectiontyp:4,self:[10,11],send:10,sep:4,sepal_length:[8,14],sepal_width:8,separ:[2,13],seri:[8,18],set:[1,2,4,6,9,12,15,16,17,18],set_background_colormap:2,set_background_colormap_opac:2,set_column_dtyp:2,set_current_view:1,set_dual_h_mod:2,set_dual_v_mod:2,set_opac:8,set_popup_mod:2,set_text_colormap:2,set_text_colormap_opac:2,set_text_formatt:2,setcentralwidget:11,setlayout:11,setobjectnam:10,setosa:8,sever:[8,10,12,13,16,18],shape:[4,12],sheet:[1,4,6,8,12],shift:[11,12,18],shortcut:[11,12,17],shorter:13,should:[8,10,15,16,18],show:[1,2,4,9,10,11,12,17],show_command_palett:2,show_consol:9,show_context_menu:2,show_eval_widget:2,show_filter_widget:2,show_finder_widget:2,show_keymap:2,show_optimizer_widget:2,show_prefer:2,show_sklearn_widget:2,show_stats_widget:2,show_undo_stack_view:2,shown:[4,12,16,17,18],shuffl:2,shuffle_data_column_wis:2,side:[4,18],signal:[2,14],signalgroup:14,signatur:13,similar:[4,9,10,11,13,14,15,16,17,18],similarli:[13,15],simpl:[2,8,11,12,18],simplest:8,simpli:[14,16,18],sinc:[8,12,16],size:[4,9],slicabl:12,slice:[1,2,4,12,14,15],slider:2,slot:16,small:17,sn:2,so:[1,11,17,18],solv:[8,11],some:[8,11,12,18],someth:[4,12],sometim:8,sort:[2,4,6,16,18],sort_by_column:2,sort_func:15,sort_inplac:2,sourc:[1,2,3,4,15,18],space:11,speci:8,specif:[2,4,8,10,11,13,16,18],spinbox:2,split:17,spreadsheet:[1,2,4,11,16,18],stack:[2,10],standard:[8,18],start:18,startup:[9,18],stat:[2,18],state:[16,17,18],statist:18,statu:[4,10],statup:4,std:10,still:17,store:[8,9,10,12,16],str:[1,2,3,4,10],straightforward:15,strategi:10,string:[1,4,9,12,18],stripplot:2,strongli:6,structur:[12,17],style:[0,1,2],sub:16,subclass:[1,11],submenu:13,submodul:0,subpackag:0,subset:15,sum:[9,18],summar:[2,18],summarize_t:2,suppli:8,support:[8,9,12,13,15,16],supportkeymap:4,suppos:[13,15],surject:15,swap:2,swap_tab_with_left:2,swap_tab_with_right:2,swarmplot:2,switch_column:2,switch_index:2,switch_layout:2,syntax:[13,15],system:8,t:[4,8,12,15,18],tab:[0,1,9,12,15,16,17],tab_posit:[1,4],tabl:[0,1,4,7,9,13],table_shap:4,table_typ:4,table_view:11,tablebas:[1,4,13],tablecolumn:1,tabledata:[1,10],tabledatatupl:1,tabledisplai:4,tableinfo:1,tableiniti:1,tablelist:4,tableseri:8,tabletyp:4,tableview:[1,4,7,8,9,12,13,18],tableviewerbas:[1,2,4,13],tableviewersign:[1,4],tableviewerwidget:[1,4,11],tabposit:[1,4],tabul:[7,9,11,12,13,16,18],tag:8,take:[1,8,11,12],task:4,tbl:12,teal:8,tell:16,test:[9,18],text:[2,3,4,18],text_color:[4,8],text_formatt:4,th:12,thei:[8,17],them:[14,15],theme:4,therefor:17,thi:[1,4,6,8,10,11,12,13,15,16,17,18],thing:11,thread:1,thu:[4,14,16],tile:[2,18],tile_t:2,tile_with_adjacent_t:2,time:[8,9],timedelta:[2,8],timedelta_rang:2,tip:[4,10],titl:[1,2],togeth:1,toggl:[2,18],toggle_consol:2,toggle_edit:2,toggle_focu:2,toggle_fullscreen:2,toggle_toolbar:2,too:[8,11,12],tool:[10,12],toolbar:[2,4,12,15,16],tooltip:[1,4,18],top:[1,2,4,10,15,18],topleft:[4,10],traceback:2,tracebacktyp:1,train:6,transpos:2,tupl:[1,2,4,13,14],turn:17,two:[2,8,9,17,18],type:[0,4,11,12,16,18],u:[9,12,13],ui:[4,11],uint8:8,under:13,undo:[2,4,10,11,18],undo_manag:4,undo_t:2,undomanag:4,union:[1,4],unless:12,unlik:8,unlimit:12,unpivot:2,until:[2,13,18],untile_t:2,updat:[1,4,12,14,15,16,18],us:[1,4,6,13,14,16,17,18],user:[2,6,9,13],usual:[8,11,18],v:17,valid:[2,4,18],valu:[1,2,4,8,12,13,14,16],valueerror:[1,8],vanish:14,variabl:[9,18],varieti:12,veri:[16,17],versicolor:8,version:[9,11,12,13],vertic:[2,9,13,17,18],via:[4,12,16],view:[0,1,4,6,10,11,12],view_imag:7,view_mod:[4,17],view_spreadsheet:1,view_tabl:[1,7],viewer:[1,2,4,6,8,10,13,14,15,16,17,18],vieweriniti:1,viewmod:4,violet:8,violinplot:2,virginica:8,virtual:12,visibl:[1,2,4,10,11,12,18],visual:8,volum:8,wai:[1,8,12,13,15,16,18],want:[8,10,11,13,16,17,18],well:[16,17],what:9,wheel:18,when:[1,4,8,9,12,16,17,18],whenev:18,where:[1,18],whether:4,which:[8,10,13,16,18],widget:[0,1,2,12,13,16,17,18],width:[4,9,18],window:[0,1,6,7,9,12,17],wip:18,wise:[6,15,16,18],without:8,work:[13,18],write:2,write_data_reference_in_consol:2,write_data_signal_in_consol:2,write_slice_in_consol:2,wrong:[1,12],x:[1,8,9,14,15,16],xlsx:12,xxx:13,y:[1,15,16],you:[4,8,9,10,11,12,13,14,15,16,17,18],your:[8,10,13],zero:4,zoom:[2,4,17],zoom_in:2,zoom_out:2},titles:["tabulous","tabulous package","tabulous.commands package","tabulous.style package","tabulous.widgets package","<no title>","tabulous","Cheat Sheet for Napari Users","Column-wise Settings","Customize Viewer Actions","Integrate Custom Widgets","Use Non-main Window Table Viewers","Quickstart","Register Custom Actions","Table Selections and Highlights","Sort/Filter Table Data","Field Attributes of Tables","View Tables in Different Modes","User Interface"],titleterms:{"catch":14,"function":[8,15],A:12,For:12,action:[9,13],add:[7,10,18],an:12,analysi:2,analyz:18,annot:10,area:10,attribut:16,background_color:16,bar:13,basic:10,built:10,cell:[13,15,16,18],chang:14,cheat:7,color:[1,8],colormap:8,column:[2,8,15,16,18],combo:12,command:[2,12,13],config:9,content:[1,2,3,4,6,7,8,10,11,12,13,14,15,16,17,18],contextmenu:13,cooper:6,core:1,custom:[9,10,13],data:[7,14,15,18],defin:[8,18],detail:12,dictionari:8,differ:17,dock:[7,10],dtype:16,dual:17,dure:15,edit:[9,15,18],evalu:18,excel:18,except:1,express:15,field:16,file:2,filter:15,formatt:[8,16],get:7,gui:[8,15],header:[13,18],highlight:14,home:18,how:17,index:16,indic:6,integr:10,interfac:18,interpol:8,interpret:12,just:7,kei:12,keybind:13,label:[16,18],layer:7,list:[7,12],magicgui:[10,11],main:11,matplotlib:8,menu:18,method:9,mode:17,modul:[1,2,3,4],more:12,move:18,namespac:[9,18],napari:7,non:11,open:[7,12],other:6,overlai:10,packag:[1,2,3,4],palett:[12,13],plot:[2,18],plt:16,popup:17,post_init:[1,9],proxi:[15,16],py:9,qt:[10,11],queri:15,quickstart:12,read:7,ref:16,refer:18,regist:[9,13],resiz:18,row:18,scalar:18,scroll:18,select:[2,14],set:[7,8,14],sheet:7,side:10,simpl:15,sort:15,spreadsheet:[8,12],string:8,style:[3,15,18],submodul:[1,2],subpackag:1,subset:8,syntax:8,tab:[2,13,18],tabl:[2,6,8,10,11,12,14,15,16,17,18],tableview:11,tabul:[0,1,2,3,4,6,10],text:[8,16],text_color:16,tile:17,toml:9,toolbar:18,type:[1,8,10,14],until:17,updat:[8,9],us:[8,9,10,11,12,15],usag:10,user:[7,18],valid:[8,16],valu:18,vector:18,view:[2,17,18],viewer:[7,9,11,12],widget:[4,6,7,10,11],window:[2,11],wise:8,work:17,your:11,zoom:18}}) diff --git a/rst/apidoc/tabulous.rst b/rst/apidoc/tabulous.rst index 1b2b4784..56fd7f03 100644 --- a/rst/apidoc/tabulous.rst +++ b/rst/apidoc/tabulous.rst @@ -8,6 +8,7 @@ Subpackages :maxdepth: 4 tabulous.commands + tabulous.style tabulous.widgets Submodules diff --git a/rst/apidoc/tabulous.style.rst b/rst/apidoc/tabulous.style.rst new file mode 100644 index 00000000..bb777b84 --- /dev/null +++ b/rst/apidoc/tabulous.style.rst @@ -0,0 +1,10 @@ +tabulous.style package +====================== + +Module contents +--------------- + +.. automodule:: tabulous.style + :members: + :undoc-members: + :show-inheritance: diff --git a/rst/fig/cell_labels.png b/rst/fig/cell_labels.png index 1e9dbbfb..f4f04ee7 100644 Binary files a/rst/fig/cell_labels.png and b/rst/fig/cell_labels.png differ diff --git a/rst/fig/colormap.png b/rst/fig/colormap.png index 19cf1698..df9ea7f4 100644 Binary files a/rst/fig/colormap.png and b/rst/fig/colormap.png differ diff --git a/rst/fig/colormap_interpolate.png b/rst/fig/colormap_interpolate.png index 9715031c..d4ff9a1a 100644 Binary files a/rst/fig/colormap_interpolate.png and b/rst/fig/colormap_interpolate.png differ diff --git a/rst/fig/column_filter.png b/rst/fig/column_filter.png index a50f65b5..76b7f1ae 100644 Binary files a/rst/fig/column_filter.png and b/rst/fig/column_filter.png differ diff --git a/rst/fig/command_palette.png b/rst/fig/command_palette.png index c1291ae7..7c8e2e21 100644 Binary files a/rst/fig/command_palette.png and b/rst/fig/command_palette.png differ diff --git a/rst/fig/dock_with_table_data_annotation.png b/rst/fig/dock_with_table_data_annotation.png index 3ce29dfc..2c85f137 100644 Binary files a/rst/fig/dock_with_table_data_annotation.png and b/rst/fig/dock_with_table_data_annotation.png differ diff --git a/rst/fig/edit_cell.png b/rst/fig/edit_cell.png index 073b504e..b7f0a334 100644 Binary files a/rst/fig/edit_cell.png and b/rst/fig/edit_cell.png differ diff --git a/rst/fig/formatter.png b/rst/fig/formatter.png index 0dc29f16..cbff7324 100644 Binary files a/rst/fig/formatter.png and b/rst/fig/formatter.png differ diff --git a/rst/fig/spreadsheet.png b/rst/fig/spreadsheet.png index 6b3681fb..67242f72 100644 Binary files a/rst/fig/spreadsheet.png and b/rst/fig/spreadsheet.png differ diff --git a/rst/fig/table.png b/rst/fig/table.png index 23a5307d..bea89640 100644 Binary files a/rst/fig/table.png and b/rst/fig/table.png differ diff --git a/rst/fig/tile_tables.png b/rst/fig/tile_tables.png index 790967e6..0d703adc 100644 Binary files a/rst/fig/tile_tables.png and b/rst/fig/tile_tables.png differ diff --git a/rst/fig/validator.png b/rst/fig/validator.png index 99365ebf..f85a9316 100644 Binary files a/rst/fig/validator.png and b/rst/fig/validator.png differ diff --git a/rst/main/quickstart.rst b/rst/main/quickstart.rst index 0dca412a..ab3f05d7 100644 --- a/rst/main/quickstart.rst +++ b/rst/main/quickstart.rst @@ -51,13 +51,13 @@ but you can show it in several ways. 1. Set :attr:`visible` property of :attr:`console` interface to ``True``: ``>>> viewer.conosole.visible = True`` -2. Activate keyboard shortcut :kbd:`Ctrl+Shift+C`. +2. Activate keyboard shortcut :kbd:`Ctrl` :kbd:`Shift` :kbd:`C`. 3. Click the |toggle_console| tool button in the the toolbar. In ``tabulous`` viewer there are additional keybindings. -- :kbd:`Ctrl+Shift+↑`: Set console floating. -- :kbd:`Ctrl+Shift+↓`: Dock console. +- :kbd:`Ctrl` :kbd:`Shift` :kbd:`↑`: Set console floating. +- :kbd:`Ctrl` :kbd:`Shift` :kbd:`↓`: Dock console. Use Tables ========== @@ -225,7 +225,7 @@ Key combo :mod:`tabulous` supports many keyboard shortcuts including key combo. All the global key map is listed in a widget that will be shown when you press -:kbd:`Ctrl+K ⇒ Shift+?` key combo. +:kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`Shift` :kbd:`?` key combo. :attr:`keymap` is the key map registry object of table viewers. You can use :meth:`register` to register custom key combo. @@ -252,7 +252,7 @@ Command palette .. versionadded:: 0.4.0 -:kbd:`Ctrl+Shift+P` or :kbd:`F1` opens a command palette widget. You can search for a variety of +:kbd:`Ctrl` :kbd:`Shift` :kbd:`P` or :kbd:`F1` opens a command palette widget. You can search for a variety of registered commands. .. image:: ../fig/command_palette.png diff --git a/rst/main/table_view_mode.rst b/rst/main/table_view_mode.rst index ba9faa17..92d57786 100644 --- a/rst/main/table_view_mode.rst +++ b/rst/main/table_view_mode.rst @@ -30,8 +30,8 @@ To reset dual view, set the property to ``"normal"``. table.view_mode = "normal" -Dual view can also be turned on by key combo :kbd:`Ctrl+K ⇒ H` (horizontal) or -:kbd:`Ctrl+K ⇒ V` (vertical). Reset it by key combo :kbd:`Ctrl+K ⇒ N`. +Dual view can also be turned on by key combo :kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`H` (horizontal) or +:kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`V` (vertical). Reset it by key combo :kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`N`. Popup View ---------- @@ -48,7 +48,7 @@ similar to dual view by ``table.view_mode = "normal"`` table = viewer.add_table(data) table.view_mode = "popup" -Dual view can also be turned on by key combo :kbd:`Ctrl+K ⇒ P`. +Dual view can also be turned on by key combo :kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`P`. Tile View --------- @@ -64,7 +64,7 @@ window, but tabs named "A" and "B" still exist in the tab bar. ``viewer.tables[i also returns the same table as before. When tab "A" or "B" is clicked, the tiled table with "A" and "B" is shown as ``A|B``. -You can tile the current table and the table next to it by shortcut :kbd:`Ctrl+K ⇒ ^`. +You can tile the current table and the table next to it by shortcut :kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`^`. You can also programmatically tile tables by calling :meth:`viewer.tables.tile`. .. code-block:: python @@ -82,5 +82,5 @@ these tabs show tiled view ``A|B|C``. If you untiled "B", "A" and "C" are re-til while "B" returns the original state. Therefore, tabs "A" and "C" shows ``A|C`` and tab "B" shows ``B``. -You can untile the current table by shortcut :kbd:`Ctrl+K ⇒ \\`. +You can untile the current table by shortcut :kbd:`Ctrl` :kbd:`K` ⇒ :kbd:`\\`. You can also programmatically untile tables by calling ``viewer.tables.untile([0, 1, 2])``. diff --git a/rst/main/user_interface.rst b/rst/main/user_interface.rst index e19d49b5..a54108f9 100644 --- a/rst/main/user_interface.rst +++ b/rst/main/user_interface.rst @@ -11,15 +11,26 @@ User Interface Tables ====== -Move around the table ---------------------- +Move and scroll +--------------- + +- Arrow keys (:kbd:`→` :kbd:`←` :kbd:`↑` :kbd:`↓`) with :kbd:`Ctrl` (or :kbd:`⌘` in Mac), + :kbd:`Shift` modifier work as you expects in most of table data editors. +- Arrow keys (:kbd:`→` :kbd:`←` :kbd:`↑` :kbd:`↓`) with :kbd:`Ctrl` + :kbd:`Alt` scrolls + the table to the desired direction. You can also scroll tables using the scroll bar, or + right-dragging. + +Zoom +---- + +- :kbd:`Ctrl` + ``mouse wheel`` zooms in/out the table. +- You can also use keybindings + :kbd:`Ctrl` :kbd:`Shift` :kbd:`>` :kbd:`Ctrl` :kbd:`Shift` :kbd:`<` to zoom in/out. -Arrow keys (:kbd:`→` :kbd:`←` :kbd:`↑` :kbd:`↓`) with :kbd:`Ctrl` (or :kbd:`⌘` in Mac), -:kbd:`Shift` modifier work as you expects in most of table data editors. +Resize +------ -Additionally, :kbd:`Ctrl` + ``mouse wheel`` zooms in/out the table. Arrow keys (:kbd:`→` -:kbd:`←` :kbd:`↑` :kbd:`↓`) with :kbd:`Ctrl` + :kbd:`Alt` scrolls the table to the desired -direction. +Cells and headers can be resized by dragging the borders of header sections. Edit cells and headers ---------------------- @@ -33,27 +44,6 @@ During editing, the text will always be validated. Invalid text will be shown in table cells, you can set any validation rules (see :doc:`/main/columnwise_settings`). For the table headers, duplicated names are not allowed and considered to be invalid. -Add cell labels ---------------- - -People using spreadsheets usually want to name some of the cells. For instance, when you -calculated the mean of a column, you want to name the cell as "mean". Usually, it is done -by editing one of the adjacent cells. - -=== ==== - A B -=== ==== - 1 mean - 2 2.5 - 3 - 4 -=== ==== - -In :mod:`tabulous`, however, you can directly name the cell using cell label. You can edit -cell labels by :kbd:`F3` key. - -.. image:: ../fig/cell_labels.png - Excel-style data evaluation --------------------------- @@ -66,7 +56,7 @@ data is available as a variable ``df``. By default, modules :mod:`numpy` and :mo also available as ``np`` and ``pd``. If the input string starts with ``=``, the editor is automatically switched to the literal evaluation mode and cell selection will insert table data reference to the editor. For instance, if you select column ``'A'`` and rows from 1 to 8, then -``df['A'][1:9]`` will be inserted. +``df[1:9, 0:1]`` will be inserted. One of the differences between this mode and Excel is that this evaluation does not use reference, so that changing the value of any of the source cells will **NOT** affect the value @@ -232,6 +222,37 @@ want to add more variables or functions, there are two ways to do it. You can't use none of ``np``, ``pd`` or ``df`` as a variable name. +Add cell labels +--------------- + +People using spreadsheets usually want to name some of the cells. For instance, when you +calculated the mean of a column, you want to name the cell as "mean". Usually, it is done +by editing one of the adjacent cells. + +=== ==== + A B +=== ==== + 1 mean + 2 2.5 + 3 + 4 +=== ==== + +In :mod:`tabulous`, however, you can directly name the cell using cell label. You can edit +cell labels by :kbd:`F3` key. + +.. image:: ../fig/cell_labels.png + +Table Tabs +========== + +All the tables are managed by the table tabs. + +- You can double-click to rename the tab. The ``name`` property of the table will also be + updated. +- You can run table specific actions by right-clicking the tab. +- You can drag-and-drop tabs between viewers by right-drag. + Toolbar ======= diff --git a/tabulous/__init__.py b/tabulous/__init__.py index f29b4090..b2458b26 100644 --- a/tabulous/__init__.py +++ b/tabulous/__init__.py @@ -1,4 +1,4 @@ -__version__ = "0.5.0rc1" +__version__ = "0.5.0" from tabulous.widgets import TableViewer, TableViewerWidget from tabulous.core import ( diff --git a/tabulous/_qt/_table/_base/_enhanced_table.py b/tabulous/_qt/_table/_base/_enhanced_table.py index b9563d91..fb227989 100644 --- a/tabulous/_qt/_table/_base/_enhanced_table.py +++ b/tabulous/_qt/_table/_base/_enhanced_table.py @@ -507,7 +507,8 @@ def setZoom(self, value: float) -> None: self.horizontalScrollBar().setSliderPosition(int(pos * zoom_ratio)) # Zoom section size of headers - self.setSectionSize(int(self._w_default * value), int(self._h_default * value)) + self.horizontalHeader().setZoomRatio(zoom_ratio) + self.verticalHeader().setZoomRatio(zoom_ratio) # Update stuff self._zoom = value @@ -517,18 +518,23 @@ def setZoom(self, value: float) -> None: self.verticalHeader().setFont(font) self.horizontalHeader().setFont(font) self._update_all() + if qviewer := self.parentViewer(): + qviewer.statusBar().showMessage(f"Zoom: {value * 100:.0f}%") return def wheelEvent(self, e: QtGui.QWheelEvent) -> None: """Zoom in/out table.""" if e.modifiers() & Qt.KeyboardModifier.ControlModifier: - dt = e.angleDelta().y() / 120 - zoom = self.zoom() + 0.15 * dt - self.setZoom(min(max(zoom, 0.25), 2.0)) - return None + return self.zoomIn(e.angleDelta().y() / 120) return super().wheelEvent(e) + def zoomIn(self, delta: int = 1) -> None: + """Zoom in or out.""" + zoom = self.zoom() + 0.15 * delta + self.setZoom(min(max(zoom, 0.25), 2.0)) + return None + def sectionSize(self) -> tuple[int, int]: """Return current section size.""" return ( diff --git a/tabulous/_qt/_table/_base/_header_view.py b/tabulous/_qt/_table/_base/_header_view.py index be29ed8f..cddf8281 100644 --- a/tabulous/_qt/_table/_base/_header_view.py +++ b/tabulous/_qt/_table/_base/_header_view.py @@ -3,6 +3,8 @@ from qtpy import QtWidgets as QtW, QtCore, QtGui from qtpy.QtCore import Qt, Signal +import numpy as np + from tabulous._qt._action_registry import QActionRegistry from tabulous._qt._proxy_button import HeaderAnchorMixin @@ -29,6 +31,7 @@ def __init__(self, parent: QtW.QWidget | None = None) -> None: self.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) self.customContextMenuRequested.connect(self._show_context_menu) + self._section_sizes = np.zeros(0, dtype=np.float32) self._header_widgets: dict[int, QtW.QWidget] = {} # fmt: off @@ -55,6 +58,7 @@ def _on_section_clicked(self, logicalIndex) -> None: def _on_section_resized( self, logicalIndex: int, oldSize: int, newSize: int ) -> None: + self._section_sizes[logicalIndex] = newSize for idx, widget in self._header_widgets.items(): if idx < logicalIndex: continue @@ -90,6 +94,31 @@ def drawCurrent(self, painter: QtGui.QPainter, rect: QtCore.QRect): """Draw the current index if exists.""" raise NotImplementedError() + def setZoomRatio(self, ratio: float): + self._section_sizes *= ratio + self.sectionResized.disconnect(self._on_section_resized) + try: + for idx, size in enumerate(self._section_sizes): + self.resizeSection(idx, int(size)) + finally: + self.sectionResized.connect(self._on_section_resized) + return None + + def insertSection(self, index: int, count: int, span: int = 0) -> None: + """Insert a section at the given index.""" + sz = self._section_sizes + self._section_sizes = np.concatenate( + [sz[:index], np.full(count, span), sz[index:]] + ) + return None + + def removeSection(self, index: int, count: int) -> None: + """Remove the section at the given index.""" + self._section_sizes = np.delete( + self._section_sizes, slice(index, index + count) + ) + return None + def paintEvent(self, event: QtGui.QPaintEvent) -> None: super().paintEvent(event) painter = QtGui.QPainter(self.viewport()) diff --git a/tabulous/_qt/_table/_base/_item_model.py b/tabulous/_qt/_table/_base/_item_model.py index 000842d0..5926f90d 100644 --- a/tabulous/_qt/_table/_base/_item_model.py +++ b/tabulous/_qt/_table/_base/_item_model.py @@ -1,5 +1,5 @@ from __future__ import annotations -from typing import Any, Callable, Hashable, TYPE_CHECKING +from typing import Any, Callable, Hashable, TYPE_CHECKING, cast import warnings from qtpy import QtCore, QtGui, QtWidgets as QtW from qtpy.QtCore import Qt, Signal @@ -297,24 +297,38 @@ def insertColumns( self, column: int, count: int, parent: QtCore.QModelIndex = None ) -> bool: self._decorations.insert_columns(column, count) + span = self.data(self.index(0, column - 1), Qt.ItemDataRole.SizeHintRole) + if isinstance(span, QtCore.QSize): + span = cast(QtCore.QSize, span).width() + else: + span = get_config().table.column_size + self.parent()._qtable_view.horizontalHeader().insertSection(column, count, span) return super().insertColumns(column, count, parent) def removeColumns( self, column: int, count: int, parent: QtCore.QModelIndex = None ) -> bool: self._decorations.remove_columns(column, count) + self.parent()._qtable_view.horizontalHeader().removeSection(column, count) return super().removeColumns(column, count, parent) def insertRows( self, row: int, count: int, parent: QtCore.QModelIndex = None ) -> bool: self._decorations.insert_rows(row, count) + span = self.data(self.index(0, row - 1), Qt.ItemDataRole.SizeHintRole) + if isinstance(span, QtCore.QSize): + span = cast(QtCore.QSize, span).height() + else: + span = get_config().table.row_size + self.parent()._qtable_view.verticalHeader().insertSection(row, count, span) return super().insertRows(row, count, parent) def removeRows( self, row: int, count: int, parent: QtCore.QModelIndex = None ) -> bool: self._decorations.remove_rows(row, count) + self.parent()._qtable_view.verticalHeader().removeSection(row, count) return super().removeRows(row, count, parent) if TYPE_CHECKING: diff --git a/tabulous/_qt/_table/_spreadsheet.py b/tabulous/_qt/_table/_spreadsheet.py index 8e13b249..aaa89a6f 100644 --- a/tabulous/_qt/_table/_spreadsheet.py +++ b/tabulous/_qt/_table/_spreadsheet.py @@ -506,6 +506,7 @@ def insertRows(self, row: int, count: int, value: Any = _EMPTY): value, ItemInfo.INSERTED, ) + self._qtable_view.setZoom(self._qtable_view.zoom()) self.itemChangedSignal.emit(info) return None @@ -573,6 +574,7 @@ def _insert_columns(self, col: int, count: int, value: Any = _EMPTY): value, ItemInfo.INSERTED, ) + self._qtable_view.setZoom(self._qtable_view.zoom()) self.itemChangedSignal.emit(info) return None @@ -616,6 +618,7 @@ def _remove_rows(self, row: int, count: int, old_values: pd.DataFrame): info = ItemInfo( slice(row, row + count), slice(None), ItemInfo.DELETED, old_values ) + self._qtable_view.setZoom(self._qtable_view.zoom()) self.itemChangedSignal.emit(info) return None @@ -664,6 +667,7 @@ def _remove_columns(self, col: int, count: int, old_values: pd.DataFrame): info = ItemInfo( slice(None), slice(col, col + count), ItemInfo.DELETED, old_values ) + self._qtable_view.setZoom(self._qtable_view.zoom()) self.itemChangedSignal.emit(info) return None diff --git a/tabulous/_qt/_traceback.py b/tabulous/_qt/_traceback.py index d937123a..c33a06f9 100644 --- a/tabulous/_qt/_traceback.py +++ b/tabulous/_qt/_traceback.py @@ -87,7 +87,6 @@ def from_exc(cls, e: Exception, parent=None): if e is None: raise RuntimeError("EmitLoopError unwrapping failed.") self = cls(type(e).__name__, e, parent) - print(parent) return self @classmethod diff --git a/tabulous/commands/__init__.py b/tabulous/commands/__init__.py index ca9778ba..6c29269e 100644 --- a/tabulous/commands/__init__.py +++ b/tabulous/commands/__init__.py @@ -92,6 +92,8 @@ def fn(self: _QtMainWidgetBase): (table.show_undo_stack_view, "Ctrl+H"), (table.undo_table, "Ctrl+Z"), (table.redo_table, "Ctrl+Y"), + (table.zoom_in, "Ctrl+Shift+>"), + (table.zoom_out, "Ctrl+Shift+<"), (file.open_table, "Ctrl+O"), (file.open_spreadsheet, "Ctrl+K, Ctrl+O"), (file.save_table, "Ctrl+S"), diff --git a/tabulous/commands/table.py b/tabulous/commands/table.py index d727c688..ee2dc111 100644 --- a/tabulous/commands/table.py +++ b/tabulous/commands/table.py @@ -303,3 +303,15 @@ def resize_cells_to_contents(viewer: TableViewerBase): table = _utils.get_table(viewer) table.native._qtable_view.resizeColumnsToContents() table.native._qtable_view.resizeRowsToContents() + + +def zoom_in(viewer: TableViewerBase): + """Zoom in""" + table = _utils.get_table(viewer) + table.native._qtable_view.zoomIn(1) + + +def zoom_out(viewer: TableViewerBase): + """Zoom in""" + table = _utils.get_table(viewer) + table.native._qtable_view.zoomIn(-1) diff --git a/tabulous/widgets/_component/_header.py b/tabulous/widgets/_component/_header.py index 58514971..c1b88c87 100644 --- a/tabulous/widgets/_component/_header.py +++ b/tabulous/widgets/_component/_header.py @@ -50,6 +50,10 @@ def resize_to_content(self): header.resizeSections(QHeaderView.ResizeMode.ResizeToContents) return None + def __repr__(self) -> str: + sizes = self.parent._get_header()._section_sizes + return f"{type(self).__name__}({sizes.astype(np.uint16)})" + class _HeaderInterface(TableComponent, SupportActionRegistration["TableBase", int]): """