MCPcopy Index your code
hub / github.com/plotly/plotly.js / makeRangeBox

Function makeRangeBox

src/plots/geo/geo.js:828–852  ·  view source on GitHub ↗
(lon, lat)

Source from the content-addressed store, hash-verified

826//
827// Note that clipPad padding is added around range to avoid aliasing.
828function makeRangeBox(lon, lat) {
829 var clipPad = constants.clipPad;
830 const [lon0, lon1] = unwrapLonRange([lon[0] + clipPad, lon[1] - clipPad]);
831 var lat0 = lat[0] + clipPad;
832 var lat1 = lat[1] - clipPad;
833
834 var dlon4 = (lon1 - lon0) / 4;
835
836 return {
837 type: 'Polygon',
838 coordinates: [[
839 [lon0, lat0],
840 [lon0, lat1],
841 [lon0 + dlon4, lat1],
842 [lon0 + 2 * dlon4, lat1],
843 [lon0 + 3 * dlon4, lat1],
844 [lon1, lat1],
845 [lon1, lat0],
846 [lon1 - dlon4, lat0],
847 [lon1 - 2 * dlon4, lat0],
848 [lon1 - 3 * dlon4, lat0],
849 [lon0, lat0]
850 ]]
851 };
852}

Callers 1

geo.jsFile · 0.85

Calls 1

unwrapLonRangeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…