@octane-xplat/charts 0.11.1 → 0.13.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,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,
|
|
4
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(() =>
|
|
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
|
|
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
|
-
},
|
|
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:
|
|
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:
|
|
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:
|
|
384
|
-
o:
|
|
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:
|
|
383
|
+
u: __s,
|
|
391
384
|
v: _m21,
|
|
392
385
|
w: null,
|
|
393
|
-
x:
|
|
386
|
+
x: __s,
|
|
394
387
|
y: _m24,
|
|
395
388
|
z: null,
|
|
396
|
-
A:
|
|
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 =
|
|
407
|
-
_b.c =
|
|
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 =
|
|
422
|
-
_b.f =
|
|
423
|
-
_b.g =
|
|
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,26 +445,34 @@ var Chart = /* @__PURE__ */ __s(function Chart(props, __s, __extra) {
|
|
|
452
445
|
_b.m = _v;
|
|
453
446
|
}
|
|
454
447
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
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
|
-
ifBlock(__s, 3, _b.o, __ifCondition, __then$2, null, _b.p, __ifCondition ? [cursor, plot] : void 0);
|
|
471
|
+
ifBlock(__s, 3, _b.o, __ifCondition, __then$2, null, _b.p, __ifCondition ? [cursor, plot] : void 0, 1);
|
|
471
472
|
}
|
|
472
473
|
{
|
|
473
474
|
const __ifCondition$ = cursor && (props.crosshair || props.tooltip);
|
|
474
|
-
ifBlock(__s, 4, _b.o, __ifCondition$, __then$4, null, _b.q, __ifCondition$ ? [cursor, dotColor] : void 0);
|
|
475
|
+
ifBlock(__s, 4, _b.o, __ifCondition$, __then$4, null, _b.q, __ifCondition$ ? [cursor, dotColor] : void 0, 1);
|
|
475
476
|
}
|
|
476
477
|
{
|
|
477
478
|
const __ifCondition$2 = cursor && props.tooltip && tipText;
|
|
@@ -480,9 +481,13 @@ var Chart = /* @__PURE__ */ __s(function Chart(props, __s, __extra) {
|
|
|
480
481
|
tipLeft,
|
|
481
482
|
tipText,
|
|
482
483
|
tipTop
|
|
483
|
-
] : void 0);
|
|
484
|
+
] : void 0, 1);
|
|
485
|
+
}
|
|
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;
|
|
484
490
|
}
|
|
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
491
|
});
|
|
487
492
|
//#endregion
|
|
488
493
|
export { Chart };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octane-xplat/charts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.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.
|
|
57
|
-
"@octane-xplat/macos-renderer": "0.
|
|
58
|
-
"@octane-xplat/ui": "0.
|
|
56
|
+
"@nativescript/core": "9.1.3",
|
|
57
|
+
"@octane-xplat/macos-renderer": "0.13.0",
|
|
58
|
+
"@octane-xplat/ui": "0.13.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.
|
|
66
|
+
"octane": "0.11.0",
|
|
67
67
|
"tsrx-typegen": "0.2.2",
|
|
68
68
|
"typescript": "5.9.3",
|
|
69
69
|
"vite": "8.3.0",
|