Data, Maps, Usability, and Performance

API canvas d3 data geo GeoJSON html5 image JavaScript json maps mysql PHP WordPress

Online Image Editor and Photo Collage Maker

Online Image Editor

CanvasEdit – the HTML5 Photo Editor and Collage Creator

Recently, a few image editors have been created with HTML5 and Canvas. Today, I decided to build by own Photo Editor by using UI Kit for layout, FabricJS for Canvas manipulation, Color Thief for retrieving a color palette from an image, Spectrum for a color picker and other libraries like Say Cheese for integrating pictures from a webcam and noUiSlider for a nice range slider. Since I have previously covered building Instagram photo filters with HTML5, these are also included in the image editor.
Read more

Map Maker and Editor with D3.js

map creator and map designer

After building a bunch of D3 map demos, I wanted to combine them all into a Map building tool, a Map Creator based on GeoJSON or TopoJSON with many design features, editing capabilities, and proper export to SVG or PNG. It started out as an enhancement to this GeoJSON and TopoJSON Visualizer and D3 Map Starter Template. I wanted to finally use dat.GUI as a visual controller for map creation. I added some preselected maps of the world, individual countries, and even states as well as the ability to add your own map data. You can change the map projection, resize the map container, and control various design elements from colors, opacity, stroke, and even textures via Textures.js.

You also have some powerful editing capabilities: ability to remove individual objects from the map and ability to merge objects together. The best thing is that you can edit the shape of any object by clicking on it and and zooming in. This exposes small green circles on object borders that can be dragged around and the drag event changes the object shape by automatically editing the SVG path data. My previous examples on working with SVG graphics helped in adding this feature. The final image can be saved as SVG or PNG using code from the Save SVG as PNG article. Finally, I integrated SimpleModal which has a textarea where you can add points (latitude, longitude, and location name) that get added as markers on the map.
Read more

Image Proxy with Google App Scripts

google app script example

I have been a big fan of Google App Scripts. This service allows you to build powerful scripts that can be scheduled and integrated with Google (email, Google Docs, Excel) and external APIs. You write in JavaScript, within a browser based code editor right in Google Drive and the script can even be published as a web app. The quotas or limits are pretty good so you can quickly build something powerful for free.

Today, I will show how to create an Image Proxy with Google App Scripts which would allow you to grab images from other domains or go around the browser’s same-origin policy. Basically, the Google App Script is a server side proxy for your client side request. So, if you are exporting SVG as an image with images hosted on another domain or saving HTML5 Canvas with toDataURL() method, this could help you avoid tainted canvas and browser security errors. But, really, it’s just a simple example of a Google App Script published as a web app.
Read more