Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C] additional bugfix #219

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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%;
`;