As I understand it, the grid works on the following principle:
Let's take the element grid as an example.
Each column in the grid represents a rarity level - the far left column is rarity 1 (Very Common) and the far right column is rarity 5 (Very Rare).
So, for example, in the left column you would have Carbon, Iron, Nickel, Phosphorus, and Sulfur, since those are the five rarity-1 elemental materials. In the column to the right of that, you would
have Chromium, Germanium, Manganese, Vanadium, and Zinc, since those are rarity-2, and so on.
Each row in the grid represents a class of material. Since I don't have a picture of this particular grid in front of me, I'm not sure as to the order that the rows are in, but to my knowledge, they are ordered by element class,
so for example there would be a row for ferrous metals, a row for alkali metals, etc, where each row contains all 5 of the elements in that class in order of rarity.
With those in mind, you end up (at least for elements) with a 5x5 grid of materials, for a total of 25.
Now for the values:
Each grid space is assigned a value depending on where it is relative to what you are looking to trade it for.
Hypothetically, let's say that I'm low on Iron (a common occurrence in the beta), and I have an excess of Tin.
Tin and Iron are in the same row, along with Selenium (and I think Tellurium and Manganese, but I'm not sure on that).
In this case, each element in the row would be assigned a trade ratio based on its relative position to the element I'm looking to get (that being Iron).
Tin occupies slot 4, since it's a rarity-4 element. Selenium is in slot 3, and (assuming that I'm correct) Tellurium and Manganese are in slots 5 and 2, respectively.
Since there is nothing in the grid lower than Iron, all of the other elements in this row are obviously going to be worth more than Iron. When working
inside a single row of the grid, elements in that row are assigned the following values in rarity-1 equivalents:
[1][3][9][27][81]
So, trading 1 Tin (in slot 4) for Iron would net me 27 Iron. Trading a Tellurium would net me 81 Iron, since it's in slot 5.
It also works the other way - if I wanted Tin, and I had Iron, I would need to put forward 27 Iron for 1 Tin.
Things get a bit more complicated for other rows (say, trading Tin for Arsenic or vice-versa), but as far as I could tell, it works basically the same way, except that
for each row you move up or down from the row you are trading for, the price goes up by a factor of 3, as if you were trading for a material 1 rarity higher than you are.
I whipped up the following poorly edited image to illustrate roughly how this works. Of course, this may change when the full update comes out, but this is how it DID work in the beta.
I couldn't find an image of the element grid, so I got one of the manufactured materials grid instead.
Blue numbers indicate how much you would have to put forward of the selected component (Basic Conductors in this case) to get the component with that number on it (so you would have to put 27 Basic Conductors forward to get 1 Heat Exchanger).
Green numbers indicate the opposite - how many Basic Conductors you would get if you sold one of the components with the number on it (so for example, you would get 9 Basic Conductors for 1 Configurable Components).
Let me know if you need additional clarification, but this should do at least a fair job of explaining this system.
Edit: Apparently the forum IMG tag does not like displaying images from Drive in-line, so I've had to format it as a standard link.
https://drive.google.com/open?id=1opVbxYnSA2I1VJFPa7Zchk_Jp4veAM2h