@ovalbee/reportifact 0.0.2 → 0.0.4

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 (112) hide show
  1. package/README.md +16 -16
  2. package/dist/Chart-Cmh3H_Wv.js +5634 -0
  3. package/dist/Chart-jF5jqxGZ.cjs +1 -0
  4. package/dist/ImageGallery-CPZM1tc_.cjs +1 -0
  5. package/dist/ImageGallery-DQzba-4p.js +163 -0
  6. package/dist/MetricCallout-C7SUQTrj.js +39 -0
  7. package/dist/MetricCallout-CxhVOiqg.cjs +1 -0
  8. package/dist/MetricCards-DW-_QLhI.cjs +1 -0
  9. package/dist/MetricCards-JR4hUW4_.js +61 -0
  10. package/dist/MetricsTable-CH8vIbWG.cjs +1 -0
  11. package/dist/MetricsTable-OXsVygq0.js +98 -0
  12. package/dist/Reportifact.vue.d.ts +3 -2
  13. package/dist/ReportifactWidgetHost-DIlz4TxO.js +13 -0
  14. package/dist/ReportifactWidgetHost-xDT1ykZc.cjs +1 -0
  15. package/dist/Timeline-DSGSvRjj.js +295 -0
  16. package/dist/Timeline-P3CpGmBD.cjs +1 -0
  17. package/dist/WidgetWrapper-AmnP99H8.js +62 -0
  18. package/dist/WidgetWrapper-C0lc1m0V.cjs +1 -0
  19. package/dist/components/TableOfContents.vue.d.ts +3 -4
  20. package/dist/dist-DBIuOmpr.cjs +27 -0
  21. package/dist/dist-DEKe39T1.js +23629 -0
  22. package/dist/markdownTable-BCLRoyPL.cjs +2 -0
  23. package/dist/markdownTable-DHdS_81b.js +40 -0
  24. package/dist/middleware.cjs +1 -1
  25. package/dist/middleware.js +146 -175
  26. package/dist/portable/ReportifactWidgetHost.vue.d.ts +7 -11
  27. package/dist/portable/contracts.d.ts +6 -1
  28. package/dist/portable/usePortableSource.d.ts +18 -0
  29. package/dist/reportifact.cjs +63 -64
  30. package/dist/reportifact.d.ts +1 -1
  31. package/dist/reportifact.js +4909 -5223
  32. package/dist/rolldown-runtime-DF3sbh8G.cjs +1 -0
  33. package/dist/style.css +2 -13
  34. package/dist/usePortableSource--y_qMDXB.js +55 -0
  35. package/dist/usePortableSource-CN5URH4d.cjs +1 -0
  36. package/dist/utils/tfeventsParser.cjs +1 -1
  37. package/dist/utils/tfeventsParser.js +298 -327
  38. package/dist/widgets/Card.vue.d.ts +2 -1
  39. package/dist/widgets/Chart.vue.d.ts +7 -9
  40. package/dist/widgets/HelpTooltip.vue.d.ts +2 -1
  41. package/dist/widgets/ImageGallery.vue.d.ts +7 -10
  42. package/dist/widgets/Markdown.vue.d.ts +3 -2
  43. package/dist/widgets/MetricCallout.vue.d.ts +5 -8
  44. package/dist/widgets/MetricCards.vue.d.ts +5 -5
  45. package/dist/widgets/MetricTable.vue.d.ts +2 -1
  46. package/dist/widgets/MetricsTable.vue.d.ts +7 -9
  47. package/dist/widgets/ModelClassComparison.vue.d.ts +3 -2
  48. package/dist/widgets/ModelComparisonGallery.vue.d.ts +3 -2
  49. package/dist/widgets/Notice.vue.d.ts +2 -1
  50. package/dist/widgets/ReportifactWidget.vue.d.ts +3 -4
  51. package/dist/widgets/Scope.vue.d.ts +2 -3
  52. package/dist/widgets/Table.vue.d.ts +3 -2
  53. package/dist/widgets/Tensorboard.vue.d.ts +3 -2
  54. package/dist/widgets/Timeline.vue.d.ts +7 -9
  55. package/dist/widgets/WidgetWrapper.vue.d.ts +22 -18
  56. package/dist/widgets/chart-config/range.d.ts +2 -0
  57. package/dist/widgets/chart-config/shared.d.ts +25 -0
  58. package/dist/widgets/chart-config/types.d.ts +12 -3
  59. package/dist/widgets/chart.cjs +1 -1
  60. package/dist/widgets/chart.d.ts +3 -3
  61. package/dist/widgets/chart.js +2 -5
  62. package/dist/widgets/chartSizing.d.ts +10 -0
  63. package/dist/widgets/contracts.cjs +1 -1
  64. package/dist/widgets/contracts.d.ts +1 -1
  65. package/dist/widgets/contracts.js +0 -1
  66. package/dist/widgets/host.cjs +1 -1
  67. package/dist/widgets/host.d.ts +3 -3
  68. package/dist/widgets/host.js +2 -5
  69. package/dist/widgets/image-gallery.cjs +1 -1
  70. package/dist/widgets/image-gallery.d.ts +3 -3
  71. package/dist/widgets/image-gallery.js +2 -5
  72. package/dist/widgets/markdownTable.d.ts +1 -1
  73. package/dist/widgets/metric-callout.cjs +1 -1
  74. package/dist/widgets/metric-callout.d.ts +3 -3
  75. package/dist/widgets/metric-callout.js +2 -5
  76. package/dist/widgets/metric-cards.cjs +1 -1
  77. package/dist/widgets/metric-cards.d.ts +3 -3
  78. package/dist/widgets/metric-cards.js +2 -5
  79. package/dist/widgets/metrics-table.cjs +1 -1
  80. package/dist/widgets/metrics-table.d.ts +3 -3
  81. package/dist/widgets/metrics-table.js +2 -5
  82. package/dist/widgets/timeline.cjs +1 -1
  83. package/dist/widgets/timeline.d.ts +3 -3
  84. package/dist/widgets/timeline.js +2 -5
  85. package/package.json +5 -10
  86. package/dist/Chart.vue_vue_type_style_index_0_lang-Bp14Es_r.js +0 -5946
  87. package/dist/Chart.vue_vue_type_style_index_0_lang-Dj7m6i3v.cjs +0 -1
  88. package/dist/ImageGallery.vue_vue_type_style_index_0_lang-BB4dG0CB.cjs +0 -1
  89. package/dist/ImageGallery.vue_vue_type_style_index_0_lang-DPY6mSdA.js +0 -191
  90. package/dist/MetricCallout.vue_vue_type_style_index_0_lang-BZbc-Wkf.js +0 -49
  91. package/dist/MetricCallout.vue_vue_type_style_index_0_lang-WpuALh8Z.cjs +0 -1
  92. package/dist/MetricCards.vue_vue_type_style_index_0_lang-CDPSu7no.cjs +0 -1
  93. package/dist/MetricCards.vue_vue_type_style_index_0_lang-CfxCCXmB.js +0 -33
  94. package/dist/MetricsTable.vue_vue_type_style_index_0_lang-BzrxoJW4.cjs +0 -1
  95. package/dist/MetricsTable.vue_vue_type_style_index_0_lang-CO9HvYfr.js +0 -132
  96. package/dist/ReportifactWidgetHost-A73gQ3bT.cjs +0 -1
  97. package/dist/ReportifactWidgetHost-BjKBwCWI.js +0 -17
  98. package/dist/Timeline.vue_vue_type_style_index_0_lang-BTA6fIp9.js +0 -2640
  99. package/dist/Timeline.vue_vue_type_style_index_0_lang-CZ8Y2pXG.cjs +0 -2
  100. package/dist/WidgetWrapper.vue_vue_type_style_index_0_lang-BQQ4Vv5j.cjs +0 -1
  101. package/dist/WidgetWrapper.vue_vue_type_style_index_0_lang-D-oXqmI2.js +0 -59
  102. package/dist/entries/figure.d.ts +0 -1
  103. package/dist/index-3DTuh2Dr.cjs +0 -47
  104. package/dist/index-DevYhXSC.js +0 -22104
  105. package/dist/markdownTable-B5207r3E.js +0 -32
  106. package/dist/markdownTable-Cbn1Du3L.cjs +0 -2
  107. package/dist/portable/ReportifactFigure.vue.d.ts +0 -40
  108. package/dist/useFetch-BfOAq-Kg.cjs +0 -1
  109. package/dist/useFetch-CHQm_TmB.js +0 -35
  110. package/dist/widgets/figure.cjs +0 -1
  111. package/dist/widgets/figure.d.ts +0 -6
  112. package/dist/widgets/figure.js +0 -84
