Skip to content

Commit

Permalink
Fix y-range for 24 hr latency line plot (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuali925 committed Feb 1, 2021
1 parent 7b3468b commit b9bf44f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion public/components/common/plots/latency_trend_plt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import React, { useMemo } from 'react';
import { Plt } from './plt';

export function LinePlt(props: { data: Plotly.Data[] }) {
const maxY = props.data[0]?.y ? Math.max(...props.data[0].y) : 0;
const layout = useMemo(
() => ({
plot_bgcolor: 'rgba(0, 0, 0, 0)',
Expand All @@ -31,6 +32,7 @@ export function LinePlt(props: { data: Plotly.Data[] }) {
fixedrange: true,
showgrid: false,
visible: false,
range: [0, maxY * 1.1],
},
margin: {
l: 0,
Expand All @@ -39,7 +41,7 @@ export function LinePlt(props: { data: Plotly.Data[] }) {
t: 0,
pad: 0,
},
height: 15,
height: 20,
width: 60,
}),
[props.data]
Expand Down

0 comments on commit b9bf44f

Please sign in to comment.