background preloader

Javascript

Facebook Twitter

FRAMEWORKS & LIBRARIES JavaScript. Tutorial - Creating an Interactive SVG map - Blog - Parallax. Over the past few years there’s been an increasing demand from our clients for interactive maps, whether it be for shopping centres, housing developments or just geographical maps. Most recently, I was tasked with creating a masterplan (architectural, not the evil villain kind) for Little Kelham, a property development at Kelham Island in Sheffield built by Citu. They needed two versions of the masterplan: a map to highlight the residential properties they have available, and a map for their commercial properties. Each plot needed to have its own well defined shape and have a hover state & click events. What am I making?

In this tutorial we’re going to be drawing vector graphics in the browser using a combination of SVG (Scalable Vector Graphics) and an excellent JavaScript framework called Raphaël to create a map of the United Kingdom. SVG is supported in most browsers except IE8 and below. How will it look? View Demo Download the source How do I make it? Tip: save your progress often! US State Map. Snap.svg Tutorial. Interactive Map with d3.js - TNODA. This is an interactive map. Please click United States, Japan or their states/prefectures to see zoom animation. 1 Gather Geo Data d3.js doesn't come with geo data, so let's get country, state/province and city data first. Natural Earth is one of the best sources for Earth data. When you go to the download page, there are three data scales: 1:10m, 1:50m and 1:110m. 1:10m has the most detailed data but is the largest file size, which is not usually suitable for web application data. 2 Shapefile GeoJSON Topojson Once you download and unzip them, you can find a bunch of files with different file extensions.

Install GDAL To convert a shapefile into GeoJSON, we'll use a command line tool, ogr2ogr in Geospatial Data Abstraction Library - GDAL. > brew install gdal Install Topojson Another CLI tool that we use will use is topojson, which converts GeoJSON to Topojson. > npm install -g topojson 3 Convert Files Let's start with the countries shapefile. Exclude Antarctica Pick attributes 4 Simplify Files A. Building Great Web Maps: A D3.js Tutorial. Data Driven Documents, or D3.js, is “a JavaScript library for manipulating documents based on data”. Or to put it more simply, D3.js is a data visualization library. It was developed by Mike Bostock with the idea of bridging the gap between static display of data, and interactive and animated data visualizations.

D3 is a powerful library with a ton of uses. In this tutorial, I’ll discuss one particularly compelling application of D3: map making. We’ll go through the common challenges of building a useful and informative web map, and show how in each case, D3.js gives capable JavaScript developers everything they need to make maps look and feel beautiful. What is D3 used for? D3.js can bind any arbitrary data to a Document Object Model (DOM), and then, through the use of JavaScript, CSS, HTML and SVG, apply transformations to the document that are driven by that data.

At its simplest, D3.js can be used to manipulate a DOM. <! D3 for Maps and Geographic Data Visualization Raster Maps. Datamaps/README.md at master · markmarkoh/datamaps. SVG To RaphaelJS Converter - Ready.Set.Raphael. Beta 2. JS Bin - Collaborative JavaScript Debugging. jQuery.

Three.js - documentation - Manual - Creating a scene. Raphaël—JavaScript Library. SVG Animations Using CSS and Snap.svg. Today I wanted to share with you the ease of animation in SVG with the tools we have available to us today. SVG is still one of those subjects that can scare away a lot of developers, but I'm here to show you hopefully just how easy it can be. While doing my usual search on the internet for inspiration, I came across this great post on From Up North. As you can see, there are some beautiful illustrations by Miguel Sousa aka Heymikel, Snack Studio, Martín Feijoó & Sara Enríquez.

As soon as I saw the animations, the first thing that came to mind was how these could be made into SVG animations to be used freely on the internet. Let's get to it There are a few different implementations, some with the focus more on the Snap.svg side of things, then also combining both Snap.svg and CSS animations. Preparation The first part of any SVG project should be spent optimising your SVG's, hopefully in your case you have either created them yourself or will have a nice SVG supplied by your design team.

JSLint,The JavaScript Code Quality Tool. Understanding the four layers of JavaScript OOP. JavaScript OOP is baffling: on one hand, there is a simple core, on the other hand, there are some really weird things going on. I’ve been pondering for a long time how to explain it well and I think the best way to do so is via four layers: single objects, prototype chains, constructors, constructor inheritance. The first two layers are JavaScript’s simple OOP core, layers 3 and 4 are where the complications start. I’ve explained the four OOP layers in an O’Reilly webcast: Video on YouTube (starts later to avoid duplicated content at the beginning)SlidesFull webcast (requires Flash, but the audience’s comments in the chat are interesting) Additional material: “In defense of JavaScript’s constructors” explains my – conservative – recommendation of constructors“JavaScript’s ‘this’: how it works, where it can trip you up”Chapter “Objects and Inheritance” in the online version of “Speaking JavaScript”

