Exploring the digital world!

Dedicated to exploring the digital world with a focus on data extraction and visualization using tools like Leaflet and D3.


Displaying GeoJSON data of the great loop


Displaying data of the States in D3

Leaflet great loop map code:

import L from "leaflet"
import greatloop from "../GeoJSON/greatloop.json"
import home from "../GeoJSON/homeIcon.svg"
// JSX for my react application
// first "invisible" icon
var smallIcon = new L.Icon({
  iconUrl: home,
  iconSize: [0.0, 0.0],
  iconAnchor: [0, 0],
}) ="home_map", {
  center: [37.9404, -77.8943],
  zoom: 3,
  layers: [
    L.tileLayer("http://{s}{z}/{x}/{y}.png", {
        '&copy; <a href="">OpenStreetMap</a> contributors',

L.geoJSON(greatloop, {
  pointToLayer: function (feature, latlng) {
    return L.marker(latlng, { icon: smallIcon })
// JSX for my react template
<div id="home_map" style={{ height: "200px" }}></div>

D3 state data code:

import * as d3 from "d3"
import * as topojson from "topojson"
import us from "../GeoJSON/states-albers-10m.json"
// in the componentDidMount
const width = 975;
const height = 610;

const zoom = d3.zoom()
    .scaleExtent([1, 8])
    .on("zoom", zoomed);

const svg =
    .attr("viewBox", [0, 0, width, height])
    .attr("width", width)
    .attr("height", height)
    .attr("style", "max-width: 100%; height: 200px;")
    .on("click", reset);

const path = d3.geoPath();

const g = svg.append("g");

const states = g.append("g")
    .attr("fill", "#444")
    .attr("cursor", "pointer")
  .data(topojson.feature(us, us.objects.states).features)
    .on("click", clicked)
    .attr("d", path);

    .text(d =>;

    .attr("fill", "none")
    .attr("stroke", "white")
    .attr("stroke-linejoin", "round")
    .attr("d", path(topojson.mesh(us, us.objects.states, (a, b) => a !== b)));;

function reset() {
  states.transition().style("fill", null);
    d3.zoomTransform(svg.node()).invert([width / 2, height / 2])

function clicked(event, d) {
  const [[x0, y0], [x1, y1]] = path.bounds(d);
  states.transition().style("fill", null);"fill", "red");
      .translate(width / 2, height / 2)
      .scale(Math.min(8, 0.9 / Math.max((x1 - x0) / width, (y1 - y0) / height)))
      .translate(-(x0 + x1) / 2, -(y0 + y1) / 2),
    d3.pointer(event, svg.node())

function zoomed(event) {
  const {transform} = event;
  g.attr("transform", transform);
  g.attr("stroke-width", 1 / transform.k);
// template
<svg ref="home_graph"></svg>

Continuos development of the monkcode information system, a set of components that gathers data autonomously and makes content.

Leveraging what I can with as much help as I can promt from ChatGPT.

Learn how to create, store, process, and distribute information. Use github actions or bitbucket pipelines to start your own information system today. Zapier, provides automation at scale across most common accounts.

XML Sitemap