How to use the refinem.plots.mpld3_plugins.Tooltip function in refinem

To help you get started, we’ve selected a few refinem examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dparks1134 / RefineM / refinem / plots / gc_cov_plot.py View on Github external
pts = self.data_pts(genome_scaffold_stats)

        # scatterplot
        xlabel = 'GC (mean = %.1f%%)' % mean_gc
        ylabel = 'Coverage (mean = %.1f)' % mean(mean_coverage)

        scatter, x_pts, y_pts, labels = self.scatter(axis, 
                                                        pts,
                                                        highlight_scaffold_ids, 
                                                        link_scaffold_ids,
                                                        xlabel, 
                                                        ylabel)

        # tooltips plugin
        if tooltip_plugin:
            tooltip = Tooltip(scatter, labels=labels, hoffset=5, voffset=-15)
            mpld3.plugins.connect(figure, tooltip)

        return scatter, x_pts, y_pts, self.plot_order(labels)
github dparks1134 / RefineM / refinem / plots / tetra_pca_plot.py View on Github external
pts = self.data_pts(genome_scaffold_stats, pc_xaxis, pc_yaxis)

        # scatterplot
        xlabel = 'PC %d (%.1f%%)' % (pc_xaxis + 1, self.variance[pc_xaxis] * 100)
        ylabel = 'PC %d (%.1f%%)' % (pc_yaxis + 1, self.variance[pc_yaxis] * 100)

        scatter, x, y, plot_labels = self.scatter(axis, 
                                                    pts,
                                                    highlight_scaffold_ids, 
                                                    link_scaffold_ids,
                                                    xlabel, 
                                                    ylabel)

        # tooltips plugin
        if tooltip_plugin:
            tooltip = Tooltip(scatter, labels=plot_labels, hoffset=5, voffset=-15)
            mpld3.plugins.connect(figure, tooltip)

        return scatter, x, y, self.plot_order(plot_labels)
github dparks1134 / RefineM / refinem / plots / td_plots.py View on Github external
x[j] = x[i]

            axes_scatter.plot(x, y, 'r--', lw=1.0, zorder=0)

        # ensure y-axis include zero and covers all sequences
        axes_scatter.set_ylim([0, ymax])

        # ensure x-axis is set appropriately for sequences
        axes_scatter.set_xlim([xmin, xmax])

        # prettify scatterplot
        self.prettify(axes_scatter)

        # tooltips plugin
        if tooltip_plugin:
            tooltip = Tooltip(scatter, labels=plot_labels, hoffset=5, voffset=-15)
            mpld3.plugins.connect(figure, tooltip)

        return scatter, x_pts, y_pts, self.plot_order(plot_labels)
github dparks1134 / RefineM / refinem / plots / gc_plots.py View on Github external
sort_indexY = np.argsort(y)
            xL = np.array(xL)[sort_indexY]
            xU = np.array(xU)[sort_indexY]
            y = np.array(y)[sort_indexY]
            axes_scatter.plot(xL, y, 'r--', lw=1.0, zorder=0)
            axes_scatter.plot(xU, y, 'r--', lw=1.0, zorder=0)

        # ensure y-axis include zero and covers all sequences
        axes_scatter.set_ylim([0, ymax])

        # ensure x-axis is set appropriately for sequences
        axes_scatter.set_xlim([xmin, xmax])

        # tooltips plugin
        if tooltip_plugin:
            tooltip = Tooltip(scatter, labels=plot_labels, hoffset=5, voffset=-15)
            mpld3.plugins.connect(figure, tooltip)

        return scatter, x_pts, y_pts, self.plot_order(plot_labels)