Implement discretely_colour in plotly for R

Hi All,

I am looking to create a choropleth map where the color is based on a categorical variable.

In python plotly, the discrete_colour function described here exactly meets my needs.

On this stack overflow thread ( it is mentioned in the comments that non-continuous legends for choropleths would be coming early 2020, but it is not currently available and I cannot find any related issues or release notes.

Thanks a lot in advance.