Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajout de prettier+husky pour reformater sur commit #49

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parserOptions:
rules:
indent:
- error
- 4
- 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...
tiens, un changement ^^

linebreak-style:
- error
- unix
Expand Down
20 changes: 11 additions & 9 deletions client/js/components/AggregatedInstructionViz.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import React from 'react'
import React from 'react';
import Sunburst from './Sunburst';

import hierarchicalM52 from '../finance/hierarchicalM52.js';

export default function(props){
const hierarchicalData = hierarchicalM52(props.M52Instruction);
export default function(props) {
const hierarchicalData = hierarchicalM52(props.M52Instruction);

return React.createElement('div', {},
React.createElement('h1', {}, hierarchicalData.name),
React.createElement('h2', {}, hierarchicalData.total.toFixed(2)),
React.createElement(Sunburst, { hierarchicalData })
);
}
return React.createElement(
'div',
{},
React.createElement('h1', {}, hierarchicalData.name),
React.createElement('h2', {}, hierarchicalData.total.toFixed(2)),
React.createElement(Sunburst, { hierarchicalData })
);
}
104 changes: 66 additions & 38 deletions client/js/components/AggregatedViz.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import React from 'react';

import Sunburst from './Sunburst';
import TextualAggregated from './TextualAggregated';
import hierarchicalAggregated from '../finance/hierarchicalAggregated.js';
import {PAR_PUBLIC_VIEW, PAR_PRESTATION_VIEW} from '../finance/constants';
import { PAR_PUBLIC_VIEW, PAR_PRESTATION_VIEW } from '../finance/constants';

