The problem of implementing irregular progress bars at the front end?

implementation effect: for example, in the progress bar in the figure above, his data is dynamically transmitted in and out
problem point:
1. The corresponding data at the bottom of this progress bar is irregular. There are no rules for the vacancy between 45 and 41. How to move the upper triangle to the corresponding position according to the passed value?
2, how should the color of the small triangle be matched with the gradual change of color in the progress bar below?

Sep.10,2021

similar parallax scrolling, Baidu, the small triangle background image put a long picture, the triangle to the right, the background to the left.


write a piecewise linear interpolation function to correspond to two sets of values. Enter the number axis as your numerical segmentation point, and output as the front-end page positioning coordinates and color values.


I think we can do it in a blind way. The
triangular row is directly made into a div
div background image is a DNA methyl map with no numerical value
div has

there are two white bars and a small square between them. The
box uses the border attribute to make the triangle border white and transparent in the middle.
left, middle and right layout.
change the width on the left and right sides according to the numerical value


since the demarcation point is not regular, your following example has to be proportional. How can we divide it equally? Set the maximum and minimum number, and then calculate the proportion to decide where to point.

Menu