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

Sample Code

Keshif only has one main function: kshf.init, and all the configuration is done by modifying the parameters passed to this function.

browser = new kshf.Browser({
  domID: "#chart_div",
  source: {
    gdocId: '0Ai6LdDWgaqgNdG1WX29BanYzRHU4VHpDUTNPX3JLaUE',
    tables: "Presidents"
  },
  summaries: [
    { title: "Party" },
    { title: "State of Birth" },
    { title: "Occupation" },
    { title: "College", layout: 'right' },
    { title: "Religion", layout: 'right' },
    { title: "Notes", layout: 'right' },
    { title: "Age at inaguration", layout: 'right' },
    { title: "Term Start", layout: 'bottom' }
  ],
  itemDisplay: {
    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 our interactive demo list at the project homepage!

Demo list is also marked by code simplicity. You can focus on the simple pieces first and then increase complexity as you want to enable more features.

The demo demo