Jump to content

User talk:Timeshifter/Map of US minimum wage by state

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Note: This discussion started here: Wikipedia:Graphics Lab/Illustration workshop. There is a signature icon on the editing toolbar of user talk pages such as this one. Unlike on user non-talk pages and subpages.

Part 1

[edit]

Commons: File:Map of US minimum wage by state.svg. Can you update this map to Jan 1, 2023? See List of US states by minimum wage. It has those numbers.

Can you make an SVG map where one can update it just by pasting in a list of states with minimum wages? For example by copying this simple list for 2023:

Commons:File:Map of US minimum wage by state.svg is used in:

I see some other SVG US maps with state names that could also be a starting point:

The map needs to be colored according to the wage. Note the color bar at the bottom of the map. --Timeshifter (talk) 23:08, 7 March 2023 (UTC)[reply]

Discussion
You might like to consider alternative approaches to maintaining this graphic via Wikidata and MapLink - see the Republican-Democrat map example at Template:Maplink. Shyamal (talk) 05:32, 8 March 2023 (UTC)[reply]
@Cmglee: - any alternative suggestions? Shyamal (talk) 08:03, 8 March 2023 (UTC)[reply]
Shyamal. Is there a link to that finished map? Without having to copy all the map code. --Timeshifter (talk) 06:42, 10 March 2023 (UTC)[reply]
@Timeshifter: Sorry, that did not work - but I have left File:US states with ids.svg, Data:US_states.map and Template:Graph:Map/Inner/USA-json in the process. Shyamal (talk) 09:29, 10 March 2023 (UTC)[reply]
Commons:Data:US_states.map
Thanks Shyamal. I meant a link like this link to the Republican-Democrat map example at
Template:Maplink#/map/11.
Is there a link to that multi-colored world map that is posted higher up. In the wikiext it starts off:
{{Graph:Highlighted world map by country ...
--Timeshifter (talk) 11:03, 10 March 2023 (UTC)[reply]
@Timeshifter: will see if I can get some help from someone who knows SPARQL better than me. Also it needs the Wikidata info on US states to have the per capita incomeminimum wage - properties added. Shyamal (talk) 03:58, 11 March 2023 (UTC)[reply]
There's the map mode of the Graph extension, though I'm unsure what basemap to use to show US states. See Template:Graph:Map. Good luck, cmɢʟeeτaʟκ 08:30, 8 March 2023 (UTC)[reply]
Can someone set this up? I have no skills in this area, and limited health and time. So I stick to the skills I have with tables, etc..
I had forgotten the file extension:
Commons: File:Map of US minimum wage by state.svg.
--Timeshifter (talk) 08:41, 8 March 2023 (UTC)[reply]
@Timeshifter: Can you please read the documentation of the Graph extension Map mode and do a little research e.g. [1] and [2] to see if there's an existing US states map mode? If so, I can set it up for you. Cheers, cmɢʟeeτaʟκ 10:55, 8 March 2023 (UTC)[reply]
I will try and help - I just created this https://commons.wikimedia.org/wiki/Data:US_states.map - now to examine the other parts. Shyamal (talk) 11:00, 8 March 2023 (UTC)[reply]
Thanks. Will we end up with a map that can be shared outside Wikipedia? --Timeshifter (talk) 11:16, 8 March 2023 (UTC)[reply]
@Timeshifter I see you've already asked about it on the template talk page. cmɢʟeeτaʟκ 11:28, 8 March 2023 (UTC)[reply]

cmglee. I had forgotten about that thread about a different type of US map. I wonder if there are US base maps now for this template. That is an old thread. Much later I found this non-template map elsewhere and uploaded it:

--Timeshifter (talk) 11:46, 8 March 2023 (UTC)[reply]

I have tried various things to get this to work but I think there must be some issue here - https://wiki.riteme.site/wiki/Template:Graph:Map/Inner/USA-json Shyamal (talk) 12:31, 8 March 2023 (UTC)[reply]
Yes, I tried setting the basemap parameter to various forms of your JSON (and for that matter http://wiki.riteme.site/wiki/Template:Graph:Map/Inner/Worldmap2c-json) but it always came out blank. Anyone here knows how to use it? Cheers, cmɢʟeeτaʟκ 12:14, 9 March 2023 (UTC)[reply]
Pinging Shyamal in case the above reply was missed in this long thread. --Timeshifter (talk) 06:42, 10 March 2023 (UTC)[reply]

Am I imagining that there are plug-and-play SVG maps that are easily updated by pasting in a text list? I thought they existed. I have done a lot of editing of tables, and see various state and country lists that have data that would be more useful if the numbers were on the map for each state or country. Especially when combined with a color bar legend. I edit Help:Table and Help:Sortable tables, and so I know how to convert the data from a column to a text list. With the state or country names to the left of the data. So a multi-purpose USA SVG map could be used for many topics: Minimum wages, cumulative Covid death rates, incarceration rates, rate of uninsured, and much more. With the data on the map. Not just a color bar legend, and coloration of states or countries. --Timeshifter (talk) 20:23, 8 March 2023 (UTC)[reply]

It's actually not too hard to make a blank map in which each state can be assigned a colour, but it will require the blank map users to do the colour interpolation (i.e. assigning the appropriate colour between 0% and 100%) themselves. A trick I could use is to draw each state twice, the underlayer in the colour corresponding to 0%, and the overlayer in the colour corresponding to 100% but with the appropriate percentage opacity. It would work for simple percentages, but if it's interpolating between a minimum and maximum value, the user must calculate the percentages to use. The data to be entered by the user will look something like this:
...
.font_data     { font-family:Times; font-size:20px; }
.color_minimum { fill:#ff0000; }
.color_maximum { fill:#99ccff; }
...
<use xlink:href="#ak" fill-opacity="0.00"/><text id="ak_data">123</text>
<use xlink:href="#ar" fill-opacity="0.50"/><text id="ar_data">246</text>
<use xlink:href="#az" fill-opacity="1.00"/><text id="az_data">369</text>
<use xlink:href="#xx" fill-opacity="0.00"/><text id="ca_data">n/a</text>
...
(the number after <text, and the fill-opacity value – if the state is to be greyed out, an invalid xlink:href can be specified e.g. xx). The font size can be set to avoid overly large text strings overrunning.
If this is desired, let me know. cmɢʟeeτaʟκ 12:35, 9 March 2023 (UTC)[reply]
cmglee. Thanks!. Anything that simplifies the process is good. The main thing is to have one location in the SVG file data where this list resides. Your list or eventually just a simple list. Or maybe a comma-separated values list.
See Template:Cell color and its "What links here" uses:
Special:WhatLinksHere/Template:Cell color. For example:
List of countries by past life expectancy
The template does the color calculation.
Maybe Guarapiranga has some ideas.
Maybe create a tool to paste in a list of numbers, and the tool spits out the list with the opacity numbers too.
I wonder how Our World in Data does the frequent updates of their maps with color bar legends. Scroll down to the OWID maps on this page:
COVID-19 pandemic by country and territory
--Timeshifter (talk) 16:06, 9 March 2023 (UTC)[reply]

The above map was created for free on MapChart.net:

All their maps are CC-BY-SA. See Commons:Template:Mapchart.net. I wonder if this is easy to do. Maybe Radom1967 can tell us how he created this map. --Timeshifter (talk) 22:06, 9 March 2023 (UTC)[reply]

I colored blank map on
https://www.mapchart.net/europe.html
Then I added numbers on countries with Paint.NET program (https://www.getpaint.net) Radom1967 (talk) 01:10, 10 March 2023 (UTC)[reply]
Thanks. Note that the maps are JPEG not SVG, @Timeshifter Cheers, cmɢʟeeτaʟκ 02:25, 10 March 2023 (UTC)[reply]
cmglee. I am just trying to find any way to easily update US maps that need regularly updated data, and have a color bar. I'll take any extension I can get at this point. I googled, and don't think Paint.net does SVG saves. Not sure.
Can you tell how OWID is updating their SVG and PNG maps so often:
commons:File:World map of total confirmed COVID-19 deaths per million people by country.svg
--Timeshifter (talk) 06:28, 10 March 2023 (UTC)[reply]
Paint.net is a [raster] image editor, so isn't the correct tool for SVG. Appropriate ones are Inkscape (free) and Adobe Illustrator (commercial).
I've no idea how OWID does things; it's likely they've a custom program to output the SVG and PNG.
I'll knock up a blank US states map using the map in this SVG web game over the weekend, unless you have a different map to use.
Cheers,
cmɢʟeeτaʟκ 07:14, 10 March 2023 (UTC)[reply]
cmglee. Interesting:
File:Mapquiz USA states SMIL.svg
Wikipedia:SVG help/Archive 8#Implementing counters and timers in SVG without JavaScript
I have edited SVG files by converting an SVG file to a text file by changing the extension. Then I edit with a text editor such as Notepad++. Then I add back the SVG extension to look at it. --Timeshifter (talk) 07:40, 10 March 2023 (UTC)[reply]
That's great – as you're comfortable editing text files in Notepad++, I'll make a human-editable SVG with comments to ease populating data.
The map game was an experiment in creating dynamic/interactive SVG. I'd prefer to make a timer stop when all states are identified, but resorted to having three lives as I couldn't make the former. cmɢʟeeτaʟκ 14:06, 10 March 2023 (UTC)[reply]

Part 2

[edit]
Return to top.
Template map of USA states and D.C.
@Timeshifter:@Shyamal: Please see File:Template_map_of_usa_states_and_dc.svg.
If you load the SVG file in a text editor, it should be obvious where the data goes.
Should you decide to use it, please save your version as a new file instead of overwriting the template.
Good luck!
cmɢʟeeτaʟκ 16:43, 11 March 2023 (UTC)[reply]
Cmglee. Thanks! I left a note at:
commons:File talk:Map of US minimum wage by state.svg
Wikideas1, Guarapiranga, and Radom1967. Please have a look at this. Can this be simplified further? Maybe some regular expression applied to a list of numbers that gives the opacity for each of those numbers? --Timeshifter (talk) 18:31, 11 March 2023 (UTC)[reply]

See User:Timeshifter/Sandbox187. Here is the Jan 1, 2023 US minimum wage list copied from that sandbox:

List. State first.
State 2023 minimum wage
Alabama $7.25
Alaska $10.85
Arizona $13.85
Arkansas $11.00
California $15.50
Colorado $13.65
Connecticut $14.00
Delaware $11.75
Florida $11.00
Georgia $7.25
Hawaii $12.00
Idaho $7.25
Illinois $13.00
Indiana $7.25
Iowa $7.25
Kansas $7.25
Kentucky $7.25
Louisiana $7.25
Maine $13.80
Maryland $13.25
Massachusetts $15.00
Michigan $10.10
Minnesota $10.59
Mississippi $7.25
Missouri $12.00
Montana $9.95
Nebraska $10.50
Nevada $10.50
New Hampshire $7.25
New Jersey $14.13
New Mexico $12.00
New York $14.20
North Carolina $7.25
North Dakota $7.25
Ohio $10.10
Oklahoma $7.25
Oregon $13.50
Pennsylvania $7.25
Rhode Island $13.00
South Carolina $7.25
South Dakota $10.80
Tennessee $7.25
Texas $7.25
Utah $7.25
Vermont $13.18
Virginia $12.00
Washington $15.74
Washington, D.C. $16.50
West Virginia $8.75
Wisconsin $7.25
Wyoming $7.25

--Timeshifter (talk) 07:21, 12 March 2023 (UTC)[reply]

Was able to tailor a Wikidata query - https://w.wiki/6S3o but no idea how to make a graded coloration. Shyamal (talk) 11:47, 12 March 2023 (UTC)[reply]
Please list the states by USPS 2-letter abbreviations. Cheers, cmɢʟeeτaʟκ 13:29, 12 March 2023 (UTC)[reply]

Shyamal and cmglee. I am willing to abandon range coloration for now. First I am looking for a way to paste in the wages all at once. Maybe into a simpler template. Here is another wages list below. This time the wages are first. It is very easy and fast to create these lists. See User:Timeshifter/Sandbox187. It now has both lists.

List. 2023 wages first.
2023   State
$7.25  Alabama
$10.85 Alaska
$13.85 Arizona
$11.00 Arkansas
$15.50 California
$13.65 Colorado
$14.00 Connecticut
$11.75 Delaware
$11.00 Florida
$7.25  Georgia
$12.00 Hawaii
$7.25  Idaho
$13.00 Illinois
$7.25  Indiana
$7.25  Iowa
$7.25  Kansas
$7.25  Kentucky
$7.25  Louisiana
$13.80 Maine
$13.25 Maryland
$15.00 Massachusetts
$10.10 Michigan
$10.59 Minnesota
$7.25  Mississippi
$12.00 Missouri
$9.95  Montana
$10.50 Nebraska
$10.50 Nevada
$7.25  New Hampshire
$14.13 New Jersey
$12.00 New Mexico
$14.20 New York
$7.25  North Carolina
$7.25  North Dakota
$10.10 Ohio
$7.25  Oklahoma
$13.50 Oregon
$7.25  Pennsylvania
$13.00 Rhode Island
$7.25  South Carolina
$10.80 South Dakota
$7.25  Tennessee
$7.25  Texas
$7.25  Utah
$13.18 Vermont
$12.00 Virginia
$15.74 Washington 
$16.50 Washington, D.C.
$8.75  West Virginia
$7.25  Wisconsin
$7.25  Wyoming

I can do column editing in freeware Notepad++ or freeware NoteTab Light. Notepad++ is better since it is unicode. I would like to copy the wages column into either one of your methods, and end up with a map with wages for each state. Instantly. No range coloring. Just black text on a pale color. We can do range coloring when we find a way or tool to quickly give opacities or colors for each value (wage) in the list. Then I could do a column paste for that too. --Timeshifter (talk) 13:37, 12 March 2023 (UTC)[reply]

I was going to give you a Google Sheet into which to paste in your data and from which to copy the lines to put in the SVG, but I first need the states listed by USPS 2-letter abbreviations not state name. cmɢʟeeτaʟκ 13:52, 12 March 2023 (UTC)[reply]
cmglee. That is a perennial big problem. Unfortunately, the 2-letter abbreviations end up in a different alphabetical order than the full names. So simply pasting over the alphabetical full-name column with the alphabetical 2-letter column does not work.
I have not found a tool to quickly convert from one to the other. I suggest using the full names in the template. It would make things a lot easier. Very few state tables on Wikipedia use the 2-letter abbreviations.
Copying and pasting a column from a table is easy in the visual editor (VE). See Help:Table in the VE section at the end. Even new editors can figure it out fairly quickly.
But asking them to also convert to 2-letter abbreviations is another level of skill most won't want to deal with. Even if they do they are likely to forget to alphabetize the 2-letter column. That can't be easily done in the visual editor. They have to use a spreadsheet, and then copy it back to Wikipedia. --Timeshifter (talk) 14:19, 12 March 2023 (UTC)[reply]
I can hardcode the order in the spreadsheet, if it can be assured that the data is always in the order you've given. Is that satisfactory? cmɢʟeeτaʟκ 17:13, 12 March 2023 (UTC)[reply]
cmglee. I can't assure that because sometimes the state lists for various topics include DC or not. Or it is listed as District of Columbia, or Washington, DC.
And eventually you may do additional spreadsheets for countries. 3-letter codes are used for them in some databases. I hate them, and I hate the 2-letter codes for states in databases. Because there is no easy way to transfer that data to Wikipedia tables correctly. Same alphabetization problems messing up the order. Same problem of converting to full names.
I can't easily copy and paste the latest year to the Wikipedia country table which also has previous years. Even using full names. Country names change in databases. Imagine in addition trying to decipher 200+ country codes and their order.
I have made various mistakes dealing with multi-year tables. Or wide tables with many columns. For example: List of countries by incarceration rate. One editor insisted on combining multiple columns in one table instead of using multiple tables as before. But the data comes from different pages on the same website. So one has to be very careful of name changes, deletions, additions, etc.. It is difficult enough with full names. And the mistakes are sometimes not discovered for a long time. That means people are using mixed up data. That happened here: List of countries by total health expenditure per capita. An anonymous editor found a bunch of mistakes of mine in Feb 2023. See diff.
There are so many ways to mess up. Please use full names everywhere. --Timeshifter (talk) 19:19, 12 March 2023 (UTC)[reply]
@Timeshifter: Re US "state" names, even full names have variations e.g. Washington, D.C., DC, D. C., District of Columbia etc. Without implementing something like Hamming distance, it's difficult to associate the data with the diagram. At least USPS abbreviations are consistent.
Country names are even worse, as they have even more variation.
Without solving this issue, I don't see a simple automated way to do what you want, whether it's using a script, spreadsheet, Wikidata, Maplink or Graph extension.
Do ping me again if you manage to work around this problem.
Cheers,
cmɢʟeeτaʟκ 23:19, 12 March 2023 (UTC)[reply]

cmglee. See: User:Timeshifter/Sandbox188. Still needs work. So lists for map use will have to mirror those names. --Timeshifter (talk) 02:12, 13 March 2023 (UTC)[reply]

@Timeshifter: I thought you wrote that the state names in the data are subject to variation. https://stackoverflow.com/a/5590014 discusses the same issue except that some states may be missing in the data. This is especially problematic if West Virginia is presented as, say, W.Virginia and Virginia itself is missing, as most algorithms will consider W.Virginia more similar to Virginia than West Virginia.
Also may I suggest moving this thread somewhere else (unsure where is best) as it's getting unwieldy and others having it on their watchlists are needlessly spammed. Cheers, cmɢʟeeτaʟκ 04:33, 13 March 2023 (UTC)[reply]
cmglee. Here are the names for US states, territories, etc. on Wikipedia:
List of states and territories of the United States
District of Columbia redirects to Washington, D.C.. So we should use Washington, D.C..
--Timeshifter (talk) 07:57, 13 March 2023 (UTC)[reply]

cmglee. I don't understand what you need to do, and the technical info you linked to went way over my head. And I now don't know exactly what you mean by "hardcode the order". But if we decide on the accepted naming, then I assume that goes a long way in helping this work. --Timeshifter (talk) 13:35, 13 March 2023 (UTC)[reply]

File:Map of US minimum wage by state 2023.svg
First go
I've created and shared a Google Sheet:
https://docs.google.com/spreadsheets/d/1qBwH0oA5IklYobs-igbVc0k-WsoxWPSbG0cgmGEZeys/edit
in which one can paste under INPUT the data you shared. Copying the lines generated under OUTPUT and pasting it in template_map_of_usa_states_and_dc.svg gives the image on the right.
Feel free to play around with the spreadsheet (but don't change the formulae unless you know what you're doing!)
Cheers,
cmɢʟeeτaʟκ 17:00, 13 March 2023 (UTC)[reply]
cmglee. I think I already messed it up. I don't know how. I can't get back to what you had. Even when I sign out of Google. I may need to close all my windows to get rid of all the cookies.
How do I get to a blank form that I can paste into?
I would like to get rid of the dollar signs ($) on the map. Instead, the caption can say: "Map of US minimum wage by state 2023, in dollars"
I would like to reverse the min and max colors. So that the reddish color matches the political situation of the states that keep minimum wages low. :)
The 2 main colors are good because black text works adequately on both of them.
--Timeshifter (talk) 17:57, 13 March 2023 (UTC)[reply]
Updated the SVG as requested. The colours work well for colour-blind readers, according to COBLIS.
I think you just moved cell D2 to E2. I've restored it. I'm unsure how to make such a form. Instead, select cell A2 and paste your data.
Anyway, unless you've many more maps to generate, ask me or someone else to generate the SVG for you. Cheers, cmɢʟeeτaʟκ 21:13, 13 March 2023 (UTC)[reply]
Cmglee. Thanks for the update. Maybe create another sandbox version with a reset button. And no ability to edit the Google Doc. Users will only be able to use it, not change it. I would like to play around with it. And link to some help info on a Commons subpage of the template. I and others can help fill out the help page.
I forgot that the map needs to have the date of Jan 1, 2023 on the map. On this model:
File:Map of US minimum wage by state.svg
Simpler caption could be:
State minimum wages, in dollars. Jan 1, 2023
File names for map should not include the year normally. Since they are sometimes updated yearly or biannually.
This map can replace this map:
File:Map of US minimum wage by state.svg. Wikideas1, is this OK?
--Timeshifter (talk) 22:46, 13 March 2023 (UTC)[reply]

Cmglee. On map and in above collapsed lists: $5.15 changed to $7.25. Federal minimum wage is actual wage in those states. See List of US states by minimum wage. Federal wage supersedes lower state minimum wages.

I also changed the map caption to "State minimum wages, in dollars. Jan 1, 2023". Because minimum wage will change on certain dates in the year. So viewers see a dated map and know what they are getting.

I uploaded the corrected map to both file locations. So the up-to-date map is now showing in multiple articles, etc..

I believe the file with 2023 in the file title should be deleted (linked below). Normally, the date is not put in the file name, because the file will be updated yearly. I can put a delete request tag on the file.

Irfanview says there is an SVG syntax error in the old and new maps, and won't show me the maps. Firefox shows me the maps without any problem.

Oops. The colors are now wrong since I did not redo the adjusted list in Google Docs. Google Docs is not working right for me. I am able to paste in the corrected list. But no result is shown. By result, I mean the code to paste into the map SVG code in the top section. --Timeshifter (talk) 05:43, 14 March 2023 (UTC)[reply]

I'm unable to do what you wanted earlier (reset button etc) in Google Sheets. Ask the computing reference desk if you need help.
Please ensure your state-first table is up to date, and I'll run and update File:Map of US minimum wage by state.svg later today. cmɢʟeeτaʟκ 06:44, 14 March 2023 (UTC)[reply]
Cmglee. I updated all the state lists on this page and in the sandbox.
I also played around with the free choropleth map tool at Datawrapper.de but was never able to get the data onto the map. I was able to paste in the data list. But it never showed on the map.
https://www.datawrapper.de/maps/choropleth-map
There are example maps with data on the maps, and with color legends:
https://app.datawrapper.de/river - search for "maps".
And the Commons has some of their free maps. See commons:Template:Datawrapper.de and its linked category.
Would be nice to have another simple map tool.
--Timeshifter (talk) 08:57, 14 March 2023 (UTC)[reply]
Updated File:Map_of_US_minimum_wage_by_state.svg. The thumbnail is not refreshing, so we'll have to wait a few hours.
Datawrapper.de seems to output PNG, where SVG is preferred. cmɢʟeeτaʟκ 13:04, 14 March 2023 (UTC)[reply]

Part 3

[edit]
Return to top.

Cmglee. Thanks again. I figured out the Google Doc and using it with the template:

Have been reading on palettes that are better for color blind:

  • https://www.datylon.com/blog/data-visualization-for-colorblind-readers - " So if you’re aiming to create a color blind-friendly palette try to use only two basic hues: blue and red (orange and yellow will also fit). The other colors should be made out of these two hues. All the variations can be made by using different saturation or lightness of the basic color."

I have experimented with various shades of those colors. It is easy to plug in to the SVG since it requires only entering 2 color codes or names. The opacities list is not changed. The main thing is to find light enough shades that black text is still visible against that color backdrop.

If Datawrapper ends up being easier to use, then I don't mind if it outputs in PNG. --Timeshifter (talk) 18:52, 14 March 2023 (UTC)[reply]

Congrats!
Re colourblindness, my aim is to support deuteranomaly which should then satisfy ~95% of the population. As far as I understand, not requiring red-yellow-green discrimination is sufficient. Adding some blue to greens e.g. #009966 also lets it be used with red, as on traffic lights.
Glad you like my technique of using fill-opacity to linearly interpolate between two colours which can be easily changed.
It's certainly better to have a bitmap instead of not having an image, but for non-photographic or topographical images especially with text, I believe Wikipedia recommends vector images.
Cheers, cmɢʟeeτaʟκ 02:40, 15 March 2023 (UTC)[reply]
Cmglee. This is the best I could get out of Datawrapper.de:
https://www.datawrapper.de/_/EHUbM/
https://datawrapper.dwcdn.net/EHUbM/1
They don't have templates set up with the outside labels on the east side of the map.
I like the fact that their software automatically determines whether to use white or black text on each state depending on the color for that state.
Is that something you could do on your template?
--Timeshifter (talk) 07:57, 24 March 2023 (UTC)[reply]
Outlined text
@Timeshifter: Sadly that's not possible as the SVG doesn't actually specify what colour it is: it just draws one colour, and the other over it with some opacity.
A common device used in subtitles, however, is to outline the text in a contrasting colour so that it can be read against (almost) any background, as in this graphic. Will that do? cmɢʟeeτaʟκ 14:14, 24 March 2023 (UTC)[reply]
Cmglee. Yes, that would be great! I had forgotten about that method.
In fact, I see that method also used on the Datawrapper map. Most noticeable when a state name crosses both a dark and a light color. --Timeshifter (talk) 14:49, 24 March 2023 (UTC)[reply]
Changed end colors and outlined text
I've done the above using an SVG filter, and also changed the end-stop colors so that larger values are more intense (darker in this case) as per usual illustrative convention. cmɢʟeeτaʟκ 05:58, 25 March 2023 (UTC)[reply]
P.S. Can you please check Washington's figure, as it doesn't end in the usual 0 or 5? cmɢʟeeτaʟκ 06:02, 25 March 2023 (UTC)[reply]

Cmglee. It is correct. See List of US states by minimum wage. A consistently good reference from the main table on that page is this one from the Dept. of Labor:

Is it possible that the template could use white text for all opacities above a certain number? It would be nice if there was a spot in the SVG code where I could enter that number. Then I could experiment with different color palettes and opacity white-text numbers before uploading.

The current 2-tone text is not enough contrast with the dark background colors in my opinion. Maybe using a bright white text outline that is wider would help. That would help even if the opacity method above is implemented to get white and black text. Because some state names overlap contiguous states with different background colors. And white text could have a black outline.

I found a graphing template that allows pasting in of lists. See:

Around 570 graphs use it. See transclusion totals of this box:

I an interested in the healthcare graphs using it:

The last one I fixed some text overlap problems by adding Liberation Sans to the font family. Anyway, I am wondering if any of the template's list capability can be used by you. The lists are pasted at the bottom of the SVG code. --Timeshifter (talk) 04:35, 26 March 2023 (UTC)[reply]

It will require rearchitecting the SVG as the state names are drawn in a different place from the values. Additionally, the callouts should be in black regardless of their values. Lastly, I think it is more consistent to have all the labels the same colour, and use the outline trick to distinguish them from the background. As such, I'm disinclined to implement it.
If you wish to experiment with the outline width, edit the lines
   <feGaussianBlur in="SourceAlpha" stdDeviation="0.5"/>
   <feColorMatrix type="matrix" values="0,0,0,0,1 0,0,0,0,1 0,0,0,0,1 0,0,0,2,0"/>
and increase either or both the values 0.5 and 2 (the former makes the transition smoother and the latter sharper). Be sure to generate a thumbnail of the expected size on Wikipedia as the rendering on browsers differs from the rsvg one. If you have further questions on this, please ask on Wikipedia:SVG_help.
commons:template:SVG Chart is a clever hack of templates, though I think Toolforge is more appropriate for such a tool than templates. A good tool is Parliament Diagrams. Nevertheless, drawing a line graph is very different from a choropleth map. Effort is much better spent adding a US states basemap to Template:Graph:Map.
Good luck,
cmɢʟeeτaʟκ 14:46, 27 March 2023 (UTC)[reply]
Cmglee. Thanks for all the info and help. I don't have a clue about Template:Graph:Map. I looked at the examples on that page, and they are not what I want. I want a non-interactive image I can copy elsewhere. Not just for Wikipedia. I want US maps with the date and state names on the map.
I did not see any examples with data or names on the map. If they exist, I guess they could be used elsewhere by doing a screenshot of the map and making a gif or png image of it. I could go for that. That is basically what OWID does. They make interactive maps, and also have non-interactive SVG or PNG maps available via download.
I did a lot of experimentation with the text outlines on your template. Nothing was really satisfying. To get enough clarity and legibility with a wide color palette (very dark to very light colors) I had to make the white outline wide enough. I succeeded at that. I made many variations, and compared them. With my preferred ones too much of the map is taken up by the text and data. It overwhelms the map. It's like using a very large bold font on a map. Plain white text on dark areas is much better. Plain black text on light areas is much better.
I can ask around for more help. This is wearing me out (health and time). So I appreciate now all the work you must have done to get to this level of skill. I wrote large parts of Help:Table and Help:Sortable tables over the years. I wrote those parts with newbies in mind. People shouldn't have to suffer to get stuff done. A lot of this stuff can be made much more accessible. Your template is a great step in that direction.
I need to find an expert on colorblindness to tell me what 2 colors to use on your template once I figure out how to get white text for dark colors. I have looked at a few pages on color blindness, and haven't seen anything specific to a color gradient based on 2 colors and opacity. --Timeshifter (talk) 01:54, 28 March 2023 (UTC)[reply]
Your requirements are fair. To provide such flexibility, I'd recommend creating a tool on Toolforge. I've no experience in creating one, but could refer you to the expert @Magnus Manske: he has created many useful tools.
Well done documenting Wikimedia features. Wikimedia could certainly improve accessibility to people less technically inclined.
I'd sure like some authoritative guidelines on colour-blindness as I find conflicting info on the Web.
Cheers,
cmɢʟeeτaʟκ 03:30, 29 March 2023 (UTC)[reply]

Cmglee. I noticed this change on an OWID map:

From a green-yellow-orange-darkred palette to a yellow-orange-darkred palette today.

So green was removed. I think I read somewhere that green is not a good color for some of the colorblind.

From previous post:

  • https://www.datylon.com/blog/data-visualization-for-colorblind-readers - " So if you’re aiming to create a color blind-friendly palette try to use only two basic hues: blue and red (orange and yellow will also fit). The other colors should be made out of these two hues. All the variations can be made by using different saturation or lightness of the basic color."

--Timeshifter (talk) 19:11, 29 March 2023 (UTC)[reply]

I think green without some blue (somewhat cyan) shouldn't be used with red to yellow shades as the only distinguishing feature (dark red and light green together are fine as luma is a distinguishing feature). I know I'm sometimes guilty of this! I use http://color-blindness.com/coblis2 to check whether a combination is acceptable. Cheers, cmɢʟeeτaʟκ 05:14, 30 March 2023 (UTC)[reply]
Putting http://upload.wikimedia.org/wikipedia/commons/thumb/archive/0/07/20230329180654!Maternal_mortality_ratio_(With_SDG_Target)%2C_OWID.svg/1200px-Maternal_mortality_ratio_(With_SDG_Target)%2C_OWID.svg.png into http://color-blindness.com/coblis2 shows that though the colours can be distinguished, the brightness isn't monotonic, making it harder to interpret the map. cmɢʟeeτaʟκ 05:21, 30 March 2023 (UTC)[reply]

Cmglee. Interesting. I am beginning to understand that tool. Have to drag the map, and zoom in and out to use the tool effectively. The green shaded areas change for some colorblind people making areas next to it less distinguishable. Going from "green weak" to "green blind".

I thought nothing happened when I clicked on the 3 choices for lens. Only after going to this page many times did I notice the circle that can be moved around. Because I had no reason to run my mouse around on the map until I learned I could drag the map around. People create these great tools, and then don't explain them for newbs like me. So the tool gets far less use. Short tips are needed right on the tool page. Since people are often coming directly to the tool page as I did.

I noticed a change of yours by comparing svg page sources here via revision diffs:

See diff. Which is better?:

  • letter-spacing="0" transform="translate(480

or

  • letter-spacing="0" transform="translate(500

The template page svg uses 480:

I intend to use that template page of yours to create a bunch of US maps using lighter colors. Then I can go ask for help with getting white text on dark colors. Since people will see that it matters for more than just a map or two.

What are the best 2 end colors (not too dark for black text without text outlining) you have found so far to use for the end colors? Can we incorporate those 2 into the template? I would like to point people to this template for their US maps. I can help with the template docs.

Google color picker is very useful.

I picked a very light pastel red (#faf5f5) as an end color, along with skyblue end color. "Misty rose" is a little darker pastel red. I can't get the coblis page to work for me anymore. It accepts my uploads, but does not show them. --Timeshifter (talk) 03:42, 31 March 2023 (UTC)[reply]

Part 4

[edit]
Yes, the lens feature is quite useful. I suppose these tools are written by engineers with little formal training in user experience (including myself). If it doesn't work anymore, try refreshing the page, opening a new tab or window, or restarting the browser or your device.
The change in translate is just to better centre the title, as the one in File:Template_map_of_usa_states_and_dc.svg is now much longer. Nevertheless, I've backported to it outlined text from File:Map_of_US_minimum_wage_by_state.svg.
To me, the schemes of File:Map_of_US_minimum_wage_by_state.svg and File:Template_map_of_usa_states_and_dc.svg, as well as the original cyan–orange work well. As the background is white, I think making larger values warmer (orange or pink) and darker colours, but you wanted blue and red swapped to reflect conventional party colours, so I redid File:Map_of_US_minimum_wage_by_state.svg.
Cheers,
cmɢʟeeτaʟκ 13:28, 31 March 2023 (UTC)[reply]
cmglee. I want to start working on other US maps. I prefer the non-outlined text.
I like the end colors though from your last map with outlined text: #ffcccc #0099ff
I found a cyan end color that works better with black text. Via this cyan chart of colors with white and black text:
https://icolorpalette.com/color/cyan-blue
So I picked the darkest cyan that worked with black text: #33c5ea
So my preferred end colors now are: #ffcccc #33c5ea
I substituted those end colors into the last map without outlined text, and uploaded it to another wiki:
https://weedwiki.fandom.com/wiki/File:Map_of_US_minimum_wage_by_state.svg
The previous upload there was the same map, but with outlined text:
https://images.wikia.com/cannabis/images/archive/7/76/20230331190033%21Map_of_US_minimum_wage_by_state.svg
I think the plain text (no outlines) is much more legible with my preferred end colors. I think the problem is that the outlining is removing the sharp edge from the black text. Maybe there are some totally free, sharp outline fonts that Wikimedia could put into the MediaWiki software. But that is research I don't have the time or health for.
I compared the SVG code between the map (#ffcccc #33c5ea) with outlined text and without. See diff.
Is there any problem with the SVG code I am using for the non-outlined map?
What do you think of a second template map without outlined text?
I was thinking of starting it, but it needs to stay up to date in its ability to work with your Google doc.
I will create more US maps, and link to them from that template as examples.
I can write up some simple how-to info on both template pages on how to use the Google doc. I do how-to info already on many file pages in order to explain sourcing, cropping, adding text, adding borders, and much more.
2 templates allows work to continue on maps with outlined text, and on maps with plain text. The plain text template might eventually end up with both black and white text. People can work on the SVG code on their template of interest.
--Timeshifter (talk) 04:46, 1 April 2023 (UTC)[reply]
Feel free to revert my changes which added the outlines (those involving the SVG filter "filter_glow").
How could you tell that the darkest cyan that worked with black text was #33c5ea? Did you use a WCAG contrast checker like
http://webaim.org/resources/contrastchecker?
A way to have a sharp outline without SVG filter is to draw the text with a white stroke, then draw it again without a stroke. Without the latter, the stroke intrudes into the character, making it too thin. It will require changing the structure of the SVG; as I previously wrote, the state names and numeric values are drawn in different places.
I don't understand "Is there any problem with the SVG code I am using for the non-outlined map?"
Having a second template complicates maintenance. You could just put in a comment for the template user to simply delete the line
text { filter:url(#filter_glow); }
to remove the outline.
Thanks a lot for your effort to make the template more accessible. Much appreciated, cmɢʟeeτaʟκ 10:12, 5 April 2023 (UTC)[reply]

cmglee.

But that assumes a bright monitor. I, and many others, turn down the brightness level on our monitors in order to avoid eye pain and strain. So that further darkens the cyan with the overall grayness contributed by a dimmer monitor. I have a system tray tool I can click to go to 100% brightness, or click again to go down to a lower level of brightness I have chosen. I choose 80%. See the freeware:

I flip it up or down depending on the web page, or whether I am watching a video (100%).

One template is definitely better than two. And I was surprised that removing only one line of code could remove the outlined text. I think that is easiest enough that most newbs could do it if desired.

I was wondering about the SVG in the outlined-text map versus the SVG found in the same map with regular text. See sandbox diff.

There is obvious added SVG for the outlined text.

But I was particularly wondering about this:

class="overlay" 

It is not found in the SVG for the outlined text map.

I guess this is a good reason not to have dual tracks for outlined text and regular text. Things get confusing.

Can we delete this map?:

Also, I suggest going back to a map with just numbers for the template:

Otherwise people may try to update the urban population map, and not pay attention to how it should be done. And search engines can not find that map when the template name is different from what the map is about. The urban population map would be better with its own filename. --Timeshifter (talk) 23:28, 7 April 2023 (UTC)[reply]

Yes, CSS allows one to "style" parts of a web page (including SVG and Wikipedia pages) at different granularities. The "text" line applies the specified filter on all text elements.
The "class" bit is an obsolete remnant of my experimentation. As it's no longer in use, it may be deleted (though doesn't cause any harm if not).
Please feel free to delete the *2023.svg file. I made it to not overwrite the original until it was approved.
I prefer a realistic example instead of just numbers to show editors how it can be used. I intentionally used an example with percentages to avoid the issue of calculating the opacities.
As you're much better at writing documentation (than I am), can you please write a blurb to explain to other editors how they should edit the file?
Thanks,
cmɢʟeeτaʟκ 12:58, 9 April 2023 (UTC)[reply]
cmglee. OK. I will start working on the how-to info. I am working on multiple projects though, with time and health constraints. Feel free to add info yourself too. I will clean it up. --Timeshifter (talk) 15:22, 9 April 2023 (UTC)[reply]

cmglee. Can you revert back to the map with the regular text here?:

Apparently, there are no revert links for people who haven't uploaded any versions of the map. I see revert links on the ..2023.svg map where I have uploaded a couple versions of the map.

I prefer your colors on that regular-text map:

versus the colors here on the last ..2023.svg map I uploaded:

Your colors show more distinction between New England states.

Someone did an SVG validation check on the template and found a couple errors. Link is found at the bottom of the file description on the template page:

I have no idea how easy those are to fix. Maybe they could be corrected on both the template map and the minimum wage map? --Timeshifter (talk) 06:19, 10 April 2023 (UTC)[reply]

Done as per http://commons.wikimedia.org/w/index.php?title=File:Map_of_US_minimum_wage_by_state.svg&diff=prev&oldid=749021731 .
The "in2" errors can be ignored. Most browsers (and rsvg) understand that the current image buffer should be operated on if an input buffer is not specified. cmɢʟeeτaʟκ 12:41, 10 April 2023 (UTC)[reply]
I reverted to my preferred map. I can see revert links here:
commons:File:Map of US minimum wage by state.svg
In my last post I must have been looking here where I can't see revert links:
commons:File:Template map of usa states and dc.svg
S**t happens when I am tired. :)
I prefer the map I reverted to because there is better contrast between the black text and the background
I started an instruction page:
Commons:User:Timeshifter/Template for creating US SVG maps. I need to do more work on it after I remember where I got stuck before when using the template, Google doc, etc..
The instruction page is linked from the maps. --Timeshifter (talk) 19:59, 10 April 2023 (UTC)[reply]
I thought you previously wrote that you preferred the pink–blue scheme. Personally, I find the orange–cyan scheme too intense, specifically orange for low values especially after 5.15 changed to 7.25, as a "bright" colour should be used as an accent rather than dominate the whole map. Cheers, cmɢʟeeτaʟκ 09:09, 11 April 2023 (UTC)[reply]
cmglee. Instructions moved to Commons:File talk:Template map of usa states and dc.svg/Instructions. See top notes there for the reasoning. I had a longer reply ready but my PC restarted out of the blue. Weird. Back later. --Timeshifter (talk) 11:42, 12 April 2023 (UTC)[reply]

cmglee. I reversed the map from orange-cyan (#ff6600 #99ffff) to cyan-orange (#99ffff #ff6600).

The map has good contrast between the background color and the black text. But without the intense orange on so many states.

The blue in the map you last uploaded (#ffcccc #0099ff) barely passes the contrast checker at 7:1 contrast ratio.

That's assuming a bright white background. I can't read the text on the darkest blue color with one of my slightly dimmed monitors. It's not enough contrast when viewing the map in articles at the sizes used in these articles:

The orange–cyan and cyan-orange maps have better contrast on dimmed monitors. The contrast ratio is a tiny bit better.

But it is much easier to read the black text on the orange background at article sizes for some reason on my slightly, or even more than slightly dimmed monitor. Maybe because the dimming makes the blue background darker versus the orange background. The blue background is starting darker to begin with. --Timeshifter (talk) 18:40, 13 April 2023 (UTC)[reply]

Yes, I much prefer cyan to orange with high values being orange. Now the Pacific states, northeast and DC stand out. Let's keep this scheme for future maps. Cheers, cmɢʟeeτaʟκ 07:38, 15 April 2023 (UTC)[reply]