HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/holoviews/tests/plotting/plotly/test_tableplot.py
from holoviews.element import Table

from .test_plot import TestPlotlyPlot


class TestTablePlot(TestPlotlyPlot):

    def test_table_state(self):
        table = Table([(0, 1), (1, 2), (2, 3)], 'x', 'y')
        state = self._get_plot_state(table)
        self.assertEqual(state['data'][0]['type'], 'table')
        self.assertEqual(state['data'][0]['header']['values'], ['x', 'y'])
        self.assertEqual(state['data'][0]['cells']['values'],
                         [['0', '1', '2'], ['1', '2', '3']])

    def test_visible(self):
        element = Table([(0, 1), (1, 2), (2, 3)], 'x', 'y').options(visible=False)
        state = self._get_plot_state(element)
        self.assertEqual(state['data'][0]['visible'], False)