phetsims / griddle

Dynamic charting library built with Scenery
MIT License
2 stars 4 forks source link

GridNode should use model coordinates #52

Closed jessegreenberg closed 4 years ago

jessegreenberg commented 4 years ago

REcommended in https://github.com/phetsims/scenery-phet/issues/601. This would make #50 easier as well since plots are generally using model coordinates.

jessegreenberg commented 4 years ago

GridNode now uses model coordinates and has an optional ModelViewTransform2.

jessegreenberg commented 4 years ago

Reopening, I no longer thing this is the right way to go. GridNode needs to change its line spacings to support things like zooming in. The model-view transform cannot be used as is currently implemented because grid width and height are in model coordinates too, so changing scale will make the entire grid larger/smaller.

From https://github.com/phetsims/scenery-phet/issues/601#issuecomment-635457138

I considered changing the API to have width/height in view coordinates and line spacings/offsets in model coordinates, but that would be confusing. I considered having a separate NumberProperty for zoom, but that is confusing in combination with the ModelViewTransform.

I am going to go back to having GridNode use view coordinates.

jessegreenberg commented 4 years ago

GridNode is back to view coordinates.