Question: I get a large list of data to populate into a jqGrid on my clientside.

```
List<MyData> lotsOfRecords = getData();

```

Which I then store in cache, since a lot of people will be using it:

```
Cache["SharedData"].Add(lotsOfRecords);

```

This grid allows users to check records for processing. I want to persist which records are checked as a user sorts, filters, pages, etc.

My first thought was to add a property `bool Selected { get; set; }` to the `MyData` object, and toggle it whenever someone checks a field. Obviously, that won't work since this is a shared cache. I don't want Joe User checking things that Bill User didn't want checked.

Next idea was to store a `Dictionary<int, bool>` in session, that maps the id of a record to the checked status. This wasn't bad, but since there is no easy way to combine objects in .NET, I don't see a clean way to send that down to my grid without a clunky anonymous object:

```
return lotsOfRecords.Select(record => {
     record.Id,
     record.Name,
     ...
     myDictionary[record.Id] // true/false for checked
};

```

That would be a solution, but I'm hoping there is a cleaner design pattern considering I have a lot of fields in my object and use it in a similar way across a few pages. Any suggestions are welcome. Thanks in advance!

Btw, my current environment is ASP.NET MVC 3 with jQuery/UI and jqGrid.

Answer: 
D3 allows to use zoom and it's fairly easy to implement. You'll only need to wrap your graph inside a "g" element that I'll call "viewport". Then you'll assign to the zoom event of the svg element:

```
svg.call(d3.behavior.zoom().on("zoom", redraw))

```

the following function:

```
function redraw() {
    d3.select("#viewport").attr("transform",
        "translate(" + d3.event.translate + ")"
        + " scale(" + d3.event.scale + ")");
}

```
```
var x, y, k;
            if (d && centered !== d) {
                var centroid = path.centroid(d);
                x = centroid[0];
                y = centroid[1];
                k = 4;
                centered = d;
            } else {
                x = w / 2;
                y = h / 2;
                k = 1;
                centered = null;
            }

```

write the following code in zoom function
svg.attr("transform", "translate(" + w / 2 + "," + h / 2 + ")scale(" + k + ")translate(" + -x + "," + -y + ")");

for absolute scale you cann use this code 
this will be helpfull for maps zooming and panning