-
Notifications
You must be signed in to change notification settings - Fork 9
[data-explorer][m]: refactored to work with data explorer concept. #19
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
Conversation
anuveyatsu
commented
Aug 13, 2019
- update props of the App container
- update logic behind App container
- update fixtures to do dev with cosmos
- update unit tests
* update props of the App container * update logic behind App container * update fixtures to do dev with cosmos * update unit tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation looks good to me.
See my note about exporting the App component from the index file. I'm open to discuss.
src/index.js
Outdated
if (!response.ok) { | ||
file.descriptor.unavailable = true | ||
return | ||
const datapackage = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need to do this here. We can check this using cosmos or unit tests.
src/index.js
Outdated
.catch((error) => { | ||
console.warn('Failed to load a Dataset from provided datapackage id\n' + error) | ||
}) | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same. I think all of this can go.
src/index.js
Outdated
) | ||
}) | ||
} | ||
ReactDOM.render( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this either. I think we just need:
export default App
so that we can load this in the parent app (Data Explorer, for instance) like this:
import FilterUI from './components/FilterUI'
import DataView from 'datapackage-views'
import DataViewBuilder from './components/DataViewBuilder'
import { filterUIAction, fetchDataAction, dataViewBuilderAction } from './actions/';
export const App = props => {
return (
<div className="text-center ml-6">
<header>
<div className="container">
<h1 className="text-3xl">Data Explorer</h1>
</div>
</header>
<div className="container py-6 bg-pink-100">
<div className="">
<FilterUI {...props} />
</div>
</div>
<div className="container flex py-6 bg-yellow-100">
<div className="w-3/4 p-4 mr-4 overflow-x-auto">
<DataView {...props} />
</div>
<div className="w-1/4 p-4 mr-4 bg-green-100">
<DataViewBuilder {...props} />
</div>
</div>
</div>
)
}
We might then need to add a wrapper that includes this App for Datahub.io or Preview pages, but I think the module should just export the component.
* Add babel resources to package.json * Add `yarn build:package` command * Add updated resources at /dist
- includes fixtures for testing via cosmos
@starsinmypockets before merging this we need to make sure that other projects won't break, e.g., this library is now being used for several projects. |
…o display on click.
…ests. This means we aren't testing Chart compnent. Error details: ● Test suite failed to run TypeError: Cannot read property 'document' of undefined 1 | import React from 'react'; > 2 | import Plotly from 'plotly.js-basic-dist'; | ^ 3 | import createPlotlyComponent from "react-plotly.js/factory"; 4 | 5 | at document (node_modules/plotly.js-basic-dist/plotly-basic.js:667:26) at Object.7 (node_modules/plotly.js-basic-dist/plotly-basic.js:660:2) at call (node_modules/plotly.js-basic-dist/plotly-basic.js:7:631) at o (node_modules/plotly.js-basic-dist/plotly-basic.js:7:682) at Object._dereq_ (node_modules/plotly.js-basic-dist/plotly-basic.js:36595:10) at call (node_modules/plotly.js-basic-dist/plotly-basic.js:7:631) at o (node_modules/plotly.js-basic-dist/plotly-basic.js:7:682) at Object._dereq_ (node_modules/plotly.js-basic-dist/plotly-basic.js:10:11) at call (node_modules/plotly.js-basic-dist/plotly-basic.js:7:631) at o (node_modules/plotly.js-basic-dist/plotly-basic.js:7:682) at Object._dereq_ (node_modules/plotly.js-basic-dist/plotly-basic.js:34001:1) at call (node_modules/plotly.js-basic-dist/plotly-basic.js:7:631) at o (node_modules/plotly.js-basic-dist/plotly-basic.js:7:682) at Object._dereq_ (node_modules/plotly.js-basic-dist/plotly-basic.js:99:18) at call (node_modules/plotly.js-basic-dist/plotly-basic.js:7:631) at o (node_modules/plotly.js-basic-dist/plotly-basic.js:7:682) at Object._dereq_ (node_modules/plotly.js-basic-dist/plotly-basic.js:112:14) at call (node_modules/plotly.js-basic-dist/plotly-basic.js:7:631) at o (node_modules/plotly.js-basic-dist/plotly-basic.js:7:797) at node_modules/plotly.js-basic-dist/plotly-basic.js:7:367 at f (node_modules/plotly.js-basic-dist/plotly-basic.js:7:88) at Object.<anonymous> (node_modules/plotly.js-basic-dist/plotly-basic.js:7:1) at Object.<anonymous> (src/Chart.js:2:1) at Object.<anonymous> (src/App.js:6:1) at Object.<anonymous> (src/App.test.js:4:1)
…ps from tabular data.
…ng geometry field automatically
Table to Maps
…erty of leaflet which causes the tests to crash.
…nt instead of failing.
…ures to use it. Also updated the tests.