@weng-lab/genomebrowser 1.8.5-beta.0 → 1.8.5-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21820,6 +21820,22 @@ function n0(e = []) {
21820
21820
  tracks: e,
21821
21821
  ids: e.map((n) => n.id),
21822
21822
  setTracks: (n) => t({ tracks: n, ids: n.map((i) => i.id) }),
21823
+ reorderTracks: (n) => {
21824
+ const i = r();
21825
+ if (n.length !== i.tracks.length)
21826
+ throw new Error("Invalid track order");
21827
+ const a = new Map(i.tracks.map((u) => [u.id, u])), o = /* @__PURE__ */ new Set(), s = n.map((u) => {
21828
+ if (o.has(u))
21829
+ throw new Error("Invalid track order");
21830
+ const c = a.get(u);
21831
+ if (!c)
21832
+ throw new Error("Invalid track order");
21833
+ return o.add(u), c;
21834
+ });
21835
+ if (o.size !== i.tracks.length)
21836
+ throw new Error("Invalid track order");
21837
+ t({ tracks: s, ids: n });
21838
+ },
21823
21839
  createShortLabel: (n) => {
21824
21840
  if (n === "ruler")
21825
21841
  return "Ruler";