@graphysdk/react-renderer 1.9.0-beta.1793615827091 → 1.9.0-beta.1793621290212
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 +904 -9
- package/dist/editable.mjs +845 -842
- package/dist/{history-chords-CwbB0gYP.js → history-chords-BHE3wDew.js} +1427 -1415
- package/dist/history-chords-nCeyn2px.cjs +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +487 -6
- package/dist/index.mjs +411 -395
- package/package.json +2 -2
- package/dist/history-chords-CMJxmSNE.cjs +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { FontSpec } from '@graphysdk/viz-engine';
|
|
|
21
21
|
import { FormattedAxis } from '@graphysdk/viz-engine';
|
|
22
22
|
import { FormattedHeadline } from '@graphysdk/viz-engine';
|
|
23
23
|
import { FormattedLegend } from '@graphysdk/viz-engine';
|
|
24
|
+
import { FormattingLocale } from '@graphysdk/viz-engine';
|
|
24
25
|
import { Geom } from '@graphysdk/viz-engine';
|
|
25
26
|
import { GeomCornerRadius } from '@graphysdk/viz-engine';
|
|
26
27
|
import { GeomEffects } from '@graphysdk/viz-engine';
|
|
@@ -225,6 +226,8 @@ declare const createTargetBoundaryStore: () => StoreApi<TargetBoundaryStoreState
|
|
|
225
226
|
/** vanilla-extract class that binds the dark token values; set it on any ancestor to flip to dark. */
|
|
226
227
|
export declare const darkTheme: string;
|
|
227
228
|
|
|
229
|
+
declare type DeepValue<T, Path extends string> = Path extends `${infer First}.${infer Rest}` ? First extends keyof T ? DeepValue<T[First], Rest> : never : Path extends keyof T ? T[Path] : never;
|
|
230
|
+
|
|
228
231
|
/** Default paint for the footer region — caption, source line, and optional Graphy badge. */
|
|
229
232
|
export declare const DefaultFooter: ({ ref, footerRect, mode, caption, showCaption, source, showSource, captionStyle, sourceStyle, graphyBadge, }: FooterSlotProps) => JSX.Element | null;
|
|
230
233
|
|
|
@@ -312,6 +315,321 @@ export declare interface DevToolsPanelProps {
|
|
|
312
315
|
className?: string;
|
|
313
316
|
}
|
|
314
317
|
|
|
318
|
+
declare const dictionaries: {
|
|
319
|
+
readonly 'en-GB': {
|
|
320
|
+
readonly graph: {
|
|
321
|
+
readonly loading: "Loading";
|
|
322
|
+
readonly error: "Something went wrong";
|
|
323
|
+
readonly axisLabels: {
|
|
324
|
+
readonly placeholder: "Add label";
|
|
325
|
+
};
|
|
326
|
+
readonly defaultPropertyLabels: {
|
|
327
|
+
readonly date: "Date";
|
|
328
|
+
readonly year: "Year";
|
|
329
|
+
readonly quarter: "Quarter";
|
|
330
|
+
readonly month: "Month";
|
|
331
|
+
readonly week: "Week";
|
|
332
|
+
readonly series: "Series";
|
|
333
|
+
readonly category: "Category";
|
|
334
|
+
readonly columnNumber: ({ number }: {
|
|
335
|
+
number: number;
|
|
336
|
+
}) => string;
|
|
337
|
+
readonly rowNumber: ({ number }: {
|
|
338
|
+
number: number;
|
|
339
|
+
}) => string;
|
|
340
|
+
readonly seriesNumber: ({ number }: {
|
|
341
|
+
number: number;
|
|
342
|
+
}) => string;
|
|
343
|
+
};
|
|
344
|
+
readonly trendComparison: {
|
|
345
|
+
readonly fromPrevious: {
|
|
346
|
+
readonly long: ({ value }: {
|
|
347
|
+
value: string;
|
|
348
|
+
}) => string;
|
|
349
|
+
readonly short: ({ value }: {
|
|
350
|
+
value: string;
|
|
351
|
+
}) => string;
|
|
352
|
+
};
|
|
353
|
+
readonly fromPreviousYear: {
|
|
354
|
+
readonly long: ({ value }: {
|
|
355
|
+
value: string;
|
|
356
|
+
}) => string;
|
|
357
|
+
readonly short: ({ value }: {
|
|
358
|
+
value: string;
|
|
359
|
+
}) => string;
|
|
360
|
+
};
|
|
361
|
+
readonly fromPreviousMonth: {
|
|
362
|
+
readonly long: ({ value }: {
|
|
363
|
+
value: string;
|
|
364
|
+
}) => string;
|
|
365
|
+
readonly short: ({ value }: {
|
|
366
|
+
value: string;
|
|
367
|
+
}) => string;
|
|
368
|
+
};
|
|
369
|
+
readonly fromPreviousWeek: {
|
|
370
|
+
readonly long: ({ value }: {
|
|
371
|
+
value: string;
|
|
372
|
+
}) => string;
|
|
373
|
+
readonly short: ({ value }: {
|
|
374
|
+
value: string;
|
|
375
|
+
}) => string;
|
|
376
|
+
};
|
|
377
|
+
readonly fromPreviousDay: {
|
|
378
|
+
readonly long: ({ value }: {
|
|
379
|
+
value: string;
|
|
380
|
+
}) => string;
|
|
381
|
+
readonly short: ({ value }: {
|
|
382
|
+
value: string;
|
|
383
|
+
}) => string;
|
|
384
|
+
};
|
|
385
|
+
readonly fromPreviousHour: {
|
|
386
|
+
readonly long: ({ value }: {
|
|
387
|
+
value: string;
|
|
388
|
+
}) => string;
|
|
389
|
+
readonly short: ({ value }: {
|
|
390
|
+
value: string;
|
|
391
|
+
}) => string;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
readonly headlineMetrics: {
|
|
395
|
+
readonly averageLong: ({ value }: {
|
|
396
|
+
value: string;
|
|
397
|
+
}) => string;
|
|
398
|
+
readonly averageShort: ({ value }: {
|
|
399
|
+
value: string;
|
|
400
|
+
}) => string;
|
|
401
|
+
readonly total: ({ value }: {
|
|
402
|
+
value: string;
|
|
403
|
+
}) => string;
|
|
404
|
+
readonly totalConversionRate: ({ value }: {
|
|
405
|
+
value: string;
|
|
406
|
+
}) => string;
|
|
407
|
+
readonly current: ({ value }: {
|
|
408
|
+
value: string;
|
|
409
|
+
}) => string;
|
|
410
|
+
readonly comparisonReference: ({ value }: {
|
|
411
|
+
value: string;
|
|
412
|
+
}) => string;
|
|
413
|
+
};
|
|
414
|
+
readonly legend: {
|
|
415
|
+
readonly hiddenItems: "Hidden legend items";
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
readonly dir: "ltr";
|
|
419
|
+
};
|
|
420
|
+
readonly 'en-US': LooseShapeOf<LocaleShape>;
|
|
421
|
+
readonly ar: {
|
|
422
|
+
readonly graph: {
|
|
423
|
+
readonly loading: "جاري التحميل";
|
|
424
|
+
readonly error: "حدث خطأ ما";
|
|
425
|
+
readonly axisLabels: {
|
|
426
|
+
readonly placeholder: "إضافة تسمية";
|
|
427
|
+
};
|
|
428
|
+
readonly defaultPropertyLabels: {
|
|
429
|
+
readonly date: "التاريخ";
|
|
430
|
+
readonly year: "السنة";
|
|
431
|
+
readonly quarter: "الربع";
|
|
432
|
+
readonly month: "الشهر";
|
|
433
|
+
readonly week: "الأسبوع";
|
|
434
|
+
readonly series: "السلسلة";
|
|
435
|
+
readonly category: "الفئة";
|
|
436
|
+
readonly columnNumber: ({ number }: {
|
|
437
|
+
number: number;
|
|
438
|
+
}) => string;
|
|
439
|
+
readonly rowNumber: ({ number }: {
|
|
440
|
+
number: number;
|
|
441
|
+
}) => string;
|
|
442
|
+
readonly seriesNumber: ({ number }: {
|
|
443
|
+
number: number;
|
|
444
|
+
}) => string;
|
|
445
|
+
};
|
|
446
|
+
readonly trendComparison: {
|
|
447
|
+
readonly fromPrevious: {
|
|
448
|
+
readonly long: ({ value }: {
|
|
449
|
+
value: string;
|
|
450
|
+
}) => string;
|
|
451
|
+
readonly short: ({ value }: {
|
|
452
|
+
value: string;
|
|
453
|
+
}) => string;
|
|
454
|
+
};
|
|
455
|
+
readonly fromPreviousYear: {
|
|
456
|
+
readonly long: ({ value }: {
|
|
457
|
+
value: string;
|
|
458
|
+
}) => string;
|
|
459
|
+
readonly short: ({ value }: {
|
|
460
|
+
value: string;
|
|
461
|
+
}) => string;
|
|
462
|
+
};
|
|
463
|
+
readonly fromPreviousMonth: {
|
|
464
|
+
readonly long: ({ value }: {
|
|
465
|
+
value: string;
|
|
466
|
+
}) => string;
|
|
467
|
+
readonly short: ({ value }: {
|
|
468
|
+
value: string;
|
|
469
|
+
}) => string;
|
|
470
|
+
};
|
|
471
|
+
readonly fromPreviousWeek: {
|
|
472
|
+
readonly long: ({ value }: {
|
|
473
|
+
value: string;
|
|
474
|
+
}) => string;
|
|
475
|
+
readonly short: ({ value }: {
|
|
476
|
+
value: string;
|
|
477
|
+
}) => string;
|
|
478
|
+
};
|
|
479
|
+
readonly fromPreviousDay: {
|
|
480
|
+
readonly long: ({ value }: {
|
|
481
|
+
value: string;
|
|
482
|
+
}) => string;
|
|
483
|
+
readonly short: ({ value }: {
|
|
484
|
+
value: string;
|
|
485
|
+
}) => string;
|
|
486
|
+
};
|
|
487
|
+
readonly fromPreviousHour: {
|
|
488
|
+
readonly long: ({ value }: {
|
|
489
|
+
value: string;
|
|
490
|
+
}) => string;
|
|
491
|
+
readonly short: ({ value }: {
|
|
492
|
+
value: string;
|
|
493
|
+
}) => string;
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
readonly headlineMetrics: {
|
|
497
|
+
readonly averageLong: ({ value }: {
|
|
498
|
+
value: string;
|
|
499
|
+
}) => string;
|
|
500
|
+
readonly averageShort: ({ value }: {
|
|
501
|
+
value: string;
|
|
502
|
+
}) => string;
|
|
503
|
+
readonly total: ({ value }: {
|
|
504
|
+
value: string;
|
|
505
|
+
}) => string;
|
|
506
|
+
readonly totalConversionRate: ({ value }: {
|
|
507
|
+
value: string;
|
|
508
|
+
}) => string;
|
|
509
|
+
readonly current: ({ value }: {
|
|
510
|
+
value: string;
|
|
511
|
+
}) => string;
|
|
512
|
+
readonly comparisonReference: ({ value }: {
|
|
513
|
+
value: string;
|
|
514
|
+
}) => string;
|
|
515
|
+
};
|
|
516
|
+
readonly legend: {
|
|
517
|
+
readonly hiddenItems: "عناصر وسيلة الإيضاح المخفية";
|
|
518
|
+
};
|
|
519
|
+
};
|
|
520
|
+
readonly dir: "rtl";
|
|
521
|
+
};
|
|
522
|
+
readonly 'pt-PT': {
|
|
523
|
+
readonly graph: {
|
|
524
|
+
readonly loading: "A carregar";
|
|
525
|
+
readonly error: "Algo correu mal";
|
|
526
|
+
readonly axisLabels: {
|
|
527
|
+
readonly placeholder: "Adicionar etiqueta";
|
|
528
|
+
};
|
|
529
|
+
readonly defaultPropertyLabels: {
|
|
530
|
+
readonly date: "Data";
|
|
531
|
+
readonly year: "Ano";
|
|
532
|
+
readonly quarter: "Trimestre";
|
|
533
|
+
readonly month: "Mês";
|
|
534
|
+
readonly week: "Semana";
|
|
535
|
+
readonly series: "Série";
|
|
536
|
+
readonly category: "Categoria";
|
|
537
|
+
readonly columnNumber: ({ number }: {
|
|
538
|
+
number: number;
|
|
539
|
+
}) => string;
|
|
540
|
+
readonly rowNumber: ({ number }: {
|
|
541
|
+
number: number;
|
|
542
|
+
}) => string;
|
|
543
|
+
readonly seriesNumber: ({ number }: {
|
|
544
|
+
number: number;
|
|
545
|
+
}) => string;
|
|
546
|
+
};
|
|
547
|
+
readonly trendComparison: {
|
|
548
|
+
readonly fromPrevious: {
|
|
549
|
+
readonly long: ({ value }: {
|
|
550
|
+
value: string;
|
|
551
|
+
}) => string;
|
|
552
|
+
readonly short: ({ value }: {
|
|
553
|
+
value: string;
|
|
554
|
+
}) => string;
|
|
555
|
+
};
|
|
556
|
+
readonly fromPreviousYear: {
|
|
557
|
+
readonly long: ({ value }: {
|
|
558
|
+
value: string;
|
|
559
|
+
}) => string;
|
|
560
|
+
readonly short: ({ value }: {
|
|
561
|
+
value: string;
|
|
562
|
+
}) => string;
|
|
563
|
+
};
|
|
564
|
+
readonly fromPreviousMonth: {
|
|
565
|
+
readonly long: ({ value }: {
|
|
566
|
+
value: string;
|
|
567
|
+
}) => string;
|
|
568
|
+
readonly short: ({ value }: {
|
|
569
|
+
value: string;
|
|
570
|
+
}) => string;
|
|
571
|
+
};
|
|
572
|
+
readonly fromPreviousWeek: {
|
|
573
|
+
readonly long: ({ value }: {
|
|
574
|
+
value: string;
|
|
575
|
+
}) => string;
|
|
576
|
+
readonly short: ({ value }: {
|
|
577
|
+
value: string;
|
|
578
|
+
}) => string;
|
|
579
|
+
};
|
|
580
|
+
readonly fromPreviousDay: {
|
|
581
|
+
readonly long: ({ value }: {
|
|
582
|
+
value: string;
|
|
583
|
+
}) => string;
|
|
584
|
+
readonly short: ({ value }: {
|
|
585
|
+
value: string;
|
|
586
|
+
}) => string;
|
|
587
|
+
};
|
|
588
|
+
readonly fromPreviousHour: {
|
|
589
|
+
readonly long: ({ value }: {
|
|
590
|
+
value: string;
|
|
591
|
+
}) => string;
|
|
592
|
+
readonly short: ({ value }: {
|
|
593
|
+
value: string;
|
|
594
|
+
}) => string;
|
|
595
|
+
};
|
|
596
|
+
};
|
|
597
|
+
readonly headlineMetrics: {
|
|
598
|
+
readonly averageLong: ({ value }: {
|
|
599
|
+
value: string;
|
|
600
|
+
}) => string;
|
|
601
|
+
readonly averageShort: ({ value }: {
|
|
602
|
+
value: string;
|
|
603
|
+
}) => string;
|
|
604
|
+
readonly total: ({ value }: {
|
|
605
|
+
value: string;
|
|
606
|
+
}) => string;
|
|
607
|
+
readonly totalConversionRate: ({ value }: {
|
|
608
|
+
value: string;
|
|
609
|
+
}) => string;
|
|
610
|
+
readonly current: ({ value }: {
|
|
611
|
+
value: string;
|
|
612
|
+
}) => string;
|
|
613
|
+
readonly comparisonReference: ({ value }: {
|
|
614
|
+
value: string;
|
|
615
|
+
}) => string;
|
|
616
|
+
};
|
|
617
|
+
readonly legend: {
|
|
618
|
+
readonly hiddenItems: "Itens de legenda ocultos";
|
|
619
|
+
};
|
|
620
|
+
};
|
|
621
|
+
readonly dir: "ltr";
|
|
622
|
+
};
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
declare type Dictionary<T> = {
|
|
626
|
+
[K in keyof T]: T[K] extends object ? Dictionary<T[K]> : string;
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
declare type DotNotation<T> = T extends object ? {
|
|
630
|
+
[K in keyof T & string]: T[K] extends (...args: never[]) => unknown ? K : T[K] extends object ? `${K}.${DotNotation<T[K]>}` : K;
|
|
631
|
+
}[keyof T & string] : never;
|
|
632
|
+
|
|
315
633
|
/** Addresses the axis a stamped node belongs to. */
|
|
316
634
|
declare const EDIT_TARGET_AXIS_ATTRIBUTE = "data-edit-axis";
|
|
317
635
|
|
|
@@ -377,6 +695,108 @@ export declare interface EditOutlineStroke extends MorphingEditOutlineShape {
|
|
|
377
695
|
width: number;
|
|
378
696
|
}
|
|
379
697
|
|
|
698
|
+
declare const EN_GB: {
|
|
699
|
+
readonly graph: {
|
|
700
|
+
readonly loading: "Loading";
|
|
701
|
+
readonly error: "Something went wrong";
|
|
702
|
+
readonly axisLabels: {
|
|
703
|
+
readonly placeholder: "Add label";
|
|
704
|
+
};
|
|
705
|
+
readonly defaultPropertyLabels: {
|
|
706
|
+
readonly date: "Date";
|
|
707
|
+
readonly year: "Year";
|
|
708
|
+
readonly quarter: "Quarter";
|
|
709
|
+
readonly month: "Month";
|
|
710
|
+
readonly week: "Week";
|
|
711
|
+
readonly series: "Series";
|
|
712
|
+
readonly category: "Category";
|
|
713
|
+
readonly columnNumber: ({ number }: {
|
|
714
|
+
number: number;
|
|
715
|
+
}) => string;
|
|
716
|
+
readonly rowNumber: ({ number }: {
|
|
717
|
+
number: number;
|
|
718
|
+
}) => string;
|
|
719
|
+
readonly seriesNumber: ({ number }: {
|
|
720
|
+
number: number;
|
|
721
|
+
}) => string;
|
|
722
|
+
};
|
|
723
|
+
readonly trendComparison: {
|
|
724
|
+
readonly fromPrevious: {
|
|
725
|
+
readonly long: ({ value }: {
|
|
726
|
+
value: string;
|
|
727
|
+
}) => string;
|
|
728
|
+
readonly short: ({ value }: {
|
|
729
|
+
value: string;
|
|
730
|
+
}) => string;
|
|
731
|
+
};
|
|
732
|
+
readonly fromPreviousYear: {
|
|
733
|
+
readonly long: ({ value }: {
|
|
734
|
+
value: string;
|
|
735
|
+
}) => string;
|
|
736
|
+
readonly short: ({ value }: {
|
|
737
|
+
value: string;
|
|
738
|
+
}) => string;
|
|
739
|
+
};
|
|
740
|
+
readonly fromPreviousMonth: {
|
|
741
|
+
readonly long: ({ value }: {
|
|
742
|
+
value: string;
|
|
743
|
+
}) => string;
|
|
744
|
+
readonly short: ({ value }: {
|
|
745
|
+
value: string;
|
|
746
|
+
}) => string;
|
|
747
|
+
};
|
|
748
|
+
readonly fromPreviousWeek: {
|
|
749
|
+
readonly long: ({ value }: {
|
|
750
|
+
value: string;
|
|
751
|
+
}) => string;
|
|
752
|
+
readonly short: ({ value }: {
|
|
753
|
+
value: string;
|
|
754
|
+
}) => string;
|
|
755
|
+
};
|
|
756
|
+
readonly fromPreviousDay: {
|
|
757
|
+
readonly long: ({ value }: {
|
|
758
|
+
value: string;
|
|
759
|
+
}) => string;
|
|
760
|
+
readonly short: ({ value }: {
|
|
761
|
+
value: string;
|
|
762
|
+
}) => string;
|
|
763
|
+
};
|
|
764
|
+
readonly fromPreviousHour: {
|
|
765
|
+
readonly long: ({ value }: {
|
|
766
|
+
value: string;
|
|
767
|
+
}) => string;
|
|
768
|
+
readonly short: ({ value }: {
|
|
769
|
+
value: string;
|
|
770
|
+
}) => string;
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
readonly headlineMetrics: {
|
|
774
|
+
readonly averageLong: ({ value }: {
|
|
775
|
+
value: string;
|
|
776
|
+
}) => string;
|
|
777
|
+
readonly averageShort: ({ value }: {
|
|
778
|
+
value: string;
|
|
779
|
+
}) => string;
|
|
780
|
+
readonly total: ({ value }: {
|
|
781
|
+
value: string;
|
|
782
|
+
}) => string;
|
|
783
|
+
readonly totalConversionRate: ({ value }: {
|
|
784
|
+
value: string;
|
|
785
|
+
}) => string;
|
|
786
|
+
readonly current: ({ value }: {
|
|
787
|
+
value: string;
|
|
788
|
+
}) => string;
|
|
789
|
+
readonly comparisonReference: ({ value }: {
|
|
790
|
+
value: string;
|
|
791
|
+
}) => string;
|
|
792
|
+
};
|
|
793
|
+
readonly legend: {
|
|
794
|
+
readonly hiddenItems: "Hidden legend items";
|
|
795
|
+
};
|
|
796
|
+
};
|
|
797
|
+
readonly dir: "ltr";
|
|
798
|
+
};
|
|
799
|
+
|
|
380
800
|
export { FadeIntroPlan }
|
|
381
801
|
|
|
382
802
|
/**
|
|
@@ -677,7 +1097,7 @@ declare interface GeomRenderInput<G extends GeomName | string = string, C extend
|
|
|
677
1097
|
layer: SceneLayerOf<G>;
|
|
678
1098
|
coordSystem: CoordSystemFor<C>;
|
|
679
1099
|
animateTransitions: boolean;
|
|
680
|
-
formattingLocale:
|
|
1100
|
+
formattingLocale: FormattingLocale;
|
|
681
1101
|
intro?: LayerIntroPlan | null;
|
|
682
1102
|
/**
|
|
683
1103
|
* The panel's pixel rect — the data rectangle geoms paint into, already inset from axes and chrome.
|
|
@@ -840,6 +1260,8 @@ export declare interface GraphHandle {
|
|
|
840
1260
|
subscribe: (onGraphChange: () => void) => () => void;
|
|
841
1261
|
/** The graph's scene as of now, or `null` before its first successful compile. */
|
|
842
1262
|
getScene: () => Scene | null;
|
|
1263
|
+
/** The tag the graph formats values in, safe to hand to `Intl`. Unset, it formats in the scene's `parsingLocale`. */
|
|
1264
|
+
formattingLocale?: FormattingLocale;
|
|
843
1265
|
/**
|
|
844
1266
|
* Reverse the most recent command. Returns whether the chart took the step, so a caller driving
|
|
845
1267
|
* this from a keystroke can leave the key to the app when the chart has nothing to undo or the
|
|
@@ -881,13 +1303,16 @@ export declare interface GraphHistoryShortcutsOptions {
|
|
|
881
1303
|
/** The mode a chart runs in, which `GraphRenderer` takes as a prop and every row of `MODE_SURFACES` is keyed by. */
|
|
882
1304
|
export declare type GraphMode = (typeof GRAPH_MODES)[keyof typeof GRAPH_MODES];
|
|
883
1305
|
|
|
1306
|
+
/** Every phrase a chart can say. The editing surface adds its own — see `editable/i18n/editor-i18n`. */
|
|
1307
|
+
declare type GraphPhrases = typeof EN_GB;
|
|
1308
|
+
|
|
884
1309
|
/**
|
|
885
1310
|
* Owns the scene for a graph and exposes it via {@link useSceneSelector}, plus a
|
|
886
1311
|
* `dispatch` for applying {@link Command}s. Both failure modes — a non-throwing compile failure and a
|
|
887
1312
|
* render-throw from a renderer component — converge on a single {@link GraphErrorBoundary} that shows
|
|
888
1313
|
* the error in place, so a broken chart never blanks the page.
|
|
889
1314
|
*/
|
|
890
|
-
export declare const GraphProvider: ({ data, spec, plugins, theme, formattingLocale, handleRef, onSpecChange, onError, onWarnings, colorScheme: hostColorScheme, children, }: GraphProviderProps) => JSX.Element;
|
|
1315
|
+
export declare const GraphProvider: ({ data, spec, plugins, theme, formattingLocale: requestedFormattingLocale, handleRef, onSpecChange, onError, onWarnings, colorScheme: hostColorScheme, children, }: GraphProviderProps) => JSX.Element;
|
|
891
1316
|
|
|
892
1317
|
/** Props for {@link GraphProvider}: the data and spec to compile, plus color scheme, locale and plugin wiring. */
|
|
893
1318
|
export declare interface GraphProviderProps {
|
|
@@ -906,7 +1331,11 @@ export declare interface GraphProviderProps {
|
|
|
906
1331
|
* The theme's `colorScheme`, when set, overrides the `colorScheme` prop.
|
|
907
1332
|
*/
|
|
908
1333
|
theme?: Theme;
|
|
909
|
-
|
|
1334
|
+
/**
|
|
1335
|
+
* Formats numbers and dates for display: any BCP-47 tag (`it-IT`). A tag `Intl` cannot read formats as `en-GB` and
|
|
1336
|
+
* reports `INVALID_FORMATTING_LOCALE`. Graphy's own texts use the built-in dictionary for its language, else `en-GB`.
|
|
1337
|
+
*/
|
|
1338
|
+
formattingLocale?: FormattingLocale;
|
|
910
1339
|
/**
|
|
911
1340
|
* Filled with this graph's {@link GraphHandle}, for callers mounted outside the provider where the
|
|
912
1341
|
* hooks can't reach. `useGraphHistoryShortcuts` binds the undo/redo chords to one.
|
|
@@ -915,7 +1344,7 @@ export declare interface GraphProviderProps {
|
|
|
915
1344
|
onSpecChange?: (next: Spec) => void;
|
|
916
1345
|
/** Fires with the compile failure(s) whenever a compile/recompile/dispatch produces errors. */
|
|
917
1346
|
onError?: (errors: VizDiagnostic[]) => void;
|
|
918
|
-
/** Fires with any warnings a successful compile produced. */
|
|
1347
|
+
/** Fires with any warnings a successful compile produced, and with `INVALID_FORMATTING_LOCALE` on a tag `Intl` cannot read. */
|
|
919
1348
|
onWarnings?: (warnings: VizDiagnostic[]) => void;
|
|
920
1349
|
colorScheme?: ColorScheme;
|
|
921
1350
|
children: ReactNode;
|
|
@@ -926,6 +1355,8 @@ export declare interface GraphProviderProps {
|
|
|
926
1355
|
* layout + DOM — the provider owns the spec and derives the scene output from it. There's
|
|
927
1356
|
* no `config` prop: every consumer must wrap with `<GraphProvider>` so commands can operate
|
|
928
1357
|
* on the live spec.
|
|
1358
|
+
*
|
|
1359
|
+
* Its texts follow `formattingLocale`, or the `locale` an `IntlProvider` above it sets, and take that provider's overrides.
|
|
929
1360
|
*/
|
|
930
1361
|
export declare const GraphRenderer: (props: GraphRendererProps) => JSX.Element;
|
|
931
1362
|
|
|
@@ -1171,6 +1602,22 @@ declare interface HoverStoreActions {
|
|
|
1171
1602
|
/** State of the hover store: the current {@link HoverState} plus its setter. */
|
|
1172
1603
|
declare type HoverStoreState = HoverSlice & HoverStoreActions;
|
|
1173
1604
|
|
|
1605
|
+
declare type I18nLocale = keyof typeof dictionaries;
|
|
1606
|
+
|
|
1607
|
+
declare type I18nRuntimeOverrides = RuntimeOverrides<GraphPhrases>;
|
|
1608
|
+
|
|
1609
|
+
/** The provider a read-only host wraps a chart in: chart phrases only, so `.` reaches no editor dictionary. */
|
|
1610
|
+
export declare const IntlProvider: React.FC<Omit<IntlProviderProps, 'dictionaries'>>;
|
|
1611
|
+
|
|
1612
|
+
declare interface IntlProviderProps {
|
|
1613
|
+
/** Any BCP-47 tag, which reads the dictionary {@link normalizeLocale} picks for it. */
|
|
1614
|
+
locale?: FormattingLocale;
|
|
1615
|
+
children: ReactNode;
|
|
1616
|
+
i18nOverrides?: I18nRuntimeOverrides;
|
|
1617
|
+
/** The phrase sets this tree translates against, most specific first. Defaults to the chart's own. */
|
|
1618
|
+
dictionaries?: readonly PhraseSource[];
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1174
1621
|
declare interface IntroAnimationOptions {
|
|
1175
1622
|
/** Whether the entrance plays at all */
|
|
1176
1623
|
enabled: boolean;
|
|
@@ -1272,6 +1719,22 @@ export declare interface LiveGeomApi {
|
|
|
1272
1719
|
readPanelPoint: (cursor: GeomHoverCursor) => PanelPoint | null;
|
|
1273
1720
|
}
|
|
1274
1721
|
|
|
1722
|
+
declare type LocaleShape = {
|
|
1723
|
+
dir?: TextDirection;
|
|
1724
|
+
} & Dictionary<typeof EN_GB>;
|
|
1725
|
+
|
|
1726
|
+
declare type LooseSection<T> = {
|
|
1727
|
+
[K in keyof T]?: T[K] extends object ? LooseSection<T[K]> : LooseValue<T[K]>;
|
|
1728
|
+
};
|
|
1729
|
+
|
|
1730
|
+
declare type LooseShapeOf<T> = {
|
|
1731
|
+
[K in keyof T]?: LooseSection<T[K]>;
|
|
1732
|
+
};
|
|
1733
|
+
|
|
1734
|
+
declare type LooseString<T> = T extends string ? string : T;
|
|
1735
|
+
|
|
1736
|
+
declare type LooseValue<T> = T extends (...args: infer A) => infer R ? (...args: A) => R : LooseString<T>;
|
|
1737
|
+
|
|
1275
1738
|
declare interface MorphingEditOutlineShape {
|
|
1276
1739
|
/** SVG path data in panel pixels. */
|
|
1277
1740
|
pathData: string;
|
|
@@ -1307,6 +1770,8 @@ declare interface OverlayAnchorInput<G extends GeomName | string = string, C ext
|
|
|
1307
1770
|
/** Where a geom `overpaint` lands: over everything a hook draws, or where the geom wraps it itself. */
|
|
1308
1771
|
export declare type OverpaintPlacement = 'layer' | 'manual';
|
|
1309
1772
|
|
|
1773
|
+
declare type OverridePhrase<Phrases, Key extends string> = DeepValue<Phrases, Key> extends PhraseFn<infer P> ? PhraseFn<P> | string : string;
|
|
1774
|
+
|
|
1310
1775
|
export declare interface PaintDefs {
|
|
1311
1776
|
/** The `fill` attribute for a paint: the color itself, or a `url(#id)` into the defs this SVG renders. */
|
|
1312
1777
|
fillFor: (paint: ResolvedPaint) => string;
|
|
@@ -1341,6 +1806,11 @@ export declare interface PathStroke {
|
|
|
1341
1806
|
strokeLinecap: StyleLineCap | undefined;
|
|
1342
1807
|
}
|
|
1343
1808
|
|
|
1809
|
+
declare type PhraseFn<P extends Record<string, unknown> = Record<string, unknown>> = (params: P) => string;
|
|
1810
|
+
|
|
1811
|
+
/** One surface's phrases, per locale. */
|
|
1812
|
+
declare type PhraseSource = Partial<Record<I18nLocale, object>>;
|
|
1813
|
+
|
|
1344
1814
|
/**
|
|
1345
1815
|
* How a point's `(x, y)` becomes SVG coordinates — the only thing that differs between a cartesian point
|
|
1346
1816
|
* and a polar (radar) point. Each coord's geom-renderer and hover container supply their own projection;
|
|
@@ -1409,6 +1879,12 @@ export declare const resolveGraphyBadgeVariant: (visible: boolean, frameSize: {
|
|
|
1409
1879
|
/** `lineCap` is the cap the stroke would otherwise paint; a dotted stroke paints round dots under any cap. */
|
|
1410
1880
|
export declare const resolvePathStroke: (dashArray: DashArray | undefined, strokeWidth: number, lineCap?: StyleLineCap) => PathStroke;
|
|
1411
1881
|
|
|
1882
|
+
declare type RuntimeOverrides<Phrases> = {
|
|
1883
|
+
dir?: TextDirection;
|
|
1884
|
+
} & {
|
|
1885
|
+
[Key in DotNotation<Phrases>]?: OverridePhrase<Phrases, Key>;
|
|
1886
|
+
};
|
|
1887
|
+
|
|
1412
1888
|
/** A point a point projection placed as a fraction of the panel, in panel pixels from the top left. */
|
|
1413
1889
|
export declare const scalePointToPanel: (point: XYPoint, panelSize: {
|
|
1414
1890
|
width: number;
|
|
@@ -1611,6 +2087,8 @@ declare interface TargetBoundaryStoreActions {
|
|
|
1611
2087
|
/** State of the target boundary store: the boundary the editor last measured plus the action replacing it. */
|
|
1612
2088
|
export declare type TargetBoundaryStoreState = TargetBoundarySlice & TargetBoundaryStoreActions;
|
|
1613
2089
|
|
|
2090
|
+
declare type TextDirection = 'ltr' | 'rtl';
|
|
2091
|
+
|
|
1614
2092
|
/**
|
|
1615
2093
|
* Creates a font-ready, cached text measurer and shares it with descendants via context.
|
|
1616
2094
|
* Renders nothing until the measurer resolves, so consumers reading the context always
|
|
@@ -1757,6 +2235,9 @@ export declare function useElementScreenRect<T extends Element = SVGRectElement>
|
|
|
1757
2235
|
screenRect: ScreenRect | null;
|
|
1758
2236
|
};
|
|
1759
2237
|
|
|
2238
|
+
/** The tag a chart formats numbers and dates in, which may name a locale no dictionary has. */
|
|
2239
|
+
export declare const useFormattingLocale: () => FormattingLocale;
|
|
2240
|
+
|
|
1760
2241
|
/**
|
|
1761
2242
|
* Registers a layout geom's render-side hit tester so a `'renderHitTest'` layer inherits central hover
|
|
1762
2243
|
* and the built-in tooltip — the path `bar` takes — with no pointer overlay of its own. The pull path.
|
|
@@ -1871,8 +2352,8 @@ export declare const useGraphHistory: () => GraphHistory;
|
|
|
1871
2352
|
*/
|
|
1872
2353
|
export declare const useGraphHistoryShortcuts: (handleRef: RefObject<GraphHandle | null>, options?: GraphHistoryShortcutsOptions) => void;
|
|
1873
2354
|
|
|
1874
|
-
/** The
|
|
1875
|
-
export declare const useGraphLocale: () =>
|
|
2355
|
+
/** The dictionary a chart's texts read when no host `IntlProvider` sets a locale. Resolved outside `IntlProvider`, so either renderer can mount its own. */
|
|
2356
|
+
export declare const useGraphLocale: () => Locale;
|
|
1876
2357
|
|
|
1877
2358
|
/**
|
|
1878
2359
|
* Subscribes to what the graph holds selected, from inside a `<GraphProvider>`. The store is
|