@octane-xplat/charts 0.11.1 → 0.12.0

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "buildId": "85aa55e8-086f-4056-bf04-d80ae6d12101",
3
+ "buildId": "218b2d90-ef10-4c27-b6b6-f6fe26c8e6cd",
4
4
  "mode": "production",
5
5
  "capabilities": {
6
6
  "independentHydration": false
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "buildId": "ea573de7-d82e-4c41-b8fd-98f1bc11e14a",
3
+ "buildId": "e45dce3b-5edc-4da4-8c7b-1564928088dd",
4
4
  "mode": "production",
5
5
  "capabilities": {
6
6
  "independentHydration": false
@@ -1,10 +1,9 @@
1
1
  import { computeScene } from "./core/scene.js";
2
2
  import { createScrub, hitLabel } from "./core/hit.js";
3
- import { __s, bag13, bag8, bag9, bagOf, child, clone, createElement, createScopedElement, createScopedValue, hookSlots, ifBlock, isHydratingStyle, positionalChildren, queueRefAttach, queueRefDetach, setAriaAttribute, setDangerouslySetInnerHTML, setStyle, setStyleProperties, setStyleProperty, sibling, template, useEffect, useRef, useState, withSlot } from "octane";
4
- import { bindSignalAttribute, bindSignalChild, compilerMemoRegion, enableSignalBindings, hookMemoCreate, hookMemoEqual, hookMemoPublish, hookMemoPublish2, hookMemoPublishInvariant, replaceRef, setPlainAttribute } from "octane/internal/client";
3
+ import { __s, bag13, bag8, bag9, bagOf, child, clone, createScopedElement, createScopedValue, hookSlots, ifBlock, isHydratingStyle, positionalChildren, queueRefAttach, queueRefDetach, setDangerouslySetInnerHTML, setStyle, setStyleProperties, setStyleProperty, sibling, template, useEffect, useRef, useState, withSlot } from "octane";
4
+ import { childTextHoleUpdate, compilerMemoRegion, createHostElement, hookMemoCreate, hookMemoEqual, hookMemoPublish, hookMemoPublish2, hookMemoPublishInvariant, replaceRef, setAriaAttributeIfChanged, setClassNameIfChanged, setPlainAttributeIfChanged, textHoleUpdate } from "octane/internal/client";
5
5
  import { useMeasure } from "@octane-xplat/ui";
6
6
  //#region src/Chart.web.tsrx
7
- enableSignalBindings(1, true);
8
7
  var _t$0 = /* @__PURE__ */ template("<div style=\"position: absolute;\"></div>");
9
8
  var _t$1 = /* @__PURE__ */ template("<div><!><div style=\"position: relative; flex-grow: 1; min-height: 0;\"><div></div><div style=\"position: absolute; inset: 0;\"><!><!><!><!></div></div><!></div>");
10
9
  var _hs$ = /* @__PURE__ */ hookSlots(6);
@@ -14,10 +13,8 @@ function __then$2(__props, __s, __extra) {
14
13
  const plot = __extra[1];
15
14
  let _b = __s.slots[0];
16
15
  if (_b === void 0) {
17
- let _m7;
18
16
  const _root = clone(_t$0, void 0, "||");
19
- _m7 = _root;
20
- _b = bag8(__s, _root, __s, void 0, void 0, void 0, void 0, void 0, void 0, _m7);
17
+ _b = bag8(__s, _root, __s, void 0, void 0, void 0, void 0, void 0, void 0, _root);
21
18
  }
22
19
  {
23
20
  const _v0 = cursor.px - .5;
@@ -81,10 +78,8 @@ function __then$4(__props, __s, __extra) {
81
78
  const dotColor = __extra[1];
82
79
  let _b = __s.slots[0];
83
80
  if (_b === void 0) {
84
- let _m8;
85
81
  const _root = clone(_t$0, void 0, "||");
86
- _m8 = _root;
87
- _b = bag9(__s, _root, __s, void 0, void 0, void 0, void 0, void 0, void 0, void 0, _m8);
82
+ _b = bag9(__s, _root, __s, void 0, void 0, void 0, void 0, void 0, void 0, void 0, _root);
88
83
  }
89
84
  {
90
85
  const _v0 = cursor.px - 4;
@@ -158,10 +153,8 @@ function __then$6(__props, __s, __extra) {
158
153
  const tipTop = __extra[3];
159
154
  let _b = __s.slots[0];
160
155
  if (_b === void 0) {
161
- let _m10;
162
156
  const _root = clone(_t$0, void 0, "||");
163
- _m10 = _root;
164
- _b = bag13(__s, _root, __s, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, _m10, null, void 0);
157
+ _b = bag13(__s, _root, __s, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, _root, null, __s);
165
158
  }
166
159
  {
167
160
  const _v0 = tipLeft;
@@ -243,7 +236,11 @@ function __then$6(__props, __s, __extra) {
243
236
  }
244
237
  }
245
238
  }
246
- _b.n = bindSignalChild(__s, _b.n, 1, _b.k, tipText, "b:a58cdbae", null, void 0, void 0, void 0, true);
239
+ {
240
+ const _v = tipText;
241
+ _b.l = childTextHoleUpdate(__s, 1, _b.k, _v, _b.l, _b.m);
242
+ _b.m = _v;
243
+ }
247
244
  }
248
245
  var _rm$10 = [
249
246
  "r",
@@ -334,7 +331,7 @@ var Chart = /* @__PURE__ */ __s(function Chart(props, __s, __extra) {
334
331
  alignItems: "center",
335
332
  gap: 4,
336
333
  fontSize: 11
337
- } }, () => positionalChildren([createScopedValue(() => createElement("span", { style: {
334
+ } }, () => positionalChildren([createScopedValue(() => createHostElement("span", { style: {
338
335
  width: 10,
339
336
  height: 10,
340
337
  borderRadius: 2,
@@ -344,20 +341,16 @@ var Chart = /* @__PURE__ */ __s(function Chart(props, __s, __extra) {
344
341
  if (__s.block.pending && !__s.block.crossRenderUpdate) return;
345
342
  let _b = __s.slots[0];
346
343
  if (_b === void 0) {
347
- let _m1, _m7, _m8, _m13, _m14, _m15, _m16, _m17, _m18, _m21, _m24;
344
+ let _m8, _m15, _m16, _m17, _m18, _m21, _m24;
348
345
  const _root = clone(_t$1, void 0, "|1|");
349
- _m1 = _root;
350
346
  const _el0 = sibling(child(_root), 1);
351
- _m7 = _el0;
352
347
  queueRefAttach(__s, _m8 = (el) => {
353
348
  hostRef.current = el;
354
349
  measure.ref(el);
355
- }, _m7);
350
+ }, _el0);
356
351
  (__s.cleanups ??= []).push(() => _b && queueRefDetach(_b.i, _b.h));
357
352
  const _el1 = child(_el0);
358
- _m13 = _el1;
359
353
  const _el2 = sibling(_el1, 1);
360
- _m14 = _el2;
361
354
  const _el3 = sibling(child(_el2), 1);
362
355
  _m15 = _el3;
363
356
  const _el4 = sibling(_el3, 1);
@@ -368,32 +361,32 @@ var Chart = /* @__PURE__ */ __s(function Chart(props, __s, __extra) {
368
361
  _m24 = sibling(_el0, 1);
369
362
  _b = bagOf(__s, _root, {
370
363
  a: void 0,
371
- b: _m1,
364
+ b: _root,
372
365
  c: void 0,
373
366
  d: void 0,
374
367
  e: void 0,
375
368
  f: void 0,
376
369
  g: void 0,
377
- h: _m7,
370
+ h: _el0,
378
371
  i: _m8,
379
372
  j: __s,
380
373
  k: void 0,
381
374
  l: void 0,
382
375
  m: void 0,
383
- n: _m13,
384
- o: _m14,
376
+ n: _el1,
377
+ o: _el2,
385
378
  p: _m15,
386
379
  q: _m16,
387
380
  r: _m17,
388
381
  s: _m18,
389
382
  t: null,
390
- u: void 0,
383
+ u: __s,
391
384
  v: _m21,
392
385
  w: null,
393
- x: void 0,
386
+ x: __s,
394
387
  y: _m24,
395
388
  z: null,
396
- A: void 0
389
+ A: __s
397
390
  });
398
391
  __s.refFields = _rm$10;
399
392
  } else {
@@ -403,8 +396,8 @@ var Chart = /* @__PURE__ */ __s(function Chart(props, __s, __extra) {
403
396
  };
404
397
  if (_r !== _b.i) _b.i = replaceRef(__s, _b.i, _r, _b.h);
405
398
  }
406
- _b.a = bindSignalAttribute(__s, _b.a, _b.b, "id", props.id, "b:c3863ebe", setPlainAttribute);
407
- _b.c = bindSignalAttribute(__s, _b.c, _b.b, "class", props.className, "b:75b7746e", "class");
399
+ _b.a = setPlainAttributeIfChanged(props.id, _b.a, _b.b, "id");
400
+ _b.c = setClassNameIfChanged(props.className, _b.c, _b.b);
408
401
  {
409
402
  const _v = {
410
403
  display: "flex",
@@ -418,9 +411,9 @@ var Chart = /* @__PURE__ */ __s(function Chart(props, __s, __extra) {
418
411
  _b.d = _v;
419
412
  }
420
413
  }
421
- _b.e = bindSignalAttribute(__s, _b.e, _b.b, "role", props.accessibilityLabel ? "img" : void 0, "b:f6e63ca7", setPlainAttribute);
422
- _b.f = bindSignalAttribute(__s, _b.f, _b.b, "aria-label", props.accessibilityLabel, "b:6f97c1ef", setAriaAttribute);
423
- _b.g = bindSignalAttribute(__s, _b.g, _b.h, "id", props.id ? props.id + "-overlay" : void 0, "b:b2421ba0", setPlainAttribute);
414
+ _b.e = setPlainAttributeIfChanged(props.accessibilityLabel ? "img" : void 0, _b.e, _b.b, "role");
415
+ _b.f = setAriaAttributeIfChanged(props.accessibilityLabel, _b.f, _b.b, "aria-label");
416
+ _b.g = setPlainAttributeIfChanged(props.id ? props.id + "-overlay" : void 0, _b.g, _b.h, "id");
424
417
  {
425
418
  const _v0 = props.width;
426
419
  const _v1 = props.height ?? (props.aspectRatio && w > 0 ? w / props.aspectRatio : void 0);
@@ -452,19 +445,27 @@ var Chart = /* @__PURE__ */ __s(function Chart(props, __s, __extra) {
452
445
  _b.m = _v;
453
446
  }
454
447
  }
455
- _b.B = bindSignalChild(__s, _b.B, 1, _b.b, legend === "top" && scene ? legendRow(scene.legend, "top") : null, "b:dbd2df85", _b.s, true, void 0, void 0, void 0);
456
- _b.C = bindSignalChild(__s, _b.C, 2, _b.o, scene?.labels.map((l) => createScopedElement("div", { style: {
457
- position: "absolute",
458
- left: l.x,
459
- top: l.y,
460
- width: l.width,
461
- fontSize: 10,
462
- opacity: .7,
463
- textAlign: l.align,
464
- overflow: "hidden",
465
- whiteSpace: "nowrap",
466
- textOverflow: "ellipsis"
467
- } }, () => l.text)), "b:fdc3332b", _b.v, true, void 0, void 0, void 0);
448
+ {
449
+ const _v = legend === "top" && scene ? legendRow(scene.legend, "top") : null;
450
+ _b.t = textHoleUpdate(__s, 1, _b.b, _v, _b.t, _b.u, _b.s, true);
451
+ _b.u = _v;
452
+ }
453
+ {
454
+ const _v = scene?.labels.map((l) => createScopedElement("div", { style: {
455
+ position: "absolute",
456
+ left: l.x,
457
+ top: l.y,
458
+ width: l.width,
459
+ fontSize: 10,
460
+ opacity: .7,
461
+ textAlign: l.align,
462
+ overflow: "hidden",
463
+ whiteSpace: "nowrap",
464
+ textOverflow: "ellipsis"
465
+ } }, () => l.text));
466
+ _b.w = textHoleUpdate(__s, 2, _b.o, _v, _b.w, _b.x, _b.v, true);
467
+ _b.x = _v;
468
+ }
468
469
  {
469
470
  const __ifCondition = cursor && props.crosshair && !scene?.pie && plot;
470
471
  ifBlock(__s, 3, _b.o, __ifCondition, __then$2, null, _b.p, __ifCondition ? [cursor, plot] : void 0);
@@ -482,7 +483,11 @@ var Chart = /* @__PURE__ */ __s(function Chart(props, __s, __extra) {
482
483
  tipTop
483
484
  ] : void 0);
484
485
  }
485
- _b.D = bindSignalChild(__s, _b.D, 6, _b.b, legend === "bottom" && scene ? legendRow(scene.legend, "bottom") : null, "b:30634c19", _b.y, true, void 0, void 0, void 0);
486
+ {
487
+ const _v = legend === "bottom" && scene ? legendRow(scene.legend, "bottom") : null;
488
+ _b.z = textHoleUpdate(__s, 6, _b.b, _v, _b.z, _b.A, _b.y, true);
489
+ _b.A = _v;
490
+ }
486
491
  });
487
492
  //#endregion
488
493
  export { Chart };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "buildId": "317da582-ffdd-44d4-9a24-d9935277320b",
3
+ "buildId": "ab97fee7-bb60-4eb6-b24f-d8c13466a135",
4
4
  "mode": "production",
5
5
  "capabilities": {
6
6
  "independentHydration": false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octane-xplat/charts",
3
- "version": "0.11.1",
3
+ "version": "0.12.0",
4
4
  "description": "Cross-platform SVG charts for Octane xplat — a DOM-free d3 core with web, iOS/Android, and macOS AppKit leaves",
5
5
  "keywords": [
6
6
  "android",
@@ -53,9 +53,9 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@nativescript-community/octane": "0.2.4",
56
- "@nativescript/core": "9.1.2",
57
- "@octane-xplat/macos-renderer": "0.11.1",
58
- "@octane-xplat/ui": "0.11.1",
56
+ "@nativescript/core": "9.1.3",
57
+ "@octane-xplat/macos-renderer": "0.12.0",
58
+ "@octane-xplat/ui": "0.12.0",
59
59
  "@octanejs/vite-plugin": "0.1.61",
60
60
  "@tsrx/typescript-plugin": "0.4.11",
61
61
  "@types/d3-array": "3.2.2",
@@ -63,7 +63,7 @@
63
63
  "@types/d3-scale": "4.0.9",
64
64
  "@types/d3-shape": "3.2.0",
65
65
  "@types/d3-time-format": "4.0.3",
66
- "octane": "0.6.3",
66
+ "octane": "0.10.2",
67
67
  "tsrx-typegen": "0.2.2",
68
68
  "typescript": "5.9.3",
69
69
  "vite": "8.3.0",