MCPcopy Index your code
hub / github.com/apache/echarts / syncBackToRoamOptionFromRoamTrans

Function syncBackToRoamOptionFromRoamTrans

src/coord/View.ts:849–875  ·  view source on GitHub ↗

* @see VIEW_COORD_SYS_ANIMATION_INTERRUPTION

(
    viewInner: ViewInner,
    hostModel: RoamHostComponentOrSeries,
    otherModelsToSync: RoamHostComponentOrSeries[] | NullUndefined,
    roamTrans: Transformable,
)

Source from the content-addressed store, hash-verified

847 * @see VIEW_COORD_SYS_ANIMATION_INTERRUPTION
848 */
849function syncBackToRoamOptionFromRoamTrans(
850 viewInner: ViewInner,
851 hostModel: RoamHostComponentOrSeries,
852 otherModelsToSync: RoamHostComponentOrSeries[] | NullUndefined,
853 roamTrans: Transformable,
854): void {
855 // This is the inverse operation of `viewCoordSysSetRoamOptionFromModel`.
856 const viewRectCenter = viewCoordSysGetViewRectCenter(viewInner);
857 const zoom = getZoomFromRoamTrans(roamTrans);
858 const notZoomNearZero = mathAbs(zoom) > 1e-6;
859 tmpCenterITR[0] = notZoomNearZero
860 ? (viewRectCenter[0] - roamTrans.x) / zoom
861 : viewRectCenter[0]; // Unlikely to occur.
862 tmpCenterITR[1] = notZoomNearZero
863 ? (viewRectCenter[1] - roamTrans.y) / zoom
864 : viewRectCenter[1]; // Unlikely to occur.
865
866 vectorApplyTransform(tmpCenterITR, tmpCenterITR, viewInner.mtRawInv);
867
868 const centerOption = invertBackToCenterOption(viewInner, tmpCenterITR);
869 syncBackRoamOptionToRoamHostModel(hostModel, centerOption, zoom);
870 each(otherModelsToSync, function (otherModel) {
871 if (otherModel !== hostModel) {
872 syncBackRoamOptionToRoamHostModel(otherModel, centerOption.slice(), zoom);
873 }
874 });
875}
876const tmpCenterITR: number[] = [];
877
878/**

Callers 1

viewCoordSysSyncBackFunction · 0.85

Calls 5

getZoomFromRoamTransFunction · 0.85
invertBackToCenterOptionFunction · 0.85
eachFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…