Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.

Docs: Summary Parameters

Adil Yalcin edited this page Dec 10, 2016 · 51 revisions

Core Summary Parameters

# name

string The summary name is shown in summary header, attribute list, record sorting, etc. If the records have an attribute with the same name, then that value is used to create the summary. If not, the "value" parameter also needs to be specified.

Note: This parameter must be defined for all summaries. Summaries can be indexed in JS using (kshf.Browser).summaries_by_name[name]

# value

string OR function TODO

Examples:

{ name: "Protein", value: "Protein (gr)", unitName: "gr"} // rename attribute name when both name and value are string
{ name: "Implementation Status", value: "impl_status_chrome"} // same as above
{ name: "Link count", value: function(){ return this.links.length; }} // custom computation
{ name: "Average Travel Minutes", value: function(){ return this['Total Travel Minutes']/this['# Riders']; } } // custom

# description

string The description of the data (attribute) presented in the summary. This is shown in the summary header ( i ) info button mouse-over.

Default: No description

Example: {name: "Carat", description: "Weight of the diamond"}

Display Parameters

# panel

"left" OR "right" OR "middle" OR "bottom" The browser panel that this summary will be inserted to. The order of the summary within a panel depends on its position in the summary specifications.

Default: left

# collapsed

true OR false If set to true, the summary will be collapsed (only header / name shown) on load.

Default: false

Categorical Summary Parameters

# catSplit

string OR regular expression If defined, the retrieved value per record is split using the provided string or regular expression to generate multiple values for each record. For example, splitting "A+B+C" by "+" creates three separate values for this record: "A","B","C". The relationships between these values can be explored using the set-pair matrix, shown when the "tag" icon in upper right corner of the summary is clicked.

Examples:

// splits by ", "
{ name: "Keywords", catSplit: ", "} 
// splits by regular expression that requires a comma and an optional space that follows
{ name: "Co-Author", catSplit: /,\b/g } 

# catTableName

string If defined, the retrieved value per record is used as look-up index in the catTableName table.

Default: None

# catLabel

object OR string OR function If you have a separate table that describes labels or if you want to use abbreviations, you can define a function which returns the label of a given category. If defined as a function, the categorical value (label) is available as this.id ("id").

Default: None

Examples:

{ name: "Fatal?", catLabel: { Y: "Yes", N: "No"} } Here, the data includes "Y" and "N" values for "Fatal?" attribute. The summary converts the labels from Y->Yes , and N->No.

{ name: "Road Surface Condition", catTableName: "RoadSurface", catLabel: "name"} This summary show record attributes called "Road Surface Condition", looks-up in a table called "RoadSurface", and returns the "name" attribute in this lookup table to display the value on the browser.

... catLabel: function(){ return ((this.id%4===0)?"Winter ":"Summer ")+this.id; } } This function gets a numeric value (a year) and adds either "Winter " or "Summer " before the number.

#### catTooltip string OR function The tooltip is shown on mouse-over on a category. You can use this function to define the tooltip text. Defined in similar way to catLabel.

Default: None

#### catSortBy custom (TODO)

Default: None (dynamic order by value)

Examples:

{ name: "Population", catSortBy: [ "1,000-10,000", "10,000-25,000", "25,000-50,000", "50,000+"] },
// _demo.Month_id is an array that describes month order
 { name: "Month", catSortBy: _demo.Month_id }, 
// sort by number
 { name: "Cylinders", catSortBy: "id" }, 
// sort by (integer) value
 { name: "Session", catSortBy: "id", catLabel: {1: "1st", 2: "2nd"} },
// multiple sorting options
 ..., catSortBy: [ { name: "# of Screenings" }, { name: "Close to me", value: function(){ return ...; } } 

#### catHeight integer The pixel-height of a category in this summary. Default is 18.

#### minAggrValue integer If set, the categorical values are filtered by the aggregate value. Default is one (categories with at least one record are shown).

Interval Summary Parameters

#### optimumTickWidth integer (in pixels) Default: 50

#### label function Only used when using an interval summary as sorting option in record display.

Interval 'Number' Summary Parameters

#### intervalScale "linear" OR "log" (TODO)

Default*: Auto-set by data distribution

#### unitName string (TODO). Examples are "$", "kg", "%", "ft", etc.

Default: None

#### showPercentile true OR false TODO

Interval 'Time' Summary Parameters

#### timeFormat string Converts the string values of the summary to date objects using the format specified in d3.time.format.

Default: None

Examples:

{ name: "Year" timeFormat: "%Y" },
{ name: "Date", timeFormat: "%m/%d/%Y" },
{ name: "Start Date", timeFormat: "%b-%y }

Record View Parameters

autoExpandMore

Default: True

# sortColWidth

integer TODO

# textSearch

string OR summaryBlock TODO

# displayType

list OR grid TODO

# recordView

string OR function Function that takes a data record, and returns an html describing how an item should appear on the display.

# sortBy

TODO

# scatterBy

TODO

# onDOM

function TODO

# detailsToggle

"one" OR "zoom" OR "off"

Default: "off"

# showRank

true OR false

Not Used

# type

"categorical" OR "interval" This value is detected automatically depending on the retrieved record value for this summary, or whether type-specific attributes are set. There may be some cases where an explicit conversion is necessary.

Notes:

  • The API is case dependent, i.e. title-Title-TITLE are different, and only 'title' is correct.