This file contains 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
import Image, ImageDraw | |
def get_colors(infile, outfile, numcolors=10, swatchsize=20, resize=150): | |
image = Image.open(infile) | |
image = image.resize((resize, resize)) | |
result = image.convert('P', palette=Image.ADAPTIVE, colors=numcolors) | |
result.putalpha(0) | |
colors = result.getcolors(resize*resize) |
This file contains 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
library(magrittr) | |
library(dplyr) | |
library(ggplot2) | |
population <- read.csv("https://raw.githubusercontent.com/andriy-gazin/datasets/master/ageSexDistribution.csv") | |
population %<>% | |
tidyr::gather(sex, number, -year, - ageGroup) %>% | |
mutate(ageGroup = gsub("100 і старше", "≥100", ageGroup), | |
ageGroup = factor(ageGroup, |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Температура в Києві, 1812-2016 рік</title> | |
<meta charset="utf-8"> | |
<script src="https://cdn.jsdelivr.net/npm/vega@3.0.10"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vega-lite@2.1.2"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vega-embed@3.0.0"></script> | |
<link href="https://fonts.googleapis.com/css?family=Ubuntu+Mono" rel="stylesheet"> | |
<style media="screen"> |
This file contains 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
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.js"></script> | |
<title>Jittering Rectangles</title> | |
</head> | |
<style media="screen"> | |
body { |
This file contains 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
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.js"></script> | |
<title>Rotating Squares</title> | |
</head> | |
<style media="screen"> | |
body { |
This file contains 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
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.js"></script> | |
<title>Jittering Lines</title> | |
</head> | |
<style media="screen"> | |
body { |
This file contains 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
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.js"></script> | |
<title>Pulsing Circles</title> | |
</head> | |
<style media="screen"> | |
body { |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Населення України</title> | |
<meta charset="utf-8"> | |
<script src="https://cdn.jsdelivr.net/npm/vega@4.3.0"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vega-lite@3.0.0-rc10"></script> | |
<script src="https://cdn.jsdelivr.net/npm/vega-embed@3.24.1"></script> | |
<link href="https://fonts.googleapis.com/css?family=Ubuntu+Condensed" rel="stylesheet"> | |
<style media="screen"> |
This file contains 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
date | temp_mean | temp_min | temp_max | month | season | |
---|---|---|---|---|---|---|
2016-01-01 | -12 | -14 | -10 | January | Winter | |
2016-01-02 | -10.5 | -15 | -9 | January | Winter | |
2016-01-03 | -15 | -16 | -12 | January | Winter | |
2016-01-04 | -14 | -17 | -12 | January | Winter | |
2016-01-05 | -8 | -12 | -6 | January | Winter | |
2016-01-06 | -3.5 | -6 | 0 | January | Winter | |
2016-01-07 | -5 | -6 | -4 | January | Winter | |
2016-01-08 | -4.5 | -11 | -1 | January | Winter | |
2016-01-09 | -4 | -7 | 3 | January | Winter |
This file contains 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
// add data | |
const data = | |
[{"date":"2016-01-01","tavg":-11.9329268293,"consumption":363439,"month":"January","season":"Winter"}, | |
{"date":"2016-01-02","tavg":-14.9573170732,"consumption":442786,"month":"January","season":"Winter"}, | |
{"date":"2016-01-03","tavg":-17.0390243902,"consumption":460553,"month":"January","season":"Winter"}, | |
{"date":"2016-01-04","tavg":-16.2256097561,"consumption":503460,"month":"January","season":"Winter"}, | |
{"date":"2016-01-05","tavg":-10.9170731707,"consumption":507364,"month":"January","season":"Winter"}, | |
{"date":"2016-01-06","tavg":-6.6573170732,"consumption":493315,"month":"January","season":"Winter"}, | |
{"date":"2016-01-07","tavg":-3.9658536585,"consumption":448638,"month":"January","season":"Winter"}, |
OlderNewer