Skip to content

Instantly share code, notes, and snippets.

@kkdd
kkdd / README.md
Last active September 5, 2022 13:13
Drawing cumulative density function
@kkdd
kkdd / README.md
Last active September 7, 2022 14:05
d3.js_lines_multiple (with tooltip)
@kkdd
kkdd / README.md
Last active April 23, 2022 19:51
await asynchronous functions

executed in order of waitTimes = [600, 400, 200].

@kkdd
kkdd / index.html
Last active May 19, 2022 06:44
Leaflet map
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css"/>
<script src="https://unpkg.com/leaflet@1.8.0/dist/leaflet.js"></script>
<style>
html, body {height: 100%; margin: 0; padding: 0;}
#map {height: 100%;}
</style>
</head>
@kkdd
kkdd / README.md
Last active April 29, 2022 08:58
regl + apache-arrow: fast WebGL scatter plot
@kkdd
kkdd / README.md
Last active May 25, 2022 06:18
d3.js: Zoomable scatterplot with handling window-resize
@kkdd
kkdd / README.md
Last active May 17, 2022 06:02
d3.js chart: handling window-resize

Run this example in a full screen, or click "Open".

data

$ curl https://raw.githubusercontent.com/holtzy/data_to_viz/master/Example_dataset/3_TwoNumOrdered_comma.csv | head -n4
date,value
2013-04-28,135.98
2013-04-29,147.49
@kkdd
kkdd / README.md
Last active March 24, 2024 03:28
deck.gl trips-layer animation: reading trips files dropped-onto

getting trips-json files

$ cat trips.json 
[{"vendor":0,"path":[[139.8007914,35.5144044],[139.9108676,35.4396142]],"timestamps":[0,600]},{"vendor":1,"path":[[139.9108139,35.439529],[139.8008987,35.5140027]],"timestamps":[0,600]}]
$ wget https://raw.githubusercontent.com/visgl/deck.gl-data/master/examples/trips/trips-v7.json
@kkdd
kkdd / city.jsonl
Last active January 14, 2022 07:13
geojson stream (from [Fetch APIのStream機能を使ってデータを読み込みながら地図を描画する](https://gunmagisgeek.com/blog/javascript/6054))
{"type":"Feature","properties":{"JCODE":"27219","KEN":"大阪府","SICHO":null,"GUN":null,"SEIREI":null,"SIKUCHOSON":"和泉市","uid":"code27219","_都道府県":"大阪府","_市区町村":"和泉市","_所得2017":3283.330972,"_都道府県名2012":"大阪府","_団体名2012":"和泉市","_所得2012":3240.948385,"_都道府県名2012_1":"大阪府","_団体名2012_1":"和泉市","_所得2010":3259.636899,"_比率2017_2010":0.73},"geometry":{"type":"MultiPolygon","coordinates":[[[[135.43185295549185,34.511161888882654],[135.4304551347164,34.51012711347982],[135.43042895259916,34.510113200181124],[135.43039984167586,34.51010757547775],[135.4303703610387,34.51011073382787],[135.4303431022808,34.510122397586265],[135.42967598728075,34.510534270586284],[135.4296524018514,34.51055450728067],[135.4296361679811,34.510581007426566],[135.429628853531,34.51061121164973],[135.4296311649279,34.51064220283754],[135.42964287893804,34.51067098787261],[135.42966286422666,34.510694786706964],[135.4310268462267,34.51188209370691],[135.4310547593534,34.51189927054821],[135.43108672685176,34.511906500041206],[135.43111931481616,34.511
@kkdd
kkdd / index.html
Last active February 26, 2022 16:10
Leaflet map: reading GeoJSONL/flatgeobuf files dropped-onto
<html lang="en">
<head>
<title>streaming GeoJSONL/flatgeobuf by dropping-on</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css">
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script src="https://unpkg.com/flatgeobuf@3.21.3/dist/flatgeobuf-geojson.min.js"></script>
<style>
body { margin:0; padding:0; }