codeamp / panel

CodeAmp Web Application. Built with React.js, GraphQL and Material-UI.
12 stars 7 forks source link

Format Numbers of Dashboard #296

Closed seanmccann closed 5 years ago

seanmccann commented 5 years ago

This will format the numbers on the dashboard by adding a comma for thousands, and will scale the number using css.

Examples:

aballman commented 5 years ago

@seanmccann What was the motivation for submitting this? Are you using the dashboard in a way that prevents from displaying the full number? We sort of like getting an exact count out of the dashboard.

We would be amenable to this, if you really want it, if you include a tooltip on hover for displaying the exact count.

seanmccann commented 5 years ago

screen shot 2018-11-30 at 12 08 23 pm

@aballman Because it's cut off. We could just make the font smaller too.

aballman commented 5 years ago

That would be a good reason! Do you usually use CodeAmp in a smaller window? Amos and I tried it in a few different sizes and didn't get that same scenario until the window was very small.

aballman commented 5 years ago

@seanmccann If you conditionally enable this when an overflow condition occurs we'll take it. It looks like you could use this lib to accomplish this: https://github.com/nickuraltsev/react-overflow

seanmccann commented 5 years ago

@aballman I changed it so that it not longer shortens numbers. It now just adds a comma (1000 => 1,000) and uses CSS to auto scale the number size to fit inside the box.

aballman commented 5 years ago

Somehow this seemed to have increased the size of the boxes as well, probably resized to fit the larger text size? I'll take it either way but I am curious.