Arrimix
Contents

Embedding the 3D view

Show a plan inside your own website or customer portal with an iframe, and drive it from your page.

Get an embed

  • In the app: on a planned request, Share → Create a link; the iframe code is shown with the link.
  • With the API: POST /v1/shipments/{id}/share returns url, iframe and model_url.
<iframe src="https://APP_URL/embed/sl_…?lang=en&theme=auto"
        width="100%" height="640" style="border:0" allow="fullscreen" title="Load plan"></iframe>

URL options

Option Values Default
lang en, fr, es, de en
theme light, dark, auto auto (visitor's system)
hide breadcrumb, info, steps, legend, hint (comma separated) nothing hidden
bin id of a packaging to open first first of the last level

The embed shows the 3D view, a link to download the 3D model, and "Made with …" unless your organization has the white label option.

Where it may be shown

In Settings → Embeds, list the sites allowed to show your embeds, one per line (https://shop.example.com). Browsers then refuse to show them elsewhere. Empty list: any site.

Drive it with postMessage

Messages in both directions carry source: "plan-embed".

Events sent by the embed

type Fields When
ready metrics, bins (id, label, level, packaging_code) loaded
open binId, label the visitor opened a packaging
hover unitId, label (null when leaving) pointer over a unit

Commands you can send

type Fields Effect
open binId opens that packaging (and its parents)
step step (number, or null for all) shows the load up to that loading step
highlight unitId (or null) keeps that unit solid, fades the others

Example

<iframe id="plan" src="https://APP_URL/embed/sl_…?hide=hint"></iframe>
<script>
  const frame = document.getElementById("plan");
  const send = (message) => frame.contentWindow.postMessage({ source: "plan-embed", ...message }, "*");

  window.addEventListener("message", (event) => {
    if (event.data?.source !== "plan-embed") return;
    if (event.data.type === "ready") {
      const firstPallet = event.data.bins.find((bin) => bin.packaging_code === "EUR1");
      if (firstPallet) send({ type: "open", binId: firstPallet.id });
    }
    if (event.data.type === "open") console.log("opened", event.data.label);
  });

  // Highlight the units of the first line of the request.
  document.getElementById("show-buckets").onclick = () => send({ type: "highlight", unitId: "line-1" });
</script>

Unit ids of request lines are line-1, line-2… in the order of the lines; packaging ids are in the ready event (and in include=placements with the API).

Revoke

A link stops working when it expires or is revoked (in the app, or by deleting the request). The iframe then shows This link is no longer available.