Page MenuHomePhabricator

Ensure zoom-to-fit scale is always >0 [2152]
ClosedPublic

Authored by bengotow on Wed, Feb 12, 11:00 PM.

Details

Summary

The error shown in https://github.com/dagster-io/dagster/issues/2152 is caused by the Gaant visualization computing a zoom-to-fit size of <=0 and then attempting to transform it logarithmically based on your preferred zoom [1-100] (producing NaN as shown in the screnshot). Math.log(0) and Math.log(-anything) are both invalid and we just need to make sure that both the elapsed time and the width of the view are positive here.

I broke this onto multiple lines and added local vars to name the divisor and divided and make this easier to follow.

Test Plan

run tests

Diff Detail

Repository
R1 dagster
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bengotow created this revision.Wed, Feb 12, 11:00 PM
This revision is now accepted and ready to land.Wed, Feb 12, 11:08 PM
This revision was automatically updated to reflect the committed changes.