tiby312 / poloto-project

MIT License
158 stars 10 forks source link

Make data name optional #155

Closed Icelk closed 2 years ago

Icelk commented 2 years ago

When supplying an empty string to the functions here, no text is added to the legend. This isn't documented. I suggest making name an Option, which implicitly tells your users the name is optional.

tiby312 commented 2 years ago

I guess i'm not understanding what you would expect to happen if an empty string is supplied? Are you saying that if the empty string is supplied, you would expect the legend color to still be there? I would prefer not having to have users always write Some("text") if we can capture desired behavior with just a regular string.

It also just occured to me that if a user wants to have just the legend color show up but still have no text, they could use a string with one space also. " ".

Icelk commented 2 years ago

Thanks for the info!