mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
Export metrics components.
Some checks failed
Node.js CI / build (postgresql, 18.18) (push) Has been cancelled
Some checks failed
Node.js CI / build (postgresql, 18.18) (push) Has been cancelled
This commit is contained in:
parent
c4114f4349
commit
dc1736458b
16 changed files with 140 additions and 126 deletions
|
|
@ -1,7 +1,6 @@
|
|||
import { FloatingTooltip, Column, useTheme, ColumnProps } from '@umami/react-zen';
|
||||
import { useState, useMemo } from 'react';
|
||||
import { ComposableMap, Geographies, Geography, ZoomableGroup } from 'react-simple-maps';
|
||||
import classNames from 'classnames';
|
||||
import { colord } from 'colord';
|
||||
import { ISO_COUNTRIES, MAP_FILE } from '@/lib/constants';
|
||||
import {
|
||||
|
|
@ -12,7 +11,6 @@ import {
|
|||
} from '@/components/hooks';
|
||||
import { formatLongNumber } from '@/lib/format';
|
||||
import { percentFilter } from '@/lib/filters';
|
||||
import styles from './WorldMap.module.css';
|
||||
import { getThemeColors } from '@/lib/colors';
|
||||
|
||||
export interface WorldMapProps extends ColumnProps {
|
||||
|
|
@ -20,7 +18,7 @@ export interface WorldMapProps extends ColumnProps {
|
|||
data?: any[];
|
||||
}
|
||||
|
||||
export function WorldMap({ websiteId, data, className, ...props }: WorldMapProps) {
|
||||
export function WorldMap({ websiteId, data, ...props }: WorldMapProps) {
|
||||
const [tooltip, setTooltipPopup] = useState();
|
||||
const { theme } = useTheme();
|
||||
const { colors } = getThemeColors(theme);
|
||||
|
|
@ -67,12 +65,7 @@ export function WorldMap({ websiteId, data, className, ...props }: WorldMapProps
|
|||
};
|
||||
|
||||
return (
|
||||
<Column
|
||||
{...props}
|
||||
className={classNames(styles.container, className)}
|
||||
data-tip=""
|
||||
data-for="world-map-tooltip"
|
||||
>
|
||||
<Column {...props} data-tip="" data-for="world-map-tooltip" style={{ margin: 'auto 0' }}>
|
||||
<ComposableMap projection="geoMercator">
|
||||
<ZoomableGroup zoom={0.8} minZoom={0.7} center={[0, 40]}>
|
||||
<Geographies geography={`${process.env.basePath || ''}${MAP_FILE}`}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue