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

Load local file #43

Merged
merged 5 commits into from
Mar 12, 2018
Merged

Load local file #43

merged 5 commits into from
Mar 12, 2018

Conversation

jwildfire
Copy link
Contributor

closes #40

@jwildfire jwildfire added this to the v0.7.0 milestone Feb 12, 2018
@jwildfire jwildfire self-assigned this Feb 12, 2018
@jwildfire jwildfire added this to To do in v0.7.0 via automation Feb 12, 2018
@jwildfire jwildfire moved this from To do to In progress in v0.7.0 Feb 12, 2018
@jwildfire jwildfire changed the base branch from master to v0.7.0-dev February 12, 2018 18:04
@jwildfire jwildfire moved this from In progress to Code Review in v0.7.0 Feb 12, 2018
Copy link
Contributor

@samussiah samussiah left a comment

Choose a reason for hiding this comment

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

Love the new functionality! Left a few nitpicky comments but overall everything works great. Attaching all the control containers to the controls object is a nice refactor too.

@@ -7,12 +7,12 @@ export function renderChart(cat) {
cat.settings.sync(cat);
//render the new chart with the current settings
var dataFile = cat.controls.dataFileSelect.node().value;
var dataFilePath = cat.config.dataURL + dataFile;
var dataObject = cat.config.dataFiles.find(f => f.label == dataFile);
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in hotfixes branch.


cat.controls.bootstrapButton = settingsSection
cat.controls.bootstrapButton = cat.controls.environmentWrap
.append("button")
.text("Load Bootstrap")
.on("click", function() {
loadBootstrap(cat);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is calling loadRenderer() but not clearing out the current chart. Does the chart need to be re-rendered?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe ... but initBoostrapConfig.js goes away in favor of a more generalized approach in a downstream PR, so not going to worry about it ;)

.attr("type", "file")
.attr("class", "file-load-input")
.on("change", function() {
if (this.value.slice(-4) == ".csv") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe toLowerCase() this just to cover all the bases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in hotfixes branch.

fr.onload = function(e) {
//make sure the file is a csv

//make an object for the file
Copy link
Contributor

Choose a reason for hiding this comment

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

Very cool.


//make an object for the file
var dataObject = {
label: files[0].name + " (loaded by user)",
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps check the label against the current set of labels and add a (1) or something so the user can upload two files with the same name, like when they're editing the same data file to test edge cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added timestamp to distinguish duplicates in hotfixes branch

? { label: df, path: cat.config.dataURL, user_loaded: false }
: df;
});
console.log(cat.config.dataFiles);
Copy link
Contributor

Choose a reason for hiding this comment

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

stray clog

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned up in downstream PR

@jwildfire
Copy link
Contributor Author

Thanks for the nice review @samussiah. Fixed the review comments in a new hotfixes branch to avoid merge conflicts. Merging this to dev.

@jwildfire jwildfire merged commit 57e3211 into v0.7.0-dev Mar 12, 2018
v0.7.0 automation moved this from Code Review to Done Mar 12, 2018
@samussiah samussiah deleted the load-local-file branch March 12, 2018 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v0.7.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants