Visidata: [plugin] add ability from the keyboard to add color to cells/rows based on the data in the cell/row

Created on 28 May 2019  Â·  11Comments  Â·  Source: saulpw/visidata

Add the ability to colour cells of a column based on the values of the cell or the cell's row.
It would be great if I could have a greyscale value to show where a cell's value is over a range of 0 to 100. Or a range of red to blue to show which way a US state voted in a particular election. Or use a color range to make it easier to see how frequent a value is in a column (a color version of the frequency table).

https://github.com/saulpw/visidata/issues/24 sounds close but is closed, and it didn't give the user the control to add colors from the UI. Now, there are predefined colors on some sheet types like DirSheet.

This feature request is asking for some basic colormaps for basing the color on the cell value or the frequency of the value. And the ability to easily add the colors via keyboard command(s).

What is colored? Provide some choices for the background or foreground text, and either just the cell or the whole row.

There are different types of colormaps that could be used:
Sequential, Diverging, Cyclic, Qualitative as described in the matplotlib docs

I don't know colors, and understand this could be hard, but it would be very useful.

help wanted plugin

Most helpful comment

I discovered this just today, can't say how happy I am with ColumnColorizer !!

All 11 comments

Thanks for the suggestion, @frosencrantz, it's a neat idea. This could be a plugin, probably not that much code too. The trick of course is in the design, as I am not so great with colors either. I'm not going to add it to the roadmap, but if you're interested, you could put together a plugin; I'd be glad to help get you going (email me), and maybe someone with some color sense could improve with the palette at some point.

Getting added to the roadmap was my interest. There are other places where color is under-supported, for example xlsx files ignore color information, or the way color works with highlighted rows (it hides any coloring already there.)

With colors it would be possible to pack more information onto the screen, and make things easier to read.

I'll follow up with you by email about the plugin. It seems like it would be useful to try.

Thanks for the reply.

If possible, let's use this issue as a place for discussion. We could use it for plugin doc improvements.

For example, do you have a good starting point on using the frequency of a value in a column as the source of color for the value or the background.

Hi @frosencrantz! I reopened this issue so that we could maintain a conversation on it. We have providing you with a short doc guide on working with colorizers in the queue. We have a few big tasks to get through, and then I will write that up and post a link in this issue.

If you want to get a headstart on looking through that code, the key word is Colorizer =) Those are the pieces of functionality that were developed for colouring VisiData cells, columns, rows, etc.

I have added a doc on colorizers here =)

This issue is being closed for the time being, since we decided recently to limit our open issues to bugs, roadmap items, and small feature requests as we get closer to releasing v2.0.

I discovered this just today, can't say how happy I am with ColumnColorizer !!

What kinds of columns are you colorizing, @sfranky?

I'm doing data cleaning, and I am kind of trying to develop a very fast
workflow (have to clean up something like 25-30k rows each time in 3-4 days)
I have columns that contain different versions of the same data, and I kept
pasting in the wrong column!!!! I needed a kind of a visual cue to point me
to the right direction, and this worked perfectly!

On Mon, Nov 11, 2019 at 4:02 AM Saul Pwanson notifications@github.com
wrote:

What kinds of columns are you colorizing, @sfranky
https://github.com/sfranky?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/saulpw/visidata/issues/287?email_source=notifications&email_token=AALVTEZFLD4E4BGF4BUMGDLQTDDLXA5CNFSM4HP67IP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDVQTZI#issuecomment-552274405,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AALVTE23NQGSLCOPDJPDRR3QTDDLXANCNFSM4HP67IPQ
.

the other obvious use case for me is for marking duplicate rows (but that's the RowColorizer). I need them marked, not selected. Since they are never exact duplicates to be deleted, I need to see which ones I need to keep, and in the meantime, I need to clean up, so the selection vanishes. I could create an extra column to mark them, but this is extra clutter and takes up screen real estate..

Thank you very @anjakefala for documenting this. I started looking at this but then didn't have time to come back to it.

Is there a good way to save the calculated color of a cell? Like if every cell has some different random value? What would be the recommended way of saving the cell color values. For example, if I have an excel file with color attached to each cell, what's a good way to cache those values.

Was this page helpful?
0 / 5 - 0 ratings