Skip to content

Commit

Permalink
[graph] add g. on ColumnsSheet #2424
Browse files Browse the repository at this point in the history
  • Loading branch information
saulpw committed Jun 22, 2024
1 parent c01c2b5 commit 5723b4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion visidata/graph.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import math

from visidata import VisiData, Canvas, Sheet, Progress, BoundingBox, Point
from visidata import VisiData, Canvas, Sheet, Progress, BoundingBox, Point, ColumnsSheet
from visidata import vd, asyncthread, dispwidth, colors, clipstr

vd.theme_option('color_graph_axis', 'bold', 'color for graph axis labels')
Expand Down Expand Up @@ -226,6 +226,7 @@ def rowsWithin(self, plotter_bbox):

Sheet.addCommand('.', 'plot-column', 'vd.push(GraphSheet(sheet.name, "graph", source=sheet, sourceRows=rows, xcols=keyCols, ycols=numericCols([cursorCol])))', 'plot current numeric column vs key columns; numeric key column is used for x-axis, while categorical key columns determine color')
Sheet.addCommand('g.', 'plot-numerics', 'vd.push(GraphSheet(sheet.name, "graph", source=sheet, sourceRows=rows, xcols=keyCols, ycols=numericCols(nonKeyVisibleCols)))', 'plot a graph of all visible numeric columns vs key columns')
ColumnsSheet.addCommand('g.', 'plot-source-selected', 'vd.push(GraphSheet(sheet.source[0].name, "graph", source=source[0], sourceRows=source[0].rows, xcols=source[0].keyCols, ycols=numericCols(selectedRows)))', 'plot a graph of all selected columns vs key columns on source sheet')

# swap directions of up/down
InvertedCanvas.addCommand(None, 'go-up', 'if cursorBox: sheet.cursorBox.ymin += cursorBox.h', 'move cursor up by its height')
Expand Down

0 comments on commit 5723b4b

Please sign in to comment.