Getting started

The Pakistan Caselaw Project includes over 150K Pakistan legal cases from the Published legal resources Library. Our Historical Trends tool graphs the frequency of words and phrases through time from 1947 to 2020, similar to the Google Ngram Viewer. Search for phrases of one to three words. Multiple phrases can be separated by commas. Do not use quotes. All searches are case-insensitive. Examples:

Reading the results

Key

The color/shape-keyed terms at the top of the graph correspond to each term in the query, and each of those corresponds to a trend line on the graph. The individual points on the trend line can be revealed by hovering over them with the mouse cursor, or by using the keyboard navigation.

Horizontal axis

The horizontal axis always represents time; each point on the timeline represents one or more years, depending on the Smoothing setting. If no smoothing is applied, each point on the horizontal axis represents one year. If maximum smoothing is applied, it may be an average of several decades. Hover over or focus on a data point to see what years each point represents.

Vertical axis

The numerically-labeled vertical axis is a little trickier. Depending on your settings, it could represent:

  • the number of times that term was used in a given year
  • out of all terms used that year, what percent were that term
  • the number of cases in which that term was used in a given year
  • the percentage of cases in which that term was used in a given year
  • a different thing for each trend line if "Terms scaled to fill Y axis" option is selected.

Please continue reading for more information on how to change the settings to display the data.

Customize display

Percentage Count/Instance Count/Scaling

For example, in the query https://pakcaselaw.com/trends/?q=apple, banana, orange, pear we can see four terms: apple, banana, orange, and pear. For the sake of simplicity, we'll turn smoothing off by clicking on the gear icon and sliding the smoothing slider all the way to the left, until 'No smoothing will be applied' is displayed.

If we focus on 1990, we see that 'pear' appears in 0.0065% of cases, 'banana' appears in 0.058% of cases, 'apple' appears in 0.45% of cases, and 'orange' appears in 1% of cases. This can be changed by tweaking the Percentage Count/Instance Count/Scaling settings, which are also accessible by clicking on the gear icon above the graph. By default, the settings read:

  • 'percentage' rather than 'absolute number,'
  • 'case count' rather than 'instance count,'
  • 'Terms on the same Y axis' rather than 'Terms scaled to fill Y axis'

If we wanted to get the total number of cases containing those terms rather than the percentage of cases, select 'Absolute number.' In this case, we see that 'pear' appears in 5 cases, 'banana' appears in 45 cases, 'apple' appears in 352, and 'orange' appears in 797 cases. If we want to change the unit to the number of times the term was used rather than the number of cases in which that term was used, select 'Instance count.' Doing so shows us that in 1990, even though 'apple' only appeared in 352 cases, the term was used 787 times. If we weren't interested at all in direct scalar comparison, the 'Terms scaled to fill Y axis' option changes the vertical scale of each trend line to fill the vertical space on the graph. You can still get the exact numbers of each data point by hovering over of focusing on a data point, but the placement of the data points are only relative to the other points on that trend line for that specific term, and not to the other terms. As a result, the Y-axis scale disappears.

Smoothing

In the previous example, we turned smoothing off so one data point would equal one year. If we drag the smoothing slider to the right until "Data points will be averaged with the nearest 10% of other points" is displayed, rather than each point on the horizontal access representing a single value for one year, it now represents a value averaged over 42 years, and the previously bumpy trend line is now smooth.

Please keep in mind that smoothing does not simply flatten the curve; it changes the values of each data point. The year labels, however, will not change. This means that a with smoothing enabled, a data point associated with a particular year will have values from other years averaged into it. Smoothing affects data in both the graph and table views, but not CSV or JSON downloads.

Table view

If you'd preview to view the data points in a table rather than on a chart, you can click on the table icon (between the keyboard icon and the mortarboard icon) above the graph. These are affected by the customize display settings in the same way the graph is.

important: smoothing does not simply flatten the curve; it changes the values of the each data point. Please see the Smoothing section for more information.

Keyboard navigation

The graph is keyboard accessible. With the graph selected, press:

Key Navigation Commands:

  • up and down arrows: select terms
  • left and right arrows: select points
  • space bar: enable or disable selected trend line
  • enter key: search for example cases

Key Sound Commands:

  • "s" key: audio tones on/off
  • "p" key: auto play audio tones
  • "b" key: blues mode

Download

The data can be exported in four ways. The first three are accessible by clicking the download icon above the graph.

  • Download as an image
    • best for sharing on social media, or messaging services
  • Download CSV
    • best for analyzing in Excel or other human-centric data analysis tools
  • Download JSON
    • best for analyzing in a program you'd write

Replace the final word of a phrase with "*" to perform a wildcard search. This will return the top ten phrases beginning with your first one or two words. Wildcards are currently allowed only as the final word in a phrase.

Examples:

  • constitutional * (top ten two-word phrases beginning with "constitutional")
  • ride a * (top ten three-word phrases beginning with "ride a")
  • * amendment (not currently supported)