Skip to content

Instantly share code, notes, and snippets.

View AnupJoseph's full-sized avatar
💭
Coding

AnupJoseph

💭
Coding
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
fig.add_annotation(x=223,y=1.04,text="1.04m of snow in 1982 is the absolute record",showarrow=True)
fig.show()
Specification Keyword RGB hex value
CSS Level 1 black #000000
CSS Level 1 silver #c0c0c0
CSS Level 1 gray #808080
CSS Level 1 white #ffffff
CSS Level 1 maroon #800000
CSS Level 1 red #ff0000
CSS Level 1 purple #800080
CSS Level 1 fuchsia #ff00ff
CSS Level 1 green #008000
padding=('SAME' if strides == 1 else 'VALID')
<script>
import { csv, scaleBand, scaleLinear, max } from "d3";
import { onMount } from "svelte";
import { fly } from "svelte/transition";
let dataset = [];
const row = function (data) {
data["Population"] = +data["2020"] * 1000; // + here is the unary conversion operator
return data;
};
@AnupJoseph
AnupJoseph / App.svelte
Created October 15, 2021 06:26
Scatter plot with D3 and Svelte
<script>
import { csv, extent, scaleLinear, scaleOrdinal } from "d3";
import { onMount } from "svelte";
import Axis from "./Axis.svelte";
let dataset = [];
const row = function (data) {
data.sepal_length = +data.sepal_length;
data.sepal_width = +data.sepal_width;
<script>
import { csv, extent, scaleLinear, scaleOrdinal } from "d3";
import { onMount } from "svelte";
import Axis from "./Axis.svelte";
import { petalPaths } from "./paths";
let dataset = [];
const row = function (data) {
data.sepal_length = +data.sepal_length;
@AnupJoseph
AnupJoseph / Axis.svelte
Created October 20, 2021 04:41
Line Chart with Animation using Svelte and D3
<script>
import { select, selectAll } from "d3-selection";
import { axisBottom, axisLeft } from "d3-axis";
import { timeFormat } from "d3-time-format";
export let innerHeight;
export let margin;
export let position;
export let scale;
@AnupJoseph
AnupJoseph / dataset.csv
Last active December 20, 2021 14:15
Migrant deaths dataset from missing migrants.com
Incident Date Total Number of Dead and Missing Coordinates
Wed, 01/01/2020 - 12:00 1 45.59174847, 13.85420616
Wed, 01/01/2020 - 12:00 4 19.45699612, 5.76462348
Thu, 01/02/2020 - 12:00 1 31.76402, 14.03511
Thu, 01/02/2020 - 12:00 1 20.0522119, -99.3442487
Thu, 01/02/2020 - 12:00 1 32.35061, -112.33691
Fri, 01/03/2020 - 12:00 1 32.44845, -113.11031
Fri, 01/03/2020 - 12:00 15 36.59258427, 28.98970454
Fri, 01/03/2020 - 12:00 20 16.69165509, 98.45030991
Fri, 01/03/2020 - 12:00 1 22.78796, 5.52718
import time
from collections import namedtuple
import gi
import re
import numpy
from enum import Enum
gi.require_version("Gst", "1.0")
gi.require_version("Tcam", "1.0")