MCPcopy Create free account
hub / github.com/holoviz/hvplot / TestExplicitStreamPlotting

Class TestExplicitStreamPlotting

hvplot/tests/teststreaming.py:8–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8class TestExplicitStreamPlotting(TestCase):
9 def setUp(self):
10 import hvplot.pandas # noqa
11
12 self.df = pd.DataFrame([[1, 2], [3, 4], [5, 6]], columns=['x', 'y'])
13
14 def test_pipe_stream(self):
15 stream = Pipe(data=self.df)
16 plot = self.df.hvplot('x', 'y', stream=stream)
17 pd.testing.assert_frame_equal(plot[()].data, self.df)
18 new_df = pd.DataFrame([[7, 8], [9, 10]], columns=['x', 'y'])
19 stream.send(new_df)
20 pd.testing.assert_frame_equal(plot[()].data, new_df)
21
22 def test_buffer_stream(self):
23 stream = Buffer(data=self.df, index=False)
24 plot = self.df.hvplot('x', 'y', stream=stream)
25 pd.testing.assert_frame_equal(plot[()].data, self.df)
26 new_df = pd.DataFrame([[7, 8], [9, 10]], columns=['x', 'y'])
27 stream.send(new_df)
28 pd.testing.assert_frame_equal(plot[()].data, pd.concat([self.df, new_df]))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…