Skip to content

Commit

Permalink
minor ui tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
xvvvyz committed Jul 1, 2024
1 parent 34e484c commit 85dfb4b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
12 changes: 5 additions & 7 deletions app/_components/plot-figure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,10 @@ const PlotFigure = ({
}

if (!showBars || !isInputNominal) {
const pointer = P[isInputNominal ? 'pointerY' : 'pointerX'];

marks.push(
P.dot(
rows,
pointer({
P.pointerX({
fill: '#fff',
maxRadius: 100,
title: (d) => JSON.stringify(d),
Expand All @@ -168,7 +166,7 @@ const PlotFigure = ({
marks.push(
P.ruleX(
rows,
pointer({
P.pointerX({
maxRadius: 100,
py: y,
stroke: 'hsla(0, 0%, 100%, 25%)',
Expand All @@ -180,7 +178,7 @@ const PlotFigure = ({
marks.push(
P.ruleY(
rows,
pointer({
P.pointerX({
maxRadius: 100,
px: x,
stroke: 'hsla(0, 0%, 100%, 25%)',
Expand All @@ -192,7 +190,7 @@ const PlotFigure = ({
marks.push(
P.text(
rows,
pointer({
P.pointerX({
dy: 16,
fill: '#fff',
frameAnchor: 'bottom',
Expand All @@ -209,7 +207,7 @@ const PlotFigure = ({
marks.push(
P.text(
rows,
pointer({
P.pointerX({
dx: -9,
fill: '#fff',
frameAnchor: 'left',
Expand Down
2 changes: 2 additions & 0 deletions app/_queries/collapsible-archive.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use client';

import Button from '@/_components/button';
import ChevronDownIcon from '@heroicons/react/24/outline/ChevronDownIcon';
import ChevronUpIcon from '@heroicons/react/24/outline/ChevronUpIcon';
Expand Down Expand Up @@ -32,4 +33,5 @@ const CollapsibleArchive = ({ children }: CollapsibleArchiveProps) => {
</Collapsible.Collapsible>
);
};

export default CollapsibleArchive;
7 changes: 5 additions & 2 deletions app/_utilities/format-input-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ interface Value {
const formatInputValue = {
checkbox: (values: Value[]) => (values[0]?.value == true ? 'Yes' : 'No'),
duration: (values: Value[]) =>
humanizeDuration(Number(values[0]?.value ?? '0') * 1000, { largest: 2 }),
humanizeDuration(Number(values[0]?.value ?? '0') * 1000, {
largest: 2,
round: true,
}),
multi_select: (values: Value[]) =>
values
.map(({ label }) => label)
Expand All @@ -19,7 +22,7 @@ const formatInputValue = {
stopwatch: (values: Value[]) =>
humanizeDuration(
Number(values.find(({ label }) => !label)?.value ?? '0') * 1000,
{ largest: 2 },
{ largest: 2, round: true },
),
};

Expand Down
1 change: 1 addition & 0 deletions app/_utilities/humanize-duration-short.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const humanizeDurationShort = humanizeDuration.humanizer({
},
},
largest: 2,
round: true,
spacer: '',
});

Expand Down

0 comments on commit 85dfb4b

Please sign in to comment.