This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import islice | |
from wikirate4py import API, Cursor, to_dataframe | |
# splits a list into chunks of a given size | |
def chunked_iterable(iterable, size): | |
iterable = iter(iterable) | |
return iter(lambda: list(islice(iterable, size)), []) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://vega.github.io/schema/vega/v5.json", | |
"description": "A beeswarm chart example that uses a force-directed layout to group items by category.", | |
"width": 950, | |
"height": 400, | |
"padding": {"left": 5, "right": 5, "top": 0, "bottom": 30}, | |
"background": "#ffefd9", | |
"autosize": "none", | |
"config": {"axis": {"labelFontSize": 15, "labelFont": "GothamNarrow"}}, | |
"signals": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://vega.github.io/schema/vega/v5.json", | |
"description": "A beeswarm chart example that uses a force-directed layout to group items by category.", | |
"width": 950, | |
"height": 400, | |
"padding": {"left": 5, "right": 5, "top": 0, "bottom": 30}, | |
"background": "#ffefd9", | |
"autosize": "none", | |
"config": {"axis": {"labelFontSize": 15, "labelFont": "GothamNarrow"}}, | |
"signals": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://vega.github.io/schema/vega/v5.json", | |
"description": "A basic line chart example.", | |
"width": 500, | |
"height": 200, | |
"padding": 5, | |
"signals": [{"name": "interpolate", "value": "cardinal"}], | |
"title": { | |
"text": "Apparel Top 100 Companies Reporting their Suppliers.", | |
"subtitle": "Number of Apparel Top 100 Companies making their list of suppliers publicly available over the years.", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function histogramChart(color_value, title, xAxisTitle, yAxisTitle, num_of_of_bins) { | |
var margin = {top: 30, right: 40, bottom: 50, left: 50}, | |
width = 460, | |
height = 300; | |
var histogram = d3.layout.histogram(), | |
x = d3.scale.ordinal(), | |
y = d3.scale.linear(), | |
xAxis = d3.svg.axis().scale(x).orient("bottom").tickSize(6, 0), | |
yAxis = d3.svg.axis() |