@amad3v/solid-echarts - v1.0.2
    Preparing search index...

    Function optionMergePlan

    • Produces the minimal correct setOption merge strategy by diffing the previous option signature against the new option.

      Decision logic (in priority order):

      1. No previous signature (first render) -> notMerge: false
      2. options array shrank (timeline steps removed) -> notMerge: true
      3. media array shrank (responsive breakpoints removed) -> notMerge: true
      4. Top-level object/scalar keys removed -> notMerge: true (ECharts merge cannot reliably remove missing top-level components/settings)
      5. Array items removed (by tracked id or anonymous count) -> replaceMerge: [key] (targeted replacement removes the stale items without resetting everything)
      6. Otherwise -> notMerge: false (standard merge, no removals detected)

      Parameters

      • prevSignature: OptionSignature | null

        Signature from the previous setOption call. Pass null on first render. Use the signature from the previous MergePlan return value on subsequent calls.

      • option: ECBasicOption

        The new ECharts option to apply.

      Returns MergePlan

      An MergePlan with the merge strategy and normalised option.

      let lastSignature: OptionSignature | null = null;

      createEffect(on([instance, option], ([chart, currentOption]) => {
      if (!chart || chart.isDisposed()) return;

      const plan = planUpdate(lastSignature, currentOption);
      lastSignature = plan.signature;

      chart.setOption(plan.option, {
      notMerge: plan.notMerge,
      replaceMerge: plan.replaceMerge.length > 0 ? plan.replaceMerge : undefined,
      });
      }));