mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-03-14 11:33:47 +00:00
Run prettier on all files
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { max, min } from 'd3-array';
|
||||
import { interpolateNumber } from 'd3-interpolate';
|
||||
import { select, Selection } from 'd3-selection';
|
||||
import {max, min} from 'd3-array';
|
||||
import {interpolateNumber} from 'd3-interpolate';
|
||||
import {select, Selection} from 'd3-selection';
|
||||
import 'd3-transition';
|
||||
import {
|
||||
D3ZoomEvent,
|
||||
@@ -9,9 +9,9 @@ import {
|
||||
ZoomedElementBaseType,
|
||||
zoomTransform,
|
||||
} from 'd3-zoom';
|
||||
import { saveAs } from 'file-saver';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { IntlShape, useIntl } from 'react-intl';
|
||||
import {saveAs} from 'file-saver';
|
||||
import {useEffect, useRef} from 'react';
|
||||
import {IntlShape, useIntl} from 'react-intl';
|
||||
import {
|
||||
ChartHandle,
|
||||
ChartInfo,
|
||||
@@ -25,9 +25,9 @@ import {
|
||||
RelativesChart,
|
||||
ChartColors as TopolaChartColors,
|
||||
} from 'topola';
|
||||
import { ChartColors, Ids, Sex } from './sidepanel/config/config';
|
||||
import { Media } from './util/media';
|
||||
import { usePrevious } from './util/previous-hook';
|
||||
import {ChartColors, Ids, Sex} from './sidepanel/config/config';
|
||||
import {Media} from './util/media';
|
||||
import {usePrevious} from './util/previous-hook';
|
||||
|
||||
/** How much to zoom when using the +/- buttons. */
|
||||
const ZOOM_FACTOR = 1.3;
|
||||
@@ -156,7 +156,10 @@ function getStrippedSvg() {
|
||||
|
||||
function getSvgDimensions() {
|
||||
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() {
|
||||
@@ -203,13 +206,13 @@ export function printChart() {
|
||||
|
||||
export async function downloadSvg() {
|
||||
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');
|
||||
}
|
||||
|
||||
async function drawOnCanvas(): Promise<HTMLCanvasElement> {
|
||||
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));
|
||||
}
|
||||
|
||||
@@ -221,7 +224,7 @@ export async function downloadPng() {
|
||||
|
||||
export async function downloadPdf() {
|
||||
// Lazy load jspdf.
|
||||
const { default: jspdf } = await import('jspdf');
|
||||
const {default: jspdf} = await import('jspdf');
|
||||
|
||||
const {width, height} = getSvgDimensions();
|
||||
const doc = new jspdf({
|
||||
@@ -342,7 +345,7 @@ class ChartWrapper {
|
||||
renderChart(
|
||||
props: ChartProps,
|
||||
intl: IntlShape,
|
||||
args: { initialRender: boolean; resetPosition: boolean } = {
|
||||
args: {initialRender: boolean; resetPosition: boolean} = {
|
||||
initialRender: false,
|
||||
resetPosition: false,
|
||||
},
|
||||
|
||||
@@ -37,7 +37,13 @@ export function SidePanel({
|
||||
id: 'tab.settings',
|
||||
defaultMessage: 'Settings',
|
||||
}),
|
||||
render: () => <ConfigPanel gedcom={data.gedcom} config={config} onChange={onConfigChange} />,
|
||||
render: () => (
|
||||
<ConfigPanel
|
||||
gedcom={data.gedcom}
|
||||
config={config}
|
||||
onChange={onConfigChange}
|
||||
/>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"menu.download_svg": "Pobierz SVG",
|
||||
"menu.view": "Widok",
|
||||
"menu.hourglass": "Wykres klepsydrowy",
|
||||
"menu.relatives": "Wszyscy krewni",
|
||||
"menu.relatives": "Wszyscy krewni",
|
||||
"menu.donatso": "Donatso fwykres rodzinny",
|
||||
"menu.fancy": "Ozdobne drzewo (eksperymentalne)",
|
||||
"menu.wikitree_login": "Zaloguj do WikiTree",
|
||||
@@ -104,7 +104,7 @@
|
||||
"age.exact": "{age, plural, =0 {Mniej niż 1 rok} one {{qualifier} 1 rok} many {{qualifier} # lat} other {{qualifier} # lata}}",
|
||||
"age.less": "Mniej niż {age, plural, =0 {1 rok} one {1 rok} many {# lat} other {# lata}}",
|
||||
"age.more": "Więcej niż {age, plural, =0 {0 lat} one {1 rok} many {# lat} other {# lata}}",
|
||||
"age.between": "Między {ageFrom} a {ageTo, plural, =0 {0 lat} one {1 rok} many {# lat} other {# lata}}",
|
||||
"age.between": "Między {ageFrom} a {ageTo, plural, =0 {0 lat} one {1 rok} many {# lat} other {# lata}}",
|
||||
"error.error": "Błąd",
|
||||
"error.failed_pdf": "Nie udało się utworzyć pliku PDF. Spróbuj jeszcze raz z mniejszym diagramem lub pobierz plik SVG.",
|
||||
"error.failed_png": "Nie udało się utworzyć pliku PNG. Spróbuj jeszcze raz z mniejszym diagramem lub pobierz plik SVG.",
|
||||
@@ -128,11 +128,11 @@
|
||||
"config.ids.SHOW": "pokaż",
|
||||
"config.sex": "Płeć",
|
||||
"config.sex.HIDE": "ukryj",
|
||||
"config.sex.SHOW": "pokaż",
|
||||
"head.source": "Źródło danych",
|
||||
"config.sex.SHOW": "pokaż",
|
||||
"head.source": "Źródło danych",
|
||||
"name.unknown_name": "N.N.",
|
||||
"extras.images": "Zdjęcia",
|
||||
"extras.notes": "Notatki",
|
||||
"extras.sources": "Źródła",
|
||||
"extras.files": "Dodatkowe pliki"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
"config.sex": "Пол",
|
||||
"config.sex.HIDE": "Скрыть",
|
||||
"config.sex.SHOW": "Показать",
|
||||
"head.source": "Источник данных",
|
||||
"head.source": "Источник данных",
|
||||
"name.unknown_name": "Неизвестно",
|
||||
"extras.images": "Картинки",
|
||||
"extras.notes": "Примечание",
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
/** No-op function for analytics. */
|
||||
export function analyticsEvent(action: string, data?: any) { }
|
||||
export function analyticsEvent(action: string, data?: any) {}
|
||||
|
||||
Reference in New Issue
Block a user