Is a very-wide custom NSTableHeaderCell feasible?

I have to display graphical data (small line and bar graphs) with a timeline for a vast data set, similar to the Instruments display.


I tried doing this with two NSOutlineViews in a split view where the left-one would display text info and the right one would display the data. The two scroll views are synchronised to make it look like one NSOutlineView.


The user can now zoom in on the right NSOutlineView which only has one column. This works correctly by changing the width of the single tableColumn and scrolls correctly.


The issue that I found is that drawInterior for my custom NSTableHeaderCell does not pass a dirty rect to cellFrame, but the entire cell frame. Although it is not very tall, it can become very wide in my case and drawing slows down to a crawl.


I tried to get the CGGraphics clip area with:

let visibleWidth = context.boundingBoxOfClipPath.size.width

so that I would manually only draw what is inside of the clip area but this also did not work. The clip area is still sometimes very wide, much wider than the actual view, slowing down the drawing and providing a bad scroll experience.


Is my approach feasible? If so, then what should I do to only draw the correct amount of data given the current visible rect? If not, then what other approach should I take?