Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
SocialGouv
archifiltre
archifiltre-site
Commits
9e5e5f62
Unverified
Commit
9e5e5f62
authored
May 06, 2021
by
Benjamin Morali
Committed by
GitHub
May 06, 2021
Browse files
feat(stats): add date of start below map chart (#180)
parent
66fe18a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
39 deletions
+43
-39
src/components/statistics/statistic-mapchart.tsx
src/components/statistics/statistic-mapchart.tsx
+42
-38
src/display-data/statistics.ts
src/display-data/statistics.ts
+1
-1
No files found.
src/components/statistics/statistic-mapchart.tsx
View file @
9e5e5f62
import
Box
from
"
@material-ui/core/Box
"
;
import
{
Theme
}
from
"
@material-ui/core/styles
"
;
import
{
PaletteColor
}
from
"
@material-ui/core/styles/createPalette
"
;
import
Tooltip
from
"
@material-ui/core/Tooltip
"
;
...
...
@@ -42,44 +43,47 @@ const StatisticMapChart: FC<StatisticMapChartProps> = ({ statistic }) => {
const
countries
=
statistic
.
value
;
const
colorGetter
=
getCountryColor
(
countries
,
primary
);
return
(
<
ComposableMap
height
=
{
400
}
projectionConfig
=
{
{
scale
:
150
}
}
>
<
Geographies
geography
=
{
geoUrl
}
>
{
({
geographies
}:
any
)
=>
geographies
.
map
((
geo
:
any
)
=>
(
<
Tooltip
title
=
{
tooltipContent
}
key
=
{
geo
.
rsmKey
}
>
<
g
>
<
Geography
geography
=
{
geo
}
onMouseEnter
=
{
()
=>
{
const
{
NAME
}
=
geo
.
properties
;
const
countryValue
=
findCountryValue
(
countries
,
geo
.
properties
.
ISO_A2
);
setTooltipContent
(
`
${
NAME
}
:
${
countryValue
||
0
}
utilisation(s)`
);
}
}
onMouseLeave
=
{
()
=>
{
setTooltipContent
(
""
);
}
}
style
=
{
{
default
:
{
fill
:
colorGetter
(
geo
),
outline
:
"
none
"
,
},
hover
:
{
fill
:
primary
.
main
,
outline
:
"
none
"
,
},
}
}
/>
</
g
>
</
Tooltip
>
))
}
</
Geographies
>
</
ComposableMap
>
<
Box
>
<
ComposableMap
height
=
{
400
}
projectionConfig
=
{
{
scale
:
150
}
}
>
<
Geographies
geography
=
{
geoUrl
}
>
{
({
geographies
}:
any
)
=>
geographies
.
map
((
geo
:
any
)
=>
(
<
Tooltip
title
=
{
tooltipContent
}
key
=
{
geo
.
rsmKey
}
>
<
g
>
<
Geography
geography
=
{
geo
}
onMouseEnter
=
{
()
=>
{
const
{
NAME
}
=
geo
.
properties
;
const
countryValue
=
findCountryValue
(
countries
,
geo
.
properties
.
ISO_A2
);
setTooltipContent
(
`
${
NAME
}
:
${
countryValue
||
0
}
utilisation(s)`
);
}
}
onMouseLeave
=
{
()
=>
{
setTooltipContent
(
""
);
}
}
style
=
{
{
default
:
{
fill
:
colorGetter
(
geo
),
outline
:
"
none
"
,
},
hover
:
{
fill
:
primary
.
main
,
outline
:
"
none
"
,
},
}
}
/>
</
g
>
</
Tooltip
>
))
}
</
Geographies
>
</
ComposableMap
>
<
Box
textAlign
=
"center"
>
{
statistic
.
label
}
</
Box
>
</
Box
>
);
};
...
...
src/display-data/statistics.ts
View file @
9e5e5f62
...
...
@@ -70,7 +70,7 @@ export const statisticsLayout: StatisticsGroup[] = [
{
field
:
"
visitorCountries
"
,
formatting
:
Formatting
.
MAPCHART
,
label
:
""
,
label
:
"
(depuis le 1er janvier 2020)
"
,
type
:
"
simple
"
,
},
],
...
...
Social Groovy Bot
🤖
@SocialGroovyBot
mentioned in commit
e0b18809
·
May 06, 2021
mentioned in commit
e0b18809
mentioned in commit e0b188097d6abd21bdd97e7ed11abfbb7dd8257d
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment