Skip to content

Commit

Permalink
Merge branch 'master' into tests/is-graph-acyclic
Browse files Browse the repository at this point in the history
  • Loading branch information
adriencanterot authored Dec 4, 2017
2 parents 1106e07 + 5c9b60e commit e54a878
Show file tree
Hide file tree
Showing 13 changed files with 597 additions and 9 deletions.
21 changes: 17 additions & 4 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"dependencies": {
"@blueprintjs/core": "^1.25.0",
"@types/chart.js": "^2.6.2",
"@types/csv-parse": "^1.1.11",
"@types/d3": "^4.10.0",
"@types/lodash": "^4.14.71",
"@types/node": "^8.0.16",
Expand All @@ -26,6 +27,7 @@
"chart.js": "^2.6.0",
"classnames": "^2.2.5",
"css-loader": "^0.28.4",
"csv-parse": "^2.0.0",
"d3": "^4.10.2",
"express": "^4.15.3",
"extract-text-webpack-plugin": "^3.0.0",
Expand Down
35 changes: 34 additions & 1 deletion app/src/application/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,39 @@ export function removeConcept(container: string, index: number): action {
}
}

export function testFetch(fileNames: string[], container: string, url: string): action {
return {
type: 'FETCH_TEST',
promise: (dispatch, getState) => {
dispatch(loading(container))

return Promise.all(fileNames.map((fileName: string) => {
return fetch(url + fileName)
.then((response: any) => {
return response.text()
})
.then((response: any) => {
dispatch(receivedTest(response, container, fileName))
}).catch((err: any) => {
dispatch(fetchFailed(err, container))
})
}))
},
container: container,
}
}

export function receivedTest(response: concept, container: string, fileName: string): action {
return {
type: 'FETCH_TEST_SUCCESS',
value: {
fileName,
response,
},
container: container,
}
}

export function fetchConcept(url: string, container: string, index: number=null): action {
return {
type: 'FETCH_CONCEPT',
Expand All @@ -38,7 +71,7 @@ export function fetchConcept(url: string, container: string, index: number=null)
}).then( (json: concept) => {
dispatch(receivedSlug(json, container, index))
}).catch( (err: any) => {
console.log(err);
console.log(err)
dispatch(fetchFailed(err, container))
})
},
Expand Down
29 changes: 29 additions & 0 deletions app/src/application/components/d3Blocks/sunburst.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@import '~@blueprintjs/core/dist/variables.less';

path {
stroke: @dark-gray4;
stroke-width: 2px;
stroke-opacity: 1;
}

#breadcrumb {
height: 18px;
font-size: 15px;
}
#info {
text-anchor: middle;

text {
fill: #e7e7e7;
}

#header {
alignment-baseline: baseline;
font-size: 18px;
}

#sub {
alignment-baseline: hanging;
font-size: 13px;
}
}
Loading

0 comments on commit e54a878

Please sign in to comment.