mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-05-26 23:26:15 +00:00
Run prettier on all files
This commit is contained in:
@@ -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,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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}
|
||||||
|
/>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
"menu.download_svg": "Pobierz SVG",
|
"menu.download_svg": "Pobierz SVG",
|
||||||
"menu.view": "Widok",
|
"menu.view": "Widok",
|
||||||
"menu.hourglass": "Wykres klepsydrowy",
|
"menu.hourglass": "Wykres klepsydrowy",
|
||||||
"menu.relatives": "Wszyscy krewni",
|
"menu.relatives": "Wszyscy krewni",
|
||||||
"menu.donatso": "Donatso fwykres rodzinny",
|
"menu.donatso": "Donatso fwykres rodzinny",
|
||||||
"menu.fancy": "Ozdobne drzewo (eksperymentalne)",
|
"menu.fancy": "Ozdobne drzewo (eksperymentalne)",
|
||||||
"menu.wikitree_login": "Zaloguj do WikiTree",
|
"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.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.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.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.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_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.",
|
"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.ids.SHOW": "pokaż",
|
||||||
"config.sex": "Płeć",
|
"config.sex": "Płeć",
|
||||||
"config.sex.HIDE": "ukryj",
|
"config.sex.HIDE": "ukryj",
|
||||||
"config.sex.SHOW": "pokaż",
|
"config.sex.SHOW": "pokaż",
|
||||||
"head.source": "Źródło danych",
|
"head.source": "Źródło danych",
|
||||||
"name.unknown_name": "N.N.",
|
"name.unknown_name": "N.N.",
|
||||||
"extras.images": "Zdjęcia",
|
"extras.images": "Zdjęcia",
|
||||||
"extras.notes": "Notatki",
|
"extras.notes": "Notatki",
|
||||||
"extras.sources": "Źródła",
|
"extras.sources": "Źródła",
|
||||||
"extras.files": "Dodatkowe pliki"
|
"extras.files": "Dodatkowe pliki"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@
|
|||||||
"config.sex": "Пол",
|
"config.sex": "Пол",
|
||||||
"config.sex.HIDE": "Скрыть",
|
"config.sex.HIDE": "Скрыть",
|
||||||
"config.sex.SHOW": "Показать",
|
"config.sex.SHOW": "Показать",
|
||||||
"head.source": "Источник данных",
|
"head.source": "Источник данных",
|
||||||
"name.unknown_name": "Неизвестно",
|
"name.unknown_name": "Неизвестно",
|
||||||
"extras.images": "Картинки",
|
"extras.images": "Картинки",
|
||||||
"extras.notes": "Примечание",
|
"extras.notes": "Примечание",
|
||||||
|
|||||||
@@ -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) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user