Visidata: [v2.-4dev] Issues with sliding columns

Created on 22 Jul 2020  路  12Comments  路  Source: saulpw/visidata

From @anjakefala

Two issues:

  • [x] Key columns cannot be re-arranged.
  • [x] When a regular column reaches into the key column space, with slide-left, it can snap back to its starting position. It should just remain to the right of the key column space.

This issue will be closed after both of these are investigated. Attempting a fix is preferable, but if a fix is too tricky, then this will be documented in /limits before closure.

bug fixed wish granted

Most helpful comment

Working like a charm!!!

All 12 comments

Key columns can now be re-arranged!

@anjakefala ! Great work with the fix, works so much better 馃憤 A couple of things I've noticed, with sliding columns since this patch though (they may have existed before).

  1. Non-key column slide issue
    Replicate:

    • vd . to open a DirSheet
    • Move to the ext column
    • Do 2 slide-right so it is the last column
    • Do 2 slide-lefts
      Expected - the ext column to be in its original position
      Actual - the ext column pops back to the last column
  2. Keycol gets de-selected during slide and doesn't slide
    Replicate:

    • vd . to open a DirSheet
    • Move to filename column
    • Do a slide-left
      Expected - the filename column to become the first column
      Actual - the filename column stays where it is, and the directory column is selected

Issue 2 I've actually noticed on a couple of sheets that if I have x2 keycols and try and slide the right most column to the left, it slides, however the right most column is still selected (I would expect the same column to be selected that I was performing the slide).

Hi @geekscrapy!

Issue 2 is because those are set key columns in the definition of the DirSheet, so they are fixed. If you un-key'd them, you could move them around.

I think issue 1 is for similar reasons...formal sheets with static columns behave differently than a standard sheet with dynamic columns does.

I do not think this issue is a blocker for 2.0, but I will leave it open for now. @saulpw, should sliding be smoothed out for static column sheets?

Thanks for explaining @anjakefala - is static and dynamic the difference between setting columns with columns = [...] and addColumn? (From @saulpw s recent docs 馃檪)

If this is the case, maybe some feedback for the user like the "cannot slide, at edge" would be best, but it would be "fixed column, cannot slide". And to also keep the column the you are trying to slide, selected even if it doesn't get moved (I think this is key).

I must admit, I was completely unaware that there were certain limitations with static and dynamic - and I probably wouldn't expect a casual user to know the differences. I just fear they may get frustrated with not being able to do something on one sheet but on another.

So I can test and confirm it all in my head, keycol sliding should work as expected if I have sheets with sheet.columns = [...]?

Thanks!

I must admit, I was completely unaware that there were certain limitations with static and dynamic - and I probably wouldn't expect a casual user to know the differences. I just fear they may get frustrated with not being able to do something on one sheet but on another.

There are not limitations! There was an old api for setting key columns, and some of the sheets with statically defined columns makes use of it. When I was doing all my sliding fixes, I did not take into account that api or erase all the instances of it. I think it is the nKeys=x statement that is breaking my work.

So it is just buggy at the moment for those specific sheets, and I will fix it for those sheets once I have the space to look at it, again. =)

You can see this in by action by trying unkey-ing, and re-keying those columns on the Dirsheet and seeing them behave normally again!

I agree this would be frustrating. I will try to have it fixed for 2.0.

I fixed things for the second issue! Now looking into the first issue.

I think this might all be fixed now... :tada:

Thanks for hanging in there, and giving me the test cases!

I'll give it a spin today! Awesome persistence @anjakefala and great work. Thanks very much

Working like a charm!!!

@anjakefala - this feels massively better than better! However I have come across a case where something seems to be amiss. I appreciate that it maybe not a priority now as it's working 100x better than before but I thought I'd log it here.

Using the following:

vd https://raw.githubusercontent.com/elastic/examples/master/Common%20Data%20Formats/apache_logs/apache_logs --play apache_logs.vd -w 5

apache_logs.vd

sheet   col row longname    input   keystrokes  comment
            open-file   /Users/geekscrapy/Downloads/apache_logs.txt o   
apache_logs text        addcol-expr text.split(" ") =   create new column from Python expression, with column names as variables
apache_logs text.split(" ")     rename-col  log ^   edit name of current column
apache_logs log     expand-col      (   expand current column of containers fully
apache_logs text        hide-col        -   hide current column
apache_logs log[0]      key-col     !   toggle current column as a key column
apache_logs log[5]      key-col     !   toggle current column as a key column
apache_logs log[7]      key-col     !   toggle current column as a key column
apache_logs log[9]      key-col     !   toggle current column as a key column
apache_logs log[8]      key-col     !   toggle current column as a key column
apache_logs         freq-keys       gF  open Frequency Table grouped by all key columns on source sheet, with aggregations of other columns
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[8]      slide-left      KEY_SLEFT   slide current column left
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[8]      slide-left      KEY_SLEFT   slide current column left
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[8]      slide-left      KEY_SLEFT   slide current column left
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[8]      slide-right     KEY_SRIGHT  slide current column right
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[8]      slide-right     KEY_SRIGHT  slide current column right
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[8]      slide-right     KEY_SRIGHT  slide current column right
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[0]      slide-right     KEY_SRIGHT  slide current column right
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[0]      slide-right     KEY_SRIGHT  slide current column right
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[5]      slide-right     KEY_SRIGHT  slide current column right
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[5]      slide-right     KEY_SRIGHT  slide current column right
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[5]      slide-right     KEY_SRIGHT  slide current column right
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[5]      slide-left      KEY_SLEFT   slide current column left
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[5]      slide-left      KEY_SLEFT   slide current column left
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[0]      slide-left      KEY_SLEFT   slide current column left
apache_logs_log[0]-log[5]-log[7]-log[9]-log[8]_freq log[0]      slide-left      KEY_SLEFT   slide current column left

At step 19 sliding of the columns get a bit funky...

Expected:
the column log[0] to be the 3rd keycol

Actual:

  • the column log[0] is left as the 2nd keycol, and the selected column changes to log[5]. After step 19, continuously sliding log[5] also slides (drags) log[0] behind it.
  • another thing to note after the replay has completed, if you try and slide log[5] to the left, it thinks it is at an edge.

@geekscrapy Thanks for documenting! Right now, I am working on shipping 2.0. This is going to wait until after that. I need a break from sliding. =)

You are welcome to try your hand at fixing it!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aborruso picture aborruso  路  12Comments

qrkourier picture qrkourier  路  16Comments

kovasap picture kovasap  路  13Comments

suntzuisafterU picture suntzuisafterU  路  11Comments

aborruso picture aborruso  路  12Comments