Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Learning D3.js Mapping
  • Toc
  • feedback
Learning D3.js Mapping

Learning D3.js Mapping

By : Newton, Oscar Villarreal
4.3 (7)
close
Learning D3.js Mapping

Learning D3.js Mapping

4.3 (7)
By: Newton, Oscar Villarreal

Overview of this book

If you are interested in creating maps for the web GIS data, this book is for you. Familiarity with D3.js will be helpful but is not necessary.
Table of Contents (9 chapters)
close
6
6. Finding and Working with Geographic Data
8
Index

Rectangle

The basic HTML code to create a rectangle is as follows:

<rect width="100" height="20" x="10" y="10"></rect>

Let's apply the following style:

      rect {
        stroke-width: 1;
        stroke:steelblue;
        fill:#888;
        fill-opacity: .5;
      }

We will create a rectangle that starts at the coordinates (10,10), and is 100 pixels wide and 20 pixels high. Based on the styling, it will have a blue outline, a gray interior, and will appear slightly opaque. See the following output and example http://localhost:8080/chapter-2/rectangle.html:

Rectangle

There are two more attributes that are useful when creating rounded borders (rx and ry):

<rect with="100" height="20" x="10" y="10" rx="5" ry="5"></rect>

These attributes indicate that the x and y corners will have 5-pixel curves.

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete