Wiki

Information and Resources

User Tools

Site Tools


api:api_example

JournalMap API Examples

API's are cool, but if you're like me you can see lots of potential for it, but realizing any measure of that potential isn't necessary straightforward. While the JournalMap API has some amazing documentation, if you're not an experienced programmer, it can still be a challenge to know how to access and work with data from the API. We've developed a set of examples to help you get started with implementing the API in case you need it. Unless otherwise noted, the examples below are all written in JavaScript to be implemented through a website, and most use D3.js and Leaflet. Let us know if there are other examples that you'd like to see.

Using the JournalMap API

  • Example of Pagination with JournalMap API - JournalMap's API uses pagination for some endpoints (articles, authors, locations) to protect the server from very large request. This example shows how to iterate over the multiple pages of results to display a map of point clusters for a selected journal. This example uses D3.js, Leaflet, and the Leaflet Marker Cluster plugin. It also uses queue.js to hold processing of the articles until all the pages have been loaded, and spin.js for a nifty spinning wheel icon while the map loads.
  • Pagination Example with Dynamic Point Loading - Like the example above, this example demonstrates how to iterate over the pages of a JournalMap API request for a selected journal. The difference with this example is that the points load dynamically on the map as the pages are returned from the API rather than constructing the point layer once all pages have been loaded. This example uses D3.js, Leaflet, and the Leaflet Marker Cluster plugin.

Embedding JournalMaps into Other Sites

  • Embed JournalMap into a WordPress Site - Embedding a JournalMap of articles from a collection or publication is really pretty simple in WordPress using an iFrame tag that links to a separate HTML page.

Visualizing Data from the JournalMap Data

  • Creating a Heatmap for a Publication - This example takes all of the articles from a publication (i.e., a journal) and creates a colored heatmap showing the distribution of the articles across the world. This example uses D3.js to access and manipulate the data and displays it on a Leaflet using the heatmap.js plugin for Leaflet. It also uses queue.js to hold processing of the articles until all the pages have been loaded, and spin.js for a nifty spinning wheel icon while the map loads. Because many journals in JournalMap have more than 30 articles, this example also includes pagination.
  • Simple Treemap for Journals - A Treemap is a compact way of visualizing data that you might normally put in a bar or pie chart. Treemaps use nested rectangles whose size is determined by a data attribute. In this example, each rectangle in the treemap below corresponds to a journal (publication) that is indexed in JournalMap. The size of each rectangle is related to the number of articles from that journal in JournalMap's database. This example uses D3.js to access the data from the JournalMap API and the super helpful D3plus for easily building the treemap.
  • JournalMap Analytics Dashboard - A basic dashboard example that shows summary stats and visualizations for a selected journal. This example uses D3.js to access and manipulate the data and displays it on a Leaflet using the heatmap.js plugin for Leaflet. It also uses queue.js to hold processing of the articles until all the pages have been loaded, and spin.js for a nifty spinning wheel icon while the map loads. Because many journals in JournalMap have more than 30 articles, this example also includes pagination

Combining JournalMap Data with Other Services

  • Mashup of JournalMap & iDigBio Data - This example shows how JournalMap records from the Sage Grouse Collection can be combined with Sage Grouse occurrence records from the iDigBio biocollections database. This example builds on the collections example above and uses the iDigBio v1 API. Sage Grouse occurrence records are shown as 1/2-degree blocks at low zoom levels and then switch to circle markers as you zoom in. Basic attributes for both JournalMap articles and iDigBio records are available via popups.
api/api_example.txt · Last modified: 2015/08/26 14:19 by jkarl

FEEDBACK    DOWNLOADS    ABOUT    SUPPORT US    HELP    BLOG    WIKI

JournalMap data is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
Creative Commons License