@ovalbee/reportifact 0.0.2 → 0.0.3

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.
Files changed (59) hide show
  1. package/README.md +15 -15
  2. package/dist/{Chart.vue_vue_type_style_index_0_lang-Bp14Es_r.js → Chart.vue_vue_type_style_index_0_lang-Bxrsp8Oz.js} +53 -43
  3. package/dist/{Chart.vue_vue_type_style_index_0_lang-Dj7m6i3v.cjs → Chart.vue_vue_type_style_index_0_lang-mN1IaQ_U.cjs} +1 -1
  4. package/dist/ImageGallery.vue_vue_type_style_index_0_lang-Ak_OUL_c.js +197 -0
  5. package/dist/ImageGallery.vue_vue_type_style_index_0_lang-Ch0UPxhs.cjs +1 -0
  6. package/dist/MetricCallout.vue_vue_type_style_index_0_lang-ANFFq7CE.js +62 -0
  7. package/dist/MetricCallout.vue_vue_type_style_index_0_lang-CT9lFI28.cjs +1 -0
  8. package/dist/MetricCards.vue_vue_type_style_index_0_lang-1hn2BMbU.js +46 -0
  9. package/dist/MetricCards.vue_vue_type_style_index_0_lang-BDU7pisC.cjs +1 -0
  10. package/dist/MetricsTable.vue_vue_type_style_index_0_lang-BfxK3vcz.js +140 -0
  11. package/dist/MetricsTable.vue_vue_type_style_index_0_lang-CS7xiHRk.cjs +1 -0
  12. package/dist/{Timeline.vue_vue_type_style_index_0_lang-BTA6fIp9.js → Timeline.vue_vue_type_style_index_0_lang-EmkZbKjQ.js} +9 -3
  13. package/dist/{Timeline.vue_vue_type_style_index_0_lang-CZ8Y2pXG.cjs → Timeline.vue_vue_type_style_index_0_lang-HOC43_F3.cjs} +2 -2
  14. package/dist/WidgetWrapper.vue_vue_type_style_index_0_lang-BY2t_Hvs.cjs +1 -0
  15. package/dist/WidgetWrapper.vue_vue_type_style_index_0_lang-BbnW8GXT.js +72 -0
  16. package/dist/portable/contracts.d.ts +6 -1
  17. package/dist/reportifact.cjs +24 -24
  18. package/dist/reportifact.js +1408 -1403
  19. package/dist/style.css +1 -1
  20. package/dist/widgets/Chart.vue.d.ts +7 -4
  21. package/dist/widgets/ImageGallery.vue.d.ts +7 -4
  22. package/dist/widgets/Markdown.vue.d.ts +1 -1
  23. package/dist/widgets/MetricCallout.vue.d.ts +5 -2
  24. package/dist/widgets/MetricCards.vue.d.ts +6 -3
  25. package/dist/widgets/MetricsTable.vue.d.ts +7 -4
  26. package/dist/widgets/ModelClassComparison.vue.d.ts +1 -1
  27. package/dist/widgets/ModelComparisonGallery.vue.d.ts +1 -1
  28. package/dist/widgets/Table.vue.d.ts +1 -1
  29. package/dist/widgets/Tensorboard.vue.d.ts +1 -1
  30. package/dist/widgets/Timeline.vue.d.ts +7 -4
  31. package/dist/widgets/WidgetWrapper.vue.d.ts +11 -5
  32. package/dist/widgets/chart.cjs +1 -1
  33. package/dist/widgets/chart.js +1 -1
  34. package/dist/widgets/image-gallery.cjs +1 -1
  35. package/dist/widgets/image-gallery.js +1 -1
  36. package/dist/widgets/metric-callout.cjs +1 -1
  37. package/dist/widgets/metric-callout.js +1 -1
  38. package/dist/widgets/metric-cards.cjs +1 -1
  39. package/dist/widgets/metric-cards.js +1 -1
  40. package/dist/widgets/metrics-table.cjs +1 -1
  41. package/dist/widgets/metrics-table.js +1 -1
  42. package/dist/widgets/timeline.cjs +1 -1
  43. package/dist/widgets/timeline.js +1 -1
  44. package/package.json +1 -6
  45. package/dist/ImageGallery.vue_vue_type_style_index_0_lang-BB4dG0CB.cjs +0 -1
  46. package/dist/ImageGallery.vue_vue_type_style_index_0_lang-DPY6mSdA.js +0 -191
  47. package/dist/MetricCallout.vue_vue_type_style_index_0_lang-BZbc-Wkf.js +0 -49
  48. package/dist/MetricCallout.vue_vue_type_style_index_0_lang-WpuALh8Z.cjs +0 -1
  49. package/dist/MetricCards.vue_vue_type_style_index_0_lang-CDPSu7no.cjs +0 -1
  50. package/dist/MetricCards.vue_vue_type_style_index_0_lang-CfxCCXmB.js +0 -33
  51. package/dist/MetricsTable.vue_vue_type_style_index_0_lang-BzrxoJW4.cjs +0 -1
  52. package/dist/MetricsTable.vue_vue_type_style_index_0_lang-CO9HvYfr.js +0 -132
  53. package/dist/WidgetWrapper.vue_vue_type_style_index_0_lang-BQQ4Vv5j.cjs +0 -1
  54. package/dist/WidgetWrapper.vue_vue_type_style_index_0_lang-D-oXqmI2.js +0 -59
  55. package/dist/entries/figure.d.ts +0 -1
  56. package/dist/portable/ReportifactFigure.vue.d.ts +0 -40
  57. package/dist/widgets/figure.cjs +0 -1
  58. package/dist/widgets/figure.d.ts +0 -6
  59. package/dist/widgets/figure.js +0 -84
