@graphysdk/react 1.9.0-beta.1792146771330 → 1.9.0-beta.1792149244850

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/README.md CHANGED
@@ -60,6 +60,16 @@ const spec = pipe(
60
60
  );
61
61
  ```
62
62
 
63
+ ## Chart count
64
+
65
+ Production browser builds send one anonymous count the first time a chart appears. The count includes the chart type and similar flags. It does not include cell values, column names, or labels. Development builds print one console line and send nothing.
66
+
67
+ ```tsx
68
+ <GraphProvider data={data} spec={spec} telemetry={false}>
69
+ <GraphRenderer />
70
+ </GraphProvider>
71
+ ```
72
+
63
73
  ## Custom geoms
64
74
 
65
75
  Plugin authoring uses the same package. `Geom`, the value readers, `defineGeomRenderer`, and `createGraphyKit` are all exported from `@graphysdk/react` — there is no need to add `@graphysdk/viz-engine` or `@graphysdk/react-renderer` as direct dependencies.
@@ -0,0 +1,14 @@
1
+ import { ChartShape } from '@graphysdk/telemetry';
2
+ interface PostChartCreatedOptions {
3
+ dsn?: string;
4
+ fetchImpl?: typeof fetch;
5
+ version?: string;
6
+ }
7
+ /** The address baked into this build. A function so tests can stand in a real DSN without a publish. */
8
+ export declare function getChartCountDsn(): string;
9
+ export declare function canSendChartCount(nodeEnv: string | undefined, hasWindow: boolean, dsn: string): boolean;
10
+ /** Once per page. The caller only invokes this in development. */
11
+ export declare function noteChartCountInDevelopment(): void;
12
+ export declare function resetChartCountNotice(): void;
13
+ export declare function postChartCreated(shape: ChartShape, options?: PostChartCreatedOptions): void;
14
+ export {};
@@ -1,6 +1,13 @@
1
- import { CreateGraphyKitOptions, GraphyKit } from '@graphysdk/react-renderer';
1
+ import { ReactElement } from 'react';
2
+ import { CreateGraphyKitOptions, GraphProviderProps, GraphyKit } from '@graphysdk/react-renderer';
2
3
  import { Plugin } from '@graphysdk/viz-engine';
4
+ import { ChartCountProps } from './use-chart-telemetry';
5
+ type KitProviderProps = Omit<GraphProviderProps, 'plugins' | 'theme'> & ChartCountProps;
6
+ type ReactGraphyKit<P extends readonly Plugin[]> = Omit<GraphyKit<P>, 'GraphProvider'> & {
7
+ GraphProvider: (props: KitProviderProps) => ReactElement;
8
+ };
3
9
  /**
4
10
  * Enables "Made with Graphy" by default. Explicit opt-outs still win.
5
11
  */
6
- export declare function createGraphyKit<const P extends readonly Plugin[] = []>(options?: CreateGraphyKitOptions<P>): GraphyKit<P>;
12
+ export declare function createGraphyKit<const P extends readonly Plugin[] = []>(options?: CreateGraphyKitOptions<P>): ReactGraphyKit<P>;
13
+ export {};