File talk:Template map of US states and District of Columbia.svg/Instructions
- Note. The instructions are in this talk subpage because subpages are not allowed for file pages.
- Note. This all started in this long discussion. Which continued here. And then here.
- Note. See also: Commons: Map resources.
- Note. See old template map, and instructions.
Purpose
[edit]These SVG maps have user-editable sections (any text editor) to allow creation of more maps on more topics. Just paste in a list of states and values. See examples here:
Feel free to create map templates for other countries too. Cmglee may be able to help with that.
Latest template map
[edit]File:Template map of US states and District of Columbia.svg - By CMG Lee.
The template map can be used to create US SVG maps by pasting in a list of states with values.
![](https://upload.wikimedia.org/wikipedia/commons/thumb/5/58/Template_map_of_US_states_and_District_of_Columbia.svg/400px-Template_map_of_US_states_and_District_of_Columbia.svg.png)
Some maps created with the latest template
[edit]- Note: See Category:English-language SVG maps of the United States made with templates for maps made with both templates.
See maps created or updated with the latest template:
- File:US map of incarceration rates per 100,000 residents.svg
- File:Map of US minimum wage by state.svg
- File:Homicide rates per 100,000 by state. CDC. US map.svg
- File:Homicide rates per 100,000 by state. FBI. US map.svg
- File:Maternal mortality rates per 100,000 births by state. US map.svg
Maps created or updated with this template |
---|
Instruction summary. New map template
[edit]- Note: Any SVG file created with this template can also be a template.
- Note: This only works with the Firefox browser.
- Open the main SVG template file (or a subsequent SVG file with the same script generator) in a text editor.
- Replace (or amend) parts indicated with relevant data:
- In the list following the line "const state_space_value...", amend the values, or paste in a new list of states and values. Remove commas from numbers. If a value is unavailable, leave the value blank.
- Adjust title, description, font sizes, colors, etc, if necessary. All of this is done in the "SVG-specific JavaScript" section at the end.
- Delete the
!--
on the line withGENERATOR_SCRIPT
, and--
on the last line. - Save as an SVG file.
- Open the SVG file in Firefox to generate the changes.
- The changes will be showing in the map. But the map must be saved again to keep the changes.
- Upload the changed SVG file to the Commons.
More instructions
[edit]- Note: See the old instruction page for the old template for some still-relevant info.
These instructions are for a list of states followed by a space, followed by a value. Multiple spaces work. Tabs work.
States can be full names, or USPS 2-letter abbreviations. There can be a mix of them in the list.
Order of states does not matter. States that are missing from the list altogether, or missing data, will show "n/a" on the map.
"DC" or "D.C." in the list works. As does "Washington D.C." or "Washington DC".
Do not use "District of Columbia". Number will be removed from it.
Choose parameter values
[edit]If you are updating an existing map, then these values are already set. In the user-editable "SVG-specific JavaScript" section at the end you can choose values for the following:
Title and description. Examples are shown. Title is on the map at the top, and on the browser tab. Description is internal and is seen by search engines, etc., and can be longer.
- const out_title = 'State minimum wages, in dollars. July 1, 2024';
- const out_desc = 'State minimum wages, in dollars. July 1, 2024';
How to mark states with no data. Blank, n/a, N/A, etc.:
- const no_data_value = 'n/a';
Decimal place to show on map. 0, 1, 2, etc.:
- const decimal_place = 1;
Font sizes:
- .title { font-size:40px; letter-spacing:0; }
- .legend { font-size:30px; }
- .state { font-size:17px; }
- .value { font-size:17px; }
Colors. Minimum, maximum, n/a:
- .min { fill:#99ffff; }
- .max { fill:#ff6600; }
- .n_a { fill:#eeeeee; }
Possible maps
[edit]Some of the below pages have maps and graphs. They can be copied to the Commons via Template:PD-map and Template:PD-chart. They are in the public domain (read PD template pages). This option is for people who haven't yet figured out the new template to put state-by-state data in numerical form right on a US map. |
Some stats from these pages can be used to create US maps:
- https://expressdentist.com/dental-health-ranked-by-state
- https://wallethub.com/edu/states-with-best-worst-dental-health/31498
"More than 800 up-to-date health indicators at the state level can be mapped, ranked, and downloaded":
- https://www.kff.org/statedata
- https://www.kff.org/other/state-indicator/firearms-death-rate-per-100000
CDC. Stats of the States:
Map workshops of the Graphic Labs
[edit]You can get help here: