@graphysdk/telemetry 1.8.1-beta.1786024899180
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/LICENSE.md +17 -0
- package/README.md +47 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +186 -0
- package/dist/index.mjs +106 -0
- package/package.json +64 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# License
|
|
2
|
+
|
|
3
|
+
This software is available under any of the following licenses, at your option,
|
|
4
|
+
depending on which one's conditions you meet:
|
|
5
|
+
|
|
6
|
+
- **PolyForm Noncommercial 1.0.0** — for noncommercial use (personal,
|
|
7
|
+
charitable, educational, research, government).
|
|
8
|
+
See [licenses/PolyForm-NonCommercial-1.0.0.md](licenses/PolyForm-NonCommercial-1.0.0.md)
|
|
9
|
+
|
|
10
|
+
- **PolyForm Small Business 1.0.0** — free commercial use for organizations
|
|
11
|
+
under the size thresholds defined in the license.
|
|
12
|
+
See [licenses/PolyForm-Small-Business-1.0.0.md](licenses/PolyForm-Small-Business-1.0.0.md)
|
|
13
|
+
|
|
14
|
+
- **PolyForm Free Trial 1.0.0** — a 32-day evaluation for anyone else.
|
|
15
|
+
See [licenses/PolyForm-Free-Trial-1.0.0.md](licenses/PolyForm-Free-Trial-1.0.0.md)
|
|
16
|
+
|
|
17
|
+
For commercial use beyond these terms, contact [hello@graphy.dev](mailto:hello@graphy.dev) or visit [https://graphy.dev](https://graphy.dev).
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @graphysdk/telemetry
|
|
2
|
+
|
|
3
|
+
A **pure, push-based** telemetry module for the Graphy chart engine. It derives anonymised usage events
|
|
4
|
+
from viz-engine's public compiler output (`CompiledSpec` / `CompileResult`) — it does **not** modify or
|
|
5
|
+
depend on viz-engine internals, and it never touches the network, storage, or timers.
|
|
6
|
+
|
|
7
|
+
Identity, opt-out policy, sampling, and beaconing (if any) live in the wrapper/host that subscribes to
|
|
8
|
+
these events — not in this package.
|
|
9
|
+
|
|
10
|
+
## Docs
|
|
11
|
+
|
|
12
|
+
- [Quickstart](https://docs.graphy.dev/sdk-next/quickstart)
|
|
13
|
+
|
|
14
|
+
## Guarantees
|
|
15
|
+
|
|
16
|
+
- **No network, no storage, no timers.** The module only _derives_ and _emits_. Anything with a side
|
|
17
|
+
effect is the subscriber's job.
|
|
18
|
+
- **Anonymised by construction.** Every payload carries only counts, enums, and booleans derived from
|
|
19
|
+
`CompiledSpec`. Data values, column names/labels, annotation content, and formatted strings never
|
|
20
|
+
cross the boundary. An allowlist test asserts no dataset string leaks into a serialized event.
|
|
21
|
+
- **Zero-overhead when unused.** Don't wire an emitter and nothing happens. `emit` is also a no-op when
|
|
22
|
+
disabled or when nobody is subscribed.
|
|
23
|
+
- **Listener isolation.** A throwing subscriber can never break the caller — each listener call is
|
|
24
|
+
wrapped in `try/catch`.
|
|
25
|
+
- **Leak-safe subscriptions.** `subscribe` returns a `VizTelemetrySubscription` (with `unsubscribe()`,
|
|
26
|
+
a `closed` flag, and `[Symbol.dispose]` for `using`).
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { createCompiler } from '@graphysdk/viz-engine';
|
|
32
|
+
import { createTelemetryEmitter, emitCompileEvents } from '@graphysdk/telemetry';
|
|
33
|
+
|
|
34
|
+
const telemetry = createTelemetryEmitter(); // { chartInstanceId?, engineVersion?, enabled? }
|
|
35
|
+
const subscription = telemetry.subscribe((event) => {
|
|
36
|
+
// Defer any beaconing — subscribers must not block.
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const compiler = createCompiler();
|
|
40
|
+
const result = compiler.compile({ input, data });
|
|
41
|
+
emitCompileEvents(telemetry, result, 'compile'); // 'compile' | 'recompile' | 'command'
|
|
42
|
+
|
|
43
|
+
subscription.unsubscribe();
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
In a React host, subscribe to a `GraphHandle` (`handle.subscribe()` + `handle.getCompiled()`) and
|
|
47
|
+
call `deriveChartShape` / `emitCompileEvents` from the listener.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var m="1.8.1-beta.1786024899180",u=0;function y(e={}){f();const{chartInstanceId:t=b(),engineVersion:s=m,enabled:i=!0}=e,r=new Set;return{chartInstanceId:t,engineVersion:s,emit:a=>{if(!i||r.size===0)return;const o=[...r];for(const n of o)try{n(a)}catch{}},subscribe:a=>{r.add(a);let o=!1;const n=()=>{o||(o=!0,r.delete(a))};return{get closed(){return o},unsubscribe:n,[Symbol.dispose]:n}}}}var b=()=>`${Math.random().toString(36).slice(2,6)}${(u+=1).toString(36)}`,f=()=>{Symbol.dispose??=Symbol.for("Symbol.dispose")};function p(e){const{layers:t,coordSystem:s,scales:i,guides:r,annotations:l,spec:d}=e,a=r.colorGroups.length>0?r.colorGroups.length:null,o=t.reduce((n,g)=>n+g.data.size(),0);return{layerCount:t.length,geoms:t.map(n=>n.geom),positions:v(t.map(n=>n.position)),coordSystem:s.type,...s.type==="cartesian"?{mainAxis:s.mainAxis}:{},scaleAesthetics:Object.keys(i),seriesCount:a,observationCount:o,hasSecondaryAxis:t.some(n=>n.yScaleType==="secondary"),features:{headline:r.headline!==null,legend:r.legends.length>0,visibleAxes:r.axes.filter(n=>n.isVisible).length,dataLabels:t.some(n=>n.dataLabels.showDataLabels),highlights:d.highlights.length,annotations:C(l)}}}function S(e,t,s){if(!e)return;const i=h(e);if(t.ok){e.emit({...i,type:"chart.compiled",trigger:s,chart:p(t.compiled),warningCodes:c(t.warnings)});return}e.emit({...i,type:"chart.compile_failed",trigger:s,errorCodes:c(t.errors),warningCodes:c(t.warnings)})}function A(e,t,s){e&&e.emit({...h(e),type:"command.applied",commandType:t.type,transient:s})}var c=e=>e.map(t=>t.code),v=e=>[...new Set(e)],C=e=>({differenceArrows:e.differenceArrows.length,shapes:e.shapes.length,freeformArrows:e.arrows.length,textAnnotations:e.textAnnotations.length,images:e.images.length,stickers:e.stickers.length,pinnedNumbers:e.pinnedNumbers.length,comments:e.comments.length}),h=e=>({timestamp:Date.now(),engineVersion:e.engineVersion,chartInstanceId:e.chartInstanceId});exports.PACKAGE_VERSION=m;exports.createTelemetryEmitter=y;exports.deriveChartShape=p;exports.emitCommandApplied=A;exports.emitCompileEvents=S;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { Command } from '@graphysdk/viz-engine';
|
|
2
|
+
import { CompiledSpec } from '@graphysdk/viz-engine';
|
|
3
|
+
import { CompileResult } from '@graphysdk/viz-engine';
|
|
4
|
+
import { VizErrorCode } from '@graphysdk/viz-engine';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Per-kind annotation counts, mirroring `CompiledAnnotations`' groups. Counts only — annotation
|
|
8
|
+
* content (text, images, positions) never enters telemetry.
|
|
9
|
+
*/
|
|
10
|
+
export declare interface ChartAnnotationCounts {
|
|
11
|
+
differenceArrows: number;
|
|
12
|
+
shapes: number;
|
|
13
|
+
freeformArrows: number;
|
|
14
|
+
textAnnotations: number;
|
|
15
|
+
images: number;
|
|
16
|
+
stickers: number;
|
|
17
|
+
pinnedNumbers: number;
|
|
18
|
+
comments: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** A chart compiled successfully. Carries the anonymised {@link ChartShape} and any warning codes. */
|
|
22
|
+
export declare interface ChartCompiledEvent extends VizTelemetryEventBase {
|
|
23
|
+
type: 'chart.compiled';
|
|
24
|
+
trigger: CompileTrigger;
|
|
25
|
+
chart: ChartShape;
|
|
26
|
+
/** Warning codes only — never messages, context, or suggestions. */
|
|
27
|
+
warningCodes: VizErrorCode[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** A compile failed. Carries error and warning codes only; no shape, since there is no compiled spec. */
|
|
31
|
+
export declare interface ChartCompileFailedEvent extends VizTelemetryEventBase {
|
|
32
|
+
type: 'chart.compile_failed';
|
|
33
|
+
trigger: CompileTrigger;
|
|
34
|
+
errorCodes: VizErrorCode[];
|
|
35
|
+
warningCodes: VizErrorCode[];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Optional-feature usage, all counts and booleans. */
|
|
39
|
+
export declare interface ChartFeatureUsage {
|
|
40
|
+
headline: boolean;
|
|
41
|
+
legend: boolean;
|
|
42
|
+
/** Number of visible axis guides. */
|
|
43
|
+
visibleAxes: number;
|
|
44
|
+
dataLabels: boolean;
|
|
45
|
+
/** Number of highlight rules on the spec. */
|
|
46
|
+
highlights: number;
|
|
47
|
+
annotations: ChartAnnotationCounts;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Anonymised "shape" of a compiled chart — counts, enums, and booleans derived from `CompiledSpec`.
|
|
52
|
+
* Never carries data values, variable names/labels, or formatted output, so it is safe to beacon.
|
|
53
|
+
*/
|
|
54
|
+
export declare interface ChartShape {
|
|
55
|
+
layerCount: number;
|
|
56
|
+
/** Geom names in layer order (built-in or custom plugin names). */
|
|
57
|
+
geoms: string[];
|
|
58
|
+
/** Distinct position adjusters in use (e.g. `'stack'`, `'dodge'`, `'identity'`, `'fill'`). */
|
|
59
|
+
positions: string[];
|
|
60
|
+
coordSystem: 'cartesian' | 'polar';
|
|
61
|
+
/** The main (independent) axis for a cartesian coord; absent for polar. */
|
|
62
|
+
mainAxis?: 'x' | 'y';
|
|
63
|
+
/** Scale aesthetic keys in use (e.g. `['x', 'y', 'color']`) — keys only, no values. */
|
|
64
|
+
scaleAesthetics: string[];
|
|
65
|
+
/** Discrete color-group cardinality (a count), or `null` when color is not discrete. */
|
|
66
|
+
seriesCount: number | null;
|
|
67
|
+
/** Total observations across all layers (a count only). */
|
|
68
|
+
observationCount: number;
|
|
69
|
+
hasSecondaryAxis: boolean;
|
|
70
|
+
features: ChartFeatureUsage;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** A command was applied to the live spec. */
|
|
74
|
+
export declare interface CommandAppliedEvent extends VizTelemetryEventBase {
|
|
75
|
+
type: 'command.applied';
|
|
76
|
+
/** The command's type discriminator (e.g. `'set-layer-geom'`). Not data-derived. */
|
|
77
|
+
commandType: string;
|
|
78
|
+
/** Whether the dispatch was transient (a live gesture frame) rather than a committed edit. */
|
|
79
|
+
transient: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* How a compile was triggered. `compile` is a fresh full compile (input/palette change or first
|
|
84
|
+
* mount), `recompile` a data-only re-run against an already-resolved spec, `command` a recompile
|
|
85
|
+
* driven by an applied command.
|
|
86
|
+
*/
|
|
87
|
+
export declare type CompileTrigger = 'compile' | 'recompile' | 'command';
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Create a {@link VizTelemetryEmitter}. Emission is synchronous fire-and-forget: each listener call is
|
|
91
|
+
* isolated in a try/catch so a throwing subscriber can never break the caller, and `emit` is a no-op
|
|
92
|
+
* when disabled or when nobody is listening (the zero-overhead-when-unused path).
|
|
93
|
+
*/
|
|
94
|
+
export declare function createTelemetryEmitter(options?: CreateTelemetryEmitterOptions): VizTelemetryEmitter;
|
|
95
|
+
|
|
96
|
+
/** Options for {@link createTelemetryEmitter}. */
|
|
97
|
+
export declare interface CreateTelemetryEmitterOptions {
|
|
98
|
+
/** Ephemeral per-chart id stamped into each event. Defaults to a generated {@link uniqueId}. */
|
|
99
|
+
chartInstanceId?: string;
|
|
100
|
+
/** Version string stamped into each event. Defaults to this package's version ({@link PACKAGE_VERSION}). */
|
|
101
|
+
engineVersion?: string;
|
|
102
|
+
/** When `false`, {@link VizTelemetryEmitter.emit} is a no-op — a cheap host opt-out. Defaults to `true`. */
|
|
103
|
+
enabled?: boolean;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Project a {@link CompiledSpec} down to its anonymised {@link ChartShape}. Reads only counts, enums,
|
|
108
|
+
* and booleans — no data values, variable names/labels, or formatted output ever cross into the shape.
|
|
109
|
+
*/
|
|
110
|
+
export declare function deriveChartShape(compiled: CompiledSpec): ChartShape;
|
|
111
|
+
|
|
112
|
+
/** Emit `command.applied` for an applied {@link Command}. A no-op when no `emitter` is wired. */
|
|
113
|
+
export declare function emitCommandApplied(emitter: VizTelemetryEmitter | undefined, command: Command, transient: boolean): void;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Emit the compile-lifecycle event for a finished {@link CompileResult}: `chart.compiled` with the
|
|
117
|
+
* anonymised shape and warning codes on success, or `chart.compile_failed` with error and warning
|
|
118
|
+
* codes on failure. A no-op when no `emitter` is wired.
|
|
119
|
+
*/
|
|
120
|
+
export declare function emitCompileEvents(emitter: VizTelemetryEmitter | undefined, result: CompileResult, trigger: CompileTrigger): void;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* This package's version, substituted at build time by the `__GRAPHY_TELEMETRY_VERSION__` replace
|
|
124
|
+
* plugin. In dev / test (unbuilt source) it stays the literal token, which is fine — telemetry only
|
|
125
|
+
* needs a string. Pass `engineVersion` to {@link createTelemetryEmitter} to report the engine version
|
|
126
|
+
* instead.
|
|
127
|
+
*/
|
|
128
|
+
export declare const PACKAGE_VERSION = "__GRAPHY_TELEMETRY_VERSION__";
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The module's push-based telemetry surface. It only *emits*; a subscriber (the telemetry wrapper, or
|
|
132
|
+
* enterprise infra) decides what to do with events. Pure by construction — no network, no storage, no
|
|
133
|
+
* timers, no id persistence live here.
|
|
134
|
+
*/
|
|
135
|
+
export declare interface VizTelemetryEmitter {
|
|
136
|
+
/** Ephemeral per-emitter id stamped into every event. NOT persisted, NOT PII. */
|
|
137
|
+
readonly chartInstanceId: string;
|
|
138
|
+
/** Version string stamped into every event. Defaults to this package's version. */
|
|
139
|
+
readonly engineVersion: string;
|
|
140
|
+
/** Fan an event out to every current listener. */
|
|
141
|
+
emit: (event: VizTelemetryEvent) => void;
|
|
142
|
+
/** Attach a listener, receiving a leak-safe {@link VizTelemetrySubscription}. */
|
|
143
|
+
subscribe: (listener: VizTelemetryListener) => VizTelemetrySubscription;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Every telemetry event, discriminated by `type`. */
|
|
147
|
+
export declare type VizTelemetryEvent = ChartCompiledEvent | ChartCompileFailedEvent | CommandAppliedEvent;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Common envelope shared by every telemetry event. Carries only low-cardinality primitives — no data
|
|
151
|
+
* values, column names, labels, or formatted strings ever cross this boundary.
|
|
152
|
+
*/
|
|
153
|
+
export declare interface VizTelemetryEventBase {
|
|
154
|
+
type: VizTelemetryEventType;
|
|
155
|
+
/** ms epoch, stamped at emit. */
|
|
156
|
+
timestamp: number;
|
|
157
|
+
/** Version string for the code that produced the event (defaults to this package's version). */
|
|
158
|
+
engineVersion: string;
|
|
159
|
+
/**
|
|
160
|
+
* Ephemeral per-emitter id. NOT persisted, NOT PII — a stable anonymous install id is the
|
|
161
|
+
* wrapper's job, not this module's.
|
|
162
|
+
*/
|
|
163
|
+
chartInstanceId: string;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/** The set of telemetry event names. Extended when renderer/interaction events land. */
|
|
167
|
+
export declare type VizTelemetryEventType = 'chart.compiled' | 'chart.compile_failed' | 'command.applied';
|
|
168
|
+
|
|
169
|
+
/** A telemetry subscriber. Must not block — defer any beaconing off the emit path. */
|
|
170
|
+
export declare type VizTelemetryListener = (event: VizTelemetryEvent) => void;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Handle returned from {@link VizTelemetryEmitter.subscribe}. Owns its own teardown so a listener
|
|
174
|
+
* can't leak: hold the subscription, call {@link VizTelemetrySubscription.unsubscribe} (or let a
|
|
175
|
+
* `using` block dispose it) to detach.
|
|
176
|
+
*/
|
|
177
|
+
export declare interface VizTelemetrySubscription {
|
|
178
|
+
/** True once unsubscribed. */
|
|
179
|
+
readonly closed: boolean;
|
|
180
|
+
/** Remove the listener. Idempotent — safe to call more than once. */
|
|
181
|
+
unsubscribe: () => void;
|
|
182
|
+
/** Enables `using sub = emitter.subscribe(...)` auto-teardown. */
|
|
183
|
+
[Symbol.dispose]: () => void;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { }
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
var p = "1.8.1-beta.1786024899180", g = 0;
|
|
2
|
+
function A(e = {}) {
|
|
3
|
+
b();
|
|
4
|
+
const { chartInstanceId: n = u(), engineVersion: t = p, enabled: i = !0 } = e, r = /* @__PURE__ */ new Set();
|
|
5
|
+
return {
|
|
6
|
+
chartInstanceId: n,
|
|
7
|
+
engineVersion: t,
|
|
8
|
+
emit: (a) => {
|
|
9
|
+
if (!i || r.size === 0) return;
|
|
10
|
+
const o = [...r];
|
|
11
|
+
for (const s of o) try {
|
|
12
|
+
s(a);
|
|
13
|
+
} catch {
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
subscribe: (a) => {
|
|
17
|
+
r.add(a);
|
|
18
|
+
let o = !1;
|
|
19
|
+
const s = () => {
|
|
20
|
+
o || (o = !0, r.delete(a));
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
get closed() {
|
|
24
|
+
return o;
|
|
25
|
+
},
|
|
26
|
+
unsubscribe: s,
|
|
27
|
+
[Symbol.dispose]: s
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
var u = () => `${Math.random().toString(36).slice(2, 6)}${(g += 1).toString(36)}`, b = () => {
|
|
33
|
+
Symbol.dispose ??= /* @__PURE__ */ Symbol.for("Symbol.dispose");
|
|
34
|
+
};
|
|
35
|
+
function y(e) {
|
|
36
|
+
const { layers: n, coordSystem: t, scales: i, guides: r, annotations: l, spec: d } = e, a = r.colorGroups.length > 0 ? r.colorGroups.length : null, o = n.reduce((s, h) => s + h.data.size(), 0);
|
|
37
|
+
return {
|
|
38
|
+
layerCount: n.length,
|
|
39
|
+
geoms: n.map((s) => s.geom),
|
|
40
|
+
positions: f(n.map((s) => s.position)),
|
|
41
|
+
coordSystem: t.type,
|
|
42
|
+
...t.type === "cartesian" ? { mainAxis: t.mainAxis } : {},
|
|
43
|
+
scaleAesthetics: Object.keys(i),
|
|
44
|
+
seriesCount: a,
|
|
45
|
+
observationCount: o,
|
|
46
|
+
hasSecondaryAxis: n.some((s) => s.yScaleType === "secondary"),
|
|
47
|
+
features: {
|
|
48
|
+
headline: r.headline !== null,
|
|
49
|
+
legend: r.legends.length > 0,
|
|
50
|
+
visibleAxes: r.axes.filter((s) => s.isVisible).length,
|
|
51
|
+
dataLabels: n.some((s) => s.dataLabels.showDataLabels),
|
|
52
|
+
highlights: d.highlights.length,
|
|
53
|
+
annotations: S(l)
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function v(e, n, t) {
|
|
58
|
+
if (!e) return;
|
|
59
|
+
const i = m(e);
|
|
60
|
+
if (n.ok) {
|
|
61
|
+
e.emit({
|
|
62
|
+
...i,
|
|
63
|
+
type: "chart.compiled",
|
|
64
|
+
trigger: t,
|
|
65
|
+
chart: y(n.compiled),
|
|
66
|
+
warningCodes: c(n.warnings)
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
e.emit({
|
|
71
|
+
...i,
|
|
72
|
+
type: "chart.compile_failed",
|
|
73
|
+
trigger: t,
|
|
74
|
+
errorCodes: c(n.errors),
|
|
75
|
+
warningCodes: c(n.warnings)
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function w(e, n, t) {
|
|
79
|
+
e && e.emit({
|
|
80
|
+
...m(e),
|
|
81
|
+
type: "command.applied",
|
|
82
|
+
commandType: n.type,
|
|
83
|
+
transient: t
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
var c = (e) => e.map((n) => n.code), f = (e) => [...new Set(e)], S = (e) => ({
|
|
87
|
+
differenceArrows: e.differenceArrows.length,
|
|
88
|
+
shapes: e.shapes.length,
|
|
89
|
+
freeformArrows: e.arrows.length,
|
|
90
|
+
textAnnotations: e.textAnnotations.length,
|
|
91
|
+
images: e.images.length,
|
|
92
|
+
stickers: e.stickers.length,
|
|
93
|
+
pinnedNumbers: e.pinnedNumbers.length,
|
|
94
|
+
comments: e.comments.length
|
|
95
|
+
}), m = (e) => ({
|
|
96
|
+
timestamp: Date.now(),
|
|
97
|
+
engineVersion: e.engineVersion,
|
|
98
|
+
chartInstanceId: e.chartInstanceId
|
|
99
|
+
});
|
|
100
|
+
export {
|
|
101
|
+
p as PACKAGE_VERSION,
|
|
102
|
+
A as createTelemetryEmitter,
|
|
103
|
+
y as deriveChartShape,
|
|
104
|
+
w as emitCommandApplied,
|
|
105
|
+
v as emitCompileEvents
|
|
106
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@graphysdk/telemetry",
|
|
3
|
+
"author": "Graphy",
|
|
4
|
+
"description": "Local event emitter for Graphy chart usage (no network)",
|
|
5
|
+
"homepage": "https://docs.graphy.dev/sdk-next/quickstart",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"graphy",
|
|
9
|
+
"telemetry",
|
|
10
|
+
"analytics",
|
|
11
|
+
"chart",
|
|
12
|
+
"events"
|
|
13
|
+
],
|
|
14
|
+
"version": "1.8.1-beta.1786024899180",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"LICENSE.md",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"import": "./dist/index.mjs",
|
|
27
|
+
"require": "./dist/index.cjs"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@graphysdk/viz-engine": "1.8.1-beta.1786024899180"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@rollup/plugin-replace": "^6.0.3",
|
|
35
|
+
"rollup-plugin-node-externals": "^8.1.1",
|
|
36
|
+
"tslib": "^2.8.1",
|
|
37
|
+
"vite": "^8.1.5",
|
|
38
|
+
"vite-plugin-dts": "^4.5.4",
|
|
39
|
+
"vitest": "^4.1.0",
|
|
40
|
+
"@graphysdk/viz-engine": "1.8.1-beta.1786024899180",
|
|
41
|
+
"@graphytools/eslint-config": "0.0.1",
|
|
42
|
+
"@graphytools/eslint-plugin-graphy": "1.0.0",
|
|
43
|
+
"@graphytools/typescript-config": "0.0.1",
|
|
44
|
+
"@graphytools/vitest-config": "1.0.0"
|
|
45
|
+
},
|
|
46
|
+
"lint-staged": {
|
|
47
|
+
"*.{ts,tsx,js,jsx,json,css,md}": [
|
|
48
|
+
"prettier --write"
|
|
49
|
+
],
|
|
50
|
+
"*.{ts,tsx}": [
|
|
51
|
+
"eslint --max-warnings=0 --fix"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "vite build",
|
|
56
|
+
"test": "vitest run",
|
|
57
|
+
"test:watch": "TZ=utc vitest",
|
|
58
|
+
"lint": "eslint . --max-warnings 0",
|
|
59
|
+
"lint:fix": "eslint . --fix",
|
|
60
|
+
"format": "prettier --write .",
|
|
61
|
+
"format:check": "prettier --check .",
|
|
62
|
+
"typecheck": "tsc --noEmit"
|
|
63
|
+
}
|
|
64
|
+
}
|