@tetrascience-npm/tetrascience-react-ui 0.6.0-beta.83.1 → 0.6.0-beta.84.1
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/components/charts/AreaGraph/AreaGraph.cjs +1 -1
- package/dist/components/charts/AreaGraph/AreaGraph.cjs.map +1 -1
- package/dist/components/charts/AreaGraph/AreaGraph.js +112 -82
- package/dist/components/charts/AreaGraph/AreaGraph.js.map +1 -1
- package/dist/components/charts/BarGraph/BarGraph.cjs +1 -1
- package/dist/components/charts/BarGraph/BarGraph.cjs.map +1 -1
- package/dist/components/charts/BarGraph/BarGraph.js +53 -48
- package/dist/components/charts/BarGraph/BarGraph.js.map +1 -1
- package/dist/components/charts/Boxplot/Boxplot.cjs +1 -1
- package/dist/components/charts/Boxplot/Boxplot.cjs.map +1 -1
- package/dist/components/charts/Boxplot/Boxplot.js +65 -60
- package/dist/components/charts/Boxplot/Boxplot.js.map +1 -1
- package/dist/components/charts/ChartTooltip/ChartTooltip.cjs +2 -0
- package/dist/components/charts/ChartTooltip/ChartTooltip.cjs.map +1 -0
- package/dist/components/charts/ChartTooltip/ChartTooltip.js +163 -0
- package/dist/components/charts/ChartTooltip/ChartTooltip.js.map +1 -0
- package/dist/components/charts/ChartTooltip/lines.cjs +2 -0
- package/dist/components/charts/ChartTooltip/lines.cjs.map +1 -0
- package/dist/components/charts/ChartTooltip/lines.js +29 -0
- package/dist/components/charts/ChartTooltip/lines.js.map +1 -0
- package/dist/components/charts/Chromatogram/Chromatogram.cjs +1 -1
- package/dist/components/charts/Chromatogram/Chromatogram.cjs.map +1 -1
- package/dist/components/charts/Chromatogram/Chromatogram.js +75 -66
- package/dist/components/charts/Chromatogram/Chromatogram.js.map +1 -1
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.cjs +1 -1
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.cjs.map +1 -1
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.js +107 -99
- package/dist/components/charts/ChromatogramChart/ChromatogramChart.js.map +1 -1
- package/dist/components/charts/ChromatogramChart/dataProcessing.cjs +1 -1
- package/dist/components/charts/ChromatogramChart/dataProcessing.cjs.map +1 -1
- package/dist/components/charts/ChromatogramChart/dataProcessing.js +38 -49
- package/dist/components/charts/ChromatogramChart/dataProcessing.js.map +1 -1
- package/dist/components/charts/DotPlot/DotPlot.cjs +1 -1
- package/dist/components/charts/DotPlot/DotPlot.cjs.map +1 -1
- package/dist/components/charts/DotPlot/DotPlot.js +52 -48
- package/dist/components/charts/DotPlot/DotPlot.js.map +1 -1
- package/dist/components/charts/Histogram/Histogram.cjs +1 -1
- package/dist/components/charts/Histogram/Histogram.cjs.map +1 -1
- package/dist/components/charts/Histogram/Histogram.js +96 -92
- package/dist/components/charts/Histogram/Histogram.js.map +1 -1
- package/dist/components/charts/LineGraph/LineGraph.cjs +1 -1
- package/dist/components/charts/LineGraph/LineGraph.cjs.map +1 -1
- package/dist/components/charts/LineGraph/LineGraph.js +44 -39
- package/dist/components/charts/LineGraph/LineGraph.js.map +1 -1
- package/dist/components/charts/PieChart/PieChart.cjs +1 -1
- package/dist/components/charts/PieChart/PieChart.cjs.map +1 -1
- package/dist/components/charts/PieChart/PieChart.js +58 -54
- package/dist/components/charts/PieChart/PieChart.js.map +1 -1
- package/dist/components/charts/PlateMap/PlateMap.cjs +1 -1
- package/dist/components/charts/PlateMap/PlateMap.cjs.map +1 -1
- package/dist/components/charts/PlateMap/PlateMap.js +271 -256
- package/dist/components/charts/PlateMap/PlateMap.js.map +1 -1
- package/dist/components/charts/ScatterGraph/ScatterGraph.cjs +1 -1
- package/dist/components/charts/ScatterGraph/ScatterGraph.cjs.map +1 -1
- package/dist/components/charts/ScatterGraph/ScatterGraph.js +112 -89
- package/dist/components/charts/ScatterGraph/ScatterGraph.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +130 -0
- package/dist/index.js +585 -580
- package/dist/index.js.map +1 -1
- package/dist/index.tailwind.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ import * as React_2 from 'react';
|
|
|
48
48
|
import { ReactElement } from 'react';
|
|
49
49
|
import { ReactNode } from 'react';
|
|
50
50
|
import { ReactPortal } from 'react';
|
|
51
|
+
import { Ref } from 'react';
|
|
51
52
|
import { RefObject } from 'react';
|
|
52
53
|
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
53
54
|
import { ScrollArea as ScrollArea_2 } from 'radix-ui';
|
|
@@ -578,6 +579,94 @@ export declare const CHART_SEQUENTIAL: {
|
|
|
578
579
|
readonly purple: string[];
|
|
579
580
|
};
|
|
580
581
|
|
|
582
|
+
/**
|
|
583
|
+
* The design-system tooltip anchored at a chart position; drive it with
|
|
584
|
+
* `useChartTooltip`.
|
|
585
|
+
*
|
|
586
|
+
* Renders the same visual as the ui `TooltipContent` (bubble + arrow) but
|
|
587
|
+
* positions it directly from the anchor coordinates — Radix's popper
|
|
588
|
+
* repositions asynchronously and mis-measures animated content, which made
|
|
589
|
+
* tooltips drift on charts. Placement supports all four sides with
|
|
590
|
+
* Radix-style collision flipping.
|
|
591
|
+
*/
|
|
592
|
+
export declare function ChartTooltip({ anchor, bubbleRef }: ChartTooltipProps): ReactPortal | null;
|
|
593
|
+
|
|
594
|
+
export declare interface ChartTooltipAnchor {
|
|
595
|
+
left: number;
|
|
596
|
+
top: number;
|
|
597
|
+
lines: string[];
|
|
598
|
+
/** Preferred placement side; auto-flips to the opposite when it won't fit */
|
|
599
|
+
side?: ChartTooltipSide;
|
|
600
|
+
/** Plays the exit animation before the tooltip unmounts */
|
|
601
|
+
closing?: boolean;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Minimal structural view of a Plotly hover point — covers cartesian, pie,
|
|
606
|
+
* and heatmap traces without depending on Plotly's loose event typings.
|
|
607
|
+
*/
|
|
608
|
+
export declare interface ChartTooltipHoverPoint {
|
|
609
|
+
x?: number | string;
|
|
610
|
+
y?: number | string;
|
|
611
|
+
z?: number;
|
|
612
|
+
/** Pie slice label */
|
|
613
|
+
label?: string;
|
|
614
|
+
/** Pie slice value */
|
|
615
|
+
value?: number;
|
|
616
|
+
/** Pie slice raw value (Plotly's `v` alias) */
|
|
617
|
+
v?: number;
|
|
618
|
+
/** Pie slice percentage (0–100) */
|
|
619
|
+
percent?: number;
|
|
620
|
+
/** Per-point hover text (e.g. PlateMap wells), lines separated by `<br>` */
|
|
621
|
+
text?: string;
|
|
622
|
+
pointIndex?: number;
|
|
623
|
+
data?: {
|
|
624
|
+
name?: string;
|
|
625
|
+
};
|
|
626
|
+
/** Per-point custom data attached to the trace */
|
|
627
|
+
customdata?: unknown;
|
|
628
|
+
/** Hovered point bounds in plot-div pixels (provided by Plotly) */
|
|
629
|
+
bbox?: {
|
|
630
|
+
x0: number;
|
|
631
|
+
x1: number;
|
|
632
|
+
y0: number;
|
|
633
|
+
y1: number;
|
|
634
|
+
};
|
|
635
|
+
/**
|
|
636
|
+
* Plotly axis objects (internal) used to project a data value to a plot-div
|
|
637
|
+
* pixel. Bars report a `bbox` that sits below their visual top, so we anchor
|
|
638
|
+
* to `_offset + l2p(value)` instead.
|
|
639
|
+
*/
|
|
640
|
+
yaxis?: {
|
|
641
|
+
_offset?: number;
|
|
642
|
+
l2p?: (value: number) => number;
|
|
643
|
+
};
|
|
644
|
+
xaxis?: {
|
|
645
|
+
_offset?: number;
|
|
646
|
+
l2p?: (value: number) => number;
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Build default tooltip lines from Plotly hover points. Handles pie slices,
|
|
652
|
+
* text-carrying traces (e.g. PlateMap wells), single cartesian points, and
|
|
653
|
+
* unified multi-trace hovers.
|
|
654
|
+
*/
|
|
655
|
+
export declare function chartTooltipLines(points: ChartTooltipHoverPoint[], labels?: {
|
|
656
|
+
xLabel?: string;
|
|
657
|
+
yLabel?: string;
|
|
658
|
+
}): string[];
|
|
659
|
+
|
|
660
|
+
export declare interface ChartTooltipProps {
|
|
661
|
+
/** Anchor position (viewport coordinates) and content lines */
|
|
662
|
+
anchor: ChartTooltipAnchor | null;
|
|
663
|
+
/** Ref to the bubble node, used by cursor-following charts to clamp it on-screen */
|
|
664
|
+
bubbleRef?: Ref<HTMLDivElement>;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/** Which edge of the point the tooltip is placed against (matches Radix). */
|
|
668
|
+
export declare type ChartTooltipSide = "top" | "bottom" | "left" | "right";
|
|
669
|
+
|
|
581
670
|
export declare const Chat: ({ initialMessages, models, defaultModel, suggestions, onSend, className, }: ChatProps) => JSX.Element;
|
|
582
671
|
|
|
583
672
|
export declare interface ChatMessage {
|
|
@@ -3863,6 +3952,47 @@ export declare function useCarousel(): CarouselContextProps;
|
|
|
3863
3952
|
|
|
3864
3953
|
declare type UseCarouselParameters = Parameters<typeof default_3>;
|
|
3865
3954
|
|
|
3955
|
+
/**
|
|
3956
|
+
* Drives the design-system tooltip from Plotly hover events.
|
|
3957
|
+
*
|
|
3958
|
+
* ```tsx
|
|
3959
|
+
* const { bindTooltip, tooltipElement } = useChartTooltip({ xLabel, yLabel });
|
|
3960
|
+
* // after Plotly.newPlot(...): set trace hoverinfo to "none", then
|
|
3961
|
+
* bindTooltip(plotRef.current);
|
|
3962
|
+
* // anywhere in the chart markup:
|
|
3963
|
+
* {tooltipElement}
|
|
3964
|
+
* ```
|
|
3965
|
+
*/
|
|
3966
|
+
export declare function useChartTooltip(options?: UseChartTooltipOptions): {
|
|
3967
|
+
bindTooltip: (plotDiv: HTMLElement | null) => void;
|
|
3968
|
+
tooltipElement: JSX.Element;
|
|
3969
|
+
};
|
|
3970
|
+
|
|
3971
|
+
export declare interface UseChartTooltipOptions {
|
|
3972
|
+
/** Axis label used for the default x line (falls back to "X") */
|
|
3973
|
+
xLabel?: string;
|
|
3974
|
+
/** Axis label used for the default y line (falls back to "Y") */
|
|
3975
|
+
yLabel?: string;
|
|
3976
|
+
/** Override the default line builder entirely */
|
|
3977
|
+
getLines?: (points: ChartTooltipHoverPoint[]) => string[];
|
|
3978
|
+
/**
|
|
3979
|
+
* Track the cursor instead of anchoring to the hovered point's bounds, and
|
|
3980
|
+
* keep the tooltip clamped inside the viewport. Use for traces with large
|
|
3981
|
+
* hover targets (e.g. pie slices) where a fixed anchor feels disconnected.
|
|
3982
|
+
*/
|
|
3983
|
+
followCursor?: boolean;
|
|
3984
|
+
/**
|
|
3985
|
+
* Override Plotly's hover hit radius (px). A larger radius makes big markers
|
|
3986
|
+
* (e.g. heatmap circles) hoverable across their whole face.
|
|
3987
|
+
*/
|
|
3988
|
+
hoverDistance?: number;
|
|
3989
|
+
/**
|
|
3990
|
+
* Preferred side to place the tooltip on relative to the point. Auto-flips to
|
|
3991
|
+
* the opposite side when there isn't room (Radix-style). Defaults to "top".
|
|
3992
|
+
*/
|
|
3993
|
+
side?: ChartTooltipSide;
|
|
3994
|
+
}
|
|
3995
|
+
|
|
3866
3996
|
export declare function useComboboxAnchor(): React_2.RefObject<HTMLDivElement | null>;
|
|
3867
3997
|
|
|
3868
3998
|
export declare function useDataTable<TData = unknown>(): TableContextValue<TData>;
|