clean_pltly_legend: Clean the legend of a plotly object

View source: R/server_plotly.R

clean_pltly_legendR Documentation

Clean the legend of a plotly object

Description

This function cleans the legend of a plotly object by removing unnecessary duplication. It is specifically designed to work around a bug that causes facet_wrap to create a separate legend entry for each facet.

Usage

clean_pltly_legend(pltly_obj, new_legend = c())

Arguments

pltly_obj

A plotly object with a legend to be cleaned.

new_legend

An optional vector of strings specifying new legend entries. Default is an empty vector.

Value

The input plotly object with its legend cleaned.


vvshiny documentation built on July 26, 2023, 5:50 p.m.