Jump to content

Template talk:Article length bar

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

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)[reply]

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)[reply]

Came up with a better way, imho; see "Arbitrariness..." section below. Mathglot (talk) 00:42, 9 March 2024 (UTC)[reply]

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)[reply]

Fixed. Mathglot (talk) 04:34, 5 September 2024 (UTC)[reply]

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: {{Albar|Jerusalem}}Kuwait ‎[318,369b] 318k), 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: 555k 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)[reply]

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:

179k 2001 = 2.4%
132k The Cabinet of Dr. Caligari = 3.2%
19.3k Caesar cipher = 6.4%
55.4k Caroline Island = 4.0%
109k Casablanca (film) = 9.9%
115k Castle = 5.2%
82.6k Cerro Blanco (volcano) = 4.2%
68.4k Chagas disease = 12.1%

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)[reply]

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)[reply]
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)[reply]
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)[reply]
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)[reply]

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:

280k 209k 304k 157k 93.6k 113k
FR DE IT BZ SC GN


280k {{Albar|France}}
209k {{Albar|Germany}}
304k {{Albar|Italy}}
157k {{Albar|Belize}}
93.6k {{Albar|Seychelles}}
113k {{Albar|Guinea}}


280k {{Albar|France|mode=horiz|style=width:20em}}
209k {{Albar|Germany|mode=horiz|style=width:20em}}
304k {{Albar|Italy|mode=horiz|style=width:20em}}
157k {{Albar|Belize|mode=horiz|style=width:20em}}
93.6k {{Albar|Seychelles|mode=horiz|style=width:20em}}
113k {{Albar|Guinea|mode=horiz|style=width:20em}}


280k {{Albar|France|mode=horiz|style=width:40em}}
209k {{Albar|Germany|mode=horiz|style=width:40em}}
304k {{Albar|Italy|mode=horiz|style=width:40em}}
157k {{Albar|Belize|mode=horiz|style=width:40em}}
93.6k {{Albar|Seychelles|mode=horiz|style=width:40em}}
113k {{Albar|Guinea|mode=horiz|style=width:40em}}

Mathglot (talk) 02:46, 5 September 2024 (UTC)[reply]