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
# Given a one-hot encoded csv file with character names as the columns and each row representing a chapter/episode, | |
# this script generates a gantt chart timeline for the appearances of each character. | |
# Created by Anthony Teo | |
# Example: mainapps.csv | |
# Kazuya,Ruka,Mami | |
# 1,0,0 | |
# 0,1,1 | |
# 1,1,1 | |
# 1,0,0 |
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
// Spotify Duotone Filter with HTML Canvas and Javascript | |
// by Anthony Teo | |
/* | |
This function generates a duotone version of an image on an HTML Canvas element using Javascript. | |
It makes use of the newer canvas functions, including filter and the globalCompositeOperations, making it | |
less code-heavy compared to existing implementations in canvas. | |
The benefit of using this method compared to CSS filters is the ability to convert the canvas to an image to be saved. | |
Libraries like HTMLtoCanvas state in their documentation that CSS filters are not supported, so it is probably not possible | |
to do so in CSS. This is a purely JS and Canvas implementation. | |
*/ |
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
// Customizable Dot Plot (for D3 v3) | |
// by Anthony Teo | |
// adapted from code by Yan Holtz | |
/* | |
This function generates a responsive and customisable dot plot that can be used as | |
a lolipop plot, a dumbell plot, or other dot-plot-like graphs. | |
I needed a really lightweight dot plot function in D3 v3 that shows the domain in each plot without needing axes, | |
so I made this by adapting a basic Cleveland plot implementation that used D3 v4, and added configurations. | |
The config object is passed in for styling customisations. | |
*/ |