Skip to content

Commit

Permalink
fix(result-search): consistent spacing in chart.js with echarts
Browse files Browse the repository at this point in the history
  • Loading branch information
TheChristophe committed Sep 14, 2023
1 parent 2de07ed commit 3502cb9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions components/result-search/diagrams/chartjs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const ChartJSDiagram: FC<ChartJSDiagramProps> = ({ results, suggestions }) => {

return (
<>
<Form.Group className="mb-1">
<Form.Group className="mb-2">
<Form.Label>Mode:</Form.Label>
<Form.Select
onChange={(e: ChangeEvent<HTMLSelectElement>) => {
Expand All @@ -122,7 +122,7 @@ const ChartJSDiagram: FC<ChartJSDiagramProps> = ({ results, suggestions }) => {
<option value={Mode.Logarithmic}>Logarithmic</option>
</Form.Select>
</Form.Group>
<XAxis setXAxis={setXAxis} suggestions={suggestions} />
<XAxis setXAxis={setXAxis} suggestions={suggestions} className="mb-2" />
<YAxis setYAxis={setYAxis} suggestions={suggestions} />

{rejected.length > 0 && (
Expand Down
10 changes: 6 additions & 4 deletions components/result-search/diagrams/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ export const generateDataPoints = (
type XAxisProps = {
setXAxis: (value: ((prevState: string) => string) | string) => void;
suggestions?: Suggestion[];
className?: string;
};
export const XAxis: FC<XAxisProps> = ({ setXAxis, suggestions }) => (
<Form.Group className="mb-1">
export const XAxis: FC<XAxisProps> = ({ setXAxis, suggestions, className }) => (
<Form.Group className={className}>
<Form.Label>X Axis:</Form.Label>
<InputWithSuggestions
placeholder="Enter a JSON path (e.g. machine.cpu.count)"
Expand All @@ -64,9 +65,10 @@ export const XAxis: FC<XAxisProps> = ({ setXAxis, suggestions }) => (
type YAxisProps = {
setYAxis: (value: ((prevState: string) => string) | string) => void;
suggestions?: Suggestion[];
className?: string;
};
export const YAxis: FC<YAxisProps> = ({ setYAxis, suggestions }) => (
<Form.Group>
export const YAxis: FC<YAxisProps> = ({ setYAxis, suggestions, className }) => (
<Form.Group className={className}>
<Form.Label>Y Axis:</Form.Label>
<InputWithSuggestions
placeholder="Enter a JSON path (e.g. result.score)"
Expand Down

0 comments on commit 3502cb9

Please sign in to comment.