Skip to content

Instantly share code, notes, and snippets.

View Hirosaji's full-sized avatar
🍙
Working@paper company

Hiroya Kato Hirosaji

🍙
Working@paper company
View GitHub Profile
@Hirosaji
Hirosaji / .block
Last active December 29, 2023 13:14
three-vrm - VRM motion capture by PoseNet
# three-vrm - VRM motion capture by PoseNet
license: mit
@Hirosaji
Hirosaji / .block
Last active February 9, 2023 23:27
Mapbox - Extruding circles (simple)
Mapbox - Extruding circles (simple)
license: mit
@Hirosaji
Hirosaji / ScrollyTelling_with_FreeCameraAPI_snippet.js
Created August 4, 2021 15:18
ScrollyTelling with FreeCamera API snippet
...
// get the overall length of each route so we can interpolate along them
const routeLength = turf.length(turf.lineString(targetRoute));
const cameraRouteLength = turf.length(turf.lineString(targetRoute));
function frame() {
...
// use the rate to get a point that is the appropriate length along the route
// this approach syncs the camera and route positions ensuring they move
@Hirosaji
Hirosaji / formatIcePolygon.js
Last active July 26, 2021 09:28
format Arctic sea ice Polygon data
const fs = require('fs');
const geojson = JSON.parse(fs.readFileSync('./input.geojson', 'utf8'));
const splitIndexes = [];
geojson.features.forEach(a => {
const _data = [];
a.geometry.coordinates.forEach(b => {
const __data = [];
b.forEach((c, i) => {
if (i !== 0 && Math.abs(c[0] - b[i - 1][0]) > 180) __data.push(i);
@Hirosaji
Hirosaji / .block
Last active July 21, 2021 02:33
Mapbox - ScrollyTelling with FreeCamera API
license: mit
@Hirosaji
Hirosaji / .block
Last active June 21, 2021 05:49
d3v5 - Selective Projection Map
# d3v5 - Selective Projection Map
license: mit
@Hirosaji
Hirosaji / .block
Last active February 23, 2021 07:38
Mapbox - Extruding circles (gradient)
Mapbox - Extruding circles (gradient)
license: mit
@Hirosaji
Hirosaji / .block
Last active February 23, 2021 07:38
Mapbox - Extruding circles (choropleth)
Mapbox - Extruding circles (choropleth)
license: mit
@Hirosaji
Hirosaji / .block
Last active February 23, 2021 07:38
Mapbox - Extruding circles (stacked)
Mapbox - Extruding circles (stacked)
license: mit
@Hirosaji
Hirosaji / IntersectionObserver.js
Last active September 1, 2020 05:37
Script using Intersection Observer API
function setObserver(targetElementsClassName) {
// vars for Intersection Observer as scroll event
const ObserverObj = {
previousY: 0,
previousRatio: 0,
loadCount: 0,
taegetElements: d3.selectAll(targetElementsClassName),
loadMax: ObserverObj.taegetElements.size(),
}