Skip to content
This repository has been archived by the owner on May 4, 2019. It is now read-only.
Adil edited this page Apr 30, 2016 · 58 revisions

Sample Code

Keshif only has one main function: a browser constructor with a few configuration parameters that describe the data source, the summaries, and the record display.

browser = new kshf.Browser({
  domID: "#chart_div",
  categoryTextWidth: 160,
  source: {
    gdocId: '0Ai6LdDWgaqgNdG1WX29BanYzRHU4VHpDUTNPX3JLaUE',
    tables: "Presidents"
  },
  summaries: [
    "Party",
    "State of Birth",
    "Occupation",
    { name: "College", panel: 'right' },
    { name: "Religion", panel: 'right' },
    { name: "Notes", panel: 'right' },
    { name: "Age at inaguration", panel: 'right' },
    { name: "Term Start", panel: 'bottom' }
  ],
  recordDisplay: {
    displayType: 'grid',
    textSearch: "Name",
    recordView: function(){ 
      return "<a href='http://www.whitehouse.gov/about/presidents/"+this.Link+"' target='_blank'>"+
        "<img src='"+this.Image+"'></a>";
    }
  }
});

Demos

Enjoy the interactive demo list at the project homepage!

Demos are also coded by simplicity of source code. You can review on the simple demos first and then increase complexity as you want to enable more features and see different ways to expand keshif.

The demo demo

Clone this wiki locally