Condition: A list of objects comes (say, 20 pieces), each of which has a property (let's call it Z) and this is random (0, 100)

Task: Build a smart grid using masonry, setting the height of each block based on the incoming parameters:

  1. minimum allowable height
  2. maximum allowable height
  3. the lowest Z of all received objects
  4. the highest Z of all received objects
  5. Z current object (in the loop when drawing)

The function looks like this:

const getHeight = (max_Z, min_Z, obj_Z, max_size = 550, min_size = 150) => { return ((obj_Z - min_Z) / (max_Z - min_Z)) * (max_size - min_size) + min_size; } 

However, the problem is that between the largest and smallest elements, all elements are distributed linearly. I also need the ratio in size between the elements to be proportional. How to achieve this mind I will not put

  • "Seven red lines. All strictly perpendicular." "was proportional" - what? - Igor

0