Skip to content
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
7 changes: 4 additions & 3 deletions apps/class-solid/src/components/Analysis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function TimeSeriesPlot({ analysis }: { analysis: TimeseriesAnalysis }) {
e.output ? e.output[analysis.yVariable] : [],
);

const xLim = () => getNiceAxisLimits(allX());
const xLim = () => getNiceAxisLimits(allX(), 0, 600);
const yLim = () => getNiceAxisLimits(allY());

const chartData = () =>
Expand Down Expand Up @@ -418,8 +418,9 @@ async function takeScreenshot(event: MouseEvent, analyse: Analysis) {
return;
}

// TODO Make screenshot bigger than the original?
const scale = 1;
// Make screenshot bigger than the original
const scale = 10;

// Can not use toSvg as legend is written in HTML
// generated svg document contains foreignObject with html tag
// which can only be rendered using web browser, not Inkscape or PowerPoint
Expand Down
3 changes: 2 additions & 1 deletion apps/class-solid/src/components/plots/Axes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export const AxisLeft = (props: AxisProps) => {
export function getNiceAxisLimits(
data: number[],
extraMargin = 0,
roundTo?: number, // Optional rounding step, e.g. 600 for 10 minutes
): [number, number] {
const max = Math.max(...data);
const min = Math.min(...data);
Expand All @@ -87,7 +88,7 @@ export function getNiceAxisLimits(
// Avoid NaNs on axis for constant values
if (range === 0) return [min - 1, max + 1];

const step = 10 ** Math.floor(Math.log10(range));
const step = roundTo ?? 10 ** Math.floor(Math.log10(range));

const niceMin = Math.floor(min / step) * step - extraMargin * step;
const niceMax = Math.ceil(max / step) * step + extraMargin * step;
Expand Down
2 changes: 1 addition & 1 deletion apps/class-solid/src/components/plots/Line.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function Line(d: ChartData<Point>) {
fill="none"
stroke={stroke()}
stroke-dasharray={d.linestyle}
stroke-width="3"
stroke-width="2"
d={l(d.data) || ""}
class="cursor-pointer"
>
Expand Down
4 changes: 2 additions & 2 deletions apps/class-solid/src/components/plots/skewTlogP.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function Sounding(data: ChartData<SoundingRecord>) {
clip-path="url(#clipper)"
stroke={stroke()}
stroke-dasharray={data.linestyle}
stroke-width={3}
stroke-width={2}
fill="none"
class="cursor-pointer"
>
Expand All @@ -133,7 +133,7 @@ function Sounding(data: ChartData<SoundingRecord>) {
clip-path="url(#clipper)"
stroke={stroke()}
stroke-dasharray="5,5"
stroke-width={3}
stroke-width={2}
fill="none"
class="cursor-pointer"
>
Expand Down