Setting coordinate space/common space and transformation for 3rd party Skia based library

Hi. I’m trying to use Microcharts to create charts in vvvv. Here’s the patch:

charts.vl (72.4 KB)

I took Rectangle node from Skia.Layers and I’m using it as a base to create a LineChart. You’d see a LineChartzzz node in this patch.

Given Microcharts’ DrawContent node draws by taking width and height in pixels (those properties are integer so I assume they are pixel-based), how do I:

  • Ensure that like a Rectangle node, when I pass Size to LineChartzzz node it has the same size (i.e. its LineChartzzz is drawn at center and has the same size as a Rectangle if I’m passing 2x2 size to both of them)?
  • Ensure that transformations behave properly like they do in Rectangle node? (Right now changing scale, rotate doesn’t do anything)

Essentially my main goal is that my chart node’s position and size matches with Rectangle node when Position, Size and Anchor are given to it.


Things I tried:

  • Manually calculating chart size by using properties from ClientBounds. The transformations didn’t work in this case
  • Tried using WithinCommonSpace: I suppose it is not meant for this task
  • Using Transformation node from CallerInfo - Learnt that I shouldn’t be applying transformations received from in into my layer because then its calculations will keep updating

Things I didn’t try (yet):

  • Aspect related nodes that pop up when you search for “aspect” in node browser
  • This alternate way to render a layer

Update: I have raised this as a feature request

Not sure if it helps, but the vvvv skia space is 1px = 0.01. so 1 in vvvv is 100px.