stamen / mapbox-gl-style-diff

Other
2 stars 1 forks source link

more granular diffing for expressions #4

Closed peterqliu closed 2 years ago

peterqliu commented 2 years ago

We currently detect any and all changes in each layer property. For very long property expressions, it can be difficult to visualize a small change in a large object or array.

Instead of the usual "new value old value" format, we can iterate through the expression, pinpoint the parts that changed, and visualize accordingly ("new old value").

peterqliu commented 2 years ago
Screen Shot 2022-01-28 at 1 38 07 AM
kelsey-taylor commented 2 years ago

@ebrelsford I really like the idea (from https://github.com/stamen/amazon-MapStyleSandbox/pull/454#issuecomment-1054713021) of seeing how much the expression has changed at the zoom levels it includes...curious what that would look like!

aparlato commented 2 years ago

seeing how much the expression has changed at the zoom levels it includes

Since only some expressions will have zoom levels and these expressions can vary pretty wildly, my inclination would be to use a more general JSON diffing library in the viewer to show the diffed expression like it would on Github (which should work much better since it's just expressions, not a huge json). I think this would still be a significant improvement over the current output. @kelsey-taylor what do you think of this?

kelsey-taylor commented 2 years ago

having seen what you're thinking over in #14...yes! this would be much more helpful, especially since we have the added benefit of variablized expressions 🙏