@@ -1,32 +0,0 @@
1
- function c(e) {
2
- return e.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((r) => r.trim());
3
- }
4
- function p(e) {
5
- return e.trim().toLowerCase().replace(/[^a-z0-9]+([a-z0-9])/g, (r, n) => n.toUpperCase()).replace(/[^a-z0-9]/g, "");
6
- }
7
- function o(e) {
8
- return /^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(e);
9
- }
10
- function l(e) {
11
- const r = e.split(`
12
- `).map((t) => t.trim()).filter((t) => t.includes("|")), n = r.findIndex((t, i) => i + 1 < r.length && o(r[i + 1]));
13
- if (n < 0) return [];
14
- const m = c(r[n]).map(p);
15
- return r.slice(n + 2).filter((t) => !o(t)).map((t) => {
16
- const i = c(t);
17
- return m.reduce((s, u, a) => (s[u] = i[a] ?? "", s), {});
18
- });
19
- }
20
- function d(e) {
21
- const r = typeof e == "number" ? e : Number(e);
22
- return Number.isFinite(r) ? r >= 0.75 ? "high" : r >= 0.45 ? "mid" : "low" : "mid";
23
- }
24
- function b(e) {
25
- const r = typeof e == "number" ? e : Number(e);
26
- return Number.isFinite(r) ? Math.max(0, Math.min(1, r)) * 100 : 0;
27
- }
28
- export {
29
- b as a,
30
- d as m,
31
- l as p
32
- };
@@ -1,2 +0,0 @@
1
- "use strict";function c(e){return e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(r=>r.trim())}function l(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+([a-z0-9])/g,(r,n)=>n.toUpperCase()).replace(/[^a-z0-9]/g,"")}function o(e){return/^\s*\|?\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(e)}function p(e){const r=e.split(`
2
- `).map(t=>t.trim()).filter(t=>t.includes("|")),n=r.findIndex((t,i)=>i+1<r.length&&o(r[i+1]));if(n<0)return[];const m=c(r[n]).map(l);return r.slice(n+2).filter(t=>!o(t)).map(t=>{const i=c(t);return m.reduce((s,u,a)=>(s[u]=i[a]??"",s),{})})}function f(e){const r=typeof e=="number"?e:Number(e);return Number.isFinite(r)?r>=.75?"high":r>=.45?"mid":"low":"mid"}function d(e){const r=typeof e=="number"?e:Number(e);return Number.isFinite(r)?Math.max(0,Math.min(1,r))*100:0}exports.metricPercent=d;exports.metricTone=f;exports.parseMarkdownTable=p;
@@ -1,40 +0,0 @@
1
- type __VLS_Props = {
2
- title?: string;
3
- caption?: string;
4
- loading?: boolean;
5
- error?: string | null;
6
- /** Static fallback. `fallbackImage` is the preferred portable API name. */
7
- fallbackImage?: string;
8
- /** Backward-compatible alias for `fallbackImage`. */
9
- fallbackSrc?: string;
10
- fallbackAlt?: string;
11
- sourceHref?: string;
12
- sourceLabel?: string;
13
- };
14
- declare function __VLS_template(): {
15
- attrs: Partial<{}>;
16
- slots: {
17
- default?(_: {}): any;
18
- };
19
- refs: {};
20
- rootEl: HTMLElement;
21
- };
22
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
23
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
24
- title: string;
25
- loading: boolean;
26
- error: string | null;
27
- caption: string;
28
- fallbackImage: string;
29
- fallbackSrc: string;
30
- fallbackAlt: string;
31
- sourceHref: string;
32
- sourceLabel: string;
33
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
34
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
35
- export default _default;
36
- type __VLS_WithTemplateSlots<T, S> = T & {
37
- new (): {
38
- $slots: S;
39
- };
40
- };
@@ -1 +0,0 @@
1
- "use strict";const n=require("vue");function v(a,l={}){const{immediate:u=!0,transformUrl:c,onSuccess:i,onError:f}=l,r=n.ref(!0),s=n.ref(null);async function o(){try{const e=c?c(a.value):a.value;if(!e||e===""){r.value=!1;return}r.value=!0,s.value=null;const t=await fetch(e);if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);i&&await i(t)}catch(e){const t=e instanceof Error?e:new Error(String(e));s.value=t.message,f&&f(t)}finally{r.value=!1}}return n.watch(a,e=>{(u||e&&e!=="")&&o()}),u&&n.onMounted(()=>{o()}),{loading:r,error:s,fetchData:o}}exports.useFetch=v;
@@ -1,35 +0,0 @@
1
- import { ref as i, watch as v, onMounted as h } from "vue";
2
- function w(a, l = {}) {
3
- const { immediate: s = !0, transformUrl: u, onSuccess: c, onError: f } = l, r = i(!0), n = i(null);
4
- async function o() {
5
- try {
6
- const t = u ? u(a.value) : a.value;
7
- if (!t || t === "") {
8
- r.value = !1;
9
- return;
10
- }
11
- r.value = !0, n.value = null;
12
- const e = await fetch(t);
13
- if (!e.ok)
14
- throw new Error(`HTTP ${e.status}: ${e.statusText}`);
15
- c && await c(e);
16
- } catch (t) {
17
- const e = t instanceof Error ? t : new Error(String(t));
18
- n.value = e.message, f && f(e);
19
- } finally {
20
- r.value = !1;
21
- }
22
- }
23
- return v(a, (t) => {
24
- (s || t && t !== "") && o();
25
- }), s && h(() => {
26
- o();
27
- }), {
28
- loading: r,
29
- error: n,
30
- fetchData: o
31
- };
32
- }
33
- export {
34
- w as u
35
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("../ReportifactWidgetHost-A73gQ3bT.cjs"),d=require("../WidgetWrapper.vue_vue_type_style_index_0_lang-BQQ4Vv5j.cjs"),s={class:"reportifact-figure"},u={key:0,class:"reportifact-figure-title"},f={class:"reportifact-widget-error-message"},k=["src","alt"],m={key:2},g=["src","alt"],v={key:0,class:"reportifact-figure-caption"},y={key:0},b=["href"],r=e.defineComponent({__name:"ReportifactFigure",props:{title:{default:void 0},caption:{default:void 0},loading:{type:Boolean,default:!1},error:{default:null},fallbackImage:{default:void 0},fallbackSrc:{default:void 0},fallbackAlt:{default:void 0},sourceHref:{default:void 0},sourceLabel:{default:"View source data"}},setup(t){const a=t,l=e.computed(()=>a.fallbackImage??a.fallbackSrc);return(c,o)=>(e.openBlock(),e.createElementBlock("figure",s,[e.createVNode(n.ReportifactWidgetHost,null,{default:e.withCtx(()=>[t.title?(e.openBlock(),e.createElementBlock("div",u,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createVNode(d._sfc_main,{loading:t.loading,error:t.error},{skeleton:e.withCtx(()=>[...o[0]||(o[0]=[e.createElementVNode("div",{class:"reportifact-figure-skeleton"},[e.createElementVNode("div",{class:"reportifact-skeleton-line",style:{width:"42%"}}),e.createElementVNode("div",{class:"reportifact-skeleton-line",style:{width:"100%",flex:"1"}})],-1)])]),fallback:e.withCtx(({error:i})=>[e.createElementVNode("div",f,e.toDisplayString(i),1)]),default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},8,["loading","error"]),l.value?(e.openBlock(),e.createElementBlock("img",{key:1,class:"reportifact-figure-fallback reportifact-figure-runtime-fallback",src:l.value,alt:t.fallbackAlt||t.title||t.caption||"Widget preview",loading:"lazy"},null,8,k)):e.createCommentVNode("",!0),l.value?(e.openBlock(),e.createElementBlock("noscript",m,[e.createElementVNode("img",{class:"reportifact-figure-fallback",src:l.value,alt:t.fallbackAlt||t.title||t.caption||"Widget preview",loading:"lazy"},null,8,g)])):e.createCommentVNode("",!0)]),_:3}),t.caption||t.sourceHref?(e.openBlock(),e.createElementBlock("figcaption",v,[t.caption?(e.openBlock(),e.createElementBlock("span",y,e.toDisplayString(t.caption),1)):e.createCommentVNode("",!0),t.sourceHref?(e.openBlock(),e.createElementBlock("a",{key:1,href:t.sourceHref},e.toDisplayString(t.sourceLabel),9,b)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))}});exports.ReportifactFigure=r;exports.default=r;
@@ -1,6 +0,0 @@
1
- export * from '../entries/figure'
2
- export {}
3
- import _default from '../entries/figure'
4
- export default _default
5
- export * from '../entries/figure'
6
- export {}
@@ -1,84 +0,0 @@
1
- import { defineComponent as g, computed as k, createElementBlock as t, openBlock as a, createVNode as n, createCommentVNode as l, withCtx as o, toDisplayString as c, renderSlot as m, createElementVNode as i } from "vue";
2
- import { R as v } from "../ReportifactWidgetHost-BjKBwCWI.js";
3
- import { _ as b } from "../WidgetWrapper.vue_vue_type_style_index_0_lang-D-oXqmI2.js";
4
- const h = { class: "reportifact-figure" }, y = {
5
- key: 0,
6
- class: "reportifact-figure-title"
7
- }, w = { class: "reportifact-widget-error-message" }, p = ["src", "alt"], H = { key: 2 }, S = ["src", "alt"], R = {
8
- key: 0,
9
- class: "reportifact-figure-caption"
10
- }, V = { key: 0 }, x = ["href"], F = /* @__PURE__ */ g({
11
- __name: "ReportifactFigure",
12
- props: {
13
- title: { default: void 0 },
14
- caption: { default: void 0 },
15
- loading: { type: Boolean, default: !1 },
16
- error: { default: null },
17
- fallbackImage: { default: void 0 },
18
- fallbackSrc: { default: void 0 },
19
- fallbackAlt: { default: void 0 },
20
- sourceHref: { default: void 0 },
21
- sourceLabel: { default: "View source data" }
22
- },
23
- setup(e) {
24
- const f = e, r = k(() => f.fallbackImage ?? f.fallbackSrc);
25
- return (d, s) => (a(), t("figure", h, [
26
- n(v, null, {
27
- default: o(() => [
28
- e.title ? (a(), t("div", y, c(e.title), 1)) : l("", !0),
29
- n(b, {
30
- loading: e.loading,
31
- error: e.error
32
- }, {
33
- skeleton: o(() => [...s[0] || (s[0] = [
34
- i("div", { class: "reportifact-figure-skeleton" }, [
35
- i("div", {
36
- class: "reportifact-skeleton-line",
37
- style: { width: "42%" }
38
- }),
39
- i("div", {
40
- class: "reportifact-skeleton-line",
41
- style: { width: "100%", flex: "1" }
42
- })
43
- ], -1)
44
- ])]),
45
- fallback: o(({ error: u }) => [
46
- i("div", w, c(u), 1)
47
- ]),
48
- default: o(() => [
49
- m(d.$slots, "default")
50
- ]),
51
- _: 3
52
- }, 8, ["loading", "error"]),
53
- r.value ? (a(), t("img", {
54
- key: 1,
55
- class: "reportifact-figure-fallback reportifact-figure-runtime-fallback",
56
- src: r.value,
57
- alt: e.fallbackAlt || e.title || e.caption || "Widget preview",
58
- loading: "lazy"
59
- }, null, 8, p)) : l("", !0),
60
- r.value ? (a(), t("noscript", H, [
61
- i("img", {
62
- class: "reportifact-figure-fallback",
63
- src: r.value,
64
- alt: e.fallbackAlt || e.title || e.caption || "Widget preview",
65
- loading: "lazy"
66
- }, null, 8, S)
67
- ])) : l("", !0)
68
- ]),
69
- _: 3
70
- }),
71
- e.caption || e.sourceHref ? (a(), t("figcaption", R, [
72
- e.caption ? (a(), t("span", V, c(e.caption), 1)) : l("", !0),
73
- e.sourceHref ? (a(), t("a", {
74
- key: 1,
75
- href: e.sourceHref
76
- }, c(e.sourceLabel), 9, x)) : l("", !0)
77
- ])) : l("", !0)
78
- ]));
79
- }
80
- });
81
- export {
82
- F as ReportifactFigure,
83
- F as default
84
- };