Skip to content

Commit

Permalink
[C] additional bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff committed Jun 12, 2024
1 parent 259dba7 commit 1340f1f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
3 changes: 1 addition & 2 deletions packages/epo-widget-lib/src/charts/ScatterPlot/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import useAxis from "@/charts/hooks/useAxis";
import * as Styled from "./styles";
import defaults from "../defaults";
import CanvasPoints from "../canvas/Points";
import { isSafari } from "@/lib/utils";

export interface ScatterPlotProps {
xAxis: AxisConfig;
Expand Down Expand Up @@ -145,7 +144,7 @@ const ScatterPlot: FunctionComponent<ScatterPlotProps> = ({
labelledById={xAxisLabelId}
{...{ xDomain, xScale }}
/>
{tooltip && !isSafari() && (
{tooltip && (
<Tooltip
x={activePoint ? xScale(activePoint.x) : undefined}
y={activePoint ? yScale(activePoint.y) : undefined}
Expand Down
18 changes: 10 additions & 8 deletions packages/epo-widget-lib/src/widgets/LightCurvePlot/Plot/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,16 @@ const Plot: FunctionComponent<PlotProps> = ({
label: t("light_curve.plot.plot_label"),
points: data,
}}
tooltip={({ y }) =>
t("light_curve.plot.tooltip", {
magnitude: y.toLocaleString(language, {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
})
}
tooltip={({ y }) => (
<Styled.TooltipWrapper>
{t("light_curve.plot.tooltip", {
magnitude: y.toLocaleString(language, {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
})}
</Styled.TooltipWrapper>
)}
plotChildren={({ xScale, yStart, yEnd, Data, ...props }) =>
plotChildren
? plotChildren({ xScale, yStart, yEnd, Data, ...props })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ export const SliderInnerWrapper = styled.div`
height: 100%;
position: relative;
`;

export const TooltipWrapper = styled.span`
white-space: nowrap;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import AspectRatio from "@/layout/AspectRatio";
import Message from "./Message";
import Loader from "@/atomic/Loader";
import ElapsedTime from "@/atomic/ElapsedTime";
import Blinker from "@/atomic/Blinker";
import PointSelector from "./PointSelector";
import * as Styled from "./styles";

interface BlinkConfig {
autoplay?: boolean;
Expand Down Expand Up @@ -118,7 +118,7 @@ const SourceSelector: FunctionComponent<SourceSelectorProps> = ({
{message}
</Message>
)}
<Blinker
<Styled.BackgroundBlinker
images={images}
activeIndex={activeAlertIndex}
blinkCallback={alertChangeCallback}
Expand All @@ -134,7 +134,7 @@ const SourceSelector: FunctionComponent<SourceSelectorProps> = ({
onSelectCallback={handleClick}
{...{ width, height, sources, selectedSource }}
/>
</Blinker>
</Styled.BackgroundBlinker>
{!isPrepared && <Loader />}
</AspectRatio>
);
Expand Down
7 changes: 7 additions & 0 deletions packages/epo-widget-lib/src/widgets/SourceSelector/styles.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import styled from "styled-components";
import Blinker from "@/atomic/Blinker";

export const SVG = styled.svg`
cursor: pointer;
position: absolute;
bottom: 0;
left: 0;
`;

export const BackgroundBlinker = styled(Blinker)`
position: absolute;
width: 100%;
height: 100%;
`;

0 comments on commit 1340f1f

Please sign in to comment.