graphein 0.7.0 → 0.7.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.
package/dist/index.js CHANGED
@@ -15940,6 +15940,7 @@ var CANVAS_MARK_TYPES = /* @__PURE__ */ new Set([
15940
15940
  "sankey",
15941
15941
  "choropleth"
15942
15942
  ]);
15943
+ var EMPTY_DATA = [];
15943
15944
  function resolveContainer(target) {
15944
15945
  if (typeof target === "string") {
15945
15946
  const el = document.querySelector(target);
@@ -15991,7 +15992,7 @@ function render(target, spec, options) {
15991
15992
  let txDef;
15992
15993
  let txOut = [];
15993
15994
  const effectiveData2 = () => {
15994
- const src = currentSpec.data ?? [];
15995
+ const src = currentSpec.data ?? EMPTY_DATA;
15995
15996
  const tx = currentSpec.transform;
15996
15997
  if (!tx || tx.length === 0) return src;
15997
15998
  if (txSrc === src && txDef === tx) return txOut;
@@ -16029,7 +16030,7 @@ function render(target, spec, options) {
16029
16030
  const filterValues = resolveFilterValues(currentSpec.filter, store);
16030
16031
  const baseData = effectiveData2();
16031
16032
  const filtered = filterValues.length ? filterRows(baseData, filterValues) : baseData;
16032
- const effectiveSpec = filtered === baseData ? currentSpec : { ...currentSpec, data: filtered };
16033
+ const effectiveSpec = filtered === (currentSpec.data ?? EMPTY_DATA) ? currentSpec : { ...currentSpec, data: filtered };
16033
16034
  const emphasis = resolveEmphasis(currentSpec.highlight, store, DIM_ALPHA);
16034
16035
  const ownParam = currentSpec.params?.[0];
16035
16036
  let interactionModel = null;