@graphysdk/react-renderer 1.9.0-beta.1792062305376 → 1.9.0-beta.1792135965871
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/dist/editable.cjs +1 -1
- package/dist/editable.d.ts +58 -1
- package/dist/editable.mjs +811 -802
- package/dist/{history-chords-BRxNhg_4.js → history-chords-C3Im3MXJ.js} +1 -1
- package/dist/{history-chords-C38FJsRv.cjs → history-chords-wWhFwrO8.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
package/dist/editable.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { AxisKey } from '@graphysdk/viz-engine';
|
|
|
2
2
|
import { Command } from '@graphysdk/viz-engine';
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import { CoordSystem } from '@graphysdk/viz-engine';
|
|
5
|
+
import { CoordType } from '@graphysdk/viz-engine';
|
|
6
|
+
import { DataLabelPlacementResolver } from '@graphysdk/viz-engine';
|
|
5
7
|
import { DispatchOptions } from '@graphysdk/viz-engine';
|
|
6
8
|
import { Edge } from '@graphysdk/viz-engine';
|
|
7
9
|
import { EdgeSizes } from '@graphysdk/viz-engine';
|
|
@@ -16,6 +18,8 @@ import { JSX } from 'react/jsx-runtime';
|
|
|
16
18
|
import { LegendPosition } from '@graphysdk/viz-engine';
|
|
17
19
|
import { LineType } from '@graphysdk/viz-engine';
|
|
18
20
|
import { MainAxis } from '@graphysdk/viz-engine';
|
|
21
|
+
import { ObservationsTarget } from '@graphysdk/viz-engine';
|
|
22
|
+
import { PositionAdjustment } from '@graphysdk/viz-engine';
|
|
19
23
|
import { ReactElement } from 'react';
|
|
20
24
|
import { ReactNode } from 'react';
|
|
21
25
|
import { Rect } from '@graphysdk/viz-engine';
|
|
@@ -627,7 +631,7 @@ declare type DotNotation<T> = T extends object ? {
|
|
|
627
631
|
* </GraphProvider>
|
|
628
632
|
* ```
|
|
629
633
|
*/
|
|
630
|
-
export declare const EditableGraphRenderer: ({ slots, mode, palettePresets, ...rest }: EditableGraphRendererProps) => JSX.Element;
|
|
634
|
+
export declare const EditableGraphRenderer: ({ slots, mode, palettePresets, editMenus, ...rest }: EditableGraphRendererProps) => JSX.Element;
|
|
631
635
|
|
|
632
636
|
/** Props for {@link EditableGraphRenderer}: the renderer's own, plus what only the editor reads. */
|
|
633
637
|
export declare interface EditableGraphRendererProps extends GraphRendererProps {
|
|
@@ -636,6 +640,33 @@ export declare interface EditableGraphRendererProps extends GraphRendererProps {
|
|
|
636
640
|
* color scale's `range`, so the spec keeps its colors whatever the host offers later. With none, no row.
|
|
637
641
|
*/
|
|
638
642
|
palettePresets?: PalettePresets;
|
|
643
|
+
/**
|
|
644
|
+
* A host's edit menus, searched before Graphy's. `null` removes that menu, and a missing entry leaves Graphy's.
|
|
645
|
+
*/
|
|
646
|
+
editMenus?: EditMenus;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/** Whether the edit menu draws a row for a target, asked before it is hovered or selected; left out, it always does. */
|
|
650
|
+
declare interface EditMenuRows<Target> {
|
|
651
|
+
hasRows?: (target: Target, inputs: EditMenuRowsInputs) => boolean;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
/** What an edit menu reads to say whether it has rows: the scene, and the placement strategies plugins extend. */
|
|
655
|
+
declare interface EditMenuRowsInputs {
|
|
656
|
+
scene: Scene;
|
|
657
|
+
dataLabelPlacement: DataLabelPlacementResolver;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/** The edit menus Graphy or a host registers, where `null` answers with none and `undefined` reads as left out. */
|
|
661
|
+
export declare interface EditMenus {
|
|
662
|
+
/** Edit menus for observations drawn one way, keyed by their layer's geom, the chart's coord and the position. */
|
|
663
|
+
layers?: Readonly<Record<string, LayerEditMenus | undefined>>;
|
|
664
|
+
/** Edit menus for observations however they are drawn, keyed by their layer's geom, a built-in or a custom one. */
|
|
665
|
+
geoms?: Readonly<Record<string, ObservationsEditMenu | null | undefined>>;
|
|
666
|
+
legend?: TargetEditMenu<'legend'> | null;
|
|
667
|
+
axis?: TargetEditMenu<'axis'> | null;
|
|
668
|
+
grid?: TargetEditMenu<'grid'> | null;
|
|
669
|
+
graph?: TargetEditMenu<'graph'> | null;
|
|
639
670
|
}
|
|
640
671
|
|
|
641
672
|
/**
|
|
@@ -1000,6 +1031,11 @@ declare interface GridSlotProps {
|
|
|
1000
1031
|
panelRect: GraphLayout['panel'];
|
|
1001
1032
|
}
|
|
1002
1033
|
|
|
1034
|
+
/** The edit targets a press on a guide takes: the legend, an axis, the grid lines of an axis. */
|
|
1035
|
+
declare type GuideEditTarget = Extract<EditTarget, {
|
|
1036
|
+
kind: 'legend' | 'axis' | 'grid';
|
|
1037
|
+
}>;
|
|
1038
|
+
|
|
1003
1039
|
/**
|
|
1004
1040
|
* Props for the Header slot, overridable via `slots.Header` on `GraphRenderer`. Title editing in
|
|
1005
1041
|
* `editable` mode is internal to this default — it hands off to the editor `/editable` supplies —
|
|
@@ -1081,6 +1117,9 @@ declare interface IntroAnimationOptions {
|
|
|
1081
1117
|
/** Without an IntersectionObserver, as in a test environment, `inView` plays on mount. */
|
|
1082
1118
|
declare type IntroTrigger = 'mount' | 'inView';
|
|
1083
1119
|
|
|
1120
|
+
/** One geom's edit menus, keyed by the chart's coord and then by the layer's position. */
|
|
1121
|
+
declare type LayerEditMenus = Partial<Record<CoordType, Partial<Record<PositionAdjustment, ObservationsEditMenu | null>>>>;
|
|
1122
|
+
|
|
1084
1123
|
/** Where the legend sits relative to the chart, and how it names its series. */
|
|
1085
1124
|
export declare const LegendSection: ({ positions, title, layout, preview }: LegendSectionProps) => JSX.Element | null;
|
|
1086
1125
|
|
|
@@ -1166,6 +1205,9 @@ export declare interface NumberFieldControlProps extends ContinuousControlProps<
|
|
|
1166
1205
|
*/
|
|
1167
1206
|
export declare const NumberFormatSection: ({ title, layout, preview }: OverridableSectionProps) => JSX.Element | null;
|
|
1168
1207
|
|
|
1208
|
+
/** The rows the overlay menu draws under its title for a selection of observations. */
|
|
1209
|
+
declare type ObservationsEditMenu = ComponentType<ResolvedObservations> & EditMenuRows<ObservationsTarget>;
|
|
1210
|
+
|
|
1169
1211
|
/**
|
|
1170
1212
|
* What a host may override per section, spread by every section onto its `Section`, so the same
|
|
1171
1213
|
* section can be mounted at two layouts without being forked to get them.
|
|
@@ -1289,6 +1331,12 @@ declare interface ResizeObserverState {
|
|
|
1289
1331
|
/** A {@link ControlRegistry} with every member filled in, as sections consume it. */
|
|
1290
1332
|
export declare type ResolvedControlRegistry = Required<ControlRegistry>;
|
|
1291
1333
|
|
|
1334
|
+
/** What the overlay menu hands the edit menu of a selection of observations. */
|
|
1335
|
+
declare interface ResolvedObservations {
|
|
1336
|
+
/** The selected observations' edit target, which the edit menu's rows hand to their commands. */
|
|
1337
|
+
target: ObservationsTarget;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1292
1340
|
/**
|
|
1293
1341
|
* One labeled setting, wiring its own control: the row publishes its ids and each control takes the
|
|
1294
1342
|
* half it can carry. The label reaches it with `htmlFor` rather than wrapping it, because a wrapping
|
|
@@ -1500,6 +1548,15 @@ export declare interface SwitchControlProps extends ControlBaseProps {
|
|
|
1500
1548
|
onChange: (isChecked: boolean) => void;
|
|
1501
1549
|
}
|
|
1502
1550
|
|
|
1551
|
+
/** The rows the overlay menu draws under its title for a guide or the chart, handed its edit target. */
|
|
1552
|
+
declare type TargetEditMenu<Kind extends GuideEditTarget['kind'] | 'graph'> = ComponentType<{
|
|
1553
|
+
target: Extract<EditTarget, {
|
|
1554
|
+
kind: Kind;
|
|
1555
|
+
}>;
|
|
1556
|
+
}> & EditMenuRows<Extract<EditTarget, {
|
|
1557
|
+
kind: Kind;
|
|
1558
|
+
}>>;
|
|
1559
|
+
|
|
1503
1560
|
declare type TextDirection = 'ltr' | 'rtl';
|
|
1504
1561
|
|
|
1505
1562
|
/**
|