Tutorials · mbostock/d3 Wiki. Wiki ▸ Tutorials Please feel free to add links to your work!! Tutorials may not be up-to-date with the latest version 4.0 of D3; consider reading them alongside the latest release notes, the 4.0 summary, and the 4.0 changes. Introductions & Core Concepts Specific Techniques D3 v4 Blogs Books Courses D3.js in Motion (Video Course)Curran Kelleher, Manning Publications, September 2017D3 4.x: Mastering Data Visualization Nick Zhu & Matt Dionis, Packt.

Talks and Videos Meetups Research Papers D3: Data-Driven DocumentsMichael Bostock, Vadim Ogievetsky, Jeffrey HeerIEEE Trans. Learning JavaScript Design Patterns. Design patterns are reusable solutions to commonly occurring problems in software design. They are both exciting and a fascinating topic to explore in any programming language. One reason for this is that they help us build upon the combined experience of many developers that came before us and ensure we structure our code in an optimized way, meeting the needs of problems we're attempting to solve. Design patterns also provide us a common vocabulary to describe solutions. This can be significantly simpler than describing syntax and semantics when we're attempting to convey a way of structuring a solution in code form to others.

In this book we will explore applying both classical and modern design patterns to the JavaScript programming language. Target Audience This book is targeted at professional developers wishing to improve their knowledge of design patterns and how they can be applied to the JavaScript programming language. Acknowledgments Credits Reading We already use patterns everyday. ImageMapster. ImageMapster is a jQuery plugin that lets you activate HTML image maps without using Flash. It works just about everywhere that Javascript does, including modern browsers, Internet Explorer 6, and mobile devices like iPads, iPhones and Androids.

Note: ImageMapster used to be distributed as a ZIP archive. You can still download the full package including examples and source as a zip from GitHub but I will no longer be building a version-specific ZIP file with each release. PLEASE STOP HOTLINKING! Bandwidth on my web host has skyrocketed recently and I can't afford it, so I've disabled hotlinking to jquery.imagemapster.js on this site. This data is obtained in (almost) real time from github. This web site uses CsQuery - a feature-complete (as of 2/12) server side implementation of jQuery written in C# that I've been working on since early 2011. For grabbing data, it's much faster than using client-side requests because the end-user will never wait for the request to complete. The Basics of Object-Oriented JavaScript.

Over recent years, JavaScript has increasingly gained popularity, partly due to libraries that are developed to make JavaScript apps/effects easier to create for those who may not have fully grasped the core language yet. While in the past it was a common argument that JavaScript was a basic language and was very 'slap dash' with no real foundation; this is no longer the case, especially with the introduction of high scale web applications and 'adaptations' such as JSON (JavaScript Object Notation). JavaScript can have all that an Object-Orientated language has to offer, albeit with some extra effort outside of the scope of this article. Congratulations, you just created an object. There are two ways to create a JavaScript object: they are 'Constructor functions' and 'Literal notation'. The one above is a Constructor function, I'll explain what the difference is shortly, but before I do, here is what an Object definition looks like using literal notation.

So which one should you use? JSbooks - free javascript books. DOM Inspector. Chartist - Simple responsive charts. You may think that this is just yet an other charting library. But Chartist.js is the product of a community that was disappointed about the abilities provided by other charting libraries. Of course there are hundreds of other great charting libraries but after using them there were always tweaks you would have wished for that were not included. Highly customizable responsive charts Facts about Chartist The following facts should give you an overview why to choose Chartists as your front-end chart generator: Simple handling while using convention over configurationGreat flexibility while using clear separation of concerns (Style with CSS & control with JS)Usage of SVG (Yes! These projects and wrapper libraries are known to me right now that either use Chartist.js or wrap them into a library for usage in a framework.

Cross-browser support Note that CSS3 animations on SVG CSS attributes are not supported on all browsers and the appearance may vary. Snap.svg - Home. Browserify. Code Monster from Crunchzilla. <h2>Code Monster use Javascript. Please enable Javascript if you want the play with the Code Monster. Otherwise, Code Monster will not be able to play with you.

</h2> I'm Code Monster! Getting Started Lesson 1 BACK How to Play | Lesson Sections | About | FAQ | Terms of Use | Privacy | Contact | © 2014 How to Play Code Monster teaches kids and adults a little about Javascript programming! It's easy to play. Click on the Reset button if you really mess up your code and want to start over on a lesson. Code Monster saves what lesson you are on, so feel free to stop at any time and come back later.

Have fun! About Code Monster from Crunchzilla is an interactive tutorial for kids that focuses on action. Projects start with simple boxes and colors, rapidly progressing into exciting experiments with simple animation and fractals. Code Monster is a gentle and fun introduction to programming concepts. Code Monster is based in Seattle, WA. Frequently Asked Questions What is the c in things like c.save()? Vivus.js - svg animation.