Template talk:Article length bar
Horizontal version
[edit]Param |mode=
is being added to be able to flip from default vertical mode, to horizontal, but is only half-coded, therefore undocumented as not a usable feature yet. Mathglot (talk) 10:31, 19 February 2024 (UTC)
Logarithmic progress bar?
[edit]In theory, there is no top end for article size, and there are fifty pages over 500kb, 245 over 400kb, and 1,247 over 300kb. I've set the default max len to 240kb, but to prevent the progress bar from blowing up line-height in vertical mode when this occurs, maybe we want to represent progress logarithmically, so it approaches a limit, topping out at around 700kb, the size of our #1 article. Mathglot (talk) 10:43, 19 February 2024 (UTC)
- Came up with a better way, imho; see "Arbitrariness..." section below. Mathglot (talk) 00:42, 9 March 2024 (UTC)
Vertical mode goes top down
[edit]The vertical mode bar currently goes downward from the current baseline, instead of upward from it, as one might want if generating a bar chart with several of these all lined up, and rising from a y=0 baseline. I think it's because of the top-down gradient, not sure how easy/hard it might be to flip that. Stating it another way: under the current implementation, it would be very easy under the current design to create an upside down bar chart, with all the bars heading downwards from the top edge, with y=0 at the top, and y=100 at the bottom. But clearly, that's not what we want. Mathglot (talk) 23:17, 8 March 2024 (UTC)
- Fixed. Mathglot (talk) 04:34, 5 September 2024 (UTC)
Arbitrariness of what length should fill the bar 100% (TMAX)
[edit]The design seeks to adequately represent the relative size of different articles by how much of the length bar it fills up, i.e, how far to the right gets shaded. (This is enhanced by different shades, but we can leave that out for the sake of this topic.) That leaves an interesting question about what does "completely filled" (i.e., 100% shaded) mean, and how do we determine that? The "100% filled" point is determined by the config variable TMAX, i.e., {{Template:Article length bar/c|TMAX}}
→ 325000 bytes. Why was this chosen? There are articles much larger than this: see 2023 deaths in the United States at 672kb, and Special:LongPages. But if we chose TMAX = size of the largest article, that would show even articles way over "definitely split" guideline size reaching only 50% or less of the length bar, which would tell the wrong story about the data. On the other hand, anything less than about 700kb for TMAX, would mean that some articles would be more than 100% of the allotted size of the bar, and there has to be a fixed size for it to fit the space available.
TMAX was set to 325kb as a compromise: articles less than that size would fill less than 100% of the bar, and articles greater than 325kb up to the longest page size of around 700kb would all show 100% as well. This seems like a fair compromise, as there is no doubt that all of those articles should be split, so whether they are 325kb, 500kb, or 3 million kb doesn't really matter too much; we *know* they should be split. At the same time, that level of TMAX at 325kb is not *so* unusual that articles of that size don't persist for quite some time, and so to demonstrate the relative length of articles exceeding the guideline, it's helpful to have some indication that some even longer articles exist. As to the exact level chosen, I think I meant to pick roughly the size of the 1000th longest article, but now that's down to 316kb, so maybe it's changed. Anyway, the idea is that it's a compromise, it doesn't cut off too many articles sizes (less than 1,000) and all the rest show some difference in percent full by how much they fill the rectangle.
That said, there is actually a way to get a very rough feel for articles longer than TMAX: an article that is just under TMAX bytes will be red up to the right border (like Jerusalem: Kuwait [318,369b] ), but for an article that is longer than TMAX, the red turns darker towards the right border, showing that it is longer than TMAX, for example, for 2022 in science: That's not much of an indicator, but it's something; and finally, the characters inside the rectangle give a digital value as well.) Mathglot (talk) 00:05, 9 March 2024 (UTC) updated by Mathglot (talk) 04:40, 5 September 2024 (UTC)
{{Albar|Jerusalem}}
Possible use for section size comparison among articles
[edit]This template could be used to compare the size of the lead (or Further reading, or whatever section) as a percent of the article size, for a small multiple of pages. This could be done by passing T1=lead size, T2=article size, L0MAX=lead pct, L1MAX=100, leading to two-color rectangles in green and yellow always filled to 100% regardless of article size, where green is the percent of the article that is the lead, and yellow is everything else. (Possibly could even use red for appendixes, if desired.)
Example: graphical representation of ratio of lead size to article size for 2001 compared to seven Featured articles:
|
---|
2001 = 2.4% |
The example above was done without any template changes, but required first finding the article length, the size of the lead, and the percentage size of the lead compared to the total article length. Explaining how to do that would require a pretty detailed explanation in the doc, and would also requires the user to find and calculate those values; doable, but a tall order, and prone to error.
An additional param (perhaps |len=
) would require the user to enter only the size of the lead in bytes (findable from {{section sizes}} on the Talk page), and with proper adjustment of the template would then trigger adjustment of the config values, and generation of the lead-pct bar without undue burden on the user.
For a small number of examples on a Talk page, sparklines might be useful, e.g.:
...can be seen in the relative sizes of the lead at The Cabinet of Dr. Caligari , Caesar cipher , and Chagas disease .
Mathglot (talk) 09:38, 2 September 2024 (UTC)
- Wow, this seems amazing. I see France is an example, can I see how long its History section is compared to others? Does this allow for showing all lv2 headers? CMD (talk) 10:22, 2 September 2024 (UTC)
- I'm not sure of the benefit here when Talk:France has
{{Section sizes}}
which shows you the lengths of all sections. - —Trappist the monk (talk) 00:45, 3 September 2024 (UTC)
- The benefit is that a visual representation is easier to eyeball than a quite long series of numbers in a table. Eventually one or the other tool might start using prose count rather than byte sizes and thus provide a more useful gauge, but in the meantime the more tools doing the thing the more likely one will eventually develop the feature. CMD (talk) 07:25, 3 September 2024 (UTC)
- User:Chipmunkdavis, you are reading my mind. That will hopefully come later, some day, when the problems with automatic calculation of prose size are resolved. For now, I find this very useful, but painful to calculate manually, hence the request. It can currently show two sections, with three colors, that is, first section, second section, everything else. If we had the additional functionality in the module, this template could be extended to more sections, though probably limited to single digits, as displaying 42 sections graphically would like like a xylophone and lose utility. Mathglot (talk) 01:19, 5 September 2024 (UTC)
- The benefit is that a visual representation is easier to eyeball than a quite long series of numbers in a table. Eventually one or the other tool might start using prose count rather than byte sizes and thus provide a more useful gauge, but in the meantime the more tools doing the thing the more likely one will eventually develop the feature. CMD (talk) 07:25, 3 September 2024 (UTC)
- CMD, although the graphic is usable for sections, I took another approach to doing comparative section analysis; you can see that at Wikipedia:WikiProject Countries/Common section size (slow-loading page), where it compares seven commonly used sections in country articles. Although I still would prefer a graphic (especially an unobtrusively labeled one) to tables full of numbers, which I find hard to make sense of, I thought having a graphic in every cell of that table would jangle ones nerves. Still, I used it in the first column, and it occurs to me that using sparklines in the remaining cells would not overwhelm and might be okay from an aesthetic viewpoint. Otoh, those tables are already slow to load with all that data being extracted on the fly, and adding more template calls (26 rows x 7 columns) to generate graphics in all the cells would surely exceed PEIS and break the page. A way around this, might be to generate the graphics rapidly from a data page generated by a weekly bot run which would be easier and faster than extracting the data for every cell from the live country articles every time someone refreshes the page, which is how it works now. A bot similar to the one proposed above already exists (User:JL-Bot task 3), and generates the bullet lists of Featured and other articles you see at Wikipedia:WikiProject Countries/Assessment#Recognised content, so it wouldn't be beyond the realm of possibility to design a similar system to extract all the section data and save it periodically, and then render it rapidly with graphics like this one. Mathglot (talk) 23:45, 22 November 2024 (UTC)
- Sparklines might work well. I would agree there is no need for live loading, this sort of thing changes slowly and rarely. If you want a smaller pool of countries, sticking to FAs may help (reminds me of an ancient analysis I made). CMD (talk) 02:16, 23 November 2024 (UTC)
- I'm not sure of the benefit here when Talk:France has
The calculations required are simpler now, following the recent upgrade to Module:Section sizes, and creation of support template {{section length}}. Will need to redo examples above using the new, easier interface. Mathglot (talk) 11:01, 21 September 2024 (UTC)
Bg color and width anomaly in interaction of style with article size < green-yellow threshold
[edit]See size and color of Seychelles (SC) and Guinea (GN) in these:
|
---|
|