Search code examples
zedgraph

Does ZedGraph offer any kind of Level-of-Detail Culling behavior?


I've searched and can't find an answer to this question. I could write the code myself to do it, but I don't want to reinvent the wheel. :)

Since ZedGraph uses an IPointList and its indexer for internal data access, you can assign any kind of data structure to it and dynamically change the data that ZedGraph receives when it calls the indexer.

It's a smart architecture, and naturally, it would be feasible to implement a Level-of-Detail system using a custom IPointList where the number of points is culled based on the xScale and yScale of the GraphPane.

This way you can have millions of points loaded, but when the zoomlevel of the graph would show all the points, they can be culled so that ZedGraph is only drawing a few thousand. As the zoom magnification is increased, fewer points would be culled in the region of interest.

I wanted to know if ZedGraph already offers anything like this out of the box. I haven't seen any indication of support for it.

Does anyone know?


Solution

  • I posted about this on Sourceforge and got no response there either.

    Then I posted on a fork on Github and got a response. It's here: https://github.com/ZedGraph/ZedGraph/issues/13

    The answer: There is a naive algorithm that filters points by simply skipping them blindly to reach a target display number.

    Of course this naive approach can give completely wrong impressions of what the data looks like when peaks and valleys get dropped in a line graph, for instance. IMHO, an algorithm like that is completely unuseable.

    So basically, there is no acceptable built-in culling in ZedGraph at the present time.