コード例 #1
0
ファイル: dash_tools.py プロジェクト: KBIbiopharma/pybleau
    def update_part_scatter(x_col_name, y_col_name, color_name, hover_props):
        """ Upon scatter plot properties, update the plotly figure.
        """
        if not x_col_name or not y_col_name:
            return go.Figure()

        return plotly_scatter(x_col_name,
                              y_col_name,
                              hover=hover_props,
                              data=df,
                              hue=color_name,
                              marker_size=plot_style.get("marker_size", 12),
                              marker_alpha=plot_style.get("marker_alpha", 0.3),
                              target="fig")
コード例 #2
0
 def test_x_y_symbol_col_on_hover(self):
     fig = plotly_scatter("b", "c", data=self.data, symbol="a", hover="a")
     self.assert_valid_plotly_figure(fig, num_renderers=NUM_A_VALUES)
コード例 #3
0
 def test_x_y_symbol_pick_hue(self):
     fig = plotly_scatter("b", "c", data=self.data, symbol="a",
                          hue="rgb(255, 0, 0)")
     self.assert_valid_plotly_figure(fig, num_renderers=NUM_A_VALUES)
コード例 #4
0
 def test_x_y_symbol_int_col(self):
     fig = plotly_scatter("b", "c", data=self.data, symbol="c")
     self.assert_valid_plotly_figure(fig, num_renderers=6)
コード例 #5
0
 def test_x_y_hover(self):
     fig = plotly_scatter("b", "c", data=self.data, hover="a")
     self.assert_valid_plotly_figure(fig)
コード例 #6
0
 def test_x_y_2_prop_hue(self):
     self.skipTest("Not supported yet")
     fig = plotly_scatter("b", "c", data=self.data, hue=["a", "index"])
     self.assert_valid_plotly_figure(fig)
コード例 #7
0
 def test_x_y_hue_and_hue_map(self):
     color_map = {"a": BLACK, "b": BLUE, "c": RED, "d": GREEN}
     fig = plotly_scatter("b", "c", data=self.data, hue="a",
                          palette=color_map)
     self.assert_valid_plotly_figure(fig, num_renderers=NUM_A_VALUES)
コード例 #8
0
 def test_create_x_y_z_hue_hover(self):
     fig = plotly_scatter(x="b", y="c", z="d", data=self.data, hue="a",
                          hover="index")
     self.assert_valid_plotly_figure(fig, num_renderers=NUM_A_VALUES)
コード例 #9
0
 def test_x_y_pick_color_and_symbol(self):
     fig = plotly_scatter("b", "c", data=self.data, symbol="square",
                          hue="rgb(255, 0, 0)")
     self.assert_valid_plotly_figure(fig)
コード例 #10
0
 def test_x_y_pick_symbol(self):
     fig = plotly_scatter("b", "c", data=self.data, symbol="square")
     self.assert_valid_plotly_figure(fig)
コード例 #11
0
 def test_x_y_pick_color(self):
     fig = plotly_scatter("b", "c", data=self.data, hue="rgb(255, 0, 0)")
     self.assert_valid_plotly_figure(fig)
コード例 #12
0
 def test_x_y(self):
     fig = plotly_scatter("b", "c", data=self.data)
     self.assert_valid_plotly_figure(fig)
コード例 #13
0
 def test_missing_data(self):
     with self.assertRaises(ValueError):
         plotly_scatter("b", "c")
コード例 #14
0
 def test_create_x_y_z_hue_hover_symbol_on_bool_col(self):
     self.skipTest("Not supported yet")
     fig = plotly_scatter(x="b", y="c", z="d", data=self.data, hue="a",
                          hover="index", symbol="e")
     self.assert_valid_plotly_figure(fig)
コード例 #15
0
 def test_x_y_symbol_hue_hover(self):
     fig = plotly_scatter("b", "c", data=self.data, symbol="a", hue="index",
                          hover="index")
     num_a_index_pairs = 6
     self.assert_valid_plotly_figure(fig, num_renderers=num_a_index_pairs)
コード例 #16
0
 def test_x_y_hue(self):
     fig = plotly_scatter("b", "c", data=self.data, hue="a")
     self.assert_valid_plotly_figure(fig, num_renderers=NUM_A_VALUES)
コード例 #17
0
 def test_create_x_y_z(self):
     fig = plotly_scatter(x="b", y="c", z="d", data=self.data)
     self.assert_valid_plotly_figure(fig)