Published
Edited
Apr 17, 2018
Insert cell
Insert cell
Insert cell
Insert cell
mappingAD = {
let fromstart = Math.max(
maps[0].fromstart,
maps[0].fromstart + (maps[1].fromstart - maps[0].tostart),
maps[0].fromstart + (maps[1].fromstart - maps[0].tostart) + (maps[2].fromstart - maps[1].tostart)
);
let tostart = Math.max(
maps[2].tostart,
maps[2].tostart + (maps[1].tostart - maps[2].fromstart),
maps[2].tostart + (maps[1].tostart - maps[2].fromstart) + (maps[0].tostart - maps[1].fromstart)
);
let fromend = Math.min(
maps[0].fromend,
maps[0].fromend + (maps[1].fromend - maps[0].toend),
maps[0].fromend + (maps[1].fromend - maps[0].toend) + (maps[2].fromend - maps[1].toend)
);
let toend = Math.min(
maps[2].toend,
maps[2].toend + (maps[1].toend - maps[2].fromend),
maps[2].toend + (maps[1].toend - maps[2].fromend) + (maps[0].toend - maps[1].fromend)
);
return [{from: "A", to: "D", color: 'red', fromstart: fromstart, tostart: tostart,fromend: fromend, toend:toend}];
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more