Coder Social home page Coder Social logo

tabulardisplay.jl's Introduction

TabularDisplay

Build Status Coverage Status codecov.io Project Status

Display a vector of things in a tabular format.

Keyword arguments

  • padding: minimum number of spaces between column data. Default value is 2.
  • index: prepend cell values with indices. Default value is false.
  • indexsep: string that separate index and cell values. Default value is :.
  • align: either :left or :right. Default value is :left.
  • orientation: either :column or :row. Default value is :column.
  • formatter: custom formatter that takes a value and returns a string. Default value is string function.
  • displaywidth: custom display width. Default value is 0, for which the system will use the terminal's size.

Examples

Assuming a 80-column terminal screen:

1---------2---------3---------4---------5---------6---------7---------8---------
julia> displaytable(stdout, [string("randomstr", i) for i in 1:16])
randomstr1   randomstr4   randomstr7   randomstr10  randomstr13  randomstr16  
randomstr2   randomstr5   randomstr8   randomstr11  randomstr14               
randomstr3   randomstr6   randomstr9   randomstr12  randomstr15               

julia> using Formatting

julia> foo = generate_formatter("%7.5f")
(::#5) (generic function with 1 method)

julia> displaytable(stdout, rand(35); padding=5, align=:right, formatter=foo, index=true, indexsep=" -> ")
      1 -> 0.08425     10 -> 0.51280     19 -> 0.71986     28 -> 0.50921
      2 -> 0.22630     11 -> 0.83040     20 -> 0.95942     29 -> 0.78327
      3 -> 0.99681     12 -> 0.17092     21 -> 0.80820     30 -> 0.34046
      4 -> 0.17840     13 -> 0.53777     22 -> 0.24029     31 -> 0.87364
      5 -> 0.20914     14 -> 0.25836     23 -> 0.14779     32 -> 0.06027
      6 -> 0.37565     15 -> 0.30872     24 -> 0.27250     33 -> 0.15860
      7 -> 0.79610     16 -> 0.52003     25 -> 0.86022     34 -> 0.27416
      8 -> 0.66101     17 -> 0.64725     26 -> 0.46590     35 -> 0.46035
      9 -> 0.61129     18 -> 0.64148     27 -> 0.65477                  

tabulardisplay.jl's People

Contributors

juliatagbot avatar tk3369 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.