graphein 0.7.0 → 0.7.2

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
@@ -8259,7 +8259,8 @@ function drawPie(surface, spec, tokens, size, context) {
8259
8259
  color: tokens.color.text,
8260
8260
  size: tokens.font.size.small,
8261
8261
  transform: o.align === "right" ? "translate(-100%,-50%)" : "translateY(-50%)",
8262
- opacity: alpha === 1 ? void 0 : alpha
8262
+ opacity: alpha === 1 ? void 0 : alpha,
8263
+ pill: { background: tokens.color.surface, border: tokens.color.border, padX: 6 }
8263
8264
  });
8264
8265
  }
8265
8266
  for (const l of labelPlan.inside) {
@@ -8269,11 +8270,12 @@ function drawPie(surface, spec, tokens, size, context) {
8269
8270
  left: l.x,
8270
8271
  top: l.y,
8271
8272
  text: l.text,
8272
- color: rgbaToCss(readableTextColor(slice.rgba)),
8273
+ color: tokens.color.text,
8273
8274
  size: tokens.font.size.small,
8274
8275
  weight: tokens.font.weight.bold,
8275
8276
  transform: "translate(-50%,-50%)",
8276
- opacity: alpha === 1 ? void 0 : alpha
8277
+ opacity: alpha === 1 ? void 0 : alpha,
8278
+ pill: { background: tokens.color.surface, border: tokens.color.border, padX: 6 }
8277
8279
  });
8278
8280
  }
8279
8281
  }
@@ -15940,6 +15942,7 @@ var CANVAS_MARK_TYPES = /* @__PURE__ */ new Set([
15940
15942
  "sankey",
15941
15943
  "choropleth"
15942
15944
  ]);
15945
+ var EMPTY_DATA = [];
15943
15946
  function resolveContainer(target) {
15944
15947
  if (typeof target === "string") {
15945
15948
  const el = document.querySelector(target);
@@ -15991,7 +15994,7 @@ function render(target, spec, options) {
15991
15994
  let txDef;
15992
15995
  let txOut = [];
15993
15996
  const effectiveData2 = () => {
15994
- const src = currentSpec.data ?? [];
15997
+ const src = currentSpec.data ?? EMPTY_DATA;
15995
15998
  const tx = currentSpec.transform;
15996
15999
  if (!tx || tx.length === 0) return src;
15997
16000
  if (txSrc === src && txDef === tx) return txOut;
@@ -16029,7 +16032,7 @@ function render(target, spec, options) {
16029
16032
  const filterValues = resolveFilterValues(currentSpec.filter, store);
16030
16033
  const baseData = effectiveData2();
16031
16034
  const filtered = filterValues.length ? filterRows(baseData, filterValues) : baseData;
16032
- const effectiveSpec = filtered === baseData ? currentSpec : { ...currentSpec, data: filtered };
16035
+ const effectiveSpec = filtered === (currentSpec.data ?? EMPTY_DATA) ? currentSpec : { ...currentSpec, data: filtered };
16033
16036
  const emphasis = resolveEmphasis(currentSpec.highlight, store, DIM_ALPHA);
16034
16037
  const ownParam = currentSpec.params?.[0];
16035
16038
  let interactionModel = null;