The answer is Yes No.
EDIT
As @Babel pointed it out to me, Symbol levels are a vector layer symbology option to choose the order of symbol layers, see here the official documentation.

So the answer is no, see this QGIS Project GitHub issue, opened in 2013, still open : https://github.com/qgis/QGIS/issues/17276.
Here the old answer where I believed that the symbol level was the size of the outline for boundaries for example :
- For a standard order: if you want your border width to go from 1 to 5, with 5 features, each feature will have an integer width. I insist on the standard because if you have 4 small features and 1 big, the biggest of the 4 small features will have a width of 4.
Here is the expression:
with_variable('sorted_array_by_area', array_agg($id, order_by:=$area),
array_find(@sorted_array_by_area, $id) / array_length(@sorted_array_by_area)
)
The result here is a percentage going from 1/features count to 1.
You can reverse this percentage by substracting the expression from 1:
with_variable('sorted_array_by_area', array_agg($id, order_by:=$area),
(1 - array_find(@sorted_array_by_area, $id) / array_length(@sorted_array_by_area))
)
You can adjust the maximum value by multiplying it by this maximum value.
- For a non-standard order, value dependent: in the previous example, the 4 smallest features will have small values and the big one the max.
Here is the expression:
with_variable('area_array', array_agg($area),
($area - array_min(@area_array)) / (array_max(@area_array) - array_min(@area_array))
)
As with the standard expression, as it returns a percentage, you can reverse the order with 1 - expression
.
And if you want to set a maximum value: expression * maximum_value
S̲u̲m̲m̲a̲r̲y̲ T̲a̲b̲l̲e̲
Area value : |
2 |
3 |
4 |
7 |
18 |
Index in a sorted array by area |
0 |
1 |
2 |
3 |
4 |
Standard Method : index / array length |
1 / 5 = 0.2 |
0.4 |
0.6 |
0.8 |
1 |
Standard Method with a maximum value of 5 |
0.2 * 5 = 1 |
2 |
3 |
4 |
5 |
Non-Standard Method : (area - min area) / (max area - min area) |
0 |
(3 - 2) / (18 - 2) = 0.0625 |
0.125 |
0.3125 |
1 |
Non-Standard Method with a maximum value of 5 |
0 |
0.3125 |
0.375 |
1.25 |
5 |