Run prettier on all files

This commit is contained in:
Przemek Więch
2026-03-04 20:12:22 +01:00
parent c5d6a9ef42
commit 6088d5d599
5 changed files with 31 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
import { max, min } from 'd3-array'; import {max, min} from 'd3-array';
import { interpolateNumber } from 'd3-interpolate'; import {interpolateNumber} from 'd3-interpolate';
import { select, Selection } from 'd3-selection'; import {select, Selection} from 'd3-selection';
import 'd3-transition'; import 'd3-transition';
import { import {
D3ZoomEvent, D3ZoomEvent,
@@ -9,9 +9,9 @@ import {
ZoomedElementBaseType, ZoomedElementBaseType,
zoomTransform, zoomTransform,
} from 'd3-zoom'; } from 'd3-zoom';
import { saveAs } from 'file-saver'; import {saveAs} from 'file-saver';
import { useEffect, useRef } from 'react'; import {useEffect, useRef} from 'react';
import { IntlShape, useIntl } from 'react-intl'; import {IntlShape, useIntl} from 'react-intl';
import { import {
ChartHandle, ChartHandle,
ChartInfo, ChartInfo,
@@ -25,9 +25,9 @@ import {
RelativesChart, RelativesChart,
ChartColors as TopolaChartColors, ChartColors as TopolaChartColors,
} from 'topola'; } from 'topola';
import { ChartColors, Ids, Sex } from './sidepanel/config/config'; import {ChartColors, Ids, Sex} from './sidepanel/config/config';
import { Media } from './util/media'; import {Media} from './util/media';
import { usePrevious } from './util/previous-hook'; import {usePrevious} from './util/previous-hook';
/** How much to zoom when using the +/- buttons. */ /** How much to zoom when using the +/- buttons. */
const ZOOM_FACTOR = 1.3; const ZOOM_FACTOR = 1.3;
@@ -156,7 +156,10 @@ function getStrippedSvg() {
function getSvgDimensions() { function getSvgDimensions() {
const svg = document.getElementById('chartSvg')!; const svg = document.getElementById('chartSvg')!;
return { width: Number(svg.getAttribute('width')), height: Number(svg.getAttribute('height')) }; return {
width: Number(svg.getAttribute('width')),
height: Number(svg.getAttribute('height')),
};
} }
function getSvgContents() { function getSvgContents() {
@@ -203,13 +206,13 @@ export function printChart() {
export async function downloadSvg() { export async function downloadSvg() {
const contents = await getSvgContentsWithInlinedImages(); const contents = await getSvgContentsWithInlinedImages();
const blob = new Blob([contents], { type: 'image/svg+xml' }); const blob = new Blob([contents], {type: 'image/svg+xml'});
saveAs(blob, 'topola.svg'); saveAs(blob, 'topola.svg');
} }
async function drawOnCanvas(): Promise<HTMLCanvasElement> { async function drawOnCanvas(): Promise<HTMLCanvasElement> {
const contents = await getSvgContentsWithInlinedImages(); const contents = await getSvgContentsWithInlinedImages();
const blob = new Blob([contents], { type: 'image/svg+xml' }); const blob = new Blob([contents], {type: 'image/svg+xml'});
return drawImageOnCanvas(await loadImage(blob)); return drawImageOnCanvas(await loadImage(blob));
} }
@@ -221,7 +224,7 @@ export async function downloadPng() {
export async function downloadPdf() { export async function downloadPdf() {
// Lazy load jspdf. // Lazy load jspdf.
const { default: jspdf } = await import('jspdf'); const {default: jspdf} = await import('jspdf');
const {width, height} = getSvgDimensions(); const {width, height} = getSvgDimensions();
const doc = new jspdf({ const doc = new jspdf({
@@ -342,7 +345,7 @@ class ChartWrapper {
renderChart( renderChart(
props: ChartProps, props: ChartProps,
intl: IntlShape, intl: IntlShape,
args: { initialRender: boolean; resetPosition: boolean } = { args: {initialRender: boolean; resetPosition: boolean} = {
initialRender: false, initialRender: false,
resetPosition: false, resetPosition: false,
}, },

View File

@@ -37,7 +37,13 @@ export function SidePanel({
id: 'tab.settings', id: 'tab.settings',
defaultMessage: 'Settings', defaultMessage: 'Settings',
}), }),
render: () => <ConfigPanel gedcom={data.gedcom} config={config} onChange={onConfigChange} />, render: () => (
<ConfigPanel
gedcom={data.gedcom}
config={config}
onChange={onConfigChange}
/>
),
}, },
]; ];

View File

@@ -1,2 +1,2 @@
/** No-op function for analytics. */ /** No-op function for analytics. */
export function analyticsEvent(action: string, data?: any) { } export function analyticsEvent(action: string, data?: any) {}