Forum Discussion
Deneb Matrix Visual - Working but with Warnings
- 1 year ago
Adding type to x2 is unnecessary and does nothing, as these share the same scale as x. The type in x dictates how x2 is scaled. Remove type from the channel and the warning should go away. (EDIT: example of using offset channels on a StackOverflow post from the other day that may help clarify)
bandPosition only spans from 0 to 1 and dictates percentage of the band to use for a mark's position (0.5 being the centre). Use xOffset or x2Offset if you want to adjust by a specific amount relative to encoded position.
Adding type to x2 is unnecessary and does nothing, as these share the same scale as x. The type in x dictates how x2 is scaled. Remove type from the channel and the warning should go away. (EDIT: example of using offset channels on a StackOverflow post from the other day that may help clarify)
bandPosition only spans from 0 to 1 and dictates percentage of the band to use for a mark's position (0.5 being the centre). Use xOffset or x2Offset if you want to adjust by a specific amount relative to encoded position.
Thanks so much for responding Daniel and thanks lbendlin for tagging him!
I was able to get rid of the type error by using your solution and also finagle the xOffset and x2Offset to work. My issue now with the Offset solution is if one of the columns goes away in my 'matrix', the shading of blue or the horizontal lines will be too short as the columns change size. When I was using the bandPosition without xOffset, the lines and shading would continue to expand to the correct position. The vertical lines work fine as the bandPosition isn't going outside of the 0-1 bounds.
Is there a way to calculate how many pixels to change the offset if I always want the starting x to be the start of the 'COR' column within MBRPVCTable and the ending x2 to be the end of the 'Other' column within MBRPVCTable like my image above shows?
Thanks again for both of your time! I have to admit I was kind of star struck when I got a reply from the DMP!
- dm-p1 year agoSuper User
You're too kind! I get pretty giddy each time I see someone using Deneb to solve a challenge 🙂
These properties have expression support, so you could calculate the x-axis's bandwidth and offset by half of that.
I'd need to see any revised code (and possibly get a sample of data to set up and try to confirm 100%, as it depends on where you're using xOffset, etc., in your spec (whether via mark properties or encoding channels).
If using via mark properties, something like the following could be a starting point which should offset by a quarter of the derived bandwidth in each direction:
// Assuming you want to go left (negative) "xOffset": { "expr": "-bandwidth('x') * 0.25" } // Assuming you want to go right (positive) "x2Offset": { "expr": "bandwidth('x') * 0.25" }Hoepfully that may get you on the right path, but if you're still stuck then any contextual info like a revised spec and sample data would be a great help to get you where you need to be.
Good luck!
Daniel
- BobThon1 year agoFrequent Visitor
Thanks for all of the help Daniel. Sorry for the lateness in my reply. My initial attempts were unsuccessful and several work priorities have kept me away. I will mark your original post as the solution for my question but will eventually post a sample workbook for my latest question to you.
Thanks again!
Bob