Skip to content

Commit

Permalink
Merge pull request #67 from medialab/viz-fraude
Browse files Browse the repository at this point in the history
Viz fraude
  • Loading branch information
Myllaume authored Jun 20, 2022
2 parents df61253 + ce26bfd commit ae49ee8
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 35 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,8 @@
"repository": "https://github.com/medialab/portic-storymaps-2022",
"author": "Guillaume Brioudes (https://myllaume.fr/)",
"license": "GPL-3.0-or-later",
"homepage": "https://medialab.github.io/portic-storymaps-2022"
"homepage": "https://medialab.github.io/portic-storymaps-2022",
"reactSnap": {
"fixWebpackChunksIssue": false
}
}
75 changes: 41 additions & 34 deletions src/visualizations/FraudeExportPortFranc/FraudeExportPortFranc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import React, { useMemo } from "react"

import AlluvialImportExport from "../../components/AlluvialImportExport";

import './FraudeExportPortFranc.scss';

export default function FraudeExportPortFranc({
data: inputData,
dimensions,
...props
}) {
const { width, height } = dimensions;
const margin = 40;

/** @type {Object[]} */
const data = useMemo(function prepareData() {
Expand All @@ -25,44 +28,48 @@ export default function FraudeExportPortFranc({
return (
<>
<div
style={{
display: 'flex'
}}
className='FraudeExportPortFranc-row'
>
<AlluvialImportExport
dimensions={{
width: width / 2,
height: height / 2
}}
data={data.filter(({ port }) => port === 'Dunkerque')}
/>
<AlluvialImportExport
dimensions={{
width: width / 2,
height: height / 2
}}
data={data.filter(({ port }) => port === 'Marseille')}
/>
<div>
<AlluvialImportExport
dimensions={{
width: (width / 2) - margin,
height: (height / 2) - margin
}}
data={data.filter(({ port }) => port === 'Dunkerque')}
/>
</div>
<div>
<AlluvialImportExport
dimensions={{
width: (width / 2) - margin,
height: (height / 2) - margin
}}
data={data.filter(({ port }) => port === 'Marseille')}
/>
</div>
</div>
<div
style={{
display: 'flex'
}}
className='FraudeExportPortFranc-row'
>
<AlluvialImportExport
dimensions={{
width: width / 2,
height: height / 2
}}
data={data.filter(({ port }) => port === 'Lorient')}
/>
<AlluvialImportExport
dimensions={{
width: width / 2,
height: height / 2
}}
data={data.filter(({ port }) => port === 'Bayonne')}
/>
<div>
<AlluvialImportExport
dimensions={{
width: (width / 2) - margin,
height: (height / 2) - margin
}}
data={data.filter(({ port }) => port === 'Lorient')}
/>
</div>
<div>
<AlluvialImportExport
dimensions={{
width: (width / 2) - margin,
height: (height / 2) - margin
}}
data={data.filter(({ port }) => port === 'Bayonne')}
/>
</div>
</div>
</>
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.FraudeExportPortFranc-row {
display: flex;

div {
margin: 20px;
}
}

0 comments on commit ae49ee8

Please sign in to comment.