package/README.md CHANGED
@@ -736,7 +736,6 @@ pages that only use metric components.
736
736
 
737
737
  ```vue
738
738
  <script setup lang="ts">
739
- import ReportifactFigure from '@ovalbee/reportifact/widgets/figure';
740
739
  import ReportifactChart from '@ovalbee/reportifact/widgets/chart';
741
740
  import '@ovalbee/reportifact/style.css';
742
741
 
@@ -747,13 +746,11 @@ const chart = {
747
746
  </script>
748
747
 
749
748
  <template>
750
- <ReportifactFigure
751
- title="Validation mAP"
749
+ <ReportifactChart
750
+ type="bar-gradient"
751
+ :data="chart"
752
752
  caption="DEIM leads on the held-out validation set."
753
- fallback-src="/case-studies/yolo-vs-deim/map.webp"
754
- >
755
- <ReportifactChart type="bar-gradient" :data="chart" />
756
- </ReportifactFigure>
753
+ />
757
754
  </template>
758
755
  ```
759
756
 
@@ -762,7 +759,6 @@ Public subpaths:
762
759
  | Import | Component | Portable input |
763
760
  | --- | --- | --- |
764
761
  | `@ovalbee/reportifact/widgets/host` | `ReportifactWidgetHost` | Theme and loading-style boundary. |
765
- | `@ovalbee/reportifact/widgets/figure` | `ReportifactFigure` | Semantic title/caption, loading, error fallback, source link. |
766
762
  | `@ovalbee/reportifact/widgets/chart` | `ReportifactChart` | `src` JSON URL or inline `data`. |
767
763
  | `@ovalbee/reportifact/widgets/metric-cards` | `ReportifactMetricCards` | Inline `data` or Markdown-table `content`. |
768
764
  | `@ovalbee/reportifact/widgets/metric-callout` | `ReportifactMetricCallout` | Inline `data` or direct props. |
@@ -773,18 +769,22 @@ Public subpaths:
773
769
 
774
770
  For URL-backed widgets, `src` is the portable spelling and legacy `url` remains
775
771
  supported for the full report renderer. Inline `data` takes precedence when
776
- both are present. `ReportifactFigure` owns the shared loading and fallback
777
- presentation; its `fallbackImage` is also emitted as a no-JavaScript fallback and replaces a
778
- failed child widget. `fallbackSrc` remains available as a compatibility alias.
779
- Wrap lower-level widgets in `ReportifactWidgetHost` when they are not already
780
- inside a `ReportifactFigure` or full `Reportifact` renderer.
772
+ both are present. Every portable widget already renders a semantic `<figure>`
773
+ and accepts optional `caption`, `sourceHref`, and `sourceLabel` props. The
774
+ shared `WidgetWrapper` owns that semantic frame together with loading and error
775
+ presentation; hosts do not add another wrapper. Static fallback images are not
776
+ part of the portable v1 authoring contract.
777
+
778
+ The full report directives accept the same `caption`, `sourceHref`, and
779
+ `sourceLabel` options. Existing reports remain valid when those options are
780
+ absent.
781
781
 
782
782
  `MetricCallout`'s `html` field is trusted pre-rendered HTML. Do not pass
783
783
  untrusted user input without sanitizing it first.
784
784
 
785
785
  Parquet tables, TensorBoard, scopes, and the full widget dispatcher remain
786
- full-report features. Embed a public full report for those experiences instead
787
- of importing their internals into a content page.
786
+ full-report features. Publish a static summary or link to a public Live Example
787
+ for those experiences instead of importing their internals into a content page.
788
788
 
789
789
  ### Custom Widgets
790
790
 
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as li, ref as kt, onMounted as ui, onUnmounted as ci, computed as st, watch as vi, createBlock as pa, openBlock as ga, withCtx as da, createElementVNode as lt, normalizeStyle as ma, createCommentVNode as hi, unref as fi } from "vue";
2
2
  import { aW as j, b6 as ya, c as Qe, aY as Tt, d as ge, b7 as St, b8 as ba, b9 as Rt, _ as B, u as Vt, a9 as oe, aQ as de, a5 as F, S as Re, ba as pi, bb as gi, bc as ae, bd as et, be as ie, bf as Ce, bg as di, a7 as it, e as re, bh as $e, V as me, bi as De, bj as Sa, bk as xr, a2 as ra, Q as ia, X as Ar, bl as ye, v as Y, bm as _t, bn as Oe, bo as He, bp as mi, bq as _a, br as wa, P as nt, b as K, bs as xa, bt as Te, $ as yi, bu as Aa, R as Me, bv as Ia, aZ as Ee, a8 as ue, bw as bi, bx as Ir, y as z, by as Si, bz as na, bA as _i, bB as wi, bC as Da, bD as Ma, bE as xi, bF as Dr, bG as Ai, f as We, bH as Ii, bI as Fe, aG as oa, bJ as La, M as Z, bK as jt, A as wt, bL as yt, O as Di, bM as Ue, aN as ke, bN as Mr, W as Lr, bO as Mi, bP as Li, bQ as Ci, bR as Ti, bS as Vi, bT as Pi, aI as Ei, bU as ki, m as Cr, bV as Ri, bW as Oi, bX as Ni, aR as $, bY as zi, bZ as Gi, b_ as Bi, b$ as Tr, c0 as Hi, c1 as Vr, aq as te, ap as ne, a1 as Fi, c2 as Ui, c3 as $i, c4 as Ca, aX as sa, c5 as Wi, ak as xt, c6 as Xi, c7 as Yi, c8 as Zi, c9 as qi, ca as Ki, an as Pr, cb as ji, cc as Ji, cd as Qi, ce as Ta, ao as Er, cf as en, aK as kr, cg as tn, ch as Va, aD as an, ci as rn, cj as nn, ck as on, cl as Rr, a_ as At, F as sn, cm as Ot, cn as Nt, n as ln, B as un, co as cn, cp as vn, cq as zt, cr as Pa, ay as hn, cs as fn, a0 as pe, ct as Ea, cu as pn, cv as ka, w as Ra, z as Gt, cw as gn, cx as dn, cy as mn, cz as yn, ar as Or, cA as bn, cB as Sn, aM as _n, s as Jt, cC as wn, as as xn, aV as Bt, aT as Ht, cD as An, cE as In, aU as Dn, cF as Mn, cG as Oa, cH as Ln, cI as Cn, a$ as Tn, b0 as Vn, b1 as Pn, b2 as En, b3 as kn, b4 as Rn } from "./index-DevYhXSC.js";
3
3
  import { u as On } from "./useFetch-CHQm_TmB.js";
4
- import { _ as Nn } from "./WidgetWrapper.vue_vue_type_style_index_0_lang-D-oXqmI2.js";
4
+ import { _ as Nn } from "./WidgetWrapper.vue_vue_type_style_index_0_lang-BbnW8GXT.js";
5
5
  function Nr(i, a, e, t, r, n, o, s) {
6
6
  var l = r - i, u = n - a, c = e - i, v = t - a, f = Math.sqrt(c * c + v * v);
7
7
  c /= f, v /= f;
@@ -5304,6 +5304,7 @@ function ot(i = "15%") {
5304
5304
  }
5305
5305
  function be(i = {}) {
5306
5306
  return {
5307
+ valueFormatter: (a) => Ns(a),
5307
5308
  ...i,
5308
5309
  textStyle: {
5309
5310
  fontSize: 12,
@@ -5311,13 +5312,16 @@ function be(i = {}) {
5311
5312
  }
5312
5313
  };
5313
5314
  }
5315
+ function Ns(i) {
5316
+ return typeof i != "number" || !Number.isFinite(i) ? String(i) : i.toLocaleString("en-US", { maximumFractionDigits: 4 });
5317
+ }
5314
5318
  function ni(i) {
5315
5319
  const a = typeof i == "object" && i !== null && "value" in i ? i.value : i;
5316
5320
  if (!Array.isArray(a) || a.length < 3) return null;
5317
5321
  const e = a.slice(0, 3).map(Number);
5318
5322
  return e.every(Number.isFinite) ? e : null;
5319
5323
  }
5320
- function Ns(i) {
5324
+ function zs(i) {
5321
5325
  if (!i.length)
5322
5326
  return { min: 0, max: 0 };
5323
5327
  const a = i.map((e) => {
@@ -5336,7 +5340,7 @@ function Sr(i, a, e) {
5336
5340
  { offset: 1, color: a }
5337
5341
  ]);
5338
5342
  }
5339
- const zs = (i, a) => {
5343
+ const Gs = (i, a) => {
5340
5344
  const e = (a == null ? void 0 : a.horizontal) === !0 || (a == null ? void 0 : a.horizontal) === "true", t = {
5341
5345
  type: "category",
5342
5346
  data: i.xAxis,
@@ -5373,7 +5377,7 @@ const zs = (i, a) => {
5373
5377
  }
5374
5378
  ]
5375
5379
  };
5376
- }, Gs = (i, a) => ({
5380
+ }, Bs = (i, a) => ({
5377
5381
  ...he(),
5378
5382
  title: fe(a, "Grouped Bar Chart"),
5379
5383
  tooltip: be({
@@ -5410,19 +5414,19 @@ function _r(i) {
5410
5414
  }
5411
5415
  return 0;
5412
5416
  }
5413
- function Bs(i) {
5417
+ function Hs(i) {
5414
5418
  if (typeof i == "object" && i !== null && "clickId" in i) {
5415
5419
  const a = i.clickId;
5416
5420
  return typeof a == "string" ? a : void 0;
5417
5421
  }
5418
5422
  }
5419
- function Hs(i, a) {
5423
+ function Fs(i, a) {
5420
5424
  return a.map((e, t) => {
5421
- const r = _r(e), n = i.reduce((l, u) => l + _r(u.data[t]), 0), o = n ? r / n : 0, s = Bs(e);
5425
+ const r = _r(e), n = i.reduce((l, u) => l + _r(u.data[t]), 0), o = n ? r / n : 0, s = Hs(e);
5422
5426
  return s ? { value: o, clickId: s } : o;
5423
5427
  });
5424
5428
  }
5425
- const Fs = (i, a) => ({
5429
+ const Us = (i, a) => ({
5426
5430
  ...he(),
5427
5431
  title: fe(a, "Normalized Bar Chart"),
5428
5432
  tooltip: be({
@@ -5457,9 +5461,9 @@ const Fs = (i, a) => ({
5457
5461
  type: "bar",
5458
5462
  stack: "total",
5459
5463
  emphasis: { focus: "series" },
5460
- data: Hs(i.series, e.data)
5464
+ data: Fs(i.series, e.data)
5461
5465
  }))
5462
- }), Us = (i, a) => ({
5466
+ }), $s = (i, a) => ({
5463
5467
  ...he(),
5464
5468
  title: fe(a, "Stacked Bar Chart"),
5465
5469
  tooltip: be({
@@ -5493,7 +5497,7 @@ const Fs = (i, a) => ({
5493
5497
  function wr(i, a) {
5494
5498
  return `${Number.isInteger(i) ? String(i) : i.toFixed(2).replace(/\.?0+$/, "")}${a}`;
5495
5499
  }
5496
- const $s = (i, a) => {
5500
+ const Ws = (i, a) => {
5497
5501
  const e = i.unit ?? rt(a, "unit", "%"), t = i.name ?? rt(a, "seriesName", ""), r = Number(i.value) || 0, n = wr(r, e);
5498
5502
  return {
5499
5503
  ...he(),
@@ -5585,8 +5589,8 @@ const $s = (i, a) => {
5585
5589
  }
5586
5590
  ]
5587
5591
  };
5588
- }, Ws = (i, a) => {
5589
- const e = Number(i.value) || 0, t = i.grade ?? Xs(e);
5592
+ }, Xs = (i, a) => {
5593
+ const e = Number(i.value) || 0, t = i.grade ?? Ys(e);
5590
5594
  return {
5591
5595
  ...he(),
5592
5596
  title: fe(a, "Assistance Score", {
@@ -5668,11 +5672,11 @@ const $s = (i, a) => {
5668
5672
  ]
5669
5673
  };
5670
5674
  };
5671
- function Xs(i) {
5675
+ function Ys(i) {
5672
5676
  return i >= 0.9 ? "Production-grade" : i >= 0.6 ? "Strong assist" : i >= 0.3 ? "Partial assist" : "Minimal assist";
5673
5677
  }
5674
- const Ys = (i, a) => {
5675
- const { min: e, max: t } = Ns(i.data);
5678
+ const Zs = (i, a) => {
5679
+ const { min: e, max: t } = zs(i.data);
5676
5680
  return {
5677
5681
  ...he(),
5678
5682
  title: fe(a, "Heatmap"),
@@ -5720,7 +5724,7 @@ const Ys = (i, a) => {
5720
5724
  }
5721
5725
  ]
5722
5726
  };
5723
- }, Zs = (i, a) => ({
5727
+ }, qs = (i, a) => ({
5724
5728
  ...he(),
5725
5729
  title: fe(a, "Line Chart"),
5726
5730
  tooltip: be({
@@ -5746,10 +5750,10 @@ const Ys = (i, a) => {
5746
5750
  ...e
5747
5751
  }))
5748
5752
  });
5749
- function qs(i) {
5753
+ function Ks(i) {
5750
5754
  return i.includes(",") ? i.split(",").map((a) => a.trim()) : i;
5751
5755
  }
5752
- const Ks = (i, a) => ({
5756
+ const js = (i, a) => ({
5753
5757
  ...he(),
5754
5758
  title: fe(a, "Pie Chart"),
5755
5759
  tooltip: be({
@@ -5764,7 +5768,7 @@ const Ks = (i, a) => ({
5764
5768
  {
5765
5769
  name: rt(a, "seriesName", "Data"),
5766
5770
  type: "pie",
5767
- radius: qs(rt(a, "radius", "50%")),
5771
+ radius: Ks(rt(a, "radius", "50%")),
5768
5772
  data: Array.isArray(i) ? i : i.data,
5769
5773
  label: {
5770
5774
  textBorderWidth: 0
@@ -5778,7 +5782,7 @@ const Ks = (i, a) => ({
5778
5782
  }
5779
5783
  }
5780
5784
  ]
5781
- }), js = (i, a) => {
5785
+ }), Js = (i, a) => {
5782
5786
  const e = i.series.length > 1;
5783
5787
  return {
5784
5788
  ...he(),
@@ -5801,30 +5805,33 @@ const Ks = (i, a) => ({
5801
5805
  }
5802
5806
  ]
5803
5807
  };
5804
- }, Js = {
5805
- pie: Ks,
5806
- line: Zs,
5807
- radar: js,
5808
- "bar-normalized": Fs,
5809
- heatmap: Ys,
5810
- "bar-gradient": zs,
5811
- "bar-grouped": Gs,
5812
- "bar-stacked": Us,
5813
- "custom-gauge": $s,
5814
- "gauge-grade": Ws
5808
+ }, Qs = {
5809
+ pie: js,
5810
+ line: qs,
5811
+ radar: Js,
5812
+ "bar-normalized": Us,
5813
+ heatmap: Zs,
5814
+ "bar-gradient": Gs,
5815
+ "bar-grouped": Bs,
5816
+ "bar-stacked": $s,
5817
+ "custom-gauge": Ws,
5818
+ "gauge-grade": Xs
5815
5819
  };
5816
- function Qs(i, a, e) {
5817
- const t = Js[i];
5820
+ function el(i, a, e) {
5821
+ const t = Qs[i];
5818
5822
  return t(a, e);
5819
5823
  }
5820
- const el = "400px";
5821
- function tl(i, a = el) {
5824
+ const tl = "400px";
5825
+ function al(i, a = tl) {
5822
5826
  const e = i == null ? void 0 : i.height;
5823
5827
  return typeof e == "number" && Number.isFinite(e) && e > 0 ? `${e}px` : typeof e == "string" && e.trim() ? e : a;
5824
5828
  }
5825
- const ol = /* @__PURE__ */ li({
5829
+ const sl = /* @__PURE__ */ li({
5826
5830
  __name: "Chart",
5827
5831
  props: {
5832
+ caption: { default: void 0 },
5833
+ sourceHref: { default: void 0 },
5834
+ sourceLabel: { default: void 0 },
5828
5835
  url: { default: void 0 },
5829
5836
  src: { default: void 0 },
5830
5837
  data: { default: void 0 },
@@ -5857,11 +5864,11 @@ const ol = /* @__PURE__ */ li({
5857
5864
  }), ci(() => {
5858
5865
  r == null || r.disconnect();
5859
5866
  });
5860
- const n = i, o = e, s = kt(null), l = kt(null), u = st(() => n.data === void 0 ? n.src ?? n.url ?? "" : ""), c = st(() => tl(n.options));
5867
+ const n = i, o = e, s = kt(null), l = kt(null), u = st(() => n.data === void 0 ? n.src ?? n.url ?? "" : ""), c = st(() => al(n.options));
5861
5868
  function v(S) {
5862
5869
  const x = d(S) ? S : null;
5863
5870
  l.value = (x == null ? void 0 : x.click) ?? null, s.value = D(
5864
- Qs(n.type, S, n.options),
5871
+ el(n.type, S, n.options),
5865
5872
  l.value
5866
5873
  );
5867
5874
  }
@@ -5906,7 +5913,10 @@ const ol = /* @__PURE__ */ li({
5906
5913
  }
5907
5914
  return a({ refresh: _ }), (S, x) => (ga(), pa(Nn, {
5908
5915
  loading: !s.value && g.value,
5909
- error: y.value
5916
+ error: y.value,
5917
+ caption: n.caption,
5918
+ "source-href": n.sourceHref,
5919
+ "source-label": n.sourceLabel
5910
5920
  }, {
5911
5921
  skeleton: da(() => [
5912
5922
  lt("div", {
@@ -5936,11 +5946,11 @@ const ol = /* @__PURE__ */ li({
5936
5946
  ], 4)
5937
5947
  ]),
5938
5948
  _: 1
5939
- }, 8, ["loading", "error"]));
5949
+ }, 8, ["loading", "error", "caption", "source-href", "source-label"]));
5940
5950
  }
5941
5951
  });
5942
5952
  export {
5943
- ol as _,
5953
+ sl as _,
5944
5954
  co as i,
5945
- tl as r
5955
+ al as r
5946
5956
  };