/*

Expand All @@ -13,41 +13,69 @@ interface AggregatedViZProps{
}

*/
export default function({
aggregatedHierarchical, aggregatedHighlightedNodes, selectedNode,
rdfi, dfView,
onSliceOvered, onSliceSelected, onAggregatedDFViewChange
}){
const rdfiId = rdfi.rd + rdfi.fi;
export default function(
{
aggregatedHierarchical,
aggregatedHighlightedNodes,
selectedNode,
rdfi,
dfView,
onSliceOvered,
onSliceSelected,
onAggregatedDFViewChange
}
) {
const rdfiId = rdfi.rd + rdfi.fi;

return React.createElement('div', {},
React.createElement('h1', {}, 'Instruction agrégée'),
(rdfiId === 'DF' ? React.createElement(
'div',
{
className: 'view-selector',
onChange: e => {
onAggregatedDFViewChange(e.currentTarget.querySelector('input[type="radio"][name="view"]:checked').value)
}
},
React.createElement('label', {},
'Actions par public ',
React.createElement('input',
{name: 'view', value: PAR_PUBLIC_VIEW, type: "radio", defaultChecked: dfView === PAR_PUBLIC_VIEW}
)
),
React.createElement('label', {},
'Actions par prestation ',
React.createElement('input',
{name: 'view', value: PAR_PRESTATION_VIEW, type: "radio", defaultChecked: dfView === PAR_PRESTATION_VIEW}
)
)
) : undefined),
React.createElement(Sunburst, {
hierarchicalData: aggregatedHierarchical,
highlightedNodes: aggregatedHighlightedNodes, selectedNode,
donutWidth: 55, outerRadius: 120,
onSliceOvered, onSliceSelected
})
);
return React.createElement(
'div',
{},
React.createElement('h1', {}, 'Instruction agrégée'),
rdfiId === 'DF'
? React.createElement(
'div',
{
className: 'view-selector',
onChange: e => {
onAggregatedDFViewChange(
e.currentTarget.querySelector(
'input[type="radio"][name="view"]:checked'
).value
);
}
},
React.createElement(
'label',
{},
'Actions par public ',
React.createElement('input', {
name: 'view',
value: PAR_PUBLIC_VIEW,
type: 'radio',
defaultChecked: dfView === PAR_PUBLIC_VIEW
})
),
React.createElement(
'label',
{},
'Actions par prestation ',
React.createElement('input', {
name: 'view',
value: PAR_PRESTATION_VIEW,
type: 'radio',
defaultChecked: dfView === PAR_PRESTATION_VIEW
})
)
)
: undefined,
React.createElement(Sunburst, {
hierarchicalData: aggregatedHierarchical,
highlightedNodes: aggregatedHighlightedNodes,
selectedNode,
donutWidth: 55,
outerRadius: 120,
onSliceOvered,
onSliceSelected
})
);
}
36 changes: 22 additions & 14 deletions client/js/components/M52Viz.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React from 'react';
import Sunburst from './Sunburst';

/*
Expand All @@ -9,17 +9,25 @@ interface M52VizProps{

*/

export default function({
M52Hierarchical, M52HighlightedNodes, selectedNode,
onSliceOvered, onSliceSelected
}){

return React.createElement('div', {},
React.createElement('h1', {}, "Instruction M52"),
React.createElement(Sunburst, {
hierarchicalData: M52Hierarchical,
highlightedNodes: M52HighlightedNodes, selectedNode,
onSliceOvered, onSliceSelected
})
);
export default function(
{
M52Hierarchical,
M52HighlightedNodes,
selectedNode,
onSliceOvered,
onSliceSelected
}
) {
return React.createElement(
'div',
{},
React.createElement('h1', {}, 'Instruction M52'),
React.createElement(Sunburst, {
hierarchicalData: M52Hierarchical,
highlightedNodes: M52HighlightedNodes,
selectedNode,
onSliceOvered,
onSliceSelected
})
);
}
124 changes: 76 additions & 48 deletions client/js/components/RDFISelector.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react'
import React from 'react';

/*

Expand All @@ -9,52 +9,80 @@ interface RDFISelector{

*/

export default class RDFISelector extends React.PureComponent{
render(){
const { rdfi, onRDFIChange } = this.props;
return React.createElement(
'div',
{
className: 'rdfi',
style: {
padding: "1em"
},
onChange: e => {
onRDFIChange({
rd: e.currentTarget.querySelector('input[type="radio"][name="rd"]:checked').value,
fi: e.currentTarget.querySelector('input[type="radio"][name="fi"]:checked').value
})
}
},
React.createElement('span', {}, 'Répartition des'),
React.createElement('div', {className: 'selector'},
React.createElement('label', {},
'dépenses',
React.createElement('input',
{name: 'rd', value: "D", type: "radio", defaultChecked: rdfi['rd'] === 'D'}
)
),
React.createElement('label', {},
'recettes',
React.createElement('input',
{name: 'rd', value: "R", type: "radio", defaultChecked: rdfi['rd'] === 'R'}
)
)
),
React.createElement('div', {className: 'selector'},
React.createElement('label', {},
'de fonctionnement',
React.createElement('input',
{name: 'fi', value: "F", type:"radio", defaultChecked: rdfi['fi'] === 'F'}
)
),
React.createElement('label', {},
"d'investissement",
React.createElement('input',
{name: 'fi', value: "I", type:"radio", defaultChecked: rdfi['fi'] === 'I'}
)
)
)
export default class RDFISelector extends React.PureComponent {
render() {
const { rdfi, onRDFIChange } = this.props;
return React.createElement(
'div',
{
className: 'rdfi',
style: {
padding: '1em'
},
onChange: e => {
onRDFIChange({
rd: e.currentTarget.querySelector(
'input[type="radio"][name="rd"]:checked'
).value,
fi: e.currentTarget.querySelector(
'input[type="radio"][name="fi"]:checked'
).value
});
}
},
React.createElement('span', {}, 'Répartition des'),
React.createElement(
'div',
{ className: 'selector' },
React.createElement(
'label',
{},
'dépenses',
React.createElement('input', {
name: 'rd',
value: 'D',
type: 'radio',
defaultChecked: rdfi['rd'] === 'D'
})
),
React.createElement(
'label',
{},
'recettes',
React.createElement('input', {
name: 'rd',
value: 'R',
type: 'radio',
defaultChecked: rdfi['rd'] === 'R'
})
)
}
),
React.createElement(
'div',
{ className: 'selector' },
React.createElement(
'label',
{},
'de fonctionnement',
React.createElement('input', {
name: 'fi',
value: 'F',
type: 'radio',
defaultChecked: rdfi['fi'] === 'F'
})
),
React.createElement(
'label',
{},
"d'investissement",
React.createElement('input', {
name: 'fi',
value: 'I',
type: 'radio',
defaultChecked: rdfi['fi'] === 'I'
})
)
)
);
}
}
Loading